--- gforth/configure.in 2002/10/04 19:17:05 1.87 +++ gforth/configure.in 2002/12/23 22:14:05 1.91 @@ -36,7 +36,7 @@ AC_ARG_ENABLE(force-reg, the machine.h file. This can cause a good speedup, but also incorrect code with some gcc versions on some processors (default disabled).], -AC_DEFINE(FORCE_REG)) +AC_DEFINE(FORCE_REG,,[Define if you want to use explicit register declarations for better performance or for more convenient CODE words (does not work with all GCC versions on all machines)])) AC_ARG_WITH(debug, [ --with-debug specifies option -g to compile with debug info (default) @@ -117,7 +117,7 @@ if test "$ac_cv_int_type_cell" != int; t echo "Since you don't have a proper C on this machine, that's one more reason" echo "to use Forth;-)" fi -AC_DEFINE_UNQUOTED(CELL_TYPE,$ac_cv_int_type_cell) +AC_DEFINE_UNQUOTED(CELL_TYPE,$ac_cv_int_type_cell,[an integer type that is as long as a pointer]) ac_cv_int_type_double_cell=none case `expr 2 '*' "$ac_cv_sizeof_char_p"` in @@ -140,9 +140,9 @@ if test "$ac_cv_int_type_double_cell" = echo 'long longs for your machine (the GCC manual states that they \"are twice as' echo "long as \`long int\'\")." AC_LIBOBJ(dblsub) - AC_DEFINE(BUGGY_LONG_LONG) + AC_DEFINE(BUGGY_LONG_LONG,,[define this if there is no working DOUBLE_CELL_TYPE on your machine]) else - AC_DEFINE_UNQUOTED(DOUBLE_CELL_TYPE,$ac_cv_int_type_double_cell) + AC_DEFINE_UNQUOTED(DOUBLE_CELL_TYPE,$ac_cv_int_type_double_cell,[an integer type that is twice as long as a pointer]) fi AC_MSG_CHECKING([whether the linker accepts -export-dynamic]) @@ -205,7 +205,7 @@ case "$host_cpu" in AC_MSG_RESULT($ac_link_mips_t) fixme #dynamically generated code should be in the same 256MB # region as the text segment; no indirect threading necessary - test $ac_link_mips_t = yes||(echo cannot link text and data into same 256M region, using indirect threading; AC_DEFINE(INDIRECT_THREADED)) + test $ac_link_mips_t = yes||(echo cannot link text and data into same 256M region, using indirect threading; AC_DEFINE(INDIRECT_THREADED,,[Define if you want to force an indirect threaded code implementation])) AC_MSG_CHECKING([whether the linker accepts -D]) OLDLDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Xlinker -D -Xlinker 10400000" @@ -233,6 +233,12 @@ esac AC_SUBST(host) AC_SUBST(ENGINE_FLAGS) +# Try if GCC understands -fno-cross-jump + +CFLAGS_1="$CFLAGS" +CFLAGS="$CFLAGS -fno-cross-jump" +AC_TRY_COMPILE(,,,CFLAGS="$CFLAGS_1") + AC_CHECK_PROG(asm_fs,asm.fs,arch/$machine/asm.fs,,$srcdir/arch/$machine) AC_SUBST(asm_fs) @@ -242,12 +248,16 @@ AC_SUBST(disasm_fs) case "$host_os" in *win32) EXE=".exe" + DIRSEP="\\" ;; *) EXE="" + DIRSEP="/" ;; esac AC_SUBST(EXE) +AC_SUBST(DIRSEP) +AC_DEFINE_UNQUOTED(DIRSEP,'$DIRSEP',[a directory separator character]) dnl Now a little support for DOS/DJGCC AC_SUBST(GFORTH_EXE) @@ -261,14 +271,14 @@ GFORTHDITC_EXE="" PATHSEP=":" AC_SUBST(PATHSEP) -AC_DEFINE_UNQUOTED(PATHSEP,'$PATHSEP') +AC_DEFINE_UNQUOTED(PATHSEP,'$PATHSEP',[a path separator character]) AC_SUBST(FORTHSIZES) if test "$PEEPHOLE" = "yes" then PEEPHOLEFLAG="true" - AC_DEFINE(HAS_PEEPHOLE) + AC_DEFINE(HAS_PEEPHOLE,,[Define if you want to use peephole optimization]) else PEEPHOLEFLAG="false" fi @@ -297,6 +307,33 @@ else KERNEL="kernl16l.fi kernl16b.fi kernl32l.fi kernl32b.fi kernl64l.fi kernl64b.fi" fi +#check how to do asm(".skip 16") +for i in ".skip 16" ".block 16" ".org .+16" ".=.+16" ".space 16" +do + AC_MSG_CHECKING([whether asm("$i") skips 16 bytes]) + AC_TRY_RUN( +int foo(int); +main() +{ + exit(foo(0)!=16); +} +int foo(int x) +{ + if (x) { + label1: + asm("$i"); + label2: + } + return (&&label2)-(&&label1); +} + ,AC_MSG_RESULT(yes) + AC_DEFINE_UNQUOTED(SKIP16,asm("$i"),statement for skipping 16 bytes) + break + ,AC_MSG_RESULT(no),) + +done + + dnl Checks for programs. AC_PROG_LN_S dnl AM_PROG_INSTALL #performed by AM_INIT_AUTOMAKE @@ -314,8 +351,8 @@ AC_REPLACE_FUNCS(memmove strtoul pow10 s AC_CHECK_FUNCS(dlopen sys_siglist getrusage) AC_DECL_SYS_SIGLIST AC_CHECK_FUNC(getopt_long,true,AC_LIBOBJ(getopt.$ac_objext getopt1)) -AC_CHECK_FUNCS(rint expm1 log1p) -AC_REPLACE_FUNCS(ecvt) +AC_CHECK_FUNCS(expm1 log1p) +AC_REPLACE_FUNCS(rint ecvt) dnl No check for select, because our replacement is no good under dnl anything but DOS AC_CHECK_HEADERS(sys/mman.h fnmatch.h)