configure.host 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. # configure.host
  2. #
  3. # This shell script handles all host based configuration for libffi.
  4. #
  5. # THIS TABLE IS SORTED. KEEP IT THAT WAY.
  6. # Most of the time we can define all the variables all at once...
  7. case "${host}" in
  8. aarch64*-*-*)
  9. TARGET=AARCH64; TARGETDIR=aarch64
  10. SOURCES="ffi.c sysv.S"
  11. ;;
  12. alpha*-*-*)
  13. TARGET=ALPHA; TARGETDIR=alpha;
  14. # Support 128-bit long double, changeable via command-line switch.
  15. HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)'
  16. SOURCES="ffi.c osf.S"
  17. ;;
  18. arc*-*-*)
  19. TARGET=ARC; TARGETDIR=arc
  20. SOURCES="ffi.c arcompact.S"
  21. ;;
  22. arm*-*-*)
  23. TARGET=ARM; TARGETDIR=arm
  24. SOURCES="ffi.c sysv.S"
  25. ;;
  26. avr32*-*-*)
  27. TARGET=AVR32; TARGETDIR=avr32
  28. SOURCES="ffi.c sysv.S"
  29. ;;
  30. bfin*)
  31. TARGET=BFIN; TARGETDIR=bfin
  32. SOURCES="ffi.c sysv.S"
  33. ;;
  34. cris-*-*)
  35. TARGET=LIBFFI_CRIS; TARGETDIR=cris
  36. SOURCES="ffi.c sysv.S"
  37. ;;
  38. frv-*-*)
  39. TARGET=FRV; TARGETDIR=frv
  40. SOURCES="ffi.c eabi.S"
  41. ;;
  42. hppa*-*-linux* | parisc*-*-linux* | hppa*-*-openbsd*)
  43. TARGET=PA_LINUX; TARGETDIR=pa
  44. SOURCES="ffi.c linux.S"
  45. ;;
  46. hppa*64-*-hpux*)
  47. TARGET=PA64_HPUX; TARGETDIR=pa
  48. ;;
  49. hppa*-*-hpux*)
  50. TARGET=PA_HPUX; TARGETDIR=pa
  51. SOURCES="ffi.c hpux32.S"
  52. ;;
  53. i?86-*-freebsd* | i?86-*-openbsd*)
  54. TARGET=X86_FREEBSD; TARGETDIR=x86
  55. ;;
  56. i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix* \
  57. | x86_64-*-cygwin* | x86_64-*-mingw*)
  58. TARGETDIR=x86
  59. if test $ac_cv_sizeof_size_t = 4; then
  60. TARGET=X86_WIN32
  61. else
  62. TARGET=X86_WIN64
  63. fi
  64. # All mingw/cygwin/win32 builds require -no-undefined for sharedlib.
  65. # We must also check with_cross_host to decide if this is a native
  66. # or cross-build and select where to install dlls appropriately.
  67. if test -n "$with_cross_host" &&
  68. test x"$with_cross_host" != x"no"; then
  69. AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"';
  70. else
  71. AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
  72. fi
  73. ;;
  74. i?86-*-darwin* | x86_64-*-darwin*)
  75. TARGETDIR=x86
  76. if test $ac_cv_sizeof_size_t = 4; then
  77. TARGET=X86_DARWIN
  78. else
  79. TARGET=X86_64_DARWIN
  80. fi
  81. ;;
  82. i?86-*-* | x86_64-*-* | amd64-*)
  83. TARGETDIR=x86
  84. if test $ac_cv_sizeof_size_t = 4; then
  85. case "$host" in
  86. *-gnux32)
  87. TARGET=X86_64
  88. ;;
  89. *)
  90. echo 'int foo (void) { return __x86_64__; }' > conftest.c
  91. if $CC $CFLAGS -Werror -S conftest.c -o conftest.s > /dev/null 2>&1; then
  92. TARGET=X86_64;
  93. else
  94. TARGET=X86;
  95. fi
  96. rm -f conftest.*
  97. ;;
  98. esac
  99. else
  100. TARGET=X86_64;
  101. fi
  102. ;;
  103. ia64*-*-*)
  104. TARGET=IA64; TARGETDIR=ia64
  105. SOURCES="ffi.c unix.S"
  106. ;;
  107. m32r*-*-*)
  108. TARGET=M32R; TARGETDIR=m32r
  109. SOURCES="ffi.c sysv.S"
  110. ;;
  111. m68k-*-*)
  112. TARGET=M68K; TARGETDIR=m68k
  113. SOURCES="ffi.c sysv.S"
  114. ;;
  115. m88k-*-*)
  116. TARGET=M88K; TARGETDIR=m88k
  117. SOURCES="ffi.c obsd.S"
  118. ;;
  119. microblaze*-*-*)
  120. TARGET=MICROBLAZE; TARGETDIR=microblaze
  121. SOURCES="ffi.c sysv.S"
  122. ;;
  123. moxie-*-*)
  124. TARGET=MOXIE; TARGETDIR=moxie
  125. SOURCES="ffi.c eabi.S"
  126. ;;
  127. metag-*-*)
  128. TARGET=METAG; TARGETDIR=metag
  129. SOURCES="ffi.c sysv.S"
  130. ;;
  131. mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
  132. TARGET=MIPS; TARGETDIR=mips
  133. ;;
  134. mips*-*linux* | mips*-*-openbsd*)
  135. # Support 128-bit long double for NewABI.
  136. HAVE_LONG_DOUBLE='defined(__mips64)'
  137. TARGET=MIPS; TARGETDIR=mips
  138. ;;
  139. nios2*-linux*)
  140. TARGET=NIOS2; TARGETDIR=nios2
  141. SOURCES="ffi.c sysv.S"
  142. ;;
  143. or1k*-linux*)
  144. TARGET=OR1K; TARGETDIR=or1k
  145. SOURCES="ffi.c sysv.S"
  146. ;;
  147. powerpc*-*-linux* | powerpc-*-sysv*)
  148. TARGET=POWERPC; TARGETDIR=powerpc
  149. HAVE_LONG_DOUBLE_VARIANT=1
  150. ;;
  151. powerpc-*-amigaos*)
  152. TARGET=POWERPC; TARGETDIR=powerpc
  153. ;;
  154. powerpc-*-beos*)
  155. TARGET=POWERPC; TARGETDIR=powerpc
  156. ;;
  157. powerpc-*-darwin* | powerpc64-*-darwin*)
  158. TARGET=POWERPC_DARWIN; TARGETDIR=powerpc
  159. ;;
  160. powerpc-*-aix* | rs6000-*-aix*)
  161. TARGET=POWERPC_AIX; TARGETDIR=powerpc
  162. ;;
  163. powerpc-*-freebsd* | powerpc-*-openbsd*)
  164. TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
  165. HAVE_LONG_DOUBLE_VARIANT=1
  166. ;;
  167. powerpc64-*-freebsd*)
  168. TARGET=POWERPC; TARGETDIR=powerpc
  169. ;;
  170. powerpc*-*-rtems*)
  171. TARGET=POWERPC; TARGETDIR=powerpc
  172. ;;
  173. s390-*-* | s390x-*-*)
  174. TARGET=S390; TARGETDIR=s390
  175. SOURCES="ffi.c sysv.S"
  176. ;;
  177. sh-*-* | sh[34]*-*-*)
  178. TARGET=SH; TARGETDIR=sh
  179. SOURCES="ffi.c sysv.S"
  180. ;;
  181. sh64-*-* | sh5*-*-*)
  182. TARGET=SH64; TARGETDIR=sh64
  183. SOURCES="ffi.c sysv.S"
  184. ;;
  185. sparc*-*-*)
  186. TARGET=SPARC; TARGETDIR=sparc
  187. SOURCES="ffi.c ffi64.c v8.S v9.S"
  188. ;;
  189. tile*-*)
  190. TARGET=TILE; TARGETDIR=tile
  191. SOURCES="ffi.c tile.S"
  192. ;;
  193. vax-*-*)
  194. TARGET=VAX; TARGETDIR=vax
  195. SOURCES="ffi.c elfbsd.S"
  196. ;;
  197. xtensa*-*)
  198. TARGET=XTENSA; TARGETDIR=xtensa
  199. SOURCES="ffi.c sysv.S"
  200. ;;
  201. esac
  202. # ... but some of the cases above share configury.
  203. case "${TARGET}" in
  204. MIPS)
  205. SOURCES="ffi.c o32.S n32.S"
  206. ;;
  207. POWERPC)
  208. SOURCES="ffi.c ffi_sysv.c ffi_linux64.c sysv.S ppc_closure.S"
  209. SOURCES="${SOURCES} linux64.S linux64_closure.S"
  210. ;;
  211. POWERPC_AIX)
  212. SOURCES="ffi_darwin.c aix.S aix_closure.S"
  213. ;;
  214. POWERPC_DARWIN)
  215. SOURCES="ffi_darwin.c darwin.S darwin_closure.S"
  216. ;;
  217. POWERPC_FREEBSD)
  218. SOURCES="ffi.c ffi_sysv.c sysv.S ppc_closure.S"
  219. ;;
  220. X86 | X86_FREEBSD | X86_WIN32)
  221. SOURCES="ffi.c sysv.S"
  222. ;;
  223. X86_64)
  224. SOURCES="ffi64.c unix64.S"
  225. ;;
  226. X86_WIN64)
  227. SOURCES="ffiw64.c win64.S"
  228. ;;
  229. X86_DARWIN)
  230. SOURCES="darwin_c.c darwin.S"
  231. ;;
  232. X86_64_DARWIN)
  233. SOURCES="darwin64_c.c darwin64.S"
  234. ;;
  235. esac
  236. # If we failed to configure SOURCES, we can't do anything.
  237. if test -z "${SOURCES}"; then
  238. UNSUPPORTED=1
  239. fi