home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / E-zine / Magazines / crh / freebsd / rootkit / sniffit.0.3.5 / libpcap-0.3 / configure.in < prev    next >
Encoding:
Text File  |  2002-05-27  |  3.0 KB  |  157 lines

  1. dnl @(#) $Header: configure.in,v 1.58 96/11/30 20:05:44 leres Exp $ (LBL)
  2. dnl
  3. dnl Copyright (c) 1994, 1995, 1996
  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_INIT(pcap.c)
  10.  
  11. AC_CANONICAL_SYSTEM
  12.  
  13. umask 002
  14.  
  15. if test -z "$PWD" ; then
  16.     PWD=`pwd`
  17. fi
  18.  
  19. AC_LBL_C_INIT(V_CCOPT, V_INCLS)
  20.  
  21. AC_CHECK_HEADERS(malloc.h sys/ioccom.h sys/sockio.h)
  22.  
  23. AC_LBL_FIXINCLUDES
  24.  
  25. AC_CHECK_FUNCS(ether_hostton strerror)
  26.  
  27. dnl
  28. dnl Not all versions of test support -c (character special) but it's a
  29. dnl better way of testing since the device might be protected. So we
  30. dnl check in our normal order using -r and then check the for the /dev
  31. dnl guys again using -c.
  32. dnl
  33. AC_MSG_CHECKING(packet capture type)
  34. if test -r /dev/bpf0 ; then
  35.     V_PCAP=bpf
  36. elif test -r /usr/include/net/pfilt.h ; then
  37.     V_PCAP=pf
  38. elif test -r /dev/enet ; then
  39.     V_PCAP=enet
  40. elif test -r /dev/nit ; then
  41.     V_PCAP=snit
  42. elif test -r /usr/include/sys/net/nit.h ; then
  43.     V_PCAP=nit
  44. elif test -r /usr/include/net/raw.h ; then
  45.     V_PCAP=snoop
  46. elif test -r /usr/include/sys/dlpi.h ; then
  47.     V_PCAP=dlpi
  48. elif test -r /usr/include/linux/socket.h ; then
  49.     V_PCAP=linux
  50. elif test -c /dev/bpf0 ; then        # check again in case not readable
  51.     V_PCAP=bpf
  52. elif test -c /dev/enet ; then        # check again in case not readable
  53.     V_PCAP=enet
  54. elif test -c /dev/nit ; then        # check again in case not readable
  55.     V_PCAP=snit
  56. else
  57.     V_PCAP=null
  58. fi
  59. AC_MSG_RESULT($V_PCAP)
  60.  
  61. case "$V_PCAP" in
  62.  
  63. null)
  64.     AC_MSG_WARN(cannot determine packet capture interface)
  65.     AC_MSG_WARN((see INSTALL for more info))
  66.     ;;
  67.  
  68. dlpi)
  69.     AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
  70.     AC_MSG_CHECKING(for /dev/dlpi device)
  71.     if test -c /dev/dlpi ; then
  72.         AC_MSG_RESULT(yes)
  73.         AC_DEFINE(HAVE_DEV_DLPI)
  74.     else
  75.         AC_MSG_RESULT(no)
  76.         dir="/dev/dlpi"
  77.         AC_MSG_CHECKING(for $dir directory)
  78.         if test -d $dir ; then
  79.             AC_MSG_RESULT(yes)
  80.             AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir")
  81.         else
  82.             AC_MSG_RESULT(no)
  83.         fi
  84.     fi
  85.     ;;
  86. esac
  87.  
  88. AC_LBL_LEX_AND_YACC(V_LEX, V_YACC, pcap_)
  89.  
  90. case "$target_os" in
  91.  
  92. aix*)
  93.     dnl Workaround to enable certain features
  94.     AC_DEFINE(_SUN)
  95.     ;;
  96.  
  97. hpux9*)
  98.     AC_DEFINE(HAVE_HPUX9)
  99.     ;;
  100.  
  101. sinix*)
  102.     AC_MSG_CHECKING(if SINIX compiler defines sinix)
  103.     AC_CACHE_VAL(ac_cv_cc_sinix_defined,
  104.         AC_TRY_COMPILE(
  105.             [],
  106.             [int i = sinix;],
  107.             ac_cv_cc_sinix_defined=yes,
  108.             ac_cv_cc_sinix_defined=no))
  109.         AC_MSG_RESULT($ac_cv_cc_sinix_defined)
  110.         if test $ac_cv_cc_sinix_defined = no ; then
  111.             AC_DEFINE(sinix)
  112.         fi
  113.     ;;
  114.  
  115. solaris*)
  116.     AC_DEFINE(HAVE_SOLARIS)
  117.     ;;
  118.  
  119. linux*)
  120.     V_INCLS="$V_INCLS -Ilinux-include"
  121.     ;;
  122. esac
  123.  
  124. AC_CHECK_PROGS(V_RANLIB, ranlib, @true)
  125.  
  126. AC_LBL_DEVEL(V_CCOPT)
  127.  
  128. AC_LBL_SOCKADDR_SA_LEN
  129.  
  130. AC_LBL_UNALIGNED_ACCESS
  131.  
  132. if test -r lbl/gnuc.h ; then
  133.     rm -f gnuc.h
  134.     ln -s lbl/gnuc.h gnuc.h
  135. fi
  136.  
  137. rm -f bpf_filter.c
  138. ln -s bpf/net/bpf_filter.c bpf_filter.c
  139. rm -f net
  140. ln -s bpf/net net
  141.  
  142. AC_SUBST(V_CCOPT)
  143. AC_SUBST(V_INCLS)
  144. AC_SUBST(V_LEX)
  145. AC_SUBST(V_PCAP)
  146. AC_SUBST(V_RANLIB)
  147. AC_SUBST(V_YACC)
  148.  
  149. AC_PROG_INSTALL
  150.  
  151. AC_OUTPUT(Makefile)
  152.  
  153. if test -f .devel ; then
  154.     make depend
  155. fi
  156. exit 0
  157.