1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
AC_INIT(README)
# handle case when -srcdir is invoked: make location directory for generated
# header files
if test ! -d ./dis ; then
mkdir ./dis
fi
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_HEADER_STDC
AC_CHECK_HEADER(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
AC_CHECK_HEADERS(stdlib.h unistd.h string.h memory.h fcntl.h)
AC_HEADER_TIME
AC_CHECK_LIB(socket, bind, [LIBS="$LIBS -lsocket"])
AC_CHECK_LIB(nsl, xdr_free, [LIBS="$LIBS -lnsl"])
AC_CHECK_LIB(gdbm, dbm_fetch, [LIBS="$LIBS -lgdbm"])
AC_DEFUN(AC_STRUCT_MSG_ACCRIGHTS,
[AC_CACHE_CHECK([for msg_accrights in struct msghdr], ac_cv_struct_msg_accrights,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>], [struct msghdr s; s.msg_accrights;],
ac_cv_struct_msg_accrights=yes, ac_cv_struct_msg_accrights=no)])
if test $ac_cv_struct_msg_accrights = yes; then
AC_DEFINE(HAVE_MSG_ACCRIGHTS)
fi
])
AC_DEFUN(AC_STRUCT_MSG_CONTROL,
[AC_CACHE_CHECK([for msg_control in struct msghdr], ac_cv_struct_msg_control,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>], [struct msghdr s; s.msg_control;],
ac_cv_struct_msg_control=yes, ac_cv_struct_msg_control=no)])
if test $ac_cv_struct_msg_control = yes; then
AC_DEFINE(HAVE_MSG_CONTROL)
fi
])
AC_DEFUN(AC_HAVE_RECVMSG,
[AC_CACHE_CHECK([for recvmsg system call], ac_cv_have_recvmsg,
[AC_TRY_LINK([#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>], [int s, f; struct msghdr m; recvmsg(s, &m, f);],
ac_cv_have_recvmsg=yes, ac_cv_have_recvmsg=no)])
if test $ac_cv_have_recvmsg = yes; then
AC_DEFINE(HAVE_RECVMSG)
fi
])
AC_STRUCT_MSG_ACCRIGHTS
AC_STRUCT_MSG_CONTROL
AC_HAVE_RECVMSG
AC_CHECK_LIB(elf, elf_end, [LIBS="$LIBS -lelf"])
# Solaris special handling ...
if uname -sr | grep '^SunOS 5' >/dev/null ; then
LIBS="$LIBS -R/usr/ucblib -L/usr/ucblib -lucb"
fi
AC_HAVE_LIBRARY(dnet_stub, [LIBS="$LIBS -ldnet_stub"])
if uname -srv | grep '^AIX 2 3' >/dev/null ; then
:
else
AC_HAVE_LIBRARY(bsd, [LIBS="$LIBS -lbsd"])
fi
LIBS="$LIBS -lm"
AC_REPLACE_FUNCS(strdup)
dnl Check for dbm_* routine buried in libc (Solaris)
AC_CHECK_LIB(c, dbm_fetch, [DBMLIB=""], [DBMLIB="-ldbm"])
AC_MSG_CHECKING("whether RPCGEN generates ANSI C function prototypes")
cat > conftest.x << EOF
program TESTPRG
{
version TESTVER
{
void TESTFUN(void) = 0;
} = 1;
} = 1;
EOF
if rpcgen -h conftest.x | grep testfun_1_svc > /dev/null
then
AC_MSG_RESULT("prototyped")
AC_DEFINE(HAVE_NEW_RPCGEN)
else
AC_MSG_RESULT("classic")
fi
AC_SUBST(dsubdirs)
AC_SUBST(DBM)
AC_SUBST(DB_LOADER)
AC_SUBST(SIMX_INCLUDES)
dsubdirs="lib"
dnl Hide away non-dbm libraries, since mdw_CHECK_MANYLIBS always
dnl modifies LIBS. This might not be necessary - the only consequence
dnl of not doing this is that the test programs get needlessly linked
dnl against dbm.
NON_DBM_LIBS="$LIBS"
mdw_CHECK_MANYLIBS(dbm_fetch,db dbm gdbm,[
AC_DEFINE(HAVE_NDBM)
DBM="$LIBS"
DB_LOADER=create-tables-4
],[
dsubdirs="$dsubdirs sdbm"
DBM="$LIBS -L../sdbm -lsdbm"
SIMX_INCLUDES="-I../sdbm"
DB_LOADER=create-tables-5
])
LIBS="$NON_DBM_LIBS"
dsubdirs="$dsubdirs server data test"
AC_CONFIG_SUBDIRS(disgen)
AC_OUTPUT(Makefile lib/Makefile sdbm/Makefile server/Makefile data/Makefile test/Makefile)
|