[gforth] / gforth / configure.in  

gforth: gforth/configure.in


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

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help