dnl Process this file with autoconf to produce a configure script. AC_INIT(include/netinet/if_ether.h) dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET AC_CHECK_LIB(X11_s, main, result=yes, result=no) if test $result = "yes"; then LIBS="$LIBS -lX11_s" fi AC_CHECK_LIB(Xm_s, main, result=yes, result=no) if test $result = "yes"; then LIBS="$LIBS -lXm_s" fi AC_CHECK_LIB(Xt_s, main, result=yes, result=no) if test $result = "yes"; then LIBS="$LIBS -lXt_s" fi AC_CHECK_LIB(c_s, main, result=yes, result=no) if test $result = "yes"; then LIBS="$LIBS -lc_s" fi AC_CHECK_LIB(nsl, main, result=yes, result=no) if test $result = "yes"; then LIBS="$LIBS -lnsl" fi AC_CHECK_LIB(resolv, main, result=yes, result=no) if test $result = "yes"; then LIBS="$LIBS -lresolv" fi AC_CHECK_LIB(rpc, main, result=yes, result=no) if test $result = "yes"; then LIBS="$LIBS -lrpc" fi dnl check for socket compatibility libraries (Solaris) check_tirpc="" AC_MSG_CHECKING(for rpc socket compatibility) echo "main() {return(1);}" > configtest.c if test -z "`${CC-cc} -o configtest.out configtest.c /usr/ucblib/librpcsoc.so 2>&1`"; then AC_MSG_RESULT(yes) # do we accept the -R option? AC_MSG_CHECKING(for runtime linkage option) if test -z "`${CC-cc} -o configtest.out -R/usr/lib configtest.c 2>&1`"; then AC_MSG_RESULT(yes) LIBS="-L/usr/ucblib -R/usr/ucblib -lrpcsvc -lrpcsoc $LIBS" else AC_MSG_RESULT(no) check_tirpc="y" fi else AC_MSG_RESULT(no) check_tirpc="y" fi rm -f configtest.* dnl check for librpcsvc only if we're not already using dnl /usr/ucblib/librpcsvc if test -n "$check_tirpc"; then AC_CHECK_LIB(rpcsvc, main, result=yes, result=no) if test $result = "yes"; then LIBS="$LIBS -lrpcsvc" fi fi AC_CHECK_LIB(socket, main, result=yes, result=no) if test $result = "yes"; then LIBS="$LIBS -lsocket" fi AC_CHECK_LIB(sun, getpwnam, result=yes, result=no) if test $result = "yes"; then LIBS="$LIBS -lsun" fi AC_CHECK_LIB(PW, main, result=yes, result=no) if test $result = "yes"; then dnl must go before other libs on HP-UX 11 LIBS="-lPW $LIBS" fi dnl check for +DAportable option (HP-UX) AC_MSG_CHECKING(for +DAportable) echo "main() {return(1);}" > configtest.c if test -z "`${CC-cc} -c $CFLAGS +DAportable $CPPFLAGS configtest.c 2>&1`"; then AC_MSG_RESULT(yes) AC_MSG_CHECKING(for +DAportable when linking) if test -z "`${CC-cc} -o configtest $CFLAGS +DAportable $CPPFLAGS $LDFLAGS configtest.c $LIBS 2>&1`"; then AC_MSG_RESULT(yes) CFLAGS="$CFLAGS +DAportable" else AC_MSG_RESULT(no) fi else AC_MSG_RESULT(no) fi rm -f configtest.* dnl check for missing /usr/include/asm link skip_limits_h="" AC_CHECK_HEADER(asm/socket.h, result=yes, result=no) if test $result = no; then AC_MSG_CHECKING(for socket.h under /usr/src/linux) echo "#include " > configtest.c echo "main() {return(1);}" >> configtest.c if test -z "`${CC-cc} -I/usr/src/linux/include -c -o configtest.o configtest.c 2>&1`"; then AC_MSG_RESULT(yes) CPPFLAGS="$CPPFLAGS -I/usr/src/linux/include" skip_limits_h="y" else AC_MSG_RESULT(no) AC_MSG_CHECKING(for socket.h in asm-i386) if test -r /usr/src/linux/include/asm-i386/socket.h; then CPPFLAGS="$CPPFLAGS -I`pwd`/include/ASM-i386" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi fi rm configtest.* fi dnl check for missing /usr/include/linux link if test -z "$skip_limits_h"; then AC_CHECK_HEADER(linux/limits.h, result=yes, result=no) if test $result = no; then AC_MSG_CHECKING(for limits.h under /usr/src/linux) AC_TRY_COMPILE([#include "/usr/src/linux/include/linux/limits.h"], [return(0)], result=yes, result=no) if test $result = yes; then CPPFLAGS="$CPPFLAGS -I/usr/src/linux/include" fi AC_MSG_RESULT($result) fi fi dnl header files AC_HEADER_STDC dnl check for TIRPC only if we're not using the rpc socket compatibility libraries if test -n "$check_tirpc"; then AC_MSG_CHECKING(for TIRPC compatibility) AC_TRY_COMPILE([#include #include #include ], [return(0)], result=yes, result=no) if test $result = yes; then AC_DEFINE(TIRPC) fi AC_MSG_RESULT($result) fi dnl typedefs AC_TYPE_GETGROUPS dnl check whether sys_errlist is declared in stdio.h or errno.h AC_MSG_CHECKING(if sys_errlist is declared) AC_TRY_COMPILE([#include #include ], [char *msg = *(sys_errlist + 1)], result=yes, result=no) if test $result = yes; then AC_DEFINE(SYS_ERRLIST_DECLARED) fi AC_MSG_RESULT($result) dnl check whether we need our own netinet AC_MSG_CHECKING(if system netinet headers work) AC_TRY_COMPILE([#include #include #include #include #include #include #include #include ], [int i = ICMP_UNREACH; int i1 = ICMP_UNREACH_HOST; int j = ICMP_MINLEN; int j1 = ICMP_UNREACH_PORT; struct icmp k; struct tcphdr *l; int m = sizeof(l->th_dport)], result=yes, result=no) AC_MSG_RESULT($result) if test $result = no; then CPPFLAGS="$CPPFLAGS -I`pwd`/include" AC_DEFINE(_BSD_SOURCE) dnl check for glibc21 AC_MSG_CHECKING(for glibc21) AC_TRY_COMPILE([#include ], [return(0)], result=yes, result=no) if test $result = yes; then AC_MSG_RESULT(no) else CPPFLAGS="$CPPFLAGS -I`pwd`/include/glibc21" AC_MSG_RESULT(yes) fi fi AC_SUBST(PROGS) PROGS=all dnl check whether we need to compile showmount if test -n "`uname | grep Linux`"; then AC_CHECK_PROG(HAVE_SHOWMOUNT,showmount,"yes","no",/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin:$PATH) if test $HAVE_SHOWMOUNT = "no"; then PROGS="$PROGS showmount" fi fi dnl check whether we need to compile rpcgen AC_PATH_PROG(RPCGEN,rpcgen,../../bin/rpcgen,/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin:$PATH) if test $RPCGEN = "../../bin/rpcgen"; then PROGS="rpcgen $PROGS" fi AC_OUTPUT(Makefile) perl reconfig