[gforth] / gforth / configure.in  

gforth: gforth/configure.in


1 : anton 1.1 dnl Process this file with autoconf to produce a configure script.
2 : anton 1.20
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 : anton 1.31 AC_INIT(engine/engine.c)
22 :     AC_CONFIG_HEADER(engine/config.h)
23 : anton 1.14
24 : anton 1.1 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 :    
43 : pazsan 1.9 AC_ARG_WITH(debug,
44 : anton 1.10 [ --with-debug specifies option -g to compile with debug info (default)
45 : anton 1.27 --without-debug omits the -g switch and creates smaller images on
46 :     machines where "strip" has problems with gcc style
47 :     debugging informations.],
48 : pazsan 1.9 if test "$withval" = "yes"; then DEBUGFLAG=-g; fi)
49 :    
50 : anton 1.16 CFLAGS=$CFLAGS
51 :    
52 : pazsan 1.15 AC_PROG_CC
53 :    
54 :     if test "$GCC" = "yes"
55 :     then
56 :     echo "Fine, gcc is available"
57 :     else
58 :     cat <<'EOF'
59 : anton 1.16 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).
62 : pazsan 1.15 EOF
63 :     exit 1
64 :     fi
65 : pazsan 1.9
66 : pazsan 1.15 AC_SUBST(CC)
67 : anton 1.7 AC_SUBST(GCCLDFLAGS)
68 : pazsan 1.9 AC_SUBST(DEBUGFLAG)
69 : anton 1.7
70 : anton 1.10 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
83 : pazsan 1.9
84 : pazsan 1.23 AC_CHECK_SIZEOF(short)
85 :     AC_CHECK_SIZEOF(int)
86 :     AC_CHECK_SIZEOF(long)
87 :     AC_CHECK_SIZEOF(long long)
88 :    
89 :     ac_cv_int_type_cell=none
90 :     case "$ac_cv_sizeof_char_p" in
91 :     $ac_cv_sizeof_short)
92 :     ac_cv_int_type_cell=short
93 :     ;;
94 :     $ac_cv_sizeof_int)
95 :     ac_cv_int_type_cell=int
96 :     ;;
97 :     $ac_cv_sizeof_long)
98 :     ac_cv_int_type_cell=long
99 :     ;;
100 :     $ac_cv_sizeof_long_long)
101 :     ac_cv_int_type_cell="long long"
102 :     ;;
103 :     esac
104 : pazsan 1.22 if test "$ac_cv_int_type_cell" != int; then
105 : anton 1.20 echo "So, sizeof(pointer)!=sizeof(int); looks like a DOS C compiler to me."
106 :     echo "Since you don't have a proper C on this machine, that's one more reason"
107 :     echo "to use Forth;-)"
108 :     fi
109 : pazsan 1.23 AC_DEFINE_UNQUOTED(CELL_TYPE,$ac_cv_int_type_cell)
110 :    
111 :     ac_cv_int_type_double_cell=none
112 :     case `expr 2 '*' "$ac_cv_sizeof_char_p"` in
113 :     $ac_cv_sizeof_short)
114 :     ac_cv_int_type_double_cell=short
115 :     ;;
116 :     $ac_cv_sizeof_int)
117 :     ac_cv_int_type_double_cell=int
118 :     ;;
119 :     $ac_cv_sizeof_long)
120 :     ac_cv_int_type_double_cell=long
121 :     ;;
122 :     $ac_cv_sizeof_long_long)
123 :     ac_cv_int_type_double_cell="long long"
124 :     ;;
125 :     esac
126 : anton 1.21 if test "$ac_cv_int_type_double_cell" = none; then
127 : anton 1.20 echo "Emulating double-cell arithmetic. This may be slow."
128 :     echo "If you find this unacceptable, ask the GCC maintainers to provide proper"
129 : pazsan 1.23 echo 'long longs for your machine (the GCC manual states that they \"are twice as'
130 :     echo "long as \`long int\'\")."
131 : anton 1.20 LIBOBJS="$LIBOBJS dblsub.o"
132 :     AC_DEFINE(BUGGY_LONG_LONG)
133 : pazsan 1.23 else
134 :     AC_DEFINE_UNQUOTED(DOUBLE_CELL_TYPE,$ac_cv_int_type_double_cell)
135 : anton 1.20 fi
136 :    
137 : anton 1.1 #terminology is a bit unusual here: The host is the system on which
138 :     #gforth will run; the system on which configure will run is the `build'
139 :     AC_CANONICAL_HOST
140 :     case "$host_cpu" in
141 :     hppa*)
142 :     mach_h=hppa
143 : pazsan 1.23 LIBOBJS="cache.o"
144 : pazsan 1.6 LDFLAGS="-Xlinker -N"
145 :     LIBS="-L/lib/pa1.1/"
146 : anton 1.31 if test "${enable_direct_threaded+set}" = ""
147 :     then
148 :     AC_DEFINE(DIRECT_THREADED)
149 :     fi
150 : anton 1.1 ;;
151 :     sparc*)
152 :     mach_h=sparc
153 :     ;;
154 : anton 1.31 i386)
155 : anton 1.1 mach_h=386
156 : anton 1.16 CFLAGS="$CFLAGS -fomit-frame-pointer -fforce-addr -fforce-mem"
157 : anton 1.31 if test "${enable_direct_threaded+set}" = "" \
158 :     -a "${enable_indirect_threaded+set}" = ""
159 :     then
160 :     echo "Using direct threaded on 386er"
161 :     AC_DEFINE(DIRECT_THREADED)
162 :     fi
163 :     ;;
164 :     i486)
165 :     mach_h=386
166 :     CFLAGS="$CFLAGS -fomit-frame-pointer -fforce-addr -fforce-mem -m486"
167 :     if test "${enable_direct_threaded+set}" = "" \
168 :     -a "${enable_indirect_threaded+set}" = ""
169 :     then
170 :     echo "Using direct threaded on 486er"
171 :     AC_DEFINE(DIRECT_THREADED)
172 :     fi
173 :     ;;
174 :     i586|i686)
175 :     mach_h=386
176 :     CFLAGS="$CFLAGS -fomit-frame-pointer -fforce-addr -fforce-mem -m486"
177 :     if test "${enable_direct_threaded+set}" = "" \
178 :     -a "${enable_indirect_threaded+set}" = ""
179 :     then
180 :     echo "Using indirect threaded on Pentium and up"
181 :     AC_DEFINE(INDIRECT_THREADED)
182 :     fi
183 : anton 1.1 ;;
184 : pazsan 1.26 m68k)
185 :     mach_h=m68k
186 :     CFLAGS="$CFLAGS -fomit-frame-pointer -traditional-cpp"
187 :     ;;
188 : anton 1.1 mips*)
189 :     mach_h=mips
190 : anton 1.7 #link text and data segment into the same 256M region!
191 :     GCCLDFLAGS="-Xlinker -T -Xlinker 10000000 -Xlinker -D -Xlinker 10400000"
192 : anton 1.1 ;;
193 : pazsan 1.9 alpha*)
194 :     mach_h=alpha
195 :     ;;
196 : anton 1.31 power*)
197 :     mach_h=power
198 :     ;;
199 : anton 1.1 *)
200 :     echo "No direct threading support for $host_cpu, using indirect threading."
201 : anton 1.20 echo "Using a generic machine description."
202 : anton 1.1 echo "I'll assume that C floats and doubles are represented by IEEE single and"
203 :     echo "double numbers. If this is not so, SF@ etc. will not work correctly."
204 : anton 1.16 echo "FLUSH-ICACHE will do nothing, so END-CODE may not work properly!"
205 : anton 1.1 mach_h=32bit
206 :     esac
207 : anton 1.10 AC_SUBST(host)
208 : pazsan 1.15 AC_SUBST(ENGINE_FLAGS)
209 : anton 1.1
210 :     dnl Now a little support for DOS/DJGCC
211 : pazsan 1.30 AC_SUBST(GFORTH_EXE)
212 :     GFORTH_EXE=""
213 :     AC_SUBST(GFORTHDITC_EXE)
214 :     GFORTHDITC_EXE=""
215 : anton 1.1
216 : anton 1.24 PATHSEP=":"
217 :     AC_SUBST(PATHSEP)
218 :     AC_DEFINE_UNQUOTED(PATHSEP,'$PATHSEP')
219 : anton 1.27
220 :     AC_SUBST(FORTHSIZES)
221 : anton 1.24
222 : anton 1.1 dnl copy commands for systems that don't have links
223 : pazsan 1.29 AC_SUBST(LINK_KERNL)
224 :     LINK_KERNL=""
225 : anton 1.1
226 :     #if test $host_os=dos
227 :     #then
228 :     # echo Configuring for DOS!!!
229 :     # MAKE_EXE="coff2exe gforth"
230 : pazsan 1.29 # LINK_KERNL='$(CP) kernl32l.fi kernel.fi'
231 : anton 1.1 #fi
232 :    
233 :     dnl the following macro produces a warning with autoconf-2.1
234 :     AC_C_BIGENDIAN
235 : pazsan 1.23 AC_SUBST(KERNEL)
236 : anton 1.1 dnl ac_cv_c_bigendian is an undocumented variable of autoconf-2.1
237 :     if test $ac_cv_c_bigendian = yes; then
238 :     bytesex=b
239 : pazsan 1.23 KERNEL="kernl16b.fi kernl16l.fi kernl32b.fi kernl32l.fi kernl64b.fi kernl64l.fi"
240 : anton 1.1 else
241 :     bytesex=l
242 : pazsan 1.23 KERNEL="kernl16l.fi kernl16b.fi kernl32l.fi kernl32b.fi kernl64l.fi kernl64b.fi"
243 : anton 1.1 fi
244 :    
245 :     dnl Checks for programs.
246 :     AC_PROG_LN_S
247 :     AC_PROG_INSTALL
248 :    
249 :     dnl Checks for library functions
250 : anton 1.2 dnl This check is just for making later checks link with libm.
251 :     dnl using sin here is no good idea since it is built-into gcc and typechecked
252 :     AC_CHECK_LIB(m,asin)
253 : anton 1.31 AC_CHECK_FUNCS(dlopen)
254 :     AC_CHECK_LIB(dl,dlopen)
255 :     AC_CHECK_LIB(kernel32,GetModuleHandle)
256 : anton 1.1 AC_FUNC_MEMCMP
257 : pazsan 1.25 AC_REPLACE_FUNCS(memmove strtoul pow10 strerror strsignal atanh)
258 : anton 1.17 AC_CHECK_FUNCS(sys_siglist)
259 : anton 1.19 AC_DECL_SYS_SIGLIST
260 : anton 1.8 AC_CHECK_FUNC(getopt_long,getopt_long="",getopt_long="getopt.o getopt1.o")
261 : anton 1.1 AC_SUBST(getopt_long)
262 : anton 1.11 AC_CHECK_FUNCS(rint expm1 log1p)
263 : anton 1.1 AC_REPLACE_FUNCS(ecvt)
264 :     dnl No check for select, because our replacement is no good under
265 :     dnl anything but DOS
266 : anton 1.28 AC_CHECK_HEADERS(sys/mman.h)
267 :     AC_CHECK_FUNCS(mmap sysconf getpagesize)
268 : anton 1.1
269 : pazsan 1.23 kernel_fi=kernl${wordsize}${bytesex}.fi
270 :     AC_SUBST(kernel_fi)
271 : anton 1.8
272 : anton 1.31 AC_LINK_FILES(arch/${mach_h} $kernel_fi,machine kernel.fi)
273 :     AC_OUTPUT([
274 :     Makefile
275 :     engine/Makefile ],echo timestamp > stamp-h)
276 : anton 1.1

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help