1999-08-08 21:27:18 +08:00
|
|
|
dnl Process this with autoconf to create configure
|
|
|
|
AC_INIT(fficonfig.h.in)
|
|
|
|
AM_CONFIG_HEADER(fficonfig.h)
|
|
|
|
|
2000-03-04 00:58:42 +08:00
|
|
|
dnl Default to --enable-multilib
|
|
|
|
AC_ARG_ENABLE(multilib,
|
|
|
|
[ --enable-multilib build many library versions (default)],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) multilib=yes ;;
|
|
|
|
no) multilib=no ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
|
|
|
|
esac], [multilib=yes])dnl
|
|
|
|
|
|
|
|
dnl We may get other options which we don't document:
|
|
|
|
dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
|
|
|
|
|
|
|
|
if test "${srcdir}" = "."; then
|
|
|
|
if test "${with_target_subdir}" != "."; then
|
|
|
|
libffi_basedir="${srcdir}/${with_multisrctop}.."
|
|
|
|
else
|
|
|
|
libffi_basedir="${srcdir}/${with_multisrctop}"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
libffi_basedir="${srcdir}"
|
|
|
|
fi
|
|
|
|
AC_SUBST(libffi_basedir)
|
|
|
|
|
1999-08-08 21:27:18 +08:00
|
|
|
AC_CANONICAL_HOST
|
|
|
|
|
2001-03-27 06:52:36 +08:00
|
|
|
AM_PROG_LIBTOOL
|
|
|
|
|
1999-09-02 07:16:34 +08:00
|
|
|
AM_INIT_AUTOMAKE(libffi,2.00-beta,no-define)
|
1999-08-08 21:27:18 +08:00
|
|
|
|
|
|
|
AC_EXEEXT
|
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
|
|
|
|
TARGETDIR="unknown"
|
|
|
|
case "$host" in
|
|
|
|
mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;;
|
2000-04-17 10:22:22 +08:00
|
|
|
i*86-*-linux*) TARGET=X86; TARGETDIR=x86;;
|
2000-04-05 02:22:01 +08:00
|
|
|
i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;;
|
1999-08-08 21:27:18 +08:00
|
|
|
i*86-*-beos*) TARGET=X86; TARGETDIR=x86;;
|
2000-08-24 09:01:57 +08:00
|
|
|
i*86-*-freebsd*) TARGET=X86; TARGETDIR=x86;;
|
2001-03-27 10:39:16 +08:00
|
|
|
i*86-*-win32*) TARGET=X86_WIN32; TARGETDIR=x86;;
|
|
|
|
i*86-*-cygwin*) TARGET=X86_WIN32; TARGETDIR=x86;;
|
|
|
|
i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;;
|
1999-08-08 21:27:18 +08:00
|
|
|
sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;;
|
2001-06-26 04:04:56 +08:00
|
|
|
sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
|
2000-04-17 10:15:32 +08:00
|
|
|
sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
|
|
|
|
sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
|
2002-03-22 06:14:56 +08:00
|
|
|
alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;;
|
2000-02-26 03:13:44 +08:00
|
|
|
ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;;
|
1999-08-08 21:27:18 +08:00
|
|
|
m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;;
|
|
|
|
powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;;
|
|
|
|
powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;;
|
2001-10-09 13:32:16 +08:00
|
|
|
powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;;
|
2002-01-18 00:04:21 +08:00
|
|
|
powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
|
|
|
|
rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
|
2000-05-04 22:33:15 +08:00
|
|
|
arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;;
|
1999-08-08 21:27:18 +08:00
|
|
|
esac
|
|
|
|
|
|
|
|
if test $TARGETDIR = unknown; then
|
|
|
|
AC_ERROR("libffi has not been ported to $host.")
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
|
|
|
|
AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
|
|
|
|
AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
|
|
|
|
AM_CONDITIONAL(X86, test x$TARGET = xX86)
|
2001-03-27 10:39:16 +08:00
|
|
|
AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32)
|
1999-08-08 21:27:18 +08:00
|
|
|
AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
|
2000-02-26 03:13:44 +08:00
|
|
|
AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
|
1999-08-08 21:27:18 +08:00
|
|
|
AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
|
|
|
|
AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
|
2002-01-18 00:04:21 +08:00
|
|
|
AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX)
|
2001-10-09 13:32:16 +08:00
|
|
|
AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN)
|
1999-08-08 21:27:18 +08:00
|
|
|
AM_CONDITIONAL(ARM, test x$TARGET = xARM)
|
|
|
|
|
|
|
|
AC_HEADER_STDC
|
|
|
|
AC_CHECK_FUNCS(memcpy)
|
|
|
|
AC_FUNC_ALLOCA
|
|
|
|
|
|
|
|
dnl AC_CHECK_SIZEOF(char)
|
2002-02-01 06:25:31 +08:00
|
|
|
AC_COMPILE_CHECK_SIZEOF(short)
|
|
|
|
AC_COMPILE_CHECK_SIZEOF(int)
|
|
|
|
AC_COMPILE_CHECK_SIZEOF(long)
|
|
|
|
AC_COMPILE_CHECK_SIZEOF(long long)
|
|
|
|
AC_COMPILE_CHECK_SIZEOF(float)
|
|
|
|
AC_COMPILE_CHECK_SIZEOF(double)
|
|
|
|
AC_COMPILE_CHECK_SIZEOF(long double)
|
|
|
|
|
|
|
|
AC_COMPILE_CHECK_SIZEOF(void *)
|
|
|
|
AC_C_BIGENDIAN_CROSS
|
1999-08-08 21:27:18 +08:00
|
|
|
|
|
|
|
AC_SUBST(TARGET)
|
|
|
|
AC_SUBST(TARGETDIR)
|
|
|
|
|
|
|
|
AC_SUBST(SHELL)
|
|
|
|
|
2001-06-01 12:09:21 +08:00
|
|
|
AC_ARG_ENABLE(debug,
|
|
|
|
[ --enable-debug debugging mode],
|
|
|
|
if test "$enable_debug" = "yes"; then
|
|
|
|
AC_DEFINE(FFI_DEBUG)
|
|
|
|
fi)
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(structs,
|
|
|
|
[ --disable-structs omit code for struct support],
|
|
|
|
if test "$enable_structs" = "no"; then
|
|
|
|
AC_DEFINE(FFI_NO_STRUCTS)
|
|
|
|
fi)
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(raw-api,
|
|
|
|
[ --disable-raw-api make the raw api unavailable],
|
|
|
|
if test "$enable_raw_api" = "no"; then
|
|
|
|
AC_DEFINE(FFI_NO_RAW_API)
|
|
|
|
fi)
|
1999-08-08 21:27:18 +08:00
|
|
|
|
|
|
|
AC_ARG_ENABLE(purify-safety,
|
2001-06-01 12:09:21 +08:00
|
|
|
[ --enable-purify-safety purify-safe mode],
|
|
|
|
if test "$enable_purify_safety" = "yes"; then
|
|
|
|
AC_DEFINE(USING_PURIFY)
|
|
|
|
fi)
|
1999-08-10 13:29:27 +08:00
|
|
|
|
|
|
|
AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
|
1999-08-08 21:27:18 +08:00
|
|
|
|
2000-03-04 00:58:42 +08:00
|
|
|
if test "${multilib}" = "yes"; then
|
|
|
|
multilib_arg="--enable-multilib"
|
|
|
|
else
|
|
|
|
multilib_arg=
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_OUTPUT(include/Makefile include/ffi.h Makefile,
|
|
|
|
[
|
|
|
|
if test -n "$CONFIG_FILES"; then
|
|
|
|
ac_file=Makefile . ${libffi_basedir}/../config-ml.in
|
|
|
|
fi
|
|
|
|
],
|
|
|
|
srcdir=${srcdir}
|
|
|
|
host=${host}
|
|
|
|
target=${target}
|
|
|
|
with_multisubdir=${with_multisubdir}
|
|
|
|
ac_configure_args="${multilib_arg} ${ac_configure_args}"
|
|
|
|
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
|
|
|
|
libffi_basedir=${libffi_basedir}
|
|
|
|
CC="${CC}"
|
|
|
|
DEFS="$DEFS"
|
1999-08-08 21:27:18 +08:00
|
|
|
test ! -d include && mkdir include
|
|
|
|
test ! -f include/fficonfig.h && cp fficonfig.h include/fficonfig.h
|
|
|
|
if cmp -s fficonfig.h include/fficonfig.h 2>/dev/null; then
|
|
|
|
echo fficonfig.h unchanged
|
|
|
|
else
|
|
|
|
echo Moving fficonfig.h to include/fficonfig.h
|
|
|
|
cp fficonfig.h include/fficonfig.h
|
|
|
|
fi
|
|
|
|
)
|
2001-03-27 06:52:36 +08:00
|
|
|
|
|
|
|
# Make target subdirectories if required.
|
2001-03-29 08:03:27 +08:00
|
|
|
test -d src || mkdir src
|
|
|
|
test -d src/${TARGETDIR} || mkdir src/${TARGETDIR}
|