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

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help