mesa upgraded to version 17.3.1
[dragora.git] / stages / 1 / 13-qi
blob347b7685a08c4dfab004c35d3a7b0be56dc9f805
1 # Build script for qi.
3 # Copyright (c) 2015-2017 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 echo "Making Qi from ${CWD}/qi ..."
19 cd -- "${CWD}/qi"
21 make clean
23 ./configure --prefix=/tools
25 make
26 make install
28 # Clean up the source repository
29 rm -f config.mak
30 make clean
32 # Copy our custom qirc to /tools
33 cp -p "${worktree}/archive/qi/qirc" /tools/etc/
34 chmod 644 /tools/etc/qirc
36 # Set compiler options provided by default in Dragora
37 case $arch in
38 i586)
39     sed -i \
40      -e 's|#QICFLAGS=.*|QICFLAGS=-g0 -Os -march=i586 -mtune=i686|' \
41      -e 's|#QICXXFLAGS=.*|QICXXFLAGS=-g0 -Os -march=i586 -mtune=i686|' \
42      /tools/etc/qirc
43     ;;
44 x86_64)
45     sed -i \
46      -e 's|#QICFLAGS=.*|QICFLAGS=-g0 -Os -mtune=generic|' \
47      -e 's|#QICXXFLAGS=.*|QICXXFLAGS=-g0 -Os -mtune=generic|' \
48      /tools/etc/qirc
49     ;;
50 esac
52 # Include additional settings from targets/
54 # We prefix '--enable-multilib' for targets supporting it,
55 # the native GCC wants this option explicitly
56 if test -n "$multilib_options"
57 then
58     case $multilib_options in
59     *--disable-multilib* | *--enable-multilib*)
60         true
61         ;;
62     *)
63         multilib_options="--enable-multilib $multilib_options"
64         ;;
65     esac
68 cat << EOF >> /tools/etc/qirc
70 # Multilib options
71 multilib_options=$multilib_options
73 # lib<equal> suffix (multilib, if any)
74 libSuffix=$libSuffix
76 # GCC (arch-specific) options
77 gcc_options=$gcc_options
78 EOF