summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-02-06 18:13:03 +0100
committerHaru <haru@dotalux.com>2016-02-06 18:51:22 +0100
commit8ca4506ee9ad4bfd490d1e9a7ab2cfb02f1ba3d7 (patch)
tree65d9aaa4c0c0695fe71c0aaa047d3eb4dafc49e0
parent730fede2da1ca573ff716c77a5d9b1d0989adc6e (diff)
downloadhercules-8ca4506ee9ad4bfd490d1e9a7ab2cfb02f1ba3d7.tar.gz
hercules-8ca4506ee9ad4bfd490d1e9a7ab2cfb02f1ba3d7.tar.bz2
hercules-8ca4506ee9ad4bfd490d1e9a7ab2cfb02f1ba3d7.tar.xz
hercules-8ca4506ee9ad4bfd490d1e9a7ab2cfb02f1ba3d7.zip
Changed PCRE to properly use the system-provided pcre.h
Signed-off-by: Haru <haru@dotalux.com>
-rwxr-xr-xconfigure57
-rw-r--r--configure.in3
-rw-r--r--src/map/npc.h5
-rw-r--r--src/map/npc_chat.c3
4 files changed, 43 insertions, 25 deletions
diff --git a/configure b/configure
index 55da25ce8..d343d11a4 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.in dfdf6b9.
+# From configure.in 730fede.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69.
#
@@ -8108,13 +8108,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. */
@@ -8133,23 +8140,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 9dd53ab95..729a8f38e 100644
--- a/configure.in
+++ b/configure.in
@@ -1304,7 +1304,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>