summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Pennock <pdp@exim.org>2012-06-25 03:27:47 -0700
committerPhil Pennock <pdp@exim.org>2012-06-25 03:27:47 -0700
commit13d08c906fd061e1ebd673789b132ce2a5d2e782 (patch)
treeaf08b9c0e620f4f5ab7c9ee4c833e5fb84cf27c1
parenta5f239e4959d4df6a4a341d8855e14d17399d671 (diff)
Let Linux makefile inherit CFLAGS/CFLAGS_DYNAMIC.
Pulled from Debian 30_dontoverridecflags.dpatch by Andreas Metzler. We just add CFLAGS_DYNAMIC too and some comments. Non-POSIX syntax, but fairly portable; GNU make gained it in 1998, we believe even very old systems should handle it fine.
-rw-r--r--doc/doc-txt/ChangeLog3
-rw-r--r--src/OS/Makefile-Linux9
2 files changed, 10 insertions, 2 deletions
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index 8fa9621bd..d1beab6e0 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -46,6 +46,9 @@ JH/03 Add expansion operators ${listnamed:name} and ${listcount:string}
PP/09 Add gnutls_enable_pkcs11 option.
+PP/10 Let Linux makefile inherit CFLAGS/CFLAGS_DYNAMIC.
+ Pulled from Debian 30_dontoverridecflags.dpatch by Andreas Metzler.
+
Exim version 4.80
-----------------
diff --git a/src/OS/Makefile-Linux b/src/OS/Makefile-Linux
index 8b721410e..990f884e9 100644
--- a/src/OS/Makefile-Linux
+++ b/src/OS/Makefile-Linux
@@ -1,5 +1,9 @@
# Exim: OS-specific make file for Linux. This is for modern Linuxes,
# which use libc6.
+#
+# For Linux, we assume GNU Make; at time of writing, the only extension
+# used is ?= which is actually portable to other maintained Make variants,
+# just is not POSIX.
HAVE_ICONV=yes
@@ -8,8 +12,9 @@ CHOWN_COMMAND=look_for_it
CHGRP_COMMAND=look_for_it
CHMOD_COMMAND=look_for_it
-CFLAGS=-O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-CFLAGS_DYNAMIC=-shared -rdynamic
+# Preserve CFLAGS and CFLAGS_DYNAMIC from the caller/environment
+CFLAGS ?= -O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
+CFLAGS_DYNAMIC ?= -shared -rdynamic
DBMLIB = -ldb
USE_DB = yes