14-qi 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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
  21. make -j1 install
  22. # Clean up the source repository
  23. rm -f config.mak
  24. make -j1 clean
  25. # Copy our custom qirc to /tools
  26. cp -p "${worktree}/archive/qi/qirc" /tools/etc/
  27. chmod 644 /tools/etc/qirc
  28. # Set compiler options provided by default in Dragora
  29. case $arch in
  30. i586)
  31. sed -i \
  32. -e 's|#QICFLAGS=.*|QICFLAGS=-g0 -Os -march=i586 -mtune=i686|' \
  33. -e 's|#QICXXFLAGS=.*|QICXXFLAGS=-g0 -Os -march=i586 -mtune=i686|' \
  34. /tools/etc/qirc
  35. ;;
  36. x86_64)
  37. sed -i \
  38. -e 's|#QICFLAGS=.*|QICFLAGS=-g0 -Os -mtune=generic|' \
  39. -e 's|#QICXXFLAGS=.*|QICXXFLAGS=-g0 -Os -mtune=generic|' \
  40. /tools/etc/qirc
  41. ;;
  42. esac
  43. # Include additional settings from targets/
  44. # We prefix '--enable-multilib' for targets supporting it,
  45. # the native GCC wants this option explicitly
  46. if test -n "$multilib_options"
  47. then
  48. case $multilib_options in
  49. *--disable-multilib* | *--enable-multilib* | *--with-multilib-list=)
  50. true
  51. ;;
  52. *)
  53. multilib_options="--enable-multilib $multilib_options"
  54. ;;
  55. esac
  56. fi
  57. cat << EOF >> /tools/etc/qirc
  58. # Multilib options
  59. multilib_options=$multilib_options
  60. # lib<equal> suffix (multilib, if any)
  61. libSuffix=$libSuffix
  62. # GCC (arch-specific) options
  63. gcc_options=$gcc_options
  64. EOF