Annotation of gforth/configure.in, revision 1.14

1.1       anton       1: dnl Process this file with autoconf to produce a configure script.
1.14    ! anton       2: 
1.1       anton       3: AC_INIT(engine.c)
1.14    ! anton       4: 
        !             5: GCC=${GCC-gcc}
        !             6: AC_SUBST(GCC)
        !             7: 
        !             8: dnl configure needs $CC to find out some parameters, and there may be
        !             9: dnl differences in what is obtained from gcc and from the default cc.
        !            10: dnl Therefore, we define $CC to be gcc:
        !            11: CC=$GCC
1.1       anton      12: 
                     13: AC_ARG_ENABLE(force-reg,
                     14: [  --enable-force-reg    Use explicit register declarations if they appear in
                     15:                          the machine.h file. This can cause a good speedup,
                     16:                          but also incorrect code with some gcc versions on
                     17:                          some processors (default disabled).],
                     18: 
                     19: AC_DEFINE(FORCE_REG))
                     20: dnl this is not quite according to the autoconf manual, it causes a replacement
                     21: AC_ARG_ENABLE(direct-threaded,
                     22: [  --enable-direct-threaded    Force direct threading. This may not work on
                     23:                                some machines and may cause slowdown on others.
                     24:                                (default processor-dependent)],
                     25: AC_DEFINE(DIRECT_THREADED))
                     26: AC_ARG_ENABLE(indirect-threaded,
                     27: [  --enable-indirect-threaded  Force indirect threading. This can cause a
                     28:                                slowdown on some machines.
                     29:                                (default processor-dependent)],
                     30: AC_DEFINE(INDIRECT_THREADED))
                     31: 
1.9       pazsan     32: AC_ARG_WITH(debug,
1.10      anton      33: [  --with-debug     specifies option -g to compile with debug info (default)
1.9       pazsan     34:    --without-debug  omits the -g switch and creates smaller images on
                     35:                     machines where "strip" has problems with gcc style
                     36:                     debugging informations.],
                     37: if test "$withval" = "yes"; then DEBUGFLAG=-g; fi)
                     38: 
                     39: 
1.7       anton      40: AC_SUBST(GCCLDFLAGS)
1.9       pazsan     41: AC_SUBST(DEBUGFLAG)
1.7       anton      42: 
1.10      anton      43: dnl the following macro produces a warning with autoconf-2.1
                     44: AC_CHECK_SIZEOF(char *)
                     45: case "$ac_cv_sizeof_char_p" in
                     46:   2)
                     47:     wordsize=16
                     48:     ;;
                     49:   4)
                     50:     wordsize=32
                     51:     ;;
                     52:   8)
                     53:     wordsize=64
                     54: dnl    AC_CHECK_SIZEOF(long long)
                     55: dnl    if [ $ac_cv_sizeof_long_long != 16 ]
                     56: dnl    then
                     57: dnl       try the whole thing with -mlonlong128
                     58: dnl complain about C compiler and OS vendor
                     59: dnl    fi
                     60:     ;;
                     61: esac
1.9       pazsan     62: 
1.1       anton      63: #terminology is a bit unusual here: The host is the system on which
                     64: #gforth will run; the system on which configure will run is the `build'
                     65: AC_CANONICAL_HOST
                     66: case "$host_cpu" in
                     67:        hppa*)
                     68:                mach_h=hppa
1.3       pazsan     69:                LIBOBJS="cache.o"
1.6       pazsan     70:                LDFLAGS="-Xlinker -N"
                     71:                LIBS="-L/lib/pa1.1/"
1.1       anton      72:                ;;
                     73:        sparc*)
                     74:                mach_h=sparc
                     75:                ;;
                     76:        i386|i486|i586)
                     77:                mach_h=386
1.9       pazsan     78:                CFLAGS="-fforce-mem -fforce-addr -fomit-frame-pointer"
1.1       anton      79:                #!! direct/indirect threading switch
                     80:                #!! -m486 flag
                     81:                ;;
                     82:        m68*)
                     83:                mach_h=m68k
                     84:                ;;
                     85:        mips*)
                     86:                mach_h=mips
1.7       anton      87:                #link text and data segment into the same 256M region!
                     88:                GCCLDFLAGS="-Xlinker -T -Xlinker 10000000 -Xlinker -D -Xlinker 10400000"
