1 |
commit: 1586bcba38ebe9f6a8922bb735b3d0eeaa534bb5 |
2 |
Author: Davide Pesavento <pesa <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 27 02:41:25 2014 +0000 |
4 |
Commit: Davide Pesavento <pesa <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 27 02:41:25 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/qt.git;a=commit;h=1586bcba |
7 |
|
8 |
[qt4-build-multilib.eclass] Improve and rename qt_mkspecs_dir(). |
9 |
|
10 |
--- |
11 |
eclass/qt4-build-multilib.eclass | 84 ++++++++++++++++++++++------------------ |
12 |
1 file changed, 46 insertions(+), 38 deletions(-) |
13 |
|
14 |
diff --git a/eclass/qt4-build-multilib.eclass b/eclass/qt4-build-multilib.eclass |
15 |
index 659b369..fb290ae 100644 |
16 |
--- a/eclass/qt4-build-multilib.eclass |
17 |
+++ b/eclass/qt4-build-multilib.eclass |
18 |
@@ -167,12 +167,9 @@ qt4-build-multilib_src_prepare() { |
19 |
fi |
20 |
|
21 |
if use_if_iuse aqua; then |
22 |
- # provide a proper macx-g++-64 |
23 |
- use x64-macos && ln -s macx-g++ mkspecs/$(qt_mkspecs_dir) |
24 |
- |
25 |
sed -e '/^CONFIG/s:app_bundle::' \ |
26 |
-e '/^CONFIG/s:plugin_no_soname:plugin_with_soname absolute_library_soname:' \ |
27 |
- -i mkspecs/$(qt_mkspecs_dir)/qmake.conf || die |
28 |
+ -i mkspecs/$(qt4_get_mkspec)/qmake.conf || die |
29 |
fi |
30 |
|
31 |
# Bug 261632 |
32 |
@@ -216,7 +213,7 @@ qt4-build-multilib_src_prepare() { |
33 |
|| die "sed config.tests failed" |
34 |
|
35 |
# Bug 172219 |
36 |
- sed -e 's:/X11R6/:/:' -i mkspecs/$(qt_mkspecs_dir)/qmake.conf || die |
37 |
+ sed -e 's:/X11R6/:/:' -i mkspecs/$(qt4_get_mkspec)/qmake.conf || die |
38 |
|
39 |
if [[ ${CHOST} == *-darwin* ]]; then |
40 |
# Set FLAGS *and* remove -arch, since our gcc-apple is multilib |
41 |
@@ -278,12 +275,12 @@ qt4-build-multilib_src_prepare() { |
42 |
|
43 |
# we need some patches for Solaris |
44 |
sed -i -e '/^QMAKE_LFLAGS_THREAD/a\QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list,' \ |
45 |
- mkspecs/$(qt_mkspecs_dir)/qmake.conf || die |
46 |
+ mkspecs/$(qt4_get_mkspec)/qmake.conf || die |
47 |
# use GCC over SunStudio |
48 |
sed -i -e '/PLATFORM=solaris-cc/s/cc/g++/' configure || die |
49 |
# do not flirt with non-Prefix stuff, we're quite possessive |
50 |
sed -i -e '/^QMAKE_\(LIB\|INC\)DIR\(_X11\|_OPENGL\|\)\t/s/=.*$/=/' \ |
51 |
- mkspecs/$(qt_mkspecs_dir)/qmake.conf || die |
52 |
+ mkspecs/$(qt4_get_mkspec)/qmake.conf || die |
53 |
|
54 |
# apply patches |
55 |
[[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" |
56 |
@@ -326,7 +323,7 @@ qt4-build-multilib_src_configure() { |
57 |
*) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;; |
58 |
esac |
59 |
|
60 |
- conf+=" -platform $(qt_mkspecs_dir)" |
61 |
+ conf+=" -platform $(qt4_get_mkspec)" |
62 |
|
63 |
# debug/release |
64 |
if use_if_iuse debug; then |
65 |
@@ -506,7 +503,7 @@ qt4_prepare_env() { |
66 |
QT4_SYSCONFDIR=${EPREFIX}/etc/qt4 |
67 |
QMAKE_LIBDIR_QT=${QT4_LIBDIR} |
68 |
|
69 |
- PLATFORM=$(qt_mkspecs_dir) |
70 |
+ PLATFORM=$(qt4_get_mkspec) |
71 |
unset QMAKESPEC |
72 |
|
73 |
export XDG_CONFIG_HOME="${T}" |
74 |
@@ -710,58 +707,69 @@ fix_includes() { |
75 |
fi |
76 |
} |
77 |
|
78 |
-# @FUNCTION: qt_mkspecs_dir |
79 |
+# @FUNCTION: qt4_get_mkspec |
80 |
# @RETURN: the specs-directory w/o path |
81 |
# @INTERNAL |
82 |
# @DESCRIPTION: |
83 |
# Allows us to define which mkspecs dir we want to use. |
84 |
-qt_mkspecs_dir() { |
85 |
+qt4_get_mkspec() { |
86 |
local spec= |
87 |
|
88 |
- case "${CHOST}" in |
89 |
+ case ${CHOST} in |
90 |
+ *-linux*) |
91 |
+ spec=linux ;; |
92 |
+ *-darwin*) |
93 |
+ use_if_iuse aqua && |
94 |
+ spec=macx || # mac with carbon/cocoa |
95 |
+ spec=darwin ;; # darwin/mac with X11 |
96 |
*-freebsd*|*-dragonfly*) |
97 |
spec=freebsd ;; |
98 |
- *-openbsd*) |
99 |
- spec=openbsd ;; |
100 |
*-netbsd*) |
101 |
spec=netbsd ;; |
102 |
- *-darwin*) |
103 |
- if use_if_iuse aqua; then |
104 |
- # mac with carbon/cocoa |
105 |
- spec=macx |
106 |
- else |
107 |
- # darwin/mac with x11 |
108 |
- spec=darwin |
109 |
- fi |
110 |
- ;; |
111 |
+ *-openbsd*) |
112 |
+ spec=openbsd ;; |
113 |
+ *-aix*) |
114 |
+ spec=aix ;; |
115 |
+ hppa*-hpux*) |
116 |
+ spec=hpux ;; |
117 |
+ ia64*-hpux*) |
118 |
+ spec=hpuxi ;; |
119 |
*-solaris*) |
120 |
spec=solaris ;; |
121 |
- *-linux-*|*-linux) |
122 |
- spec=linux ;; |
123 |
*) |
124 |
- die "${FUNCNAME}(): Unknown CHOST '${CHOST}'" ;; |
125 |
+ die "${FUNCNAME}(): Unsupported CHOST '${CHOST}'" ;; |
126 |
esac |
127 |
|
128 |
- case "$(tc-getCXX)" in |
129 |
+ case $(tc-getCXX) in |
130 |
*g++*) |
131 |
spec+=-g++ ;; |
132 |
- *icpc*) |
133 |
- spec+=-icc ;; |
134 |
*clang*) |
135 |
- spec+=-clang ;; |
136 |
+ if [[ -d ${S}/mkspecs/unsupported/${spec}-clang ]]; then |
137 |
+ spec=unsupported/${spec}-clang |
138 |
+ else |
139 |
+ ewarn "${spec}-clang mkspec does not exist, falling back to ${spec}-g++" |
140 |
+ spec+=-g++ |
141 |
+ fi ;; |
142 |
+ *icpc*) |
143 |
+ if [[ -d ${S}/mkspecs/${spec}-icc ]]; then |
144 |
+ spec+=-icc |
145 |
+ else |
146 |
+ ewarn "${spec}-icc mkspec does not exist, falling back to ${spec}-g++" |
147 |
+ spec+=-g++ |
148 |
+ fi ;; |
149 |
*) |
150 |
- die "${FUNCNAME}(): Unknown compiler '$(tc-getCXX)'" ;; |
151 |
+ die "${FUNCNAME}(): Unsupported compiler '$(tc-getCXX)'" ;; |
152 |
esac |
153 |
|
154 |
- # Add -64 for 64bit profiles |
155 |
- if use x64-freebsd || |
156 |
- use amd64-linux || |
157 |
+ # Add -64 for 64-bit prefix profiles |
158 |
+ if use amd64-linux || use ia64-linux || use ppc64-linux || |
159 |
use x64-macos || |
160 |
- use x64-solaris || |
161 |
- use sparc64-solaris |
162 |
+ use sparc64-freebsd || use x64-freebsd || use x64-openbsd || |
163 |
+ use ia64-hpux || |
164 |
+ use sparc64-solaris || use x64-solaris |
165 |
then |
166 |
- spec+=-64 |
167 |
+ [[ -d ${S}/mkspecs/${spec}-64 ]] && spec+=-64 |
168 |
fi |
169 |
|
170 |
- echo "${spec}" |
171 |
+ echo ${spec} |
172 |
} |