From 943f415f81207ea00bf1efe8c2c1cbf13a094a56 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Fri, 4 Dec 2009 15:20:12 -0800 Subject: configure: Support the capturing of CFLAGS and CXXFLAGS at configure time. These variables can now be set via configure time via environment variables like so: CFLAGS=-g ./configure and subsequent builds will remember these values. The values can still be overridden at compile time by passing make variables: make CFLAGS=-O2 The CXXFLAGS variable is optional. If unset at either configure time or at compile time, it will inherit its value from the CFLAGS variable. (Though if explicitly set at configure time it must be explicitly overriden at compile time---just overriding CFLAGS will not override CXXFLAGS as well.) --- configure | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'configure') diff --git a/configure b/configure index 488b3bd7..ff8baa5e 100755 --- a/configure +++ b/configure @@ -2,6 +2,8 @@ CC=${CC:-gcc} CXX=${CXX:-g++} +CFLAGS=${CFLAGS:--O2} +CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)} # defaults PREFIX=/usr/local @@ -195,6 +197,12 @@ CC = ${CC} # The C++ compiler to use CXX = ${CXX} +# Default FLAGS for C compiler (can be overridden by user such as "make CFLAGS=-g") +CFLAGS = ${CFLAGS} + +# Default FLAGS for C++ compiler (can be overridden by user such as "make CXXFLAGS=-g") +CXXFLAGS = ${CXXFLAGS} + # The prefix to which notmuch should be installed prefix = ${PREFIX} -- cgit v1.2.3