[llvm] r174313 - Pass CPPFLAGS/CFLAGS/CXXFLAGS from the environment of configure to

Patrik Hagglund patrik.h.hagglund at ericsson.com
Mon Feb 4 00:15:54 PST 2013


Author: patha
Date: Mon Feb  4 02:15:53 2013
New Revision: 174313

URL: http://llvm.org/viewvc/llvm-project?rev=174313&view=rev
Log:
Pass CPPFLAGS/CFLAGS/CXXFLAGS from the environment of configure to
Makefile.config.

This is implied at the bottom of the help text of configure (besides
CC/CXX/LDFLAGS, already passed to Makefile.config).

For backward compatibility, the values of CFLAGS and CXXFLAGS defaults
to empty, overriding the default values provided by autoconf (for
example, '-g -O2' when CC=gcc').

$(CPP) is not used by our makefiles. Therefore, the value of CPP is
not passed to Makefile.config, despite beeing mentioned by 'configure
--help'.

Modified:
    llvm/trunk/Makefile.config.in
    llvm/trunk/autoconf/configure.ac
    llvm/trunk/configure
    llvm/trunk/docs/MakefileGuide.rst

Modified: llvm/trunk/Makefile.config.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.config.in?rev=174313&r1=174312&r2=174313&view=diff
==============================================================================
--- llvm/trunk/Makefile.config.in (original)
+++ llvm/trunk/Makefile.config.in Mon Feb  4 02:15:53 2013
@@ -156,8 +156,17 @@ CXX = @CXX@
 # Path to the CC binary, which use used by testcases for native builds.
 CC := @CC@
 
+# C/C++ preprocessor flags.
+CPPFLAGS += @CPPFLAGS@
+
+# C compiler flags.
+CFLAGS += @CFLAGS@
+
+# C++ compiler flags.
+CXXFLAGS += @CXXFLAGS@
+
 # Linker flags.
-LDFLAGS+=@LDFLAGS@
+LDFLAGS += @LDFLAGS@
 
 # Path to the library archiver program.
 AR_PATH = @AR@

Modified: llvm/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=174313&r1=174312&r2=174313&view=diff
==============================================================================
--- llvm/trunk/autoconf/configure.ac (original)
+++ llvm/trunk/autoconf/configure.ac Mon Feb  4 02:15:53 2013
@@ -59,6 +59,11 @@ if test ${srcdir} != "." ; then
   fi
 fi
 
+dnl Default to empty (i.e. assigning the null string to) CFLAGS and CXXFLAGS,
+dnl instead of the autoconf default (for example, '-g -O2' for CC=gcc).
+${CFLAGS=}
+${CXXFLAGS=}
+
 dnl We need to check for the compiler up here to avoid anything else
 dnl starting with a different one.
 AC_PROG_CC(clang llvm-gcc gcc)

Modified: llvm/trunk/configure
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=174313&r1=174312&r2=174313&view=diff
==============================================================================
--- llvm/trunk/configure (original)
+++ llvm/trunk/configure Mon Feb  4 02:15:53 2013
@@ -1981,6 +1981,9 @@ echo "$as_me: error: Already configured 
   fi
 fi
 
+${CFLAGS=}
+${CXXFLAGS=}
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -5606,8 +5609,8 @@ case "$enableval" in
         x86_64)   TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
         sparc)    TARGETS_TO_BUILD="Sparc $TARGETS_TO_BUILD" ;;
         powerpc)  TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD" ;;
-        arm)      TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;;
         aarch64)  TARGETS_TO_BUILD="AArch64 $TARGETS_TO_BUILD" ;;
+        arm)      TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;;
         mips)     TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
         mipsel)   TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
         mips64)   TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
@@ -8716,7 +8719,9 @@ if test "${enable_ltdl_install+set}" = s
 fi
 
 
- if test x"${enable_ltdl_install-no}" != xno; then
+
+
+if test x"${enable_ltdl_install-no}" != xno; then
   INSTALL_LTDL_TRUE=
   INSTALL_LTDL_FALSE='#'
 else
@@ -8724,7 +8729,9 @@ else
   INSTALL_LTDL_FALSE=
 fi
 
- if test x"${enable_ltdl_convenience-no}" != xno; then
+
+
+if test x"${enable_ltdl_convenience-no}" != xno; then
   CONVENIENCE_LTDL_TRUE=
   CONVENIENCE_LTDL_FALSE='#'
 else
@@ -10491,7 +10498,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 10493 "configure"
+#line 10501 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H

Modified: llvm/trunk/docs/MakefileGuide.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/MakefileGuide.rst?rev=174313&r1=174312&r2=174313&view=diff
==============================================================================
--- llvm/trunk/docs/MakefileGuide.rst (original)
+++ llvm/trunk/docs/MakefileGuide.rst Mon Feb  4 02:15:53 2013
@@ -699,6 +699,9 @@ The override variables are given below:
 ``CFLAGS``
     Additional flags to be passed to the 'C' compiler.
 
+``CPPFLAGS``
+    Additional flags passed to the C/C++ preprocessor.
+
 ``CXX``
     Specifies the path to the C++ compiler.
 





More information about the llvm-commits mailing list