Merge lp:~loic.molinari/ubuntu-ui-toolkit/uitk-ubuntu-packaging-flags-clean-up into lp:ubuntu-ui-toolkit/staging
Status: | Merged |
---|---|
Approved by: | Loïc Molinari |
Approved revision: | 2105 |
Merged at revision: | 2119 |
Proposed branch: | lp:~loic.molinari/ubuntu-ui-toolkit/uitk-ubuntu-packaging-flags-clean-up |
Merge into: | lp:ubuntu-ui-toolkit/staging |
Prerequisite: | lp:~loic.molinari/ubuntu-ui-toolkit/uitk-ascii-cast-warnings-fix |
Diff against target: |
161 lines (+56/-24) 6 files modified
.qmake.conf (+2/-2) debian/rules (+1/-1) documentation/documentation.pro (+1/-1) features/ubuntu_enable_testing.prf (+1/-1) features/ubuntu_qml_plugin.prf (+26/-10) features/ubuntu_qt_module.prf (+25/-9) |
To merge this branch: | bzr merge lp:~loic.molinari/ubuntu-ui-toolkit/uitk-ubuntu-packaging-flags-clean-up |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
ubuntu-sdk-build-bot | continuous-integration | Approve | |
Benjamin Zeller | Approve | ||
Zsombor Egri | Approve | ||
Review via email: mp+305843@code.launchpad.net |
Commit message
Cleaned up qmake Ubuntu packaging variables.
The qtbase packaging for Ubuntu exports the CFLAGS, CXXFLAGS and LFLAGS variables in the environment before running configure so that the qtbase shared libraries can be compiled with the required distribution defined compiler flags. That is fine (though I guess that could be handled better at the qtbase packaging level with maybe a dedicated prf) but it results in qt_build_config.prf defining the QMAKE_CFLAGS, QMAKE_CXXFLAGS and QMAKE_LFLAGS variables with these distribution specific flags. Since we load this prf, these variables end up being defined when building the toolkit for development purpose. This is problematic because -O2 and -g are always defined (whatever the debug or release config chosen by the developer), also these are GCC specific flags which makes our build break with other compilers. This is also ugly because preprocessor defines are directly set in the QMAKE_C*FLAGS. In order to workaround these issues, we unset these variables and set the different flags apart from -g and -O2 in the right qmake variables. This allows to keep compiling with the Debian flags but in a more flexible way. For the Debian packaging, we keep the former behaviour by simply passing the debian_build config.
Description of the change
Cleaned up qmake Ubuntu packaging variables.
The qtbase packaging for Ubuntu exports the CFLAGS, CXXFLAGS and LFLAGS variables in the environment before running configure so that the qtbase shared libraries can be compiled with the required distribution defined compiler flags. That is fine (though I guess that could be handled better at the qtbase packaging level with maybe a dedicated prf) but it results in qt_build_config.prf defining the QMAKE_CFLAGS, QMAKE_CXXFLAGS and QMAKE_LFLAGS variables with these distribution specific flags. Since we load this prf, these variables end up being defined when building the toolkit for development purpose. This is problematic because -O2 and -g are always defined (whatever the debug or release config chosen by the developer), also these are GCC specific flags which makes our build break with other compilers. This is also ugly because preprocessor defines are directly set in the QMAKE_C*FLAGS. In order to workaround these issues, we unset these variables and set the different flags apart from -g and -O2 in the right qmake variables. This allows to keep compiling with the Debian flags but in a more flexible way. For the Debian packaging, we keep the former behaviour by simply passing the debian_build config.
Here are the flags for the toolkit libs:
qmake CONFIG=release
CXXFLAGS = -fstack-protector -Werror -O2 -std=c++0x -fvisibility=hidden -fvisibility-
LFLAGS = -Wl,--no-undefined -Wl,-O1 -fuse-ld=gold -Wl,--enable-
qmake CONFIG+=debug
CXXFLAGS = -fstack-protector -Werror -g -std=c++0x -fvisibility=hidden -fvisibility-
LFLAGS = -Wl,--no-undefined -fuse-ld=gold -Wl,--enable-
qmake CONFIG+
CXXFLAGS = -g -O2 -fstack-
LFLAGS = -Wl,-Bsymbolic-
I've got a MR almost ready to share the common stuff for C++ libs and QML plugins.