123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- # Build script for qi.
- #
- # Copyright (c) 2015-2021 Matias Fonzo, <selk@dragora.org>.
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- echo "Making Qi from ${CWD}/qi ..."
- cd -- "${CWD}/qi"
- make -j1 clean
- ./configure \
- --prefix=/tools \
- --packagedir=/usr/pkg \
- --targetdir=/ \
- --arch=$package_arch
- make -j1 install
- # Clean up the source repository
- rm -f config.mak
- make -j1 clean
- # Create usr/pkg directory at 'rootdir'
- mkdir -p -- "${rootdir}/usr/pkg"
- # Adjust prefixes in config for final system installation
- sed -i \
- -e 's|/tools|/usr|g' \
- -e 's|/usr/etc|/etc|' \
- -e 's|/usr/var|/var|' \
- /tools/etc/qirc
- # Set compiler options provided by default in Dragora
- case $arch in
- i586)
- sed -i \
- -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\"|' \
- -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\"|' \
- -e 's|#QILDFLAGS=.*|QILDFLAGS=\"-s\"|' \
- -e 's|#QICPPFLAGS=.*|QICPPFLAGS=\"-D_FORTIFY_SOURCE=2\"|' \
- /tools/etc/qirc
- ;;
- x86_64)
- sed -i \
- -e 's|#QICFLAGS=.*|QICFLAGS=\"-O2 -march=x86-64 -fstack-clash-protection -fcf-protection=full -fstack-protector-strong --param=ssp-buffer-size=4 -pipe\"|' \
- -e 's|#QICXXFLAGS=.*|QICXXFLAGS=\"-O2 -march=x86-64 -fstack-clash-protection -fcf-protection=full -fstack-protector-strong --param=ssp-buffer-size=4 -pipe\"|' \
- -e 's|#QILDFLAGS=.*|QILDFLAGS=\"-s\"|' \
- -e 's|#QICPPFLAGS=.*|QICPPFLAGS=\"-D_FORTIFY_SOURCE=2\"|' \
- /tools/etc/qirc
- ;;
- *)
- sed -i \
- -e 's|#QICFLAGS=.*|QICFLAGS=\"-O2 -fstack-protector-strong --param=ssp-buffer-size=4 -pipe\"|' \
- -e 's|#QICXXFLAGS=.*|QICXXFLAGS=\"-O2 -fstack-protector-strong --param=ssp-buffer-size=4 -pipe\"|' \
- -e 's|#QILDFLAGS=.*|QILDFLAGS=\"-s\"|' \
- -e 's|#QICPPFLAGS=.*|QICPPFLAGS=\"-D_FORTIFY_SOURCE=2\"|' \
- /tools/etc/qirc
- ;;
- esac
- # Include additional settings from targets/
- # We prefix '--enable-multilib' for targets supporting it,
- # the native GCC wants this option explicitly
- if test -n "$multilib_options"
- then
- case $multilib_options in
- *--disable-multilib* | *--enable-multilib* | *--with-multilib-list=)
- true
- ;;
- *)
- multilib_options="--enable-multilib $multilib_options"
- ;;
- esac
- fi
- cat << EOF >> /tools/etc/qirc
- # Multilib options
- multilib_options="$multilib_options"
- # lib<equal> suffix (multilib, if any)
- libSuffix="$libSuffix"
- # GCC (arch-specific) options
- gcc_options="$gcc_options"
- EOF
- chmod 644 /tools/etc/qirc
|