Annotation of gforth/configure.in, revision 1.20

1.1       anton       1: dnl Process this file with autoconf to produce a configure script.
1.20    ! anton       2: 
        !             3: #Copyright (C) 1995,1996 Free Software Foundation, Inc.
        !             4: 
        !             5: #This file is part of Gforth.
        !             6: 
        !             7: #Gforth is free software; you can redistribute it and/or
        !             8: #modify it under the terms of the GNU General Public License
        !             9: #as published by the Free Software Foundation; either version 2
        !            10: #of the License, or (at your option) any later version.
        !            11: 
        !            12: #This program is distributed in the hope that it will be useful,
        !            13: #but WITHOUT ANY WARRANTY; without even the implied warranty of
        !            14: #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.#See the
        !            15: #GNU General Public License for more details.
        !            16: 
        !            17: #You should have received a copy of the GNU General Public License
        !            18: #along with this program; if not, write to the Free Software
        !            19: #Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
        !            20: 
1.1       anton      21: AC_INIT(engine.c)
1.18      anton      22: AC_CONFIG_HEADER(config.h)
1.14      anton      23: 
1.1       anton      24: AC_ARG_ENABLE(force-reg,
                     25: [  --enable-force-reg    Use explicit register declarations if they appear in
                     26:                          the machine.h file. This can cause a good speedup,
                     27:                          but also incorrect code with some gcc versions on
                     28:                          some processors (default disabled).],
                     29: 
                     30: AC_DEFINE(FORCE_REG))
                     31: dnl this is not quite according to the autoconf manual, it causes a replacement
                     32: AC_ARG_ENABLE(direct-threaded,
                     33: [  --enable-direct-threaded    Force direct threading. This may not work on
                     34:                                some machines and may cause slowdown on others.
                     35:                                (default processor-dependent)],
                     36: AC_DEFINE(DIRECT_THREADED))
                     37: AC_ARG_ENABLE(indirect-threaded,
                     38: [  --enable-indirect-threaded  Force indirect threading. This can cause a
                     39:                                slowdown on some machines.
                     40:                                (default processor-dependent)],
                     41: AC_DEFINE(INDIRECT_THREADED))
                     42: 
1.9       pazsan     43: AC_ARG_WITH(debug,
1.10      anton      44: [  --with-debug     specifies option -g to compile with debug info (default)
1.9       pazsan     45:    --without-debug  omits the -g switch and creates smaller images on
                     46:                     machines where "strip" has problems with gcc style
                     47:                     debugging informations.],
                     48: if test "$withval" = "yes"; then DEBUGFLAG=-g; fi)
                     49: 
1.16      anton      50: CFLAGS=$CFLAGS
                     51: 
1.15      pazsan     52: AC_PROG_CC
                     53: 
                     54: if test "$GCC" = "yes"
                     55: then
                     56:    echo "Fine, gcc is available"
                     57: else
                     58:    cat <<'EOF'
1.16      anton      59: Gforth requires GCC-2.0 or higher (it uses GNU C extensions).
                     60: It does not work with other C compilers. Please install the GNU C compiler,
                     61: and try again (or search for a binary distribution for your platform).
1.15      pazsan     62: EOF
                     63:    exit 1
                     64: fi
1.9       pazsan     65: 
1.15      pazsan     66: AC_SUBST(CC)
1.7       anton      67: AC_SUBST(GCCLDFLAGS)
1.9       pazsan     68: AC_SUBST(DEBUGFLAG)
1.7       anton      69: 
1.10      anton      70: dnl the following macro produces a warning with autoconf-2.1
                     71: AC_CHECK_SIZEOF(char *)
                     72: case "$ac_cv_sizeof_char_p" in
                     73:   2)
                     74:     wordsize=16
                     75:     ;;
                     76:   4)
                     77:     wordsize=32
                     78:     ;;
                     79:   8)
                     80:     wordsize=64
                     81:     ;;
                     82: esac
1.9       pazsan     83: 
1.20    ! anton      84: AC_CHECK_INT_TYPE(sizeof(char *),cell,long)
        !            85: if test $ac_cv_int_type_cell != int; then
        !            86:        echo "So, sizeof(pointer)!=sizeof(int); looks like a DOS C compiler to me."
        !            87:        echo "Since you don't have a proper C on this machine, that's one more reason"
        !            88:        echo "to use Forth;-)"
        !            89: fi
        !            90: AC_CHECK_INT_TYPE(2*sizeof(char *),double cell,long long)
        !            91: if test $ac_cv_int_type_double_cell = none; then
        !            92:        echo "Emulating double-cell arithmetic. This may be slow."
        !            93:        echo "If you find this unacceptable, ask the GCC maintainers to provide proper"
        !            94:        echo 'long longs for your machine (the GCC manual states that they \"are twice as'
        !            95:        echo "long as \`long int\'\")."
        !            96:        LIBOBJS="$LIBOBJS dblsub.o"
        !            97:        AC_DEFINE(BUGGY_LONG_LONG)
        !            98: fi
        !            99: 
1.1       anton     100: #terminology is a bit unusual here: The host is the system on which
                    101: #gforth will run; the system on which configure will run is the `build'
                    102: AC_CANONICAL_HOST
                    103: case "$host_cpu" in
                    104:        hppa*)
                    105:                mach_h=hppa
