changeset 2644:bc02ddf3890b

Allow the compiler used to be overridden by setting BUILD_GCC/BUILD_CPP.
author andrew
date Fri, 29 Jul 2011 03:58:15 +0100
parents 8e3defb263a9
children 0856b81f0466
files agent/src/os/linux/Makefile make/linux/makefiles/gcc.make
diffstat 2 files changed, 31 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/agent/src/os/linux/Makefile	Fri Jul 29 01:13:58 2011 +0100
+++ b/agent/src/os/linux/Makefile	Fri Jul 29 03:58:15 2011 +0100
@@ -23,7 +23,12 @@
 #
 
 ARCH := $(shell if ([ `uname -m` = "ia64" ])  ; then echo ia64 ; elif ([ `uname -m` = "x86_64" ]) ; then echo amd64; elif ([ `uname -m` = "sparc64" ]) ; then echo sparc; else echo i386 ; fi )
-GCC      = gcc
+
+ifndef BUILD_GCC
+BUILD_GCC = gcc
+endif
+
+GCC      = $(BUILD_GCC)
 
 JAVAH    = ${JAVA_HOME}/bin/javah
 
--- a/make/linux/makefiles/gcc.make	Fri Jul 29 01:13:58 2011 +0100
+++ b/make/linux/makefiles/gcc.make	Fri Jul 29 03:58:15 2011 +0100
@@ -25,20 +25,35 @@
 #------------------------------------------------------------------------
 # CC, CPP & AS
 
-# When cross-compiling the ALT_COMPILER_PATH points
-# to the cross-compilation toolset
+ifndef HOST_GCC
+HOST_GCC = gcc
+endif
+
+ifndef HOST_CPP
+HOST_CPP = g++
+endif
+
+ifndef BUILD_GCC
 ifdef CROSS_COMPILE_ARCH
-CPP = $(ALT_COMPILER_PATH)/g++
-CC  = $(ALT_COMPILER_PATH)/gcc
-HOSTCPP = g++
-HOSTCC  = gcc
+BUILD_GCC  = $(ALT_COMPILER_PATH)/gcc
 else
-CPP = g++
-CC  = gcc
-HOSTCPP = $(CPP)
-HOSTCC  = $(CC)
+BUILD_GCC = gcc
+endif
 endif
 
+ifndef BUILD_CPP
+ifdef CROSS_COMPILE_ARCH
+BUILD_CPP = $(ALT_COMPILER_PATH)/g++$(GCC_SUFFIX)
+else
+BUILD_CPP = g++
+endif
+endif
+
+CPP = $(BUILD_CPP)
+CC = $(BUILD_GCC)
+HOSTCPP = $(HOST_CPP)
+HOSTCC  = $(HOST_GCC)
+
 AS  = $(CC) -c
 
 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only