From 9599b05c3cd2145ea9cd9fe7ce98912705942740 Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Thu, 27 Dec 2007 12:08:07 +0000 Subject: * Changed the configure script: - refined the mysql test (wasn't detecting 64 libraries compiled without -m64) - added a test for clock_gettime in -lrt (required for Debian) (run ./configure to update the Makefiles) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11985 54d463be-8e91-2dee-dedb-b68131a5f0ec --- configure.in | 66 ++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 28 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 69a403895..2751d945e 100644 --- a/configure.in +++ b/configure.in @@ -288,6 +288,29 @@ if test "$enable_debug" = "yes" ; then fi +# +# zlib library (required) +# +if test -n "${ZLIB_HOME}" ; then + LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib" + CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include" +fi +AC_CHECK_LIB([z], [inflateEnd], [],[AC_MSG_ERROR([zlib library not found or incompatible, please specify the correct path with --with-zlib=DIR... stopping])]) +AC_CHECK_HEADER([zlib.h], [], [AC_MSG_ERROR([zlib header not found, please specify the correct path with --with-zlib=DIR... stopping])]) + + +# +# math library (required) +# +AC_CHECK_LIB([m], [sqrt], [], [AC_MSG_ERROR([math library not found... stopping])]) + + +# +# clock_gettime (rt on Debian) +# +AC_CHECK_LIB([rt], [clock_gettime]) + + # # MySQL library (optional) # @@ -302,22 +325,30 @@ else AC_PATH_PROG([MYSQL_CONFIG_HOME], [mysql_config], [no]) fi - AC_MSG_CHECKING([MySQL library (optional)]) if test "$MYSQL_CONFIG_HOME" != "no" ; then - HAVE_MYSQL="yes" MYSQL_VERSION="`$MYSQL_CONFIG_HOME --version`" MYSQL_CFLAGS="`$MYSQL_CONFIG_HOME --include`" MYSQL_LIBS="`$MYSQL_CONFIG_HOME --libs`" + + MYSQL_OLD_LDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS $MYSQL_LIBS" + MYSQL_OLD_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS $MYSQL_CFLAGS" + AC_CHECK_LIB([mysqlclient], [mysql_init], [HAVE_MYSQL="yes"], []) + AC_CHECK_HEADER([mysql.h], [], [HAVE_MYSQL=""]) + CPPFLAGS="$MYSQL_OLD_CPPFLAGS" + LDFLAGS="$MYSQL_OLD_LDFLAGS" + fi + AC_MSG_CHECKING([MySQL library (optional)]) + if test "$HAVE_MYSQL" = "yes" ; then AC_MSG_RESULT([yes ($MYSQL_VERSION)]) - 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=... stopping]) - fi else AC_MSG_RESULT([no]) if test "$require_mysql" = "yes" ; then - AC_MSG_ERROR([MySQL not found (requested)]) + AC_MSG_ERROR([MySQL not found or incompatible (requested)]) else AC_MSG_NOTICE([disabling MySQL (optional)]) + MYSQL_VERSION="" + MYSQL_CFLAGS="" + MYSQL_LIBS="" fi fi fi @@ -328,7 +359,6 @@ AC_SUBST([MYSQL_CFLAGS]) AC_SUBST([MYSQL_LIBS]) - # # PCRE library (optional) # @@ -361,7 +391,7 @@ else else AC_MSG_RESULT([no]) if test "$require_pcre" = "yes" ; then - AC_MSG_ERROR([PCRE not found (requested)]) + AC_MSG_ERROR([PCRE not found or incompatible (requested)]) else AC_MSG_NOTICE([disabling PCRE (optional)]) fi @@ -373,26 +403,6 @@ AC_SUBST([PCRE_LIBS]) AC_SUBST([PCRE_CFLAGS]) - -# -# zlib library (required) -# -if test -n "${ZLIB_HOME}" ; then - LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib" - CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include" -fi -AC_CHECK_LIB([z], [inflateEnd], ,[AC_MSG_ERROR([zlib library not found, please specify the correct path with --with-zlib=DIR... stopping])]) -AC_CHECK_HEADER([zlib.h], , [AC_MSG_ERROR([zlib header not found, please specify the correct path with --with-zlib=DIR... stopping])]) - - - -# -# math library (required) -# -AC_CHECK_LIB([m], [sqrt], [], [AC_MSG_ERROR([math library not found... stopping])]) - - - # # Host specific stuff # -- cgit v1.2.3-60-g2f50