"Fossies" - the Fresh Open Source Software Archive

Member "scanssh-2.1/configure.in" (5 Mar 2005, 9737 Bytes) of package /linux/privat/old/scanssh-2.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 dnl Process this file with autoconf to produce a configure script.
    2 AC_INIT(scanssh)
    3 AC_CONFIG_SRCDIR(scanssh.c)
    4 
    5 AM_INIT_AUTOMAKE(scanssh, 2.1)
    6 AM_CONFIG_HEADER(config.h)
    7 
    8 dnl Check for system type.
    9 dnl XXX - we do this to qualify our later feature checks, since some
   10 dnl systems claim to support multiple features, but are quite b0rked.
   11 AC_CANONICAL_HOST
   12 
   13 dnl Initialize prefix.
   14 if test "$prefix" = "NONE"; then
   15    prefix="/usr/local"
   16 fi
   17 
   18 dnl Checks for programs.
   19 AC_PROG_CC
   20 AC_PROG_INSTALL
   21 
   22 dnl XXX - Solaris sux.
   23 AC_CHECK_LIB(socket, socket)
   24 AC_CHECK_LIB(nsl, gethostbyname)
   25 
   26 dnl XXX - we need WinPcap developer's pack under Cygwin for win32
   27 AC_CYGWIN
   28 if test "$CYGWIN" = yes ; then
   29     if test -d /usr/include/mingw ; then
   30         CPPFLAGS="$CPPFLAGS -mno-cygwin"
   31         CFLAGS="$CFLAGS -mno-cygwin"
   32         AC_DEFINE(WIN32_LEAN_AND_MEAN, 1, 
   33             [Define for faster code generation.])
   34         AC_CHECK_LIB(ws2_32, main)
   35         AC_CHECK_LIB(iphlpapi, main)
   36         AC_DEFINE(snprintf, _snprintf, 
   37             [Use MingW32's internal snprintf])
   38     else
   39         AC_MSG_ERROR([need MingW32 package to build under Cygwin])
   40     fi
   41     AC_MSG_CHECKING(for WinPcap developer's pack)
   42     AC_ARG_WITH(wpdpack,
   43     [  --with-wpdpack=DIR      use WinPcap developer's pack in DIR],
   44     [ AC_MSG_RESULT($withval)
   45       if test -f $withval/include/packet32.h -a -f $withval/lib/packet.a; then
   46          owd=`pwd`
   47          if cd $withval; then withval=`pwd`; cd $owd; fi
   48          CFLAGS="$CFLAGS -I$withval/include"
   49          LIBS="$LIBS -L$withval/lib -lpacket"
   50       else
   51          AC_MSG_ERROR(packet32.h or packet.a not found in $withval)
   52       fi ],
   53     [ for dir in ${prefix} ${HOME}/WPdpack ; do
   54          if test -f ${dir}/include/packet32.h -a -f ${dir}/lib/packet.a; then
   55             CFLAGS="$CFLAGS -I${dir}/include"
   56         LIBS="$LIBS -L${dir}/lib -lpacket"
   57         have_pcap=yes
   58         break;
   59          fi
   60       done
   61       if test "$have_pcap" != yes; then
   62          AC_MSG_ERROR(WinPcap developer's pack not found)
   63       fi
   64       AC_MSG_RESULT(yes) ])
   65 fi
   66 
   67 dnl Checks for libraries.
   68 AC_REPLACE_FUNCS(inet_aton inet_pton strsep getaddrinfo getnameinfo strlcpy strlcat arc4random)
   69 needmd5=no
   70 AC_CHECK_FUNCS(MD5Update, , [needmd5=yes])
   71 if test $needmd5 = yes; then
   72    AC_LIBOBJ(md5)
   73 fi
   74 neederr=no
   75 AC_CHECK_FUNCS(warnx, , [neederr=yes])
   76 if test $neederr = yes; then
   77    AC_LIBOBJ(err)
   78 fi
   79 
   80 dnl Checks for libpcap
   81 AC_MSG_CHECKING(for libpcap)
   82 AC_ARG_WITH(libpcap,
   83 [  --with-libpcap=DIR      use libpcap build directory],
   84 [ case "$withval" in
   85   yes|no)
   86      AC_MSG_RESULT(no)
   87      ;;
   88   *)
   89      AC_MSG_RESULT($withval)
   90      if test -f $withval/pcap.h -a -f $withval/libpcap.a; then
   91         owd=`pwd`
   92         if cd $withval; then withval=`pwd`; cd $owd; fi
   93     PCAPINC="-I$withval -I$withval/bpf"
   94     PCAPLIB="-L$withval -lpcap"
   95      else
   96         AC_ERROR(pcap.h or libpcap.a not found in $withval)
   97      fi
   98      ;;
   99   esac ],
  100 [ if test -f ${prefix}/include/pcap.h; then
  101      PCAPINC="-I${prefix}/include"
  102      PCAPLIB="-L${prefix}/lib -lpcap"
  103   elif test -f /usr/include/pcap/pcap.h; then
  104      PCAPINC="-I/usr/include/pcap"
  105      PCAPLIB="-lpcap"
  106   elif test -f /usr/include/pcap.h; then
  107      PCAPLIB="-lpcap"
  108   else
  109      AC_MSG_RESULT(no)
  110      AC_ERROR(libpcap not found)
  111   fi
  112   AC_MSG_RESULT(yes) ]
  113 )
  114 AC_SUBST(PCAPINC)
  115 AC_SUBST(PCAPLIB)
  116 
  117 dnl Checks for (installed) libdnet
  118 AC_ARG_WITH(libdnet,
  119 [  --with-libdnet=DIR      use libdnet in DIR],
  120 [ case "$withval" in
  121   yes|no)
  122      AC_ERROR([Please specify directory containing dnet-config when using --with-libdnet])
  123      ;;
  124   *)
  125      AC_MSG_CHECKING(for libdnet)
  126      AC_MSG_RESULT($withval)
  127      if test -f $withval/src/libdnet.a; then
  128     DNETINC="-I$withval/include"
  129     DNETLIB="-L$withval/src -ldnet `$withval/dnet-config --libs`"
  130      elif test -x $withval/bin/dnet-config; then
  131     DNETINC="`$withval/bin/dnet-config --cflags`"
  132     DNETLIB="`$withval/bin/dnet-config --libs`"
  133      else
  134         AC_MSG_RESULT(no)
  135         AC_ERROR(dnet-config not found in $withval/bin)
  136      fi
  137      ;;
  138   esac
  139   AC_MSG_RESULT(yes) ],
  140 [ dnl This is the default case so let's just use AC_PATH_PROG! --CPK.
  141   AC_PATH_PROG(dnetconfig, dnet-config, "no")
  142   if test "$dnetconfig" = "no"; then
  143      AC_ERROR(dnet-config not found)
  144   else
  145      DNETINC="`$dnetconfig --cflags`"
  146      DNETLIB="`$dnetconfig --libs`"
  147   fi]
  148 )
  149 
  150 dnl We still need to check whether it's dnet or dumbnet as
  151 dnl for example on Debian. We test by looking at the content
  152 dnl of DNETLIB and derive from the library name what version
  153 dnl we're dealing with. If we find a libdumbnet, we prefix
  154 dnl compat/libdnet to our inclusion path. It provides a dnet.h
  155 dnl that transparently includes dumbnet.h for those systems. --CPK.
  156 AC_MSG_CHECKING([whether libdnet is a libdumbnet])
  157 if test `echo $DNETLIB | sed -e '/dumb/=;d'`; then
  158      AC_MSG_RESULT(yes)
  159      AC_DEFINE(HAVE_DUMBNET, 1,
  160         [Define if our libdnet is a libdumbnet])
  161      DNETCOMPAT="compat/libdnet"
  162 else
  163      AC_MSG_RESULT(no)
  164 fi
  165 
  166 AC_SUBST(DNETCOMPAT)
  167 AC_SUBST(DNETINC)
  168 AC_SUBST(DNETLIB)
  169 
  170 if test -z "$DNETCOMPAT"
  171 then
  172     CFLAGS="$DNETINC"
  173 else
  174     CFLAGS="-I$DNETCOMPAT $DNETINC"
  175 fi
  176 LIBS=$DNETLIB
  177 
  178         AC_MSG_CHECKING(for working addr_pton in libdnet)
  179         AC_TRY_RUN(
  180 #include <sys/types.h>
  181 #include <stdlib.h>
  182 #include <dnet.h>
  183 int
  184 main(int argc, char **argv)
  185 {
  186     struct addr a1;
  187 
  188     addr_pton("0.0.0.0/0", &a1);
  189 
  190         exit(a1.addr_bits != 0);
  191 }, AC_MSG_RESULT(yes), AC_WARNING(your version of libdnet is buggy - working around it), AC_MSG_RESULT(yes))
  192 
  193 dnl Checks for libevent
  194 AC_MSG_CHECKING(for libevent)
  195 AC_ARG_WITH(libevent,
  196 [  --with-libevent=DIR     use libevent build directory],
  197 [ case "$withval" in
  198   yes|no)
  199      AC_MSG_RESULT(no)
  200      ;;
  201   *)
  202      AC_MSG_RESULT($withval)
  203      if test -f $withval/event.h -a -f $withval/libevent.a; then
  204         owd=`pwd`
  205         if cd $withval; then withval=`pwd`; cd $owd; fi
  206         EVENTINC="-I$withval"
  207         EVENTLIB="-L$withval -levent"
  208      else
  209         AC_ERROR(event.h or libevent.a not found in $withval)
  210      fi
  211      ;;
  212   esac ],
  213 [ if test -f ${prefix}/include/event.h; then
  214      EVENTINC="-I${prefix}/include"
  215      EVENTLIB="-L${prefix}/lib -levent"
  216   elif test -f /usr/include/event/event.h; then
  217      EVENTINC="-I/usr/include/event"
  218      EVENTLIB="-levent"
  219   elif test -f /usr/include/event.h; then
  220      EVENTLIB="-levent"
  221   else
  222      AC_MSG_RESULT(no)
  223      AC_ERROR(libevent not found)
  224   fi
  225   AC_MSG_RESULT(yes) ]
  226 )
  227 AC_SUBST(EVENTINC)
  228 AC_SUBST(EVENTLIB)
  229 
  230 CFLAGS=$EVENTINC
  231 LIBS=$EVENTLIB
  232 
  233     AC_MSG_CHECKING(for bufferevent in libevent)
  234     AC_TRY_LINK([
  235 #include <sys/types.h>
  236 #include <sys/time.h>
  237 #include <stdlib.h>
  238 #include <event.h>],[
  239     struct bufferevent bev;
  240     bufferevent_settimeout(&bev, 1, 1);
  241 ], AC_MSG_RESULT(yes), [
  242         AC_ERROR([you need to install a more recent version of libevent,
  243     check http://www.monkey.org/~provos/libevent/])
  244 ], AC_MSG_RESULT(yes))
  245 
  246 CFLAGS=""
  247 LIBS=""
  248 
  249 dnl Checks for header files.
  250 AC_HEADER_STDC
  251 AC_HEADER_SYS_WAIT
  252 AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h)
  253 
  254 havesysselect=no
  255 AC_CHECK_HEADER(sys/select.h, [havesysselect=yes], )
  256 if test $havesysselect = yes; then
  257  AC_MSG_CHECKING([for fd_mask in sys/select.h])
  258  AC_EGREP_HEADER(fd_mask, sys/select.h,
  259   [ AC_DEFINE(HAVE_FDMASK_IN_SELECT)
  260     AC_MSG_RESULT([yes])], AC_MSG_RESULT([no]))
  261 fi
  262 dnl Checks for typedefs, structures, and compiler characteristics.
  263 AC_TYPE_PID_T
  264 AC_TYPE_SIZE_T
  265 AC_CHECK_TYPE(u_int64_t, unsigned long long)
  266 AC_CHECK_TYPE(u_int32_t, unsigned int)
  267 AC_CHECK_TYPE(u_int16_t, unsigned short)
  268 AC_CHECK_TYPE(u_int8_t, unsigned char)
  269 AC_HEADER_TIME
  270 
  271 AC_MSG_CHECKING([for struct sockaddr_storage in sys/socket.h])
  272 AC_EGREP_HEADER(sockaddr_storage, sys/socket.h,
  273     [ AC_DEFINE(HAVE_SOCKADDR_STORAGE)
  274       AC_MSG_RESULT([yes])], AC_MSG_RESULT([no])
  275 )
  276 AC_MSG_CHECKING([for struct addrinfo in netdb.h])
  277 AC_EGREP_HEADER(addrinfo, netdb.h,
  278     [ AC_DEFINE(HAVE_STRUCT_ADDRINFO)
  279       AC_MSG_RESULT([yes])], AC_MSG_RESULT([no])
  280 )
  281 AC_MSG_CHECKING([for timeradd in sys/time.h])
  282 AC_EGREP_CPP(yes,
  283 [
  284 #include <sys/time.h>
  285 #ifdef timeradd
  286 yes
  287 #endif
  288 ],  [ AC_DEFINE(HAVE_TIMERADD)
  289       AC_MSG_RESULT([yes])], AC_MSG_RESULT([no])
  290 )
  291 AC_MSG_CHECKING([for byte order of raw socket I/O])
  292 AC_EGREP_CPP(yes,
  293 [
  294 #include <sys/param.h>
  295 #ifdef BSD4_4
  296   yes
  297 #endif
  298 ], 
  299     AC_EGREP_CPP(yes,
  300     [#include <sys/param.h>
  301      #ifdef OpenBSD
  302        yes
  303      #endif
  304     ],
  305         AC_MSG_RESULT([good byte order]),
  306             [ AC_DEFINE(BSD_RAWSOCK_ORDER)
  307               AC_MSG_RESULT([bad byte order])
  308                         ]
  309           ),
  310       AC_MSG_RESULT([good byte order])
  311 )
  312     
  313 AC_MSG_CHECKING([for sin_len in struct sockaddr_in])
  314 AC_TRY_COMPILE([
  315  #include <sys/types.h>
  316  #include <sys/socket.h>
  317  #include <netinet/in.h>],
  318   [void *p = &((struct sockaddr_in *)0L)->sin_len;],
  319   [ AC_MSG_RESULT([yes])
  320     AC_DEFINE(HAVE_SIN_LEN, 1, [struct sockaddr_in contains sin_len]) ],
  321   AC_MSG_RESULT([no])
  322 )
  323 
  324 AC_MSG_CHECKING([for sa_family_t])
  325 AC_TRY_COMPILE([
  326  #include <sys/types.h>
  327  #include <sys/socket.h>],
  328   [sa_family_t x;],
  329   AC_MSG_RESULT([yes]),
  330   [AC_MSG_RESULT([no])
  331   AC_DEFINE(sa_family_t, int)]
  332 )
  333 
  334 AC_MSG_CHECKING([for socklen_t])
  335 AC_TRY_COMPILE([
  336  #include <sys/types.h>
  337  #include <sys/socket.h>],
  338   [socklen_t x;],
  339   AC_MSG_RESULT([yes]),
  340   [AC_MSG_RESULT([no])
  341   AC_DEFINE(socklen_t, int)]
  342 )
  343 
  344 AC_MSG_CHECKING([for NI_NUMERICHOST])
  345 AC_TRY_COMPILE([
  346  #include <sys/types.h>
  347  #include <sys/socket.h>
  348  #include <netdb.h>],
  349   [char x[NI_NUMERICHOST];],
  350   AC_MSG_RESULT([yes]),
  351   [AC_MSG_RESULT([no])
  352   AC_DEFINE(NI_NUMERICHOST, 1)
  353   AC_DEFINE(NI_MAXHOST, 256)]
  354 )
  355 
  356 AC_MSG_CHECKING([for NI_MAXSERV])
  357 AC_TRY_COMPILE([
  358  #include <sys/types.h>
  359  #include <sys/socket.h>
  360  #include <netdb.h>],
  361   [char x[NI_MAXSERV];],
  362   AC_MSG_RESULT([yes]),
  363   [AC_MSG_RESULT([no])
  364   AC_DEFINE(NI_MAXSERV, 32)]
  365 )
  366 
  367 dnl Checks for library functions.
  368 AC_TYPE_SIGNAL
  369 AC_CHECK_FUNCS(gettimeofday select socket strdup strerror strtol seteuid)
  370 
  371 AC_OUTPUT(Makefile)