summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2009-08-12 09:03:32 -0600
committerRich Megginson <rmeggins@redhat.com>2009-08-12 12:47:36 -0600
commitb2c5e72befb090c853a568d269b5ea66620adbc0 (patch)
tree951e11fc549f85fe3e6aebabc498d2511d5bf26c
parent289cac6b186fc62eaf8e303b54d204c97d71d69c (diff)
downloadds-b2c5e72befb090c853a568d269b5ea66620adbc0.tar.gz
ds-b2c5e72befb090c853a568d269b5ea66620adbc0.tar.xz
ds-b2c5e72befb090c853a568d269b5ea66620adbc0.zip
fix pcre build issues
Reviewed by: nkinder (Thanks!)
-rw-r--r--Makefile.am4
-rw-r--r--Makefile.in4
-rwxr-xr-xconfigure45
-rw-r--r--ldap/servers/slapd/regex.c3
-rw-r--r--ldap/servers/slapd/slap.h3
-rw-r--r--m4/pcre.m437
6 files changed, 53 insertions, 43 deletions
diff --git a/Makefile.am b/Makefile.am
index f984ac85..b26daf38 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -556,7 +556,7 @@ libslapd_la_SOURCES = ldap/servers/slapd/add.c \
ldap/servers/slapd/vattr.c \
$(libavl_a_SOURCES)
-libslapd_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) @sasl_inc@ @db_inc@ @svrcore_inc@ @kerberos_inc@
+libslapd_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) @sasl_inc@ @db_inc@ @svrcore_inc@ @kerberos_inc@ @pcre_inc@
if SOLARIS
libslapd_la_SOURCES += ldap/servers/slapd/slapi_counter_sunos_sparcv9.S
endif
@@ -1130,7 +1130,7 @@ ns_slapd_SOURCES = ldap/servers/slapd/abandon.c \
$(GETSOCKETPEER)
ns_slapd_CPPFLAGS = $(AM_CPPFLAGS) @sasl_inc@ @openldap_inc@ @ldapsdk_inc@ @nss_inc@ \
- @nspr_inc@ @svrcore_inc@ @pcre_inc@
+ @nspr_inc@ @svrcore_inc@
ns_slapd_LDADD = libslapd.la libldaputil.a $(LDAPSDK_LINK) $(NSS_LINK) \
$(NSPR_LINK) $(SASL_LINK) $(SVRCORE_LINK) $(LIBNSL) $(LIBSOCKET)
# We need to link ns-slapd with the C++ compiler on HP-UX since we load
diff --git a/Makefile.in b/Makefile.in
index 7a6a93e5..948c611a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1559,7 +1559,7 @@ libslapd_la_SOURCES = ldap/servers/slapd/add.c \
ldap/servers/slapd/uuid.c ldap/servers/slapd/value.c \
ldap/servers/slapd/valueset.c ldap/servers/slapd/vattr.c \
$(libavl_a_SOURCES) $(am__append_1)
-libslapd_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) @sasl_inc@ @db_inc@ @svrcore_inc@ @kerberos_inc@
+libslapd_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) @sasl_inc@ @db_inc@ @svrcore_inc@ @kerberos_inc@ @pcre_inc@
libslapd_la_LIBADD = $(LDAPSDK_LINK) $(SASL_LINK) $(SVRCORE_LINK) $(NSS_LINK) $(NSPR_LINK) $(KERBEROS_LINK) $(PCRE_LINK)
#////////////////////////////////////////////////////////////////
@@ -2100,7 +2100,7 @@ ns_slapd_SOURCES = ldap/servers/slapd/abandon.c \
$(GETSOCKETPEER)
ns_slapd_CPPFLAGS = $(AM_CPPFLAGS) @sasl_inc@ @openldap_inc@ @ldapsdk_inc@ @nss_inc@ \
- @nspr_inc@ @svrcore_inc@ @pcre_inc@
+ @nspr_inc@ @svrcore_inc@
ns_slapd_LDADD = libslapd.la libldaputil.a $(LDAPSDK_LINK) $(NSS_LINK) \
$(NSPR_LINK) $(SASL_LINK) $(SVRCORE_LINK) $(LIBNSL) $(LIBSOCKET)
diff --git a/configure b/configure
index fdf49b92..40767092 100755
--- a/configure
+++ b/configure
@@ -27005,28 +27005,8 @@ else
echo "${ECHO_T}no" >&6
fi;
-if test -z "$pcre_inc"; then
- echo "$as_me:$LINENO: checking for pcre.h" >&5
-echo $ECHO_N "checking for pcre.h... $ECHO_C" >&6
- if test -f "/usr/include/pcre.h"; then
- echo "$as_me:$LINENO: result: using /usr/include/pcre.h" >&5
-echo "${ECHO_T}using /usr/include/pcre.h" >&6
- pcre_incdir="/usr/include"
- pcre_inc="-I/usr/include"
- pcre_lib='-L$(libdir)'
- pcre_libdir='$(libdir)'
- else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- { { echo "$as_me:$LINENO: error: pcre not found, specify with --with-pcre." >&5
-echo "$as_me: error: pcre not found, specify with --with-pcre." >&2;}
- { (exit 1); exit 1; }; }
- fi
-fi
#
# if PCRE is not found yet, try pkg-config
-
-# last resort
if test -z "$pcre_inc" -o -z "$pcre_lib" -o -z "$pcre_libdir"; then
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
@@ -27076,6 +27056,12 @@ echo $ECHO_N "checking for pcre with pkg-config... $ECHO_C" >&6
pcre_libdir=`$PKG_CONFIG --libs-only-L pcre | sed -e s/-L// | sed -e s/\ .*$//`
echo "$as_me:$LINENO: result: using system PCRE" >&5
echo "${ECHO_T}using system PCRE" >&6
+ elif $PKG_CONFIG --exists libpcre; then
+ pcre_inc=`$PKG_CONFIG --cflags-only-I libpcre`
+ pcre_lib=`$PKG_CONFIG --libs-only-L libpcre`
+ pcre_libdir=`$PKG_CONFIG --libs-only-L libpcre | sed -e s/-L// | sed -e s/\ .*$//`
+ echo "$as_me:$LINENO: result: using system PCRE" >&5
+echo "${ECHO_T}using system PCRE" >&6
else
{ { echo "$as_me:$LINENO: error: PCRE not found, specify with --with-pcre." >&5
echo "$as_me: error: PCRE not found, specify with --with-pcre." >&2;}
@@ -27084,6 +27070,25 @@ echo "$as_me: error: PCRE not found, specify with --with-pcre." >&2;}
fi
fi
+if test -z "$pcre_inc"; then
+ echo "$as_me:$LINENO: checking for pcre.h" >&5
+echo $ECHO_N "checking for pcre.h... $ECHO_C" >&6
+ if test -f "/usr/include/pcre.h"; then
+ echo "$as_me:$LINENO: result: using /usr/include/pcre.h" >&5
+echo "${ECHO_T}using /usr/include/pcre.h" >&6
+ pcre_incdir="/usr/include"
+ pcre_inc="-I/usr/include"
+ pcre_lib='-L$(libdir)'
+ pcre_libdir='$(libdir)'
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ { { echo "$as_me:$LINENO: error: pcre not found, specify with --with-pcre." >&5
+echo "$as_me: error: pcre not found, specify with --with-pcre." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+fi
+
PACKAGE_BASE_VERSION=`echo $PACKAGE_VERSION | awk -F\. '{print $1"."$2}'`
diff --git a/ldap/servers/slapd/regex.c b/ldap/servers/slapd/regex.c
index 24e7b860..6eb682a4 100644
--- a/ldap/servers/slapd/regex.c
+++ b/ldap/servers/slapd/regex.c
@@ -45,6 +45,9 @@
#include "slap.h"
#include "slapi-plugin.h"
+/* Perl Compatible Regular Expression */
+#include <pcre.h>
+
struct slapi_regex_handle {
pcre *re_pcre; /* contains the compiled pattern */
int *re_ovector; /* output vector */
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index 55184a32..ceb46b2c 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -167,9 +167,6 @@ typedef struct symbol_t {
#include "csngen.h"
#include "uuid.h"
-/* Perl Compatible Regular Expression */
-#include <pcre.h>
-
#if defined(OS_solaris)
# include <thread.h>
# define GET_THREAD_ID() thr_self()
diff --git a/m4/pcre.m4 b/m4/pcre.m4
index f60123e2..6096108d 100644
--- a/m4/pcre.m4
+++ b/m4/pcre.m4
@@ -53,24 +53,8 @@ AC_ARG_WITH(pcre, [ --with-pcre=PATH Perl Compatible Regular Expression direc
],
AC_MSG_RESULT(no))
-dnl - check in system locations
-if test -z "$pcre_inc"; then
- AC_MSG_CHECKING(for pcre.h)
- if test -f "/usr/include/pcre.h"; then
- AC_MSG_RESULT([using /usr/include/pcre.h])
- pcre_incdir="/usr/include"
- pcre_inc="-I/usr/include"
- pcre_lib='-L$(libdir)'
- pcre_libdir='$(libdir)'
- else
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([pcre not found, specify with --with-pcre.])
- fi
-fi
#
# if PCRE is not found yet, try pkg-config
-
-# last resort
if test -z "$pcre_inc" -o -z "$pcre_lib" -o -z "$pcre_libdir"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config)
AC_MSG_CHECKING(for pcre with pkg-config)
@@ -80,8 +64,29 @@ if test -z "$pcre_inc" -o -z "$pcre_lib" -o -z "$pcre_libdir"; then
pcre_lib=`$PKG_CONFIG --libs-only-L pcre`
pcre_libdir=`$PKG_CONFIG --libs-only-L pcre | sed -e s/-L// | sed -e s/\ .*$//`
AC_MSG_RESULT([using system PCRE])
+ elif $PKG_CONFIG --exists libpcre; then
+ pcre_inc=`$PKG_CONFIG --cflags-only-I libpcre`
+ pcre_lib=`$PKG_CONFIG --libs-only-L libpcre`
+ pcre_libdir=`$PKG_CONFIG --libs-only-L libpcre | sed -e s/-L// | sed -e s/\ .*$//`
+ AC_MSG_RESULT([using system PCRE])
else
AC_MSG_ERROR([PCRE not found, specify with --with-pcre.])
fi
fi
fi
+
+dnl last resort
+dnl - check in system locations
+if test -z "$pcre_inc"; then
+ AC_MSG_CHECKING(for pcre.h)
+ if test -f "/usr/include/pcre.h"; then
+ AC_MSG_RESULT([using /usr/include/pcre.h])
+ pcre_incdir="/usr/include"
+ pcre_inc="-I/usr/include"
+ pcre_lib='-L$(libdir)'
+ pcre_libdir='$(libdir)'
+ else
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR([pcre not found, specify with --with-pcre.])
+ fi
+fi