Annotation of gforth/configure.in, revision 1.12

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

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