1.3       pazsan    106:                LIBOBJS="cache.o"
1.6       pazsan    107:                LDFLAGS="-Xlinker -N"
                    108:                LIBS="-L/lib/pa1.1/"
1.1       anton     109:                ;;
                    110:        sparc*)
                    111:                mach_h=sparc
                    112:                ;;
                    113:        i386|i486|i586)
                    114:                mach_h=386
1.16      anton     115:                CFLAGS="$CFLAGS -fomit-frame-pointer -fforce-addr -fforce-mem"
1.1       anton     116:                #!! direct/indirect threading switch
                    117:                #!! -m486 flag
                    118:                ;;
                    119:        mips*)
                    120:                mach_h=mips
1.7       anton     121:                #link text and data segment into the same 256M region!
                    122:                GCCLDFLAGS="-Xlinker -T -Xlinker 10000000 -Xlinker -D -Xlinker 10400000"
1.1       anton     123:                ;;
1.9       pazsan    124:        alpha*)
                    125:                mach_h=alpha
                    126:                ;;
1.1       anton     127:        *)
                    128:                echo "No direct threading support for $host_cpu, using indirect threading."
1.20    ! anton     129:                echo "Using a generic machine description."
1.1       anton     130:                echo "I'll assume that C floats and doubles are represented by IEEE single and"
                    131:                echo "double numbers. If this is not so, SF@ etc. will not work correctly."
1.16      anton     132:                echo "FLUSH-ICACHE will do nothing, so END-CODE may not work properly!"
1.1       anton     133:                mach_h=32bit
                    134: esac
1.10      anton     135: AC_SUBST(host)
1.15      pazsan    136: AC_SUBST(ENGINE_FLAGS)
1.1       anton     137: 
                    138: dnl Now a little support for DOS/DJGCC
                    139: AC_SUBST(MAKE_EXE)
                    140: MAKE_EXE=""
                    141: 
                    142: dnl copy commands for systems that don't have links
1.6       pazsan    143: AC_SUBST(LINK_KERNL16L)
                    144: LINK_KERNL16L=""
                    145: AC_SUBST(LINK_KERNL16B)
                    146: LINK_KERNL16B=""
1.1       anton     147: AC_SUBST(LINK_KERNL32L)
                    148: LINK_KERNL32L=""
                    149: AC_SUBST(LINK_KERNL32B)
                    150: LINK_KERNL32B=""
1.6       pazsan    151: AC_SUBST(LINK_KERNL64L)
                    152: LINK_KERNL64L=""
                    153: AC_SUBST(LINK_KERNL64B)
                    154: LINK_KERNL64B=""
1.1       anton     155: 
                    156: #if test $host_os=dos
                    157: #then
                    158: #  echo Configuring for DOS!!!
                    159: #  MAKE_EXE="coff2exe gforth"
1.13      anton     160: #  LINK_KERNL32L='$(CP) kernl32l.fi kernal.fi'
1.1       anton     161: #fi
                    162: 
                    163: dnl the following macro produces a warning with autoconf-2.1
                    164: AC_C_BIGENDIAN
1.4       pazsan    165: AC_SUBST(KERNAL)
1.1       anton     166: dnl ac_cv_c_bigendian is an undocumented variable of autoconf-2.1
                    167: if test $ac_cv_c_bigendian = yes; then
                    168:   bytesex=b
1.6       pazsan    169:   KERNAL="kernl16b.fi kernl16l.fi kernl32b.fi kernl32l.fi kernl64b.fi kernl64l.fi"
1.1       anton     170: else
                    171:   bytesex=l
1.6       pazsan    172:   KERNAL="kernl16l.fi kernl16b.fi kernl32l.fi kernl32b.fi kernl64l.fi kernl64b.fi"
1.1       anton     173: fi
                    174: 
                    175: dnl Checks for programs.
                    176: AC_PROG_LN_S
                    177: AC_PROG_INSTALL
                    178: 
                    179: dnl Checks for library functions
1.2       anton     180: dnl This check is just for making later checks link with libm.
                    181: dnl using sin here is no good idea since it is built-into gcc and typechecked
                    182: AC_CHECK_LIB(m,asin)
1.1       anton     183: AC_FUNC_MEMCMP
1.13      anton     184: AC_REPLACE_FUNCS(memmove strtoul pow10 strerror strsignal)
1.17      anton     185: AC_CHECK_FUNCS(sys_siglist)
1.19      anton     186: AC_DECL_SYS_SIGLIST
1.8       anton     187: AC_CHECK_FUNC(getopt_long,getopt_long="",getopt_long="getopt.o getopt1.o")
1.1       anton     188: AC_SUBST(getopt_long)
1.11      anton     189: AC_CHECK_FUNCS(rint expm1 log1p)
1.1       anton     190: AC_REPLACE_FUNCS(ecvt)
                    191: dnl No check for select, because our replacement is no good under
                    192: dnl anything but DOS
                    193: 
1.13      anton     194: kernal_fi=kernl${wordsize}${bytesex}.fi
                    195: AC_SUBST(kernal_fi)
1.8       anton     196: 
1.13      anton     197: AC_LINK_FILES(${mach_h}.h $kernal_fi,machine.h kernal.fi)
1.18      anton     198: AC_OUTPUT(Makefile,echo timestamp > stamp-h)
1.1       anton     199: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>