diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 166 |
1 files changed, 140 insertions, 26 deletions
diff --git a/configure b/configure index 9f0018b3906..1ea28a0d67d 100755 --- a/configure +++ b/configure @@ -5383,6 +5383,98 @@ if test x"$pgac_cv_prog_CC_cflags__Werror_vla" = x"yes"; then fi + # On macOS, complain about usage of symbols newer than the deployment target + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Werror=unguarded-availability-new, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Werror=unguarded-availability-new, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Werror_unguarded_availability_new+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Werror=unguarded-availability-new" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Werror_unguarded_availability_new=yes +else + pgac_cv_prog_CC_cflags__Werror_unguarded_availability_new=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Werror_unguarded_availability_new" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Werror_unguarded_availability_new" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Werror_unguarded_availability_new" = x"yes"; then + CFLAGS="${CFLAGS} -Werror=unguarded-availability-new" +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -Werror=unguarded-availability-new, for CXXFLAGS" >&5 +$as_echo_n "checking whether ${CXX} supports -Werror=unguarded-availability-new, for CXXFLAGS... " >&6; } +if ${pgac_cv_prog_CXX_cxxflags__Werror_unguarded_availability_new+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CXXFLAGS=$CXXFLAGS +pgac_save_CXX=$CXX +CXX=${CXX} +CXXFLAGS="${CXXFLAGS} -Werror=unguarded-availability-new" +ac_save_cxx_werror_flag=$ac_cxx_werror_flag +ac_cxx_werror_flag=yes +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + pgac_cv_prog_CXX_cxxflags__Werror_unguarded_availability_new=yes +else + pgac_cv_prog_CXX_cxxflags__Werror_unguarded_availability_new=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_cxx_werror_flag=$ac_save_cxx_werror_flag +CXXFLAGS="$pgac_save_CXXFLAGS" +CXX="$pgac_save_CXX" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__Werror_unguarded_availability_new" >&5 +$as_echo "$pgac_cv_prog_CXX_cxxflags__Werror_unguarded_availability_new" >&6; } +if test x"$pgac_cv_prog_CXX_cxxflags__Werror_unguarded_availability_new" = x"yes"; then + CXXFLAGS="${CXXFLAGS} -Werror=unguarded-availability-new" +fi + + # -Wvla is not applicable for C++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wendif-labels, for CFLAGS" >&5 @@ -15931,6 +16023,54 @@ cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRNLEN $ac_have_decl _ACEOF + +# We can't use AC_REPLACE_FUNCS to replace these functions, because it +# won't handle deployment target restrictions on macOS +ac_fn_c_check_decl "$LINENO" "preadv" "ac_cv_have_decl_preadv" "#include <sys/uio.h> +" +if test "x$ac_cv_have_decl_preadv" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PREADV $ac_have_decl +_ACEOF +if test $ac_have_decl = 1; then : + +else + case " $LIBOBJS " in + *" preadv.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS preadv.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_decl "$LINENO" "pwritev" "ac_cv_have_decl_pwritev" "#include <sys/uio.h> +" +if test "x$ac_cv_have_decl_pwritev" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PWRITEV $ac_have_decl +_ACEOF +if test $ac_have_decl = 1; then : + +else + case " $LIBOBJS " in + *" pwritev.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS pwritev.$ac_objext" + ;; +esac + +fi + + # This is probably only present on macOS, but may as well check always ac_fn_c_check_decl "$LINENO" "F_FULLFSYNC" "ac_cv_have_decl_F_FULLFSYNC" "#include <fcntl.h> " @@ -16144,19 +16284,6 @@ esac fi -ac_fn_c_check_func "$LINENO" "preadv" "ac_cv_func_preadv" -if test "x$ac_cv_func_preadv" = xyes; then : - $as_echo "#define HAVE_PREADV 1" >>confdefs.h - -else - case " $LIBOBJS " in - *" preadv.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS preadv.$ac_objext" - ;; -esac - -fi - ac_fn_c_check_func "$LINENO" "pwrite" "ac_cv_func_pwrite" if test "x$ac_cv_func_pwrite" = xyes; then : $as_echo "#define HAVE_PWRITE 1" >>confdefs.h @@ -16170,19 +16297,6 @@ esac fi -ac_fn_c_check_func "$LINENO" "pwritev" "ac_cv_func_pwritev" -if test "x$ac_cv_func_pwritev" = xyes; then : - $as_echo "#define HAVE_PWRITEV 1" >>confdefs.h - -else - case " $LIBOBJS " in - *" pwritev.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS pwritev.$ac_objext" - ;; -esac - -fi - ac_fn_c_check_func "$LINENO" "random" "ac_cv_func_random" if test "x$ac_cv_func_random" = xyes; then : $as_echo "#define HAVE_RANDOM 1" >>confdefs.h |