macros.qt5: cleanup, %_qt5_cflags, %_qt5_cxxflags (for f24+)

This commit is contained in:
Rex Dieter 2016-03-18 22:21:44 -05:00
parent 93e45467fb
commit 1b09f2f623
2 changed files with 26 additions and 27 deletions

View File

@ -18,14 +18,16 @@
%_qt5_sysconfdir %{_qt5_settingsdir}
%_qt5_translationdir %{_datadir}/qt5/translations
%_qt5_ldflags %{?__global_ldflags} @@QT5_RPM_LD_FLAGS@@
%_qt5_cflags %{nil}@@QT5_CFLAGS@@
%_qt5_cxxflags %{nil}@@QT5_CXXFLAGS@@
%_qt5_ldflags %{nil}%{?__global_ldflags} @@QT5_RPM_LD_FLAGS@@
%_qt5_optflags %{optflags} @@QT5_RPM_OPT_FLAGS@@
%_qt5_qmake_flags \\\
QMAKE_CFLAGS_DEBUG="${CFLAGS:-%{_qt5_optflags}}" \\\
QMAKE_CFLAGS_RELEASE="${CFLAGS:-%{_qt5_optflags}}" \\\
QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS:-%{_qt5_optflags}}" \\\
QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS:-%{_qt5_optflags}}" \\\
QMAKE_CFLAGS_DEBUG="${CFLAGS:-%{_qt5_optflags} %{?_qt5_cflags}}" \\\
QMAKE_CFLAGS_RELEASE="${CFLAGS:-%{_qt5_optflags} %{?_qt5_cflags}}" \\\
QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS:-%{_qt5_optflags} %{?_qt5_cxxflags}}" \\\
QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS:-%{_qt5_optflags} %{?_qt5_cxxflags}}" \\\
QMAKE_LFLAGS_DEBUG="${LDFLAGS:-%{_qt5_ldflags}}" \\\
QMAKE_LFLAGS_RELEASE="${LDFLAGS:-%{_qt5_ldflags}}" \\\
QMAKE_STRIP=

View File

@ -30,6 +30,14 @@
%if 0%{?fedora} > 23
%global journald -journald
# gcc6: FTBFS
%global qt5_deprecated_flag -Wno-deprecated-declaration
# gcc6: Qt assumes this in places
%global qt5_null_flag -fno-delete-null-pointer-checks
%ifarch armv7hl
# gcc6: arm FTBFS
%global qt5_arm_flag -mfpu=neon
%endif
%endif
# define to build docs, need to undef this for bootstrapping
@ -368,21 +376,14 @@ RPM macros for building Qt5 packages.
%patch150 -p1 -b .moc_system_defines
%patch176 -p1 -b .0076
## adjust $RPM_OPT_FLAGS
# remove -fexceptions
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'`
# add -fno-delete-null-pointer-checks for f24/gcc6
%if 0%{?fedora} > 23
%global qt5_rpm_opt_flags -fno-delete-null-pointer-checks -Wno-deprecated-declaration
RPM_OPT_FLAGS="$RPM_OPT_FLAGS %{?qt5_rpm_opt_flags}"
%ifarch armv7hl
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -mfpu=neon"
%endif
%endif
%define platform linux-g++
%if 0%{?inject_optflags}
## adjust $RPM_OPT_FLAGS
# remove -fexceptions
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'`
RPM_OPT_FLAGS="$RPM_OPT_FLAGS %{?qt5_deprecated_flag} %{?qt5_arm_flag}"
%patch2 -p1 -b .multilib_optflags
# drop backup file(s), else they get installed too, http://bugzilla.redhat.com/639463
rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags
@ -423,16 +424,10 @@ test -x configure || chmod +x configure
## adjust $RPM_OPT_FLAGS
# remove -fexceptions
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'`
# add -fno-delete-null-pointer-checks for f24/gcc6
%if 0%{?fedora} > 23
RPM_OPT_FLAGS="$RPM_OPT_FLAGS %{?qt5_rpm_opt_flags}"
%ifarch armv7hl
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -mfpu=neon"
%endif
%endif
RPM_OPT_FLAGS="$RPM_OPT_FLAGS %{?qt5_deprecated_flag} %{?qt5_arm_flag}"
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS"
export CXXFLAGS="$CXXFLAGS $RPM_OPT_FLAGS"
export CXXFLAGS="$CXXFLAGS $RPM_OPT_FLAGS %{?qt5_null_flag}"
export LDFLAGS="$LDFLAGS $RPM_LD_FLAGS"
export MAKEFLAGS="%{?_smp_mflags}"
@ -550,8 +545,10 @@ sed -i \
-e "s|@@EPOCH@@|%{?epoch}%{!?epoch:0}|g" \
-e "s|@@VERSION@@|%{version}|g" \
-e "s|@@EVR@@|%{?epoch:%{epoch:}}%{version}-%{release}|g" \
-e "s|@@QT5_CFLAGS@@|%{?qt5_cflags}|g" \
-e "s|@@QT5_CXXFLAGS@@|%{?qt5_null_flag}|g" \
-e "s|@@QT5_RPM_LD_FLAGS@@|%{?qt5_rpm_ld_flags}|g" \
-e "s|@@QT5_RPM_OPT_FLAGS@@|%{?qt5_rpm_opt_flags}|g" \
-e "s|@@QT5_RPM_OPT_FLAGS@@|%{?qt5_arm_flag} %{?qt5_deprecated_flag}|g" \
%{buildroot}%{rpm_macros_dir}/macros.qt5
# create/own dirs
@ -961,7 +958,7 @@ fi
%changelog
* Fri Mar 18 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.6.0-4
- macros.qt5: fix %%{_qt5_optflags} (for f24+)
- macros.qt5: cleanup, %%_qt5_cflags, %%_qt5_cxxflags (for f24+)
* Fri Mar 18 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.6.0-3
- rebuild