1.1       anton      89:                ;;
1.9       pazsan     90:        alpha*)
                     91:                mach_h=alpha
                     92:                echo Very Preliminary Support for Alpha!!!
                     93:                ;;
1.1       anton      94:        *)
                     95:                echo "No direct threading support for $host_cpu, using indirect threading."
                     96:                echo "Using a generic 32-bit machine description. It will only work if char * AND"
                     97:                echo "long values have 32 bits."
                     98:                echo "I'll assume that C floats and doubles are represented by IEEE single and"
                     99:                echo "double numbers. If this is not so, SF@ etc. will not work correctly."
                    100:                mach_h=32bit
                    101: esac
1.10      anton     102: AC_SUBST(host)
1.1       anton     103: 
                    104: dnl Now a little support for DOS/DJGCC
                    105: AC_SUBST(MAKE_EXE)
                    106: MAKE_EXE=""
                    107: 
                    108: dnl copy commands for systems that don't have links
1.6       pazsan    109: AC_SUBST(LINK_KERNL16L)
                    110: LINK_KERNL16L=""
                    111: AC_SUBST(LINK_KERNL16B)
                    112: LINK_KERNL16B=""
1.1       anton     113: AC_SUBST(LINK_KERNL32L)
                    114: LINK_KERNL32L=""
                    115: AC_SUBST(LINK_KERNL32B)
                    116: LINK_KERNL32B=""
1.6       pazsan    117: AC_SUBST(LINK_KERNL64L)
                    118: LINK_KERNL64L=""
                    119: AC_SUBST(LINK_KERNL64B)
                    120: LINK_KERNL64B=""
1.1       anton     121: 
                    122: #if test $host_os=dos
                    123: #then
                    124: #  echo Configuring for DOS!!!
                    125: #  MAKE_EXE="coff2exe gforth"
1.13      anton     126: #  LINK_KERNL32L='$(CP) kernl32l.fi kernal.fi'
1.1       anton     127: #fi
                    128: 
                    129: dnl the following macro produces a warning with autoconf-2.1
                    130: AC_C_BIGENDIAN
1.4       pazsan    131: AC_SUBST(KERNAL)
1.1       anton     132: dnl ac_cv_c_bigendian is an undocumented variable of autoconf-2.1
                    133: if test $ac_cv_c_bigendian = yes; then
                    134:   bytesex=b
1.6       pazsan    135:   KERNAL="kernl16b.fi kernl16l.fi kernl32b.fi kernl32l.fi kernl64b.fi kernl64l.fi"
1.1       anton     136: else
                    137:   bytesex=l
1.6       pazsan    138:   KERNAL="kernl16l.fi kernl16b.fi kernl32l.fi kernl32b.fi kernl64l.fi kernl64b.fi"
1.1       anton     139: fi
                    140: 
                    141: dnl Checks for programs.
                    142: AC_PROG_LN_S
                    143: AC_PROG_INSTALL
                    144: 
                    145: dnl Checks for library functions
1.2       anton     146: dnl This check is just for making later checks link with libm.
                    147: dnl using sin here is no good idea since it is built-into gcc and typechecked
                    148: AC_CHECK_LIB(m,asin)
1.1       anton     149: AC_FUNC_MEMCMP
1.13      anton     150: AC_REPLACE_FUNCS(memmove strtoul pow10 strerror strsignal)
1.8       anton     151: AC_CHECK_FUNC(getopt_long,getopt_long="",getopt_long="getopt.o getopt1.o")
1.1       anton     152: AC_SUBST(getopt_long)
1.11      anton     153: AC_CHECK_FUNCS(rint expm1 log1p)
1.1       anton     154: AC_REPLACE_FUNCS(ecvt)
                    155: dnl No check for select, because our replacement is no good under
                    156: dnl anything but DOS
                    157: 
1.13      anton     158: kernal_fi=kernl${wordsize}${bytesex}.fi
                    159: AC_SUBST(kernal_fi)
1.8       anton     160: 
1.13      anton     161: AC_LINK_FILES(${mach_h}.h $kernal_fi,machine.h kernal.fi)
1.1       anton     162: AC_OUTPUT(Makefile)
                    163: 

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