.gitignore: updated
[dragora.git] / stages / 1 / 16-qi
blob5d1b4d4a2cdce43717fb1b099bb2779f30e7baba
1 # Build script for qi.
3 # Copyright (c) 2015-2019 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 -j1 clean
22 ./configure --prefix=/tools
23 make -j1 install
25 # Clean up the source repository
27 rm -f config.mak
28 make -j1 clean
30 # Copy our custom qirc to /tools
31 cp -p "${worktree}/archive/qi/qirc" /tools/etc/
33 # Set compiler options provided by default in Dragora
34 case $arch in
35 i586)
36     sed -i \
37      -e 's|#QICFLAGS=.*|QICFLAGS=-g0 -Os -march=i586 -mtune=i686|' \
38      -e 's|#QICXXFLAGS=.*|QICXXFLAGS=-g0 -Os -march=i586 -mtune=i686|' \
39      /tools/etc/qirc
40     ;;
41 x86_64)
42     sed -i \
43      -e 's|#QICFLAGS=.*|QICFLAGS=-g0 -Os -mtune=generic -pipe|' \
44      -e 's|#QICXXFLAGS=.*|QICXXFLAGS=-g0 -Os -mtune=generic -pipe|' \
45      /tools/etc/qirc
46     ;;
48     sed -i \
49      -e 's|#QICFLAGS=.*|QICFLAGS=-g0 -Os -pipe|' \
50      -e 's|#QICXXFLAGS=.*|QICXXFLAGS=-g0 -Os -pipe|' \
51      /tools/etc/qirc
52     ;;
53 esac
55 # Include additional settings from targets/
57 # We prefix '--enable-multilib' for targets supporting it,
58 # the native GCC wants this option explicitly
59 if test -n "$multilib_options"
60 then
61     case $multilib_options in
62     *--disable-multilib* | *--enable-multilib* | *--with-multilib-list=)
63         true
64         ;;
65     *)
66         multilib_options="--enable-multilib $multilib_options"
67         ;;
68     esac
71 cat << EOF >> /tools/etc/qirc
73 # Multilib options
74 multilib_options=$multilib_options
76 # lib<equal> suffix (multilib, if any)
77 libSuffix=$libSuffix
79 # GCC (arch-specific) options
80 gcc_options=$gcc_options
81 EOF
83 chmod 644 /tools/etc/qirc