3 # This shell script handles all host based configuration for libffi.
6 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
7 # Most of the time we can define all the variables all at once...
9 aarch64*-*-cygwin* | aarch64*-*-mingw* | aarch64*-*-win* )
10 TARGET=ARM_WIN64; TARGETDIR=aarch64
11 if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then
17 TARGET=AARCH64; TARGETDIR=aarch64
18 SOURCES="ffi.c sysv.S"
22 TARGET=ALPHA; TARGETDIR=alpha;
23 # Support 128-bit long double, changeable via command-line switch.
24 HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)'
29 TARGET=ARC; TARGETDIR=arc
30 SOURCES="ffi.c arcompact.S"
33 arm*-*-cygwin* | arm*-*-mingw* | arm*-*-win* )
34 TARGET=ARM_WIN32; TARGETDIR=arm
35 if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then
41 TARGET=ARM; TARGETDIR=arm
42 SOURCES="ffi.c sysv.S"
46 TARGET=AVR32; TARGETDIR=avr32
47 SOURCES="ffi.c sysv.S"
51 TARGET=BFIN; TARGETDIR=bfin
52 SOURCES="ffi.c sysv.S"
56 TARGET=LIBFFI_CRIS; TARGETDIR=cris
57 SOURCES="ffi.c sysv.S"
61 TARGET=CSKY; TARGETDIR=csky
62 SOURCES="ffi.c sysv.S"
66 TARGET=FRV; TARGETDIR=frv
67 SOURCES="ffi.c eabi.S"
70 hppa*-*-linux* | parisc*-*-linux* | hppa*-*-openbsd*)
71 TARGET=PA_LINUX; TARGETDIR=pa
72 SOURCES="ffi.c linux.S"
75 TARGET=PA64_HPUX; TARGETDIR=pa
78 TARGET=PA_HPUX; TARGETDIR=pa
79 SOURCES="ffi.c hpux32.S"
82 i?86-*-freebsd* | i?86-*-openbsd*)
83 TARGET=X86_FREEBSD; TARGETDIR=x86
86 i?86-*-cygwin* | i?86-*-mingw* | i?86-*-win* | i?86-*-os2* | i?86-*-interix* \
87 | x86_64-*-cygwin* | x86_64-*-mingw* | x86_64-*-win* )
89 if test $ac_cv_sizeof_size_t = 4; then
94 if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then
97 # All mingw/cygwin/win32 builds require -no-undefined for sharedlib.
98 # We must also check with_cross_host to decide if this is a native
99 # or cross-build and select where to install dlls appropriately.
100 if test -n "$with_cross_host" &&
101 test x"$with_cross_host" != x"no"; then
102 AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"';
104 AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
108 i?86-*-darwin* | x86_64-*-darwin* | i?86-*-ios | x86_64-*-ios)
110 if test $ac_cv_sizeof_size_t = 4; then
117 i?86-*-* | x86_64-*-* | amd64-*)
119 if test $ac_cv_sizeof_size_t = 4; then
120 echo 'int foo (void) { return __x86_64__; }' > conftest.c
121 if $CC $CFLAGS -Werror -S conftest.c -o conftest.s > /dev/null 2>&1; then
134 TARGET=IA64; TARGETDIR=ia64
135 SOURCES="ffi.c unix.S"
139 TARGET=KVX; TARGETDIR=kvx
140 SOURCES="ffi.c sysv.S"
144 TARGET=M32R; TARGETDIR=m32r
145 SOURCES="ffi.c sysv.S"
149 TARGET=M68K; TARGETDIR=m68k
150 SOURCES="ffi.c sysv.S"
154 TARGET=M88K; TARGETDIR=m88k
155 SOURCES="ffi.c obsd.S"
159 TARGET=MICROBLAZE; TARGETDIR=microblaze
160 SOURCES="ffi.c sysv.S"
164 TARGET=MOXIE; TARGETDIR=moxie
165 SOURCES="ffi.c eabi.S"
169 TARGET=METAG; TARGETDIR=metag
170 SOURCES="ffi.c sysv.S"
173 mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
174 TARGET=MIPS; TARGETDIR=mips
176 mips*-*linux* | mips*-*-openbsd* | mips*-*-freebsd*)
177 # Support 128-bit long double for NewABI.
178 HAVE_LONG_DOUBLE='defined(__mips64)'
179 TARGET=MIPS; TARGETDIR=mips
183 TARGET=NIOS2; TARGETDIR=nios2
184 SOURCES="ffi.c sysv.S"
188 TARGET=OR1K; TARGETDIR=or1k
189 SOURCES="ffi.c sysv.S"
192 powerpc*-*-linux* | powerpc-*-sysv*)
193 TARGET=POWERPC; TARGETDIR=powerpc
194 HAVE_LONG_DOUBLE_VARIANT=1
197 TARGET=POWERPC; TARGETDIR=powerpc
200 TARGET=POWERPC; TARGETDIR=powerpc
203 TARGET=POWERPC; TARGETDIR=powerpc
205 powerpc-*-darwin* | powerpc64-*-darwin*)
206 TARGET=POWERPC_DARWIN; TARGETDIR=powerpc
208 powerpc-*-aix* | rs6000-*-aix*)
209 TARGET=POWERPC_AIX; TARGETDIR=powerpc
211 powerpc-*-freebsd* | powerpc-*-openbsd* | powerpc-*-netbsd*)
212 TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
213 HAVE_LONG_DOUBLE_VARIANT=1
215 powerpcspe-*-freebsd*)
216 TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
217 CFLAGS="$CFLAGS -D__NO_FPRS__"
219 powerpc64-*-freebsd* | powerpc64le-*-freebsd*)
220 TARGET=POWERPC; TARGETDIR=powerpc
223 TARGET=POWERPC; TARGETDIR=powerpc
227 TARGET=RISCV; TARGETDIR=riscv
228 SOURCES="ffi.c sysv.S"
231 s390-*-* | s390x-*-*)
232 TARGET=S390; TARGETDIR=s390
233 SOURCES="ffi.c sysv.S"
236 sh-*-* | sh[34]*-*-*)
237 TARGET=SH; TARGETDIR=sh
238 SOURCES="ffi.c sysv.S"
241 TARGET=SH64; TARGETDIR=sh64
242 SOURCES="ffi.c sysv.S"
246 TARGET=SPARC; TARGETDIR=sparc
247 SOURCES="ffi.c ffi64.c v8.S v9.S"
251 TARGET=TILE; TARGETDIR=tile
252 SOURCES="ffi.c tile.S"
256 TARGET=VAX; TARGETDIR=vax
257 SOURCES="ffi.c elfbsd.S"
261 TARGET=XTENSA; TARGETDIR=xtensa
262 SOURCES="ffi.c sysv.S"
266 # ... but some of the cases above share configury.
269 if test "$MSVC" = 1; then
270 SOURCES="ffi.c sysv_msvc_arm32.S"
272 SOURCES="ffi.c sysv.S"
276 if test "$MSVC" = 1; then
277 SOURCES="ffi.c win64_armasm.S"
279 SOURCES="ffi.c sysv.S"
283 SOURCES="ffi.c o32.S n32.S"
286 SOURCES="ffi.c ffi_sysv.c ffi_linux64.c sysv.S ppc_closure.S"
287 SOURCES="${SOURCES} linux64.S linux64_closure.S"
290 SOURCES="ffi_darwin.c aix.S aix_closure.S"
293 SOURCES="ffi_darwin.c darwin.S darwin_closure.S"
296 SOURCES="ffi.c ffi_sysv.c sysv.S ppc_closure.S"
298 X86 | X86_DARWIN | X86_FREEBSD | X86_WIN32)
299 if test "$MSVC" = 1; then
300 SOURCES="ffi.c sysv_intel.S"
302 SOURCES="ffi.c sysv.S"
306 if test x"$TARGET_X32" = xyes; then
307 SOURCES="ffi64.c unix64.S"
309 SOURCES="ffi64.c unix64.S ffiw64.c win64.S"
313 if test "$MSVC" = 1; then
314 SOURCES="ffiw64.c win64_intel.S"
316 SOURCES="ffiw64.c win64.S"
321 # If we failed to configure SOURCES, we can't do anything.
322 if test -z "${SOURCES}"; then