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