|
@@ -3,7 +3,7 @@
|
|
|
|
|
|
AC_INIT(eAthena)
|
|
|
AC_REVISION($Revision$)
|
|
|
-AC_PREREQ([2.61])
|
|
|
+AC_PREREQ([2.59])
|
|
|
AC_CONFIG_SRCDIR([src/common/cbasetypes.h])
|
|
|
AC_CONFIG_FILES([Makefile src/common/Makefile])
|
|
|
AC_CONFIG_FILES([src/char/Makefile src/login/Makefile src/ladmin/Makefile])
|
|
@@ -79,13 +79,13 @@ AC_ARG_ENABLE(
|
|
|
|
|
|
|
|
|
#
|
|
|
-# Enable/disable MySql and optionally specify the path (optional library)
|
|
|
+# Enable/disable MySql and optionally specify the path to mysql_config (optional library)
|
|
|
#
|
|
|
AC_ARG_WITH(
|
|
|
[mysql],
|
|
|
AC_HELP_STRING(
|
|
|
[--with-mysql@<:@=ARG@:>@],
|
|
|
- [use MySQL client library, optionally specify path to the mysql_config executable (by default mysql is used if found)]
|
|
|
+ [use MySQL client library, optionally specify the path to the mysql_config executable (by default mysql is used if found)]
|
|
|
),
|
|
|
[
|
|
|
if test "$withval" = "no" ; then
|
|
@@ -94,6 +94,9 @@ AC_ARG_WITH(
|
|
|
want_mysql="yes"
|
|
|
require_mysql="yes"
|
|
|
if test "$withval" != "yes" ; then
|
|
|
+ if test ! -x "$withval" ; then
|
|
|
+ AC_MSG_ERROR([$withval is not an executable file])
|
|
|
+ fi
|
|
|
MYSQL_CONFIG_HOME="$withval"
|
|
|
fi
|
|
|
fi
|
|
@@ -109,7 +112,7 @@ AC_ARG_WITH(
|
|
|
[pcre],
|
|
|
AC_HELP_STRING(
|
|
|
[--with-pcre@<:@=ARG@:>@],
|
|
|
- [use PCRE library, optionally specify the root directory path of pcre installation (by default pcre is used if found)]
|
|
|
+ [use PCRE library, optionally specify the full path of pcre installation directory (by default pcre is used if found)]
|
|
|
),
|
|
|
[
|
|
|
if test "$withval" = "no" ; then
|
|
@@ -118,6 +121,9 @@ AC_ARG_WITH(
|
|
|
want_pcre="yes"
|
|
|
require_pcre="yes"
|
|
|
if test "$withval" != "yes" ; then
|
|
|
+ if test ! -d "$withval" ; then
|
|
|
+ AC_MSG_ERROR([$withval is not a directoy])
|
|
|
+ fi
|
|
|
PCRE_HOME="$withval"
|
|
|
fi
|
|
|
fi
|
|
@@ -147,7 +153,10 @@ AC_ARG_WITH(
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
-# Checks for programs and types.
|
|
|
+# Check for programs and types.
|
|
|
+#
|
|
|
+
|
|
|
+
|
|
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
AC_PROG_CC
|
|
@@ -169,14 +178,15 @@ 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([[int hw[(sizeof(int) == sizeof(void *))];]])],
|
|
|
+ [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"
|
|
|
AC_COMPILE_IFELSE(
|
|
|
- [AC_LANG_PROGRAM([[int hw[(sizeof(int) == sizeof(void *))];]])],
|
|
|
+ [AC_LANG_PROGRAM([[static int test_array[((long int)sizeof(int)) == ((long int)sizeof(void *)) ? 1 : -1];]])],
|
|
|
[pointers_fit_in_ints="yes (with -m32)"],
|
|
|
[]
|
|
|
)
|
|
@@ -226,15 +236,15 @@ AC_COMPILE_IFELSE(
|
|
|
)
|
|
|
|
|
|
|
|
|
-###############################################################################
|
|
|
-# Checks for libraries and header files.
|
|
|
-
|
|
|
|
|
|
+###############################################################################
|
|
|
+# Check for libraries and header files.
|
|
|
+#
|
|
|
|
|
|
-dnl
|
|
|
-dnl Memory manager
|
|
|
-dnl
|
|
|
|
|
|
+#
|
|
|
+# Memory manager
|
|
|
+#
|
|
|
case $enableval in
|
|
|
"no")
|
|
|
CFLAGS="$CFLAGS -DNO_MEMMGR"
|
|
@@ -262,28 +272,25 @@ case $enableval in
|
|
|
esac
|
|
|
|
|
|
|
|
|
-dnl
|
|
|
-dnl Memory manager
|
|
|
-dnl
|
|
|
-
|
|
|
+#
|
|
|
+# Mapregsql
|
|
|
+#
|
|
|
if test "$enable_mapregsql" = "yes" ; then
|
|
|
CFLAGS="$CFLAGS -DMAPREGSQL"
|
|
|
fi
|
|
|
|
|
|
|
|
|
-dnl
|
|
|
-dnl Debug
|
|
|
-dnl
|
|
|
-
|
|
|
+#
|
|
|
+# Debug
|
|
|
+#
|
|
|
if test "$enable_debug" = "yes" ; then
|
|
|
CFLAGS="$CFLAGS -DDEBUG"
|
|
|
fi
|
|
|
|
|
|
|
|
|
-dnl
|
|
|
-dnl Check MySQL library (optional)
|
|
|
-dnl
|
|
|
-
|
|
|
+#
|
|
|
+# MySQL library (optional)
|
|
|
+#
|
|
|
MYSQL_VERSION=""
|
|
|
MYSQL_CFLAGS=""
|
|
|
MYSQL_LIBS=""
|
|
@@ -299,11 +306,11 @@ else
|
|
|
if test "$MYSQL_CONFIG_HOME" != "no" ; then
|
|
|
HAVE_MYSQL="yes"
|
|
|
MYSQL_VERSION="`$MYSQL_CONFIG_HOME --version`"
|
|
|
- MYSQL_CFLAGS="`$MYSQL_CONFIG_HOME --cflags`"
|
|
|
+ MYSQL_CFLAGS="`$MYSQL_CONFIG_HOME --include`"
|
|
|
MYSQL_LIBS="`$MYSQL_CONFIG_HOME --libs`"
|
|
|
AC_MSG_RESULT([yes ($MYSQL_VERSION)])
|
|
|
- if test -n "`$MYSQL_CONFIG_HOME --libs | grep -i '\-m64'`"; then
|
|
|
- AC_MSG_ERROR([$MYSQL_CONFIG_HOME reported that MySQL was compiled in 64bit mode, please specify a 32bit distribution of MySQL with --with-mysql=<path>... stopping])
|
|
|
+ if test -n "`$MYSQL_CONFIG_HOME --cflags | grep -i '\-m64'`"; then
|
|
|
+ AC_MSG_ERROR([$MYSQL_CONFIG_HOME reported a 64 bit MySQL, please specify a 32bit version with --with-mysql=<path to mysql_config>... stopping])
|
|
|
fi
|
|
|
else
|
|
|
AC_MSG_RESULT([no])
|
|
@@ -322,10 +329,9 @@ AC_SUBST([MYSQL_LIBS])
|
|
|
|
|
|
|
|
|
|
|
|
-dnl
|
|
|
-dnl Check PCRE libraries (optional)
|
|
|
-dnl
|
|
|
-
|
|
|
+#
|
|
|
+# PCRE library (optional)
|
|
|
+#
|
|
|
##TODO PCRE version
|
|
|
PCRE_LIBS=""
|
|
|
PCRE_CFLAGS=""
|
|
@@ -368,10 +374,9 @@ AC_SUBST([PCRE_CFLAGS])
|
|
|
|
|
|
|
|
|
|
|
|
-dnl
|
|
|
-dnl zlib library (required)
|
|
|
-dnl
|
|
|
-
|
|
|
+#
|
|
|
+# zlib library (required)
|
|
|
+#
|
|
|
if test -n "${ZLIB_HOME}" ; then
|
|
|
LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
|
|
|
CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
|
|
@@ -381,18 +386,16 @@ AC_CHECK_HEADER([zlib.h], , [AC_MSG_ERROR([zlib header not found, please specify
|
|
|
|
|
|
|
|
|
|
|
|
-dnl
|
|
|
-dnl math library (required)
|
|
|
-dnl
|
|
|
-
|
|
|
+#
|
|
|
+# math library (required)
|
|
|
+#
|
|
|
AC_CHECK_LIB([m], [sqrt], [], [AC_MSG_ERROR([math library not found... stopping])])
|
|
|
|
|
|
|
|
|
|
|
|
-dnl
|
|
|
-dnl Host specific stuff
|
|
|
-dnl
|
|
|
-
|
|
|
+#
|
|
|
+# Host specific stuff
|
|
|
+#
|
|
|
AC_MSG_CHECKING([host OS])
|
|
|
host_os="`uname`"
|
|
|
AC_MSG_RESULT([$host_os])
|