]> git.ipfire.org Git - thirdparty/gcc.git/blame - libobjc/configure.in
configure.in: Switch to modern style for AC_INIT, AC_OUTPUT.
[thirdparty/gcc.git] / libobjc / configure.in
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)
252dde64
NN
24AC_INIT
25AC_CONFIG_SRCDIR([objc/objc.h])
d972a4c2 26AC_CONFIG_HEADER(config.h)
bce1b489 27
252dde64 28# We need the following definitions because AC_PROG_LIBTOOL relies on them
1fcfac98 29PACKAGE=libobjc
252dde64 30# Version is pulled out to make it a bit easier to change using sed.
1fcfac98
NN
31VERSION=1:0:0
32AC_SUBST(VERSION)
33
6706f116
AO
34# This works around the fact that libtool configuration may change LD
35# for this particular configuration, but some shells, instead of
36# keeping the changes in LD private, export them just because LD is
37# exported.
38ORIGINAL_LD_FOR_MULTILIBS=$LD
39
252dde64
NN
40# -------
41# Options
42# -------
43
44# Default to --enable-multilib
9c01f395
NN
45AC_ARG_ENABLE(multilib,
46 [ --enable-multilib build hella library versions (default)],
47 [case "${enableval}" in
48 yes) multilib=yes ;;
49 no) multilib=no ;;
50 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
252dde64
NN
51 esac],
52 [multilib=yes])
53
54# We use these options to decide which functions to include.
55AC_ARG_WITH(target-subdir,
56[ --with-target-subdir=SUBDIR
57 configuring in a subdirectory])
58AC_ARG_WITH(cross-host,
59[ --with-cross-host=HOST configuring with a cross compiler])
60
61AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
62AC_ARG_ENABLE(version-specific-runtime-libs,
63[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
64[case "$enableval" in
65 yes) version_specific_libs=yes ;;
66 no) version_specific_libs=no ;;
67 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
68 esac],
69[version_specific_libs=no])
70AC_MSG_RESULT($version_specific_libs)
71
72AC_ARG_ENABLE(objc-gc,
73[ --enable-objc-gc enable the use of Boehm's garbage collector with
74 the GNU Objective-C runtime.],
75[case $enable_objc_gc in
76 no) OBJC_BOEHM_GC='' ;;
77 *) OBJC_BOEHM_GC=libobjc_gc.la ;;
78esac],
79[OBJC_BOEHM_GC=''])
80AC_SUBST(OBJC_BOEHM_GC)
81
82# -----------
83# Directories
84# -----------
9c01f395
NN
85
86# When building with srcdir == objdir, links to the source files will
87# be created in directories within the target_subdir. We have to
88# adjust toplevel_srcdir accordingly, so that configure finds
89# install-sh and other auxiliary files that live in the top-level
90# source directory.
91if test "${srcdir}" = "."; then
92 if test -z "${with_target_subdir}"; then
93 toprel=".."
94 else
95 if test "${with_target_subdir}" != "."; then
96 toprel="${with_multisrctop}../.."
97 else
98 toprel="${with_multisrctop}.."
99 fi
100 fi
101else
102 toprel=".."
103fi
104AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
88386050 105toplevel_srcdir=\${srcdir}/$toprel
9c01f395 106AC_SUBST(toplevel_srcdir)
aebb8c22 107
b150efee 108AC_CANONICAL_SYSTEM
9c01f395
NN
109_GCC_TOPLEV_NONCANONICAL_TARGET
110AC_SUBST(target_noncanonical)
111
112# Export build and source directories.
113# These need to be absolute paths, yet at the same time need to
114# canonicalize only relative paths, because then amd will not unmount
115# drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
116glibcpp_builddir=`${PWDCMD-pwd}`
117case $srcdir in
252dde64
NN
118 [\\/$]* | ?:[\\/]*) glibcpp_srcdir=${srcdir} ;;
119 *) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
9c01f395
NN
120esac
121AC_SUBST(glibcpp_builddir)
122AC_SUBST(glibcpp_srcdir)
123
9c01f395 124# Process the option "--enable-version-specific-runtime-libs"
9c01f395
NN
125gcc_version_trigger=${srcdir}/../gcc/version.c
126gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'`
127gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
128AC_SUBST(gcc_version)
129AC_SUBST(gcc_version_trigger)
130
131# Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
132case ${version_specific_libs} in
133 yes)
134 # Need the gcc compiler version to know where to install libraries
135 # and header files if --enable-version-specific-runtime-libs option
136 # is selected.
137 glibcpp_toolexecdir='$(libdir)/gcc/$(target_noncanonical)'
138 glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
139 ;;
140 no)
141 if test -n "$with_cross_host" &&
142 test x"$with_cross_host" != x"no"; then
143 glibcpp_toolexecdir='$(exec_prefix)/$(target_noncanonical)'
144 glibcpp_toolexeclibdir='$(toolexecdir)/lib'
145 else
146 # Install a library built with a cross compiler in tooldir, not libdir.
147 glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
148 glibcpp_toolexeclibdir='$(libdir)'
149 fi
150 multi_os_directory=`$CC -print-multi-os-directory`
151 case $multi_os_directory in
152 .) ;; # Avoid trailing /.
153 *) glibcpp_toolexeclibdir=$glibcpp_toolexeclibdir/$multi_os_directory ;;
154 esac
155 ;;
156esac
157AC_SUBST(glibcpp_toolexecdir)
158AC_SUBST(glibcpp_toolexeclibdir)
159
160glibcpp_prefixdir=${prefix}
161AC_SUBST(glibcpp_prefixdir)
bce1b489 162
252dde64
NN
163# --------
164# Programs
165# --------
166
167GCC_NO_EXECUTABLES
168AC_PROG_CC
169
170AC_CHECK_TOOL(AS, as)
171AC_CHECK_TOOL(AR, ar)
172AC_CHECK_TOOL(RANLIB, ranlib, :)
173AC_PROG_INSTALL
7c6b0e92 174
b150efee
FS
175# Disable shared libs by default
176AC_DISABLE_SHARED
9c01f395
NN
177# Enable Win32 DLL on MS Windows - FIXME
178AC_LIBTOOL_WIN32_DLL
7c6b0e92 179
b150efee 180AC_PROG_LIBTOOL
bce1b489 181
b150efee 182AC_PROG_MAKE_SET
bce1b489 183
252dde64
NN
184# -------
185# Headers
186# -------
187
bce1b489
BE
188# Sanity check for the cross-compilation case:
189AC_CHECK_HEADER(stdio.h,:,
190 [AC_MSG_ERROR([Can't find stdio.h.
191You must have a usable C system for the target already installed, at least
192including headers and, preferably, the library, before you can configure
193the Objective C runtime system. If necessary, install gcc now with
194\`LANGUAGES=c', then the target library, then build with \`LANGUAGES=objc'.])])
195
196AC_HEADER_STDC
197
d972a4c2
OP
198AC_CHECK_HEADERS(sched.h)
199
252dde64
NN
200# -----------
201# Miscellanea
202# -----------
203
15794a95 204# Determine CFLAGS for gthread.
b43e7294
NN
205# FIXME: the current implementation is dependent on the 'r' variable
206# passed down from the top level
15794a95 207AC_CACHE_CHECK([for gthread cflags],objc_cv_gthread_flags,
79014e6f 208[if test -f "$r"/gcc/Makefile
bce1b489 209then
15794a95 210 objc_cv_gthread_flags=`grep \^GTHREAD_FLAGS "$r"/gcc/Makefile | awk -F= '{ print $2 }'`
bce1b489
BE
211else
212 AC_MSG_ERROR([not found])
213fi])
15794a95
L
214GTHREAD_FLAGS=$objc_cv_gthread_flags
215AC_SUBST(GTHREAD_FLAGS)
bce1b489 216
252dde64
NN
217# ------
218# Output
219# ------
bce1b489 220
252dde64
NN
221AC_CONFIG_FILES([Makefile])
222
223AC_CONFIG_COMMANDS([default],
224[[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
bce1b489
BE
225if test -n "$CONFIG_FILES"; then
226 if test -n "${with_target_subdir}"; then
227 # FIXME: We shouldn't need to set ac_file
228 ac_file=Makefile
6706f116 229 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
b150efee 230 . ${toplevel_srcdir}/config-ml.in
bce1b489 231 fi
252dde64
NN
232fi]],
233[[srcdir=${srcdir}
bce1b489
BE
234host=${host}
235target=${target}
236with_target_subdir=${with_target_subdir}
237with_multisubdir=${with_multisubdir}
238ac_configure_args="--enable-multilib ${ac_configure_args}"
b150efee 239toplevel_srcdir=${toplevel_srcdir}
bce1b489 240CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
3343fdd2 241ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
252dde64
NN
242]])
243
244AC_OUTPUT