recipes: tools/qi: make sure to provide a copy of the qirc configuration file (just...
[dragora.git] / stages / 1 / 14-qi
blobd914f5f826716f1a9ce1c4f7fed2a468c26ad2da
1 # Build script for qi.
3 # Copyright (c) 2015-2018 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/
32 chmod 644 /tools/etc/qirc
34 # Set compiler options provided by default in Dragora
35 case $arch in
36 i586)
37     sed -i \
38      -e 's|#QICFLAGS=.*|QICFLAGS=-g0 -Os -march=i586 -mtune=i686|' \
39      -e 's|#QICXXFLAGS=.*|QICXXFLAGS=-g0 -Os -march=i586 -mtune=i686|' \
40      /tools/etc/qirc
41     ;;
42 x86_64)
43     sed -i \
44      -e 's|#QICFLAGS=.*|QICFLAGS=-g0 -Os -mtune=generic|' \
45      -e 's|#QICXXFLAGS=.*|QICXXFLAGS=-g0 -Os -mtune=generic|' \
46      /tools/etc/qirc
47     ;;
49     sed -i \
50      -e 's|#QICFLAGS=.*|QICFLAGS=-g0 -Os|' \
51      -e 's|#QICXXFLAGS=.*|QICXXFLAGS=-g0 -Os|' \
52      /tools/etc/qirc
53     ;;
54 esac
56 # Include additional settings from targets/
58 # We prefix '--enable-multilib' for targets supporting it,
59 # the native GCC wants this option explicitly
60 if test -n "$multilib_options"
61 then
62     case $multilib_options in
63     *--disable-multilib* | *--enable-multilib* | *--with-multilib-list=)
64         true
65         ;;
66     *)
67         multilib_options="--enable-multilib $multilib_options"
68         ;;
69     esac
72 cat << EOF >> /tools/etc/qirc
74 # Multilib options
75 multilib_options=$multilib_options
77 # lib<equal> suffix (multilib, if any)
78 libSuffix=$libSuffix
80 # GCC (arch-specific) options
81 gcc_options=$gcc_options
82 EOF