@@ -108,6 +108,12 @@ AC_ARG_ENABLE([lcov],
108108 [ use_lcov=yes] ,
109109 [ use_lcov=no] )
110110
111+ AC_ARG_ENABLE ( [ glibc-back-compat] ,
112+ [ AS_HELP_STRING ( [ --enable-glibc-back-compat] ,
113+ [ enable backwards compatibility with glibc and libstdc++] ) ] ,
114+ [ use_glibc_compat=$enableval] ,
115+ [ use_glibc_compat=no] )
116+
111117AC_ARG_WITH ( [ protoc-bindir] ,[ AS_HELP_STRING ( [ --with-protoc-bindir=BIN_DIR] ,[ specify protoc bin path] ) ] , [ protoc_bin_path=$withval] , [ ] )
112118
113119
319325
320326AX_CHECK_LINK_FLAG ( [ [ -Wl,--large-address-aware] ] , [ LDFLAGS="$LDFLAGS -Wl,--large-address-aware"] )
321327
328+ if test x$use_glibc_compat != xno; then
329+
330+ # __fdelt_chk's params and return type have changed from long unsigned int to long int.
331+ # See which one is present here.
332+ AC_MSG_CHECKING ( __fdelt_chk type )
333+ AC_TRY_COMPILE ( [ #define __USE_FORTIFY_LEVEL 2
334+ #include <sys/select.h>
335+ extern "C" long unsigned int __fdelt_warn(long unsigned int);] ,[ ] ,
336+ [ fdelt_type="long unsigned int"] ,
337+ [ fdelt_type="long int"] )
338+ AC_MSG_RESULT ( $fdelt_type )
339+ AC_DEFINE_UNQUOTED ( FDELT_TYPE , $fdelt_type ,[ parameter and return value type for __fdelt_chk] )
340+
341+ fi
342+
322343if test x$use_hardening != xno; then
323344 AX_CHECK_COMPILE_FLAG ( [ -Wstack-protector] ,[ HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"] )
324345 AX_CHECK_COMPILE_FLAG ( [ -fstack-protector-all] ,[ HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"] )
@@ -691,6 +712,7 @@ AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
691712AM_CONDITIONAL([ USE_LCOV] ,[ test x$use_lcov == xyes] )
692713AM_CONDITIONAL([ USE_COMPARISON_TOOL] ,[ test x$use_comparison_tool != xno] )
693714AM_CONDITIONAL([ USE_COMPARISON_TOOL_REORG_TESTS] ,[ test x$use_comparison_tool_reorg_test != xno] )
715+ AM_CONDITIONAL([ GLIBC_BACK_COMPAT] ,[ test x$use_glibc_compat = xyes] )
694716
695717AC_DEFINE ( CLIENT_VERSION_MAJOR , _CLIENT_VERSION_MAJOR , [ Major version] )
696718AC_DEFINE ( CLIENT_VERSION_MINOR , _CLIENT_VERSION_MINOR , [ Minor version] )
0 commit comments