Xorg and its components have been updated
[dragora.git] / stages / 1 / 17-qi
blob1a74834b3eb8f062b074c56003dc9024181c7393
1 # Build script for qi.
3 # Copyright (c) 2015-2022 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
23 ./configure \
24  --prefix=/tools \
25  --packagedir=/usr/pkg \
26  --targetdir=/ \
27  --arch=$package_arch
29 make -j1 install
31 # Clean up the source repository
33 rm -f config.mak
34 make -j1 clean
36 # Create usr/pkg directory at 'rootdir'
37 mkdir -p -- "${rootdir}/usr/pkg"
39 # Adjust prefixes in config for final system installation
40 sed -i \
41  -e 's|/tools|/usr|g'   \
42  -e 's|/usr/etc|/etc|'  \
43  -e 's|/usr/var|/var|'  \
44  /tools/etc/qirc
46 # Set default compiler options for Dragora
47 case $arch in
48 i586)
49     sed -i \
50      -e 's|#QICFLAGS=.*|QICFLAGS=\"-O2 -march=pentium-mmx -mtune=pentiumpro -fstack-clash-protection -fcf-protection=full -fstack-protector-strong --param=ssp-buffer-size=4 -pipe\"|' \
51      -e 's|#QICXXFLAGS=.*|QICXXFLAGS=\"-O2 -march=pentium-mmx -mtune=pentiumpro -fstack-clash-protection -fcf-protection=full -fstack-protector-strong --param=ssp-buffer-size=4 -pipe\"|' \
52      -e 's|#QILDFLAGS=.*|QILDFLAGS=\"-s\"|' \
53      -e 's|#QICPPFLAGS=.*|QICPPFLAGS=\"-D_FORTIFY_SOURCE=2\"|' \
54      /tools/etc/qirc
55     ;;
56 x86_64)
57     sed -i \
58      -e 's|#QICFLAGS=.*|QICFLAGS=\"-O2 -march=x86-64 -fstack-clash-protection -fcf-protection=full -fstack-protector-strong --param=ssp-buffer-size=4 -pipe\"|' \
59      -e 's|#QICXXFLAGS=.*|QICXXFLAGS=\"-O2 -march=x86-64 -fstack-clash-protection -fcf-protection=full -fstack-protector-strong --param=ssp-buffer-size=4 -pipe\"|' \
60      -e 's|#QILDFLAGS=.*|QILDFLAGS=\"-s\"|' \
61      -e 's|#QICPPFLAGS=.*|QICPPFLAGS=\"-D_FORTIFY_SOURCE=2\"|' \
62      /tools/etc/qirc
63     ;;
65     sed -i \
66      -e 's|#QICFLAGS=.*|QICFLAGS=\"-O2 -fstack-protector-strong --param=ssp-buffer-size=4 -pipe\"|' \
67      -e 's|#QICXXFLAGS=.*|QICXXFLAGS=\"-O2 -fstack-protector-strong --param=ssp-buffer-size=4 -pipe\"|' \
68      -e 's|#QILDFLAGS=.*|QILDFLAGS=\"-s\"|' \
69      -e 's|#QICPPFLAGS=.*|QICPPFLAGS=\"-D_FORTIFY_SOURCE=2\"|' \
70      /tools/etc/qirc
71     ;;
72 esac
74 # Include additional settings from targets/
76 # We prefix '--enable-multilib' for targets supporting it,
77 # the native GCC wants this option explicitly
78 if test -n "$multilib_options"
79 then
80     case $multilib_options in
81     *--disable-multilib* | *--enable-multilib* | *--with-multilib-list=)
82         true
83         ;;
84     *)
85         multilib_options="--enable-multilib $multilib_options"
86         ;;
87     esac
90 cat << EOF >> /tools/etc/qirc
92 # Multilib options
93 multilib_options="$multilib_options"
95 # lib<equal> suffix (multilib, if any)
96 libSuffix="$libSuffix"
98 # GCC (arch-specific) options
99 gcc_options="$gcc_options"
102 chmod 644 /tools/etc/qirc