diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-06 21:28:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-06 21:28:59 +0300 |
commit | 02204cfb8310c3adea07b93ab200b0609f72f26c (patch) | |
tree | cbe6b767c743d64faa493cd5a06e6f8c00d779ab | |
parent | dfdf6b91839c88d9ca1071d63337d33757a87f4c (diff) | |
parent | 2f4b1d7f15c8835545c791f09bac94bfae7e43b8 (diff) | |
download | hercules-02204cfb8310c3adea07b93ab200b0609f72f26c.tar.gz hercules-02204cfb8310c3adea07b93ab200b0609f72f26c.tar.bz2 hercules-02204cfb8310c3adea07b93ab200b0609f72f26c.tar.xz hercules-02204cfb8310c3adea07b93ab200b0609f72f26c.zip |
Merge pull request #1143 from MishimaHaruna/usrlocal
Improved ./configure on systems that rely on /usr/local
-rwxr-xr-x | configure | 102 | ||||
-rw-r--r-- | configure.in | 44 | ||||
-rw-r--r-- | src/map/npc.h | 5 | ||||
-rw-r--r-- | src/map/npc_chat.c | 3 |
4 files changed, 71 insertions, 83 deletions
@@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in cbe69a9. +# From configure.in 8ca4506. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -708,7 +708,6 @@ with_maxconn with_mysql with_MYSQL_CFLAGS with_MYSQL_LIBS -with_zlib ' ac_precious_vars='build_alias host_alias @@ -1387,10 +1386,6 @@ Optional Packages: "mysql_config --include") --with-MYSQL_LIBS=ARG specify MYSQL_LIBS manually (instead of using "mysql_config --libs") - --with-zlib=DIR root directory path of zlib installation (defaults - to /usr/local or /usr if not found in /usr/local). - Assumes that the header files are in DIR/include and - the library files are in DIR/lib Some influential environment variables: CC C compiler command @@ -3811,26 +3806,6 @@ fi -# -# Specify the path of the zlib library (required library) -# - -# Check whether --with-zlib was given. -if test "${with_zlib+set}" = set; then : - withval=$with_zlib; - test -n "$withval" && ZLIB_HOME="$withval" - -else - - ZLIB_HOME=/usr/local - test ! -f "${ZLIB_HOME}/include/zlib.h" && ZLIB_HOME=/usr - - -fi - - - - ############################################################################### # Check for programs and types. # @@ -4596,6 +4571,18 @@ CFLAGS="$CFLAGS -pipe -ffast-math -Wall -Wextra -Wno-sign-compare" CPPFLAGS="$CPPFLAGS -I../common" LDFLAGS="$LDFLAGS" +# Add /usr/local to the library and header search path, where appropriate +case `uname` in + Darwin*|*BSD*) + if test -d /usr/local/include ; then + CPPFLAGS="$CPPFLAGS -I/usr/local/include" + fi + if test -d /usr/local/lib ; then + LDFLAGS="$LDFLAGS -L/usr/local/lib" + fi + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : @@ -7263,10 +7250,6 @@ fi # # zlib library (required) # -if test -n "${ZLIB_HOME}" ; then - LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib" - CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include" -fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inflateEnd" >&5 $as_echo_n "checking for library containing inflateEnd... " >&6; } if ${ac_cv_search_inflateEnd+:} false; then : @@ -7322,14 +7305,14 @@ if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else - as_fn_error $? "zlib library not found or incompatible, please specify the correct path with --with-zlib=DIR... stopping" "$LINENO" 5 + as_fn_error $? "zlib library not found or incompatible... stopping" "$LINENO" 5 fi ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : else - as_fn_error $? "zlib header not found, please specify the correct path with --with-zlib=DIR... stopping" "$LINENO" 5 + as_fn_error $? "zlib header not found, please specify the correct path with... stopping" "$LINENO" 5 fi @@ -8096,13 +8079,20 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking PCRE library" >&5 $as_echo_n "checking PCRE library... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_study in -lpcre" >&5 -$as_echo_n "checking for pcre_study in -lpcre... " >&6; } -if ${ac_cv_lib_pcre_pcre_study+:} false; then : +ac_fn_c_check_header_mongrel "$LINENO" "pcre.h" "ac_cv_header_pcre_h" "$ac_includes_default" +if test "x$ac_cv_header_pcre_h" = xyes; then : + +else + as_fn_error $? "PCRE header not found" "$LINENO" 5 +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pcre_study" >&5 +$as_echo_n "checking for library containing pcre_study... " >&6; } +if ${ac_cv_search_pcre_study+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcre $LIBS" + ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8121,23 +8111,35 @@ return pcre_study (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pcre_pcre_study=yes -else - ac_cv_lib_pcre_pcre_study=no +for ac_lib in '' pcre; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_pcre_study=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + conftest$ac_exeext + if ${ac_cv_search_pcre_study+:} false; then : + break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_study" >&5 -$as_echo "$ac_cv_lib_pcre_pcre_study" >&6; } -if test "x$ac_cv_lib_pcre_pcre_study" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPCRE 1 -_ACEOF +done +if ${ac_cv_search_pcre_study+:} false; then : - LIBS="-lpcre $LIBS" +else + ac_cv_search_pcre_study=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pcre_study" >&5 +$as_echo "$ac_cv_search_pcre_study" >&6; } +ac_res=$ac_cv_search_pcre_study +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else as_fn_error $? "PCRE not found or incompatible" "$LINENO" 5 diff --git a/configure.in b/configure.in index b4a5a110c..c8bc3a864 100644 --- a/configure.in +++ b/configure.in @@ -443,27 +443,6 @@ AC_ARG_WITH( ) -# -# Specify the path of the zlib library (required library) -# -AC_ARG_WITH( - [zlib], - AC_HELP_STRING( - [--with-zlib=DIR], - [root directory path of zlib installation (defaults to /usr/local or /usr if not found in /usr/local). - Assumes that the header files are in DIR/include and the library files are in DIR/lib] - ), - [ - test -n "$withval" && ZLIB_HOME="$withval" - ], - [ - ZLIB_HOME=/usr/local - test ! -f "${ZLIB_HOME}/include/zlib.h" && ZLIB_HOME=/usr - ] -) - - - ############################################################################### # Check for programs and types. # @@ -481,6 +460,18 @@ CFLAGS="$CFLAGS -pipe -ffast-math -Wall -Wextra -Wno-sign-compare" CPPFLAGS="$CPPFLAGS -I../common" LDFLAGS="$LDFLAGS" +# Add /usr/local to the library and header search path, where appropriate +case `uname` in + Darwin*|*BSD*) + if test -d /usr/local/include ; then + CPPFLAGS="$CPPFLAGS -I/usr/local/include" + fi + if test -d /usr/local/lib ; then + LDFLAGS="$LDFLAGS -L/usr/local/lib" + fi + ;; +esac + AC_C_BIGENDIAN( [AC_MSG_ERROR([[bigendian is not supported... stopping]])], , @@ -1161,12 +1152,8 @@ fi # # zlib library (required) # -if test -n "${ZLIB_HOME}" ; then - LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib" - CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include" -fi -AC_SEARCH_LIBS([inflateEnd], [z], [],[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])]) +AC_SEARCH_LIBS([inflateEnd], [z], [],[AC_MSG_ERROR([zlib library not found or incompatible... stopping])]) +AC_CHECK_HEADER([zlib.h], [], [AC_MSG_ERROR([zlib header not found, please specify the correct path with... stopping])]) # @@ -1292,7 +1279,8 @@ AC_SUBST([MYSQL_LIBS]) # AC_MSG_CHECKING([PCRE library]) -AC_CHECK_LIB(pcre, pcre_study, , AC_MSG_ERROR([PCRE not found or incompatible])) +AC_CHECK_HEADER([pcre.h], [], [AC_MSG_ERROR([PCRE header not found])]) +AC_SEARCH_LIBS([pcre_study], [pcre], [], AC_MSG_ERROR([PCRE not found or incompatible])) # # static Support test diff --git a/src/map/npc.h b/src/map/npc.h index 568ddfe87..be878933e 100644 --- a/src/map/npc.h +++ b/src/map/npc.h @@ -27,6 +27,8 @@ #include "common/hercules.h" #include "common/db.h" +#include <pcre.h> + struct hplugin_data_store; struct view_data; @@ -308,9 +310,6 @@ void npc_defaults(void); HPShared struct npc_interface *npc; -/* comes from npc_chat.c */ -#include <pcre/include/pcre.h> - /** * Structure containing all info associated with a single pattern block */ diff --git a/src/map/npc_chat.c b/src/map/npc_chat.c index 001baf3ea..6726c65a9 100644 --- a/src/map/npc_chat.c +++ b/src/map/npc_chat.c @@ -31,8 +31,7 @@ #include "common/strlib.h" #include "common/timer.h" -#include <pcre/include/pcre.h> - +#include <pcre.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> |