blob: d5cdc6a5289dbfd6ae353ecca8d2f389c7d55a5b [file] [log] [blame]
Ben Ellistonbce1b481998-09-30 02:13:15 +00001# Process this file with autoconf to produce a configure script.
2# Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
3# Contributed by Dave Love (d.love@dl.ac.uk).
4#
5#This file is part of GNU Objective C.
6#
7#GNU Objective C is free software; you can redistribute it and/or modify
8#it under the terms of the GNU General Public License as published by
9#the Free Software Foundation; either version 2, or (at your option)
10#any later version.
11#
12#GNU Objective C is distributed in the hope that it will be useful,
13#but WITHOUT ANY WARRANTY; without even the implied warranty of
14#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15#GNU General Public License for more details.
16#
17#You should have received a copy of the GNU General Public License
18#along with GNU Objective C; see the file COPYING. If not, write to
19#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20#02111-1307, USA.
21
Jeffrey A Law789eb4f1998-09-30 08:17:56 +000022AC_INIT(objc/objc.h)
Ben Ellistonbce1b481998-09-30 02:13:15 +000023#AC_CONFIG_HEADER(config.h)
24
25if test "${srcdir}" = "." ; then
26 if test "${with_target_subdir}" != "." ; then
27 topsrcdir=${with_multisrctop}../..
28 else
29 topsrcdir=${with_multisrctop}..
30 fi
31else
32 topsrcdir=${srcdir}/..
33fi
Kaveh R. Ghazi8a829fd1998-10-22 11:39:46 +000034dnl This is needed for a multilibbed build in the source tree so
35dnl that install-sh and config.sub get found.
36AC_CONFIG_AUX_DIR($topsrcdir)
Ben Ellistonbce1b481998-09-30 02:13:15 +000037
38dnl Checks for programs.
39# For ObjC we'll set CC to point at the built gcc, but this will get it into
40# the makefiles
41AC_PROG_CC
42
43test "$AR" || AR=ar
44AC_SUBST(AR)
45if test "$RANLIB"; then :
46 AC_SUBST(RANLIB)
47else
48 AC_PROG_RANLIB
49fi
50AC_PROG_INSTALL
51
52dnl Checks for libraries.
53
54dnl Checks for header files.
55# Sanity check for the cross-compilation case:
56AC_CHECK_HEADER(stdio.h,:,
57 [AC_MSG_ERROR([Can't find stdio.h.
58You must have a usable C system for the target already installed, at least
59including headers and, preferably, the library, before you can configure
60the Objective C runtime system. If necessary, install gcc now with
61\`LANGUAGES=c', then the target library, then build with \`LANGUAGES=objc'.])])
62
63AC_HEADER_STDC
64
65# Determine the name of the GCC thread file.
66
Robert Lipe4102f621998-10-01 21:35:22 +000067dir=`pwd`
68if test x"${with_multisubdir}" = "x" ; then
69 gccobjdir=`echo $dir/../../gcc`
70else
71 gccobjdir=`echo $dir | sed -e s:${with_multisubdir}::`/../../gcc
72fi
73
Ben Ellistonbce1b481998-09-30 02:13:15 +000074AC_CACHE_CHECK([for thread file],objc_cv_thread_file,
Robert Lipe4102f621998-10-01 21:35:22 +000075[if test -f $gccobjdir/Makefile
Ben Ellistonbce1b481998-09-30 02:13:15 +000076then
Robert Lipe4102f621998-10-01 21:35:22 +000077 objc_cv_thread_file=`grep \^GCC_THREAD_FILE $gccobjdir/Makefile | awk -F= '{ print $2 }'`
Ben Ellistonbce1b481998-09-30 02:13:15 +000078else
79 AC_MSG_ERROR([not found])
80fi])
81OBJC_THREAD_FILE=$objc_cv_thread_file
82AC_SUBST(OBJC_THREAD_FILE)
83
84AC_ARG_ENABLE(objc-gc,
85[ --enable-objc-gc enable the use of Boehm's garbage collector with
86 the GNU Objective-C runtime.],
87if [[[ x$enable_objc_gc = xno ]]]; then
88 OBJC_BOEHM_GC=''
89else
90 OBJC_BOEHM_GC=libobjc_gc.a
91fi,
92OBJC_BOEHM_GC='')
93AC_SUBST(OBJC_BOEHM_GC)
94
95
96# We need multilib support, but only if configuring for the target.
97AC_OUTPUT(Makefile,
98[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
99if test -n "$CONFIG_FILES"; then
100 if test -n "${with_target_subdir}"; then
101 # FIXME: We shouldn't need to set ac_file
102 ac_file=Makefile
103 . ${topsrcdir}/config-ml.in
104 fi
105fi],
106srcdir=${srcdir}
107host=${host}
108target=${target}
109with_target_subdir=${with_target_subdir}
110with_multisubdir=${with_multisubdir}
111ac_configure_args="--enable-multilib ${ac_configure_args}"
112CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
113topsrcdir=${topsrcdir}
114)
115
116dnl Local Variables:
117dnl comment-start: "dnl "
118dnl comment-end: ""
119dnl comment-start-skip: "\\bdnl\\b\\s *"
120dnl End: