1996-02-13 08:29:09 -08:00
|
|
|
#! /bin/sh
|
|
|
|
|
1999-12-09 10:53:52 -08:00
|
|
|
#########################################################################
|
|
|
|
# #
|
|
|
|
# Objective Caml #
|
|
|
|
# #
|
|
|
|
# Xavier Leroy, projet Cristal, INRIA Rocquencourt #
|
|
|
|
# #
|
|
|
|
# Copyright 1999 Institut National de Recherche en Informatique et #
|
|
|
|
# en Automatique. All rights reserved. This file is distributed #
|
2001-12-07 05:41:02 -08:00
|
|
|
# under the terms of the GNU Library General Public License, with #
|
|
|
|
# the special exception on linking described in file LICENSE. #
|
1999-12-09 10:53:52 -08:00
|
|
|
# #
|
|
|
|
#########################################################################
|
1996-02-13 08:29:09 -08:00
|
|
|
|
1996-02-25 06:45:47 -08:00
|
|
|
# $Id$
|
1996-02-13 08:29:09 -08:00
|
|
|
|
2001-07-14 09:54:17 -07:00
|
|
|
configure_options="$*"
|
1999-03-10 01:51:16 -08:00
|
|
|
prefix=/usr/local
|
|
|
|
bindir=''
|
|
|
|
libdir=''
|
|
|
|
mandir=''
|
1996-02-13 08:29:09 -08:00
|
|
|
manext=1
|
|
|
|
host_type=unknown
|
2000-12-12 02:26:02 -08:00
|
|
|
ccoption=''
|
1996-02-13 08:29:09 -08:00
|
|
|
cclibs=''
|
2000-10-27 08:18:24 -07:00
|
|
|
curseslibs=''
|
1998-03-13 11:59:11 -08:00
|
|
|
mathlib='-lm'
|
2001-08-28 07:47:48 -07:00
|
|
|
dllib=''
|
1996-06-19 02:43:01 -07:00
|
|
|
x11_include_dir=''
|
|
|
|
x11_lib_dir=''
|
2001-10-04 01:39:49 -07:00
|
|
|
tk_wanted=yes
|
1999-11-30 08:07:38 -08:00
|
|
|
tk_defs=''
|
|
|
|
tk_libs=''
|
1997-10-24 08:49:12 -07:00
|
|
|
posix_threads=no
|
1999-11-30 08:07:38 -08:00
|
|
|
verbose=no
|
2000-10-27 08:18:24 -07:00
|
|
|
withcurses=yes
|
2001-08-28 07:47:48 -07:00
|
|
|
withsharedlibs=yes
|
1996-02-13 08:29:09 -08:00
|
|
|
|
1999-12-09 10:53:52 -08:00
|
|
|
gcc_warnings="-Wall -Wno-unused"
|
|
|
|
|
2001-12-07 06:23:01 -08:00
|
|
|
# Try to turn internationalization off, can cause config.guess to malfunction!
|
|
|
|
unset LANG
|
|
|
|
unset LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
# Parse command-line arguments
|
|
|
|
|
|
|
|
while : ; do
|
|
|
|
case "$1" in
|
|
|
|
"") break;;
|
1999-03-10 01:51:16 -08:00
|
|
|
-prefix|--prefix)
|
|
|
|
prefix=$2; shift;;
|
1997-10-24 08:49:12 -07:00
|
|
|
-bindir|--bindir)
|
|
|
|
bindir=$2; shift;;
|
|
|
|
-libdir|--libdir)
|
|
|
|
libdir=$2; shift;;
|
|
|
|
-mandir|--mandir)
|
|
|
|
mandir=$2
|
|
|
|
manext=`echo $mandir | sed -e 's/^.*\(.\)$/\1/'`
|
|
|
|
shift;;
|
|
|
|
-host*|--host*)
|
|
|
|
host_type=$2; shift;;
|
|
|
|
-cc*)
|
2000-12-12 02:26:02 -08:00
|
|
|
ccoption="$2"; shift;;
|
1997-10-24 08:49:12 -07:00
|
|
|
-lib*)
|
2000-10-27 08:18:24 -07:00
|
|
|
cclibs="$2 $cclibs"; shift;;
|
2001-08-28 07:47:48 -07:00
|
|
|
-no-curses)
|
|
|
|
withcurses=no;;
|
|
|
|
-no-shared-libs)
|
|
|
|
withsharedlibs=no;;
|
1997-10-24 08:49:12 -07:00
|
|
|
-x11include*|--x11include*)
|
|
|
|
x11_include_dir=$2; shift;;
|
|
|
|
-x11lib*|--x11lib*)
|
|
|
|
x11_lib_dir=$2; shift;;
|
1997-11-10 10:20:48 -08:00
|
|
|
-with-pthread*|--with-pthread*)
|
1997-10-24 08:49:12 -07:00
|
|
|
posix_threads=yes;;
|
2001-10-04 01:39:49 -07:00
|
|
|
-notk|--notk)
|
|
|
|
tk_wanted=no;;
|
1999-11-30 08:07:38 -08:00
|
|
|
-tkdefs*|--tkdefs*)
|
|
|
|
tk_defs=$2; shift;;
|
|
|
|
-tklibs*|--tklibs*)
|
|
|
|
tk_libs=$2; shift;;
|
|
|
|
-verbose|--verbose)
|
2000-01-07 07:50:42 -08:00
|
|
|
verbose=yes;;
|
1996-02-13 08:29:09 -08:00
|
|
|
*) echo "Unknown option \"$1\"." 1>&2; exit 2;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
1997-10-24 08:49:12 -07:00
|
|
|
# Sanity checks
|
|
|
|
|
1999-03-10 01:51:16 -08:00
|
|
|
case "$prefix" in
|
|
|
|
/*) ;;
|
|
|
|
*) echo "The -prefix directory must be absolute." 1>&2; exit 2;;
|
|
|
|
esac
|
1997-10-24 08:49:12 -07:00
|
|
|
case "$bindir" in
|
|
|
|
/*) ;;
|
1999-03-10 01:51:16 -08:00
|
|
|
"") ;;
|
1997-10-24 08:49:12 -07:00
|
|
|
*) echo "The -bindir directory must be absolute." 1>&2; exit 2;;
|
|
|
|
esac
|
|
|
|
case "$libdir" in
|
|
|
|
/*) ;;
|
1999-03-10 01:51:16 -08:00
|
|
|
"") ;;
|
1997-10-24 08:49:12 -07:00
|
|
|
*) echo "The -libdir directory must be absolute." 1>&2; exit 2;;
|
|
|
|
esac
|
|
|
|
case "$mandir" in
|
|
|
|
/*) ;;
|
1999-03-10 01:51:16 -08:00
|
|
|
"") ;;
|
1997-10-24 08:49:12 -07:00
|
|
|
*) echo "The -mandir directory must be absolute." 1>&2; exit 2;;
|
|
|
|
esac
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
# Generate the files
|
|
|
|
|
|
|
|
cd config/auto-aux
|
|
|
|
rm -f s.h m.h Makefile
|
|
|
|
touch s.h m.h Makefile
|
|
|
|
|
2001-02-21 19:37:29 -08:00
|
|
|
# Write options to Makefile
|
|
|
|
|
|
|
|
echo "# generated by ./configure $configure_options" >> Makefile
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
# Where to install
|
|
|
|
|
1999-03-10 01:51:16 -08:00
|
|
|
echo "PREFIX=$prefix" >> Makefile
|
|
|
|
case "$bindir" in
|
|
|
|
"") echo 'BINDIR=$(PREFIX)/bin' >> Makefile
|
|
|
|
bindir="$prefix/bin";;
|
|
|
|
*) echo "BINDIR=$bindir" >> Makefile;;
|
|
|
|
esac
|
|
|
|
case "$libdir" in
|
|
|
|
"") echo 'LIBDIR=$(PREFIX)/lib/ocaml' >> Makefile
|
|
|
|
libdir="$prefix/lib/ocaml";;
|
|
|
|
*) echo "LIBDIR=$libdir" >> Makefile;;
|
|
|
|
esac
|
|
|
|
case "$mandir" in
|
|
|
|
"") echo 'MANDIR=$(PREFIX)/man/man1' >> Makefile
|
|
|
|
mandir="$prefix/man/man1";;
|
|
|
|
*) echo "MANDIR=$mandir" >> Makefile;;
|
|
|
|
esac
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "MANEXT=$manext" >> Makefile
|
|
|
|
|
|
|
|
# Determine the system type
|
|
|
|
|
1996-02-25 06:45:47 -08:00
|
|
|
if test "$host_type" = "unknown"; then
|
2001-06-25 07:40:07 -07:00
|
|
|
if host_type=`../gnu/config.guess`; then :; else
|
1996-02-25 06:45:47 -08:00
|
|
|
echo "Cannot guess host type"
|
|
|
|
echo "You must specify one with the -host option"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
fi
|
2001-06-25 07:40:07 -07:00
|
|
|
if host=`../gnu/config.sub $host_type`; then :; else
|
1996-02-25 06:45:47 -08:00
|
|
|
echo "Please specify the correct host type with the -host option"
|
|
|
|
exit 2
|
|
|
|
fi
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "Configuring for a $host ..."
|
|
|
|
|
|
|
|
# Do we have gcc?
|
|
|
|
|
2000-12-12 02:26:02 -08:00
|
|
|
if test -z "$ccoption"; then
|
1996-02-13 08:29:09 -08:00
|
|
|
if sh ./searchpath gcc; then
|
|
|
|
echo "gcc found"
|
|
|
|
cc=gcc
|
|
|
|
else
|
|
|
|
cc=cc
|
|
|
|
fi
|
2000-12-12 02:26:02 -08:00
|
|
|
else
|
|
|
|
cc="$ccoption"
|
1996-02-13 08:29:09 -08:00
|
|
|
fi
|
|
|
|
|
1997-03-21 02:44:35 -08:00
|
|
|
# Check for buggy versions of GCC
|
|
|
|
|
1997-08-22 01:52:38 -07:00
|
|
|
case "$host,$cc" in
|
|
|
|
i[3456]86-*-*,gcc*)
|
1997-03-21 02:44:35 -08:00
|
|
|
case `$cc --version` in
|
1997-08-22 01:52:38 -07:00
|
|
|
2.7.2.1) cat <<'EOF'
|
|
|
|
|
|
|
|
WARNING: you are using gcc version 2.7.2.1 on an Intel x86 processor.
|
|
|
|
This version of gcc is known to generate incorrect code for the
|
|
|
|
Objective Caml runtime system on some Intel x86 machines. (The symptom
|
|
|
|
is a crash of boot/ocamlc when compiling stdlib/pervasives.mli.)
|
|
|
|
In particular, the version of gcc 2.7.2.1 that comes with
|
|
|
|
Linux RedHat 4.x / Intel is affected by this problem.
|
|
|
|
Other Linux distributions might also be affected.
|
|
|
|
If you are using one of these configurations, you are strongly advised
|
2000-03-25 10:54:03 -08:00
|
|
|
to use another version of gcc, such as 2.7.2.3 or 2.95, which are
|
1997-08-22 01:52:38 -07:00
|
|
|
known to work well with Objective Caml.
|
|
|
|
|
|
|
|
Press <enter> to proceed or <interrupt> to stop.
|
|
|
|
EOF
|
1997-03-21 02:44:35 -08:00
|
|
|
read reply;;
|
|
|
|
esac;;
|
|
|
|
esac
|
|
|
|
|
1997-03-11 01:25:23 -08:00
|
|
|
# Configure the bytecode compiler
|
1996-02-13 08:29:09 -08:00
|
|
|
|
1997-03-11 01:25:23 -08:00
|
|
|
bytecc="$cc"
|
|
|
|
bytecccompopts=""
|
|
|
|
bytecclinkopts=""
|
2000-08-10 07:41:24 -07:00
|
|
|
ostype="Unix"
|
2000-08-10 02:58:08 -07:00
|
|
|
exe=""
|
1996-02-13 08:29:09 -08:00
|
|
|
|
1997-03-11 01:25:23 -08:00
|
|
|
case "$bytecc,$host" in
|
1997-05-13 07:02:58 -07:00
|
|
|
cc,*-*-nextstep*)
|
1997-03-11 01:25:23 -08:00
|
|
|
# GNU C extensions disabled, but __GNUC__ still defined!
|
1999-12-09 10:53:52 -08:00
|
|
|
bytecccompopts="-fno-defer-pop $gcc_warnings -U__GNUC__ -posix"
|
1997-03-11 01:25:23 -08:00
|
|
|
bytecclinkopts="-posix";;
|
2001-12-04 02:54:14 -08:00
|
|
|
*,*-*-rhapsody*)
|
1998-03-13 11:59:11 -08:00
|
|
|
# Almost the same as NeXTStep
|
1999-12-09 10:53:52 -08:00
|
|
|
bytecccompopts="-fno-defer-pop $gcc_warnings -DSHRINKED_GNUC"
|
1998-03-13 11:59:11 -08:00
|
|
|
mathlib="";;
|
2001-12-04 02:54:14 -08:00
|
|
|
*,*-*-darwin*)
|
|
|
|
# Almost the same as rhapsody
|
|
|
|
bytecccompopts="-fno-defer-pop $gcc_warnings"
|
|
|
|
mathlib="";;
|
1999-05-18 11:46:17 -07:00
|
|
|
*,*-*-beos*)
|
1999-12-09 10:53:52 -08:00
|
|
|
bytecccompopts="-fno-defer-pop $gcc_warnings"
|
1999-05-18 11:46:17 -07:00
|
|
|
# No -lm library
|
|
|
|
mathlib="";;
|
2001-07-02 04:35:04 -07:00
|
|
|
gcc,alpha*-*-osf*)
|
1999-12-09 10:53:52 -08:00
|
|
|
bytecccompopts="-fno-defer-pop $gcc_warnings"
|
2000-07-27 04:12:54 -07:00
|
|
|
if cc="$bytecc" sh ./hasgot -mieee; then
|
|
|
|
bytecccompopts="-mieee $bytecccompopts";
|
|
|
|
fi
|
2000-03-10 06:30:16 -08:00
|
|
|
# Put code and static data in lower 4GB
|
|
|
|
bytecclinkopts="-Wl,-T,12000000 -Wl,-D,14000000"
|
|
|
|
# Tell gcc that we can use 32-bit code addresses for threaded code
|
|
|
|
echo "#define ARCH_CODE32" >> m.h;;
|
2001-07-02 04:35:04 -07:00
|
|
|
cc,alpha*-*-osf*)
|
2000-07-27 04:03:20 -07:00
|
|
|
bytecccompopts="-std1 -ieee";;
|
2001-11-23 06:55:25 -08:00
|
|
|
gcc,alpha*-*-linux*)
|
|
|
|
if cc="$bytecc" sh ./hasgot -mieee; then
|
|
|
|
bytecccompopts="-mieee $bytecccompopts";
|
|
|
|
fi;;
|
1997-03-21 02:44:35 -08:00
|
|
|
cc,mips-*-irix6*)
|
1999-03-09 02:02:40 -08:00
|
|
|
# Add -n32 flag to ensure compatibility with native-code compiler
|
|
|
|
bytecccompopts="-n32"
|
1997-03-11 01:25:23 -08:00
|
|
|
# Turn off warning "unused library"
|
1999-03-09 02:02:40 -08:00
|
|
|
bytecclinkopts="-n32 -Wl,-woff,84";;
|
1997-03-21 02:44:35 -08:00
|
|
|
cc*,mips-*-irix6*)
|
1997-12-02 05:04:03 -08:00
|
|
|
# (For those who want to force "cc -64")
|
1997-03-11 01:25:23 -08:00
|
|
|
# Turn off warning "unused library"
|
|
|
|
bytecclinkopts="-Wl,-woff,84";;
|
2001-06-25 07:40:07 -07:00
|
|
|
*,alpha*-*-unicos*)
|
1998-06-23 09:47:02 -07:00
|
|
|
# For the Cray T3E
|
|
|
|
bytecccompopts="-DUMK";;
|
2000-03-17 08:45:18 -08:00
|
|
|
gcc*,powerpc-*-aix4.3*)
|
|
|
|
# Avoid name-space pollution by requiring Unix98-conformant includes
|
|
|
|
bytecccompopts="-fno-defer-pop $gcc_warnings -D_XOPEN_SOURCE=500";;
|
|
|
|
*,powerpc-*-aix4.3*)
|
|
|
|
bytecccompopts="-D_XOPEN_SOURCE=500";;
|
2000-08-10 02:58:08 -07:00
|
|
|
gcc*,*-*-cygwin*)
|
|
|
|
bytecccompopts="-fno-defer-pop $gcc_warnings -U_WIN32"
|
|
|
|
exe=".exe"
|
|
|
|
ostype="Cygwin";;
|
2000-03-17 08:45:18 -08:00
|
|
|
gcc*)
|
|
|
|
bytecccompopts="-fno-defer-pop $gcc_warnings";;
|
1997-03-11 01:25:23 -08:00
|
|
|
esac
|
|
|
|
|
|
|
|
# Configure compiler to use in further tests
|
|
|
|
|
2001-08-03 05:35:49 -07:00
|
|
|
cc="$bytecc -O $bytecclinkopts"
|
1999-11-30 08:07:38 -08:00
|
|
|
export cc cclibs verbose
|
1996-02-13 08:29:09 -08:00
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
# Check C compiler
|
|
|
|
|
|
|
|
sh ./runtest ansi.c
|
|
|
|
case $? in
|
|
|
|
0) echo "The C compiler is ANSI-compliant.";;
|
|
|
|
1) echo "The C compiler $cc is not ANSI-compliant."
|
|
|
|
echo "You need an ANSI C compiler to build Objective Caml."
|
|
|
|
exit 2;;
|
1999-05-18 11:46:17 -07:00
|
|
|
*) echo "Unable to compile the test program."
|
1997-09-02 05:55:01 -07:00
|
|
|
echo "Make sure the C compiler $cc is properly installed."
|
|
|
|
exit 2;;
|
|
|
|
esac
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
# Check the sizes of data types
|
|
|
|
|
|
|
|
echo "Checking the sizes of integers and pointers..."
|
1997-04-11 07:27:45 -07:00
|
|
|
set `sh ./runtest sizes.c`
|
1998-06-23 06:39:54 -07:00
|
|
|
case "$2,$3" in
|
|
|
|
4,4) echo "OK, this is a regular 32 bit architecture."
|
|
|
|
echo "#undef ARCH_SIXTYFOUR" >> m.h;;
|
|
|
|
8,8) echo "Wow! A 64 bit architecture!"
|
2000-03-10 06:30:16 -08:00
|
|
|
echo "#define ARCH_SIXTYFOUR" >> m.h;;
|
1998-06-23 06:39:54 -07:00
|
|
|
*,8) echo "Wow! A 64 bit architecture!"
|
|
|
|
echo "Unfortunately, Objective Caml cannot work in the case"
|
|
|
|
echo "sizeof(long) != sizeof(long *)."
|
|
|
|
echo "Objective Caml won't run on this architecture."
|
|
|
|
exit 2;;
|
|
|
|
*,*) echo "This architecture seems to be neither 32 bits nor 64 bits."
|
|
|
|
echo "Objective Caml won't run on this architecture."
|
|
|
|
exit 2;;
|
|
|
|
*) echo "Unable to compile the test program."
|
|
|
|
echo "Make sure the C compiler $cc is properly installed."
|
|
|
|
exit 2;;
|
1996-02-13 08:29:09 -08:00
|
|
|
esac
|
1998-06-23 06:39:54 -07:00
|
|
|
if test $1 != 4 && test $2 != 4 && test $4 != 4; then
|
|
|
|
echo "Sorry, we can't find a 32-bit integer type"
|
|
|
|
echo "(sizeof(short) = $4, sizeof(int) = $1, sizeof(long) = $2)"
|
|
|
|
echo "Objective Caml won't run on this architecture."
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "#define SIZEOF_INT $1" >> m.h
|
|
|
|
echo "#define SIZEOF_LONG $2" >> m.h
|
|
|
|
echo "#define SIZEOF_SHORT $4" >> m.h
|
1996-02-13 08:29:09 -08:00
|
|
|
|
2000-02-14 05:23:00 -08:00
|
|
|
if test $2 = 8; then
|
2000-02-11 07:47:09 -08:00
|
|
|
echo "#define ARCH_INT64_TYPE long" >> m.h
|
|
|
|
echo "#define ARCH_UINT64_TYPE unsigned long" >> m.h
|
|
|
|
echo '#define ARCH_INT64_PRINTF_FORMAT "l"' >> m.h
|
2000-03-10 09:36:31 -08:00
|
|
|
int64_supported=true
|
2000-02-11 07:47:09 -08:00
|
|
|
else
|
2000-02-11 04:03:31 -08:00
|
|
|
sh ./runtest longlong.c
|
|
|
|
case $? in
|
2001-07-14 09:54:17 -07:00
|
|
|
0) echo "64-bit \"long long\" integer type found (printf with \"%ll\")."
|
2000-02-11 07:47:09 -08:00
|
|
|
echo "#define ARCH_INT64_TYPE long long" >> m.h
|
|
|
|
echo "#define ARCH_UINT64_TYPE unsigned long long" >> m.h
|
2000-03-10 09:36:31 -08:00
|
|
|
echo '#define ARCH_INT64_PRINTF_FORMAT "ll"' >> m.h
|
|
|
|
int64_supported=true;;
|
2001-07-14 09:54:17 -07:00
|
|
|
1) echo "64-bit \"long long\" integer type found (printf with \"%q\")."
|
2001-03-07 07:34:00 -08:00
|
|
|
echo "#define ARCH_INT64_TYPE long long" >> m.h
|
|
|
|
echo "#define ARCH_UINT64_TYPE unsigned long long" >> m.h
|
|
|
|
echo '#define ARCH_INT64_PRINTF_FORMAT "q"' >> m.h
|
|
|
|
int64_supported=true;;
|
2000-02-11 04:03:31 -08:00
|
|
|
*) echo "No suitable 64-bit integer type found, Int64.t will not be supported."
|
2000-03-10 09:36:31 -08:00
|
|
|
int64_supported=false;;
|
2000-02-11 04:03:31 -08:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
# Determine endianness
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
sh ./runtest endian.c
|
1996-02-13 08:29:09 -08:00
|
|
|
case $? in
|
|
|
|
0) echo "This is a big-endian architecture."
|
1996-07-01 05:43:28 -07:00
|
|
|
echo "#define ARCH_BIG_ENDIAN" >> m.h;;
|
1996-02-13 08:29:09 -08:00
|
|
|
1) echo "This is a little-endian architecture."
|
1996-07-01 05:43:28 -07:00
|
|
|
echo "#undef ARCH_BIG_ENDIAN" >> m.h;;
|
1996-02-13 08:29:09 -08:00
|
|
|
2) echo "This architecture seems to be neither big endian nor little endian."
|
1996-04-30 07:53:58 -07:00
|
|
|
echo "Objective Caml won't run on this architecture."
|
1996-02-13 08:29:09 -08:00
|
|
|
exit 2;;
|
|
|
|
*) echo "Something went wrong during endianness determination."
|
|
|
|
echo "You'll have to figure out endianness yourself"
|
1996-07-01 05:43:28 -07:00
|
|
|
echo "(option ARCH_BIG_ENDIAN in m.h).";;
|
1996-02-13 08:29:09 -08:00
|
|
|
esac
|
|
|
|
|
|
|
|
# Determine alignment constraints
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
sh ./runtest dblalign.c
|
1996-02-13 08:29:09 -08:00
|
|
|
case $? in
|
1996-02-15 08:19:09 -08:00
|
|
|
0) echo "Doubles can be word-aligned."
|
1996-07-01 05:43:28 -07:00
|
|
|
echo "#undef ARCH_ALIGN_DOUBLE" >> m.h;;
|
1996-02-13 08:29:09 -08:00
|
|
|
1) echo "Doubles must be doubleword-aligned."
|
1996-07-01 05:43:28 -07:00
|
|
|
echo "#define ARCH_ALIGN_DOUBLE" >> m.h;;
|
1996-02-13 08:29:09 -08:00
|
|
|
*) echo "Something went wrong during alignment determination for doubles."
|
|
|
|
echo "I'm going to assume this architecture has alignment constraints over doubles."
|
1996-04-30 07:53:58 -07:00
|
|
|
echo "That's a safe bet: Objective Caml will work even if"
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "this architecture has actually no alignment constraints."
|
1996-07-01 05:43:28 -07:00
|
|
|
echo "#define ARCH_ALIGN_DOUBLE" >> m.h;;
|
1996-02-13 08:29:09 -08:00
|
|
|
esac
|
|
|
|
|
2000-03-10 09:36:31 -08:00
|
|
|
if $int64_supported; then
|
|
|
|
sh ./runtest int64align.c
|
|
|
|
case $? in
|
|
|
|
0) echo "64-bit integers can be word-aligned."
|
|
|
|
echo "#undef ARCH_ALIGN_INT64" >> m.h;;
|
|
|
|
1) echo "64-bit integers must be doubleword-aligned."
|
|
|
|
echo "#define ARCH_ALIGN_INT64" >> m.h;;
|
|
|
|
*) echo "Something went wrong during alignment determination for 64-bit integers."
|
|
|
|
echo "I'm going to assume this architecture has alignment constraints."
|
|
|
|
echo "That's a safe bet: Objective Caml will work even if"
|
|
|
|
echo "this architecture has actually no alignment constraints."
|
|
|
|
echo "#define ARCH_ALIGN_INT64" >> m.h;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2001-11-27 02:17:36 -08:00
|
|
|
# Check semantics of division and modulus
|
|
|
|
|
|
|
|
sh ./runtest divmod.c
|
|
|
|
case $? in
|
|
|
|
0) echo "Native division and modulus have round-towards-zero semantics, will use them."
|
|
|
|
echo "#undef NONSTANDARD_DIV_MOD" >> m.h;;
|
|
|
|
1) echo "Native division and modulus do not have round-towards-zero semantics, will use software emulation."
|
|
|
|
echo "#define NONSTANDARD_DIV_MOD" >> m.h;;
|
|
|
|
*) echo "Something went wrong while checking native division and modulus, please report it."
|
|
|
|
echo "#define NONSTANDARD_DIV_MOD" >> m.h;;
|
|
|
|
esac
|
|
|
|
|
2001-08-28 07:47:48 -07:00
|
|
|
# Shared library support
|
|
|
|
|
|
|
|
shared_libraries_supported=false
|
|
|
|
sharedcccompopts=''
|
|
|
|
mksharedlib=''
|
|
|
|
byteccrpath=''
|
2001-10-30 01:32:32 -08:00
|
|
|
mksharedlibrpath=''
|
2001-08-28 07:47:48 -07:00
|
|
|
|
|
|
|
if test $withsharedlibs = "yes"; then
|
|
|
|
case "$host" in
|
|
|
|
*-*-linux-gnu|*-*-linux|*-*-freebsd[3-9]*)
|
|
|
|
sharedcccompopts="-fPIC"
|
|
|
|
mksharedlib="gcc -shared -o"
|
|
|
|
bytecclinkopts="$bytecclinkopts -Wl,-E"
|
|
|
|
byteccrpath="-Wl,-rpath,"
|
2001-10-30 01:32:32 -08:00
|
|
|
mksharedlibrpath="-Wl,-rpath,"
|
2001-08-28 07:47:48 -07:00
|
|
|
shared_libraries_supported=true;;
|
|
|
|
alpha*-*-osf*)
|
|
|
|
case "$bytecc" in
|
|
|
|
cc*) sharedcccompopts="";;
|
|
|
|
gcc*) sharedcccompopts="-fPIC";;
|
|
|
|
esac
|
|
|
|
mksharedlib="ld -shared -expect_unresolved '*' -o"
|
|
|
|
byteccrpath="-Wl,-rpath,"
|
2001-10-30 01:32:32 -08:00
|
|
|
mksharedlibrpath="-rpath "
|
2001-08-28 07:47:48 -07:00
|
|
|
shared_libraries_supported=true;;
|
2001-09-05 03:44:19 -07:00
|
|
|
*-*-solaris2*)
|
2001-08-28 07:47:48 -07:00
|
|
|
case "$bytecc" in
|
|
|
|
gcc*)
|
|
|
|
sharedcccompopts="-fPIC"
|
2001-10-25 04:31:12 -07:00
|
|
|
if sh ./solaris-ld; then
|
|
|
|
mksharedlib="$bytecc -shared -o"
|
2001-12-20 16:26:38 -08:00
|
|
|
byteccrpath="-R"
|
2001-10-30 01:32:32 -08:00
|
|
|
mksharedlibrpath="-R"
|
2001-09-05 03:44:19 -07:00
|
|
|
else
|
2001-10-25 04:31:12 -07:00
|
|
|
mksharedlib="$bytecc -shared -o"
|
|
|
|
bytecclinkopts="$bytecclinkopts -Wl,-E"
|
|
|
|
byteccrpath="-Wl,-rpath,"
|
2001-12-20 16:26:38 -08:00
|
|
|
mksharedlibrpath="-Wl,-rpath,"
|
2001-10-25 04:31:12 -07:00
|
|
|
fi
|
2001-09-05 03:44:19 -07:00
|
|
|
shared_libraries_supported=true;;
|
2001-08-28 07:47:48 -07:00
|
|
|
*)
|
|
|
|
sharedcccompopts="-KPIC"
|
2001-12-20 16:26:38 -08:00
|
|
|
byteccrpath="-R"
|
|
|
|
mksharedlibrpath="-R"
|
2001-08-28 07:47:48 -07:00
|
|
|
mksharedlib="/usr/ccs/bin/ld -G -o"
|
|
|
|
shared_libraries_supported=true;;
|
|
|
|
esac;;
|
|
|
|
mips-sgi-irix[56]*)
|
|
|
|
case "$bytecc" in
|
|
|
|
cc*) sharedcccompopts="";;
|
|
|
|
gcc*) sharedcccompopts="-fPIC";;
|
|
|
|
esac
|
|
|
|
mksharedlib="ld -shared -rdata_shared -o"
|
|
|
|
byteccrpath="-Wl,-rpath,"
|
2001-10-30 01:32:32 -08:00
|
|
|
mksharedlibrpath="-rpath "
|
2001-08-28 07:47:48 -07:00
|
|
|
shared_libraries_supported=true;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
if $shared_libraries_supported; then
|
|
|
|
echo "Dynamic loading of shared libraries is supported."
|
|
|
|
echo "#define SUPPORT_DYNAMIC_LINKING" >> s.h
|
|
|
|
fi
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
# Configure the native-code compiler
|
|
|
|
|
|
|
|
arch=none
|
|
|
|
model=default
|
|
|
|
system=unknown
|
|
|
|
|
|
|
|
case "$host" in
|
2001-07-02 04:35:04 -07:00
|
|
|
alpha*-*-osf*) arch=alpha; system=digital;;
|
|
|
|
alpha*-*-linux*) arch=alpha; system=linux;;
|
|
|
|
alpha*-*-freebsd*) arch=alpha; system=freebsd;;
|
|
|
|
alpha*-*-netbsd*) arch=alpha; system=netbsd;;
|
|
|
|
alpha*-*-openbsd*) arch=alpha; system=openbsd;;
|
1996-02-13 08:29:09 -08:00
|
|
|
sparc-*-sunos4.*) arch=sparc; system=sunos;;
|
|
|
|
sparc-*-solaris2.*) arch=sparc; system=solaris;;
|
1996-04-18 09:27:16 -07:00
|
|
|
sparc-*-*bsd*) arch=sparc; system=bsd;;
|
2001-06-25 07:40:07 -07:00
|
|
|
sparc-*-linux*) arch=sparc; system=linux;;
|
1999-10-14 06:34:17 -07:00
|
|
|
i[3456]86-*-linux*) arch=i386; system=linux_`sh ./runtest elf.c`;;
|
|
|
|
i[3456]86-*-*bsd*) arch=i386; system=bsd_`sh ./runtest elf.c`;;
|
1996-02-13 08:29:09 -08:00
|
|
|
i[3456]86-*-nextstep*) arch=i386; system=nextstep;;
|
1996-09-18 06:24:56 -07:00
|
|
|
i[3456]86-*-solaris*) arch=i386; system=solaris;;
|
1999-05-18 11:46:17 -07:00
|
|
|
i[3456]86-*-beos*) arch=i386; system=beos;;
|
2000-08-10 02:58:08 -07:00
|
|
|
i[3456]86-*-cygwin*) arch=i386; system=cygwin;;
|
1997-03-21 02:44:35 -08:00
|
|
|
mips-*-irix6*) arch=mips; system=irix;;
|
1996-06-23 02:27:14 -07:00
|
|
|
hppa1.1-*-hpux*) arch=hppa; system=hpux;;
|
|
|
|
hppa1.1-*-nextstep*) arch=hppa; system=nextstep;;
|
1996-07-03 09:14:11 -07:00
|
|
|
rs6000-*-aix*) arch=power; model=rs6000; system=aix;;
|
|
|
|
powerpc-*-aix*) arch=power; model=ppc; system=aix;;
|
1996-07-03 11:39:36 -07:00
|
|
|
powerpc-*-linux*) arch=power; model=ppc; system=elf;;
|
1998-03-13 11:59:11 -08:00
|
|
|
powerpc-*-rhapsody*) arch=power; model=ppc; system=rhapsody;;
|
2001-08-02 01:59:52 -07:00
|
|
|
powerpc-*-darwin*) arch=power; model=ppc; system=rhapsody;;
|
2001-06-25 07:40:07 -07:00
|
|
|
arm*-*-linux*) arch=arm; system=linux;;
|
2000-06-30 09:37:42 -07:00
|
|
|
ia64-*-linux*) arch=ia64; system=linux;;
|
1996-02-13 08:29:09 -08:00
|
|
|
esac
|
|
|
|
|
2000-12-12 02:26:02 -08:00
|
|
|
if test -z "$ccoption"; then
|
|
|
|
case "$arch,$system,$cc" in
|
|
|
|
alpha,digital,gcc*) nativecc=cc;;
|
|
|
|
mips,*,gcc*) nativecc=cc;;
|
|
|
|
*) nativecc="$bytecc";;
|
|
|
|
esac
|
|
|
|
else
|
|
|
|
nativecc="$ccoption"
|
|
|
|
fi
|
1996-02-13 08:29:09 -08:00
|
|
|
|
1997-02-03 06:41:42 -08:00
|
|
|
nativecccompopts=''
|
|
|
|
nativecclinkopts=''
|
2001-08-28 07:47:48 -07:00
|
|
|
nativeccrpath="$byteccrpath"
|
1997-02-03 06:41:42 -08:00
|
|
|
|
2000-02-10 00:42:47 -08:00
|
|
|
case "$arch,$nativecc,$system,$host_type" in
|
|
|
|
alpha,cc*,digital,*) nativecccompopts=-std1;;
|
|
|
|
mips,cc*,irix,*) nativecccompopts=-n32
|
|
|
|
nativecclinkopts="-n32 -Wl,-woff,84";;
|
2000-03-17 08:45:18 -08:00
|
|
|
power,gcc*,aix,*aix4.3*)
|
|
|
|
nativecccompopts="$gcc_warnings -D_XOPEN_SOURCE=500";;
|
|
|
|
power,*,aix,*aix4.3*)
|
|
|
|
nativecccompopts="-D_XOPEN_SOURCE=500";;
|
2000-02-10 00:42:47 -08:00
|
|
|
*,*,nextstep,*) nativecccompopts="$gcc_warnings -U__GNUC__ -posix"
|
|
|
|
nativecclinkopts="-posix";;
|
2001-12-04 02:54:14 -08:00
|
|
|
# SHRINKED_GNUC is not necessary for MacOS 10.1 (don't know about 10.0)
|
|
|
|
# (but it doesn't matter much for native code anyway)
|
2000-02-10 00:42:47 -08:00
|
|
|
*,*,rhapsody,*) nativecccompopts="$gcc_warnings -DSHRINKED_GNUC";;
|
2001-12-04 02:54:14 -08:00
|
|
|
# *,*,rhapsody,*) nativecccompopts="$gcc_warnings";;
|
2000-08-10 02:58:08 -07:00
|
|
|
*,gcc*,cygwin,*) nativecccompopts="$gcc_warnings -U_WIN32";;
|
2000-02-10 00:42:47 -08:00
|
|
|
*,gcc*,*,*) nativecccompopts="$gcc_warnings";;
|
1996-02-13 08:29:09 -08:00
|
|
|
esac
|
|
|
|
|
1996-09-18 06:24:56 -07:00
|
|
|
asflags=''
|
|
|
|
aspp='$(AS)'
|
|
|
|
asppflags=''
|
1998-08-06 07:25:24 -07:00
|
|
|
asppprofflags='-DPROFILING'
|
1996-09-18 06:24:56 -07:00
|
|
|
|
|
|
|
case "$arch,$model,$system" in
|
1998-08-06 07:25:24 -07:00
|
|
|
alpha,*,digital) asflags='-O2'; asppflags='-O2 -DSYS_$(SYSTEM)';
|
|
|
|
asppprofflags='-pg -DPROFILING';;
|
1997-07-29 18:12:19 -07:00
|
|
|
alpha,*,linux) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
|
2000-02-29 08:15:40 -08:00
|
|
|
alpha,*,freebsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
|
1999-05-15 08:05:54 -07:00
|
|
|
alpha,*,netbsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
|
|
|
|
alpha,*,openbsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
|
1998-11-18 10:10:53 -08:00
|
|
|
mips,*,irix) asflags='-n32 -O2'; asppflags="$asflags";;
|
1996-09-18 06:24:56 -07:00
|
|
|
sparc,*,bsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
|
1998-05-11 07:57:23 -07:00
|
|
|
sparc,*,linux) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
|
1999-10-14 08:23:30 -07:00
|
|
|
sparc,*,*) case "$cc" in
|
|
|
|
gcc*) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
|
|
|
|
*) asppflags='-P -DSYS_$(SYSTEM)';;
|
|
|
|
esac;;
|
2001-02-22 01:16:55 -08:00
|
|
|
i386,*,solaris) # case "$cc" in
|
2001-02-21 19:37:29 -08:00
|
|
|
# Intel/solaris assembler doesn't like GNU cpp output
|
|
|
|
# gcc*) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
|
2001-02-22 01:16:55 -08:00
|
|
|
aspp='/usr/ccs/bin/as'; asppflags='-P -DSYS_$(SYSTEM)';;
|
1996-09-18 06:24:56 -07:00
|
|
|
i386,*,*) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
|
2000-02-10 00:42:47 -08:00
|
|
|
hppa,*,*) aspp="$cc"; asppflags='-traditional -c -DSYS_$(SYSTEM)';;
|
1996-09-18 06:24:56 -07:00
|
|
|
power,rs6000,aix) asflags='-u -m pwr -w'; asppflags="$asflags";;
|
|
|
|
power,ppc,aix) asflags='-u -m ppc -w'; asppflags="$asflags";;
|
|
|
|
power,*,elf) aspp='gcc'; asppflags='-c';;
|
1998-03-13 11:59:11 -08:00
|
|
|
power,*,rhapsody) ;;
|
1998-10-16 07:43:49 -07:00
|
|
|
arm,*,linux) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
|
2000-07-07 07:09:06 -07:00
|
|
|
ia64,*,linux) asflags=-xexplicit
|
2000-07-21 01:06:04 -07:00
|
|
|
aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM) -Wa,-xexplicit';;
|
1996-02-13 08:29:09 -08:00
|
|
|
esac
|
|
|
|
|
1998-11-06 07:39:18 -08:00
|
|
|
case "$arch,$model,$system" in
|
|
|
|
alpha,*,digital) profiling='prof';;
|
|
|
|
i386,*,linux_elf) profiling='prof';;
|
2000-02-29 08:15:40 -08:00
|
|
|
i386,*,bsd_elf) profiling='prof';;
|
1998-11-06 07:39:18 -08:00
|
|
|
*) profiling='noprof';;
|
|
|
|
esac
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
# Where is ranlib?
|
|
|
|
|
|
|
|
if sh ./searchpath ranlib; then
|
|
|
|
echo "ranlib found"
|
|
|
|
echo "RANLIB=ranlib" >> Makefile
|
1996-11-07 02:54:28 -08:00
|
|
|
echo "RANLIBCMD=ranlib" >> Makefile
|
1996-02-13 08:29:09 -08:00
|
|
|
else
|
|
|
|
echo "ranlib not used"
|
1996-11-07 02:54:28 -08:00
|
|
|
echo "RANLIB=ar rs" >> Makefile
|
|
|
|
echo "RANLIBCMD=" >> Makefile
|
1996-02-13 08:29:09 -08:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Do #! scripts work?
|
|
|
|
|
|
|
|
if (SHELL=/bin/sh; export SHELL; ./sharpbang > /dev/null); then
|
|
|
|
echo "#! appears to work in shell scripts"
|
1997-08-22 01:52:38 -07:00
|
|
|
case "$host" in
|
1998-10-29 07:54:13 -08:00
|
|
|
*-*-sunos*|*-*-unicos*)
|
|
|
|
echo "We won't use it, though, because under SunOS and Unicos it breaks"
|
1998-04-14 07:48:34 -07:00
|
|
|
echo "on pathnames longer than 30 characters"
|
|
|
|
echo "SHARPBANGSCRIPTS=false" >> Makefile;;
|
2000-08-10 02:58:08 -07:00
|
|
|
*-*-cygwin*)
|
|
|
|
echo "We won't use it, though, because of conflicts with .exe extension"
|
|
|
|
echo "under Cygwin"
|
|
|
|
echo "SHARPBANGSCRIPTS=false" >> Makefile;;
|
|
|
|
*)
|
|
|
|
echo "SHARPBANGSCRIPTS=true" >> Makefile;;
|
1997-08-22 01:52:38 -07:00
|
|
|
esac
|
1996-02-13 08:29:09 -08:00
|
|
|
else
|
|
|
|
echo "No support for #! in shell scripts"
|
|
|
|
echo "SHARPBANGSCRIPTS=false" >> Makefile
|
|
|
|
fi
|
|
|
|
|
2000-08-10 02:58:08 -07:00
|
|
|
# Write the OS type (Unix or Cygwin)
|
1996-10-06 09:36:37 -07:00
|
|
|
|
2000-08-10 02:58:08 -07:00
|
|
|
echo "#define OCAML_OS_TYPE \"$ostype\"" >> s.h
|
2001-08-28 07:47:48 -07:00
|
|
|
echo "#define OCAML_STDLIB_DIR \"$libdir\"" >> s.h
|
1996-10-06 09:36:37 -07:00
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
# Check the semantics of signal handlers
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot sigaction sigprocmask; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "POSIX signal handling found."
|
1999-11-16 01:49:12 -08:00
|
|
|
echo "#define POSIX_SIGNALS" >> s.h
|
1996-02-13 08:29:09 -08:00
|
|
|
else
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./runtest signals.c; then
|
1996-02-21 02:49:46 -08:00
|
|
|
echo "Signals have the BSD semantics."
|
|
|
|
echo "#define BSD_SIGNALS" >> s.h
|
|
|
|
else
|
|
|
|
echo "Signals have the System V semantics."
|
|
|
|
fi
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot sigsetmask; then
|
1996-02-21 02:49:46 -08:00
|
|
|
echo "sigsetmask() found"
|
|
|
|
echo "#define HAS_SIGSETMASK" >> s.h
|
|
|
|
fi
|
1996-02-13 08:29:09 -08:00
|
|
|
fi
|
|
|
|
|
|
|
|
# For the sys module
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot strerror; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "strerror() found."
|
|
|
|
echo "#define HAS_STRERROR" >> s.h
|
|
|
|
fi
|
|
|
|
|
1998-02-24 02:43:14 -08:00
|
|
|
if sh ./hasgot times; then
|
|
|
|
echo "times() found."
|
|
|
|
echo "#define HAS_TIMES" >> s.h
|
|
|
|
fi
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
# For the terminfo module
|
|
|
|
|
2000-10-27 08:18:24 -07:00
|
|
|
if test "$withcurses" = "yes"; then
|
2001-07-02 05:10:31 -07:00
|
|
|
for libs in "" "-lcurses" "-ltermcap" "-lcurses -ltermcap" "-lncurses"; do
|
2000-10-27 08:18:24 -07:00
|
|
|
if sh ./hasgot $libs tgetent tgetstr tgetnum tputs; then
|
|
|
|
echo "termcap functions found (with libraries '$libs')"
|
|
|
|
echo "#define HAS_TERMCAP" >> s.h
|
|
|
|
curseslibs="${libs}"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
1996-02-13 08:29:09 -08:00
|
|
|
|
1996-04-01 07:22:44 -08:00
|
|
|
# Configuration for the libraries
|
|
|
|
|
2000-02-25 05:43:57 -08:00
|
|
|
otherlibraries="unix str num dynlink bigarray"
|
1996-04-01 07:22:44 -08:00
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
# For the Unix library
|
|
|
|
|
1997-02-23 08:29:36 -08:00
|
|
|
has_sockets=no
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot socket socketpair bind listen accept connect; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "You have BSD sockets."
|
|
|
|
echo "#define HAS_SOCKETS" >> s.h
|
1997-02-23 08:29:36 -08:00
|
|
|
has_sockets=yes
|
1997-04-11 07:27:45 -07:00
|
|
|
elif sh ./hasgot -lnsl -lsocket socket socketpair bind listen accept connect; then
|
1997-07-30 05:23:13 -07:00
|
|
|
echo "You have BSD sockets (with libraries '-lnsl -lsocket')"
|
1996-02-13 08:29:09 -08:00
|
|
|
cclibs="$cclibs -lnsl -lsocket"
|
|
|
|
echo "#define HAS_SOCKETS" >> s.h
|
1997-02-23 08:29:36 -08:00
|
|
|
has_sockets=yes
|
1996-02-13 08:29:09 -08:00
|
|
|
fi
|
|
|
|
|
1999-12-17 04:42:16 -08:00
|
|
|
if sh ./hasgot -i sys/socket.h -t socklen_t; then
|
|
|
|
echo "socklen_t is defined in <sys/socket.h>"
|
|
|
|
echo "#define HAS_SOCKLEN_T" >> s.h
|
|
|
|
fi
|
|
|
|
|
2001-06-19 03:01:57 -07:00
|
|
|
if sh ./hasgot inet_aton; then
|
|
|
|
echo "inet_aton() found."
|
|
|
|
echo "#define HAS_INET_ATON" >> s.h
|
|
|
|
fi
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot -i unistd.h; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "unistd.h found."
|
|
|
|
echo "#define HAS_UNISTD" >> s.h
|
|
|
|
fi
|
|
|
|
|
2000-02-29 08:15:40 -08:00
|
|
|
if sh ./hasgot -i sys/types.h -i dirent.h; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "dirent.h found."
|
|
|
|
echo "#define HAS_DIRENT" >> s.h
|
|
|
|
fi
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot rewinddir; then
|
1996-06-25 02:27:34 -07:00
|
|
|
echo "rewinddir() found."
|
|
|
|
echo "#define HAS_REWINDDIR" >> s.h
|
|
|
|
fi
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot lockf; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "lockf() found."
|
|
|
|
echo "#define HAS_LOCKF" >> s.h
|
|
|
|
fi
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot mkfifo; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "mkfifo() found."
|
|
|
|
echo "#define HAS_MKFIFO" >> s.h
|
|
|
|
fi
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot getcwd; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "getcwd() found."
|
|
|
|
echo "#define HAS_GETCWD" >> s.h
|
|
|
|
fi
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot getwd; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "getwd() found."
|
|
|
|
echo "#define HAS_GETWD" >> s.h
|
|
|
|
fi
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot getpriority setpriority; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "getpriority() found."
|
|
|
|
echo "#define HAS_GETPRIORITY" >> s.h
|
|
|
|
fi
|
|
|
|
|
2000-02-29 08:15:40 -08:00
|
|
|
if sh ./hasgot -i sys/types.h -i utime.h && sh ./hasgot utime; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "utime() found."
|
|
|
|
echo "#define HAS_UTIME" >> s.h
|
|
|
|
fi
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot utimes; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "utimes() found."
|
|
|
|
echo "#define HAS_UTIMES" >> s.h
|
|
|
|
fi
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot dup2; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "dup2() found."
|
|
|
|
echo "#define HAS_DUP2" >> s.h
|
|
|
|
fi
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot fchmod fchown; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "fchmod() found."
|
|
|
|
echo "#define HAS_FCHMOD" >> s.h
|
|
|
|
fi
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot truncate ftruncate; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "truncate() found."
|
|
|
|
echo "#define HAS_TRUNCATE" >> s.h
|
|
|
|
fi
|
|
|
|
|
2000-08-08 05:37:53 -07:00
|
|
|
select_include=''
|
|
|
|
if sh ./hasgot -i sys/types.h -i sys/select.h; then
|
|
|
|
echo "sys/select.h found."
|
|
|
|
echo "#define HAS_SYS_SELECT_H" >> s.h
|
|
|
|
select_include='-i sys/select.h'
|
|
|
|
fi
|
|
|
|
|
1997-02-23 08:29:36 -08:00
|
|
|
has_select=no
|
2000-08-08 05:37:53 -07:00
|
|
|
if sh ./hasgot select && \
|
|
|
|
sh ./hasgot -i sys/types.h $select_include -t fd_set ; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "select() found."
|
|
|
|
echo "#define HAS_SELECT" >> s.h
|
1996-04-03 02:01:15 -08:00
|
|
|
has_select=yes
|
1996-02-13 08:29:09 -08:00
|
|
|
fi
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot symlink readlink lstat; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "symlink() found."
|
|
|
|
echo "#define HAS_SYMLINK" >> s.h
|
|
|
|
fi
|
|
|
|
|
1997-02-23 08:29:36 -08:00
|
|
|
has_wait=no
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot waitpid; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "waitpid() found."
|
|
|
|
echo "#define HAS_WAITPID" >> s.h
|
1996-06-25 02:27:34 -07:00
|
|
|
has_wait=yes
|
|
|
|
fi
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot wait4; then
|
1996-06-25 02:27:34 -07:00
|
|
|
echo "wait4() found."
|
|
|
|
echo "#define HAS_WAIT4" >> s.h
|
|
|
|
has_wait=yes
|
1996-02-13 08:29:09 -08:00
|
|
|
fi
|
|
|
|
|
2000-02-29 08:15:40 -08:00
|
|
|
if sh ./hasgot -i limits.h && sh ./runtest getgroups.c; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "getgroups() found."
|
|
|
|
echo "#define HAS_GETGROUPS" >> s.h
|
|
|
|
fi
|
|
|
|
|
2000-04-05 11:30:22 -07:00
|
|
|
if sh ./hasgot -i termios.h &&
|
1997-04-11 07:27:45 -07:00
|
|
|
sh ./hasgot tcgetattr tcsetattr tcsendbreak tcflush tcflow; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "POSIX termios found."
|
|
|
|
echo "#define HAS_TERMIOS" >> s.h
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Async I/O under OSF1 3.x are so buggy that the test program hangs...
|
|
|
|
testasyncio=true
|
|
|
|
if test -f /usr/bin/uname; then
|
1997-02-01 09:40:41 -08:00
|
|
|
case "`/usr/bin/uname -s -r`" in
|
1996-02-13 08:29:09 -08:00
|
|
|
"OSF1 V3."*) testasyncio=false;;
|
|
|
|
esac
|
|
|
|
fi
|
1997-04-11 07:27:45 -07:00
|
|
|
if $testasyncio && sh ./runtest async_io.c; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "Asynchronous I/O are supported."
|
|
|
|
echo "#define HAS_ASYNC_IO" >> s.h
|
|
|
|
fi
|
|
|
|
|
1997-02-23 08:29:36 -08:00
|
|
|
has_setitimer=no
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot setitimer; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "setitimer() found."
|
|
|
|
echo "#define HAS_SETITIMER" >> s.h
|
1996-04-03 02:01:15 -08:00
|
|
|
has_setitimer="yes"
|
1996-02-13 08:29:09 -08:00
|
|
|
fi
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot gethostname; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "gethostname() found."
|
|
|
|
echo "#define HAS_GETHOSTNAME" >> s.h
|
|
|
|
fi
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot -i sys/utsname.h && sh ./hasgot uname; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "uname() found."
|
|
|
|
echo "#define HAS_UNAME" >> s.h
|
|
|
|
fi
|
|
|
|
|
1997-02-23 08:29:36 -08:00
|
|
|
has_gettimeofday=no
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot gettimeofday; then
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "gettimeofday() found."
|
|
|
|
echo "#define HAS_GETTIMEOFDAY" >> s.h
|
1996-04-03 02:01:15 -08:00
|
|
|
has_gettimeofday="yes"
|
1996-02-13 08:29:09 -08:00
|
|
|
fi
|
|
|
|
|
1997-04-11 07:27:45 -07:00
|
|
|
if sh ./hasgot mktime; then
|
1996-06-24 09:35:58 -07:00
|
|
|
echo "mktime() found."
|
|
|
|
echo "#define HAS_MKTIME" >> s.h
|
|
|
|
fi
|
|
|
|
|
2000-08-10 02:58:08 -07:00
|
|
|
case "$host" in
|
|
|
|
*-*-cygwin*) ;; # setsid emulation under Cygwin breaks the debugger
|
|
|
|
*) if sh ./hasgot setsid; then
|
|
|
|
echo "setsid() found."
|
|
|
|
echo "#define HAS_SETSID" >> s.h
|
|
|
|
fi;;
|
|
|
|
esac
|
1997-02-14 08:29:10 -08:00
|
|
|
|
1998-04-30 06:38:50 -07:00
|
|
|
if sh ./hasgot putenv; then
|
|
|
|
echo "putenv() found."
|
|
|
|
echo "#define HAS_PUTENV" >> s.h
|
|
|
|
fi
|
|
|
|
|
1999-05-15 08:05:54 -07:00
|
|
|
if sh ./hasgot -i locale.h && sh ./hasgot setlocale; then
|
|
|
|
echo "setlocale() and <locale.h> found."
|
|
|
|
echo "#define HAS_LOCALE" >> s.h
|
|
|
|
fi
|
|
|
|
|
1999-11-30 08:07:38 -08:00
|
|
|
if sh ./hasgot -ldl dlopen; then
|
|
|
|
echo "dlopen() found."
|
|
|
|
dllib=-ldl
|
|
|
|
fi
|
|
|
|
|
2000-02-29 08:15:40 -08:00
|
|
|
if sh ./hasgot -i sys/types.h -i sys/mman.h && sh ./hasgot mmap munmap; then
|
2000-02-25 05:43:57 -08:00
|
|
|
echo "mmap() found."
|
|
|
|
echo "#define HAS_MMAP" >> s.h
|
|
|
|
fi
|
|
|
|
|
1997-02-23 08:29:36 -08:00
|
|
|
# Determine if the debugger is supported
|
|
|
|
|
|
|
|
if test "$has_sockets" = "yes"; then
|
|
|
|
echo "Replay debugger supported."
|
|
|
|
debugger="ocamldebugger"
|
|
|
|
else
|
|
|
|
echo "No replay debugger (missing system calls)"
|
|
|
|
debugger=""
|
|
|
|
fi
|
|
|
|
|
2001-08-08 01:30:26 -07:00
|
|
|
# Determine if system stack overflows can be detected
|
|
|
|
|
|
|
|
case "$arch,$model,$system" in
|
2001-08-08 02:14:46 -07:00
|
|
|
i386,*,*)
|
2001-08-08 01:30:26 -07:00
|
|
|
if ./runtest -DTARGET_$arch -DSYS_$system stackov.c; then
|
|
|
|
echo "System stack overflow can be detected."
|
|
|
|
echo "#define HAS_STACK_OVERFLOW_DETECTION" >> s.h
|
|
|
|
else
|
|
|
|
echo "Cannot detect system stack overflow."
|
|
|
|
fi;;
|
|
|
|
*)
|
|
|
|
echo "Cannot detect system stack overflow.";;
|
|
|
|
esac
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
# Determine the target architecture for the "num" library
|
|
|
|
|
|
|
|
case "$host" in
|
1997-02-01 09:40:41 -08:00
|
|
|
mips-*-ultrix*) bignum_arch=mips;;
|
1997-07-29 18:12:19 -07:00
|
|
|
alpha-*-osf*) bignum_arch=alpha;;
|
2001-07-05 02:38:29 -07:00
|
|
|
i[3456]86-*-linux*)
|
|
|
|
case `sh ./runtest elf.c` in
|
|
|
|
elf) bignum_arch=x86;;
|
|
|
|
*) bignum_arch=C;;
|
|
|
|
esac;;
|
1999-05-18 11:46:17 -07:00
|
|
|
i[3456]86-*-beos) bignum_arch=x86;;
|
2000-03-25 10:54:03 -08:00
|
|
|
i[3456]86-*-*bsd*)
|
|
|
|
case `sh ./runtest elf.c` in
|
|
|
|
elf) bignum_arch=x86;;
|
|
|
|
*) bignum_arch=C;;
|
|
|
|
esac;;
|
1996-02-13 08:29:09 -08:00
|
|
|
sparc-*-sunos*) bignum_arch=supersparc;;
|
|
|
|
sparc-*-solaris*) bignum_arch=supersparc-solaris;;
|
1996-04-18 09:27:16 -07:00
|
|
|
sparc-*-*bsd*) bignum_arch=sparc;;
|
1996-10-24 09:14:57 -07:00
|
|
|
m68k-*-sunos*) bignum_arch=68K;;
|
1996-02-13 08:29:09 -08:00
|
|
|
*) bignum_arch=C
|
|
|
|
esac
|
|
|
|
|
2001-01-25 06:19:37 -08:00
|
|
|
# Some systems (e.g. Solaris) don't have an assembler!
|
|
|
|
if sh ./searchpath as; then :; else bignum_arch=C; fi
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
echo "BIGNUM_ARCH=$bignum_arch" >> Makefile
|
|
|
|
|
1996-04-03 02:01:15 -08:00
|
|
|
# Determine if the threads library is supported
|
|
|
|
|
1997-10-24 08:49:12 -07:00
|
|
|
if test "$posix_threads" = "yes"; then
|
|
|
|
echo "Threads library supported (using POSIX system threads)."
|
|
|
|
otherlibraries="$otherlibraries systhreads"
|
1998-02-26 04:46:56 -08:00
|
|
|
bytecccompopts="$bytecccompopts -D_REENTRANT"
|
|
|
|
nativecccompopts="$nativecccompopts -D_REENTRANT"
|
2000-03-09 01:08:58 -08:00
|
|
|
case "$host" in
|
2000-05-15 06:34:06 -07:00
|
|
|
*-*-solaris*)
|
2001-08-28 07:47:48 -07:00
|
|
|
pthread_link="-lpthread -lposix4";;
|
2000-05-15 06:34:06 -07:00
|
|
|
*-*-freebsd*)
|
2001-09-06 07:19:03 -07:00
|
|
|
pthread_link="-pthread"
|
2000-05-15 06:34:06 -07:00
|
|
|
bytecccompopts="$bytecccompopts -D_THREAD_SAFE"
|
2000-05-16 09:38:05 -07:00
|
|
|
nativecccompopts="$nativecccompopts -D_THREAD_SAFE";;
|
|
|
|
*-*-openbsd*)
|
2001-08-28 07:47:48 -07:00
|
|
|
pthread_link="-pthread"
|
2000-05-16 09:38:05 -07:00
|
|
|
bytecccompopts="$bytecccompopts -pthread"
|
|
|
|
asppflags="$asppflags -pthread"
|
|
|
|
nativecccompopts="$nativecccompopts -pthread";;
|
2000-05-15 06:34:06 -07:00
|
|
|
*)
|
2001-08-28 07:47:48 -07:00
|
|
|
pthread_link="-lpthread";;
|
2000-03-09 01:08:58 -08:00
|
|
|
esac
|
|
|
|
echo "Options for linking with POSIX threads: $pthread_link"
|
|
|
|
echo "PTHREAD_LINK=$pthread_link" >> Makefile
|
1997-10-24 08:49:12 -07:00
|
|
|
elif test "$has_select" = "yes" \
|
1996-04-03 02:01:15 -08:00
|
|
|
&& test "$has_setitimer" = "yes" \
|
1996-06-25 02:27:34 -07:00
|
|
|
&& test "$has_gettimeofday" = "yes" \
|
|
|
|
&& test "$has_wait" = "yes"; then
|
2000-03-09 01:08:58 -08:00
|
|
|
echo "Threads library supported (using bytecode-level scheduling)."
|
1996-04-03 02:01:15 -08:00
|
|
|
otherlibraries="$otherlibraries threads"
|
|
|
|
else
|
|
|
|
echo "No threads library (missing system calls)"
|
|
|
|
fi
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
# Determine the location of X include files and libraries
|
|
|
|
|
|
|
|
x11_include="not found"
|
1996-04-02 00:40:00 -08:00
|
|
|
x11_link="not found"
|
1996-02-13 08:29:09 -08:00
|
|
|
|
2001-10-30 05:40:42 -08:00
|
|
|
for dir in \
|
|
|
|
$x11_include_dir \
|
|
|
|
\
|
|
|
|
/usr/X11R6/include \
|
|
|
|
/usr/include/X11R6 \
|
|
|
|
/usr/local/X11R6/include \
|
|
|
|
/usr/local/include/X11R6 \
|
|
|
|
/opt/X11R6/include \
|
|
|
|
\
|
|
|
|
/usr/X11/include \
|
|
|
|
/usr/include/X11 \
|
|
|
|
/usr/local/X11/include \
|
|
|
|
/usr/local/include/X11 \
|
|
|
|
/opt/X11/include \
|
|
|
|
\
|
|
|
|
/usr/X11R5/include \
|
|
|
|
/usr/include/X11R5 \
|
|
|
|
/usr/local/X11R5/include \
|
|
|
|
/usr/local/include/X11R5 \
|
|
|
|
/usr/local/x11r5/include \
|
|
|
|
/opt/X11R5/include \
|
|
|
|
\
|
|
|
|
/usr/X11R4/include \
|
|
|
|
/usr/include/X11R4 \
|
|
|
|
/usr/local/X11R4/include \
|
|
|
|
/usr/local/include/X11R4 \
|
|
|
|
\
|
|
|
|
/usr/X386/include \
|
|
|
|
/usr/x386/include \
|
|
|
|
/usr/XFree86/include/X11 \
|
|
|
|
\
|
|
|
|
/usr/include \
|
|
|
|
/usr/local/include \
|
|
|
|
/usr/unsupported/include \
|
|
|
|
/usr/athena/include \
|
|
|
|
/usr/lpp/Xamples/include \
|
|
|
|
\
|
|
|
|
/usr/openwin/include \
|
|
|
|
/usr/openwin/share/include \
|
|
|
|
; \
|
1996-04-01 07:22:44 -08:00
|
|
|
do
|
|
|
|
if test -f $dir/X11/X.h; then
|
1997-03-21 06:23:00 -08:00
|
|
|
x11_include=$dir
|
1996-02-13 08:29:09 -08:00
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2001-10-30 05:40:42 -08:00
|
|
|
if test "$x11_include" = "not found"; then
|
|
|
|
x11_try_lib_dir=''
|
|
|
|
else
|
|
|
|
x11_try_lib_dir=`echo $x11_include | sed -e 's|include|lib|'`
|
|
|
|
fi
|
|
|
|
|
|
|
|
for dir in \
|
|
|
|
$x11_lib_dir \
|
|
|
|
$x11_try_lib_dir \
|
|
|
|
\
|
|
|
|
/usr/X11R6/lib \
|
|
|
|
/usr/lib/X11R6 \
|
|
|
|
/usr/local/X11R6/lib \
|
|
|
|
/usr/local/lib/X11R6 \
|
|
|
|
/opt/X11R6/lib \
|
|
|
|
\
|
|
|
|
/usr/X11/lib \
|
|
|
|
/usr/lib/X11 \
|
|
|
|
/usr/local/X11/lib \
|
|
|
|
/usr/local/lib/X11 \
|
|
|
|
/opt/X11/lib \
|
|
|
|
\
|
|
|
|
/usr/X11R5/lib \
|
|
|
|
/usr/lib/X11R5 \
|
|
|
|
/usr/local/X11R5/lib \
|
|
|
|
/usr/local/lib/X11R5 \
|
|
|
|
/usr/local/x11r5/lib \
|
|
|
|
/opt/X11R5/lib \
|
|
|
|
\
|
|
|
|
/usr/X11R4/lib \
|
|
|
|
/usr/lib/X11R4 \
|
|
|
|
/usr/local/X11R4/lib \
|
|
|
|
/usr/local/lib/X11R4 \
|
|
|
|
\
|
|
|
|
/usr/X386/lib \
|
|
|
|
/usr/x386/lib \
|
|
|
|
/usr/XFree86/lib/X11 \
|
|
|
|
\
|
|
|
|
/usr/lib \
|
|
|
|
/usr/local/lib \
|
|
|
|
/usr/unsupported/lib \
|
|
|
|
/usr/athena/lib \
|
|
|
|
/usr/lpp/Xamples/lib \
|
|
|
|
/lib/usr/lib/X11 \
|
|
|
|
\
|
|
|
|
/usr/openwin/lib \
|
|
|
|
/usr/openwin/share/lib \
|
|
|
|
; \
|
1996-04-01 07:22:44 -08:00
|
|
|
do
|
|
|
|
if test -f $dir/libX11.a || \
|
|
|
|
test -f $dir/libX11.so || \
|
|
|
|
test -f $dir/libX11.sa; then
|
1999-11-30 08:07:38 -08:00
|
|
|
if test $dir = /usr/lib; then
|
2001-08-28 07:47:48 -07:00
|
|
|
x11_link="-lX11"
|
1999-11-30 08:07:38 -08:00
|
|
|
else
|
2001-08-28 07:47:48 -07:00
|
|
|
x11_link="-L$dir -lX11"
|
1999-11-30 08:07:38 -08:00
|
|
|
x11_libs="-L$dir"
|
|
|
|
fi
|
1996-02-13 08:29:09 -08:00
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
|
1996-04-02 00:40:00 -08:00
|
|
|
if test "$x11_include" = "not found" || test "$x11_link" = "not found"
|
1996-02-13 08:29:09 -08:00
|
|
|
then
|
1996-06-25 02:27:34 -07:00
|
|
|
echo "X11 not found, the \"graph\" library will not be supported."
|
2000-08-10 02:58:08 -07:00
|
|
|
x11_include=""
|
1996-04-01 07:22:44 -08:00
|
|
|
else
|
1997-03-21 06:23:00 -08:00
|
|
|
echo "Location of X11 include files: $x11_include/X11"
|
1996-04-02 00:40:00 -08:00
|
|
|
echo "Options for linking with X11: $x11_link"
|
1996-04-01 07:22:44 -08:00
|
|
|
otherlibraries="$otherlibraries graph"
|
1997-03-21 06:23:00 -08:00
|
|
|
if test "$x11_include" = "/usr/include"; then
|
|
|
|
x11_include=""
|
|
|
|
else
|
|
|
|
x11_include="-I$x11_include"
|
|
|
|
fi
|
|
|
|
echo "X11_INCLUDES=$x11_include" >> Makefile
|
|
|
|
echo "X11_LINK=$x11_link" >> Makefile
|
1996-04-01 07:22:44 -08:00
|
|
|
fi
|
|
|
|
|
1996-06-12 06:53:43 -07:00
|
|
|
# See if we can compile the dbm library
|
|
|
|
|
2000-03-25 10:54:03 -08:00
|
|
|
dbm_include="not found"
|
2000-06-05 06:28:14 -07:00
|
|
|
dbm_link="not found"
|
2001-10-30 05:40:42 -08:00
|
|
|
for dir in /usr/include /usr/include/db1 /usr/include/gdbm; do
|
2000-03-25 10:54:03 -08:00
|
|
|
if test -f $dir/ndbm.h; then
|
|
|
|
dbm_include=$dir
|
2000-06-05 06:28:14 -07:00
|
|
|
if sh ./hasgot dbm_open; then
|
|
|
|
dbm_link=""
|
|
|
|
elif sh ./hasgot -lndbm dbm_open; then
|
2001-08-28 07:47:48 -07:00
|
|
|
dbm_link="-lndbm"
|
2001-03-30 04:21:13 -08:00
|
|
|
elif sh ./hasgot -ldb1 dbm_open; then
|
2001-08-28 07:47:48 -07:00
|
|
|
dbm_link="-ldb1"
|
2001-10-30 05:40:42 -08:00
|
|
|
elif sh ./hasgot -lgdbm dbm_open; then
|
|
|
|
dbm_link="-lgdbm"
|
2000-06-05 06:28:14 -07:00
|
|
|
else
|
|
|
|
dbm_include="not found"
|
|
|
|
fi
|
2000-03-25 10:54:03 -08:00
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if test "$dbm_include" = "not found"; then
|
1996-06-25 02:27:34 -07:00
|
|
|
echo "NDBM not found, the \"dbm\" library will not be supported."
|
2000-03-25 10:54:03 -08:00
|
|
|
else
|
|
|
|
echo "NDBM found (in $dbm_include)"
|
|
|
|
if test "$dbm_include" = "/usr/include"; then
|
|
|
|
dbm_include=""
|
|
|
|
else
|
|
|
|
dbm_include="-I$dbm_include"
|
|
|
|
fi
|
|
|
|
echo "DBM_INCLUDES=$dbm_include" >> Makefile
|
2000-06-05 06:28:14 -07:00
|
|
|
echo "DBM_LINK=$dbm_link" >> Makefile
|
2000-03-25 10:54:03 -08:00
|
|
|
otherlibraries="$otherlibraries dbm"
|
1996-06-12 06:53:43 -07:00
|
|
|
fi
|
|
|
|
|
1999-11-30 08:07:38 -08:00
|
|
|
# Look for tcl/tk
|
|
|
|
|
|
|
|
echo "Configuring LablTk..."
|
2001-09-06 01:52:32 -07:00
|
|
|
|
2001-10-04 01:39:49 -07:00
|
|
|
if test $tk_wanted = no; then
|
|
|
|
has_tk=false
|
2001-10-09 07:02:04 -07:00
|
|
|
elif test "$ostype" = "Cygwin"; then
|
2001-09-06 01:52:32 -07:00
|
|
|
has_tk=true
|
|
|
|
elif test "$x11_include" = "not found" || test "$x11_link" = "not found"; then
|
1999-11-30 08:07:38 -08:00
|
|
|
echo "X11 not found."
|
|
|
|
has_tk=false
|
|
|
|
else
|
2001-09-06 01:52:32 -07:00
|
|
|
tk_x11_include="$x11_include"
|
|
|
|
tk_x11_libs="$x11_libs -lX11"
|
1999-11-30 08:07:38 -08:00
|
|
|
has_tk=true
|
2001-09-06 01:52:32 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test $has_tk = true; then
|
1999-11-30 08:07:38 -08:00
|
|
|
tcl_version=''
|
2001-09-06 01:52:32 -07:00
|
|
|
tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c`
|
1999-11-30 08:07:38 -08:00
|
|
|
if test -z "$tcl_version" && test -z "$tk_defs"; then
|
|
|
|
tk_defs=-I/usr/local/include
|
2001-09-06 01:52:32 -07:00
|
|
|
tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c`
|
1999-11-30 08:07:38 -08:00
|
|
|
fi
|
2001-04-06 06:33:01 -07:00
|
|
|
if test -z "$tcl_version"; then
|
|
|
|
tk_defs="-I/usr/include/tcl8.2 -I/usr/include/tk8.2"
|
2001-09-06 01:52:32 -07:00
|
|
|
tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c`
|
2001-04-06 06:33:01 -07:00
|
|
|
fi
|
|
|
|
if test -z "$tcl_version"; then
|
|
|
|
tk_defs="-I/usr/include/tcl8.3 -I/usr/include/tk8.3"
|
2001-09-06 01:52:32 -07:00
|
|
|
tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c`
|
2001-04-06 06:33:01 -07:00
|
|
|
fi
|
1999-11-30 08:07:38 -08:00
|
|
|
if test -n "$tcl_version"; then
|
|
|
|
echo "tcl.h version $tcl_version found."
|
|
|
|
case $tcl_version in
|
|
|
|
7.5) tclmaj=7 tclmin=5 tkmaj=4 tkmin=1 ;;
|
|
|
|
7.6) tclmaj=7 tclmin=6 tkmaj=4 tkmin=2 ;;
|
|
|
|
8.0) tclmaj=8 tclmin=0 tkmaj=8 tkmin=0 ;;
|
|
|
|
8.1) tclmaj=8 tclmin=1 tkmaj=8 tkmin=1 ;;
|
|
|
|
8.2) tclmaj=8 tclmin=2 tkmaj=8 tkmin=2 ;;
|
2000-02-14 23:25:10 -08:00
|
|
|
8.3) tclmaj=8 tclmin=3 tkmaj=8 tkmin=3 ;;
|
1999-11-30 08:07:38 -08:00
|
|
|
*) echo "This version is not known."; has_tk=false ;;
|
|
|
|
esac
|
|
|
|
else
|
|
|
|
echo "tcl.h not found."
|
|
|
|
has_tk=false
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test $has_tk = true; then
|
2000-08-24 23:53:45 -07:00
|
|
|
if sh ./hasgot $tk_x11_include $tk_defs -i tk.h; then
|
1999-11-30 08:07:38 -08:00
|
|
|
echo "tk.h found."
|
|
|
|
else
|
|
|
|
echo "tk.h not found."
|
|
|
|
has_tk=false
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
tkauxlibs="$mathlib $dllib"
|
|
|
|
tcllib=''
|
|
|
|
tklib=''
|
|
|
|
if test $has_tk = true; then
|
2001-02-07 22:35:30 -08:00
|
|
|
if sh ./hasgot $tk_libs $tk_x11_libs $tkauxlibs Tcl_DoOneEvent
|
1999-11-30 08:07:38 -08:00
|
|
|
then tk_libs="$tk_libs $dllib"
|
|
|
|
elif sh ./hasgot $tk_libs -ltcl$tclmaj.$tclmin $tkauxlibs Tcl_DoOneEvent
|
|
|
|
then
|
1999-12-22 07:01:35 -08:00
|
|
|
tk_libs="$tk_libs -ltk$tkmaj.$tkmin -ltcl$tclmaj.$tclmin $dllib"
|
1999-11-30 08:07:38 -08:00
|
|
|
elif sh ./hasgot $tk_libs -ltcl$tclmaj$tclmin $tkauxlibs Tcl_DoOneEvent
|
|
|
|
then
|
1999-12-22 07:01:35 -08:00
|
|
|
tk_libs="$tk_libs -ltk$tkmaj$tkmin -ltcl$tclmaj$tclmin $dllib"
|
1999-11-30 08:07:38 -08:00
|
|
|
elif test -z "$tk_libs" && tk_libs=-L/usr/local/lib && \
|
|
|
|
sh ./hasgot $tk_libs -ltcl$tclmaj.$tclmin $tkauxlibs Tcl_DoOneEvent
|
|
|
|
then
|
1999-12-22 07:01:35 -08:00
|
|
|
tk_libs="$tk_libs -ltk$tkmaj.$tkmin -ltcl$tclmaj.$tclmin $dllib"
|
1999-11-30 08:07:38 -08:00
|
|
|
elif sh ./hasgot $tk_libs -ltcl$tclmaj$tclmin $tkauxlibs Tcl_DoOneEvent
|
|
|
|
then
|
1999-12-22 07:01:35 -08:00
|
|
|
tk_libs="$tk_libs -ltk$tkmaj$tkmin -ltcl$tclmaj$tclmin $dllib"
|
1999-11-30 08:07:38 -08:00
|
|
|
# elif sh ./hasgot $tk_libs -ltcl $tkauxlibs Tcl_DoOneEvent; then
|
1999-12-22 07:01:35 -08:00
|
|
|
# tk_libs="$tk_libs -ltk -ltcl"
|
1999-11-30 08:07:38 -08:00
|
|
|
else
|
|
|
|
echo "Tcl library not found."
|
|
|
|
has_tk=false
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test $has_tk = true; then
|
2000-08-24 23:53:45 -07:00
|
|
|
if sh ./hasgot $tk_libs $tk_x11_libs $tkauxlibs Tk_SetGrid; then
|
1999-11-30 08:07:38 -08:00
|
|
|
echo "Tcl/Tk libraries found."
|
|
|
|
else
|
|
|
|
echo "Tcl library found."
|
|
|
|
echo "Tk library not found."
|
|
|
|
has_tk=false
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test $has_tk = true; then
|
|
|
|
echo "TK_DEFS=$tk_defs" >> Makefile
|
2000-04-03 20:39:35 -07:00
|
|
|
echo "TK_LINK=$tk_libs" >> Makefile
|
1999-11-30 08:07:38 -08:00
|
|
|
otherlibraries="$otherlibraries labltk"
|
|
|
|
else
|
|
|
|
echo "Configuration failed, LablTk will not be built."
|
|
|
|
fi
|
|
|
|
|
2001-09-07 18:43:46 -07:00
|
|
|
# Camlp4
|
|
|
|
|
|
|
|
(
|
|
|
|
cd ../../camlp4/config
|
2001-12-24 02:21:09 -08:00
|
|
|
EXE=$exe ./configure_batch -bindir "$bindir" -libdir "$libdir" -mandir "$mandir" -ocaml-top ../.. > /dev/null
|
2001-09-07 18:43:46 -07:00
|
|
|
)
|
|
|
|
|
1996-02-13 08:29:09 -08:00
|
|
|
# Finish generated files
|
|
|
|
|
1998-03-13 11:59:11 -08:00
|
|
|
cclibs="$cclibs $mathlib"
|
1998-02-26 04:46:56 -08:00
|
|
|
|
|
|
|
echo "BYTECC=$bytecc" >> Makefile
|
|
|
|
echo "BYTECCCOMPOPTS=$bytecccompopts" >> Makefile
|
|
|
|
echo "BYTECCLINKOPTS=$bytecclinkopts" >> Makefile
|
2001-10-24 06:08:53 -07:00
|
|
|
echo "BYTECCLIBS=$cclibs $dllib $curseslibs $pthread_link" >> Makefile
|
2001-08-28 07:47:48 -07:00
|
|
|
echo "BYTECCRPATH=$byteccrpath" >> Makefile
|
2000-08-10 02:58:08 -07:00
|
|
|
echo "EXE=$exe" >> Makefile
|
2001-08-28 07:47:48 -07:00
|
|
|
echo "SUPPORTS_SHARED_LIBRARIES=$shared_libraries_supported" >> Makefile
|
|
|
|
echo "SHAREDCCCOMPOPTS=$sharedcccompopts" >> Makefile
|
|
|
|
echo "MKSHAREDLIB=$mksharedlib" >> Makefile
|
2001-10-30 01:32:32 -08:00
|
|
|
echo "MKSHAREDLIBRPATH=$mksharedlibrpath" >> Makefile
|
1998-02-26 04:46:56 -08:00
|
|
|
echo "ARCH=$arch" >> Makefile
|
|
|
|
echo "MODEL=$model" >> Makefile
|
|
|
|
echo "SYSTEM=$system" >> Makefile
|
|
|
|
echo "NATIVECC=$nativecc" >> Makefile
|
|
|
|
echo "NATIVECCCOMPOPTS=$nativecccompopts" >> Makefile
|
|
|
|
echo "NATIVECCLINKOPTS=$nativecclinkopts" >> Makefile
|
2001-08-28 07:47:48 -07:00
|
|
|
echo "NATIVECCRPATH=$nativeccrpath" >> Makefile
|
2000-10-27 08:18:24 -07:00
|
|
|
echo "NATIVECCLIBS=$cclibs" >> Makefile
|
1998-02-26 04:46:56 -08:00
|
|
|
echo "ASFLAGS=$asflags" >> Makefile
|
|
|
|
echo "ASPP=$aspp" >> Makefile
|
|
|
|
echo "ASPPFLAGS=$asppflags" >> Makefile
|
1998-08-06 07:25:24 -07:00
|
|
|
echo "ASPPPROFFLAGS=$asppprofflags" >> Makefile
|
1998-11-06 07:39:18 -08:00
|
|
|
echo "PROFILING=$profiling" >> Makefile
|
1998-02-26 04:46:56 -08:00
|
|
|
|
1999-11-30 08:07:38 -08:00
|
|
|
echo "DYNLINKOPTS=$dllib" >> Makefile
|
1996-04-01 07:22:44 -08:00
|
|
|
echo "OTHERLIBRARIES=$otherlibraries" >> Makefile
|
1997-02-23 08:29:36 -08:00
|
|
|
echo "DEBUGGER=$debugger" >> Makefile
|
1996-02-13 08:29:09 -08:00
|
|
|
|
|
|
|
rm -f tst hasgot.c
|
|
|
|
rm -f ../m.h ../s.h ../Makefile
|
|
|
|
mv m.h s.h Makefile ..
|
1996-04-01 07:22:44 -08:00
|
|
|
|
|
|
|
# Print a summary
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "** Configuration summary **"
|
|
|
|
echo
|
1996-04-30 07:53:58 -07:00
|
|
|
echo "Directories where Objective Caml will be installed:"
|
2000-01-07 07:50:42 -08:00
|
|
|
echo " binaries.................. $bindir"
|
|
|
|
echo " standard library.......... $libdir"
|
|
|
|
echo " manual pages.............. $mandir (with extension .$manext)"
|
1996-04-01 07:22:44 -08:00
|
|
|
|
|
|
|
echo "Configuration for the bytecode compiler:"
|
2000-01-07 07:50:42 -08:00
|
|
|
echo " C compiler used........... $bytecc"
|
|
|
|
echo " options for compiling..... $bytecccompopts"
|
2001-10-24 06:08:53 -07:00
|
|
|
echo " options for linking....... $bytecclinkopts $cclibs $dllib $curseslibs $pthread_link"
|
2001-08-28 07:47:48 -07:00
|
|
|
if $shared_libraries_supported; then
|
|
|
|
echo " shared libraries are supported"
|
|
|
|
echo " options for compiling..... $sharedcccompopts $bytecccompopts"
|
2001-10-30 01:32:32 -08:00
|
|
|
echo " command for building...... $mksharedlib lib.so $mksharedlibrpath/a/path objs"
|
2001-08-28 07:47:48 -07:00
|
|
|
else
|
|
|
|
echo " shared libraries not supported"
|
|
|
|
fi
|
1996-04-01 07:22:44 -08:00
|
|
|
|
|
|
|
echo "Configuration for the native-code compiler:"
|
|
|
|
if test "$arch" = "none"; then
|
2000-01-07 07:50:42 -08:00
|
|
|
echo " (not supported on this platform)"
|
1996-04-01 07:22:44 -08:00
|
|
|
else
|
|
|
|
if test "$model" = "default"; then
|
2000-01-07 07:50:42 -08:00
|
|
|
echo " hardware architecture..... $arch"
|
1996-04-01 07:22:44 -08:00
|
|
|
else
|
2000-01-07 07:50:42 -08:00
|
|
|
echo " hardware architecture..... $arch ($model)"
|
1996-04-01 07:22:44 -08:00
|
|
|
fi
|
|
|
|
if test "$system" = "unknown"; then : ; else
|
2000-01-07 07:50:42 -08:00
|
|
|
echo " OS variant................ $system"
|
1996-04-01 07:22:44 -08:00
|
|
|
fi
|
2000-01-07 07:50:42 -08:00
|
|
|
echo " C compiler used........... $nativecc"
|
|
|
|
echo " options for compiling..... $nativecccompopts"
|
|
|
|
echo " options for linking....... $nativecclinkopts $cclibs"
|
1996-09-18 06:24:56 -07:00
|
|
|
echo " assembler ................ \$(AS) $asflags"
|
|
|
|
echo " preprocessed assembler ... $aspp $asppflags"
|
1998-11-06 07:39:18 -08:00
|
|
|
if test "$profiling" = "prof"; then
|
|
|
|
echo " profiling with gprof ..... supported"
|
|
|
|
else
|
|
|
|
echo " profiling with gprof ..... not supported"
|
|
|
|
fi
|
1996-04-01 07:22:44 -08:00
|
|
|
fi
|
|
|
|
|
1997-02-23 08:29:36 -08:00
|
|
|
if test "$debugger" = "ocamldebugger"; then
|
|
|
|
echo "Source-level replay debugger: supported"
|
|
|
|
else
|
|
|
|
echo "Source-level replay debugger: not supported"
|
|
|
|
fi
|
|
|
|
|
1996-04-01 07:22:44 -08:00
|
|
|
echo "Configuration for the external libraries:"
|
2000-03-25 10:54:03 -08:00
|
|
|
echo " libraries supported ...... $otherlibraries"
|
1996-04-01 07:22:44 -08:00
|
|
|
|
1996-04-03 02:01:15 -08:00
|
|
|
echo "The \"num\" library:"
|
2000-01-07 07:50:42 -08:00
|
|
|
echo " target architecture ...... $bignum_arch"
|
1996-04-03 02:01:15 -08:00
|
|
|
|
1996-04-01 07:22:44 -08:00
|
|
|
if test "$x11_include" != "not found" && test "$x11_lib" != "not found"; then
|
|
|
|
echo "The \"graph\" library:"
|
2000-01-07 07:50:42 -08:00
|
|
|
echo " options for compiling .... $x11_include"
|
|
|
|
echo " options for linking ...... $x11_link"
|
1996-04-01 07:22:44 -08:00
|
|
|
fi
|
|
|
|
|
1999-11-30 08:07:38 -08:00
|
|
|
if test $has_tk = true; then
|
|
|
|
echo "The \"labltk\" library:"
|
2000-01-07 07:50:42 -08:00
|
|
|
echo " use tcl/tk version ....... $tcl_version"
|
|
|
|
echo " options for compiling .... $tk_defs"
|
|
|
|
echo " options for linking ...... $tk_libs"
|
1999-11-30 08:07:38 -08:00
|
|
|
else
|
2001-08-24 06:32:26 -07:00
|
|
|
echo "The \"labltk\" library: not found"
|
1999-12-09 10:53:52 -08:00
|
|
|
fi
|