configure.tgt 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. # -*- shell-script -*-
  2. # Copyright (C) 2011-2015 Free Software Foundation, Inc.
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; either version 2 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software
  15. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  16. # This is the target specific configuration file. This is invoked by the
  17. # autoconf generated configure script. Putting it in a separate shell file
  18. # lets us skip running autoconf when modifying target specific information.
  19. # This file switches on the shell variable ${target}, and sets the
  20. # following shell variables:
  21. # config_path An ordered list of directories to search for
  22. # sources and headers. This is relative to the
  23. # config subdirectory of the source tree.
  24. # XCFLAGS Add extra compile flags to use.
  25. # XLDFLAGS Add extra link flags to use.
  26. # Optimize TLS usage by avoiding the overhead of dynamic allocation.
  27. if test "$gcc_cv_have_tls" = yes ; then
  28. case "${target}" in
  29. # For x86, we use slots in the TCB head for most of our TLS.
  30. # The setup of those slots in beginTransaction can afford to
  31. # use the global-dynamic model.
  32. i[456]86-*-linux* | x86_64-*-linux*)
  33. ;;
  34. *-*-linux*)
  35. XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
  36. ;;
  37. esac
  38. fi
  39. # Map the target cpu to an ARCH sub-directory. At the same time,
  40. # work out any special compilation flags as necessary.
  41. case "${target_cpu}" in
  42. aarch64*) ARCH=aarch64 ;;
  43. alpha*) ARCH=alpha ;;
  44. rs6000 | powerpc*)
  45. XCFLAGS="${XCFLAGS} -mhtm"
  46. ARCH=powerpc
  47. ;;
  48. arm*) ARCH=arm ;;
  49. i[3456]86)
  50. case " ${CC} ${CFLAGS} " in
  51. *" -m64 "*|*" -mx32 "*)
  52. ;;
  53. *)
  54. if test -z "$with_arch"; then
  55. XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
  56. XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
  57. fi
  58. esac
  59. XCFLAGS="${XCFLAGS} -mrtm"
  60. ARCH=x86
  61. ;;
  62. sh*) ARCH=sh ;;
  63. sparc)
  64. case " ${CC} ${CFLAGS} " in
  65. *" -m64 "*)
  66. ;;
  67. *)
  68. if test -z "$with_cpu"; then
  69. XCFLAGS="${XCFLAGS} -mcpu=v9"
  70. fi
  71. esac
  72. ARCH=sparc
  73. ;;
  74. sparc64|sparcv9)
  75. case " ${CC} ${CFLAGS} " in
  76. *" -m32 "*)
  77. XCFLAGS="${XCFLAGS} -mcpu=v9"
  78. ;;
  79. *" -m64 "*)
  80. ;;
  81. *)
  82. if test "x$with_cpu" = xv8; then
  83. XCFLAGS="${XCFLAGS} -mcpu=v9"
  84. fi
  85. ;;
  86. esac
  87. ARCH=sparc
  88. ;;
  89. x86_64)
  90. case " ${CC} ${CFLAGS} " in
  91. *" -m32 "*)
  92. XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
  93. XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
  94. ;;
  95. esac
  96. XCFLAGS="${XCFLAGS} -mrtm"
  97. ARCH=x86
  98. ;;
  99. s390|s390x)
  100. XCFLAGS="${XCFLAGS} -mzarch -mhtm"
  101. ARCH=s390
  102. ;;
  103. *)
  104. ARCH="${target_cpu}"
  105. ;;
  106. esac
  107. # For the benefit of top-level configure, determine if the cpu is supported.
  108. test -d ${srcdir}/config/$ARCH || UNSUPPORTED=1
  109. # Since we require POSIX threads, assume a POSIX system by default.
  110. config_path="$ARCH posix generic"
  111. # Other system configury
  112. case "${target}" in
  113. *-*-linux*)
  114. if test "$enable_linux_futex" = yes; then
  115. config_path="linux/$ARCH linux $config_path"
  116. fi
  117. ;;
  118. powerpc*-*-aix* | rs6000-*-aix*)
  119. # The system ought to be supported, but sjlj.S has not been ported.
  120. UNSUPPORTED=1
  121. ;;
  122. *-*-gnu* | *-*-k*bsd*-gnu \
  123. | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \
  124. | *-*-solaris2* | *-*-sysv4* | *-*-hpux11* \
  125. | *-*-darwin* | *-*-aix* | *-*-dragonfly*)
  126. # POSIX system. The OS is supported.
  127. ;;
  128. *) # Non-POSIX, or embedded system
  129. UNSUPPORTED=1
  130. ;;
  131. esac