]> git.ipfire.org Git - thirdparty/gcc.git/blame - libobjc/configure.ac
* decl.c (expand_static_init): Avoid bogus warnings.
[thirdparty/gcc.git] / libobjc / configure.ac
CommitLineData
bce1b489 1# Process this file with autoconf to produce a configure script.
9c01f395 2# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004
3343fdd2 3# Free Software Foundation, Inc.
9c01f395 4# Originally contributed by Dave Love (d.love@dl.ac.uk).
bce1b489 5#
9c01f395 6#This file is part of GCC.
bce1b489 7#
9c01f395 8#GCC is free software; you can redistribute it and/or modify
bce1b489
BE
9#it under the terms of the GNU General Public License as published by
10#the Free Software Foundation; either version 2, or (at your option)
11#any later version.
12#
9c01f395 13#GCC is distributed in the hope that it will be useful,
bce1b489
BE
14#but WITHOUT ANY WARRANTY; without even the implied warranty of
15#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16#GNU General Public License for more details.
17#
18#You should have received a copy of the GNU General Public License
9c01f395 19#along with GCC; see the file COPYING. If not, write to
bce1b489
BE
20#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
21#02111-1307, USA.
22
88386050 23AC_PREREQ(2.59)
684c64bf 24AC_INIT(package-unused, version-unused,, libobjc)
252dde64 25AC_CONFIG_SRCDIR([objc/objc.h])
bce1b489 26
252dde64 27# We need the following definitions because AC_PROG_LIBTOOL relies on them
1fcfac98 28PACKAGE=libobjc
252dde64 29# Version is pulled out to make it a bit easier to change using sed.
1fcfac98
NN
30VERSION=1:0:0
31AC_SUBST(VERSION)
32
6706f116
AO
33# This works around the fact that libtool configuration may change LD
34# for this particular configuration, but some shells, instead of
35# keeping the changes in LD private, export them just because LD is
36# exported.
37ORIGINAL_LD_FOR_MULTILIBS=$LD
38
252dde64
NN
39# -------
40# Options
41# -------
42
43# Default to --enable-multilib
9c01f395
NN
44AC_ARG_ENABLE(multilib,
45 [ --enable-multilib build hella library versions (default)],
46 [case "${enableval}" in
47 yes) multilib=yes ;;
48 no) multilib=no ;;
49 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
252dde64
NN
50 esac],
51 [multilib=yes])
52
53# We use these options to decide which functions to include.
54AC_ARG_WITH(target-subdir,
55[ --with-target-subdir=SUBDIR
56 configuring in a subdirectory])
57AC_ARG_WITH(cross-host,
58[ --with-cross-host=HOST configuring with a cross compiler])
59
60AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
61AC_ARG_ENABLE(version-specific-runtime-libs,
62[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
63[case "$enableval" in
64 yes) version_specific_libs=yes ;;
65 no) version_specific_libs=no ;;
66 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
67 esac],
68[version_specific_libs=no])
69AC_MSG_RESULT($version_specific_libs)
70
71AC_ARG_ENABLE(objc-gc,
72[ --enable-objc-gc enable the use of Boehm's garbage collector with
73 the GNU Objective-C runtime.],
74[case $enable_objc_gc in
75 no) OBJC_BOEHM_GC='' ;;
76 *) OBJC_BOEHM_GC=libobjc_gc.la ;;
77esac],
78[OBJC_BOEHM_GC=''])
79AC_SUBST(OBJC_BOEHM_GC)
80
81# -----------
82# Directories
83# -----------
9c01f395
NN
84
85# When building with srcdir == objdir, links to the source files will
86# be created in directories within the target_subdir. We have to
87# adjust toplevel_srcdir accordingly, so that configure finds
88# install-sh and other auxiliary files that live in the top-level
89# source directory.
90if test "${srcdir}" = "."; then
91 if test -z "${with_target_subdir}"; then
92 toprel=".."
93 else
94 if test "${with_target_subdir}" != "."; then
95 toprel="${with_multisrctop}../.."
96 else
97 toprel="${with_multisrctop}.."
98 fi
99 fi
100else
101 toprel=".."
102fi
103AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
88386050 104toplevel_srcdir=\${srcdir}/$toprel
9c01f395 105AC_SUBST(toplevel_srcdir)
aebb8c22 106
b150efee 107AC_CANONICAL_SYSTEM
9c01f395
NN
108_GCC_TOPLEV_NONCANONICAL_TARGET
109AC_SUBST(target_noncanonical)
110
af0c82b3 111# Export source directory.
9c01f395
NN
112# These need to be absolute paths, yet at the same time need to
113# canonicalize only relative paths, because then amd will not unmount
114# drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
9c01f395 115case $srcdir in
252dde64
NN
116 [\\/$]* | ?:[\\/]*) glibcpp_srcdir=${srcdir} ;;
117 *) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
9c01f395 118esac
9c01f395
NN
119AC_SUBST(glibcpp_srcdir)
120
9c01f395 121# Process the option "--enable-version-specific-runtime-libs"
9c01f395
NN
122gcc_version_trigger=${srcdir}/../gcc/version.c
123gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'`
124gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
125AC_SUBST(gcc_version)
9c01f395 126
608e1e0c 127# Calculate toolexeclibdir
a42a57cb 128# Also toolexecdir, though it's only used in toolexeclibdir
9c01f395
NN
129case ${version_specific_libs} in
130 yes)
131 # Need the gcc compiler version to know where to install libraries
132 # and header files if --enable-version-specific-runtime-libs option
133 # is selected.
a42a57cb 134 toolexecdir='$(libdir)/gcc/$(target_noncanonical)'
608e1e0c 135 toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
9c01f395
NN
136 ;;
137 no)
138 if test -n "$with_cross_host" &&
139 test x"$with_cross_host" != x"no"; then
9c01f395 140 # Install a library built with a cross compiler in tooldir, not libdir.
a42a57cb 141 toolexecdir='$(exec_prefix)/$(target_noncanonical)'
608e1e0c
NN
142 toolexeclibdir='$(toolexecdir)/lib'
143 else
a42a57cb 144 toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
608e1e0c 145 toolexeclibdir='$(libdir)'
9c01f395
NN
146 fi
147 multi_os_directory=`$CC -print-multi-os-directory`
148 case $multi_os_directory in
149 .) ;; # Avoid trailing /.
608e1e0c 150 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
9c01f395
NN
151 esac
152 ;;
153esac
a42a57cb 154AC_SUBST(toolexecdir)
608e1e0c 155AC_SUBST(toolexeclibdir)
9c01f395 156
ff65de76
AP
157# Figure out if we want to name the include directory and the
158# library name changes differently.
7d34a5a9 159includedirname=include
ff65de76
AP
160libext=
161case "${host}" in
162 *-darwin*)
163 # Darwin is the only target so far that needs a different include directory.
7d34a5a9 164 includedirname=include-gnu-runtime
ff65de76
AP
165 libext=-gnu
166 ;;
167esac
7d34a5a9 168AC_SUBST(includedirname)
ff65de76
AP
169AC_SUBST(libext)
170
252dde64
NN
171# --------
172# Programs
173# --------
174
175GCC_NO_EXECUTABLES
db7f3c69
NN
176
177# We must force CC to /not/ be a precious variable; otherwise
178# the wrong, non-multilib-adjusted value will be used in multilibs.
179# As a side effect, we have to subst CFLAGS ourselves.
180m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
181m4_define([_AC_ARG_VAR_PRECIOUS],[])
252dde64 182AC_PROG_CC
db7f3c69
NN
183m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
184
185AC_SUBST(CFLAGS)
252dde64
NN
186
187AC_CHECK_TOOL(AS, as)
188AC_CHECK_TOOL(AR, ar)
189AC_CHECK_TOOL(RANLIB, ranlib, :)
190AC_PROG_INSTALL
7c6b0e92 191
9c01f395
NN
192# Enable Win32 DLL on MS Windows - FIXME
193AC_LIBTOOL_WIN32_DLL
7c6b0e92 194
b150efee 195AC_PROG_LIBTOOL
bce1b489 196
b150efee 197AC_PROG_MAKE_SET
bce1b489 198
252dde64
NN
199# -------
200# Headers
201# -------
202
bce1b489
BE
203# Sanity check for the cross-compilation case:
204AC_CHECK_HEADER(stdio.h,:,
205 [AC_MSG_ERROR([Can't find stdio.h.
206You must have a usable C system for the target already installed, at least
207including headers and, preferably, the library, before you can configure
208the Objective C runtime system. If necessary, install gcc now with
209\`LANGUAGES=c', then the target library, then build with \`LANGUAGES=objc'.])])
210
211AC_HEADER_STDC
212
d972a4c2
OP
213AC_CHECK_HEADERS(sched.h)
214
252dde64
NN
215# -----------
216# Miscellanea
217# -----------
218
15794a95 219# Determine CFLAGS for gthread.
b43e7294
NN
220# FIXME: the current implementation is dependent on the 'r' variable
221# passed down from the top level
15794a95 222AC_CACHE_CHECK([for gthread cflags],objc_cv_gthread_flags,
79014e6f 223[if test -f "$r"/gcc/Makefile
bce1b489 224then
15794a95 225 objc_cv_gthread_flags=`grep \^GTHREAD_FLAGS "$r"/gcc/Makefile | awk -F= '{ print $2 }'`
bce1b489
BE
226else
227 AC_MSG_ERROR([not found])
228fi])
15794a95
L
229GTHREAD_FLAGS=$objc_cv_gthread_flags
230AC_SUBST(GTHREAD_FLAGS)
bce1b489 231
252dde64
NN
232# ------
233# Output
234# ------
bce1b489 235
252dde64
NN
236AC_CONFIG_FILES([Makefile])
237
238AC_CONFIG_COMMANDS([default],
608e1e0c 239[[if test -n "$CONFIG_FILES"; then
bce1b489
BE
240 if test -n "${with_target_subdir}"; then
241 # FIXME: We shouldn't need to set ac_file
242 ac_file=Makefile
6706f116 243 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
b150efee 244 . ${toplevel_srcdir}/config-ml.in
bce1b489 245 fi
252dde64
NN
246fi]],
247[[srcdir=${srcdir}
bce1b489
BE
248host=${host}
249target=${target}
250with_target_subdir=${with_target_subdir}
251with_multisubdir=${with_multisubdir}
252ac_configure_args="--enable-multilib ${ac_configure_args}"
b150efee 253toplevel_srcdir=${toplevel_srcdir}
bce1b489 254CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
3343fdd2 255ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
252dde64
NN
256]])
257
258AC_OUTPUT