diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-01-16 23:16:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-01-21 19:39:37 +0300 |
commit | 5ce1b0ec7c0a8267bba7b163af5c7e4556fb3390 (patch) | |
tree | f219810e9bfd6bb0f069c28234b1ea6c84502c40 | |
parent | 0ed2d09e9aa88af01698707fd701363bdbd92b4b (diff) | |
download | hercules-5ce1b0ec7c0a8267bba7b163af5c7e4556fb3390.tar.gz hercules-5ce1b0ec7c0a8267bba7b163af5c7e4556fb3390.tar.bz2 hercules-5ce1b0ec7c0a8267bba7b163af5c7e4556fb3390.tar.xz hercules-5ce1b0ec7c0a8267bba7b163af5c7e4556fb3390.zip |
Enable pcre by default in configure and show error if pcre missing.
-rwxr-xr-x | configure | 131 | ||||
-rw-r--r-- | configure.in | 74 | ||||
-rw-r--r-- | src/char/Makefile.in | 4 | ||||
-rw-r--r-- | src/common/Makefile.in | 2 | ||||
-rw-r--r-- | src/login/Makefile.in | 2 | ||||
-rw-r--r-- | src/map/Makefile.in | 4 | ||||
-rw-r--r-- | src/plugins/Makefile.in | 4 | ||||
-rw-r--r-- | src/test/Makefile.in | 4 |
8 files changed, 27 insertions, 198 deletions
@@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in 5a3f06b. +# From configure.in e2391ea. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -627,9 +627,6 @@ HAVE_PERL HAVE_DOXYGEN PLUGINSTATIC STATIC -PCRE_CFLAGS -PCRE_LIBS -HAVE_PCRE MYSQL_LIBS MYSQL_CFLAGS MYSQL_VERSION @@ -711,7 +708,6 @@ with_maxconn with_mysql with_MYSQL_CFLAGS with_MYSQL_LIBS -with_pcre with_zlib ' ac_precious_vars='build_alias @@ -1391,9 +1387,6 @@ Optional Packages: "mysql_config --include") --with-MYSQL_LIBS=ARG specify MYSQL_LIBS manually (instead of using "mysql_config --libs") - --with-pcre[=ARG] use PCRE library, optionally specify the full path - of pcre installation directory (by default pcre is - used if found) --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 @@ -3819,33 +3812,6 @@ fi # -# Enable/disable PCRE and optionally specify the path (optional library) -# - -# Check whether --with-pcre was given. -if test "${with_pcre+set}" = set; then : - withval=$with_pcre; - if test "$withval" = "no" ; then - want_pcre="no" - else - want_pcre="yes" - require_pcre="yes" - if test "$withval" != "yes" ; then - if test ! -d "$withval" ; then - as_fn_error $? "$withval is not a directoy" "$LINENO" 5 - fi - PCRE_HOME="$withval" - fi - fi - -else - want_pcre="yes" require_pcre="no" - -fi - - - -# # Specify the path of the zlib library (required library) # @@ -8127,16 +8093,10 @@ fi # # PCRE library (optional) # -##TODO PCRE version -PCRE_LIBS="" -PCRE_CFLAGS="" -if test "$want_pcre" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: ignoring PCRE (optional)" >&5 -$as_echo "$as_me: ignoring PCRE (optional)" >&6;} -else - if test -z "$PCRE_HOME" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_study in -lpcre" >&5 +{ $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 : $as_echo_n "(cached) " >&6 @@ -8173,84 +8133,17 @@ 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 : - HAVE_PCRE="yes" -fi + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPCRE 1 +_ACEOF - if test "$HAVE_PCRE" = "yes" ; then - PCRE_LIBS="-lpcre" - PCRE_CFLAGS="-DPCRE_SUPPORT" - fi - else - PCRE_OLD_LDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS -L$PCRE_HOME/lib" - PCRE_OLD_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS -I$PCRE_HOME/include" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 -$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } -if ${ac_cv_lib_pcre_pcre_compile+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcre $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + LIBS="-lpcre $LIBS" -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pcre_compile (); -int -main () -{ -return pcre_compile (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pcre_pcre_compile=yes else - ac_cv_lib_pcre_pcre_compile=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 -$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } -if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : - HAVE_PCRE="yes" -fi - - CPPFLAGS="$PCRE_OLD_CPPFLAGS" - LDFLAGS="$PCRE_OLD_LDFLAGS" - if test "$HAVE_PCRE" = "yes" ; then - PCRE_LIBS="-L$PCRE_HOME/lib -lpcre" - test -d "$PCRE_HOME/include" && PCRE_CFLAGS="-I$PCRE_HOME/include -DPCRE_SUPPORT" - fi - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking PCRE library (optional)" >&5 -$as_echo_n "checking PCRE library (optional)... " >&6; } - if test "$HAVE_PCRE" = "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - if test "$require_pcre" = "yes" ; then - as_fn_error $? "PCRE not found or incompatible (requested)" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: disabling PCRE (optional)" >&5 -$as_echo "$as_me: disabling PCRE (optional)" >&6;} - fi - fi + as_fn_error $? "PCRE not found or incompatible" "$LINENO" 5 fi - - - - +CFLAGS="$CFLAGS -DPCRE_SUPPORT" # # static Support test @@ -8264,9 +8157,9 @@ if test "$enable_static" != "no" ; then OLD_LDFLAGS="$LDFLAGS" OLD_LIBS="$LIBS" - CFLAGS="$OLD_CFLAGS $MYSQL_CFLAGS $PCRE_CFLAGS -static" + CFLAGS="$OLD_CFLAGS $MYSQL_CFLAGS -static" LDFLAGS="$OLD_LDFLAGS -static" - LIBS="$OLD_LIBS $MYSQL_LIBS $PCRE_LIBS" + LIBS="$OLD_LIBS $MYSQL_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -static" >&5 $as_echo_n "checking whether $CC supports -static... " >&6; } diff --git a/configure.in b/configure.in index bfcc27322..7b89bbce4 100644 --- a/configure.in +++ b/configure.in @@ -444,33 +444,6 @@ AC_ARG_WITH( # -# Enable/disable PCRE and optionally specify the path (optional library) -# -AC_ARG_WITH( - [pcre], - AC_HELP_STRING( - [--with-pcre@<:@=ARG@:>@], - [use PCRE library, optionally specify the full path of pcre installation directory (by default pcre is used if found)] - ), - [ - if test "$withval" = "no" ; then - want_pcre="no" - else - 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 - ], - [want_pcre="yes" require_pcre="no"] -) - - -# # Specify the path of the zlib library (required library) # AC_ARG_WITH( @@ -1317,47 +1290,10 @@ AC_SUBST([MYSQL_LIBS]) # # PCRE library (optional) # -##TODO PCRE version -PCRE_LIBS="" -PCRE_CFLAGS="" - -if test "$want_pcre" = "no" ; then - AC_MSG_NOTICE([ignoring PCRE (optional)]) -else - if test -z "$PCRE_HOME" ; then - AC_CHECK_LIB([pcre], [pcre_study], [HAVE_PCRE="yes"], []) - if test "$HAVE_PCRE" = "yes" ; then - PCRE_LIBS="-lpcre" - PCRE_CFLAGS="-DPCRE_SUPPORT" - fi - else - PCRE_OLD_LDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS -L$PCRE_HOME/lib" - PCRE_OLD_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS -I$PCRE_HOME/include" - AC_CHECK_LIB(pcre, pcre_compile, [HAVE_PCRE="yes"], []) - CPPFLAGS="$PCRE_OLD_CPPFLAGS" - LDFLAGS="$PCRE_OLD_LDFLAGS" - if test "$HAVE_PCRE" = "yes" ; then - PCRE_LIBS="-L$PCRE_HOME/lib -lpcre" - test -d "$PCRE_HOME/include" && PCRE_CFLAGS="-I$PCRE_HOME/include -DPCRE_SUPPORT" - fi - fi - AC_MSG_CHECKING([PCRE library (optional)]) - if test "$HAVE_PCRE" = "yes" ; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - if test "$require_pcre" = "yes" ; then - AC_MSG_ERROR([PCRE not found or incompatible (requested)]) - else - AC_MSG_NOTICE([disabling PCRE (optional)]) - fi - fi -fi - -AC_SUBST([HAVE_PCRE]) -AC_SUBST([PCRE_LIBS]) -AC_SUBST([PCRE_CFLAGS]) +AC_MSG_CHECKING([PCRE library]) +AC_CHECK_LIB(pcre, pcre_study, , AC_MSG_ERROR([PCRE not found or incompatible])) +CFLAGS="$CFLAGS -DPCRE_SUPPORT" # # static Support test @@ -1371,9 +1307,9 @@ if test "$enable_static" != "no" ; then OLD_LDFLAGS="$LDFLAGS" OLD_LIBS="$LIBS" - CFLAGS="$OLD_CFLAGS $MYSQL_CFLAGS $PCRE_CFLAGS -static" + CFLAGS="$OLD_CFLAGS $MYSQL_CFLAGS -static" LDFLAGS="$OLD_LDFLAGS -static" - LIBS="$OLD_LIBS $MYSQL_LIBS $PCRE_LIBS" + LIBS="$OLD_LIBS $MYSQL_LIBS" AC_MSG_CHECKING([whether $CC supports -static]) AC_RUN_IFELSE( diff --git a/src/char/Makefile.in b/src/char/Makefile.in index bc2c0e980..8d9094f18 100644 --- a/src/char/Makefile.in +++ b/src/char/Makefile.in @@ -110,13 +110,13 @@ char-server: ../../char-server@EXEEXT@ ../../char-server@EXEEXT@: $(CHAR_SERVER_SQL_DEPENDS) Makefile @echo " LD $(notdir $@)" @$(CC) @STATIC@ @LDFLAGS@ -o ../../char-server@EXEEXT@ $(CHAR_OBJ) $(COMMON_D)/obj_sql/common_sql.a \ - $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@ + $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ # char object files obj_sql/%.o: %.c $(CHAR_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PCRE_CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing object files $(COMMON_D)/obj_all/common.a: diff --git a/src/common/Makefile.in b/src/common/Makefile.in index df3ecaf2d..9d4b2d044 100644 --- a/src/common/Makefile.in +++ b/src/common/Makefile.in @@ -135,7 +135,7 @@ obj_all/sysinfo.o: sysinfo.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_ obj_all/%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PCRE_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $< obj_all/mini%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all @echo " CC $<" diff --git a/src/login/Makefile.in b/src/login/Makefile.in index 022831fb5..6560e6497 100644 --- a/src/login/Makefile.in +++ b/src/login/Makefile.in @@ -106,7 +106,7 @@ login-server: ../../login-server@EXEEXT@ ../../login-server@EXEEXT@: $(LOGIN_SERVER_SQL_DEPENDS) Makefile @echo " LD $(notdir $@)" @$(CC) @STATIC@ @LDFLAGS@ -o ../../login-server@EXEEXT@ $(LOGIN_OBJ) $(COMMON_D)/obj_sql/common_sql.a \ - $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@ + $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ # login object files diff --git a/src/map/Makefile.in b/src/map/Makefile.in index 60d87522e..b5a3d4461 100644 --- a/src/map/Makefile.in +++ b/src/map/Makefile.in @@ -116,13 +116,13 @@ map-server: ../../map-server@EXEEXT@ ../../map-server@EXEEXT@: $(MAP_SERVER_SQL_DEPENDS) Makefile @echo " LD $(notdir $@)" @$(CC) @STATIC@ @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_OBJ) $(COMMON_D)/obj_sql/common_sql.a \ - $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@ + $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ # map object files obj_sql/%.o: %.c $(MAP_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PCRE_CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing object files $(COMMON_D)/obj_all/common.a: diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in index 6e8e3bfac..3fe38b6bc 100644 --- a/src/plugins/Makefile.in +++ b/src/plugins/Makefile.in @@ -102,7 +102,7 @@ Makefile: Makefile.in ../../plugins/%@DLLEXT@: %.c $(ALL_H) $$(shell ls %/* 2>/dev/null) @echo " CC $<" - @$(CC) $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @PCRE_CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $< + @$(CC) $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $< ../../plugins/HPMHooking_login@DLLEXT@: HPMHOOKINGTYPE = LOGIN ../../plugins/HPMHooking_char@DLLEXT@: HPMHOOKINGTYPE = CHAR @@ -110,4 +110,4 @@ Makefile: Makefile.in ../../plugins/HPMHooking_%@DLLEXT@: HPMHooking.c $(ALL_H) $$(shell ls HPMHooking/*_%* HPMHooking/*_common* 2>/dev/null) @echo " CC $< ($(HPMHOOKINGTYPE))" - @$(CC) -DHPMHOOKING_$(HPMHOOKINGTYPE) $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @PCRE_CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $< + @$(CC) -DHPMHOOKING_$(HPMHOOKINGTYPE) $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $< diff --git a/src/test/Makefile.in b/src/test/Makefile.in index 29331cb0f..6d2187733 100644 --- a/src/test/Makefile.in +++ b/src/test/Makefile.in @@ -88,13 +88,13 @@ $(TESTS_ALL): test_%: ../../test_%@EXEEXT@ ../../test_%@EXEEXT@: obj/test_%.o $(TEST_DEPENDS) Makefile @echo " LD $(notdir $@)" @$(CC) @STATIC@ @LDFLAGS@ -o $@ $< $(COMMON_D)/obj_sql/common_sql.a \ - $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@ + $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ # object files obj/%.o: %.c $(TEST_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PCRE_CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing object files $(COMMON_D)/obj_all/common.a: |