home *** CD-ROM | disk | FTP | other *** search
/ ftp.shrubbery.net / 2015-02-07.ftp.shrubbery.net.tar / ftp.shrubbery.net / pub / astraceroute / astraceroute-1.4.a12.2.tar.gz / astraceroute-1.4.a12.2.tar / astraceroute-1.4.a12.2 / configure.in < prev    next >
Text File  |  2008-11-17  |  3KB  |  157 lines

  1. dnl @(#) $Id: configure.in,v 1.4 2008/11/17 10:00:11 heas Exp $ (LBL)
  2. dnl
  3. dnl Copyright (c) 1995, 1996, 1997, 1999, 2000
  4. dnl    The Regents of the University of California.  All rights reserved.
  5. dnl
  6. dnl Process this file with autoconf to produce a configure script.
  7. dnl
  8.  
  9. AC_PREREQ(2.13)
  10. AC_INIT(traceroute.c)
  11. AM_INIT_AUTOMAKE(astraceroute, `cat VERSION`)
  12. VERSION=`cat VERSION`
  13. AC_SUBST(VERSION)
  14.  
  15. AC_PROG_MAKE_SET()
  16.  
  17. umask 002
  18.  
  19. if test -z "$PWD" ; then
  20.     PWD=`pwd`
  21. fi
  22.  
  23. AC_LBL_C_INIT([V_CCOPT], [V_INCLS])
  24.  
  25. # compiler specifics
  26. AC_PROG_CC
  27. AM_C_PROTOTYPES
  28. AC_PROG_CPP
  29. AC_C_CONST
  30. AC_C_INLINE
  31. AC_C_STRINGIZE
  32.  
  33. AC_CHECK_HEADERS(malloc.h sys/select.h sys/sockio.h net/route.h \
  34.     net/if_dl.h inet/mib2.h)
  35.  
  36. AC_REPLACE_FUNCS(strerror usleep)
  37. AC_CHECK_FUNCS(setlinebuf)
  38. if test $ac_cv_func_usleep = "no" ; then
  39.     AC_CHECK_FUNCS(nanosleep)
  40. fi
  41.  
  42. AC_LBL_LIBRARY_NET
  43. AC_CANONICAL_HOST
  44. case "$host_os" in
  45. bsd4*)
  46.     AC_DEFINE(HAVE_RAW_OPTIONS)
  47.     ;;
  48.  
  49. bsdi*)
  50.     AC_DEFINE(HAVE_RAW_OPTIONS)
  51.     ;;
  52.  
  53. freebsd*)
  54.     AC_DEFINE(HAVE_RAW_OPTIONS)
  55.     ;;
  56.  
  57. linux*)
  58.     V_INCLS="$V_INCLS -Ilinux-include"
  59.     AC_DEFINE(BYTESWAP_IP_HDR)
  60.     ;;
  61.  
  62. osf3*)
  63.     dnl Workaround around ip_hl vs. ip_vhl problem in netinet/ip.h
  64.     AC_DEFINE(__STDC__,2)
  65.     ;;
  66.  
  67. solaris2.[[012345]]*)
  68.     AC_DEFINE(BYTESWAP_IP_HDR)
  69.     AC_DEFINE(CANT_HACK_IPCKSUM)
  70.     ;;
  71.  
  72. solaris*)
  73.     AC_DEFINE(BYTESWAP_IP_HDR)
  74.     ;;
  75. esac
  76.  
  77. dnl
  78. dnl What kind of routing table lookup do we have?
  79. dnl
  80. AC_MSG_CHECKING(routing table type)
  81. t="generic"
  82. if test $ac_cv_header_inet_mib2_h = yes ; then
  83.     t="mib"
  84. elif test $ac_cv_header_net_route_h = yes -a \
  85.     $ac_cv_header_net_if_dl_h = yes ; then
  86.     t="socket"
  87. elif test -f /proc/net/route ; then
  88.     t="linux"
  89. else
  90.     t="generic"
  91. fi
  92. AM_CONDITIONAL(FAMIB, [test $t = "mib"])
  93. AM_CONDITIONAL(FASOCKET, [test $t = "socket"])
  94. AM_CONDITIONAL(FALINUX, [test $t = "linux"])
  95. AM_CONDITIONAL(FAGENERIC, [test $t = "generic"])
  96. AC_MSG_RESULT(${t})
  97.  
  98. AC_SEARCH_LIBS([res_query], [resolv], [], [
  99.     AC_ERROR([Could not find res_query()])])
  100.  
  101. AC_LBL_CHECK_TYPE(int32_t, int)
  102. AC_LBL_CHECK_TYPE(u_int32_t, u_int)
  103.  
  104. AC_LBL_DEVEL(V_CCOPT)
  105.  
  106. AC_LBL_SOCKADDR_SA_LEN
  107.  
  108. AC_MSG_CHECKING(if struct icmp has icmp_nextmtu)
  109. AC_CACHE_VAL(ac_cv_struct_icmp_has_icmp_nextmtu,
  110.     LBL_SAVE_CFLAGS="$CFLAGS"
  111.     CFLAGS="$CFLAGS $V_INCLS"
  112.     AC_TRY_COMPILE([   
  113. #       include <sys/param.h>
  114. #    include <sys/socket.h>
  115. #    include <netinet/in_systm.h>
  116. #       if __STDC__
  117.         /* osf3 has REALLY good prototyes */
  118.         struct mbuf;
  119.         struct rtentry;
  120. #       endif
  121. #       include <netinet/in.h>
  122. #       include <netinet/ip.h>
  123. #       include <netinet/ip_icmp.h>
  124. #       include <netinet/if_ether.h>],
  125.     [u_int i = sizeof(((struct icmp *)0)->icmp_nextmtu)],
  126.     ac_cv_struct_icmp_has_icmp_nextmtu=yes,
  127.     ac_cv_struct_icmp_has_icmp_nextmtu=no)
  128.     CFLAGS="$LBL_SAVE_CFLAGS")
  129. AC_MSG_RESULT($ac_cv_struct_icmp_has_icmp_nextmtu)
  130. if test $ac_cv_struct_icmp_has_icmp_nextmtu = yes ; then
  131.     AC_DEFINE(HAVE_ICMP_NEXTMTU)
  132. fi
  133.  
  134. if test "${srcdir}" = "." ; then
  135.     srcdirprefix=""
  136. else
  137.     srcdirprefix="./"
  138. fi
  139.  
  140. if test -r ${srcdirprefix}lbl/gnuc.h ; then
  141.     rm -f gnuc.h
  142.     ln -s ${srcdirprefix}lbl/gnuc.h gnuc.h
  143. fi
  144.  
  145. AC_SUBST(V_CCOPT)
  146. AC_SUBST(V_INCLS)
  147.  
  148. AC_PROG_INSTALL
  149.  
  150. AC_OUTPUT(Makefile version.h)
  151.  
  152. if test -f .devel ; then
  153.     make depend
  154. fi
  155.  
  156. exit 0
  157.