--- gforth/configure.in 2007/03/17 19:14:57 1.174 +++ gforth/configure.in 2007/04/22 22:04:28 1.185 @@ -21,7 +21,7 @@ dnl Process this file with autoconf to p dnl We use some automake macros here, dnl but don't use automake for creating Makefile.in -AC_INIT([gforth],[0.6.2-20060527],[https://savannah.gnu.org/bugs/?func=addbug&group=gforth]) +AC_INIT([gforth],[0.6.9-20070401],[https://savannah.gnu.org/bugs/?func=addbug&group=gforth]) AC_PREREQ(2.54) #snapshots have numbers major.minor.release-YYYYMMDD #note that lexicographic ordering must be heeded. @@ -86,18 +86,39 @@ dnl --without-peephole disables peepho dnl but slower images.], dnl PEEPHOLE="$withval") -AC_ARG_ENABLE(ec, - AC_HELP_STRING([--enable-ec], +GCC_LD="\$(GCC)" +EC_MODE="false" +EC="" +engine2="engine2.o" +engine_fast2="engine-fast2.o" +no_dynamic="" +image_i="" +signals_o="io.o signals.o" + +AC_ARG_WITH(ec, + AC_HELP_STRING([--with-ec=], [ Build gforth for systems without OS.]), - ,enable_ec=no) -if test "$enable_ec" = "yes"; then - echo "defining standalone system" +[if test "$withval" = "no"; then + echo "defining hosted system" +else + echo "defining standalone system (${withval})" AC_DEFINE(STANDALONE,,[Define if you want a Gforth without OS]) EC_MODE="true" -else - echo "defining hosted system" - EC_MODE="false" -fi + EC="-ec" + engine2="" + engine_fast2="" + no_dynamic="-DNO_DYNAMIC" + image_i="image.i" + if test "$withval" != "yes"; then + signals_o="io-${withval}.o" + else + signals_o="io.o" + fi + GCC_PATH=$(which $CC) + LIB_PATH=${GCC_PATH%/*/*} + GCC_LD="\$(LD)" + platform=${withval} +fi]) #variables mentioned in INSTALL AC_ARG_VAR(CC, [The C compiler (must support GNU C 2.x); gcc-2.95 recommended.]) @@ -106,6 +127,7 @@ AC_ARG_VAR(STACK_CACHE_DEFAULT_FAST, [nu 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(ac_cv_sizeof_char_p, [sizeof(char *)]) +AC_ARG_VAR(ac_cv_sizeof_void_p, [sizeof(void *)]) AC_ARG_VAR(ac_cv_sizeof_char, [sizeof(char)]) AC_ARG_VAR(ac_cv_sizeof_short, [sizeof(short)]) AC_ARG_VAR(ac_cv_sizeof_int, [sizeof(int)]) @@ -118,6 +140,7 @@ AC_ARG_VAR(ac_cv_c_bigendian, [Is the ta AC_ARG_VAR(no_dynamic_default, [run gforth with --dynamic (0) or --no-dynamic (1) by default]) AC_ARG_VAR(skipcode, [assembly code for skipping 16 bytes of code]) AC_ARG_VAR(asmcomment, [assembler comment start string]) +AC_ARG_VAR(arm_cacheflush, [file containing ARM cacheflush function (without .c)]) #set up feature test macros, so the tests get them right: # turn on all POSIX, SUSv3, and GNU features if available @@ -143,8 +166,15 @@ AC_PROG_CC test "$GCC" = "yes" || AC_MSG_ERROR(Gforth uses GNU C extensions and requires GCC 2.0 or higher) AC_SUBST(CC) +AC_SUBST(GCC_LD) AC_SUBST(DEBUGFLAG) +AC_SUBST(EC) AC_SUBST(EC_MODE) +AC_SUBST(engine2) +AC_SUBST(engine_fast2) +AC_SUBST(no_dynamic) +AC_SUBST(image_i) +AC_SUBST(signals_o) #this is used to disable some (not generally essential) part of the #Makefile that some makes don't grok. It would be better to test for @@ -172,10 +202,19 @@ case "$host_cpu" in arm*) machine=arm CFLAGS="$CFLAGS -fomit-frame-pointer" - if test -z $no_dynamic_default; then + if test x$platform = xnxt; then + CFLAGS="$CFLAGS -mthumb -mthumb-interwork" + fi + if test -z $arm_cacheflush; then no_dynamic_default=1 + arm_cacheflush=arch/arm/cacheflush0 AC_MSG_WARN([No I-cache flush code known, disabling dynamic native code generation]) fi + AC_LIBSOURCES([../arch/arm/cacheflush0, ../arch/arm/cacheflush1, ../arch/arm/cacheflush2]) + AC_LIBOBJ(../$arm_cacheflush) + #longer skipcodes lead to problems on ARM, and it uses + #only 4-byte alignment anyway + test "$skipcode" || skipcode="nop" ;; hppa*) machine=hppa @@ -268,6 +307,26 @@ case "$host_cpu" in esac AC_SUBST(host) +MAKEINC="" + +echo "Check for arch/$machine/$platform/gforth.ld ($EC_MODE)" +if test x$EC_MODE = xtrue +then + echo "Check for arch/$machine/$platform/gforth.ld" + if test -f arch/$machine/$platform/gforth.ld + then + LDFLAGS="-T ../arch/$machine/$platform/gforth.ld -Map \$@.map -cref --gc-sections $LDFLAGS" + if test x$platform = xnxt; then + LIBS="$LIB_PATH/lib/gcc/arm-elf/$($CC --version | grep GCC | cut -d' ' -f3)/interwork/libgcc.a $LIB_PATH/arm-elf/lib/interwork/libc.a $LIBS" + fi + fi + if test -f arch/$machine/$platform/make.inc + then + MAKEINC="include ../arch/$machine/$platform/make.inc" + fi +fi +AC_SUBST(MAKEINC) + 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]) @@ -299,6 +358,19 @@ case "$ac_cv_sizeof_char_p" in ;; esac +AC_CHECK_SIZEOF(void *) +case "$ac_cv_sizeof_void_p" in + 2) + vwordsize=16 + ;; + 4) + vwordsize=32 + ;; + 8) + vwordsize=64 + ;; +esac + AC_CHECK_SIZEOF(char) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) @@ -643,7 +715,7 @@ if test -z "$asmcomment"; then asmcomment=no CFLAGS_1="$CFLAGS" CFLAGS="$CFLAGS $ENGINE_FLAGS" - for i in '"# "' '"! "'; do + for i in '"# "' '"! "' '"; "'; do AC_TRY_COMPILE(,[asm($i"fluffystunk");],asmcomment=$i; break,) done CFLAGS=$CFLAGS_1 @@ -711,8 +783,10 @@ test $ac_cv_func_fnmatch_works = yes || AC_CHECK_FUNCS(mmap sysconf getpagesize) AM_PATH_LISPDIR -kernel_fi=kernl${wordsize}${bytesex}.fi +kernel_fi=kernl${vwordsize}${bytesex}.fi +include_fi=kernl${wordsize}${bytesex}${EC}.fi AC_SUBST(kernel_fi) +AC_SUBST(include_fi) #this breaks bindists #dnl replace srource directory by absolute value