Patchwork [19/39] add CPP variable

login
register
mail settings
Submitter Paolo Bonzini
Date Oct. 12, 2010, 1 p.m.
Message ID <1286888457-5033-20-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/67579/
State New
Headers show

Comments

Paolo Bonzini - Oct. 12, 2010, 1 p.m.
There is already a CPP makefile variable, treat it consistently
with every other tool.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

Patch

diff --git a/configure b/configure
index 1ea56f7..8273f84 100755
--- a/configure
+++ b/configure
@@ -185,6 +185,8 @@  for opt do
   --source-path=*) source_path="$optarg"
   source_path_used="yes"
   ;;
+  CPP=*) CPP="$optarg"
+  ;;
   --cpu=*) cpu="$optarg"
   ;;
   CFLAGS=*) CFLAGS="$CFLAGS"
@@ -219,6 +221,7 @@  done
 # we can eliminate it's usage altogether
 
 cc="${cross_prefix}${CC-gcc}"
+cpp="${cross_prefix}${CPP-cpp}"
 ar="${cross_prefix}${AR-ar}"
 objcopy="${cross_prefix}${OBJCOPY-objcopy}"
 ld="${cross_prefix}${LD-ld}"
@@ -519,6 +522,8 @@  for opt do
   ;;
   CC=*|--cc=*)
   ;;
+  CPP=*)
+  ;;
   --host-cc=*)
   ;;
   --make=*) make="$optarg"
@@ -930,6 +935,7 @@  echo ""
 echo "Some influential environment variables can be passed on the command line:"
 echo "  CC          C compiler command"
 echo "  CFLAGS      C compiler flags"
+echo "  CPP         C preprocessor command"
 echo "  CPPFLAGS    C preprocessor flags, e.g. -I<include dir> if you have"
 echo "              headers in a nonstandard directory <include dir>"
 echo "  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a"
@@ -2290,6 +2296,7 @@  echo "ELF interp prefix $interp_prefix"
 fi
 echo "Source path       $source_path"
 echo "C compiler        $cc"
+echo "C preprocessor    $cpp"
 echo "CFLAGS            $CFLAGS"
 echo "CPPFLAGS          $CPPFLAGS"
 echo "QEMU_CFLAGS       $QEMU_CFLAGS"
@@ -2653,6 +2660,7 @@  echo "INSTALL_DIR=$install -d -m0755 -p" >> $config_host_mak
 echo "INSTALL_DATA=$install -m0644 -p" >> $config_host_mak
 echo "INSTALL_PROG=$install -m0755 -p" >> $config_host_mak
 echo "CC=$cc" >> $config_host_mak
+echo "CPP=$cpp" >> $config_host_mak
 echo "AR=$ar" >> $config_host_mak
 echo "OBJCOPY=$objcopy" >> $config_host_mak
 echo "LD=$ld" >> $config_host_mak
@@ -3140,7 +3148,7 @@  for rom in seabios vgabios ; do
     echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak
     echo "CC=$cc" >> $config_mak
     echo "BCC=bcc" >> $config_mak
-    echo "CPP=${cross_prefix}cpp" >> $config_mak
+    echo "CPP=$cpp" >> $config_mak
     echo "OBJCOPY=objcopy" >> $config_mak
     echo "IASL=iasl" >> $config_mak
     echo "LD=$ld" >> $config_mak