configure.tgt 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. # This is the target specific configuration file. This is invoked by the
  2. # autoconf generated configure script. Putting it in a separate shell file
  3. # lets us skip running autoconf when modifying target specific information.
  4. # This file switches on the shell variable ${target}, and sets the
  5. # following shell variables:
  6. # config_path An ordered list of directories to search for
  7. # sources and headers. This is relative to the
  8. # config subdirectory of the source tree.
  9. # XCFLAGS Add extra compile flags to use.
  10. # XLDFLAGS Add extra link flags to use.
  11. # Optimize TLS usage by avoiding the overhead of dynamic allocation.
  12. if test $gcc_cv_have_tls = yes ; then
  13. case "${target}" in
  14. *-*-k*bsd*-gnu*)
  15. ;;
  16. *-*-linux* | *-*-gnu*)
  17. XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
  18. ;;
  19. *-*-rtems*)
  20. XCFLAGS="${XCFLAGS} -ftls-model=local-exec"
  21. ;;
  22. esac
  23. fi
  24. # Since we require POSIX threads, assume a POSIX system by default.
  25. config_path="posix"
  26. # Check for futex enabled all at once.
  27. if test x$enable_linux_futex = xyes; then
  28. case "${target}" in
  29. aarch64*-*-linux*)
  30. config_path="linux posix"
  31. ;;
  32. alpha*-*-linux*)
  33. config_path="linux/alpha linux posix"
  34. ;;
  35. arm*-*-linux*)
  36. config_path="linux posix"
  37. ;;
  38. ia64*-*-linux*)
  39. config_path="linux/ia64 linux posix"
  40. ;;
  41. mips*-*-linux*)
  42. config_path="linux/mips linux posix"
  43. ;;
  44. powerpc*-*-linux*)
  45. config_path="linux/powerpc linux posix"
  46. ;;
  47. s390*-*-linux*)
  48. config_path="linux/s390 linux posix"
  49. ;;
  50. tile*-*-linux*)
  51. config_path="linux/tile linux posix"
  52. ;;
  53. # Note that bare i386 is not included here. We need cmpxchg.
  54. i[456]86-*-linux*)
  55. config_path="linux/x86 linux posix"
  56. case " ${CC} ${CFLAGS} " in
  57. *" -m64 "*|*" -mx32 "*)
  58. ;;
  59. *)
  60. if test -z "$with_arch"; then
  61. XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
  62. fi
  63. esac
  64. ;;
  65. # Similar jiggery-pokery for x86_64 multilibs, except here we
  66. # can't rely on the --with-arch configure option, since that
  67. # applies to the 64-bit side.
  68. x86_64-*-linux*)
  69. config_path="linux/x86 linux posix"
  70. case " ${CC} ${CFLAGS} " in
  71. *" -m32 "*)
  72. XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
  73. ;;
  74. esac
  75. ;;
  76. # Note that sparcv7 and sparcv8 is not included here. We need cas.
  77. sparcv9-*-linux* | sparc64-*-linux*)
  78. echo "int i;" > conftestx.c
  79. if ${CC} ${CFLAGS} -c -o conftestx.o conftestx.c > /dev/null 2>&1; then
  80. config_path="linux/sparc linux posix"
  81. case "`/usr/bin/file conftestx.o`" in
  82. *32-bit*)
  83. case " ${CC} ${CFLAGS}" in
  84. *" -mcpu=ultrasparc"*)
  85. ;;
  86. *)
  87. XCFLAGS="${XCFLAGS} -mcpu=v9"
  88. ;;
  89. esac
  90. ;;
  91. esac
  92. fi
  93. rm -f conftestx.c conftestx.o
  94. ;;
  95. esac
  96. fi
  97. # Other system configury
  98. case "${target}" in
  99. *-*-hpux*)
  100. config_path="hpux posix"
  101. case "${target}" in
  102. *-*-hpux11*)
  103. # HPUX v11.x requires -lrt to resolve sem_init in libgomp.la
  104. XLDFLAGS="${XLDFLAGS} -lrt"
  105. ;;
  106. esac
  107. case "${target}" in
  108. hppa[12]*-*-hpux*)
  109. # PA 32 HP-UX needs -frandom-seed for bootstrap compare.
  110. XCFLAGS="${XCFLAGS} -frandom-seed=fixed-seed"
  111. ;;
  112. esac
  113. ;;
  114. *-*-mingw32*)
  115. config_path="mingw32 posix"
  116. ;;
  117. *-*-darwin*)
  118. config_path="bsd darwin posix"
  119. ;;
  120. *-*-freebsd*)
  121. # Need to link with -lpthread so libgomp.so is self-contained.
  122. XLDFLAGS="${XLDFLAGS} -lpthread"
  123. ;;
  124. *-*-aix*)
  125. config_path="posix"
  126. # Need to link with -lpthread so libgomp.so is self-contained.
  127. XLDFLAGS="${XLDFLAGS} -lpthread"
  128. ;;
  129. *)
  130. ;;
  131. esac