annotate libffi/configure.ac @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 dnl Process this with autoconf to create configure
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 AC_INIT([libffi], [3.99999], [http://github.com/atgreen/libffi/issues])
kono
parents:
diff changeset
5 AC_CONFIG_HEADERS([fficonfig.h])
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 AM_ENABLE_MULTILIB(, ..)
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 AC_CANONICAL_SYSTEM
kono
parents:
diff changeset
10 target_alias=${target_alias-$host_alias}
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 AM_INIT_AUTOMAKE([no-dist])
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 # See if makeinfo has been installed and is modern enough
kono
parents:
diff changeset
15 # that we can use it.
kono
parents:
diff changeset
16 ACX_CHECK_PROG_VER([MAKEINFO], [makeinfo], [--version],
kono
parents:
diff changeset
17 [GNU texinfo.* \([0-9][0-9.]*\)],
kono
parents:
diff changeset
18 [4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*])
kono
parents:
diff changeset
19 AM_CONDITIONAL(BUILD_INFO, test $gcc_cv_prog_makeinfo_modern = "yes")
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 # We would like our source tree to be readonly. However when releases or
kono
parents:
diff changeset
22 # pre-releases are generated, the flex/bison generated files as well as the
kono
parents:
diff changeset
23 # various formats of manuals need to be included along with the rest of the
kono
parents:
diff changeset
24 # sources. Therefore we have --enable-generated-files-in-srcdir to do
kono
parents:
diff changeset
25 # just that.
kono
parents:
diff changeset
26 AC_MSG_CHECKING(generated-files-in-srcdir)
kono
parents:
diff changeset
27 AC_ARG_ENABLE(generated-files-in-srcdir,
kono
parents:
diff changeset
28 AS_HELP_STRING([--enable-generated-files-in-srcdir],
kono
parents:
diff changeset
29 [put copies of generated files in source dir intended for creating source tarballs for users without texinfo bison or flex]),
kono
parents:
diff changeset
30 [case "$enableval" in
kono
parents:
diff changeset
31 yes) enable_generated_files_in_srcdir=yes ;;
kono
parents:
diff changeset
32 no) enable_generated_files_in_srcdir=no ;;
kono
parents:
diff changeset
33 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
kono
parents:
diff changeset
34 esac],
kono
parents:
diff changeset
35 [enable_generated_files_in_srcdir=no])
kono
parents:
diff changeset
36 AC_MSG_RESULT($enable_generated_files_in_srcdir)
kono
parents:
diff changeset
37 AM_CONDITIONAL(GENINSRC, test "$enable_generated_files_in_srcdir" = yes)
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 # The same as in boehm-gc and libstdc++. Have to borrow it from there.
kono
parents:
diff changeset
40 # We must force CC to /not/ be precious variables; otherwise
kono
parents:
diff changeset
41 # the wrong, non-multilib-adjusted value will be used in multilibs.
kono
parents:
diff changeset
42 # As a side effect, we have to subst CFLAGS ourselves.
kono
parents:
diff changeset
43 # Also save and restore CFLAGS, since AC_PROG_CC will come up with
kono
parents:
diff changeset
44 # defaults of its own if none are provided.
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
kono
parents:
diff changeset
47 m4_define([_AC_ARG_VAR_PRECIOUS],[])
kono
parents:
diff changeset
48 save_CFLAGS=$CFLAGS
kono
parents:
diff changeset
49 AC_PROG_CC
kono
parents:
diff changeset
50 AC_PROG_CXX
kono
parents:
diff changeset
51 CFLAGS=$save_CFLAGS
kono
parents:
diff changeset
52 m4_undefine([_AC_ARG_VAR_PRECIOUS])
kono
parents:
diff changeset
53 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 AC_SUBST(CFLAGS)
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 AM_PROG_AS
kono
parents:
diff changeset
58 AM_PROG_CC_C_O
kono
parents:
diff changeset
59 AC_PROG_LIBTOOL
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 # Test for 64-bit build.
kono
parents:
diff changeset
62 AC_CHECK_SIZEOF([size_t])
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 AM_MAINTAINER_MODE
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 AC_CHECK_HEADERS(sys/mman.h)
kono
parents:
diff changeset
67 AC_CHECK_FUNCS([mmap mkostemp])
kono
parents:
diff changeset
68 AC_FUNC_MMAP_BLACKLIST
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 dnl The -no-testsuite modules omit the test subdir.
kono
parents:
diff changeset
71 AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 TARGETDIR="unknown"
kono
parents:
diff changeset
74 HAVE_LONG_DOUBLE_VARIANT=0
kono
parents:
diff changeset
75
kono
parents:
diff changeset
76 . ${srcdir}/configure.host
kono
parents:
diff changeset
77
kono
parents:
diff changeset
78 if test -n "${UNSUPPORTED}"; then
kono
parents:
diff changeset
79 AC_MSG_ERROR(["libffi has not been ported to $host."])
kono
parents:
diff changeset
80 fi
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 AC_SUBST(AM_RUNTESTFLAGS)
kono
parents:
diff changeset
83 AC_SUBST(AM_LTLDFLAGS)
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 AC_HEADER_STDC
kono
parents:
diff changeset
86 AC_CHECK_FUNCS(memcpy)
kono
parents:
diff changeset
87 AC_FUNC_ALLOCA
kono
parents:
diff changeset
88
kono
parents:
diff changeset
89 AC_CHECK_SIZEOF(double)
kono
parents:
diff changeset
90 AC_CHECK_SIZEOF(long double)
kono
parents:
diff changeset
91
kono
parents:
diff changeset
92 # Also AC_SUBST this variable for ffi.h.
kono
parents:
diff changeset
93 if test -z "$HAVE_LONG_DOUBLE"; then
kono
parents:
diff changeset
94 HAVE_LONG_DOUBLE=0
kono
parents:
diff changeset
95 if test $ac_cv_sizeof_long_double != 0; then
kono
parents:
diff changeset
96 if test $HAVE_LONG_DOUBLE_VARIANT != 0; then
kono
parents:
diff changeset
97 AC_DEFINE(HAVE_LONG_DOUBLE_VARIANT, 1, [Define if you support more than one size of the long double type])
kono
parents:
diff changeset
98 HAVE_LONG_DOUBLE=1
kono
parents:
diff changeset
99 else
kono
parents:
diff changeset
100 if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then
kono
parents:
diff changeset
101 HAVE_LONG_DOUBLE=1
kono
parents:
diff changeset
102 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the long double type and it is bigger than a double])
kono
parents:
diff changeset
103 fi
kono
parents:
diff changeset
104 fi
kono
parents:
diff changeset
105 fi
kono
parents:
diff changeset
106 fi
kono
parents:
diff changeset
107 AC_SUBST(HAVE_LONG_DOUBLE)
kono
parents:
diff changeset
108 AC_SUBST(HAVE_LONG_DOUBLE_VARIANT)
kono
parents:
diff changeset
109
kono
parents:
diff changeset
110 AC_C_BIGENDIAN
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 GCC_AS_CFI_PSEUDO_OP
kono
parents:
diff changeset
113
kono
parents:
diff changeset
114 case "$TARGET" in
kono
parents:
diff changeset
115 SPARC)
kono
parents:
diff changeset
116 AC_CACHE_CHECK([assembler and linker support unaligned pc related relocs],
kono
parents:
diff changeset
117 libffi_cv_as_sparc_ua_pcrel, [
kono
parents:
diff changeset
118 save_CFLAGS="$CFLAGS"
kono
parents:
diff changeset
119 save_LDFLAGS="$LDFLAGS"
kono
parents:
diff changeset
120 CFLAGS="$CFLAGS -fpic"
kono
parents:
diff changeset
121 LDFLAGS="$LDFLAGS -shared"
kono
parents:
diff changeset
122 AC_TRY_LINK([asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text");],,
kono
parents:
diff changeset
123 [libffi_cv_as_sparc_ua_pcrel=yes],
kono
parents:
diff changeset
124 [libffi_cv_as_sparc_ua_pcrel=no])
kono
parents:
diff changeset
125 CFLAGS="$save_CFLAGS"
kono
parents:
diff changeset
126 LDFLAGS="$save_LDFLAGS"])
kono
parents:
diff changeset
127 if test "x$libffi_cv_as_sparc_ua_pcrel" = xyes; then
kono
parents:
diff changeset
128 AC_DEFINE(HAVE_AS_SPARC_UA_PCREL, 1,
kono
parents:
diff changeset
129 [Define if your assembler and linker support unaligned PC relative relocs.])
kono
parents:
diff changeset
130 fi
kono
parents:
diff changeset
131
kono
parents:
diff changeset
132 AC_CACHE_CHECK([assembler .register pseudo-op support],
kono
parents:
diff changeset
133 libffi_cv_as_register_pseudo_op, [
kono
parents:
diff changeset
134 libffi_cv_as_register_pseudo_op=unknown
kono
parents:
diff changeset
135 # Check if we have .register
kono
parents:
diff changeset
136 AC_TRY_COMPILE(,[asm (".register %g2, #scratch");],
kono
parents:
diff changeset
137 [libffi_cv_as_register_pseudo_op=yes],
kono
parents:
diff changeset
138 [libffi_cv_as_register_pseudo_op=no])
kono
parents:
diff changeset
139 ])
kono
parents:
diff changeset
140 if test "x$libffi_cv_as_register_pseudo_op" = xyes; then
kono
parents:
diff changeset
141 AC_DEFINE(HAVE_AS_REGISTER_PSEUDO_OP, 1,
kono
parents:
diff changeset
142 [Define if your assembler supports .register.])
kono
parents:
diff changeset
143 fi
kono
parents:
diff changeset
144 ;;
kono
parents:
diff changeset
145
kono
parents:
diff changeset
146 X86*)
kono
parents:
diff changeset
147 AC_CACHE_CHECK([assembler supports pc related relocs],
kono
parents:
diff changeset
148 libffi_cv_as_x86_pcrel, [
kono
parents:
diff changeset
149 libffi_cv_as_x86_pcrel=no
kono
parents:
diff changeset
150 echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
kono
parents:
diff changeset
151 if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
kono
parents:
diff changeset
152 libffi_cv_as_x86_pcrel=yes
kono
parents:
diff changeset
153 fi
kono
parents:
diff changeset
154 ])
kono
parents:
diff changeset
155 if test "x$libffi_cv_as_x86_pcrel" = xyes; then
kono
parents:
diff changeset
156 AC_DEFINE(HAVE_AS_X86_PCREL, 1,
kono
parents:
diff changeset
157 [Define if your assembler supports PC relative relocs.])
kono
parents:
diff changeset
158 fi
kono
parents:
diff changeset
159 ;;
kono
parents:
diff changeset
160
kono
parents:
diff changeset
161 S390)
kono
parents:
diff changeset
162 AC_CACHE_CHECK([compiler uses zarch features],
kono
parents:
diff changeset
163 libffi_cv_as_s390_zarch, [
kono
parents:
diff changeset
164 libffi_cv_as_s390_zarch=no
kono
parents:
diff changeset
165 echo 'void foo(void) { bar(); bar(); }' > conftest.c
kono
parents:
diff changeset
166 if $CC $CFLAGS -S conftest.c > /dev/null 2>&1; then
kono
parents:
diff changeset
167 if grep -q brasl conftest.s; then
kono
parents:
diff changeset
168 libffi_cv_as_s390_zarch=yes
kono
parents:
diff changeset
169 fi
kono
parents:
diff changeset
170 fi
kono
parents:
diff changeset
171 ])
kono
parents:
diff changeset
172 if test "x$libffi_cv_as_s390_zarch" = xyes; then
kono
parents:
diff changeset
173 AC_DEFINE(HAVE_AS_S390_ZARCH, 1,
kono
parents:
diff changeset
174 [Define if the compiler uses zarch features.])
kono
parents:
diff changeset
175 fi
kono
parents:
diff changeset
176 ;;
kono
parents:
diff changeset
177 esac
kono
parents:
diff changeset
178
kono
parents:
diff changeset
179 # On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC.
kono
parents:
diff changeset
180 AC_ARG_ENABLE(pax_emutramp,
kono
parents:
diff changeset
181 [ --enable-pax_emutramp enable pax emulated trampolines, for we can't use PROT_EXEC],
kono
parents:
diff changeset
182 if test "$enable_pax_emutramp" = "yes"; then
kono
parents:
diff changeset
183 AC_DEFINE(FFI_MMAP_EXEC_EMUTRAMP_PAX, 1,
kono
parents:
diff changeset
184 [Define this if you want to enable pax emulated trampolines])
kono
parents:
diff changeset
185 fi)
kono
parents:
diff changeset
186
kono
parents:
diff changeset
187 FFI_EXEC_TRAMPOLINE_TABLE=0
kono
parents:
diff changeset
188 case "$target" in
kono
parents:
diff changeset
189 *arm*-apple-darwin* | aarch64-apple-darwin*)
kono
parents:
diff changeset
190 FFI_EXEC_TRAMPOLINE_TABLE=1
kono
parents:
diff changeset
191 AC_DEFINE(FFI_EXEC_TRAMPOLINE_TABLE, 1,
kono
parents:
diff changeset
192 [Cannot use PROT_EXEC on this target, so, we revert to
kono
parents:
diff changeset
193 alternative means])
kono
parents:
diff changeset
194 ;;
kono
parents:
diff changeset
195 *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*)
kono
parents:
diff changeset
196 AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1,
kono
parents:
diff changeset
197 [Cannot use malloc on this target, so, we revert to
kono
parents:
diff changeset
198 alternative means])
kono
parents:
diff changeset
199 ;;
kono
parents:
diff changeset
200 esac
kono
parents:
diff changeset
201 AM_CONDITIONAL(FFI_EXEC_TRAMPOLINE_TABLE, test x$FFI_EXEC_TRAMPOLINE_TABLE = x1)
kono
parents:
diff changeset
202 AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE)
kono
parents:
diff changeset
203
kono
parents:
diff changeset
204 if test x$TARGET = xX86_64; then
kono
parents:
diff changeset
205 AC_CACHE_CHECK([toolchain supports unwind section type],
kono
parents:
diff changeset
206 libffi_cv_as_x86_64_unwind_section_type, [
kono
parents:
diff changeset
207 cat > conftest1.s << EOF
kono
parents:
diff changeset
208 .text
kono
parents:
diff changeset
209 .globl foo
kono
parents:
diff changeset
210 foo:
kono
parents:
diff changeset
211 jmp bar
kono
parents:
diff changeset
212 .section .eh_frame,"a",@unwind
kono
parents:
diff changeset
213 bar:
kono
parents:
diff changeset
214 EOF
kono
parents:
diff changeset
215
kono
parents:
diff changeset
216 cat > conftest2.c << EOF
kono
parents:
diff changeset
217 extern void foo();
kono
parents:
diff changeset
218 int main(){foo();}
kono
parents:
diff changeset
219 EOF
kono
parents:
diff changeset
220
kono
parents:
diff changeset
221 libffi_cv_as_x86_64_unwind_section_type=no
kono
parents:
diff changeset
222 # we ensure that we can compile _and_ link an assembly file containing an @unwind section
kono
parents:
diff changeset
223 # since the compiler can support it and not the linker (ie old binutils)
kono
parents:
diff changeset
224 if $CC -Wa,--fatal-warnings $CFLAGS -c conftest1.s > /dev/null 2>&1 && \
kono
parents:
diff changeset
225 $CC conftest2.c conftest1.o > /dev/null 2>&1 ; then
kono
parents:
diff changeset
226 libffi_cv_as_x86_64_unwind_section_type=yes
kono
parents:
diff changeset
227 fi
kono
parents:
diff changeset
228 ])
kono
parents:
diff changeset
229 if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then
kono
parents:
diff changeset
230 AC_DEFINE(HAVE_AS_X86_64_UNWIND_SECTION_TYPE, 1,
kono
parents:
diff changeset
231 [Define if your assembler supports unwind section type.])
kono
parents:
diff changeset
232 fi
kono
parents:
diff changeset
233 fi
kono
parents:
diff changeset
234
kono
parents:
diff changeset
235 if test "x$GCC" = "xyes"; then
kono
parents:
diff changeset
236 AC_CACHE_CHECK([whether .eh_frame section should be read-only],
kono
parents:
diff changeset
237 libffi_cv_ro_eh_frame, [
kono
parents:
diff changeset
238 libffi_cv_ro_eh_frame=no
kono
parents:
diff changeset
239 echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
kono
parents:
diff changeset
240 if $CC $CFLAGS -c -fpic -fexceptions -o conftest.o conftest.c > /dev/null 2>&1; then
kono
parents:
diff changeset
241 objdump -h conftest.o > conftest.dump 2>&1
kono
parents:
diff changeset
242 libffi_eh_frame_line=`grep -n eh_frame conftest.dump | cut -d: -f 1`
kono
parents:
diff changeset
243 if test "x$libffi_eh_frame_line" != "x"; then
kono
parents:
diff changeset
244 libffi_test_line=`expr $libffi_eh_frame_line + 1`p
kono
parents:
diff changeset
245 sed -n $libffi_test_line conftest.dump > conftest.line
kono
parents:
diff changeset
246 if grep READONLY conftest.line > /dev/null; then
kono
parents:
diff changeset
247 libffi_cv_ro_eh_frame=yes
kono
parents:
diff changeset
248 fi
kono
parents:
diff changeset
249 fi
kono
parents:
diff changeset
250 fi
kono
parents:
diff changeset
251 rm -f conftest.*
kono
parents:
diff changeset
252 ])
kono
parents:
diff changeset
253 if test "x$libffi_cv_ro_eh_frame" = xyes; then
kono
parents:
diff changeset
254 AC_DEFINE(HAVE_RO_EH_FRAME, 1,
kono
parents:
diff changeset
255 [Define if .eh_frame sections should be read-only.])
kono
parents:
diff changeset
256 AC_DEFINE(EH_FRAME_FLAGS, "a",
kono
parents:
diff changeset
257 [Define to the flags needed for the .section .eh_frame directive. ])
kono
parents:
diff changeset
258 else
kono
parents:
diff changeset
259 AC_DEFINE(EH_FRAME_FLAGS, "aw",
kono
parents:
diff changeset
260 [Define to the flags needed for the .section .eh_frame directive. ])
kono
parents:
diff changeset
261 fi
kono
parents:
diff changeset
262
kono
parents:
diff changeset
263 AC_CACHE_CHECK([for __attribute__((visibility("hidden")))],
kono
parents:
diff changeset
264 libffi_cv_hidden_visibility_attribute, [
kono
parents:
diff changeset
265 echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1 ; }' > conftest.c
kono
parents:
diff changeset
266 libffi_cv_hidden_visibility_attribute=no
kono
parents:
diff changeset
267 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
kono
parents:
diff changeset
268 if grep '\.hidden.*foo' conftest.s >/dev/null; then
kono
parents:
diff changeset
269 libffi_cv_hidden_visibility_attribute=yes
kono
parents:
diff changeset
270 fi
kono
parents:
diff changeset
271 fi
kono
parents:
diff changeset
272 rm -f conftest.*
kono
parents:
diff changeset
273 ])
kono
parents:
diff changeset
274 if test $libffi_cv_hidden_visibility_attribute = yes; then
kono
parents:
diff changeset
275 AC_DEFINE(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE, 1,
kono
parents:
diff changeset
276 [Define if __attribute__((visibility("hidden"))) is supported.])
kono
parents:
diff changeset
277 fi
kono
parents:
diff changeset
278 fi
kono
parents:
diff changeset
279
kono
parents:
diff changeset
280 AH_BOTTOM([
kono
parents:
diff changeset
281 #ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
kono
parents:
diff changeset
282 #ifdef LIBFFI_ASM
kono
parents:
diff changeset
283 #define FFI_HIDDEN(name) .hidden name
kono
parents:
diff changeset
284 #else
kono
parents:
diff changeset
285 #define FFI_HIDDEN __attribute__ ((visibility ("hidden")))
kono
parents:
diff changeset
286 #endif
kono
parents:
diff changeset
287 #else
kono
parents:
diff changeset
288 #ifdef LIBFFI_ASM
kono
parents:
diff changeset
289 #define FFI_HIDDEN(name)
kono
parents:
diff changeset
290 #else
kono
parents:
diff changeset
291 #define FFI_HIDDEN
kono
parents:
diff changeset
292 #endif
kono
parents:
diff changeset
293 #endif
kono
parents:
diff changeset
294 ])
kono
parents:
diff changeset
295
kono
parents:
diff changeset
296 AC_SUBST(TARGET)
kono
parents:
diff changeset
297 AC_SUBST(TARGETDIR)
kono
parents:
diff changeset
298
kono
parents:
diff changeset
299 changequote(<,>)
kono
parents:
diff changeset
300 TARGET_OBJ=
kono
parents:
diff changeset
301 for i in $SOURCES; do
kono
parents:
diff changeset
302 TARGET_OBJ="${TARGET_OBJ} src/${TARGETDIR}/"`echo $i | sed 's/[cS]$/lo/'`
kono
parents:
diff changeset
303 done
kono
parents:
diff changeset
304 changequote([,])
kono
parents:
diff changeset
305 AC_SUBST(TARGET_OBJ)
kono
parents:
diff changeset
306
kono
parents:
diff changeset
307 AC_SUBST(SHELL)
kono
parents:
diff changeset
308
kono
parents:
diff changeset
309 AC_ARG_ENABLE(debug,
kono
parents:
diff changeset
310 [ --enable-debug debugging mode],
kono
parents:
diff changeset
311 if test "$enable_debug" = "yes"; then
kono
parents:
diff changeset
312 AC_DEFINE(FFI_DEBUG, 1, [Define this if you want extra debugging.])
kono
parents:
diff changeset
313 fi)
kono
parents:
diff changeset
314 AM_CONDITIONAL(FFI_DEBUG, test "$enable_debug" = "yes")
kono
parents:
diff changeset
315
kono
parents:
diff changeset
316 AC_ARG_ENABLE(structs,
kono
parents:
diff changeset
317 [ --disable-structs omit code for struct support],
kono
parents:
diff changeset
318 if test "$enable_structs" = "no"; then
kono
parents:
diff changeset
319 AC_DEFINE(FFI_NO_STRUCTS, 1, [Define this if you do not want support for aggregate types.])
kono
parents:
diff changeset
320 fi)
kono
parents:
diff changeset
321 AM_CONDITIONAL(FFI_DEBUG, test "$enable_debug" = "yes")
kono
parents:
diff changeset
322
kono
parents:
diff changeset
323 AC_ARG_ENABLE(raw-api,
kono
parents:
diff changeset
324 [ --disable-raw-api make the raw api unavailable],
kono
parents:
diff changeset
325 if test "$enable_raw_api" = "no"; then
kono
parents:
diff changeset
326 AC_DEFINE(FFI_NO_RAW_API, 1, [Define this if you do not want support for the raw API.])
kono
parents:
diff changeset
327 fi)
kono
parents:
diff changeset
328
kono
parents:
diff changeset
329 AC_ARG_ENABLE(purify-safety,
kono
parents:
diff changeset
330 [ --enable-purify-safety purify-safe mode],
kono
parents:
diff changeset
331 if test "$enable_purify_safety" = "yes"; then
kono
parents:
diff changeset
332 AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.])
kono
parents:
diff changeset
333 fi)
kono
parents:
diff changeset
334
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
335 GCC_WITH_TOOLEXECLIBDIR
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
336
111
kono
parents:
diff changeset
337 if test -n "$with_cross_host" &&
kono
parents:
diff changeset
338 test x"$with_cross_host" != x"no"; then
kono
parents:
diff changeset
339 toolexecdir='$(exec_prefix)/$(target_alias)'
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
340 case ${with_toolexeclibdir} in
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
341 no)
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
342 toolexeclibdir='$(toolexecdir)/lib'
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
343 ;;
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
344 *)
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
345 toolexeclibdir=${with_toolexeclibdir}
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
346 ;;
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
347 esac
111
kono
parents:
diff changeset
348 else
kono
parents:
diff changeset
349 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
kono
parents:
diff changeset
350 toolexeclibdir='$(libdir)'
kono
parents:
diff changeset
351 fi
kono
parents:
diff changeset
352 multi_os_directory=`$CC -print-multi-os-directory`
kono
parents:
diff changeset
353 case $multi_os_directory in
kono
parents:
diff changeset
354 .) ;; # Avoid trailing /.
kono
parents:
diff changeset
355 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
kono
parents:
diff changeset
356 esac
kono
parents:
diff changeset
357 AC_SUBST(toolexecdir)
kono
parents:
diff changeset
358 AC_SUBST(toolexeclibdir)
kono
parents:
diff changeset
359
kono
parents:
diff changeset
360 if test "${multilib}" = "yes"; then
kono
parents:
diff changeset
361 multilib_arg="--enable-multilib"
kono
parents:
diff changeset
362 else
kono
parents:
diff changeset
363 multilib_arg=
kono
parents:
diff changeset
364 fi
kono
parents:
diff changeset
365
kono
parents:
diff changeset
366 # Check linker support.
kono
parents:
diff changeset
367 LIBAT_ENABLE_SYMVERS
kono
parents:
diff changeset
368
kono
parents:
diff changeset
369 # Determine what GCC version number to use in filesystem paths.
kono
parents:
diff changeset
370 GCC_BASE_VER
kono
parents:
diff changeset
371
kono
parents:
diff changeset
372 AC_CONFIG_COMMANDS(include, [test -d include || mkdir include])
kono
parents:
diff changeset
373 AC_CONFIG_COMMANDS(src, [
kono
parents:
diff changeset
374 test -d src || mkdir src
kono
parents:
diff changeset
375 test -d src/$TARGETDIR || mkdir src/$TARGETDIR
kono
parents:
diff changeset
376 ], [TARGETDIR="$TARGETDIR"])
kono
parents:
diff changeset
377
kono
parents:
diff changeset
378 AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h)
kono
parents:
diff changeset
379
kono
parents:
diff changeset
380 AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc)
kono
parents:
diff changeset
381
kono
parents:
diff changeset
382 AC_OUTPUT