annotate libffi/configure.ac @ 144:8f4e72ab4e11

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