summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in340
1 files changed, 218 insertions, 122 deletions
diff --git a/configure.in b/configure.in
index 92c4c58..f10734d 100644
--- a/configure.in
+++ b/configure.in
@@ -1,30 +1,31 @@
dnl Process this file with autoconf to produce a configure script.
dnl
-dnl $Id: configure.in,v 1.17 1994/05/31 12:31:46 mlschroe Exp $ FAU
+dnl $Id: configure.in,v 1.18 1994/09/06 16:59:54 mlschroe Exp $ FAU
dnl
dnl Many thanks to David MacKenzie for writing autoconf and
dnl providing a sample configure.in file for screen.
dnl
-AC_REVISION($Revision: 1.17 $)dnl
+AC_REVISION($Revision: 1.18 $)dnl
AC_INIT(screen.c)
AC_CONFIG_HEADER(config.h)
dnl
dnl Define some useful macros
dnl
-define(AC_PROGRAM_SOURCE,
+AC_DEFUN(AC_PROGRAM_SOURCE,
[AC_REQUIRE([AC_PROG_CPP])AC_PROVIDE([$0])cat > conftest.c <<EOF
[$1]
_CUT_HERE_
[$2]
EOF
-$CPP $DEFS conftest.c 2>/dev/null | sed -e '1,/_CUT_HERE_/d' > conftest.out
+eval "$ac_cpp conftest.c 2>&5 | sed -e '1,/_CUT_HERE_/d' > conftest.out"
. ./conftest.out
rm -f conftest*
])dnl
dnl
define(AC_NOTE,
-[test -n "$silent" || echo "$1"])dnl
+[echo "$1" 1>&AC_FD_MSG
+])dnl
dnl
dnl Extract version from patchlevel.h
@@ -35,22 +36,38 @@ pat=`sed < ${srcdir}/patchlevel.h -n -e '/#define PATCHLEVEL/s/#define PATCHLEVE
VERSION="$rev.$vers.$pat"
AC_NOTE(this is screen version $VERSION)
AC_SUBST(VERSION)
-AC_PREFIX(gzip)
+AC_PREFIX_PROGRAM(screen)
+AC_PREFIX_PROGRAM(gzip)
AC_PROG_CC
AC_PROG_CPP
-AC_GCC_TRADITIONAL
+AC_PROG_GCC_TRADITIONAL
AC_ISC_POSIX
-AC_TEST_PROGRAM(main(){exit(0);},,AC_ERROR(Can't run the compiler - sorry))
+AC_TRY_RUN(main(){exit(0);},,[
+if test $CC != cc ; then
+AC_NOTE(Your $CC failed - restarting with CC=cc)
+AC_NOTE()
+CC=cc
+export CC
+exec $0 $configure_args
+fi
+])
+
+AC_TRY_RUN(main(){exit(0);},,
+exec 5>&2
+eval $ac_link
+AC_NOTE(CC=$CC; CFLAGS=$CFLAGS; LIBS=$LIBS;)
+AC_NOTE($ac_compile)
+AC_MSG_ERROR(Can't run the compiler - sorry))
-AC_TEST_PROGRAM([
+AC_TRY_RUN([
main()
{
int __something_strange_();
__something_strange_(0);
}
-],AC_ERROR(Your compiler does not set the exit status - sorry))
+],AC_MSG_ERROR(Your compiler does not set the exit status - sorry))
AC_PROG_AWK
@@ -58,7 +75,7 @@ AC_PROG_INSTALL
if test -f etc/toolcheck; then
AC_CHECKING(for buggy tools)
-sh etc/toolcheck
+sh etc/toolcheck 1>&AC_FD_MSG
fi
dnl
@@ -81,13 +98,19 @@ fi
AC_CHECKING(for MIPS)
if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then
+oldlibs="$LIBS"
test -f /bin/mx || LIBS="$LIBS -lmld" # for nlist. But not on alpha.
dnl djm@eng.umd.edu: "... for one thing, it doubles the size of the executable"
+AC_CHECKING(mld library)
+AC_TRY_LINK(,,,LIBS="$oldlibs")
+dnl
dnl
if test -r /dev/ptc; then
AC_DEFINE(MIPS)
-AC_COMPILE_CHECK(wait3, , [wait3();], ,
-AC_COMPILE_CHECK(wait2, , [wait2();],
+AC_CHECKING(wait3)
+AC_TRY_LINK(,[wait3();], ,
+AC_CHECKING(wait2)
+AC_TRY_LINK(,[wait2();],
dnl John Rouillard (rouilj@sni-usa.com):
dnl need -I/usr/include/bsd in RISCOS otherwise sockets are broken, no
dnl job control etc.
@@ -97,26 +120,28 @@ AC_DEFINE(USE_WAIT2) LIBS="$LIBS -lbsd" ; CC="$CC -I/usr/include/bsd"
fi
fi
+
AC_CHECKING(for Ultrix)
-AC_PROGRAM_EGREP(yes,
+AC_EGREP_CPP(yes,
[#if defined(ultrix) || defined(__ultrix)
- yes
+ yes;
#endif
], ULTRIX=1)
if test -f /usr/lib/libpyr.a ; then
oldlibs="$LIBS"
LIBS="$LIBS -lpyr"
-AC_COMPILE_CHECK(Pyramid OSX,,[open_controlling_pty("");],AC_DEFINE(OSX),LIBS="oldlibs")
+AC_CHECKING(Pyramid OSX)
+AC_TRY_LINK(,[open_controlling_pty("")], AC_DEFINE(OSX), LIBS="$oldlibs")
fi
dnl ghazi@caip.rutgers.edu (Kaveh R. Ghazi):
dnl BBN butterfly is not POSIX, but a MACH BSD system.
dnl Do not define POSIX and TERMIO.
AC_CHECKING(for butterfly)
-AC_PROGRAM_EGREP(yes,
+AC_EGREP_CPP(yes,
[#if defined(butterfly)
- yes
+ yes;
#endif
], butterfly=1)
@@ -125,58 +150,70 @@ if test -n "$ULTRIX"; then
test -z "$GCC" && CC="$CC -YBSD"
fi
AC_CHECKING(for POSIX.1)
-AC_PROGRAM_EGREP(yes,
+AC_EGREP_CPP(yes,
[#include <sys/types.h>
#include <unistd.h>
main () {
#ifdef _POSIX_VERSION
- yes
+ yes;
#endif
], AC_NOTE(- you have a POSIX system) AC_DEFINE(POSIX) posix=1)
fi
-AC_COMPILE_CHECK([System V],
+AC_CHECKING(for System V)
+AC_TRY_COMPILE(
[#include <sys/types.h>
#include <signal.h>
#include <fcntl.h>], [int x = SIGCHLD | FNDELAY;], , AC_DEFINE(SYSV))
AC_CHECKING(for sequent/ptx)
-AC_PROGRAM_EGREP(yes,
+AC_EGREP_CPP(yes,
[#ifdef _SEQUENT_
- yes
+ yes;
#endif
], LIBS="$LIBS -lsocket -linet";seqptx=1)
oldlibs="$LIBS"
LIBS="$LIBS -lelf"
-AC_COMPILE_CHECK(SVR4,[#include <utmpx.h>
+AC_CHECKING(SVR4)
+AC_TRY_LINK([#include <utmpx.h>
],,
-AC_HEADER_CHECK(dwarf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN),
-AC_HEADER_CHECK(elf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN)))
+AC_CHECK_HEADER(dwarf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN),
+AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN)))
,LIBS="$oldlibs")
+AC_CHECKING(for Solaris 2.x)
+AC_EGREP_CPP(yes,
+[#if defined(SVR4) && defined(sun)
+ yes
+#endif
+], LIBS="$LIBS -lsocket -lnsl -lkstat")
dnl
dnl **** typedefs ****
dnl
+dnl (currently not used)
+dnl
dnl AC_CHECKING(for pid_t)
-dnl AC_PROGRAM_EGREP(pid_t,[#include <sys/types.h>
+dnl AC_EGREP_CPP(pid_t,[#include <sys/types.h>
dnl ],AC_DEFINE(PID_T_DEFINED))
dnl
dnl AC_CHECKING(for sig_t)
-dnl AC_PROGRAM_EGREP(sig_t,[#include <sys/types.h>
+dnl AC_EGREP_CPP(sig_t,[#include <sys/types.h>
dnl #include <signal.h>
dnl ],AC_DEFINE(SIG_T_DEFINED))
dnl
dnl AC_CHECKING(for uid_t)
-dnl AC_PROGRAM_EGREP(uid_t,[#include <sys/types.h>
+dnl AC_EGREP_CPP(uid_t,[#include <sys/types.h>
dnl ],AC_DEFINE(UID_T_DEFINED))
+dnl
dnl
dnl **** Job control ****
dnl
-AC_COMPILE_CHECK([BSD job control],
+AC_CHECKING(BSD job jontrol)
+AC_TRY_LINK(
[#include <sys/types.h>
#include <sys/ioctl.h>
], [
@@ -195,7 +232,8 @@ int y = TIOCNOTTY;
dnl
dnl **** setreuid(), seteuid() ****
dnl
-AC_COMPILE_CHECK(setreuid, , [
+AC_CHECKING(setreuid)
+AC_TRY_LINK(,[
#ifdef __hpux
setresuid(0, 0, 0);
#else
@@ -208,28 +246,32 @@ dnl linux seteuid was broken before V1.1.11
dnl NeXT, AUX, ISC, and ultrix are still broken (no saved uid support)
dnl Solaris seteuid doesn't change the saved uid, bad for
dnl multiuser screen sessions
-AC_COMPILE_CHECK(seteuid, , [
+AC_CHECKING(seteuid)
+AC_TRY_LINK(,[
#if defined(linux) || defined(NeXT) || defined(_AUX_SOURCE) || defined(AUX) || defined(ultrix) || (defined(sun) && defined(SVR4)) || defined(ISC) || defined(sony_news)
seteuid_is_broken(0);
#else
seteuid(0);
#endif
], AC_DEFINE(HAVE_SETEUID))
+
dnl
dnl **** select() ****
dnl
-AC_COMPILE_CHECK(select,,[select(0, 0, 0, 0, 0);],,
+AC_CHECKING(select)
+AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],,
LIBS="$LIBS -lnet -lnsl"
-AC_COMPILE_CHECK(select with $LIBS,,[select(0, 0, 0, 0, 0);],,
-AC_ERROR(!!! no select - no screen))
+AC_CHECKING(select with $LIBS)
+AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],,
+AC_MSG_ERROR(!!! no select - no screen))
)
dnl
dnl **** FIFO tests ****
dnl
AC_CHECKING(fifos)
-AC_TEST_PROGRAM([
+AC_TRY_RUN([
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -285,13 +327,13 @@ main()
exit(1);
exit(0);
}
-], AC_NOTE(- your fifos are usable);fifo=1,
+], AC_NOTE(- your fifos are usable) fifo=1,
AC_NOTE(- your fifos are not usable))
rm -f /tmp/conftest*
if test -n "$fifo"; then
AC_CHECKING(for broken fifo implementation)
-AC_TEST_PROGRAM([
+AC_TRY_RUN([
#include <sys/types.h>
#include <fcntl.h>
#include <sys/time.h>
@@ -339,7 +381,7 @@ dnl may need LIBS="$LIBS -lsocket" here
dnl
AC_CHECKING(sockets)
-AC_TEST_PROGRAM([
+AC_TRY_RUN([
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
@@ -380,13 +422,13 @@ main()
exit(1);
exit(0);
}
-], AC_NOTE(- your sockets are usable);sock=1,
+], AC_NOTE(- your sockets are usable) sock=1,
AC_NOTE(- your sockets are not usable))
rm -f /tmp/conftest*
if test -n "$sock"; then
AC_CHECKING(socket implementation)
-AC_TEST_PROGRAM([
+AC_TRY_RUN([
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
@@ -439,7 +481,7 @@ if test -n "$fifo"; then
elif test -n "$sock"; then
AC_NOTE(- using unix-domain sockets, of course)
else
- AC_ERROR(you have neither usable sockets nor usable pipes -> no screen)
+ AC_MSG_ERROR(you have neither usable sockets nor usable pipes -> no screen)
fi
dnl
@@ -447,7 +489,7 @@ dnl **** check the select implementation ****
dnl
AC_CHECKING(select return value)
-AC_TEST_PROGRAM([
+AC_TRY_RUN([
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -470,7 +512,7 @@ main()
#ifdef __FreeBSD__
/* From Andrew A. Chernov (ache@astral.msk.su):
- * opening RDWR fifo fails in BSD 4.4, but select return values is
+ * opening RDWR fifo fails in BSD 4.4, but select return values are
* right.
*/
exit(0);
@@ -541,7 +583,8 @@ dnl
AC_CHECKING(for tgetent)
olibs="$LIBS"
LIBS="-lcurses $olibs"
-AC_COMPILE_CHECK(libcurses,,[
+AC_CHECKING(libcurses)
+AC_TRY_LINK(,[
#ifdef __hpux
__sorry_hpux_libcurses_is_totally_broken_in_10_10();
#else
@@ -549,18 +592,24 @@ tgetent((char *)0, (char *)0);
#endif
],,
LIBS="-ltermcap $olibs"
-AC_COMPILE_CHECK(libtermcap,,tgetent((char *)0, (char *)0);,,
+AC_CHECKING(libtermcap)
+AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
LIBS="-ltermlib $olibs"
-AC_COMPILE_CHECK(libtermlib,,tgetent((char *)0, (char *)0);,,
-AC_ERROR(!!! no tgetent - no screen))))
-
-AC_TEST_PROGRAM([
+AC_CHECKING(libtermlib)
+AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
+LIBS="-lncurses $olibs"
+AC_CHECKING(libncurses)
+AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
+AC_MSG_ERROR(!!! no tgetent - no screen)))))
+
+AC_TRY_RUN([
main()
{
exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
}], AC_NOTE(- you use the termcap database),
AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO))
-AC_COMPILE_CHECK(ospeed,extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
+AC_CHECKING(ospeed)
+AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
dnl
dnl **** PTY specific things ****
@@ -570,18 +619,33 @@ if test -r /dev/ptc; then
AC_DEFINE(HAVE_DEV_PTC)
fi
+AC_CHECKING(for SVR4 ptys)
+if test -c /dev/ptmx ; then
+AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],AC_DEFINE(HAVE_SVR4_PTYS))
+fi
+
AC_CHECKING(for ptyranges)
if test -d /dev/ptym ; then
pdir='/dev/ptym'
else
pdir='/dev'
fi
-ptys=`echo $pdir/pty??`
+dnl SCO uses ptyp%d
+AC_EGREP_CPP(yes,
+[#ifdef M_UNIX
+ yes;
+#endif
+], ptys=`echo /dev/ptyp??`, ptys=`echo $pdir/pty??`)
+dnl if test -c /dev/ptyp19; then
+dnl ptys=`echo /dev/ptyp??`
+dnl else
+dnl ptys=`echo $pdir/pty??`
+dnl fi
if test "$ptys" != "$pdir/pty??" ; then
p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'`
p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'`
-AC_DEFINE_UNQUOTED(PTYRANGE0,\"$p0\")
-AC_DEFINE_UNQUOTED(PTYRANGE1,\"$p1\")
+AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0")
+AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1")
fi
dnl **** pty mode/group handling ****
@@ -589,7 +653,7 @@ dnl
dnl support provided by Luke Mewburn <lm@rmit.edu.au>, 931222
AC_CHECKING(default tty permissions/group)
rm -f conftest_grp
-AC_TEST_PROGRAM([
+AC_TRY_RUN([
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
@@ -634,8 +698,9 @@ rm -f conftest_grp
dnl
dnl **** utmp handling ****
dnl
-dnl linux has a void pututline, grrr, gcc will error when evaluating it.
-AC_COMPILE_CHECK(getutent, [#include <time.h> /* to get time_t on SCO */
+AC_CHECKING(getutent)
+AC_TRY_LINK([
+#include <time.h> /* to get time_t on SCO */
#include <sys/types.h>
#if defined(SVR4) && !defined(DGUX)
#include <utmpx.h>
@@ -647,10 +712,12 @@ AC_COMPILE_CHECK(getutent, [#include <time.h> /* to get time_t on SCO */
#define pututline _pututline
#endif
],
-[int x = DEAD_PROCESS; struct utmp *y = pututline((struct utmp *)0); getutent();], AC_DEFINE(GETUTENT),
+[int x = DEAD_PROCESS; pututline((struct utmp *)0); getutent();], AC_DEFINE(GETUTENT),
olibs="$LIBS"
LIBS="$LIBS -lgen"
-AC_COMPILE_CHECK(getutent with -lgen, [#include <time.h>
+AC_CHECKING(getutent with -lgen)
+AC_TRY_LINK([
+#include <time.h>
#include <sys/types.h>
#if defined(SVR4) && !defined(DGUX)
#include <utmpx.h>
@@ -662,9 +729,11 @@ AC_COMPILE_CHECK(getutent with -lgen, [#include <time.h>
#define pututline _pututline
#endif
],
-[int x = DEAD_PROCESS; struct utmp *y = pututline((struct utmp *)0); getutent();], AC_DEFINE(GETUTENT), LIBS="$olibs")
+[int x = DEAD_PROCESS; pututline((struct utmp *)0); getutent();], AC_DEFINE(GETUTENT), LIBS="$olibs")
)
-AC_COMPILE_CHECK(ut_host, [#include <time.h>
+AC_CHECKING(ut_host)
+AC_TRY_COMPILE([
+#include <time.h>
#include <sys/types.h>
#if defined(SVR4) && !defined(DGUX)
#include <utmpx.h>
@@ -673,7 +742,11 @@ AC_COMPILE_CHECK(ut_host, [#include <time.h>
#include <utmp.h>
#endif
],[struct utmp u; u.ut_host[0] = 0;], AC_DEFINE(UTHOST))
-
+AC_CHECK_HEADER(utempter.h, have_utempter=yes, have_utempter=no)
+if test "$have_utempter" = yes; then
+ AC_DEFINE(HAVE_UTEMPTER)
+ LIBS="$LIBS -lutempter"
+fi
dnl
dnl **** loadav ****
@@ -682,20 +755,22 @@ AC_CHECKING(for libutil(s))
test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils"
test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil"
-AC_COMPILE_CHECK(getloadavg, , [getloadavg((double *)0, 0);],
+AC_CHECKING(getloadavg)
+AC_TRY_LINK(,[getloadavg((double *)0, 0);],
AC_DEFINE(LOADAV_GETLOADAVG) load=1,
if test -f /usr/lib/libkvm.a ; then
olibs="$LIBS"
LIBS="$LIBS -lkvm"
-AC_COMPILE_CHECK(getloadavg with -lkvm, , [getloadavg((double *)0, 0);],
+AC_CHECKING(getloadavg with -lkvm)
+AC_TRY_LINK(,[getloadavg((double *)0, 0);],
AC_DEFINE(LOADAV_GETLOADAVG) load=1, LIBS="$olibs")
fi
)
if test -z "$load" ; then
-AC_PROGRAM_EGREP(yes,
+AC_EGREP_CPP(yes,
[#if defined(NeXT) || defined(apollo) || defined(linux)
- yes
+ yes;
#endif
], load=1)
fi
@@ -710,15 +785,17 @@ if test ! -f $core && test ! -c $core ; then
AC_NOTE(- no kernelfile found)
else
AC_NOTE(- using kernelfile '$core')
- AC_DEFINE_UNQUOTED(LOADAV_UNIX,\"$core\")
- AC_HEADER_CHECK(nlist.h,
+ if test -r $core ; then
+ AC_DEFINE_UNQUOTED(LOADAV_UNIX,"$core")
+ AC_CHECK_HEADER(nlist.h,
[AC_DEFINE(NLIST_STRUCT)
- AC_COMPILE_CHECK(n_un in struct nlist, [#include <nlist.h>],
+ AC_CHECKING(n_un in struct nlist)
+ AC_TRY_COMPILE([#include <nlist.h>],
[struct nlist n; n.n_un.n_name = 0;],
AC_DEFINE(NLIST_NAME_UNION))])
AC_CHECKING(for nlist declaration)
- AC_PROGRAM_EGREP([nlist(( | )( | )*.*\(|\()],[
+ AC_EGREP_CPP([nlist(( | )( | )*.*\(|\()],[
#ifdef NLIST_STRUCT
# include <nlist.h>
#else
@@ -728,7 +805,7 @@ else
AC_CHECKING(for avenrun symbol)
for av in avenrun _avenrun _Loadavg ; do
- AC_TEST_PROGRAM([
+ AC_TRY_RUN([
#include <sys/types.h>
#ifdef NLIST_STRUCT
#include <nlist.h>
@@ -737,7 +814,7 @@ else
#endif
#ifdef __sgi
-# if _MIPS_SZLONG == 64
+# if _MIPS_SZLONG == 64 || (defined(_MIPS_ISA) && _MIPS_ISA > 2)
# define nlist nlist64
# endif
#endif
@@ -766,9 +843,18 @@ main()
AC_NOTE(- no avenrun symbol found)
else
AC_NOTE(- using avenrun symbol '$avensym')
- AC_DEFINE_UNQUOTED(LOADAV_AVENRUN,\"$avensym\")
+ AC_DEFINE_UNQUOTED(LOADAV_AVENRUN,"$avensym")
load=1
fi
+ else
+ AC_NOTE( Can't configure the load average display feature)
+ AC_NOTE( because $core is not readable by you.)
+ AC_NOTE( To configure the load average display feature,)
+ AC_NOTE( re-run configure as root if possible.)
+ AC_NOTE( If you are not the system administrator then disregard)
+ AC_NOTE( this warning. You can still use screen without)
+ AC_NOTE( the load average display feature.)
+ fi
fi
fi
@@ -776,7 +862,7 @@ AC_PROGRAM_SOURCE([
#include <sys/types.h>
#include <sys/param.h>
],[
-#if ((defined(hp300) && !defined(__hpux)) || defined(sun) || (defined(ultrix) && defined(mips)) || defined(_SEQUENT_) || defined(sgi) || defined(SVR4) || defined(sony_news) || defined(__alpha) || defined(_IBMR2) || defined(_AUX_SOURCE) || defined(AUX) || defined(m88k))
+#if ((defined(hp300) && !defined(__hpux)) || defined(sun) || (defined(ultrix) && defined(mips)) || defined(_SEQUENT_) || defined(sgi) || defined(SVR4) || defined(sony_news) || !(defined(__osf__) && defined(__alpha)) || defined(_IBMR2) || defined(_AUX_SOURCE) || defined(AUX) || defined(m88k))
loadtype=long
# if defined(apollo) || defined(_IBMR2) || defined(_AUX_SOURCE) || defined(AUX)
loadscale=65536
@@ -786,8 +872,8 @@ loadscale=65536
loadscale=FSCALE
# else
# ifdef sgi
-loadscale=1024
loadtype=int
+loadscale=1024
# else
# if defined(MIPS) || defined(SVR4) || defined(m88k)
loadscale=256
@@ -813,7 +899,6 @@ if test -n "$loadtype" ; then AC_DEFINE_UNQUOTED(LOADAV_TYPE,$loadtype) fi
if test -n "$loadnum" ; then AC_DEFINE_UNQUOTED(LOADAV_NUM,$loadnum) fi
if test -n "$loadscale" ; then AC_DEFINE_UNQUOTED(LOADAV_SCALE,$loadscale) fi
-
dnl
dnl **** signal handling ****
dnl
@@ -825,17 +910,19 @@ AC_DEFINE(SIGVOID)
else
-AC_COMPILE_CHECK([return type of signal handlers],
+AC_CHECKING(return type of signal handlers)
+AC_TRY_COMPILE(
[#include <sys/types.h>
#include <signal.h>
#ifdef signal
#undef signal
#endif
extern void (*signal ()) ();], [int i;], AC_DEFINE(SIGVOID))
-AC_COMPILE_CHECK(sigset, [
+AC_CHECKING(sigset)
+AC_TRY_LINK([
#include <sys/types.h>
#include <signal.h>
-], [
+],[
#ifdef SIGVOID
sigset(0, (void (*)())0);
#else
@@ -843,7 +930,7 @@ sigset(0, (int (*)())0);
#endif
], AC_DEFINE(USESIGSET))
AC_CHECKING(signal implementation)
-AC_TEST_PROGRAM([
+AC_TRY_RUN([
#include <sys/types.h>
#include <signal.h>
@@ -886,19 +973,35 @@ dnl
AC_CHECKING(for crypt and sec libraries)
test -f /lib/libcrypt_d.a || test -f /usr/lib/libcrypt_d.a && LIBS="$LIBS -lcrypt_d"
-test -f /lib/libcrypt.a || test -f /usr/lib/libcrypt.a && LIBS="$LIBS -lcrypt"
+oldlibs="$LIBS"
+LIBS="$LIBS -lcrypt"
+AC_CHECKING(crypt)
+AC_TRY_LINK(,,,LIBS="$oldlibs")
test -f /lib/libsec.a || test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec"
test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow"
-
oldlibs="$LIBS"
LIBS="$LIBS -lsun"
-AC_COMPILE_CHECK(IRIX sun library,,,,LIBS="$oldlibs")
-
+AC_CHECKING(IRIX sun library)
+AC_TRY_LINK(,,,LIBS="$oldlibs")
+
+AC_CHECKING(syslog)
+AC_TRY_LINK(,[closelog();], , [oldlibs="$LIBS"
+LIBS="$LIBS -lbsd"
+AC_CHECKING(syslog in libbsd.a)
+AC_TRY_LINK(, [closelog();], AC_NOTE(- found.), [LIBS="oldlibs"
+AC_NOTE(- bad news: syslog missing.) AC_DEFINE(NOSYSLOG)])])
+
+AC_EGREP_CPP(yes,
+[#ifdef M_UNIX
+ yes;
+#endif
+], LIBS="$LIBS -lsocket -lcrypt_i")
dnl
dnl **** misc things ****
dnl
-AC_COMPILE_CHECK(wait union,[#include <sys/types.h>
+AC_CHECKING(wait union)
+AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/wait.h>
],[
union wait x;
@@ -910,21 +1013,22 @@ AC_COMPILE_CHECK(wait union,[#include <sys/types.h>
if test -z "$butterfly"; then
AC_CHECKING(for termio or termios)
-AC_TEST_CPP([#include <termio.h>], AC_DEFINE(TERMIO),
+AC_TRY_CPP([#include <termio.h>], AC_DEFINE(TERMIO),
if test -n "$posix"; then
-AC_TEST_CPP([#include <termios.h>], AC_DEFINE(TERMIO))
+AC_TRY_CPP([#include <termios.h>], AC_DEFINE(TERMIO))
fi
)
fi
-dnl AC_HEADER_CHECK(shadow.h, AC_DEFINE(SHADOWPW))
-AC_COMPILE_CHECK(getspnam, [#include <shadow.h>], [getspnam("x");],
- AC_DEFINE(SHADOWPW))
+dnl AC_CHECK_HEADER(shadow.h, AC_DEFINE(SHADOWPW))
+AC_CHECKING(getspnam)
+AC_TRY_LINK([#include <shadow.h>], [getspnam("x");],AC_DEFINE(SHADOWPW))
-AC_COMPILE_CHECK(getttyent, , [getttyent();], AC_DEFINE(GETTTYENT))
+AC_CHECKING(getttyent)
+AC_TRY_LINK(,[getttyent();], AC_DEFINE(GETTTYENT))
AC_CHECKING(whether memcpy/memmove/bcopy handles overlapping arguments)
-AC_TEST_PROGRAM([
+AC_TRY_RUN([
main() {
char buf[10];
strcpy(buf, "abcdefghi");
@@ -938,7 +1042,7 @@ main() {
exit(0); /* libc version works properly. */
}], AC_DEFINE(USEBCOPY))
-AC_TEST_PROGRAM([
+AC_TRY_RUN([
#define bcopy(s,d,l) memmove(d,s,l)
main() {
char buf[10];
@@ -954,7 +1058,7 @@ main() {
}], AC_DEFINE(USEMEMMOVE))
-AC_TEST_PROGRAM([
+AC_TRY_RUN([
#define bcopy(s,d,l) memcpy(d,s,l)
main() {
char buf[10];
@@ -969,57 +1073,49 @@ main() {
exit(0); /* libc version works properly. */
}], AC_DEFINE(USEMEMCPY))
-AC_CHECKING(for long file names)
+AC_MSG_CHECKING(long file names)
(echo 1 > /tmp/conftest9012345) 2>/dev/null
(echo 2 > /tmp/conftest9012346) 2>/dev/null
val=`cat /tmp/conftest9012345 2>/dev/null`
-if test -f /tmp/conftest9012345 && test "$val" = 1; then :
-else AC_DEFINE(NAME_MAX, 14)
+if test -f /tmp/conftest9012345 && test "$val" = 1; then
+AC_MSG_RESULT(yes)
+else
+AC_MSG_RESULT(no)
+AC_DEFINE(NAME_MAX, 14)
fi
rm -f /tmp/conftest*
-AC_COMPILE_CHECK(vsprintf, [
-#include <stdio.h>], [vsprintf(0,0,0);], AC_DEFINE(USEVARARGS))
+AC_MSG_CHECKING(for vsprintf)
+AC_TRY_LINK(,[vsprintf(0,0,0);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no))
-AC_DIR_HEADER
-AC_XENIX_DIR
+AC_HEADER_DIRENT
-AC_COMPILE_CHECK(setenv, , [setenv((char *)0,(char *)0);unsetenv((char *)0);], AC_DEFINE(USESETENV),
-AC_COMPILE_CHECK(putenv, , [putenv((char *)0);unsetenv((char *)0);], ,
-AC_DEFINE(NEEDPUTENV)
+AC_MSG_CHECKING(for setenv)
+AC_TRY_LINK(,[setenv((char *)0,(char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes);AC_DEFINE(USESETENV),
+AC_MSG_RESULT(no)
+AC_MSG_CHECKING(for putenv)
+AC_TRY_LINK(,[putenv((char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no);AC_DEFINE(NEEDPUTENV)
))
-AC_COMPILE_CHECK(rename, , [rename(0,0);], , AC_DEFINE(NEED_RENAME))
-AC_COMPILE_CHECK(_exit, , [_exit(0);], AC_DEFINE(HAVE__EXIT))
-AC_COMPILE_CHECK(lstat, , [lstat(0,0);], AC_DEFINE(HAVE_LSTAT))
-AC_COMPILE_CHECK(strerror, ,[strerror(0);], AC_DEFINE(HAVE_STRERROR))
-AC_COMPILE_CHECK(utimes, ,[utimes(0,0);], AC_DEFINE(HAVE_UTIMES))
-AC_COMPILE_CHECK(vsnprintf, ,[vsnprintf(0,0,0);], AC_DEFINE(HAVE_VSNPRINTF))
+AC_CHECK_FUNCS(rename fchmod fchown strerror lstat _exit utimes vsnprintf getcwd)
dnl
dnl **** the end ****
dnl
dnl Ptx bug workaround -- insert -lc after -ltermcap
-test -n "$seqptx" && LIBS="-ltermcap -lc -lsocket -linet -lsec -lseq"
+test -n "$seqptx" && LIBS="-ltermcap -lc -lsocket -linet -lnsl -lsec -lseq"
-AC_TEST_PROGRAM(main(){exit(0);},,AC_ERROR(Can't run the compiler - internal error. Sorry.))
+AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.))
if test -n "$prefix"; then
-AC_DEFINE_UNQUOTED(ETCSCREENRC,\"$prefix/etc/screenrc\")
+AC_DEFINE_UNQUOTED(ETCSCREENRC,"$prefix/etc/screenrc")
fi
-AC_OUTPUT(Makefile doc/Makefile)
-
+AC_OUTPUT(Makefile doc/Makefile, [[
# a hook for preserving undef directive in config.h
-if test -z "$no_create" ; then
mv config.h conftest
sed -e 's@^\(.*\)defin.\( .*\) .*/\*\(.*KEEP_UNDEF_HERE\)@\1undef\2 /\*\3@' < conftest > config.h
rm -f conftest
-fi
-cat >> config.status << EOF
-mv config.h conftest
-sed -e 's@^\(.*\)defin.\( .*\) .*/\*\(.*KEEP_UNDEF_HERE\)@\1undef\2 /\*\3@' < conftest > config.h
-rm -f conftest
-EOF
+]])
echo ""
if test -z "$AWK"; then