From aee3755b6d780c3261bdec2aef4d517bc7c7b148 Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Mon, 19 Nov 2007 03:05:16 +0000 Subject: * Nullpo's disabled on release builds. * Added timestamps to the log of memory leaks. * Moved definition of __func__ to cbasetypes.h. * Configure script updated: - added option to select the memory manager - added option to enable MAPREGSQL - added option to enable DEBUG * common's Makefile deleting svnversion.h on 'clean' target. (run ./configure again to update your Makefile) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11760 54d463be-8e91-2dee-dedb-b68131a5f0ec --- configure.in | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 117 insertions(+), 1 deletion(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index dc5da9c54..1ac99c495 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_INIT(eAthena) -AC_REVISION($Revision: 11695$) +AC_REVISION($Revision$) AC_PREREQ([2.61]) AC_CONFIG_SRCDIR([src/common/cbasetypes.h]) AC_CONFIG_FILES([Makefile src/common/Makefile]) @@ -11,6 +11,73 @@ AC_CONFIG_FILES([src/char_sql/Makefile src/login_sql/Makefile src/txt-converter/ AC_CONFIG_FILES([src/map/Makefile src/plugins/Makefile src/tool/Makefile]) +# +# Memory managers +# +AC_ARG_ENABLE( + [manager], + AC_HELP_STRING( + [--enable-manager=ARG], + [memory managers: no, builtin, memwatch, dmalloc, gcollect, bcheck (defaults to builtin)] + ), + [ + enable_manager="$enableval" + case $enableval in + "no");; + "builtin");; + "memwatch");; + "dmalloc");; + "gcollect");; + "bcheck");; + *) AC_MSG_ERROR([[unknown memory manager '$enable_manager'... stopping]]);; + esac + ], + [enable_manager="builtin"] +) + + +# +# mapregsql +# +AC_ARG_ENABLE( + [mapregsql], + AC_HELP_STRING( + [--enable-mapregsql], + [Makes map-wide script variables be saved to SQL instead of TXT files in the sql map-server. (defauts to no)] + ), + [ + enable_mapregsql="$enableval" + case $enableval in + no);; + yes);; + *) AC_MSG_ERROR([[invalid argument --enable-mapregsql=$enable_mapregsql... stopping]]);; + esac + ], + [enable_mapregsql="no"] +) + + +# +# debug +# +AC_ARG_ENABLE( + [debug], + AC_HELP_STRING( + [--enable-debug], + [Compiles in debug mode. (defauts to no)] + ), + [ + enable_debug="$enableval" + case $enableval in + no);; + yes);; + *) AC_MSG_ERROR([[invalid argument --enable-debug=$enable_mapregsql... stopping]]);; + esac + ], + [enable_debug="no"] +) + + # # Enable/disable MySql and optionally specify the path (optional library) # @@ -164,6 +231,55 @@ AC_COMPILE_IFELSE( +dnl +dnl Memory manager +dnl + +case $enableval in + "no") + CFLAGS="$CFLAGS -DNO_MEMMGR" + ;; + "builtin") + # enabled by default + ;; + "memwatch") + CFLAGS="$CFLAGS -DMEMWATCH" + AC_CHECK_HEADER([memwatch.h], , [AC_MSG_ERROR([memwatch header not found... stopping])]) + ;; + "dmalloc") + CFLAGS="$CFLAGS -DDMALLOC -DDMALLOC_FUNC_CHECK" + LIBS="$LIBS -ldmalloc" + AC_CHECK_HEADER([dmalloc.h], , [AC_MSG_ERROR([dmalloc header not found... stopping])]) + ;; + "gcollect") + CFLAGS="$CFLAGS -DGCOLLECT" + LIBS="$LIBS -lgc" + AC_CHECK_HEADER([gc.h], , [AC_MSG_ERROR([gcollect header not found... stopping])]) + ;; + "bcheck") + CFLAGS="$CFLAGS -DBCHECK" + ;; +esac + + +dnl +dnl Memory manager +dnl + +if test "$enable_mapregsql" = "yes" ; then + CFLAGS="$CFLAGS -DMAPREGSQL" +fi + + +dnl +dnl Debug +dnl + +if test "$enable_debug" = "yes" ; then + CFLAGS="$CFLAGS -DDEBUG" +fi + + dnl dnl Check MySQL library (optional) dnl -- cgit v1.2.3-60-g2f50