remove stray quote
[libffi.git] / configure.host
1 # configure.host
2 #
3 # This shell script handles all host based configuration for libffi.
4 #
5
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         ;;
13
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         ;;
20
21   arc*-*-*)
22         TARGET=ARC; TARGETDIR=arc
23         SOURCES="ffi.c arcompact.S"
24         ;;
25
26   arm*-*-*)
27         TARGET=ARM; TARGETDIR=arm
28         SOURCES="ffi.c sysv.S"
29         ;;
30
31   avr32*-*-*)
32         TARGET=AVR32; TARGETDIR=avr32
33         SOURCES="ffi.c sysv.S"
34         ;;
35
36   bfin*)
37         TARGET=BFIN; TARGETDIR=bfin
38         SOURCES="ffi.c sysv.S"
39         ;;
40
41   cris-*-*)
42         TARGET=LIBFFI_CRIS; TARGETDIR=cris
43         SOURCES="ffi.c sysv.S"
44         ;;
45
46   frv-*-*)
47         TARGET=FRV; TARGETDIR=frv
48         SOURCES="ffi.c eabi.S"
49         ;;
50
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         ;;
62
63   i?86-*-freebsd* | i?86-*-openbsd*)
64         TARGET=X86_FREEBSD; TARGETDIR=x86
65         ;;
66
67   i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix* \
68   | x86_64-*-cygwin* | x86_64-*-mingw* | x86_64-*-win* )
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         if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then
76           MSVC=1
77           if test $ac_cv_sizeof_size_t = 4; then
78             # libffi does not support microsoft tools for 32-bit windows
79             # hosts.  Try porting src/x86/sysv.S to intel assembly
80             # format.
81             UNSUPPORTED=1
82           fi
83         fi
84         # All mingw/cygwin/win32 builds require -no-undefined for sharedlib.
85         # We must also check with_cross_host to decide if this is a native
86         # or cross-build and select where to install dlls appropriately.
87         if test -n "$with_cross_host" &&
88            test x"$with_cross_host" != x"no"; then
89           AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"';
90         else
91           AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
92         fi
93         ;;
94
95   i?86-*-darwin* | x86_64-*-darwin*)
96         TARGETDIR=x86
97         if test $ac_cv_sizeof_size_t = 4; then
98           TARGET=X86_DARWIN
99         else
100           TARGET=X86_64
101         fi
102         ;;
103
104   i?86-*-* | x86_64-*-* | amd64-*)
105         TARGETDIR=x86
106         if test $ac_cv_sizeof_size_t = 4; then
107           case "$host" in
108             x86_64-*x32|x86_64-x32-*)
109               TARGET=X86_64
110               ;;
111             *)
112               TARGET=X86
113               ;;
114           esac
115         else
116           TARGET=X86_64;
117         fi
118         ;;
119
120   ia64*-*-*)
121         TARGET=IA64; TARGETDIR=ia64
122         SOURCES="ffi.c unix.S"
123         ;;
124
125   m32r*-*-*)
126         TARGET=M32R; TARGETDIR=m32r
127         SOURCES="ffi.c sysv.S"
128         ;;
129
130   m68k-*-*)
131         TARGET=M68K; TARGETDIR=m68k
132         SOURCES="ffi.c sysv.S"
133         ;;
134
135   m88k-*-*)
136         TARGET=M88K; TARGETDIR=m88k
137         SOURCES="ffi.c obsd.S"
138         ;;
139
140   microblaze*-*-*)
141         TARGET=MICROBLAZE; TARGETDIR=microblaze
142         SOURCES="ffi.c sysv.S"
143         ;;
144
145   moxie-*-*)
146         TARGET=MOXIE; TARGETDIR=moxie
147         SOURCES="ffi.c eabi.S"
148         ;;
149
150   metag-*-*)
151         TARGET=METAG; TARGETDIR=metag
152         SOURCES="ffi.c sysv.S"
153         ;;
154
155   mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
156         TARGET=MIPS; TARGETDIR=mips
157         ;;
158   mips*-*linux* | mips*-*-openbsd*)
159         # Support 128-bit long double for NewABI.
160         HAVE_LONG_DOUBLE='defined(__mips64)'
161         TARGET=MIPS; TARGETDIR=mips
162         ;;
163
164   nios2*-linux*)
165         TARGET=NIOS2; TARGETDIR=nios2
166         SOURCES="ffi.c sysv.S"
167         ;;
168
169   or1k*-linux*)
170         TARGET=OR1K; TARGETDIR=or1k
171         SOURCES="ffi.c sysv.S"
172         ;;
173
174   powerpc*-*-linux* | powerpc-*-sysv*)
175         TARGET=POWERPC; TARGETDIR=powerpc
176         HAVE_LONG_DOUBLE_VARIANT=1
177         ;;
178   powerpc-*-amigaos*)
179         TARGET=POWERPC; TARGETDIR=powerpc
180         ;;
181   powerpc-*-beos*)
182         TARGET=POWERPC; TARGETDIR=powerpc
183         ;;
184   powerpc-*-darwin* | powerpc64-*-darwin*)
185         TARGET=POWERPC_DARWIN; TARGETDIR=powerpc
186         ;;
187   powerpc-*-aix* | rs6000-*-aix*)
188         TARGET=POWERPC_AIX; TARGETDIR=powerpc
189         ;;
190   powerpc-*-freebsd* | powerpc-*-openbsd* | powerpc-*-netbsd*)
191         TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
192         HAVE_LONG_DOUBLE_VARIANT=1
193         ;;
194   powerpc64-*-freebsd*)
195         TARGET=POWERPC; TARGETDIR=powerpc
196         ;;
197   powerpc*-*-rtems*)
198         TARGET=POWERPC; TARGETDIR=powerpc
199         ;;
200
201   s390-*-* | s390x-*-*)
202         TARGET=S390; TARGETDIR=s390
203         SOURCES="ffi.c sysv.S"
204         ;;
205
206   sh-*-* | sh[34]*-*-*)
207         TARGET=SH; TARGETDIR=sh
208         SOURCES="ffi.c sysv.S"
209         ;;
210   sh64-*-* | sh5*-*-*)
211         TARGET=SH64; TARGETDIR=sh64
212         SOURCES="ffi.c sysv.S"
213         ;;
214
215   sparc*-*-*)
216         TARGET=SPARC; TARGETDIR=sparc
217         SOURCES="ffi.c ffi64.c v8.S v9.S"
218         ;;
219
220   tile*-*)
221         TARGET=TILE; TARGETDIR=tile
222         SOURCES="ffi.c tile.S"
223         ;;
224
225   vax-*-*)
226         TARGET=VAX; TARGETDIR=vax
227         SOURCES="ffi.c elfbsd.S"
228         ;;
229
230   xtensa*-*)
231         TARGET=XTENSA; TARGETDIR=xtensa
232         SOURCES="ffi.c sysv.S"
233         ;;
234 esac
235
236 # ... but some of the cases above share configury.
237 case "${TARGET}" in
238   MIPS)
239         SOURCES="ffi.c o32.S n32.S"
240         ;;
241   POWERPC)
242         SOURCES="ffi.c ffi_sysv.c ffi_linux64.c sysv.S ppc_closure.S"
243         SOURCES="${SOURCES} linux64.S linux64_closure.S"
244         ;;
245   POWERPC_AIX)
246         SOURCES="ffi_darwin.c aix.S aix_closure.S"
247         ;;
248   POWERPC_DARWIN)
249         SOURCES="ffi_darwin.c darwin.S darwin_closure.S"
250         ;;
251   POWERPC_FREEBSD)
252         SOURCES="ffi.c ffi_sysv.c sysv.S ppc_closure.S"
253         ;;
254   X86 | X86_DARWIN | X86_FREEBSD | X86_WIN32)
255         SOURCES="ffi.c sysv.S"
256         ;;
257   X86_64)
258         SOURCES="ffi64.c unix64.S ffiw64.c win64.S"
259         ;;
260   X86_WIN64)
261         if test "$MSVC" = 1; then
262                 SOURCES="ffiw64.c win64_intel.S"
263         else
264                 SOURCES="ffiw64.c win64.S"
265         fi
266         ;;
267 esac
268
269 # If we failed to configure SOURCES, we can't do anything.
270 if test -z "${SOURCES}"; then
271   UNSUPPORTED=1
272 fi