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 powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;;
60 powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
61 rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
62 arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;;
65 if test $TARGETDIR = unknown; then
66 AC_ERROR("libffi has not been ported to $host.")
69 AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
70 AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
71 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
72 AM_CONDITIONAL(X86, test x$TARGET = xX86)
73 AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32)
74 AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
75 AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
76 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
77 AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
78 AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX)
79 AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN)
80 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
83 AC_CHECK_FUNCS(memcpy)
86 dnl AC_CHECK_SIZEOF(char)
87 AC_COMPILE_CHECK_SIZEOF(short)
88 AC_COMPILE_CHECK_SIZEOF(int)
89 AC_COMPILE_CHECK_SIZEOF(long)
90 AC_COMPILE_CHECK_SIZEOF(long long)
91 AC_COMPILE_CHECK_SIZEOF(float)
92 AC_COMPILE_CHECK_SIZEOF(double)
93 AC_COMPILE_CHECK_SIZEOF(long double)
95 AC_COMPILE_CHECK_SIZEOF(void *)
104 [ --enable-debug debugging mode],
105 if test "$enable_debug" = "yes"; then
109 AC_ARG_ENABLE(structs,
110 [ --disable-structs omit code for struct support],
111 if test "$enable_structs" = "no"; then
112 AC_DEFINE(FFI_NO_STRUCTS)
115 AC_ARG_ENABLE(raw-api,
116 [ --disable-raw-api make the raw api unavailable],
117 if test "$enable_raw_api" = "no"; then
118 AC_DEFINE(FFI_NO_RAW_API)
121 AC_ARG_ENABLE(purify-safety,
122 [ --enable-purify-safety purify-safe mode],
123 if test "$enable_purify_safety" = "yes"; then
124 AC_DEFINE(USING_PURIFY)
127 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
129 if test "${multilib}" = "yes"; then
130 multilib_arg="--enable-multilib"
135 AC_OUTPUT(include/Makefile include/ffi.h Makefile,
137 if test -n "$CONFIG_FILES"; then
138 ac_file=Makefile . ${libffi_basedir}/../config-ml.in
144 with_multisubdir=${with_multisubdir}
145 ac_configure_args="${multilib_arg} ${ac_configure_args}"
146 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
147 libffi_basedir=${libffi_basedir}
150 test ! -d include && mkdir include
151 test ! -f include/fficonfig.h && cp fficonfig.h include/fficonfig.h
152 if cmp -s fficonfig.h include/fficonfig.h 2>/dev/null; then
153 echo fficonfig.h unchanged
155 echo Moving fficonfig.h to include/fficonfig.h
156 cp fficonfig.h include/fficonfig.h
160 # Make target subdirectories if required.
161 test -d src || mkdir src
162 test -d src/${TARGETDIR} || mkdir src/${TARGETDIR}