OSDN Git Service

e2777cca6714f61bf4e91850df710df92b9443dc
[pf3gnuchains/gcc-fork.git] / boehm-gc / configure.in
1 dnl Process this file with autoconf to produce configure.
2
3 AC_INIT(gc_mark.h)
4
5 dnl Can't be done in BOEHM_CONFIGURE because that confuses automake. 
6 AC_CONFIG_AUX_DIR(..)
7
8 AC_CANONICAL_SYSTEM
9
10 BOEHM_CONFIGURE(.)
11
12 AM_PROG_LIBTOOL
13
14 dnl We use these options to decide which functions to include.
15 AC_ARG_WITH(target-subdir,
16 [  --with-target-subdir=SUBDIR      Configuring with a cross compiler])
17 AC_ARG_WITH(cross-host,
18 [  --with-cross-host=HOST           Configuring with a cross compiler])
19
20 AM_MAINTAINER_MODE
21 # automake wants to see AC_EXEEXT.  But we don't need it.  And having
22 # it is actually a problem, because the compiler we're passed can't
23 # necessarily do a full link.  So we fool automake here.
24 if test "x" = "y"; then
25    AC_EXEEXT
26 fi
27
28 AC_MSG_CHECKING([for threads package to use])
29 AC_ARG_ENABLE(threads, [  --enable-threads=TYPE    choose threading package],
30   THREADS=$enableval,
31   dnl FIXME: figure out native threads to use here.
32   THREADS=no)
33
34 if test "$THREADS" = yes; then
35    case "$host" in
36     *-*-vxworks*)
37        THREADS=vxworks
38        ;;
39     *-*-linux*)
40        # FIXME: this isn't correct in all cases.
41        THREADS=posix
42        ;;
43     *-*-win*)
44        THREADS=win32
45        ;;
46     *-*-irix*)
47        # FIXME: for now, choose POSIX, because we implement that.
48        # Later, choose irix threads.
49        THREADS=posix
50        ;;
51     *-*-solaris*)
52        # FIXME: for now, choose POSIX, because we implement that.
53        # Later, choose solaris threads.
54        THREADS=posix
55        ;;
56     *)
57        # For now.
58        THREADS=none
59        ;;
60    esac
61 fi
62
63 INCLUDES=
64 case "$THREADS" in
65  no | none | single)
66     THREADS=none
67     ;;
68  posix | pthreads)
69     THREADS=posix
70     case "$host" in
71      *-*-linux*)
72         AC_DEFINE(LINUX_THREADS)
73         AC_DEFINE(_REENTRANT)
74         ;;
75      *-*-solaris*)
76         AC_DEFINE(SOLARIS_THREADS)
77         AC_DEFINE(_SOLARIS_PTHREADS)
78         ;;
79      *-*-irix*)
80         AC_DEFINE(IRIX_THREADS)
81         ;;
82     esac
83     ;;
84  qt)
85     AC_DEFINE(QUICK_THREADS)
86     INCLUDES="-I${boehm_gc_basedir}/../qthreads"
87     ;;
88  decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
89     AC_MSG_ERROR(thread package $THREADS not yet supported)
90     ;;
91  *)
92     AC_MSG_ERROR($THREADS is an unknown thread package)
93     ;;
94 esac
95 AC_MSG_RESULT($THREADS)
96
97 AC_ARG_ENABLE(java-gc,
98 changequote(<<,>>)dnl
99 <<  --enable-java-gc=TYPE    choose garbage collector [boehm]>>,
100 changequote([,])
101   GC=$enableval,
102   GC=boehm)
103 target_all=
104 if test "$GC" = "boehm"; then
105    target_all=libgcjgc.la
106 fi
107 AC_SUBST(target_all)
108
109 dnl If the target is an eCos system, use the appropriate eCos
110 dnl I/O routines.
111 dnl FIXME: this should not be a local option but a global target
112 dnl system; at present there is no eCos target.
113 TARGET_ECOS="no"
114 AC_ARG_WITH(ecos,
115 [  --with-ecos      Enable runtime eCos target support.],
116 TARGET_ECOS="$with_ecos"
117 )
118
119 addobjs=
120 CXXINCLUDES=
121 case "$TARGET_ECOS" in
122    no)
123       ;;
124    *)
125       AC_DEFINE(ECOS)
126       CXXINCLUDES="-I${TARGET_ECOS}/include"
127       addobjs="$addobjs ecos.lo"
128       ;;
129 esac
130 AC_SUBST(CXX)
131
132 AC_SUBST(INCLUDES)
133 AC_SUBST(CXXINCLUDES)
134
135 machdep=
136 case "$host" in
137  alpha*-*-*)
138     machdep="alpha_mach_dep.lo"
139     ;;
140  mipstx39-*-elf*)
141     machdep="mips_ultrix_mach_dep.lo"
142     AC_DEFINE(STACKBASE, __stackbase)
143     AC_DEFINE(DATASTART_IS_ETEXT)
144     ;;
145  mips-dec-ultrix*)
146     machdep="mips_ultrix_mach-dep.lo"
147     ;;
148  mips-*-*)
149     machdep="mips_sgi_mach_dep.lo"
150     AC_DEFINE(NO_EXECUTE_PERMISSION)
151     ;;
152  sparc-sun-solaris2.3*)
153     AC_DEFINE(SUNOS53_SHARED_LIB)
154     ;;
155 esac
156 if test x"$machdep" = x; then
157    machdep="mach_dep.lo"
158 fi
159 addobjs="$addobjs $machdep"
160 AC_SUBST(addobjs)
161
162 dnl As of 4.13a2, the collector will not properly work on Solaris when
163 dnl built with gcc and -O.  So we remove -O in the appropriate case.
164 case "$host" in
165  sparc-sun-solaris2*)
166     if test "$GCC" = yes; then
167        new_CFLAGS=
168        for i in $CFLAGS; do
169           case "$i" in
170            -O*)
171               ;;
172            *)
173               new_CFLAGS="$new_CFLAGS $i"
174               ;;
175           esac
176        done
177        CFLAGS="$new_CFLAGS"
178     fi
179     ;;
180 esac
181
182 dnl We need to override the top-level CFLAGS.  This is how we do it.
183 MY_CFLAGS="$CFLAGS"
184 AC_SUBST(MY_CFLAGS)
185
186 dnl Define a few things to retarget the library towards
187 dnl embedded Java.
188 AC_DEFINE(SILENT)
189 AC_DEFINE(NO_SIGNALS)
190 AC_DEFINE(NO_DEBUGGING)
191 AC_DEFINE(JAVA_FINALIZATION)
192
193 dnl Create boehm-config.h so that libjava can find it.
194 dnl It is required to use gc_priv.h, which is required to write
195 dnl a new marking function.  So config.h in this package is
196 dnl poorly named.
197 AC_LINK_FILES(config.h, boehm-config.h)
198
199 dnl This is something of a hack.  When cross-compiling we turn off
200 dnl some functionality.  We also enable the "small" configuration.
201 dnl These is only correct when targetting an embedded system.  FIXME.
202 if test -n "${with_cross_host}"; then
203    AC_DEFINE(NO_SIGSET)
204    AC_DEFINE(NO_CLOCK)
205    AC_DEFINE(SMALL_CONFIG)
206 fi
207
208 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
209
210 if test "${multilib}" = "yes"; then
211   multilib_arg="--enable-multilib"
212 else
213   multilib_arg=
214 fi
215
216 AC_OUTPUT(Makefile,
217 [
218 dnl Put all the -D options in a file.  These are required before
219 dnl boehm-config.h can be included.  This is a huge hack brought
220 dnl about by overall poor structuring of this entire library.
221 echo "$DEFS" > boehm-cflags
222
223 if test -n "$CONFIG_FILES"; then
224   ac_file=Makefile . ${boehm_gc_basedir}/../config-ml.in
225 fi],
226 srcdir=${srcdir}
227 host=${host}
228 target=${target}
229 with_multisubdir=${with_multisubdir}
230 ac_configure_args="${multilib_arg} ${ac_configure_args}"
231 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
232 boehm_gc_basedir=${boehm_gc_basedir}
233 CC="${CC}"
234 DEFS="$DEFS"
235 )