From 48d19919cc82f637ee96873f81c957cdf9b84127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 27 Oct 2010 13:44:11 +0200 Subject: mkspecs: Emit warning when including g++.conf directly 86636e0c4ab91bfb6 refactored the mkspecs, but didn't account for people with their own mkspec who would still include g++.conf directly. We now print a warning if this situation is detected, and explain to the user how they can fix their mkspec. For convenience we redirect g++.conf to g++-unix.conf so that people's mkspecs will still work. Reviewed-by: Marius Storm-Olsen --- mkspecs/common/g++-base.conf | 23 ++++++++++++ mkspecs/common/g++-mac.conf | 32 ---------------- mkspecs/common/g++-macx.conf | 32 ++++++++++++++++ mkspecs/common/g++-unix.conf | 2 +- mkspecs/common/g++.conf | 24 +++--------- mkspecs/common/gcc-base-mac.conf | 43 ---------------------- mkspecs/common/gcc-base-macx.conf | 43 ++++++++++++++++++++++ mkspecs/common/gcc-base.conf | 10 ++--- mkspecs/macx-g++/qmake.conf | 4 +- mkspecs/macx-g++40/qmake.conf | 4 +- mkspecs/macx-g++42/qmake.conf | 4 +- mkspecs/macx-llvm/qmake.conf | 2 +- mkspecs/macx-xcode/qmake.conf | 4 +- mkspecs/symbian-gcce/qmake.conf | 3 +- mkspecs/unsupported/macx-clang/qmake.conf | 2 +- mkspecs/unsupported/qws/qnx-generic-g++/qmake.conf | 1 - 16 files changed, 122 insertions(+), 111 deletions(-) create mode 100644 mkspecs/common/g++-base.conf delete mode 100644 mkspecs/common/g++-mac.conf create mode 100644 mkspecs/common/g++-macx.conf delete mode 100644 mkspecs/common/gcc-base-mac.conf create mode 100644 mkspecs/common/gcc-base-macx.conf diff --git a/mkspecs/common/g++-base.conf b/mkspecs/common/g++-base.conf new file mode 100644 index 0000000..d73b38f --- /dev/null +++ b/mkspecs/common/g++-base.conf @@ -0,0 +1,23 @@ +# +# Qmake configuration for the GNU C++ compiler +# +# Before making changes to this file, please read the comment in +# gcc-base.conf, to make sure the change goes in the right place. +# +# To verify that your change has the desired effect on the final configuration +# you can use the manual test in tests/manual/mkspecs. +# + +QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g + +QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO + +QMAKE_LINK_C = $$QMAKE_CC +QMAKE_LINK_C_SHLIB = $$QMAKE_CC + +QMAKE_PCH_OUTPUT_EXT = .gch + +QMAKE_CFLAGS_PRECOMPILE = -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} +QMAKE_CFLAGS_USE_PRECOMPILE = -include ${QMAKE_PCH_OUTPUT_BASE} +QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} +QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE diff --git a/mkspecs/common/g++-mac.conf b/mkspecs/common/g++-mac.conf deleted file mode 100644 index bcfd9aa..0000000 --- a/mkspecs/common/g++-mac.conf +++ /dev/null @@ -1,32 +0,0 @@ -# -# Qmake configuration for the GNU C++ compiler on Mac OS X -# -# Before making changes to this file, please read the comment in -# gcc-base.conf, to make sure the change goes in the right place. -# -# To verify that your change has the desired effect on the final configuration -# you can use the manual test in tests/manual/mkspecs. -# - -include(g++.conf) - -QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_DWARF2 -QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_DWARF2 -QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += -g $$QMAKE_CFLAGS_DWARF2 - -QMAKE_LFLAGS_STATIC_LIB += -all_load - -QMAKE_CFLAGS_X86_64 += -Xarch_x86_64 -mmacosx-version-min=10.5 -QMAKE_CFLAGS_PPC_64 += -Xarch_ppc64 -mmacosx-version-min=10.5 - -QMAKE_CXXFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64 -QMAKE_CXXFLAGS_PPC_64 = $$QMAKE_CFLAGS_PPC_64 -QMAKE_OBJECTIVE_CFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64 -QMAKE_OBJECTIVE_CFLAGS_PPC_64 = $$QMAKE_CFLAGS_PPC_64 -QMAKE_LFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64 -QMAKE_LFLAGS_PPC_64 = $$QMAKE_CFLAGS_PPC_64 - -QMAKE_OBJCFLAGS_PRECOMPILE = -x objective-c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} -QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE -QMAKE_OBJCXXFLAGS_PRECOMPILE = -x objective-c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} -QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE diff --git a/mkspecs/common/g++-macx.conf b/mkspecs/common/g++-macx.conf new file mode 100644 index 0000000..2251157 --- /dev/null +++ b/mkspecs/common/g++-macx.conf @@ -0,0 +1,32 @@ +# +# Qmake configuration for the GNU C++ compiler on Mac OS X +# +# Before making changes to this file, please read the comment in +# gcc-base.conf, to make sure the change goes in the right place. +# +# To verify that your change has the desired effect on the final configuration +# you can use the manual test in tests/manual/mkspecs. +# + +include(g++-base.conf) + +QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_DWARF2 +QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_DWARF2 +QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += -g $$QMAKE_CFLAGS_DWARF2 + +QMAKE_LFLAGS_STATIC_LIB += -all_load + +QMAKE_CFLAGS_X86_64 += -Xarch_x86_64 -mmacosx-version-min=10.5 +QMAKE_CFLAGS_PPC_64 += -Xarch_ppc64 -mmacosx-version-min=10.5 + +QMAKE_CXXFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64 +QMAKE_CXXFLAGS_PPC_64 = $$QMAKE_CFLAGS_PPC_64 +QMAKE_OBJECTIVE_CFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64 +QMAKE_OBJECTIVE_CFLAGS_PPC_64 = $$QMAKE_CFLAGS_PPC_64 +QMAKE_LFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64 +QMAKE_LFLAGS_PPC_64 = $$QMAKE_CFLAGS_PPC_64 + +QMAKE_OBJCFLAGS_PRECOMPILE = -x objective-c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} +QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE +QMAKE_OBJCXXFLAGS_PRECOMPILE = -x objective-c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} +QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE diff --git a/mkspecs/common/g++-unix.conf b/mkspecs/common/g++-unix.conf index 09b3e90..96e301e 100644 --- a/mkspecs/common/g++-unix.conf +++ b/mkspecs/common/g++-unix.conf @@ -8,7 +8,7 @@ # you can use the manual test in tests/manual/mkspecs. # -include(g++.conf) +include(g++-base.conf) QMAKE_LFLAGS_RELEASE += -Wl,-O1 QMAKE_LFLAGS_NOUNDEF += -Wl,--no-undefined diff --git a/mkspecs/common/g++.conf b/mkspecs/common/g++.conf index d73b38f..0ca4fbd 100644 --- a/mkspecs/common/g++.conf +++ b/mkspecs/common/g++.conf @@ -1,23 +1,11 @@ # -# Qmake configuration for the GNU C++ compiler +# Notice: g++.conf has been split into g++-base.conf and g++-unix.conf # -# Before making changes to this file, please read the comment in -# gcc-base.conf, to make sure the change goes in the right place. +# This file will make sure that anyone who's still including g++.conf +# directly will get a warning and an explanation of how to fix their mkspec # -# To verify that your change has the desired effect on the final configuration -# you can use the manual test in tests/manual/mkspecs. -# - -QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g - -QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO - -QMAKE_LINK_C = $$QMAKE_CC -QMAKE_LINK_C_SHLIB = $$QMAKE_CC -QMAKE_PCH_OUTPUT_EXT = .gch +warning($$escape_expand("Your mkspec is including 'common/g++.conf', but the mkspecs have been refactored\\n\\tTo fix this include 'common/gcc-base-$${TARGET_PLATFORM}.conf and 'common/g++-$${TARGET_PLATFORM}.conf' instead")) -QMAKE_CFLAGS_PRECOMPILE = -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} -QMAKE_CFLAGS_USE_PRECOMPILE = -include ${QMAKE_PCH_OUTPUT_BASE} -QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} -QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE +# We include g++-unix.conf to keep the behavior of the old g++.conf +include(g++-unix.conf) \ No newline at end of file diff --git a/mkspecs/common/gcc-base-mac.conf b/mkspecs/common/gcc-base-mac.conf deleted file mode 100644 index 5c9a8a1..0000000 --- a/mkspecs/common/gcc-base-mac.conf +++ /dev/null @@ -1,43 +0,0 @@ -# -# Base qmake configuration for GCC on Mac OS X -# -# Before making changes to this file, please read the comment in -# gcc-base.conf, to make sure the change goes in the right place. -# -# To verify that your change has the desired effect on the final configuration -# you can use the manual test in tests/manual/mkspecs. -# - -include(gcc-base.conf) - -QMAKE_COMPILER_DEFINES += __APPLE__ __GNUC__ - -QMAKE_CFLAGS_X86 += -arch i386 -QMAKE_CFLAGS_X86_64 += -arch x86_64 -QMAKE_CFLAGS_PPC += -arch ppc -QMAKE_CFLAGS_PPC_64 += -arch ppc64 -QMAKE_CFLAGS_DWARF2 += -gdwarf-2 - -QMAKE_CXXFLAGS_X86 += $$QMAKE_CFLAGS_X86 -QMAKE_CXXFLAGS_X86_64 += $$QMAKE_CFLAGS_X86_64 -QMAKE_CXXFLAGS_PPC += $$QMAKE_CFLAGS_PPC -QMAKE_CXXFLAGS_PPC_64 += $$QMAKE_CFLAGS_PPC_64 -QMAKE_CXXFLAGS_DWARF2 += $$QMAKE_CFLAGS_DWARF2 - -QMAKE_OBJECTIVE_CFLAGS_X86 += $$QMAKE_CFLAGS_X86 -QMAKE_OBJECTIVE_CFLAGS_X86_64 += $$QMAKE_CFLAGS_X86_64 -QMAKE_OBJECTIVE_CFLAGS_PPC += $$QMAKE_CFLAGS_PPC -QMAKE_OBJECTIVE_CFLAGS_PPC_64 += $$QMAKE_CFLAGS_PPC_64 - -QMAKE_LFLAGS_X86 += $$QMAKE_CFLAGS_X86 -QMAKE_LFLAGS_X86_64 += $$QMAKE_CFLAGS_X86_64 -QMAKE_LFLAGS_PPC += $$QMAKE_CFLAGS_PPC -QMAKE_LFLAGS_PPC_64 += $$QMAKE_CFLAGS_PPC_64 - -QMAKE_LFLAGS += -headerpad_max_install_names -QMAKE_LFLAGS_SHLIB += -single_module -dynamiclib -QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB -QMAKE_LFLAGS_INCREMENTAL += -undefined suppress -flat_namespace -QMAKE_LFLAGS_SONAME += -install_name$${LITERAL_WHITESPACE} -QMAKE_LFLAGS_VERSION += -current_version$${LITERAL_WHITESPACE} -QMAKE_LFLAGS_COMPAT_VERSION += -compatibility_version$${LITERAL_WHITESPACE} diff --git a/mkspecs/common/gcc-base-macx.conf b/mkspecs/common/gcc-base-macx.conf new file mode 100644 index 0000000..5c9a8a1 --- /dev/null +++ b/mkspecs/common/gcc-base-macx.conf @@ -0,0 +1,43 @@ +# +# Base qmake configuration for GCC on Mac OS X +# +# Before making changes to this file, please read the comment in +# gcc-base.conf, to make sure the change goes in the right place. +# +# To verify that your change has the desired effect on the final configuration +# you can use the manual test in tests/manual/mkspecs. +# + +include(gcc-base.conf) + +QMAKE_COMPILER_DEFINES += __APPLE__ __GNUC__ + +QMAKE_CFLAGS_X86 += -arch i386 +QMAKE_CFLAGS_X86_64 += -arch x86_64 +QMAKE_CFLAGS_PPC += -arch ppc +QMAKE_CFLAGS_PPC_64 += -arch ppc64 +QMAKE_CFLAGS_DWARF2 += -gdwarf-2 + +QMAKE_CXXFLAGS_X86 += $$QMAKE_CFLAGS_X86 +QMAKE_CXXFLAGS_X86_64 += $$QMAKE_CFLAGS_X86_64 +QMAKE_CXXFLAGS_PPC += $$QMAKE_CFLAGS_PPC +QMAKE_CXXFLAGS_PPC_64 += $$QMAKE_CFLAGS_PPC_64 +QMAKE_CXXFLAGS_DWARF2 += $$QMAKE_CFLAGS_DWARF2 + +QMAKE_OBJECTIVE_CFLAGS_X86 += $$QMAKE_CFLAGS_X86 +QMAKE_OBJECTIVE_CFLAGS_X86_64 += $$QMAKE_CFLAGS_X86_64 +QMAKE_OBJECTIVE_CFLAGS_PPC += $$QMAKE_CFLAGS_PPC +QMAKE_OBJECTIVE_CFLAGS_PPC_64 += $$QMAKE_CFLAGS_PPC_64 + +QMAKE_LFLAGS_X86 += $$QMAKE_CFLAGS_X86 +QMAKE_LFLAGS_X86_64 += $$QMAKE_CFLAGS_X86_64 +QMAKE_LFLAGS_PPC += $$QMAKE_CFLAGS_PPC +QMAKE_LFLAGS_PPC_64 += $$QMAKE_CFLAGS_PPC_64 + +QMAKE_LFLAGS += -headerpad_max_install_names +QMAKE_LFLAGS_SHLIB += -single_module -dynamiclib +QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB +QMAKE_LFLAGS_INCREMENTAL += -undefined suppress -flat_namespace +QMAKE_LFLAGS_SONAME += -install_name$${LITERAL_WHITESPACE} +QMAKE_LFLAGS_VERSION += -current_version$${LITERAL_WHITESPACE} +QMAKE_LFLAGS_COMPAT_VERSION += -compatibility_version$${LITERAL_WHITESPACE} diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf index 41280c6..2d8a02f 100644 --- a/mkspecs/common/gcc-base.conf +++ b/mkspecs/common/gcc-base.conf @@ -7,21 +7,21 @@ # # Platform-specific options shared by these compilers are put into: # -# - gcc-base-mac.conf +# - gcc-base-macx.conf # - gcc-base-unix.conf # # These base files are then combined with configurations for each compiler: # -# - g++.conf -# - g++-mac.conf +# - g++-base.conf +# - g++-macx.conf # - g++-unix.conf # - llvm.conf # - clang.conf # # The combination happens in the top level mkspec, by including a platform- -# specific version of the base-file, for example gcc-base-mac.conf, and then +# specific version of the base-file, for example gcc-base-macx.conf, and then # a (possibly platform-specific) version of the actual compiler configuration, -# for example g++-mac.conf. +# for example g++-macx.conf. # # If you are making changes to any of these files, please consider the # possible effect it may have due to these include-rules, and whether it diff --git a/mkspecs/macx-g++/qmake.conf b/mkspecs/macx-g++/qmake.conf index fd36b70..0fd2c74 100644 --- a/mkspecs/macx-g++/qmake.conf +++ b/mkspecs/macx-g++/qmake.conf @@ -17,6 +17,6 @@ QMAKE_CC = gcc QMAKE_CXX = g++ include(../common/mac.conf) -include(../common/gcc-base-mac.conf) -include(../common/g++-mac.conf) +include(../common/gcc-base-macx.conf) +include(../common/g++-macx.conf) load(qt_config) diff --git a/mkspecs/macx-g++40/qmake.conf b/mkspecs/macx-g++40/qmake.conf index cfdd724..aa10fa2 100644 --- a/mkspecs/macx-g++40/qmake.conf +++ b/mkspecs/macx-g++40/qmake.conf @@ -17,7 +17,7 @@ QMAKE_CC = gcc-4.0 QMAKE_CXX = g++-4.0 include(../common/mac.conf) -include(../common/gcc-base-mac.conf) -include(../common/g++-mac.conf) +include(../common/gcc-base-macx.conf) +include(../common/g++-macx.conf) load(qt_config) diff --git a/mkspecs/macx-g++42/qmake.conf b/mkspecs/macx-g++42/qmake.conf index 08305ba..b2be5ed 100644 --- a/mkspecs/macx-g++42/qmake.conf +++ b/mkspecs/macx-g++42/qmake.conf @@ -17,7 +17,7 @@ QMAKE_CC = gcc-4.2 QMAKE_CXX = g++-4.2 include(../common/mac.conf) -include(../common/gcc-base-mac.conf) -include(../common/g++-mac.conf) +include(../common/gcc-base-macx.conf) +include(../common/g++-macx.conf) load(qt_config) diff --git a/mkspecs/macx-llvm/qmake.conf b/mkspecs/macx-llvm/qmake.conf index 95c2b28..94f9688 100644 --- a/mkspecs/macx-llvm/qmake.conf +++ b/mkspecs/macx-llvm/qmake.conf @@ -15,7 +15,7 @@ QMAKE_INCREMENTAL_STYLE = sublib include(../common/mac.conf) include(../common/llvm.conf) -include(../common/gcc-base-mac.conf) +include(../common/gcc-base-macx.conf) QMAKE_OBJCFLAGS_PRECOMPILE = -x objective-c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE diff --git a/mkspecs/macx-xcode/qmake.conf b/mkspecs/macx-xcode/qmake.conf index dc79b3d..4cb4626 100755 --- a/mkspecs/macx-xcode/qmake.conf +++ b/mkspecs/macx-xcode/qmake.conf @@ -10,8 +10,8 @@ CONFIG += qt warn_on release lib_version_first incremental plugin_no_soname li QT += core gui include(../common/mac.conf) -include(../common/gcc-base-mac.conf) -include(../common/g++-mac.conf) +include(../common/gcc-base-macx.conf) +include(../common/g++-macx.conf) QMAKE_CC = QMAKE_CXX = diff --git a/mkspecs/symbian-gcce/qmake.conf b/mkspecs/symbian-gcce/qmake.conf index f012217..7051a9c 100644 --- a/mkspecs/symbian-gcce/qmake.conf +++ b/mkspecs/symbian-gcce/qmake.conf @@ -4,7 +4,8 @@ include(../common/symbian/symbian-makefile.conf) -include(../common/g++.conf) +include(../common/g++-unix.conf) +include(../common/gcc-base-unix.conf) QMAKE_CC = arm-none-symbianelf-gcc QMAKE_CXX = arm-none-symbianelf-g++ diff --git a/mkspecs/unsupported/macx-clang/qmake.conf b/mkspecs/unsupported/macx-clang/qmake.conf index 17892e8..aaabf27 100644 --- a/mkspecs/unsupported/macx-clang/qmake.conf +++ b/mkspecs/unsupported/macx-clang/qmake.conf @@ -11,7 +11,7 @@ QMAKE_INCREMENTAL_STYLE = sublib include(../../common/mac.conf) include(../../common/clang.conf) -include(../../common/gcc-base-mac.conf) +include(../../common/gcc-base-macx.conf) QMAKE_OBJCFLAGS_PRECOMPILE = -x objective-c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE diff --git a/mkspecs/unsupported/qws/qnx-generic-g++/qmake.conf b/mkspecs/unsupported/qws/qnx-generic-g++/qmake.conf index 26de9b7..bb760b2 100644 --- a/mkspecs/unsupported/qws/qnx-generic-g++/qmake.conf +++ b/mkspecs/unsupported/qws/qnx-generic-g++/qmake.conf @@ -61,7 +61,6 @@ QMAKE_PCH_OUTPUT_EXT = .gch QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list, -#include(../../common/g++.conf) include(../../common/unix.conf) QMAKE_CFLAGS_THREAD = -D_REENTRANT -- cgit v0.12