[Qt-interest] [PATCH 2/2] mkspecs/qws: Use $(CROSS_COMPILE) to set the gcc prefix
Grant Likely
grant.likely at secretlab.ca
Thu Jan 14 19:38:38 CET 2010
$(CROSS_COMPILE) is commonly used to set the gcc prefix when
cross compiling. This patch enables the qws generic target to
pick up the correct cross compiler at configure time without
modifying/adding config files.
Using CROSS_COMPILE also eliminates the need for the qt config
files to know about all the possible gcc cross compiler
configurations. For example, ELDK uses a different prefix for
each target. On PowerPC alone ELDK provides ppc_4xx-gcc,
ppc_4xxFP-gcc, ppc_6xx-gcc, ppc_7xx-gcc, ppc_8xx-gcc, ppc_74xx-gcc,
ppc_82xx-gcc, ppc_85xx-gcc, and ppc_85xxDP.
---
mkspecs/qws/linux-generic-g++/qmake.conf | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/mkspecs/qws/linux-generic-g++/qmake.conf b/mkspecs/qws/linux-generic-g++/qmake.conf
index a026e88..bd1136d 100644
--- a/mkspecs/qws/linux-generic-g++/qmake.conf
+++ b/mkspecs/qws/linux-generic-g++/qmake.conf
@@ -1,9 +1,22 @@
#
# qmake configuration for building with g++
#
+# CROSS_COMPILE environmental variable is used to set the g++ prefix.
+#
include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)
+# modifications to g++.conf
+QMAKE_CC = $$(CROSS_COMPILE)gcc
+QMAKE_CXX = $$(CROSS_COMPILE)g++
+QMAKE_LINK = $$(CROSS_COMPILE)g++
+QMAKE_LINK_SHLIB = $$(CROSS_COMPILE)g++
+
+# modifications to linux.conf
+QMAKE_AR = $$(CROSS_COMPILE)ar cqs
+QMAKE_OBJCOPY = $$(CROSS_COMPILE)objcopy
+QMAKE_STRIP = $$(CROSS_COMPILE)strip
+
load(qt_config)
More information about the Qt-interest-old
mailing list