diff options
author | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-01-25 16:12:20 +0000 |
---|---|---|
committer | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-01-25 16:12:20 +0000 |
commit | e5f0d3eb45aedbf6888c0816ecb625999df8cdb6 (patch) | |
tree | 775504d1d582f4a8392f5ab3b6af1dafd6a451b8 /configure.in | |
parent | 101dd12ba7fa9cb34363361ef9bbbe5c74f8b375 (diff) | |
download | hercules-e5f0d3eb45aedbf6888c0816ecb625999df8cdb6.tar.gz hercules-e5f0d3eb45aedbf6888c0816ecb625999df8cdb6.tar.bz2 hercules-e5f0d3eb45aedbf6888c0816ecb625999df8cdb6.tar.xz hercules-e5f0d3eb45aedbf6888c0816ecb625999df8cdb6.zip |
* Changes to the configure script:
- added option --enable-profiler (supports gprof)
- added option --enable-64bit (don't force 32bit)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13486 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 101 |
1 files changed, 82 insertions, 19 deletions
diff --git a/configure.in b/configure.in index d0d15e0ca..c881f5610 100644 --- a/configure.in +++ b/configure.in @@ -56,9 +56,11 @@ AC_ARG_ENABLE( AC_ARG_ENABLE( [debug], AC_HELP_STRING( - [--enable-debug], - [Compiles extra debug code. (disabled by default)], - [(available options: yes, no, gdb)] + [--enable-debug@<:@=ARG@:>@], + [ + Compiles extra debug code. (disabled by default) + (available options: yes, no, gdb) + ] ), [ enable_debug="$enableval" @@ -74,6 +76,51 @@ AC_ARG_ENABLE( # +# Profiler +# +AC_ARG_ENABLE( + [profiler], + AC_HELP_STRING( + [--enable-profiler=ARG], + [Profilers: no, gprof (disabled by default)] + ), + [ + enable_profiler="$enableval" + case $enableval in + "no");; + "gprof");; + *) AC_MSG_ERROR([[invalid argument --enable-profiler=$enableval... stopping]]);; + esac + ], + [enable_profiler="no"] +) + + +# +# 64bit +# +AC_ARG_ENABLE( + [64bit], + AC_HELP_STRING( + [--enable-64bit], + [ + Don't force 32 bit. (disabled by default) + 64bit support is still being tested, not recommended for production servers. + ] + ), + [ + enable_64bit="$enableval" + case $enableval in + "no");; + "yes");; + *) AC_MSG_ERROR([[invalid argument --enable-64bit=$enableval... stopping]]);; + esac + ], + [enable_64bit="no"] +) + + +# # Enable/disable MySql and optionally specify the path to mysql_config (optional library) # AC_ARG_WITH( @@ -205,25 +252,27 @@ AC_C_BIGENDIAN( ) -AC_MSG_CHECKING([whether pointers can be stored in ints (old code)]) -pointers_fit_in_ints="no" -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[static int test_array[((long int)sizeof(int)) == ((long int)sizeof(void*)) ? 1 : -1];]])], - [pointers_fit_in_ints="yes"], - [] -) -if test "$pointers_fit_in_ints" = "no" ; then - CFLAGS="$CFLAGS -m32" - LDFLAGS="$LDFLAGS -m32" +if test "$enable_64bit" = "no" ; then + AC_MSG_CHECKING([whether pointers can be stored in ints (old code)]) + pointers_fit_in_ints="no" AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[static int test_array[((long int)sizeof(int)) == ((long int)sizeof(void *)) ? 1 : -1];]])], - [pointers_fit_in_ints="yes (with -m32)"], + [AC_LANG_PROGRAM([[static int test_array[((long int)sizeof(int)) == ((long int)sizeof(void*)) ? 1 : -1];]])], + [pointers_fit_in_ints="yes"], [] ) -fi -AC_MSG_RESULT($pointers_fit_in_ints) -if test "$pointers_fit_in_ints" = "no" ; then - AC_MSG_ERROR([pointers cannot be stored in ints, required for old code... stopping]) + if test "$pointers_fit_in_ints" = "no" ; then + CFLAGS="$CFLAGS -m32" + LDFLAGS="$LDFLAGS -m32" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[static int test_array[((long int)sizeof(int)) == ((long int)sizeof(void *)) ? 1 : -1];]])], + [pointers_fit_in_ints="yes (with -m32)"], + [] + ) + fi + AC_MSG_RESULT($pointers_fit_in_ints) + if test "$pointers_fit_in_ints" = "no" ; then + AC_MSG_ERROR([pointers cannot be stored in ints, required for old code... stopping]) + fi fi @@ -335,6 +384,20 @@ esac # +# Profiler +# +case $enable_profiler in + "no") + # default value + ;; + "gprof") + CFLAGS="$CFLAGS -pg" + LDFLAGS="$LDFLAGS -pg" + ;; +esac + + +# # zlib library (required) # if test -n "${ZLIB_HOME}" ; then |