[exim-cvs] pcre-config support.

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Exim Git Commits Mailing List
Dátum:  
Címzett: exim-cvs
Tárgy: [exim-cvs] pcre-config support.
Gitweb: http://git.exim.org/exim.git/commitdiff/6a6084f8fd44dc65dce40536198ec5d282deb126
Commit:     6a6084f8fd44dc65dce40536198ec5d282deb126
Parent:     1ca9f5074196f7fa459367956bcf6d4239b47634
Author:     Phil Pennock <pdp@???>
AuthorDate: Sat May 12 09:11:28 2012 -0400
Committer:  Phil Pennock <pdp@???>
CommitDate: Sat May 12 09:11:28 2012 -0400


    pcre-config support.


    Remove a couple of stray references to PCRE_CFLAGS too (dating from when PCRE was bundled).
---
 doc/doc-docbook/spec.xfpt      |    9 +++++++--
 doc/doc-txt/ChangeLog          |    3 +++
 doc/doc-txt/NewStuff           |    3 +++
 doc/doc-txt/OptionLists.txt    |    3 ++-
 src/OS/Makefile-SunOS4         |    5 -----
 src/OS/Makefile-mips           |    1 -
 src/scripts/Configure-Makefile |   15 ++++++++++++++-
 src/src/EDITME                 |    9 ++++++---
 8 files changed, 35 insertions(+), 13 deletions(-)


diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt
index 2202e6b..5104e50 100644
--- a/doc/doc-docbook/spec.xfpt
+++ b/doc/doc-docbook/spec.xfpt
@@ -1647,6 +1647,7 @@ architecture and operating system for itself, but the defaults can be
overridden if necessary.


