From ef5d0ba6b1b00ffc5e0c1dbb9b31da9602207393 Mon Sep 17 00:00:00 2001 From: Rick L Bird Date: Fri, 22 Apr 2011 23:32:40 -0400 Subject: [PATCH] PennMUSH 1.8.3p9 configure.ac changes --- configure.ac | 60 ++++++++++++++++++++++++++++++++++++++++++---------- src/help.c | 1 + 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 8086f71..455906c 100644 --- a/configure.ac +++ b/configure.ac @@ -93,13 +93,18 @@ esac AX_GCC_OPTION([-fstack-protector], [], [], [ CFLAGS="$CFLAGS -fstack-protector" ], []) -AX_LD_CHECK_FLAG([-Wl,-z,noexecstack], [], [], [ - LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" -], []) -AX_LD_CHECK_FLAG([-Wa,--noexecstack], [], [], [ - CFLAGS="$CFLAGS -Wa,--noexecstack" -], []) - +case "${build_os}" in + *linux*) + # These might be linux-specific and aren't always caught as not + # supported by configure + AX_LD_CHECK_FLAG([-Wl,-z,noexecstack], [], [], [ + LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" + ], []) + AX_LD_CHECK_FLAG([-Wa,--noexecstack], [], [], [ + CFLAGS="$CFLAGS -Wa,--noexecstack" + ], []) + ;; +esac if test "${CTAGS+set}" != "set" -a "${EXCTAGS+set}" = "set"; then @@ -264,7 +269,40 @@ AC_CHECK_FUNCS([cbrt log2 round imaxdiv]) AC_CHECK_FUNCS([getuid geteuid seteuid getpriority setpriority]) AC_CHECK_FUNCS([socketpair sigaction sigprocmask posix_memalign writev]) AC_CHECK_FUNCS([fcntl pselect poll ppoll pollts kqueue epoll_ctl inotify_init]) -AC_CHECK_FUNCS([pread pwrite posix_fadvise posix_fallocate]) +AC_CHECK_FUNCS([pread pwrite]) +# Some linux OSes (Old redhat, others?) will see these functions +# through an AC_CHECK_FUNCS but not when it comes time to actually use +# them in source. +AC_MSG_CHECKING([for posix_fallocate]) +AC_LINK_IFELSE([ +#define _XOPEN_SOURCE 600 +#include + +int +main(void) +{ + posix_fallocate(0, 0, 100); + return 0; +} +], +[AC_MSG_RESULT(yes)] +[AC_DEFINE(HAVE_POSIX_FALLOCATE)], +AC_MSG_RESULT(no)) +AC_MSG_CHECKING([for posix_fadvise and associated constants]) +AC_LINK_IFELSE([ +#define _XOPEN_SOURCE 600 +#include + +int +main(void) +{ + posix_fadvise(0, 0, 0, POSIX_FADV_SEQUENTIAL); + return 0; +} +], +[AC_MSG_RESULT(yes)] +[AC_DEFINE(HAVE_POSIX_FADVISE)], +AC_MSG_RESULT(no)) AC_FUNC_SNPRINTF if test "x$ac_cv_have_working_snprintf" = xyes; then @@ -406,13 +444,13 @@ echo "* PCRE: $which_pcre" if test "$enable_sql" = yes; then sql_servers="" if test "$found_mysql" = yes; then - sql_servers+="MySQL " + sql_servers="MySQL " fi if test "$found_postgresql" = yes; then - sql_servers+="Postgres " + sql_servers="${sql_servers} Postgres " fi if test "$found_sqlite" = yes; then - sql_servers+="Sqlite3 " + sql_servers="${sql_servers} Sqlite3 " fi echo "* SQL support: ${sql_servers:-No}" else diff --git a/src/help.c b/src/help.c index efc269d..df932d8 100644 --- a/src/help.c +++ b/src/help.c @@ -6,6 +6,7 @@ * */ #include "config.h" +#define _XOPEN_SOURCE 600 #include #include #include -- 2.30.2