| 1 | # Copyright 2007-2009 Gentoo Foundation |
1 | # Copyright 2007-2009 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.28 2009/03/16 08:21:18 aballier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.31 2009/03/28 02:29:24 gengor Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: qt4-build.eclass |
5 | # @ECLASS: qt4-build.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # Ben de Groot <yngwin@gentoo.org>, |
7 | # Ben de Groot <yngwin@gentoo.org>, |
| 8 | # Markos Chandras <hwoarang@gentoo.org>, |
8 | # Markos Chandras <hwoarang@gentoo.org>, |
| … | |
… | |
| 74 | LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}" |
74 | LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}" |
| 75 | |
75 | |
| 76 | if ! version_is_at_least 4.1 $(gcc-version) ; then |
76 | if ! version_is_at_least 4.1 $(gcc-version) ; then |
| 77 | ewarn "Using a GCC version lower than 4.1 is not supported!" |
77 | ewarn "Using a GCC version lower than 4.1 is not supported!" |
| 78 | echo |
78 | echo |
| 79 | ebeep 5 |
79 | ebeep 3 |
| 80 | fi |
80 | fi |
| 81 | |
81 | |
| 82 | if use custom-cxxflags; then |
82 | if use custom-cxxflags; then |
| 83 | echo |
83 | echo |
| 84 | ewarn "You have set USE=custom-cxxflags, which means Qt will be built with the" |
84 | ewarn "You have set USE=custom-cxxflags, which means Qt will be built with the" |
| … | |
… | |
| 133 | # Don't let the user go too overboard with flags. |
133 | # Don't let the user go too overboard with flags. |
| 134 | strip-flags |
134 | strip-flags |
| 135 | replace-flags -O3 -O2 |
135 | replace-flags -O3 -O2 |
| 136 | fi |
136 | fi |
| 137 | |
137 | |
| 138 | # Bug 253127 |
138 | # Bug 178652 |
|
|
139 | if [[ "$(gcc-major-version)" == "3" ]] && use amd64; then |
|
|
140 | ewarn "Appending -fno-gcse to CFLAGS/CXXFLAGS" |
|
|
141 | append-flags -fno-gcse |
|
|
142 | fi |
|
|
143 | |
| 139 | # Unsupported old gcc versions - hardened needs this :( |
144 | # Unsupported old gcc versions - hardened needs this :( |
| 140 | if [[ $(gcc-major-version) -lt "4" ]] ; then |
145 | if [[ $(gcc-major-version) -lt "4" ]] ; then |
| 141 | ewarn "Appending -fno-stack-protector to CXXFLAGS" |
146 | ewarn "Appending -fno-stack-protector to CXXFLAGS" |
| 142 | append-cxxflags -fno-stack-protector |
147 | append-cxxflags -fno-stack-protector |
| 143 | fi |
148 | # Bug 253127 |
| 144 | |
149 | sed -e "/^QMAKE_CFLAGS\t/ s:$: -fno-stack-protector-all:" \ |
| 145 | # Bug 178652 |
150 | -i "${S}"/mkspecs/common/g++.conf || die "sed ${S}/mkspecs/common/g++.conf failed" |
| 146 | if [[ "$(gcc-major-version)" == "3" ]] && use amd64; then |
|
|
| 147 | ewarn "Appending -fno-gcse to CFLAGS/CXXFLAGS" |
|
|
| 148 | append-flags -fno-gcse |
|
|
| 149 | fi |
151 | fi |
| 150 | |
152 | |
| 151 | # Bug 172219 |
153 | # Bug 172219 |
| 152 | sed -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \ |
154 | sed -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \ |
| 153 | -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \ |
155 | -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \ |