scsh-0.5/configure.in

361 lines
8.7 KiB
Plaintext
Raw Permalink Normal View History

1995-10-13 23:34:21 -04:00
dnl Process this file with autoconf 2.x to produce a configure script.
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
dnl Autoconf does not seems to fit the needs of dynamic linking well -bri
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
dnl We might want AC_CHAR_UNSIGNED in the future.
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
dnl The -cckr (K&R) flag is for the IRIX C compiler. If this is left
dnl out, scheme48vm.c breaks because the rather pedantic SGI compiler
dnl decides that a char is not the same thing as an unsigned char.
dnl - Bryan O'Sullivan 3/94
AC_DEFUN(S48_CFLAG_CKR, [
AC_MSG_CHECKING(${CC} for -cckr)
AC_CACHE_VAL(s48_cv_cflag_ckr,[
if test ${CC} != gcc; then
echo "main(){int i=1;}" > conftest.c
if CFLAGS="-cckr ${CFLAGS}" eval $ac_compile
then
s48_cv_cflag_ckr=yes
else
s48_cv_cflag_ckr=no
fi
else
s48_cv_cflag_ckr=no
fi
rm -f conftest*])
AC_MSG_RESULT($s48_cv_cflag_ckr)
if test $s48_cv_cflag_ckr = yes; then
CFLAGS=$CFLAGS
fi
])
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AC_DEFUN(S48_POSIX_LIBC, [
AC_MSG_CHECKING(for RISC/OS POSIX library lossage)
AC_CACHE_VAL(s48_cv_posix_libc,[
if test -f /usr/posix/usr/lib/libc.a; then
s48_cv_posix_libc=yes
else
s48_cv_posix_libc=no
fi])
AC_MSG_RESULT($s48_cv_posix_libc)
if test $s48_cv_posix_libc = yes; then
LIBS="${LIBS} /usr/posix/usr/lib/libc.a"
fi
])
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AC_DEFUN(S48_CFLAG_O2, [
AC_MSG_CHECKING(whether we can use -O2)
AC_CACHE_VAL(s48_cv_cflag_o2,[
if test "z$CFLAGS" = "z"; then
if test "z$GCC" = "z"; then
s48_cv_cflag_o2=yes
else
s48_cv_cflag_o2=no
fi
else
s48_cv_cflag_o2=preset
fi])
AC_MSG_RESULT($s48_cv_cflag_o2)
case "$s48_cv_cflag_o2" in
yes )
CFLAGS="-O"
;;
no )
CFLAGS="-O2 -g"
;;
esac
])
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AC_DEFUN(S48_USCORE, [
AC_MSG_CHECKING(for underscore before symbols)
AC_CACHE_VAL(s48_cv_uscore,[
echo "main(){int i=1;}
fnord(){int i=23; int ltuae=42;}" > conftest.c
${CC} conftest.c > /dev/null
if (nm a.out | grep _fnord) > /dev/null; then
s48_cv_uscore=yes
else
s48_cv_uscore=no
fi])
AC_MSG_RESULT($s48_cv_uscore)
if test $s48_cv_uscore = yes; then
AC_DEFINE(USCORE)
fi
rm -f conftest.c a.out
])
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AC_DEFUN(S48_NLIST,[
AC_MSG_CHECKING(for n_name)
AC_CACHE_VAL(s48_cv_nlist,[
AC_TRY_COMPILE([#include <nlist.h>],
[struct nlist name_list;
name_list.n_name = "foo";],
s48_cv_nlist=yes,
s48_cv_nlist=no)])
AC_MSG_RESULT($s48_cv_nlist)
if test $s48_cv_nlist = yes; then
AC_DEFINE(NLIST_HAS_N_NAME)
fi
])
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AC_DEFUN(S48__CNT,[
AC_MSG_CHECKING(for _cnt)
AC_CACHE_VAL(s48_cv__cnt,[
AC_TRY_COMPILE([#include <stdio.h>],
[return stdin->_cnt;],
s48_cv__cnt=yes,
s48_cv__cnt=no)])
AC_MSG_RESULT($s48_cv__cnt)
if test $s48_cv__cnt = yes; then
AC_DEFINE(FILE_HAS__CNT)
fi
])
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AC_DEFUN(SCSH_TZNAME,[
AC_MSG_CHECKING(for tzname)
AC_CACHE_VAL(scsh_cv_tzname,[
AC_TRY_COMPILE([#include <time.h>],
[return (int) tzname;],
scsh_cv_tzname=yes,
scsh_cv_tzname=no)])
AC_MSG_RESULT($scsh_cv_tzname)
if test $scsh_cv_tzname = yes; then
AC_DEFINE(HAVE_TZNAME)
fi
])
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AC_DEFUN(SCSH_GMTOFF,[
AC_MSG_CHECKING(for gmtoff)
AC_CACHE_VAL(scsh_cv_gmtoff,[
AC_TRY_COMPILE([#include <time.h>],
[struct tm time;
return time.tm_gmtoff;],
scsh_cv_gmtoff=yes,
scsh_cv_gmtoff=no)])
AC_MSG_RESULT($scsh_cv_gmtoff)
if test $scsh_cv_gmtoff = yes; then
AC_DEFINE(HAVE_GMTOFF)
fi
])
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AC_DEFUN(SCSH_LINUX_ELF, [
AC_MSG_CHECKING(for Linux using ELF)
AC_CACHE_VAL(scsh_cv_linux_elf,[
touch conftest.c
if ${CC} -v conftest.c 2>&1 | grep -q __ELF__ ; then
scsh_cv_linux_elf=yes
else
scsh_cv_linux_elf=no
fi])
AC_MSG_RESULT($scsh_cv_linux_elf)
if test $scsh_cv_linux_elf = yes; then
LDFLAGS=-rdynamic
fi
rm -f conftest.c a.out
])
1995-11-03 23:28:27 -05:00
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AC_DEFUN(SCSH_LINUX_STATIC_DEBUG, [
case "$host" in
*-*-linux* )
AC_MSG_CHECKING(for broken Linux that needs -static with -g)
AC_CACHE_VAL(scsh_cv_linux_static_debug,[
AC_TRY_LINK([],
[],
1995-11-04 00:15:07 -05:00
scsh_cv_linux_static_debug=no,
scsh_cv_linux_static_debug=yes)])
1995-11-03 23:28:27 -05:00
AC_MSG_RESULT($scsh_cv_linux_static_debug)
if test $scsh_cv_linux_static_debug = yes; then
LDFLAGS="-static ${LDFLAGS}"
fi
;;
esac
])
1995-10-13 23:34:21 -04:00
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AC_DEFUN(SCSH_CONST_SYS_ERRLIST,[
AC_MSG_CHECKING(for const sys_errlist)
AC_CACHE_VAL(scsh_cv_const_sys_errlist,[
AC_TRY_COMPILE([#include <errno.h>
#include <unistd.h>],
[const extern char *sys_errlist[];],
scsh_cv_const_sys_errlist=yes,
scsh_cv_const_sys_errlist=no)])
AC_MSG_RESULT($scsh_cv_const_sys_errlist)
if test $scsh_cv_const_sys_errlist = yes; then
AC_DEFINE(HAVE_CONST_SYS_ERRLIST)
fi
])
dnl -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AC_INIT(scheme48vm.c)
AC_CONFIG_HEADER(sysdep.h)
AC_CANONICAL_HOST
AC_PROG_CC
1995-11-03 23:31:50 -05:00
AC_ISC_POSIX
1995-11-03 23:28:27 -05:00
SCSH_LINUX_STATIC_DEBUG
1995-10-13 23:34:21 -04:00
AC_PROG_INSTALL
1995-11-01 20:45:35 -05:00
AC_PROG_RANLIB
1995-10-13 23:34:21 -04:00
AC_C_CONST
1995-10-31 16:35:45 -05:00
AC_C_BIGENDIAN
1995-10-31 16:40:55 -05:00
if test $ac_cv_c_bigendian = no ; then
1995-10-31 16:35:45 -05:00
ENDIAN=little
else
ENDIAN=big
fi
1995-10-31 18:16:31 -05:00
AR=${AR-"ar cq"}
TMPDIR=${TMPDIR-"/usr/tmp"}
1995-10-13 23:34:21 -04:00
case "$host" in
## CX/UX
m88k-harris-cxux* )
dir=cxux
CC="cc -Xa"
CFLAGS="-O"
LDFLAGS="-O -Wl,-Bexport"
AC_DEFINE(HAVE_HARRIS)
;;
## DEC Ultrix
mips-dec-ultrix* )
dir=ultrix
if test ${CC} = cc; then
LDFLAGS=-N
fi
;;
## HP 9000 series 700 and 800, running HP/UX
hppa*-hp-hpux* )
dir=hpux
LDFLAGS="-Wl,-E"
1995-10-13 23:34:21 -04:00
if test ${CC} = cc; then
CFLAGS="-Ae -O +Obb1800"
AC_DEFINE(_HPUX_SOURCE)
AC_DEFINE(hpux)
fi
;;
## IBM AIX
rs6000-ibm-aix*|powerpc-ibm-aix* )
dir=aix
LDFLAGS="-O"
if test ${CC} = gcc; then
LDFLAGS_AIX="-Xlinker -bexport:exportlist.aix"
else
LDFLAGS_AIX="-bexport:exportlist.aix"
fi
CFLAGS="-O"
AIX_P="exportlist.aix"
;;
## Linux
*-*-linux* )
dir=linux
1995-11-02 19:38:31 -05:00
# gross, but needed for some older a.out systems for 0.4.x
LIBS=-lc
1995-10-13 23:34:21 -04:00
SCSH_LINUX_ELF
;;
1995-11-04 15:55:34 -05:00
## NetBSD and FreeBSD ( and maybe 386BSD also)
1995-10-13 23:34:21 -04:00
*-*-*bsd* )
dir=bsd
;;
## NeXT
*-next-* )
dir=next
CC="$CC -posix"
AC_DEFINE(HAVE_SIGACTION)
;;
## SGI IRIX
mips-sgi-irix* )
dir=irix
S48_CFLAG_CKR
INSTALL='$(srcdir)/install-sh'
;;
## SunOS
sparc*-sun-sunos* )
dir=sunos
;;
## Solaris - Sparc and i386
*-*-solaris* )
1995-10-13 23:34:21 -04:00
dir=solaris
AC_DEFINE(HAVE_NLIST)
;;
## Generic Configuration
* )
dir=generic
echo "WARNING: "
echo "WARNING: Using generic configuration."
echo "WARNING: See doc/install.txt for more information."
echo "WARNING: "
;;
esac
/bin/rm -f $srcdir/scsh/machine
ln -s $srcdir/$dir $srcdir/scsh/machine
AC_CHECK_LIB(m, sqrt)
1995-10-13 23:34:21 -04:00
AC_CHECK_LIB(gen, pathfind)
AC_CHECK_LIB(nsl, gethostbyaddr)
AC_CHECK_LIB(socket, socket)
dnl Solaris 2.3 seems to need -lelf for nlist(). (tnx Bryan O'Sullivan)
AC_CHECK_LIB(elf, nlist)
AC_CHECK_LIB(ld, ldopen)
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_LIB(dld, shl_findsym)
1995-10-13 23:34:21 -04:00
dnl AC_CHECK_LIB(mld, main)
AC_RETSIGTYPE
AC_HAVE_HEADERS(libgen.h sys/timeb.h posix/time.h sys/select.h nlist.h)
1995-11-01 17:56:22 -05:00
AC_HAVE_FUNCS(strerror)
1995-10-13 23:34:21 -04:00
AC_HAVE_FUNCS(dlopen gettimeofday ftime nlist select setitimer sigaction)
AC_HAVE_FUNCS(socket chroot)
S48_POSIX_LIBC
S48_CFLAG_O2
S48_USCORE
S48_NLIST
S48__CNT
SCSH_TZNAME
SCSH_GMTOFF
SCSH_CONST_SYS_ERRLIST
CFLAGS1=${CFLAGS}
AC_SUBST(AIX_P)
1995-10-31 18:16:31 -05:00
AC_SUBST(AR)
AC_SUBST(CC)
1995-10-13 23:34:21 -04:00
AC_SUBST(CFLAGS)
AC_SUBST(CFLAGS1)
1995-10-31 16:35:45 -05:00
AC_SUBST(ENDIAN)
1995-10-13 23:34:21 -04:00
AC_SUBST(LDFLAGS)
AC_SUBST(LDFLAGS_AIX)
1995-11-02 19:03:37 -05:00
AC_SUBST(LIBS)
1995-10-31 18:16:31 -05:00
AC_SUBST(TMPDIR)
1995-10-13 23:34:21 -04:00
1995-10-31 18:16:31 -05:00
AC_OUTPUT(Makefile scsh/regexp/Makefile scsh/endian.scm scsh/static.scm)
chmod +x scsh/static.scm