OSDN Git Service

* combine.c (combine_instructions): Add missing argument
[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  decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
88     AC_MSG_ERROR(thread package $THREADS not yet supported)
89     ;;
90  *)
91     AC_MSG_ERROR($THREADS is an unknown thread package)
92     ;;
93 esac
94 AC_MSG_RESULT($THREADS)
95 AC_SUBST(THREADLIB)
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_mach_dep.s assumes that pointers are not saved in fp registers.
138 # Gcc on a 21264 can spill pointers to fp registers.  Oops.
139 # alpha*-*-*)
140 #    machdep="alpha_mach_dep.lo"
141 #    ;;
142  mipstx39-*-elf*)
143     machdep="mips_ultrix_mach_dep.lo"
144     AC_DEFINE(STACKBASE, __stackbase)
145     AC_DEFINE(DATASTART_IS_ETEXT)
146     ;;
147  mips-dec-ultrix*)
148     machdep="mips_ultrix_mach-dep.lo"
149     ;;
150  mips-*-*)
151     machdep="mips_sgi_mach_dep.lo"
152     AC_DEFINE(NO_EXECUTE_PERMISSION)
153     ;;
154  sparc-sun-solaris2.3*)
155     AC_DEFINE(SUNOS53_SHARED_LIB)
156     ;;
157 esac
158 if test x"$machdep" = x; then
159    machdep="mach_dep.lo"
160 fi
161 addobjs="$addobjs $machdep"
162 AC_SUBST(addobjs)
163
164 dnl As of 4.13a2, the collector will not properly work on Solaris when
165 dnl built with gcc and -O.  So we remove -O in the appropriate case.
166 case "$host" in
167  sparc-sun-solaris2*)
168     if test "$GCC" = yes; then
169        new_CFLAGS=
170        for i in $CFLAGS; do
171           case "$i" in
172            -O*)
173               ;;
174            *)
175               new_CFLAGS="$new_CFLAGS $i"
176               ;;
177           esac
178        done
179        CFLAGS="$new_CFLAGS"
180     fi
181     ;;
182 esac
183
184 dnl We need to override the top-level CFLAGS.  This is how we do it.
185 MY_CFLAGS="$CFLAGS"
186 AC_SUBST(MY_CFLAGS)
187
188 dnl Define a few things to retarget the library towards
189 dnl embedded Java.
190 AC_DEFINE(SILENT)
191 AC_DEFINE(NO_SIGNALS)
192 AC_DEFINE(NO_DEBUGGING)
193 AC_DEFINE(JAVA_FINALIZATION)
194
195 dnl This is something of a hack.  When cross-compiling we turn off
196 dnl some functionality.  We also enable the "small" configuration.
197 dnl These is only correct when targetting an embedded system.  FIXME.
198 if test -n "${with_cross_host}"; then
199    AC_DEFINE(NO_SIGSET)
200    AC_DEFINE(NO_CLOCK)
201    AC_DEFINE(SMALL_CONFIG)
202 fi
203
204 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
205
206 if test "${multilib}" = "yes"; then
207   multilib_arg="--enable-multilib"
208 else
209   multilib_arg=
210 fi
211
212 AC_OUTPUT(Makefile,
213 [
214 dnl Put all the -D options in a file.  These are required before
215 dnl boehm-config.h can be included.  This is a huge hack brought
216 dnl about by overall poor structuring of this entire library.
217 echo "$DEFS" > boehm-cflags
218
219 if test -n "$CONFIG_FILES"; then
220   ac_file=Makefile . ${boehm_gc_basedir}/../config-ml.in
221 fi],
222 srcdir=${srcdir}
223 host=${host}
224 target=${target}
225 with_multisubdir=${with_multisubdir}
226 ac_configure_args="${multilib_arg} ${ac_configure_args}"
227 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
228 boehm_gc_basedir=${boehm_gc_basedir}
229 CC="${CC}"
230 DEFS="$DEFS"
231 )