2018-02-07 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / libffi / configure.host
blob24fbfc438f010d9eb09ee4879089b975a08c9d46
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   s390-*-* | s390x-*-*)
199         TARGET=S390; TARGETDIR=s390
200         SOURCES="ffi.c sysv.S"
201         ;;
203   sh-*-* | sh[34]*-*-*)
204         TARGET=SH; TARGETDIR=sh
205         SOURCES="ffi.c sysv.S"
206         ;;
207   sh64-*-* | sh5*-*-*)
208         TARGET=SH64; TARGETDIR=sh64
209         SOURCES="ffi.c sysv.S"
210         ;;
212   sparc*-*-*)
213         TARGET=SPARC; TARGETDIR=sparc
214         SOURCES="ffi.c ffi64.c v8.S v9.S"
215         ;;
217   tile*-*)
218         TARGET=TILE; TARGETDIR=tile
219         SOURCES="ffi.c tile.S"
220         ;;
222   vax-*-*)
223         TARGET=VAX; TARGETDIR=vax
224         SOURCES="ffi.c elfbsd.S"
225         ;;
227   xtensa*-*)
228         TARGET=XTENSA; TARGETDIR=xtensa
229         SOURCES="ffi.c sysv.S"
230         ;;
231 esac
233 # ... but some of the cases above share configury.
234 case "${TARGET}" in
235   MIPS)
236         SOURCES="ffi.c o32.S n32.S"
237         ;;
238   POWERPC)
239         SOURCES="ffi.c ffi_sysv.c ffi_linux64.c sysv.S ppc_closure.S"
240         SOURCES="${SOURCES} linux64.S linux64_closure.S"
241         ;;
242   POWERPC_AIX)
243         SOURCES="ffi_darwin.c aix.S aix_closure.S"
244         ;;
245   POWERPC_DARWIN)
246         SOURCES="ffi_darwin.c darwin.S darwin_closure.S"
247         ;;
248   POWERPC_FREEBSD)
249         SOURCES="ffi.c ffi_sysv.c sysv.S ppc_closure.S"
250         ;;
251   X86 | X86_FREEBSD | X86_WIN32)
252         SOURCES="ffi.c sysv.S"
253         ;;
254   X86_64)
255         SOURCES="ffi64.c unix64.S"
256         ;;
257   X86_WIN64)
258         SOURCES="ffiw64.c win64.S"
259         ;;
260   X86_DARWIN)
261         SOURCES="darwin_c.c darwin.S"
262         ;;
263   X86_64_DARWIN)
264         SOURCES="darwin64_c.c darwin64.S"
265         ;;
266 esac
268 # If we failed to configure SOURCES, we can't do anything.
269 if test -z "${SOURCES}"; then
270   UNSUPPORTED=1