stages/1: use GNU patch/ed instead of the versions provided by busybox
[dragora.git] / stages / 1 / 11-qi
blob592fc571a429e49ac4653cae5e749d63f491e9a6
1 # Build script for qi
3 # Copyright (C) 2015-2017 Matias Fonzo, <selk@dragora.org>
5 # This script is free software: you have unlimited permission
6 # to copy, distribute and modify it.
8 echo "Making Qi from ${CWD}/qi ..."
10 cd -- "${CWD}/qi"
12 make clean
14 ./configure --prefix=/tools
16 make
17 make install
19 # Clean up the source repository
20 rm -f config.mak
21 make clean
23 # Copy our custom qirc to /tools
24 cp -p "${worktree}/archive/qi/qirc" /tools/etc/
25 chmod 644 /tools/etc/qirc
27 # Set compiler options provided by default in Dragora
28 case $arch in
29 i586)
30     sed -i \
31      -e 's|#QICFLAGS=.*|QICFLAGS=-g0 -Os -march=i586 -mtune=i686|' \
32      -e 's|#QICXXFLAGS=.*|QICXXFLAGS=-g0 -Os -march=i586 -mtune=i686|' \
33      /tools/etc/qirc
34     ;;
35 x86_64)
36     sed -i \
37      -e 's|#QICFLAGS=.*|QICFLAGS=-g0 -Os -mtune=generic|' \
38      -e 's|#QICXXFLAGS=.*|QICXXFLAGS=-g0 -Os -mtune=generic|' \
39      /tools/etc/qirc
40     ;;
41 esac
43 # Include additional settings from targets/
45 # We prefix '--enable-multilib' for targets supporting it,
46 # the native GCC wants this option explicitly
47 if test -n "$multilib_options"
48 then
49     case $multilib_options in
50     *--disable-multilib* | *--enable-multilib*)
51         true
52         ;;
53     *)
54         multilib_options="--enable-multilib $multilib_options"
55         ;;
56     esac
59 cat << EOF >> /tools/etc/qirc
61 # Multilib options
62 multilib_options=$multilib_options
64 # lib<equal> suffix (multilib, if any)
65 libSuffix=$libSuffix
67 # GCC (arch-specific) options
68 gcc_options=$gcc_options
69 EOF