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)
39 AM_INIT_AUTOMAKE(libffi,2.00-beta,no-define)
49 mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;;
50 i*86-*-linux*) TARGET=X86; TARGETDIR=x86;;
51 i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;;
52 i*86-*-beos*) TARGET=X86; TARGETDIR=x86;;
53 i*86-*-freebsd*) TARGET=X86; TARGETDIR=x86;;
54 i*86-*-win32*) TARGET=X86_WIN32; TARGETDIR=x86;;
55 i*86-*-cygwin*) TARGET=X86_WIN32; TARGETDIR=x86;;
56 i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;;
57 sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;;
58 sparc-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
59 sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
60 sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
61 alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; TARGETDIR=alpha;;
62 ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;;
63 m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;;
64 powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;;
65 powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;;
66 arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;;
69 if test $TARGETDIR = unknown; then
70 AC_ERROR("libffi has not been ported to $host.")
73 AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
74 AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
75 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
76 AM_CONDITIONAL(X86, test x$TARGET = xX86)
77 AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32)
78 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
79 AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
80 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
81 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
82 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
85 AC_CHECK_FUNCS(memcpy)
88 dnl AC_CHECK_SIZEOF(char)
89 AC_CHECK_SIZEOF(short)
92 AC_CHECK_SIZEOF(long long)
93 AC_CHECK_SIZEOF(float)
94 AC_CHECK_SIZEOF(double)
95 AC_CHECK_SIZEOF(long double)
97 AC_CHECK_SIZEOF(void *)
105 AC_ARG_ENABLE(debug,[ --enable-debug debugging mode], AC_DEFINE(FFI_DEBUG))
107 AC_ARG_ENABLE(debug,[ --disable-structs omit code for struct support], AC_DEFINE(FFI_NO_STRUCTS))
109 AC_ARG_ENABLE(debug,[ --disable-raw-api make the raw api unavailable], AC_DEFINE(FFI_NO_RAW_API))
111 AC_ARG_ENABLE(purify-safety,
112 [ --enable-purify-safety purify-safe mode], AC_DEFINE(USING_PURIFY))
114 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
116 if test "${multilib}" = "yes"; then
117 multilib_arg="--enable-multilib"
122 AC_OUTPUT(include/Makefile include/ffi.h Makefile,
124 if test -n "$CONFIG_FILES"; then
125 ac_file=Makefile . ${libffi_basedir}/../config-ml.in
131 with_multisubdir=${with_multisubdir}
132 ac_configure_args="${multilib_arg} ${ac_configure_args}"
133 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
134 libffi_basedir=${libffi_basedir}
137 test ! -d include && mkdir include
138 test ! -f include/fficonfig.h && cp fficonfig.h include/fficonfig.h
139 if cmp -s fficonfig.h include/fficonfig.h 2>/dev/null; then
140 echo fficonfig.h unchanged
142 echo Moving fficonfig.h to include/fficonfig.h
143 cp fficonfig.h include/fficonfig.h
147 # Make target subdirectories if required.
148 test -d src || mkdir src
149 test -d src/${TARGETDIR} || mkdir src/${TARGETDIR}