14-qi 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Build script for qi.
  2. #
  3. # Copyright (c) 2015-2018 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 --prefix=/tools
  20. make -j1 install
  21. # Clean up the source repository
  22. rm -f config.mak
  23. make -j1 clean
  24. # Copy our custom qirc to /tools
  25. cp -p "${worktree}/archive/qi/qirc" /tools/etc/
  26. 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. *)
  42. sed -i \
  43. -e 's|#QICFLAGS=.*|QICFLAGS=-g0 -Os|' \
  44. -e 's|#QICXXFLAGS=.*|QICXXFLAGS=-g0 -Os|' \
  45. /tools/etc/qirc
  46. ;;
  47. esac
  48. # Include additional settings from targets/
  49. # We prefix '--enable-multilib' for targets supporting it,
  50. # the native GCC wants this option explicitly
  51. if test -n "$multilib_options"
  52. then
  53. case $multilib_options in
  54. *--disable-multilib* | *--enable-multilib* | *--with-multilib-list=)
  55. true
  56. ;;
  57. *)
  58. multilib_options="--enable-multilib $multilib_options"
  59. ;;
  60. esac
  61. fi
  62. cat << EOF >> /tools/etc/qirc
  63. # Multilib options
  64. multilib_options=$multilib_options
  65. # lib<equal> suffix (multilib, if any)
  66. libSuffix=$libSuffix
  67. # GCC (arch-specific) options
  68. gcc_options=$gcc_options
  69. EOF