c++: simplify member template substitution
[official-gcc.git] / libffi / configure.host
blob268267183a031c292a53d3ab11ec475f13c51392
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*-*-cygwin* | aarch64*-*-mingw* | aarch64*-*-win* )
10         TARGET=ARM_WIN64; TARGETDIR=aarch64
11         if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then
12           MSVC=1
13         fi
14         ;;
16   aarch64*-*-*)
17         TARGET=AARCH64; TARGETDIR=aarch64
18         SOURCES="ffi.c sysv.S"
19         ;;
21   alpha*-*-*)
22         TARGET=ALPHA; TARGETDIR=alpha;
23         # Support 128-bit long double, changeable via command-line switch.
24         HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)'
25         SOURCES="ffi.c osf.S"
26         ;;
28   arc*-*-*)
29         TARGET=ARC; TARGETDIR=arc
30         SOURCES="ffi.c arcompact.S"
31         ;;
33   arm*-*-cygwin* | arm*-*-mingw* | arm*-*-win* )
34         TARGET=ARM_WIN32; TARGETDIR=arm
35         if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then
36           MSVC=1
37         fi
38         ;;
40   arm*-*-*)
41         TARGET=ARM; TARGETDIR=arm
42         SOURCES="ffi.c sysv.S"
43         ;;
45   avr32*-*-*)
46         TARGET=AVR32; TARGETDIR=avr32
47         SOURCES="ffi.c sysv.S"
48         ;;
50   bfin*)
51         TARGET=BFIN; TARGETDIR=bfin
52         SOURCES="ffi.c sysv.S"
53         ;;
55   cris-*-*)
56         TARGET=LIBFFI_CRIS; TARGETDIR=cris
57         SOURCES="ffi.c sysv.S"
58         ;;
60   csky-*-*)
61         TARGET=CSKY; TARGETDIR=csky
62         SOURCES="ffi.c sysv.S"
63         ;;
65   frv-*-*)
66         TARGET=FRV; TARGETDIR=frv
67         SOURCES="ffi.c eabi.S"
68         ;;
70   hppa*-*-linux* | parisc*-*-linux* | hppa*-*-openbsd*)
71         TARGET=PA_LINUX; TARGETDIR=pa
72         SOURCES="ffi.c linux.S"
73         ;;
74   hppa*64-*-hpux*)
75         TARGET=PA64_HPUX; TARGETDIR=pa
76         ;;
77   hppa*-*-hpux*)
78         TARGET=PA_HPUX; TARGETDIR=pa
79         SOURCES="ffi.c hpux32.S"
80         ;;
82   i?86-*-freebsd* | i?86-*-openbsd*)
83         TARGET=X86_FREEBSD; TARGETDIR=x86
84         ;;
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* )
88         TARGETDIR=x86
89         if test $ac_cv_sizeof_size_t = 4; then
90           TARGET=X86_WIN32
91         else
92           TARGET=X86_WIN64
93         fi
94         if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then
95           MSVC=1
96         fi
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)"';
103         else
104           AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
105         fi
106         ;;
108   i?86-*-darwin* | x86_64-*-darwin* | i?86-*-ios | x86_64-*-ios)
109         TARGETDIR=x86
110         if test $ac_cv_sizeof_size_t = 4; then
111           TARGET=X86_DARWIN
112         else
113           TARGET=X86_64
114         fi
115         ;;
117   i?86-*-* | x86_64-*-* | amd64-*)
118         TARGETDIR=x86
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
122             TARGET_X32=yes
123             TARGET=X86_64
124           else
125             TARGET=X86;
126           fi
127           rm -f conftest.*
128         else
129           TARGET=X86_64;
130         fi
131         ;;
133   ia64*-*-*)
134         TARGET=IA64; TARGETDIR=ia64
135         SOURCES="ffi.c unix.S"
136         ;;
138   kvx-*-*)
139         TARGET=KVX; TARGETDIR=kvx
140         SOURCES="ffi.c sysv.S"
141         ;;
143   m32r*-*-*)
144         TARGET=M32R; TARGETDIR=m32r
145         SOURCES="ffi.c sysv.S"
146         ;;
148   m68k-*-*)
149         TARGET=M68K; TARGETDIR=m68k
150         SOURCES="ffi.c sysv.S"
151         ;;
153   m88k-*-*)
154         TARGET=M88K; TARGETDIR=m88k
155         SOURCES="ffi.c obsd.S"
156         ;;
158   microblaze*-*-*)
159         TARGET=MICROBLAZE; TARGETDIR=microblaze
160         SOURCES="ffi.c sysv.S"
161         ;;
163   moxie-*-*)
164         TARGET=MOXIE; TARGETDIR=moxie
165         SOURCES="ffi.c eabi.S"
166         ;;
168   metag-*-*)
169         TARGET=METAG; TARGETDIR=metag
170         SOURCES="ffi.c sysv.S"
171         ;;
173   mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
174         TARGET=MIPS; TARGETDIR=mips
175         ;;
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
180         ;;
182   nios2*-linux*)
183         TARGET=NIOS2; TARGETDIR=nios2
184         SOURCES="ffi.c sysv.S"
185         ;;
187   or1k*-*-*)
188         TARGET=OR1K; TARGETDIR=or1k
189         SOURCES="ffi.c sysv.S"
190         ;;
192   powerpc*-*-linux* | powerpc-*-sysv*)
193         TARGET=POWERPC; TARGETDIR=powerpc
194         HAVE_LONG_DOUBLE_VARIANT=1
195         ;;
196   powerpc-*-amigaos*)
197         TARGET=POWERPC; TARGETDIR=powerpc
198         ;;
199   powerpc-*-eabi*)
200         TARGET=POWERPC; TARGETDIR=powerpc
201         ;;
202   powerpc-*-beos*)
203         TARGET=POWERPC; TARGETDIR=powerpc
204         ;;
205   powerpc-*-darwin* | powerpc64-*-darwin*)
206         TARGET=POWERPC_DARWIN; TARGETDIR=powerpc
207         ;;
208   powerpc-*-aix* | rs6000-*-aix*)
209         TARGET=POWERPC_AIX; TARGETDIR=powerpc
210         ;;
211   powerpc-*-freebsd* | powerpc-*-openbsd* | powerpc-*-netbsd*)
212         TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
213         HAVE_LONG_DOUBLE_VARIANT=1
214         ;;
215   powerpcspe-*-freebsd*)
216         TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
217         CFLAGS="$CFLAGS -D__NO_FPRS__"
218         ;;
219   powerpc64-*-freebsd* | powerpc64le-*-freebsd*)
220         TARGET=POWERPC; TARGETDIR=powerpc
221         ;;
222   powerpc*-*-rtems*)
223         TARGET=POWERPC; TARGETDIR=powerpc
224         ;;
226   riscv*-*)
227         TARGET=RISCV; TARGETDIR=riscv
228         SOURCES="ffi.c sysv.S"
229         ;;
231   s390-*-* | s390x-*-*)
232         TARGET=S390; TARGETDIR=s390
233         SOURCES="ffi.c sysv.S"
234         ;;
236   sh-*-* | sh[34]*-*-*)
237         TARGET=SH; TARGETDIR=sh
238         SOURCES="ffi.c sysv.S"
239         ;;
240   sh64-*-* | sh5*-*-*)
241         TARGET=SH64; TARGETDIR=sh64
242         SOURCES="ffi.c sysv.S"
243         ;;
245   sparc*-*-*)
246         TARGET=SPARC; TARGETDIR=sparc
247         SOURCES="ffi.c ffi64.c v8.S v9.S"
248         ;;
250   tile*-*)
251         TARGET=TILE; TARGETDIR=tile
252         SOURCES="ffi.c tile.S"
253         ;;
255   vax-*-*)
256         TARGET=VAX; TARGETDIR=vax
257         SOURCES="ffi.c elfbsd.S"
258         ;;
260   xtensa*-*)
261         TARGET=XTENSA; TARGETDIR=xtensa
262         SOURCES="ffi.c sysv.S"
263         ;;
264 esac
266 # ... but some of the cases above share configury.
267 case "${TARGET}" in
268   ARM_WIN32)
269         if test "$MSVC" = 1; then
270                 SOURCES="ffi.c sysv_msvc_arm32.S"
271         else
272                 SOURCES="ffi.c sysv.S"
273         fi
274         ;;
275   ARM_WIN64)
276         if test "$MSVC" = 1; then
277                 SOURCES="ffi.c win64_armasm.S"
278         else
279                 SOURCES="ffi.c sysv.S"
280         fi
281         ;;
282   MIPS)
283         SOURCES="ffi.c o32.S n32.S"
284         ;;
285   POWERPC)
286         SOURCES="ffi.c ffi_sysv.c ffi_linux64.c sysv.S ppc_closure.S"
287         SOURCES="${SOURCES} linux64.S linux64_closure.S"
288         ;;
289   POWERPC_AIX)
290         SOURCES="ffi_darwin.c aix.S aix_closure.S"
291         ;;
292   POWERPC_DARWIN)
293         SOURCES="ffi_darwin.c darwin.S darwin_closure.S"
294         ;;
295   POWERPC_FREEBSD)
296         SOURCES="ffi.c ffi_sysv.c sysv.S ppc_closure.S"
297         ;;
298   X86 | X86_DARWIN | X86_FREEBSD | X86_WIN32)
299         if test "$MSVC" = 1; then
300                 SOURCES="ffi.c sysv_intel.S"
301         else
302                 SOURCES="ffi.c sysv.S"
303         fi
304         ;;
305   X86_64)
306         if test x"$TARGET_X32" = xyes; then
307                 SOURCES="ffi64.c unix64.S"
308         else
309                 SOURCES="ffi64.c unix64.S ffiw64.c win64.S"
310         fi
311         ;;
312   X86_WIN64)
313         if test "$MSVC" = 1; then
314                 SOURCES="ffiw64.c win64_intel.S"
315         else
316                 SOURCES="ffiw64.c win64.S"
317         fi
318         ;;
319 esac
321 # If we failed to configure SOURCES, we can't do anything.
322 if test -z "${SOURCES}"; then
323   UNSUPPORTED=1