[exim-cvs] Support pkg-config for SSL libraries.

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Support pkg-config for SSL libraries.
Gitweb: http://git.exim.org/exim.git/commitdiff/f4b00a2db9b3f3a52232dd52229d50122f941058
Commit:     f4b00a2db9b3f3a52232dd52229d50122f941058
Parent:     252e0c7b1235b8474023a0ab187c35a3088d3cb1
Author:     Phil Pennock <pdp@???>
AuthorDate: Sat Feb 18 09:10:50 2012 -0500
Committer:  Phil Pennock <pdp@???>
CommitDate: Sat Feb 18 09:10:50 2012 -0500


    Support pkg-config for SSL libraries.


    Also: update EDITME to refer to pkg-config & AUTH_HEIMDAL_GSSAPI.
---
 src/scripts/Configure-Makefile |   24 ++++++++++++++++++++++++
 src/src/EDITME                 |   27 ++++++++++++++++++++++++---
 2 files changed, 48 insertions(+), 3 deletions(-)


diff --git a/src/scripts/Configure-Makefile b/src/scripts/Configure-Makefile
index 24ba108..5ef0ff7 100755
--- a/src/scripts/Configure-Makefile
+++ b/src/scripts/Configure-Makefile
@@ -117,6 +117,9 @@ 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 | \
+  sed "s/[$st]*=/='/" | \
+  sed "s/\$/'/" >> $mftt
 if test -s $mftt
 then
   (
@@ -124,6 +127,26 @@ then
   . ./$mftt
   for var in `cut -d = -f 1 < $mftt`; do
     case $var in
+
+      USE_*_PC)
+        eval "pc_value=\"\$$var\""
+        need_this=''
+        if [ ".$SUPPORT_TLS" = "." ]; then
+          # no TLS, not referencing
+          true
+        elif [ ".$var" = ".USE_GNUTLS_PC" ] && [ ".$USE_GNUTLS" != "." ]; then
+          need_this=t
+        elif [ ".$var" = ".USE_OPENSSL_PC" ] && [ ".$USE_GNUTLS" = "." ]; then
+          need_this=t
+        fi
+        if [ ".$need_this" != "." ]; then
+          tls_include=`pkg-config --cflags $pc_value`
+          tls_libs=`pkg-config --libs $pc_value`
+          echo "TLS_INCLUDE=$tls_include"
+          echo "TLS_LIBS=$tls_libs"
+        fi
+        ;;
+
       *_PC)
         eval "pc_value=\"\$$var\""
         base=`echo $var | sed 's/_PC$//'`
@@ -149,6 +172,7 @@ then
           fi
         fi
         ;;
+
     esac
   done
   echo "# End of pkg-config fixups"
diff --git a/src/src/EDITME b/src/src/EDITME
index 7e426ea..fc57054 100644
--- a/src/src/EDITME
+++ b/src/src/EDITME
@@ -279,6 +279,10 @@ TRANSPORT_SMTP=yes
 # the dynamic library and not the exim binary will be linked against the
 # library.
 # NOTE: LDAP cannot be built as a module!
+#
+# If your system has pkg-config then the _INCLUDE/_LIBS setting can be
+# handled for you automatically by also defining the _PC variable to reference
+# the name of the pkg-config package, if such is available.


LOOKUP_DBM=yes
LOOKUP_LSEARCH=yes
@@ -295,6 +299,7 @@ LOOKUP_DNSDB=yes
# LOOKUP_PASSWD=yes
# LOOKUP_PGSQL=yes
# LOOKUP_SQLITE=yes
+# LOOKUP_SQLITE_PC=sqlite3
# LOOKUP_WHOSON=yes

# These two settings are obsolete; all three lookups are compiled when
@@ -342,6 +347,8 @@ PCRE_LIBS=-lpcre
# don't need to set LOOKUP_INCLUDE if the relevant directories are already
# specified in INCLUDE. The settings below are just examples; -lpq is for
# PostgreSQL, -lgds is for Interbase, -lsqlite3 is for SQLite.
+#
+# You do not need to use this for any lookup information added via pkg-config.

# LOOKUP_INCLUDE=-I /usr/local/ldap/include -I /usr/local/mysql/include -I /usr/local/pgsql/include
# LOOKUP_LIBS=-L/usr/local/lib -lldap -llber -lmysqlclient -lpq -lgds -lsqlite3
@@ -554,6 +561,9 @@ FIXED_NEVER_USERS=root
# AUTH_CYRUS_SASL=yes
# AUTH_DOVECOT=yes
# AUTH_GSASL=yes
+# AUTH_GSASL_PC=libgsasl
+# AUTH_HEIMDAL_GSSAPI=yes
+# AUTH_HEIMDAL_GSSAPI_PC=heimdal-gssapi
# AUTH_PLAINTEXT=yes
# AUTH_SPA=yes

@@ -561,10 +571,13 @@ FIXED_NEVER_USERS=root
#------------------------------------------------------------------------------
# If you specified AUTH_CYRUS_SASL above, you should ensure that you have the
# Cyrus SASL library installed before trying to build Exim, and you probably
-# want to uncomment the first line below. Similarly for GNU SASL.
+# want to uncomment the first line below.
+# Similarly for GNU SASL, unless pkg-config is used via AUTH_GSASL_PC.
+# Ditto for AUTH_HEIMDAL_GSSAPI(_PC).

# AUTH_LIBS=-lsasl2
# AUTH_LIBS=-lgsasl
+# AUTH_LIBS=-lgssapi -lheimntlm -lkrb5 -lhx509 -lcom_err -lhcrypto -lasn1 -lwind -lroken -lcrypt


#------------------------------------------------------------------------------
@@ -657,11 +670,14 @@ HEADERS_CHARSET="ISO-8859-1"
# This setting is required for any TLS support (either OpenSSL or GnuTLS)
# SUPPORT_TLS=yes

-# Uncomment this setting if you are using OpenSSL
+# Uncomment one of these settings if you are using OpenSSL; pkg-config vs not
+# USE_OPENSSL_PC=openssl
# TLS_LIBS=-lssl -lcrypto

-# Uncomment these settings if you are using GnuTLS
+# Uncomment the first and either the second or the third of these if you
+# are using GnuTLS. If you have pkg-config, then the second, else the third.
# USE_GNUTLS=yes
+# USE_GNUTLS_PC=gnutls
# TLS_LIBS=-lgnutls -ltasn1 -lgcrypt

# If you are running Exim as a server, note that just building it with TLS
@@ -672,6 +688,11 @@ HEADERS_CHARSET="ISO-8859-1"
# if you are running Exim only as a client, building it with TLS support
# is all you need to do.

+# If you are using pkg-config then you should not need to worry where the
+# libraries and headers are installed, as the pkg-config .pc specification
+# should include all -L/-I information necessary. If not using pkg-config
+# then you might need to specify the locations too.
+
# Additional libraries and include files are required for both OpenSSL and
# GnuTLS. The TLS_LIBS settings above assume that the libraries are installed
# with all your other libraries. If they are in a special directory, you may