diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-04-09 09:09:35 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-04-09 09:09:35 +0000 |
commit | 1260d294ed795011b5b73284e308a6a01d9eef9e (patch) | |
tree | 6663a0ae44f8ac7d830598311411843401f129a1 /configure.in | |
parent | 28532995686a5315ddf0ad6557ae00cb2fe76206 (diff) | |
download | hercules-1260d294ed795011b5b73284e308a6a01d9eef9e.tar.gz hercules-1260d294ed795011b5b73284e308a6a01d9eef9e.tar.bz2 hercules-1260d294ed795011b5b73284e308a6a01d9eef9e.tar.xz hercules-1260d294ed795011b5b73284e308a6a01d9eef9e.zip |
* Merged changes from trunk [14742:14782/trunk].
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/renewal@14783 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 63 |
1 files changed, 59 insertions, 4 deletions
diff --git a/configure.in b/configure.in index afc35ee3a..6407cda1b 100644 --- a/configure.in +++ b/configure.in @@ -318,7 +318,24 @@ OLD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wno-pointer-sign" AC_COMPILE_IFELSE( [int foo;], - [AC_MSG_RESULT([yes])], + [ + AC_MSG_RESULT([yes]) + AC_MSG_CHECKING([whether $CC can actually use -Wno-pointer-sign]) + # This option causes warnings in C++ mode + # Note: -Werror must be before -Wno-pointer-sign, otherwise it does not do anything + CFLAGS="$OLD_CFLAGS -Werror -Wno-pointer-sign" + AC_COMPILE_IFELSE( + [int foo;], + [ + AC_MSG_RESULT([yes]) + CFLAGS="$OLD_CFLAGS -Wno-pointer-sign" + ], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + ] + ) + ], [ AC_MSG_RESULT([no]) CFLAGS="$OLD_CFLAGS" @@ -555,13 +572,51 @@ AC_CHECK_HEADER([zlib.h], [], [AC_MSG_ERROR([zlib header not found, please speci # # math library (required) # -AC_CHECK_LIB([m], [sqrt], [], [AC_MSG_ERROR([math library not found... stopping])]) +AC_SEARCH_LIBS([sqrt], [m], [], [AC_MSG_ERROR([math library not found... stopping])]) # -# clock_gettime (rt on Debian) +# clock_gettime (optional, rt on Debian) +# +AC_SEARCH_LIBS([clock_gettime], [rt]) + + # -AC_CHECK_LIB([rt], [clock_gettime]) +# CLOCK_MONOTONIC clock for clock_gettime +# Normally defines _POSIX_TIMERS > 0 and _POSIX_MONOTONIC_CLOCK (for posix +# compliant systems) and __FreeBSD_cc_version >= 500005 (for FreeBSD +# >= 5.1.0, which does not have the posix defines (ref. r11983)) would be +# checked but some systems define them even when they do not support it +# (ref. bugreport:1003). +# +if test "$ac_cv_search_clock_gettime" != "no" ; then + AC_MSG_CHECKING([whether CLOCK_MONOTONIC is supported and works]) + AC_RUN_IFELSE( + [ + #include <sys/time.h> + #include <time.h> + #include <unistd.h> + + int main(int argc, char** argv) + { + struct timespec tval; + return clock_gettime(CLOCK_MONOTONIC, &tval); + } + ], + [ + AC_MSG_RESULT([yes]) + CFLAGS="$CFLAGS -DHAVE_MONOTONIC_CLOCK" + ], + [ + # either it failed to compile (CLOCK_MONOTONIC undefined) + # or clock_gettime has returned a non-zero value + AC_MSG_RESULT([no]) + ], + [ + AC_MSG_RESULT([guessing no]) + ] + ) +fi # |