[PATCH] #assert becomes macro-like
[official-gcc.git] / libffi / configure.host
blob786b32c5bb00c3efb76d6daf15a024ea4c7e00d4
1 # configure.host
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...
8 case "${host}" in
9   aarch64*-*-*)
10         TARGET=AARCH64; TARGETDIR=aarch64
11         SOURCES="ffi.c sysv.S"
12         ;;
14   alpha*-*-*)
15         TARGET=ALPHA; TARGETDIR=alpha;
16         # Support 128-bit long double, changeable via command-line switch.
17         HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)'
18         SOURCES="ffi.c osf.S"
19         ;;
21   arc*-*-*)
22         TARGET=ARC; TARGETDIR=arc
23         SOURCES="ffi.c arcompact.S"
24         ;;
26   arm*-*-*)
27         TARGET=ARM; TARGETDIR=arm
28         SOURCES="ffi.c sysv.S"
29         ;;
31   avr32*-*-*)
32         TARGET=AVR32; TARGETDIR=avr32
33         SOURCES="ffi.c sysv.S"
34         ;;
36   bfin*)
37         TARGET=BFIN; TARGETDIR=bfin
38         SOURCES="ffi.c sysv.S"
39         ;;
41   cris-*-*)
42         TARGET=LIBFFI_CRIS; TARGETDIR=cris
43         SOURCES="ffi.c sysv.S"
44         ;;
46   frv-*-*)
47         TARGET=FRV; TARGETDIR=frv
48         SOURCES="ffi.c eabi.S"
49         ;;
51   hppa*-*-linux* | parisc*-*-linux* | hppa*-*-openbsd*)
52         TARGET=PA_LINUX; TARGETDIR=pa
53         SOURCES="ffi.c linux.S"
54         ;;
55   hppa*64-*-hpux*)
56         TARGET=PA64_HPUX; TARGETDIR=pa
57         ;;
58   hppa*-*-hpux*)
59         TARGET=PA_HPUX; TARGETDIR=pa
60         SOURCES="ffi.c hpux32.S"
61         ;;
63   i?86-*-freebsd* | i?86-*-openbsd*)
64         TARGET=X86_FREEBSD; TARGETDIR=x86
65         ;;
67   i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix* \
68   | x86_64-*-cygwin* | x86_64-*-mingw*)
69         TARGETDIR=x86
70         if test $ac_cv_sizeof_size_t = 4; then
71           TARGET=X86_WIN32
72         else
73           TARGET=X86_WIN64
74         fi
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)"';
81         else
82           AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
83         fi
84         ;;
86   i?86-*-darwin* | x86_64-*-darwin*)
87         TARGETDIR=x86
88         if test $ac_cv_sizeof_size_t = 4; then
89           TARGET=X86_DARWIN
90         else
91           TARGET=X86_64_DARWIN
92         fi
93         ;;
95   i?86-*-* | x86_64-*-* | amd64-*)
96         TARGETDIR=x86
97         if test $ac_cv_sizeof_size_t = 4; then
98           case "$host" in
99             *-gnux32)
100               TARGET=X86_64
101               ;;
102             *)
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
105                 TARGET=X86_64;
106               else
107                 TARGET=X86;
108               fi
109               rm -f conftest.*
110               ;;
111           esac
112         else
113           TARGET=X86_64;
114         fi
115         ;;
117   ia64*-*-*)
118         TARGET=IA64; TARGETDIR=ia64
119         SOURCES="ffi.c unix.S"
120         ;;
122   m32r*-*-*)
123         TARGET=M32R; TARGETDIR=m32r
124         SOURCES="ffi.c sysv.S"
125         ;;
127   m68k-*-*)
128         TARGET=M68K; TARGETDIR=m68k
129         SOURCES="ffi.c sysv.S"
130         ;;
132   m88k-*-*)
133         TARGET=M88K; TARGETDIR=m88k
134         SOURCES="ffi.c obsd.S"
135         ;;
137   microblaze*-*-*)
138         TARGET=MICROBLAZE; TARGETDIR=microblaze
139         SOURCES="ffi.c sysv.S"
140         ;;
142   moxie-*-*)
143         TARGET=MOXIE; TARGETDIR=moxie
144         SOURCES="ffi.c eabi.S"
145         ;;
147   metag-*-*)
148         TARGET=METAG; TARGETDIR=metag
149         SOURCES="ffi.c sysv.S"
150         ;;
152   mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
153         TARGET=MIPS; TARGETDIR=mips
154         ;;
155   mips*-*linux* | mips*-*-openbsd*)
156         # Support 128-bit long double for NewABI.
157         HAVE_LONG_DOUBLE='defined(__mips64)'
158         TARGET=MIPS; TARGETDIR=mips
159         ;;
161   nios2*-linux*)
162         TARGET=NIOS2; TARGETDIR=nios2
163         SOURCES="ffi.c sysv.S"
164         ;;
166   or1k*-linux*)
167         TARGET=OR1K; TARGETDIR=or1k
168         SOURCES="ffi.c sysv.S"
169         ;;
171   powerpc*-*-linux* | powerpc-*-sysv*)
172         TARGET=POWERPC; TARGETDIR=powerpc
173         HAVE_LONG_DOUBLE_VARIANT=1
174         ;;
175   powerpc-*-amigaos*)
176         TARGET=POWERPC; TARGETDIR=powerpc
177         ;;
178   powerpc-*-beos*)
179         TARGET=POWERPC; TARGETDIR=powerpc
180         ;;
181   powerpc-*-darwin* | powerpc64-*-darwin*)
182         TARGET=POWERPC_DARWIN; TARGETDIR=powerpc
183         ;;
184   powerpc-*-aix* | rs6000-*-aix*)
185         TARGET=POWERPC_AIX; TARGETDIR=powerpc
186         ;;
187   powerpc-*-freebsd* | powerpc-*-openbsd*)
188         TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
189         HAVE_LONG_DOUBLE_VARIANT=1
190         ;;
191   powerpc64-*-freebsd*)
192         TARGET=POWERPC; TARGETDIR=powerpc
193         ;;
194   powerpc*-*-rtems*)
195         TARGET=POWERPC; TARGETDIR=powerpc
196         ;;
198   riscv*-*)
199         TARGET=RISCV; TARGETDIR=riscv
200         SOURCES="ffi.c sysv.S"
201         ;;
203   s390-*-* | s390x-*-*)
204         TARGET=S390; TARGETDIR=s390
205         SOURCES="ffi.c sysv.S"
206         ;;
208   sh-*-* | sh[34]*-*-*)
209         TARGET=SH; TARGETDIR=sh
210         SOURCES="ffi.c sysv.S"
211         ;;
212   sh64-*-* | sh5*-*-*)
213         TARGET=SH64; TARGETDIR=sh64
214         SOURCES="ffi.c sysv.S"
215         ;;
217   sparc*-*-*)
218         TARGET=SPARC; TARGETDIR=sparc
219         SOURCES="ffi.c ffi64.c v8.S v9.S"
220         ;;
222   tile*-*)
223         TARGET=TILE; TARGETDIR=tile
224         SOURCES="ffi.c tile.S"
225         ;;
227   vax-*-*)
228         TARGET=VAX; TARGETDIR=vax
229         SOURCES="ffi.c elfbsd.S"
230         ;;
232   xtensa*-*)
233         TARGET=XTENSA; TARGETDIR=xtensa
234         SOURCES="ffi.c sysv.S"
235         ;;
236 esac
238 # ... but some of the cases above share configury.
239 case "${TARGET}" in
240   MIPS)
241         SOURCES="ffi.c o32.S n32.S"
242         ;;
243   POWERPC)
244         SOURCES="ffi.c ffi_sysv.c ffi_linux64.c sysv.S ppc_closure.S"
245         SOURCES="${SOURCES} linux64.S linux64_closure.S"
246         ;;
247   POWERPC_AIX)
248         SOURCES="ffi_darwin.c aix.S aix_closure.S"
249         ;;
250   POWERPC_DARWIN)
251         SOURCES="ffi_darwin.c darwin.S darwin_closure.S"
252         ;;
253   POWERPC_FREEBSD)
254         SOURCES="ffi.c ffi_sysv.c sysv.S ppc_closure.S"
255         ;;
256   X86 | X86_FREEBSD | X86_WIN32)
257         SOURCES="ffi.c sysv.S"
258         ;;
259   X86_64)
260         SOURCES="ffi64.c unix64.S"
261         ;;
262   X86_WIN64)
263         SOURCES="ffiw64.c win64.S"
264         ;;
265   X86_DARWIN)
266         SOURCES="darwin_c.c darwin.S"
267         ;;
268   X86_64_DARWIN)
269         SOURCES="darwin64_c.c darwin64.S"
270         ;;
271 esac
273 # If we failed to configure SOURCES, we can't do anything.
274 if test -z "${SOURCES}"; then
275   UNSUPPORTED=1