--- gforth/configure.in 2008/07/29 21:17:49 1.234 +++ gforth/configure.in 2008/08/09 14:39:09 1.236 @@ -108,6 +108,7 @@ AC_ARG_VAR(FORTHSIZES, [Gforth command l AC_ARG_VAR(STACK_CACHE_REGS, [number of registers in the maximum stack cache state for gforth-fast and gforth-native (default platform-dependent).]) AC_ARG_VAR(STACK_CACHE_DEFAULT_FAST, [number of registers in the default stack cache state for gforth-fast and gforth-native (default 1).]) AC_ARG_VAR(GCC_PR15242_WORKAROUND, [Force the enabling (1) or disabling (0) of a workaround for a gcc-3.x performance bug (default unset: use workaround for gcc-3.x)]) +AC_ARG_VAR(LIBCC_BUILD_SRC, [(Additional) libcc interface source files that should be processed on building and installation (default none)]) AC_ARG_VAR(ac_cv_sizeof_char_p, [sizeof(char *)]) AC_ARG_VAR(ac_cv_sizeof_void_p, [sizeof(void *)]) @@ -808,30 +809,33 @@ dnl This check is just for making later dnl using sin here is no good idea since it is built-into gcc and typechecked AC_CHECK_LIB(m,asin) AC_CHECK_LIB(ltdl,lt_dlinit) -dnl check for libffi 2.x -dnl AC_CHECK_LIB(ffi,ffi_call) -dnl if test $ac_cv_lib_ffi_ffi_call = yes -dnl then -dnl LIBFFIFLAG="true" -dnl FFCALLFLAG="false" -dnl OLDCALLFLAG="false" -dnl AC_DEFINE(HAS_LIBFFI,,[define this if you want to use the ffcall interface with libffi 2.0]) -dnl else -dnl check for ffcall libraries -dnl unfortunately, these four calls are separated out into a library each. -dnl AC_CHECK_LIB(avcall,__builtin_avcall) +#check for libffi 2.x +AC_CHECK_LIB(ffi,ffi_call) +if test $ac_cv_lib_ffi_ffi_call = yes +then + LIBFFIFLAG="true" + LIBCC_BUILD_SRC="$LIBCC_BUILD_SRC libffi.fs" +else + LIBFFIFLAG="false" +fi +#check for ffcall libraries +#unfortunately, these four calls are separated out into a library each. +AC_CHECK_LIB(avcall,__builtin_avcall) dnl AC_CHECK_LIB(callback,__vacall_r) dnl AC_CHECK_LIB(vacall,vacall) dnl AC_CHECK_LIB(trampoline,alloc_trampoline) -dnl LIBFFIFLAG="false" -dnl FFCALLFLAG="false" -dnl OLDCALLFLAG="true" -dnl test $ac_cv_lib_avcall___builtin_avcall = yes && FFCALLFLAG="true" && OLDCALLFLAG="false" && AC_DEFINE(HAS_FFCALL,,[define this if you want to use the ffcall libraries]) -dnl test $ac_cv_lib_avcall___builtin_avcall = no && AC_DEFINE(HAS_OLDCALL,,[define this if you want to use the old call libraries]) -dnl fi -dnl AC_SUBST(LIBFFIFLAG) -dnl AC_SUBST(FFCALLFLAG) -dnl AC_SUBST(OLDCALLFLAG) +if test $ac_cv_lib_avcall___builtin_avcall = yes; then + FFCALLFLAG="true" + LIBCC_BUILD_SRC="$LIBCC_BUILD_SRC fflib.fs" +else + FFCALLFLAG="false" +fi +if test $LIBFFIFLAG = false -a $FFCALLFLAG = false; then + AC_MSG_WARN([The (old) lib.fs foreign function interface needs either libffi or the ffcall libraries]) +fi +AC_SUBST(LIBFFIFLAG) +AC_SUBST(FFCALLFLAG) +AC_SUBST(LIBCC_BUILD_SRC) if test "$host_os" != "nextstep3" then AC_FUNC_MEMCMP