blob: f3c7c5b16aef220c943640b89d0a96200d496872 [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
Kaveh R. Ghazi223a8841998-11-23 13:51:40 +000022AC_PREREQ(2.12.1)
Jeffrey A Law789eb4f1998-09-30 08:17:56 +000023AC_INIT(objc/objc.h)
Ben Ellistonbce1b481998-09-30 02:13:15 +000024#AC_CONFIG_HEADER(config.h)
25
26if test "${srcdir}" = "." ; then
27 if test "${with_target_subdir}" != "." ; then
28 topsrcdir=${with_multisrctop}../..
29 else
30 topsrcdir=${with_multisrctop}..
31 fi
32else
33 topsrcdir=${srcdir}/..
34fi
Kaveh R. Ghazi8a829fd1998-10-22 11:39:46 +000035dnl This is needed for a multilibbed build in the source tree so
36dnl that install-sh and config.sub get found.
37AC_CONFIG_AUX_DIR($topsrcdir)
Ben Ellistonbce1b481998-09-30 02:13:15 +000038
39dnl Checks for programs.
40# For ObjC we'll set CC to point at the built gcc, but this will get it into
41# the makefiles
42AC_PROG_CC
43
44test "$AR" || AR=ar
45AC_SUBST(AR)
46if test "$RANLIB"; then :
47 AC_SUBST(RANLIB)
48else
49 AC_PROG_RANLIB
50fi
51AC_PROG_INSTALL
52
53dnl Checks for libraries.
54
55dnl Checks for header files.
56# Sanity check for the cross-compilation case:
57AC_CHECK_HEADER(stdio.h,:,
58 [AC_MSG_ERROR([Can't find stdio.h.
59You must have a usable C system for the target already installed, at least
60including headers and, preferably, the library, before you can configure
61the Objective C runtime system. If necessary, install gcc now with
62\`LANGUAGES=c', then the target library, then build with \`LANGUAGES=objc'.])])
63
64AC_HEADER_STDC
65
66# Determine the name of the GCC thread file.
67
Robert Lipe4102f621998-10-01 21:35:22 +000068dir=`pwd`
69if test x"${with_multisubdir}" = "x" ; then
70 gccobjdir=`echo $dir/../../gcc`
71else
72 gccobjdir=`echo $dir | sed -e s:${with_multisubdir}::`/../../gcc
73fi
74
Ben Ellistonbce1b481998-09-30 02:13:15 +000075AC_CACHE_CHECK([for thread file],objc_cv_thread_file,
Robert Lipe4102f621998-10-01 21:35:22 +000076[if test -f $gccobjdir/Makefile
Ben Ellistonbce1b481998-09-30 02:13:15 +000077then
Robert Lipe4102f621998-10-01 21:35:22 +000078 objc_cv_thread_file=`grep \^GCC_THREAD_FILE $gccobjdir/Makefile | awk -F= '{ print $2 }'`
Ben Ellistonbce1b481998-09-30 02:13:15 +000079else
80 AC_MSG_ERROR([not found])
81fi])
82OBJC_THREAD_FILE=$objc_cv_thread_file
83AC_SUBST(OBJC_THREAD_FILE)
84
85AC_ARG_ENABLE(objc-gc,
86[ --enable-objc-gc enable the use of Boehm's garbage collector with
87 the GNU Objective-C runtime.],
88if [[[ x$enable_objc_gc = xno ]]]; then
89 OBJC_BOEHM_GC=''
90else
91 OBJC_BOEHM_GC=libobjc_gc.a
92fi,
93OBJC_BOEHM_GC='')
94AC_SUBST(OBJC_BOEHM_GC)
95
96
97# We need multilib support, but only if configuring for the target.
98AC_OUTPUT(Makefile,
99[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
100if test -n "$CONFIG_FILES"; then
101 if test -n "${with_target_subdir}"; then
102 # FIXME: We shouldn't need to set ac_file
103 ac_file=Makefile
104 . ${topsrcdir}/config-ml.in
105 fi
106fi],
107srcdir=${srcdir}
108host=${host}
109target=${target}
110with_target_subdir=${with_target_subdir}
111with_multisubdir=${with_multisubdir}
112ac_configure_args="--enable-multilib ${ac_configure_args}"
113CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
114topsrcdir=${topsrcdir}
115)
116
117dnl Local Variables:
118dnl comment-start: "dnl "
119dnl comment-end: ""
120dnl comment-start-skip: "\\bdnl\\b\\s *"
121dnl End: