PennMUSH 1.8.3p9 configure.ac changes
authorRick L Bird <nveid@yahoo.com>
Sat, 23 Apr 2011 03:32:40 +0000 (23:32 -0400)
committerRick L Bird <nveid@yahoo.com>
Sat, 23 Apr 2011 03:32:40 +0000 (23:32 -0400)
configure.ac
src/help.c

index 8086f714eaf8cc6bbacbb2d6473767c62ddc4c16..455906c4250901d89341d3d1b3392c18cdba59dd 100644 (file)
@@ -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 <fcntl.h>
+
+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 <fcntl.h>
+
+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
index efc269dfe673e908657112c98dc76aa3fa0eb317..df932d804a9afeef24bca6bcf7f5bbcfa7d992a7 100644 (file)
@@ -6,6 +6,7 @@
  *
  */
 #include "config.h"
+#define _XOPEN_SOURCE 600
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>