1 dnl Process this with autoconf to create configure
2 AC_INIT(fficonfig.h.in)
3 AM_CONFIG_HEADER(fficonfig.h)
5 AC_MSG_WARN(***********************************************************)
6 AC_MSG_WARN(***********************************************************)
7 AC_MSG_WARN(This is beta code. If you're looking for a stable release)
8 AC_MSG_WARN(then use the most recent one - libffi-1.20.)
9 AC_MSG_WARN(***********************************************************)
10 AC_MSG_WARN(***********************************************************)
12 dnl Default to --enable-multilib
13 AC_ARG_ENABLE(multilib,
14 [ --enable-multilib build many library versions (default)],
15 [case "${enableval}" in
18 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
19 esac], [multilib=yes])dnl
21 dnl We may get other options which we don't document:
22 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
24 if test "${srcdir}" = "."; then
25 if test "${with_target_subdir}" != "."; then
26 libffi_basedir="${srcdir}/${with_multisrctop}.."
28 libffi_basedir="${srcdir}/${with_multisrctop}"
31 libffi_basedir="${srcdir}"
33 AC_SUBST(libffi_basedir)
37 AM_INIT_AUTOMAKE(libffi,2.00-beta,no-define)
47 mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;;
48 i*86-*-linux*) TARGET=X86; TARGETDIR=x86;;
49 i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;;
50 i*86-*-beos*) TARGET=X86; TARGETDIR=x86;;
51 sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;;
52 sparc-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
53 sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
54 sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
55 alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; TARGETDIR=alpha;;
56 ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;;
57 m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;;
58 powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;;
59 powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;;
60 arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;;
63 if test $TARGETDIR = unknown; then
64 AC_ERROR("libffi has not been ported to $host.")
67 AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
68 AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
69 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
70 AM_CONDITIONAL(X86, test x$TARGET = xX86)
71 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
72 AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
73 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
74 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
75 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
78 AC_CHECK_FUNCS(memcpy)
81 dnl AC_CHECK_SIZEOF(char)
82 AC_CHECK_SIZEOF(short)
85 AC_CHECK_SIZEOF(long long)
86 AC_CHECK_SIZEOF(float)
87 AC_CHECK_SIZEOF(double)
88 AC_CHECK_SIZEOF(long double)
90 AC_CHECK_SIZEOF(void *)
98 AC_ARG_ENABLE(debug,[ --enable-debug debugging mode], AC_DEFINE(FFI_DEBUG))
100 AC_ARG_ENABLE(debug,[ --disable-structs omit code for struct support], AC_DEFINE(FFI_NO_STRUCTS))
102 AC_ARG_ENABLE(debug,[ --disable-raw-api make the raw api unavailable], AC_DEFINE(FFI_NO_RAW_API))
104 AC_ARG_ENABLE(purify-safety,
105 [ --enable-purify-safety purify-safe mode], AC_DEFINE(USING_PURIFY))
107 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
109 if test "${multilib}" = "yes"; then
110 multilib_arg="--enable-multilib"
115 AC_OUTPUT(include/Makefile include/ffi.h Makefile,
117 if test -n "$CONFIG_FILES"; then
118 ac_file=Makefile . ${libffi_basedir}/../config-ml.in
124 with_multisubdir=${with_multisubdir}
125 ac_configure_args="${multilib_arg} ${ac_configure_args}"
126 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
127 libffi_basedir=${libffi_basedir}
130 test ! -d include && mkdir include
131 test ! -f include/fficonfig.h && cp fficonfig.h include/fficonfig.h
132 if cmp -s fficonfig.h include/fficonfig.h 2>/dev/null; then
133 echo fficonfig.h unchanged
135 echo Moving fficonfig.h to include/fficonfig.h
136 cp fficonfig.h include/fficonfig.h