1 dnl Process this with autoconf to create configure
2 AC_INIT(fficonfig.h.in)
3 AM_CONFIG_HEADER(fficonfig.h)
5 dnl Default to --enable-multilib
6 AC_ARG_ENABLE(multilib,
7 [ --enable-multilib build many library versions (default)],
8 [case "${enableval}" in
11 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
12 esac], [multilib=yes])dnl
14 dnl We may get other options which we don't document:
15 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
17 if test "${srcdir}" = "."; then
18 if test "${with_target_subdir}" != "."; then
19 libffi_basedir="${srcdir}/${with_multisrctop}.."
21 libffi_basedir="${srcdir}/${with_multisrctop}"
24 libffi_basedir="${srcdir}"
26 AC_SUBST(libffi_basedir)
32 AM_INIT_AUTOMAKE(libffi,2.00-beta,no-define)
42 mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;;
43 i*86-*-linux*) TARGET=X86; TARGETDIR=x86;;
44 i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;;
45 i*86-*-beos*) TARGET=X86; TARGETDIR=x86;;
46 i*86-*-freebsd*) TARGET=X86; TARGETDIR=x86;;
47 i*86-*-win32*) TARGET=X86_WIN32; TARGETDIR=x86;;
48 i*86-*-cygwin*) TARGET=X86_WIN32; TARGETDIR=x86;;
49 i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;;
50 sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;;
51 sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
52 sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
53 sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
54 alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; TARGETDIR=alpha;;
55 ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;;
56 m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;;
57 powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;;
58 powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;;
59 arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;;
62 if test $TARGETDIR = unknown; then
63 AC_ERROR("libffi has not been ported to $host.")
66 AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
67 AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
68 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
69 AM_CONDITIONAL(X86, test x$TARGET = xX86)
70 AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32)
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 *)
99 [ --enable-debug debugging mode],
100 if test "$enable_debug" = "yes"; then
104 AC_ARG_ENABLE(structs,
105 [ --disable-structs omit code for struct support],
106 if test "$enable_structs" = "no"; then
107 AC_DEFINE(FFI_NO_STRUCTS)
110 AC_ARG_ENABLE(raw-api,
111 [ --disable-raw-api make the raw api unavailable],
112 if test "$enable_raw_api" = "no"; then
113 AC_DEFINE(FFI_NO_RAW_API)
116 AC_ARG_ENABLE(purify-safety,
117 [ --enable-purify-safety purify-safe mode],
118 if test "$enable_purify_safety" = "yes"; then
119 AC_DEFINE(USING_PURIFY)
122 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
124 if test "${multilib}" = "yes"; then
125 multilib_arg="--enable-multilib"
130 AC_OUTPUT(include/Makefile include/ffi.h Makefile,
132 if test -n "$CONFIG_FILES"; then
133 ac_file=Makefile . ${libffi_basedir}/../config-ml.in
139 with_multisubdir=${with_multisubdir}
140 ac_configure_args="${multilib_arg} ${ac_configure_args}"
141 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
142 libffi_basedir=${libffi_basedir}
145 test ! -d include && mkdir include
146 test ! -f include/fficonfig.h && cp fficonfig.h include/fficonfig.h
147 if cmp -s fficonfig.h include/fficonfig.h 2>/dev/null; then
148 echo fficonfig.h unchanged
150 echo Moving fficonfig.h to include/fficonfig.h
151 cp fficonfig.h include/fficonfig.h
155 # Make target subdirectories if required.
156 test -d src || mkdir src
157 test -d src/${TARGETDIR} || mkdir src/${TARGETDIR}