summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@kiki.usersys.redhat.com>2009-05-28 09:55:06 -0700
committerNoriko Hosoi <nhosoi@kiki.usersys.redhat.com>2009-05-28 09:55:06 -0700
commit67aca96ae2c53f74f896439840a82cbccbeb34cf (patch)
treeba1da5996985d5990ca5cb13db118983e6b85b2c /m4
parent586da77caf36591a261506e89dcc9e6a4db00036 (diff)
downloadds-67aca96ae2c53f74f896439840a82cbccbeb34cf.tar.gz
ds-67aca96ae2c53f74f896439840a82cbccbeb34cf.tar.xz
ds-67aca96ae2c53f74f896439840a82cbccbeb34cf.zip
Use thread aware library for complex regex searches
For more details, see the design doc at http://directory.fedoraproject.org/wiki/Thread_Aware_Regex Additional 2 unrelated changes are being made: 1) dbgen.pl.in: secretary and manager are having a dn format value "cn=...". 2) slapi_counter_sunos_sparcv9.S: adding "#define _ASM 1" to force to set an assembler code macro _ASM.
Diffstat (limited to 'm4')
-rw-r--r--m4/pcre.m487
1 files changed, 87 insertions, 0 deletions
diff --git a/m4/pcre.m4 b/m4/pcre.m4
new file mode 100644
index 00000000..f60123e2
--- /dev/null
+++ b/m4/pcre.m4
@@ -0,0 +1,87 @@
+# BEGIN COPYRIGHT BLOCK
+# Copyright (C) 2007 Red Hat, Inc.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# END COPYRIGHT BLOCK
+
+AC_CHECKING(for pcre)
+
+dnl - check for --with-pcre
+AC_MSG_CHECKING(for --with-pcre)
+AC_ARG_WITH(pcre, [ --with-pcre=PATH Perl Compatible Regular Expression directory],
+[
+ if test "$withval" = "yes"; then
+ AC_MSG_RESULT(yes)
+ dnl - check in system locations
+ if test -f "/usr/include/pcre.h"; then
+ pcre_incdir="/usr/include"
+ pcre_inc="-I/usr/include"
+ pcre_lib='-L$(libdir)'
+ pcre_libdir='$(libdir)'
+ else
+ AC_MSG_ERROR([pcre.h not found])
+ fi
+ elif test -d "$withval"/include -a -d "$withval"/lib; then
+ AC_MSG_RESULT([using $withval])
+ dnl - check the user provided location
+ PCREDIR=$withval
+ pcre_lib="-L$PCREDIR/lib"
+ pcre_libdir="$PCREDIR/lib"
+ pcre_incdir="$PCREDIR/include"
+ if ! test -e "$pcre_incdir/pcre.h" ; then
+ AC_MSG_ERROR([$withval include dir not found])
+ fi
+ pcre_inc="-I$pcre_incdir"
+ else
+ echo
+ AC_MSG_ERROR([$withval not found])
+ fi
+],
+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)
+ if test -n "$PKG_CONFIG"; then
+ if $PKG_CONFIG --exists pcre; then
+ pcre_inc=`$PKG_CONFIG --cflags-only-I pcre`
+ 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])
+ else
+ AC_MSG_ERROR([PCRE not found, specify with --with-pcre.])
+ fi
+ fi
+fi