OSDN Git Service

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