@@ -108,6 +108,12 @@ AC_ARG_ENABLE([lcov],
108
108
[ use_lcov=yes] ,
109
109
[ use_lcov=no] )
110
110
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
+
111
117
AC_ARG_WITH ( [ protoc-bindir] ,[ AS_HELP_STRING ( [ --with-protoc-bindir=BIN_DIR] ,[ specify protoc bin path] ) ] , [ protoc_bin_path=$withval] , [ ] )
112
118
113
119
319
325
320
326
AX_CHECK_LINK_FLAG ( [ [ -Wl,--large-address-aware] ] , [ LDFLAGS="$LDFLAGS -Wl,--large-address-aware"] )
321
327
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
+
322
343
if test x$use_hardening != xno; then
323
344
AX_CHECK_COMPILE_FLAG ( [ -Wstack-protector] ,[ HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"] )
324
345
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])
691
712
AM_CONDITIONAL([ USE_LCOV] ,[ test x$use_lcov == xyes] )
692
713
AM_CONDITIONAL([ USE_COMPARISON_TOOL] ,[ test x$use_comparison_tool != xno] )
693
714
AM_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] )
694
716
695
717
AC_DEFINE ( CLIENT_VERSION_MAJOR , _CLIENT_VERSION_MAJOR , [ Major version] )
696
718
AC_DEFINE ( CLIENT_VERSION_MINOR , _CLIENT_VERSION_MINOR , [ Minor version] )
0 commit comments