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...
10 TARGET=AARCH64; TARGETDIR=aarch64
11 SOURCES="ffi.c sysv.S"
15 TARGET=ALPHA; TARGETDIR=alpha;
16 # Support 128-bit long double, changeable via command-line switch.
17 HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)'
22 TARGET=ARC; TARGETDIR=arc
23 SOURCES="ffi.c arcompact.S"
27 TARGET=ARM; TARGETDIR=arm
28 SOURCES="ffi.c sysv.S"
32 TARGET=AVR32; TARGETDIR=avr32
33 SOURCES="ffi.c sysv.S"
37 TARGET=BFIN; TARGETDIR=bfin
38 SOURCES="ffi.c sysv.S"
42 TARGET=LIBFFI_CRIS; TARGETDIR=cris
43 SOURCES="ffi.c sysv.S"
47 TARGET=FRV; TARGETDIR=frv
48 SOURCES="ffi.c eabi.S"
51 hppa*-*-linux* | parisc*-*-linux* | hppa*-*-openbsd*)
52 TARGET=PA_LINUX; TARGETDIR=pa
53 SOURCES="ffi.c linux.S"
56 TARGET=PA64_HPUX; TARGETDIR=pa
59 TARGET=PA_HPUX; TARGETDIR=pa
60 SOURCES="ffi.c hpux32.S"
63 i?86-*-freebsd* | i?86-*-openbsd*)
64 TARGET=X86_FREEBSD; TARGETDIR=x86
67 i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix* \
68 | x86_64-*-cygwin* | x86_64-*-mingw*)
70 if test $ac_cv_sizeof_size_t = 4; then
75 # All mingw/cygwin/win32 builds require -no-undefined for sharedlib.
76 # We must also check with_cross_host to decide if this is a native
77 # or cross-build and select where to install dlls appropriately.
78 if test -n "$with_cross_host" &&
79 test x"$with_cross_host" != x"no"; then
80 AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"';
82 AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
86 i?86-*-darwin* | x86_64-*-darwin*)
88 if test $ac_cv_sizeof_size_t = 4; then
95 i?86-*-* | x86_64-*-* | amd64-*)
97 if test $ac_cv_sizeof_size_t = 4; then
103 echo 'int foo (void) { return __x86_64__; }' > conftest.c
104 if $CC $CFLAGS -Werror -S conftest.c -o conftest.s > /dev/null 2>&1; then
118 TARGET=IA64; TARGETDIR=ia64
119 SOURCES="ffi.c unix.S"
123 TARGET=M32R; TARGETDIR=m32r
124 SOURCES="ffi.c sysv.S"
128 TARGET=M68K; TARGETDIR=m68k
129 SOURCES="ffi.c sysv.S"
133 TARGET=M88K; TARGETDIR=m88k
134 SOURCES="ffi.c obsd.S"
138 TARGET=MICROBLAZE; TARGETDIR=microblaze
139 SOURCES="ffi.c sysv.S"
143 TARGET=MOXIE; TARGETDIR=moxie
144 SOURCES="ffi.c eabi.S"
148 TARGET=METAG; TARGETDIR=metag
149 SOURCES="ffi.c sysv.S"
152 mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
153 TARGET=MIPS; TARGETDIR=mips
155 mips*-*linux* | mips*-*-openbsd*)
156 # Support 128-bit long double for NewABI.
157 HAVE_LONG_DOUBLE='defined(__mips64)'
158 TARGET=MIPS; TARGETDIR=mips
162 TARGET=NIOS2; TARGETDIR=nios2
163 SOURCES="ffi.c sysv.S"
167 TARGET=OR1K; TARGETDIR=or1k
168 SOURCES="ffi.c sysv.S"
171 powerpc*-*-linux* | powerpc-*-sysv*)
172 TARGET=POWERPC; TARGETDIR=powerpc
173 HAVE_LONG_DOUBLE_VARIANT=1
176 TARGET=POWERPC; TARGETDIR=powerpc
179 TARGET=POWERPC; TARGETDIR=powerpc
181 powerpc-*-darwin* | powerpc64-*-darwin*)
182 TARGET=POWERPC_DARWIN; TARGETDIR=powerpc
184 powerpc-*-aix* | rs6000-*-aix*)
185 TARGET=POWERPC_AIX; TARGETDIR=powerpc
187 powerpc-*-freebsd* | powerpc-*-openbsd*)
188 TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
189 HAVE_LONG_DOUBLE_VARIANT=1
191 powerpc64-*-freebsd*)
192 TARGET=POWERPC; TARGETDIR=powerpc
195 TARGET=POWERPC; TARGETDIR=powerpc
199 TARGET=RISCV; TARGETDIR=riscv
200 SOURCES="ffi.c sysv.S"
203 s390-*-* | s390x-*-*)
204 TARGET=S390; TARGETDIR=s390
205 SOURCES="ffi.c sysv.S"
208 sh-*-* | sh[34]*-*-*)
209 TARGET=SH; TARGETDIR=sh
210 SOURCES="ffi.c sysv.S"
213 TARGET=SH64; TARGETDIR=sh64
214 SOURCES="ffi.c sysv.S"
218 TARGET=SPARC; TARGETDIR=sparc
219 SOURCES="ffi.c ffi64.c v8.S v9.S"
223 TARGET=TILE; TARGETDIR=tile
224 SOURCES="ffi.c tile.S"
228 TARGET=VAX; TARGETDIR=vax
229 SOURCES="ffi.c elfbsd.S"
233 TARGET=XTENSA; TARGETDIR=xtensa
234 SOURCES="ffi.c sysv.S"
238 # ... but some of the cases above share configury.
241 SOURCES="ffi.c o32.S n32.S"
244 SOURCES="ffi.c ffi_sysv.c ffi_linux64.c sysv.S ppc_closure.S"
245 SOURCES="${SOURCES} linux64.S linux64_closure.S"
248 SOURCES="ffi_darwin.c aix.S aix_closure.S"
251 SOURCES="ffi_darwin.c darwin.S darwin_closure.S"
254 SOURCES="ffi.c ffi_sysv.c sysv.S ppc_closure.S"
256 X86 | X86_FREEBSD | X86_WIN32)
257 SOURCES="ffi.c sysv.S"
260 SOURCES="ffi64.c unix64.S"
263 SOURCES="ffiw64.c win64.S"
266 SOURCES="darwin_c.c darwin.S"
269 SOURCES="darwin64_c.c darwin64.S"
273 # If we failed to configure SOURCES, we can't do anything.
274 if test -z "${SOURCES}"; then