File:
[gforth] /
gforth /
configure.in
Revision
1.34:
download - view:
text,
annotated -
select for diffs
Thu Jun 4 16:17:38 1998 UTC (24 years, 9 months ago) by
anton
Branches:
MAIN
CVS tags:
HEAD
various changes in configure.in and the Makefile.in's:
symlinks kernel.fi and arch/machine eliminated
utilize some automake stuff (e.g., @VERSION@ and @lispdir@)
eliminated engine/version.h
eliminated replace.a; gforth[-ditc] is now built by engine/Makefile
getopt_long replacement is now donw through LIBOBJS, like everything else
automake-induced changes in acconfig.h; added acinclude.m4 and AUTHORS.
aclocal.m4 is now generated (it's still in CVS because there's not yet a
make rule for it).
made gforthmi more conformant with GNU standards (--version etc.).
prim: fixed portability bug (RTLD_GLOBAL does not exist everywhere)
arch/power/machine.h: refined cache flush code
doc/gforth.ds now uses @VERSION{} (but we need to generate version.texi)
documented new buffering behaviour
1: dnl Process this file with autoconf to produce a configure script.
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:
21: AC_INIT(engine/engine.c)
22:
23: dnl We use some automake macros here,
24: dnl but don't use automake for creating Makefile.in
25: AM_INIT_AUTOMAKE(gforth,0.4.0)
26: AM_CONFIG_HEADER(engine/config.h)
27: AM_CYGWIN32
28:
29: AC_ARG_ENABLE(force-reg,
30: [ --enable-force-reg Use explicit register declarations if they appear in
31: the machine.h file. This can cause a good speedup,
32: but also incorrect code with some gcc versions on
33: some processors (default disabled).],
34:
35: AC_DEFINE(FORCE_REG))
36: dnl this is not quite according to the autoconf manual, it causes a replacement
37: AC_ARG_ENABLE(direct-threaded,
38: [ --enable-direct-threaded Force direct threading. This may not work on
39: some machines and may cause slowdown on others.
40: (default processor-dependent)],
41: AC_DEFINE(DIRECT_THREADED))
42: AC_ARG_ENABLE(indirect-threaded,
43: [ --enable-indirect-threaded Force indirect threading. This can cause a
44: slowdown on some machines.
45: (default processor-dependent)],
46: AC_DEFINE(INDIRECT_THREADED))
47:
48: AC_ARG_WITH(debug,
49: [ --with-debug specifies option -g to compile with debug info (default)
50: --without-debug omits the -g switch and creates smaller images on
51: machines where "strip" has problems with gcc style
52: debugging informations.],
53: if test "$withval" = "yes"; then DEBUGFLAG=-g; fi)
54:
55: CFLAGS=$CFLAGS
56:
57: AC_PROG_CC
58:
59: if test "$GCC" = "yes"
60: then
61: echo "Fine, gcc is available"
62: else
63: cat <<'EOF'
64: Gforth requires GCC-2.0 or higher (it uses GNU C extensions).
65: It does not work with other C compilers. Please install the GNU C compiler,
66: and try again (or search for a binary distribution for your platform).
67: EOF
68: exit 1
69: fi
70:
71: AC_SUBST(CC)
72: AC_SUBST(GCCLDFLAGS)
73: AC_SUBST(DEBUGFLAG)
74:
75: dnl the following macro produces a warning with autoconf-2.1
76: AC_CHECK_SIZEOF(char *)
77: case "$ac_cv_sizeof_char_p" in
78: 2)
79: wordsize=16
80: ;;
81: 4)
82: wordsize=32
83: ;;
84: 8)
85: wordsize=64
86: ;;
87: esac
88:
89: AC_CHECK_SIZEOF(short)
90: AC_CHECK_SIZEOF(int)
91: AC_CHECK_SIZEOF(long)
92: AC_CHECK_SIZEOF(long long)
93:
94: ac_cv_int_type_cell=none
95: case "$ac_cv_sizeof_char_p" in
96: $ac_cv_sizeof_short)
97: ac_cv_int_type_cell=short
98: ;;
99: $ac_cv_sizeof_int)
100: ac_cv_int_type_cell=int
101: ;;
102: $ac_cv_sizeof_long)
103: ac_cv_int_type_cell=long
104: ;;
105: $ac_cv_sizeof_long_long)
106: ac_cv_int_type_cell="long long"
107: ;;
108: esac
109: if test "$ac_cv_int_type_cell" != int; then
110: echo "So, sizeof(pointer)!=sizeof(int); looks like a DOS C compiler to me."
111: echo "Since you don't have a proper C on this machine, that's one more reason"
112: echo "to use Forth;-)"
113: fi
114: AC_DEFINE_UNQUOTED(CELL_TYPE,$ac_cv_int_type_cell)
115:
116: ac_cv_int_type_double_cell=none
117: case `expr 2 '*' "$ac_cv_sizeof_char_p"` in
118: $ac_cv_sizeof_short)
119: ac_cv_int_type_double_cell=short
120: ;;
121: $ac_cv_sizeof_int)
122: ac_cv_int_type_double_cell=int
123: ;;
124: $ac_cv_sizeof_long)
125: ac_cv_int_type_double_cell=long
126: ;;
127: $ac_cv_sizeof_long_long)
128: ac_cv_int_type_double_cell="long long"
129: ;;
130: esac
131: if test "$ac_cv_int_type_double_cell" = none; then
132: echo "Emulating double-cell arithmetic. This may be slow."
133: echo "If you find this unacceptable, ask the GCC maintainers to provide proper"
134: echo 'long longs for your machine (the GCC manual states that they \"are twice as'
135: echo "long as \`long int\'\")."
136: LIBOBJS="$LIBOBJS dblsub.o"
137: AC_DEFINE(BUGGY_LONG_LONG)
138: else
139: AC_DEFINE_UNQUOTED(DOUBLE_CELL_TYPE,$ac_cv_int_type_double_cell)
140: fi
141:
142: #terminology is a bit unusual here: The host is the system on which
143: #gforth will run; the system on which configure will run is the `build'
144: AC_CANONICAL_HOST
145: case "$host_cpu" in
146: hppa*)
147: machine=hppa
148: LIBOBJS="$LIBOBJS cache.o"
149: LDFLAGS="-Xlinker -N"
150: LIBS="-L/lib/pa1.1/"
151: if test "${enable_direct_threaded+set}" = ""
152: then
153: AC_DEFINE(DIRECT_THREADED)
154: fi
155: ;;
156: sparc*)
157: machine=sparc
158: ;;
159: i386)
160: machine=386
161: CFLAGS="$CFLAGS -fomit-frame-pointer -fforce-addr -fforce-mem"
162: if test "${enable_direct_threaded+set}" = "" \
163: -a "${enable_indirect_threaded+set}" = ""
164: then
165: echo "Using direct threaded code on 386"
166: AC_DEFINE(DIRECT_THREADED)
167: fi
168: ;;
169: i486)
170: machine=386
171: CFLAGS="$CFLAGS -fomit-frame-pointer -fforce-addr -fforce-mem -m486"
172: if test "${enable_direct_threaded+set}" = "" \
173: -a "${enable_indirect_threaded+set}" = ""
174: then
175: echo "Using direct threaded code on 486"
176: AC_DEFINE(DIRECT_THREADED)
177: fi
178: ;;
179: i586|i686)
180: machine=386
181: CFLAGS="$CFLAGS -fomit-frame-pointer -fforce-addr -fforce-mem -m486"
182: if test "${enable_direct_threaded+set}" = "" \
183: -a "${enable_indirect_threaded+set}" = ""
184: then
185: echo "Using indirect threaded code on Pentium and up"
186: AC_DEFINE(INDIRECT_THREADED)
187: fi
188: ;;
189: m68k)
190: machine=m68k
191: CFLAGS="$CFLAGS -fomit-frame-pointer"
192: if test "$host_os" = "nextstep3"
193: then
194: LIBOBJS="$LIBOBJS termios.o"
195: fi
196: ;;
197: mips*)
198: machine=mips
199: #link text and data segment into the same 256M region!
200: GCCLDFLAGS="-Xlinker -T -Xlinker 10000000 -Xlinker -D -Xlinker 10400000"
201: ;;
202: alpha*)
203: machine=alpha
204: ;;
205: power*)
206: machine=power
207: ;;
208: *)
209: echo "No direct threading support for $host_cpu, using indirect threading."
210: echo "Using a generic machine description."
211: echo "I'll assume that C floats and doubles are represented by IEEE single and"
212: echo "double numbers. If this is not so, SF@ etc. will not work correctly."
213: echo "FLUSH-ICACHE will do nothing, so END-CODE may not work properly!"
214: machine=generic
215: esac
216: AC_SUBST(host)
217: AC_SUBST(ENGINE_FLAGS)
218:
219: dnl Now a little support for DOS/DJGCC
220: AC_SUBST(GFORTH_EXE)
221: GFORTH_EXE=""
222: AC_SUBST(GFORTHDITC_EXE)
223: GFORTHDITC_EXE=""
224:
225: PATHSEP=":"
226: AC_SUBST(PATHSEP)
227: AC_DEFINE_UNQUOTED(PATHSEP,'$PATHSEP')
228:
229: AC_SUBST(FORTHSIZES)
230:
231: dnl copy commands for systems that don't have links
232: AC_SUBST(LINK_KERNL)
233: LINK_KERNL=""
234:
235: #if test $host_os=dos
236: #then
237: # echo Configuring for DOS!!!
238: # MAKE_EXE="coff2exe gforth"
239: # LINK_KERNL='$(CP) kernl32l.fi kernel.fi'
240: #fi
241:
242: dnl the following macro produces a warning with autoconf-2.1
243: AC_C_BIGENDIAN
244: AC_SUBST(KERNEL)
245: dnl ac_cv_c_bigendian is an undocumented variable of autoconf-2.1
246: if test $ac_cv_c_bigendian = yes; then
247: bytesex=b
248: KERNEL="kernl16b.fi kernl16l.fi kernl32b.fi kernl32l.fi kernl64b.fi kernl64l.fi"
249: else
250: bytesex=l
251: KERNEL="kernl16l.fi kernl16b.fi kernl32l.fi kernl32b.fi kernl64l.fi kernl64b.fi"
252: fi
253:
254: dnl Checks for programs.
255: AC_PROG_LN_S
256: dnl AM_PROG_INSTALL #performed by AM_INIT_AUTOMAKE
257:
258: dnl Checks for library functions
259: dnl This check is just for making later checks link with libm.
260: dnl using sin here is no good idea since it is built-into gcc and typechecked
261: AC_CHECK_LIB(m,asin)
262: AC_CHECK_FUNCS(dlopen)
263: AC_CHECK_LIB(dl,dlopen)
264: AC_CHECK_LIB(kernel32,GetModuleHandle)
265: if test "$host_os" != "nextstep3"
266: then
267: AC_FUNC_MEMCMP
268: fi
269: AC_REPLACE_FUNCS(memmove strtoul pow10 strerror strsignal atanh)
270: AC_CHECK_FUNCS(sys_siglist)
271: AC_DECL_SYS_SIGLIST
272: AC_CHECK_FUNC(getopt_long,true,LIBOBJS="$LIBOBJS getopt.o getopt1.o")
273: AC_CHECK_FUNCS(rint expm1 log1p)
274: AC_REPLACE_FUNCS(ecvt)
275: dnl No check for select, because our replacement is no good under
276: dnl anything but DOS
277: AC_CHECK_HEADERS(sys/mman.h)
278: AC_CHECK_FUNCS(mmap sysconf getpagesize)
279: AM_PATH_LISPDIR
280:
281: kernel_fi=kernl${wordsize}${bytesex}.fi
282: AC_SUBST(kernel_fi)
283:
284: AC_SUBST(machine)
285: dnl AC_LINK_FILES(arch/$machine,arch/machine) #no longer needed
286: AC_OUTPUT([
287: Makefile
288: engine/Makefile ],echo timestamp > stamp-h)
289:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>