Annotation of gforth/configure.in, revision 1.15
1.1 anton 1: dnl Process this file with autoconf to produce a configure script.
2: AC_INIT(engine.c)
1.14 anton 3:
1.1 anton 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:
1.15 ! pazsan 30: AC_PROG_CC
! 31:
! 32: if test "$GCC" = "yes"
! 33: then
! 34: echo "Fine, gcc is available"
! 35: else
! 36: cat <<'EOF'
! 37: Gforth uses the GNU-C extensions for better performance. It does not work
! 38: with other C compilers. Please install a new version of the GNU-C compiler, and
! 39: try again.
! 40: EOF
! 41: exit 1
! 42: fi
1.9 pazsan 43:
1.15 ! pazsan 44: AC_SUBST(CC)
1.7 anton 45: AC_SUBST(GCCLDFLAGS)
1.9 pazsan 46: AC_SUBST(DEBUGFLAG)
1.7 anton 47:
1.10 anton 48: dnl the following macro produces a warning with autoconf-2.1
49: AC_CHECK_SIZEOF(char *)
50: case "$ac_cv_sizeof_char_p" in
51: 2)
52: wordsize=16
53: ;;
54: 4)
55: wordsize=32
56: ;;
57: 8)
58: wordsize=64
59: dnl AC_CHECK_SIZEOF(long long)
60: dnl if [ $ac_cv_sizeof_long_long != 16 ]
61: dnl then
1.15 ! pazsan 62: dnl try the whole thing with -mlonglong128
1.10 anton 63: dnl complain about C compiler and OS vendor
64: dnl fi
65: ;;
66: esac
1.9 pazsan 67:
1.1 anton 68: #terminology is a bit unusual here: The host is the system on which
69: #gforth will run; the system on which configure will run is the `build'
70: AC_CANONICAL_HOST
71: case "$host_cpu" in
72: hppa*)
73: mach_h=hppa
1.3 pazsan 74: LIBOBJS="cache.o"
1.6 pazsan 75: LDFLAGS="-Xlinker -N"
76: LIBS="-L/lib/pa1.1/"
1.1 anton 77: ;;
78: sparc*)
79: mach_h=sparc
80: ;;
81: i386|i486|i586)
82: mach_h=386
1.15 ! pazsan 83: CFLAGS="-fomit-frame-pointer -fforce-addr -fforce-mem"
1.1 anton 84: #!! direct/indirect threading switch
85: #!! -m486 flag
86: ;;
87: m68*)
88: mach_h=m68k
89: ;;
90: mips*)
91: mach_h=mips
1.7 anton 92: #link text and data segment into the same 256M region!
93: GCCLDFLAGS="-Xlinker -T -Xlinker 10000000 -Xlinker -D -Xlinker 10400000"
1.1 anton 94: ;;
1.9 pazsan 95: alpha*)
96: mach_h=alpha
97: echo Very Preliminary Support for Alpha!!!
98: ;;
1.1 anton 99: *)
100: echo "No direct threading support for $host_cpu, using indirect threading."
101: echo "Using a generic 32-bit machine description. It will only work if char * AND"
102: echo "long values have 32 bits."
103: echo "I'll assume that C floats and doubles are represented by IEEE single and"
104: echo "double numbers. If this is not so, SF@ etc. will not work correctly."
105: mach_h=32bit
106: esac
1.10 anton 107: AC_SUBST(host)
1.15 ! pazsan 108: AC_SUBST(ENGINE_FLAGS)
1.1 anton 109:
110: dnl Now a little support for DOS/DJGCC
111: AC_SUBST(MAKE_EXE)
112: MAKE_EXE=""
113:
114: dnl copy commands for systems that don't have links
1.6 pazsan 115: AC_SUBST(LINK_KERNL16L)
116: LINK_KERNL16L=""
117: AC_SUBST(LINK_KERNL16B)
118: LINK_KERNL16B=""
1.1 anton 119: AC_SUBST(LINK_KERNL32L)
120: LINK_KERNL32L=""
121: AC_SUBST(LINK_KERNL32B)
122: LINK_KERNL32B=""
1.6 pazsan 123: AC_SUBST(LINK_KERNL64L)
124: LINK_KERNL64L=""
125: AC_SUBST(LINK_KERNL64B)
126: LINK_KERNL64B=""
1.1 anton 127:
128: #if test $host_os=dos
129: #then
130: # echo Configuring for DOS!!!
131: # MAKE_EXE="coff2exe gforth"
1.13 anton 132: # LINK_KERNL32L='$(CP) kernl32l.fi kernal.fi'
1.1 anton 133: #fi
134:
135: dnl the following macro produces a warning with autoconf-2.1
136: AC_C_BIGENDIAN
1.4 pazsan 137: AC_SUBST(KERNAL)
1.1 anton 138: dnl ac_cv_c_bigendian is an undocumented variable of autoconf-2.1
139: if test $ac_cv_c_bigendian = yes; then
140: bytesex=b
1.6 pazsan 141: KERNAL="kernl16b.fi kernl16l.fi kernl32b.fi kernl32l.fi kernl64b.fi kernl64l.fi"
1.1 anton 142: else
143: bytesex=l
1.6 pazsan 144: KERNAL="kernl16l.fi kernl16b.fi kernl32l.fi kernl32b.fi kernl64l.fi kernl64b.fi"
1.1 anton 145: fi
146:
147: dnl Checks for programs.
148: AC_PROG_LN_S
149: AC_PROG_INSTALL
150:
151: dnl Checks for library functions
1.2 anton 152: dnl This check is just for making later checks link with libm.
153: dnl using sin here is no good idea since it is built-into gcc and typechecked
154: AC_CHECK_LIB(m,asin)
1.1 anton 155: AC_FUNC_MEMCMP
1.13 anton 156: AC_REPLACE_FUNCS(memmove strtoul pow10 strerror strsignal)
1.8 anton 157: AC_CHECK_FUNC(getopt_long,getopt_long="",getopt_long="getopt.o getopt1.o")
1.1 anton 158: AC_SUBST(getopt_long)
1.11 anton 159: AC_CHECK_FUNCS(rint expm1 log1p)
1.1 anton 160: AC_REPLACE_FUNCS(ecvt)
161: dnl No check for select, because our replacement is no good under
162: dnl anything but DOS
163:
1.13 anton 164: kernal_fi=kernl${wordsize}${bytesex}.fi
165: AC_SUBST(kernal_fi)
1.8 anton 166:
1.13 anton 167: AC_LINK_FILES(${mach_h}.h $kernal_fi,machine.h kernal.fi)
1.1 anton 168: AC_OUTPUT(Makefile)
169:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>