[exim-cvs] Bail configuration on missing package

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Bail configuration on missing package
Gitweb: http://git.exim.org/exim.git/commitdiff/14ea0bea67dc606a55b1a7c29ce7e8595bd86f64
Commit:     14ea0bea67dc606a55b1a7c29ce7e8595bd86f64
Parent:     f64a1e235f8579c91d6ea0275d7d97e7a958709b
Author:     Phil Pennock <pdp@???>
AuthorDate: Tue Apr 15 23:25:45 2014 -0700
Committer:  Phil Pennock <pdp@???>
CommitDate: Tue Apr 15 23:25:45 2014 -0700


    Bail configuration on missing package


    If we're configured to use pkg-config (or pcre-config) and the tool is
    not available or does not know about the package we ask for, that should
    be a fatal configuration error.


    We should not silently ignore the missing package, then try to compile,
    and have missing header warnings from the compiler.  Eg, if we're told
    to support GSASL, we'll try to compile the client code, and without
    compiler flags, we'll either fail to compile (missing headers) or fail
    to link, which obscures the source of the errors.


    This change will only break people who had builds set to have Exim
    depend upon non-existent packages, and that _needs_ to break.
---
 src/scripts/Configure-Makefile |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)


diff --git a/src/scripts/Configure-Makefile b/src/scripts/Configure-Makefile
index 5e8a726..eeb26ee 100755
--- a/src/scripts/Configure-Makefile
+++ b/src/scripts/Configure-Makefile
@@ -142,6 +142,10 @@ then
         fi
         if [ ".$need_this" != "." ]; then
           tls_include=`pkg-config --cflags $pc_value`
+          if [ $? -ne 0 ]; then
+            echo >&2 "*** Missing pkg-config for package $pc_value (for Exim $var build option)"
+            exit 1
+          fi
           tls_libs=`pkg-config --libs $pc_value`
           echo "TLS_INCLUDE=$tls_include"
           echo "TLS_LIBS=$tls_libs"
@@ -161,6 +165,10 @@ then
         else
           # main binary
           cflags=`pkg-config --cflags $pc_value`
+          if [ $? -ne 0 ]; then
+            echo >&2 "*** Missing pkg-config for package $pc_value (for Exim $var build option)"
+            exit 1
+          fi
           libs=`pkg-config --libs $pc_value`
           if [ "$var" != "${var#LOOKUP_}" ]; then
             echo "LOOKUP_INCLUDE += $cflags"
@@ -178,6 +186,10 @@ then
         case $PCRE_CONFIG in
           yes|YES|y|Y)
             cflags=`pcre-config --cflags`
+            if [ $? -ne 0 ]; then
+              echo >&2 "*** Missing pcre-config for regular expression support"
+              exit 1
+            fi
             libs=`pcre-config --libs`
             if [ ".$cflags" != "." ]; then
               echo "INCLUDE += $cflags"
@@ -196,6 +208,10 @@ then
   echo "# End of pkg-config fixups"
   echo
   ) >> $mft
+  subexit=$?
+  if [ $subexit -ne 0 ]; then
+    exit $subexit
+  fi
 fi
 rm -f $mftt