diff --git a/mkspecs/common/gcc-base-unix.conf b/mkspecs/common/gcc-base-unix.conf index f82c8a8430..0178bda75a 100644 --- a/mkspecs/common/gcc-base-unix.conf +++ b/mkspecs/common/gcc-base-unix.conf @@ -22,3 +22,4 @@ QMAKE_LFLAGS_USE_GOLD = -fuse-ld=gold # -Bsymbolic-functions (ld) support QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list, +QMAKE_LFLAGS_VERSION_SCRIPT = -Wl,--version-script, diff --git a/mkspecs/common/qcc-base-qnx.conf b/mkspecs/common/qcc-base-qnx.conf index f7da151a41..dbbf346ea2 100644 --- a/mkspecs/common/qcc-base-qnx.conf +++ b/mkspecs/common/qcc-base-qnx.conf @@ -19,6 +19,7 @@ QMAKE_LFLAGS_RPATHLINK = -Wl,-rpath-link, # -Bsymbolic-functions (ld) support QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list, +QMAKE_LFLAGS_VERSION_SCRIPT = -Wl,--version-script, # Generic options for all BlackBerry/QNX qcc mkspecs QMAKE_CFLAGS_THREAD = -D_REENTRANT diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index c89b6d2793..5206691a17 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -185,6 +185,28 @@ equals(QT_ARCH, i386):contains(QT_CPU_FEATURES.$$QT_ARCH, sse2):compiler_support QMAKE_CXXFLAGS += -mfpmath=sse } +unix:!isEmpty(QMAKE_LFLAGS_VERSION_SCRIPT):!no_linker_version_script:!static { + verscript = $$OUT_PWD/$${TARGET}.version + QMAKE_LFLAGS += $${QMAKE_LFLAGS_VERSION_SCRIPT}$$verscript + + internal_module { + verscript_content = "Qt_$${QT_MAJOR_VERSION}_PRIVATE_API { *; };" + } else { + current = Qt_$$QT_MAJOR_VERSION + verscript_content = "$$current { *; };" + for(i, 0..$$section(VERSION, ., 1, 1)) { + previous = $$current + current = Qt_$${QT_MAJOR_VERSION}.$$i + verscript_content += "$$current {} $$previous;" + } + } + write_file($$verscript, verscript_content)|error("Aborting.") + unset(current) + unset(previous) + unset(verscript) + unset(verscript_content) +} + android: CONFIG += qt_android_deps #install directives diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf index 38f1fe41a7..b302cc7737 100644 --- a/mkspecs/linux-icc/qmake.conf +++ b/mkspecs/linux-icc/qmake.conf @@ -104,6 +104,7 @@ QMAKE_CXXFLAGS_PRECOMPILE = -c -pch-create ${QMAKE_PCH_OUTPUT} -include ${QMAKE_ # -Bsymbolic-functions (ld) support QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list, +QMAKE_LFLAGS_VERSION_SCRIPT = -Wl,--version-script, # Symbol visibility control QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden diff --git a/mkspecs/unsupported/linux-host-g++/qmake.conf b/mkspecs/unsupported/linux-host-g++/qmake.conf index 1523126eaa..546ff21349 100644 --- a/mkspecs/unsupported/linux-host-g++/qmake.conf +++ b/mkspecs/unsupported/linux-host-g++/qmake.conf @@ -71,6 +71,7 @@ QMAKE_PCH_OUTPUT_EXT = .gch # -Bsymbolic-functions (ld) support QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list, +QMAKE_LFLAGS_VERSION_SCRIPT = -Wl,--version-script, # # qmake configuration for common linux