+.new
.section "PCRE library" "SECTpcre"
.cindex "PCRE library"
Exim no longer has an embedded PCRE library as the vast majority of
@@ -1654,10 +1655,14 @@ modern systems include PCRE as a system library, although you may need
to install the PCRE or PCRE development package for your operating
system. If your system has a normal PCRE installation the Exim build
process will need no further configuration. If the library or the
-headers are in an unusual location you will need to set the PCRE_LIBS
-and INCLUDE directives appropriately. If your operating system has no
+headers are in an unusual location you will need to either set the PCRE_LIBS
+and INCLUDE directives appropriately,
+or set PCRE_CONFIG=yes to use the installed &(pcre-config)& command.
+If your operating system has no
PCRE support then you will need to obtain and build the current PCRE
from &url(ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/).
+More information on PCRE is available at &url(http://www.pcre.org/).
+.wen

.section "DBM libraries" "SECTdb"
.cindex "DBM libraries" "discussion of"
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index de7c178..6a34c57 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -93,6 +93,9 @@ PP/21 Defaulting "accept_8bitmime" to true, not false.

PP/22 Added -bw for inetd wait mode support.

+PP/23 Added PCRE_CONFIG=yes support to Makefile for using pcre-config to
+      locate the relevant includes and libraries.  Made this the default.
+


 Exim version 4.77
 -----------------
diff --git a/doc/doc-txt/NewStuff b/doc/doc-txt/NewStuff
index 432bbd2..db77318 100644
--- a/doc/doc-txt/NewStuff
+++ b/doc/doc-txt/NewStuff
@@ -26,6 +26,9 @@ Version 4.78
     "LOOKUP_LIBS" directly.  Similarly for handling the TLS library support
     without adjusting "TLS_INCLUDE" and "TLS_LIBS".


+    In addition, setting PCRE_CONFIG=yes will query the pcre-config tool to
+    find the headers and libraries for PCRE.
+
  4. New expansion variable $tls_bits.


  5. New lookup type, "dbmjz".  Key is an Exim list, the elements of which will
diff --git a/doc/doc-txt/OptionLists.txt b/doc/doc-txt/OptionLists.txt
index c962968..925504d 100644
--- a/doc/doc-txt/OptionLists.txt
+++ b/doc/doc-txt/OptionLists.txt
@@ -910,7 +910,8 @@ MAX_INTERFACES               system       maximum network interfaces
 MSGLOG_DIRECTORY_MODE        optional*    mode for message log directory
 MV_COMMAND                   system       path to mv command
 NO_SYMLINK                   optional     install doesn't make 'exim" symlink
-PCRE_CFLAGS                  system       compile flags for PCRE library
+PCRE_CONFIG                  system*      use pcre-config for PCRE support
+PCRE_LIBS                    system*      library for using PCRE
 PERL_CC                      system*      compiler for Perl interface code
 PERL_CCOPTS                  system*      flags for same
 PERL_COMMAND                 system       path to Perl
diff --git a/src/OS/Makefile-SunOS4 b/src/OS/Makefile-SunOS4
index 63db9c5..c876998 100644
--- a/src/OS/Makefile-SunOS4
+++ b/src/OS/Makefile-SunOS4
@@ -2,11 +2,6 @@


CFLAGS=-O

-# Don't need -DSTRERROR_FROM_ERRLIST in PCRE_CFLAGS, because it is in os.h
-# for SunOS4, which gets included for pcre.
-
-PCRE_CFLAGS=-DUSE_BCOPY
-
CHOWN_COMMAND=/usr/etc/chown
HOSTNAME_COMMAND=/usr/bin/hostname
EXIT_FAILURE=1
diff --git a/src/OS/Makefile-mips b/src/OS/Makefile-mips
index dbc101c..ff33139 100644
--- a/src/OS/Makefile-mips
+++ b/src/OS/Makefile-mips
@@ -8,7 +8,6 @@ LIBS=-liberty -lm
XINCLUDE=-I/usr/X11R6/include

CFLAGS=-O
-PCRE_CFLAGS=-DUSE_BCOPY -DSTRERROR_FROM_ERRLIST

 EXIWHAT_PS_ARG=-ax
 EXIWHAT_EGREP_ARG='/exim( |$$)'
diff --git a/src/scripts/Configure-Makefile b/src/scripts/Configure-Makefile
index 5ef0ff7..3e901e6 100755
--- a/src/scripts/Configure-Makefile
+++ b/src/scripts/Configure-Makefile
@@ -117,7 +117,7 @@ done >> $mft || exit 1
 egrep "^[$st]*(AUTH|LOOKUP)_[A-Z0-9_]*[$st]*=[$st]*" $mft | \
   sed "s/[$st]*=/='/" | \
   sed "s/\$/'/" > $mftt
-egrep "^[$st]*((USE_(OPENSSL|GNUTLS)_PC)|SUPPORT_TLS|USE_GNUTLS)[$st]*=[$st]*" $mft | \
+egrep "^[$st]*((USE_(OPENSSL|GNUTLS)_PC)|SUPPORT_TLS|USE_GNUTLS|PCRE_CONFIG)[$st]*=[$st]*" $mft | \
   sed "s/[$st]*=/='/" | \
   sed "s/\$/'/" >> $mftt
 if test -s $mftt
@@ -173,6 +173,19 @@ then
         fi
         ;;


+      PCRE_CONFIG)
+        case $PCRE_CONFIG in
+          yes|YES|y|Y)
+            cflags=`pcre-config --cflags`
+            libs=`pcre-config --libs`
+            if [ ".$cflags" != "." ]; then
+              echo "INCLUDE += $cflags"
+            fi
+            echo "PCRE_LIBS=$libs"
+            ;;
+        esac
+        ;;
+
     esac
   done
   echo "# End of pkg-config fixups"
diff --git a/src/src/EDITME b/src/src/EDITME
index f247f44..d972e9c 100644
--- a/src/src/EDITME
+++ b/src/src/EDITME
@@ -342,10 +342,13 @@ LOOKUP_DNSDB=yes
 # In either case you must specify the library link info here.  If the
 # PCRE header files are not in the standard search path you must also
 # modify the INCLUDE path (above)
-# The default setting of PCRE_LIBS should work on the vast majority of
-# systems
+#
+# Use PCRE_CONFIG to query the pcre-config command (first found in $PATH)
+# to find the include files and libraries, else use PCRE_LIBS and set INCLUDE
+# too if needed.


-PCRE_LIBS=-lpcre
+# PCRE_CONFIG=yes
+# PCRE_LIBS=-lpcre


#------------------------------------------------------------------------------