16-qi 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Build script for qi.
  2. #
  3. # Copyright (c) 2015-2019 Matias Fonzo, <selk@dragora.org>.
  4. #
  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
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  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.
  16. echo "Making Qi from ${CWD}/qi ..."
  17. cd -- "${CWD}/qi"
  18. make -j1 clean
  19. ./configure \
  20. --prefix=/tools \
  21. --packagedir=/usr/pkg \
  22. --targetdir=/
  23. make -j1 install
  24. # Clean up the source repository
  25. rm -f config.mak
  26. make -j1 clean
  27. # Create usr/pkg directory at 'rootdir'
  28. mkdir -p -- "${rootdir}/usr/pkg"
  29. # Copy our custom qirc to /tools
  30. cp -p "${worktree}/archive/qi/qirc" /tools/etc/
  31. # Set compiler options provided by default in Dragora
  32. case $arch in
  33. i586)
  34. sed -i \
  35. -e 's|#QICFLAGS=.*|QICFLAGS=-g0 -Os -march=i586 -mtune=i686|' \
  36. -e 's|#QICXXFLAGS=.*|QICXXFLAGS=-g0 -Os -march=i586 -mtune=i686|' \
  37. /tools/etc/qirc
  38. ;;
  39. x86_64)
  40. sed -i \
  41. -e 's|#QICFLAGS=.*|QICFLAGS=-g0 -Os -mtune=generic -pipe|' \
  42. -e 's|#QICXXFLAGS=.*|QICXXFLAGS=-g0 -Os -mtune=generic -pipe|' \
  43. /tools/etc/qirc
  44. ;;
  45. *)
  46. sed -i \
  47. -e 's|#QICFLAGS=.*|QICFLAGS=-g0 -Os -pipe|' \
  48. -e 's|#QICXXFLAGS=.*|QICXXFLAGS=-g0 -Os -pipe|' \
  49. /tools/etc/qirc
  50. ;;
  51. esac
  52. # Include additional settings from targets/
  53. # We prefix '--enable-multilib' for targets supporting it,
  54. # the native GCC wants this option explicitly
  55. if test -n "$multilib_options"
  56. then
  57. case $multilib_options in
  58. *--disable-multilib* | *--enable-multilib* | *--with-multilib-list=)
  59. true
  60. ;;
  61. *)
  62. multilib_options="--enable-multilib $multilib_options"
  63. ;;
  64. esac
  65. fi
  66. cat << EOF >> /tools/etc/qirc
  67. # Multilib options
  68. multilib_options=$multilib_options
  69. # lib<equal> suffix (multilib, if any)
  70. libSuffix=$libSuffix
  71. # GCC (arch-specific) options
  72. gcc_options=$gcc_options
  73. EOF
  74. chmod 644 /tools/etc/qirc