1995-05-05 21:22:44 +00:00
|
|
|
AC_INIT(src/Collection.m)
|
1994-11-04 16:29:24 +00:00
|
|
|
|
|
|
|
# configure.in for GNU Objective-C library
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
#
|
1996-01-05 22:35:03 +00:00
|
|
|
# Copyright (C) 1993,1994, 1995, 1996 Free Software Foundation, Inc.
|
1994-11-04 16:29:24 +00:00
|
|
|
#
|
|
|
|
# Written by: R. Andrew McCallum <mccallum@cs.rochester.edu>
|
|
|
|
# Dept. of Computer Science, U. of Rochester, Rochester, NY 14627
|
|
|
|
#
|
|
|
|
# This file is part of the GNU Objective-C library.
|
|
|
|
#
|
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU Library General Public
|
|
|
|
# License as published by the Free Software Foundation; either
|
|
|
|
# version 2 of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This library is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# Library General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Library General Public
|
|
|
|
# License along with this library; if not, write to the Free
|
|
|
|
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# Find the compiler
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CPP
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# Find out if we\'re using NeXT\'s compiler.
|
|
|
|
# if yes:
|
|
|
|
# add -cpp-traditional to CPP
|
|
|
|
# if no:
|
|
|
|
# include implementations of List, HashTable etc. objects
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
AC_MSG_CHECKING(whether we are using NeXT's compiler)
|
1996-01-05 22:35:03 +00:00
|
|
|
AC_TRY_CPP([#include "$srcdir/config/config.nextcc.h"], NeXTCC=0, NeXTCC=1)
|
1994-11-04 16:29:24 +00:00
|
|
|
# Was using this too: -o `basename $CC` = "gcc" -o `basename $CC` = "xgcc"
|
|
|
|
if test $NeXTCC = 0; then
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
#----------------------------------------------------------------
|
|
|
|
# Find out if nested functions work on this machine
|
|
|
|
#----------------------------------------------------------------
|
|
|
|
AC_C_CROSS
|
|
|
|
AC_MSG_CHECKING(whether nested functions work)
|
1996-01-05 22:35:03 +00:00
|
|
|
AC_TRY_RUN([#include "$srcdir/config/config.nested.c"],
|
1995-05-05 22:42:07 +00:00
|
|
|
gcc_nested=1, gcc_nested=0,
|
1994-11-04 16:29:24 +00:00
|
|
|
gcc_nested=1)
|
|
|
|
if test $gcc_nested = 0; then
|
|
|
|
echo "aborting"
|
|
|
|
echo
|
|
|
|
echo "The GCC 'nested functions' feature does not seem to be working on"
|
|
|
|
echo "this machine. Libobjects makes extensive use of nested functions."
|
|
|
|
echo "Read the bug-report instructions in the GCC texinfo manual"
|
|
|
|
echo "and submit a bug report."
|
|
|
|
echo "The program this configure script used to test nested functions"
|
1995-05-05 22:42:07 +00:00
|
|
|
echo "can be found in the file 'config/config.nested.c' in this"
|
1994-11-04 16:29:24 +00:00
|
|
|
echo "distribution. Under sparc-sun-sunos4.1.3 with gcc-2.6.1 the"
|
|
|
|
echo "file compiles, runs and returns exit status 0."
|
|
|
|
exit
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
fi
|
|
|
|
#----------------------------------------------------------------
|
|
|
|
# Find out if we're on a NEXTSTEP machine
|
|
|
|
#----------------------------------------------------------------
|
|
|
|
AC_MSG_CHECKING(whether we are running under NEXTSTEP)
|
|
|
|
AC_TRY_CPP([#if defined(NeXT)
|
|
|
|
#error
|
|
|
|
#endif], NeXTSTEP=0, NeXTSTEP=1)
|
|
|
|
if test $NeXTSTEP = 0; then
|
|
|
|
AC_MSG_RESULT(no)
|
1995-05-19 15:24:47 +00:00
|
|
|
OBJS_INSTALL='$(GNU_OBJS) $(NEXTSTEP_OBJS) $(GNUSTEP_OBJS)'
|
|
|
|
HEADERS_INSTALL='$(GNU_HEADERS) $(NEXTSTEP_HEADERS) $(GNUSTEP_HEADERS)'
|
1994-11-04 16:29:24 +00:00
|
|
|
NEXT_INCLUDES='$(OBJECTS_NEXT_INCLUDES)'
|
|
|
|
NeXT_runtime=0
|
|
|
|
NeXT_cc=0
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
#----------------------------------------------------------------
|
|
|
|
# Find out if we are using NeXT or GNU runtime
|
|
|
|
#----------------------------------------------------------------
|
|
|
|
saved_ac_ext=$ac_ext
|
|
|
|
ac_ext=m
|
|
|
|
AC_MSG_CHECKING(whether we are using GNU Objective C runtime)
|
1996-01-05 22:35:03 +00:00
|
|
|
AC_TRY_LINK([#include "$srcdir/config/config.nextrt.m"], ;,
|
1994-11-04 16:29:24 +00:00
|
|
|
NeXT_runtime=1, NeXT_runtime=0)
|
|
|
|
ac_ext=$saved_ac_ext
|
|
|
|
if test $NeXT_runtime = 1; then
|
|
|
|
AC_MSG_RESULT(no: NeXT runtime)
|
|
|
|
LIBOBJC=''
|
|
|
|
CC="$CC -fnext-runtime"
|
|
|
|
# Make sure that we get NeXTs objc/*.h files
|
|
|
|
NEXT_INCLUDES='$(NEXT_NEXT_INCLUDES)'
|
1995-05-19 15:24:47 +00:00
|
|
|
OBJS_INSTALL='$(GNU_OBJS)'
|
|
|
|
HEADERS_INSTALL='$(GNU_HEADERS)'
|
1994-11-04 16:29:24 +00:00
|
|
|
NeXT_cc=0
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
LIBOBJC='-lobjc'
|
|
|
|
CC="$CC -fgnu-runtime"
|
|
|
|
# Get objc/List.h, etc. files from libobjects.
|
|
|
|
NEXT_INCLUDES='$(OBJECTS_NEXT_INCLUDES)'
|
1996-01-19 16:37:32 +00:00
|
|
|
OBJS_INSTALL='$(GNU_OBJS) $(NEXTSTEP_OBJS) $(GNUSTEP_OBJS)'
|
1995-05-19 15:24:47 +00:00
|
|
|
HEADERS_INSTALL='$(GNU_HEADERS) $(NEXTSTEP_HEADERS) $(GNUSTEP_HEADERS)'
|
1994-11-04 16:29:24 +00:00
|
|
|
NeXT_cc=0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
#----------------------------------------------------------------
|
|
|
|
# Find out if we have sel_types_match
|
|
|
|
# (i.e. the necessary patch has been applied)
|
|
|
|
#----------------------------------------------------------------
|
|
|
|
if test $NeXT_runtime = 0; then
|
|
|
|
AC_CHECK_LIB(objc, main, HAVE_LIBOBJC=1, HAVE_LIBOBJC=0)
|
|
|
|
if test $HAVE_LIBOBJC = 0; then
|
|
|
|
AC_MSG_ERROR(Couldn't find GCC Objective C runtime library, libobjc.a)
|
|
|
|
else
|
|
|
|
LIBS="$LIBS -lobjc"
|
|
|
|
fi
|
|
|
|
AC_CHECK_FUNC(sel_types_match, have_sel=1, have_sel=0)
|
|
|
|
if test $have_sel = 0; then
|
|
|
|
AC_MSG_ERROR(Could not find sel_types_match in libobjc.a.
|
|
|
|
GCC version less than 2.6.1?)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_MSG_ERROR(Sorry, libobjects does not currently work with NeXT's cc; use gcc)
|
|
|
|
#----------------------------------------------------------------
|
|
|
|
# Find out if we have NEXTSTEP 3.2 or lower
|
|
|
|
#----------------------------------------------------------------
|
|
|
|
AC_CHECKING(NEXTSTEP version)
|
|
|
|
AC_TRY_CPP([#if NX_CURRENT_COMPILER_RELEASE < 320
|
|
|
|
#error
|
|
|
|
#endif], NeXT32plus=1, NeXT32plus=0)
|
|
|
|
if test $NeXT32plus = 0; then
|
|
|
|
echo "aborting"
|
|
|
|
echo
|
|
|
|
echo "It looks like your compiler is NEXTSTEP 3.2 or earlier."
|
|
|
|
echo "Libobjects makes extensive use of nested functions. In 3.2,"
|
|
|
|
echo "NeXT's cc did not support nested functions. To compile libobjects"
|
|
|
|
echo "you can either (1) use gcc instead of NeXT's cc (no loss, since"
|
|
|
|
echo "gcc can compile AppKit programs without problems), or (2) upgrade"
|
|
|
|
echo "to the later release of NEXTSTEP when it is available."
|
|
|
|
exit
|
|
|
|
fi
|
1995-05-19 15:24:47 +00:00
|
|
|
OBJS_INSTALL='$(GNU_OBJS)'
|
|
|
|
HEADERS_INSTALL='$(GNU_HEADERS)'
|
1994-11-04 16:29:24 +00:00
|
|
|
LIBOBJC=''
|
|
|
|
NeXT_runtime=1
|
|
|
|
NeXT_cc=1
|
|
|
|
# NeXT default cpp doesn't accept nested functions
|
|
|
|
CC='cc -traditional-cpp'
|
|
|
|
fi
|
1995-05-19 15:24:47 +00:00
|
|
|
AC_SUBST(OBJS_INSTALL)
|
|
|
|
AC_SUBST(HEADERS_INSTALL)
|
1994-11-04 16:29:24 +00:00
|
|
|
AC_SUBST(LIBOBJC)
|
|
|
|
AC_SUBST(NeXT_runtime)
|
|
|
|
AC_SUBST(NeXT_cc)
|
|
|
|
AC_SUBST(NEXT_INCLUDES)
|
|
|
|
|
1995-04-03 22:22:07 +00:00
|
|
|
#--------------------------------------------------------------------
|
1995-09-12 22:30:13 +00:00
|
|
|
# Setup dynamic linking
|
1995-04-03 22:22:07 +00:00
|
|
|
#--------------------------------------------------------------------
|
1995-09-12 22:30:13 +00:00
|
|
|
OBJC_SYS_DYNAMIC_FLAGS()
|
1995-04-03 22:22:07 +00:00
|
|
|
|
1994-11-04 16:29:24 +00:00
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# Find some programs
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_RANLIB
|
1995-04-03 22:22:07 +00:00
|
|
|
AC_LN_S
|
1994-11-04 16:29:24 +00:00
|
|
|
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# Following header checks needed for bzero in Storage.m and other places
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
AC_HEADER_STDC
|
|
|
|
AC_CHECK_HEADERS(string.h memory.h)
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# These two headers (functions) needed by Time.m
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
dnl AC_REPLACE_FUNCS(getrusage gettimeofday)
|
|
|
|
AC_CHECK_HEADER(sys/time.h, TIME_H=1, TIME_H=0)
|
|
|
|
AC_CHECK_HEADER(sys/resource.h, RESOURCE_H=1, RESOURCE_H=0)
|
|
|
|
|
|
|
|
if test TIME_H = 0 -o RESOURCE_H = 0 ; then
|
|
|
|
AC_MSG_ERROR(Could not find headers needed by class Time)
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(sys/rusage.h ucbinclude/sys/resource.h)
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# These headers/functions needed by SocketPort.m
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
AC_CHECK_HEADER(sys/socket.h, SOCKET_H=1, SOCKET_H=0)
|
|
|
|
AC_CHECK_HEADER(netinet/in.h, IN_H=1, IN_H=0)
|
|
|
|
dnl AC_REPLACE_FUNCS(recvfrom)
|
|
|
|
|
|
|
|
if test SOCKET_H = 0 -o IN_H = 0 ; then
|
|
|
|
AC_MSG_ERROR(Could not find headers needed by class SocketPort)
|
|
|
|
fi
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------
|
1995-03-31 15:30:28 +00:00
|
|
|
# This function needed by StdioStream.m
|
1994-11-04 16:29:24 +00:00
|
|
|
#--------------------------------------------------------------------
|
|
|
|
AC_CHECK_FUNCS(vsprintf)
|
|
|
|
|
1995-03-31 15:30:28 +00:00
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# This function needed by objc-malloc.c
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
AC_CHECK_FUNCS(valloc)
|
|
|
|
|
1995-03-31 15:34:32 +00:00
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# This function needed by Time.m
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
AC_CHECK_FUNCS(times)
|
|
|
|
|
1996-01-24 03:24:33 +00:00
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# This function needed by NSString for handling of %@ printf directive.
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
AC_CHECK_FUNCS(register_printf_function)
|
|
|
|
|
1994-11-04 16:29:24 +00:00
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# These libraries needed by the check programs for distributed objects
|
|
|
|
# on Solaris where the socket/network code isn't the regular place. Yuck!
|
|
|
|
# I'm assuming that if the socket/network code is in the regular place,
|
|
|
|
# we won't find these libraries, or if we do find them, they aren't
|
|
|
|
# something weird I wouldn't want to link with.
|
|
|
|
# It's just for the programs in "checks" and "examples" anyway; it
|
|
|
|
# doesn't affect the compilation of libobjects.
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
AC_CHECK_LIB(socket, main)
|
|
|
|
AC_CHECK_LIB(nsl, main)
|
|
|
|
|
1995-11-07 02:20:11 +00:00
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# Make a shared library?
|
|
|
|
#--------------------------------------------------------------------
|
1996-01-08 16:05:50 +00:00
|
|
|
AC_ARG_ENABLE(shared, Build libobjects as a shared library,
|
1996-01-05 22:35:03 +00:00
|
|
|
LIBOBJECTS_SO='libobjects.so.$(OBJECTS_VERSION)',
|
|
|
|
LIBOBJECTS_SO=)
|
|
|
|
AC_SUBST(LIBOBJECTS_SO)
|
1995-11-07 02:20:11 +00:00
|
|
|
|
1994-11-04 16:29:24 +00:00
|
|
|
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# Write the Makefiles
|
|
|
|
#--------------------------------------------------------------------
|
1995-08-09 16:18:04 +00:00
|
|
|
AC_OUTPUT(Makefile src/Makefile checks/Makefile examples/Makefile
|
|
|
|
doc/Makefile NSCharacterSets/Makefile admin/Makefile src/objects/config.h)
|