--- gforth/configure.in 2007/07/03 21:41:29 1.195 +++ gforth/configure.in 2008/01/02 21:04:44 1.203 @@ -1,12 +1,12 @@ dnl Process this file with autoconf to produce a configure script. -#Copyright (C) 1995,1996,1997,1998,2000,2003,2004,2005,2006 Free Software Foundation, Inc. +#Copyright (C) 1995,1996,1997,1998,2000,2003,2004,2005,2006,2007 Free Software Foundation, Inc. #This file is part of Gforth. #Gforth is free software; you can redistribute it and/or #modify it under the terms of the GNU General Public License -#as published by the Free Software Foundation; either version 2 +#as published by the Free Software Foundation, either version 3 #of the License, or (at your option) any later version. #This program is distributed in the hope that it will be useful, @@ -15,8 +15,7 @@ dnl Process this file with autoconf to p #GNU General Public License for more details. #You should have received a copy of the GNU General Public License -#along with this program; if not, write to the Free Software -#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. +#along with this program. If not, see http://www.gnu.org/licenses/. dnl We use some automake macros here, @@ -121,8 +120,9 @@ else fi]) #variables mentioned in INSTALL -AC_ARG_VAR(CC, [The C compiler (must support GNU C 2.x); gcc-2.95 recommended.]) +AC_ARG_VAR(CC, [The C compiler (must support GNU C 2.x).]) AC_ARG_VAR(FORTHSIZES, [Gforth command line options for the default stack and dictionary sizes (see INSTALL).]) +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)]) @@ -315,6 +315,9 @@ case "$host_cpu" in test x$ac_cv_sizeof_long_long = x && ($CC -v 2>&1 |grep -q 'gcc version 2.95') && ac_cv_sizeof_long_long=0 + #The only architecture with enough callee-saved registers + test x$STACK_CACHE_REGS = x && STACK_CACHE_REGS=3 + #or use 2, hardly slower at run-time and starts up faster ;; *) AC_MSG_WARN([Using a generic machine description]) @@ -349,6 +352,11 @@ then fi AC_SUBST(MAKEINC) +AC_ARG_VAR(STACK_CACHE_REGS, [number of registers in the maximum stack cache state for gforth-fast and gforth-native (default platform-dependent).]) + +test x$STACK_CACHE_REGS = x && STACK_CACHE_REGS=1 +AC_DEFINE_UNQUOTED(STACK_CACHE_REGS, $STACK_CACHE_REGS, + [number of registers in the maximum stack cache state for gforth-fast and gforth-native]) test x$STACK_CACHE_DEFAULT_FAST = x && STACK_CACHE_DEFAULT_FAST=1 AC_DEFINE_UNQUOTED(STACK_CACHE_DEFAULT_FAST, $STACK_CACHE_DEFAULT_FAST, [number of registers in the default stack cache state for gforth-fast and gforth-native]) @@ -619,7 +627,7 @@ AC_MSG_RESULT($MAYBE_UNUSED) #try if m4 understands -s AC_MSG_CHECKING([how to invoke m4]) -if m4 -s /dev/null; then +if m4 -s /dev/null >/dev/null 2>&1; then M4="m4 -s" else M4=m4 @@ -628,6 +636,14 @@ AC_SUBST(M4) AC_DEFINE_UNQUOTED(M4,"$M4",[How to invoke m4]) AC_MSG_RESULT($M4) +# Find installed Gforth +AC_MSG_CHECKING([for gforth]) +GFORTH="`which gforth 2>/dev/null`" +if test ! -z "$GFORTH"; then GFORTH="$GFORTH -m4M" ; fi +AC_SUBST(GFORTH) +AC_DEFINE_UNQUOTED(GFORTH,"$GFORTH",[How to invoke gforth]) +AC_MSG_RESULT($GFORTH) + echo "machine='$machine'" dnl AC_CHECK_PROG(asm_fs,asm.fs,arch/$machine/asm.fs,,$srcdir/arch/$machine) @@ -795,10 +811,14 @@ AC_PROG_LN_S AC_PROG_INSTALL AC_CHECK_PROGS(TEXI2DVI,texi2dvi4a2ps texi2dvi) +dnl MacOS X has a libtool that does something else +AC_CHECK_PROGS(GNU_LIBTOOL,glibtool libtool) + dnl Checks for library functions dnl This check is just for making later checks link with libm. 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) AC_CHECK_LIB(dl,dlopen) dnl check for libffi 2.x AC_CHECK_LIB(ffi,ffi_call) @@ -872,6 +892,6 @@ chmod +x vmgen chmod +x build-ec test -d kernel||mkdir kernel $srcdir/mkinstalldirs include/gforth/$PACKAGE_VERSION -ln -s ../../../engine/config.h ../../../engine/libcc.h include/gforth/$PACKAGE_VERSION]],[[PACKAGE_VERSION=$PACKAGE_VERSION]]) +ln -sf ../../../engine/config.h ../../../engine/libcc.h include/gforth/$PACKAGE_VERSION]],[[PACKAGE_VERSION=$PACKAGE_VERSION]]) AC_OUTPUT