OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.7 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../libtool/libtool.conf
  5. # Copyright (C) 2007 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; version 2 of the License. A copy of the
  12. # GNU General Public License can be found in the file COPYING.
  13. # --- SDE-COPYRIGHT-NOTE-END ---
  14. if atstage toolchain; then
  15. buildloops=2
  16. hook_add preconf 5 'libtool_cross'
  17. libtool_cross() {
  18. if [ $buildloop -eq 2 ]; then
  19. # on the second loop we make it a cross compiler
  20. # remove --target and --host (default's at stage 0)
  21. var_remove_regex confopt ' ' '--target=.*'
  22. var_remove_regex confopt ' ' '--host=.*'
  23. # add --build and --host (default's at stage 1)
  24. var_append confopt ' ' '--build=$arch_build'
  25. var_append confopt ' ' '--host=$arch_target'
  26. # and set the prefix and the bindir (as gcc's)
  27. var_append extraconfopt ' ' '--program-prefix=${arch_target}-'
  28. hook_add postmake 5 'libtool_cross_tweak'
  29. fi
  30. }
  31. # if we `export` them 0-libtool's configure will try to test that $CC is able
  32. # to produce binaries, but as 1-glibc is not yet built the crt.o file is not
  33. # found and the test fails.
  34. libtool_cross_tweak() {
  35. local x= y=
  36. # set the right CC,CXX,AR,....
  37. for x in gcc g++ ar ld nm strip as ranlib; do
  38. case "$x" in
  39. gcc) y=CC ;;
  40. g++) y=CXX ;;
  41. *) y=$( echo $x | tr [a-z] [A-Z] ) ;;
  42. esac
  43. # TODO: turn this into a single `sed` call
  44. sed -i -e "s,^$y=.*,$y=\"${arch_target}-$x\"," "$root$bindir/${arch_target}-libtool"
  45. done
  46. }
  47. fi