Home | History | Annotate | Download | only in ninfod
      1 dnl $USAGI: configure.in,v 1.12 2003-07-16 09:49:01 yoshfuji Exp $
      2 
      3 dnl Copyright (C) 2002 USAGI/WIDE Project.
      4 dnl All rights reserved.
      5 dnl 
      6 dnl Redistribution and use in source and binary forms, with or without
      7 dnl modification, are permitted provided that the following conditions
      8 dnl are met:
      9 dnl 1. Redistributions of source code must retain the above copyright
     10 dnl    notice, this list of conditions and the following disclaimer.
     11 dnl 2. Redistributions in binary form must reproduce the above copyright
     12 dnl    notice, this list of conditions and the following disclaimer in the
     13 dnl    documentation and/or other materials provided with the distribution.
     14 dnl 3. Neither the name of the project nor the names of its contributors
     15 dnl    may be used to endorse or promote products derived from this software
     16 dnl    without specific prior written permission.
     17 dnl 
     18 dnl THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
     19 dnl ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     20 dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     21 dnl ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
     22 dnl FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     23 dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     24 dnl OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     25 dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     26 dnl LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     27 dnl OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     28 dnl SUCH DAMAGE.
     29 
     30 AC_PREREQ(2.53)
     31 AC_INIT(ninfod.c)
     32 AC_CONFIG_HEADER(config.h)
     33 AC_PREFIX_DEFAULT(/usr/local/v6)
     34 
     35 AC_COPYRIGHT([Copyright (C)2002 USAGI/WIDE Project.  All Rights Reserved.])
     36 
     37 dnl Checks for programs.
     38 AC_PROG_CC
     39 AC_PROG_INSTALL
     40 INSTALL_LIB="\${INSTALL_DATA}"
     41 AC_SUBST(INSTALL_LIB)
     42 INSTALL_DIR="\${INSTALL} -d"
     43 AC_SUBST(INSTALL_DIR)
     44 
     45 dnl Checks for Enable/With
     46 AC_ARG_ENABLE(debug,
     47 [  --enable-debug          Enable debugging])
     48 if test x"$enableval" != x"no"; then
     49   AC_DEFINE(ENABLE_DEBUG, 1, 
     50 	    [Enable debugging])
     51 fi
     52 
     53 AC_ARG_ENABLE(threads,
     54 [  --disable-threads       Disable threads (and random delay)],,enable_threads=no)
     55 if test x"$enableval" != x"no"; then
     56   AC_DEFINE(ENABLE_THREADS, 1,
     57             [Enable threads])
     58 fi
     59 
     60 AC_ARG_ENABLE(suptypes,
     61 [  --enable-suptypes       Enable suptypes qtype (deprecated)])
     62 if test x"$enableval" != x"no"; then
     63   AC_DEFINE(ENABLE_SUPTYPES, 1,
     64 	    [Enable suptypes (deprecated)])
     65 fi
     66 
     67 AC_ARG_ENABLE(suptypes,
     68 [  --enable-ttl            Enable ttl support for qtypes (deprecated)])
     69 if test x"$enableval" != x"no"; then
     70   AC_DEFINE(ENABLE_SUPTYPES, 1,
     71 	    [Enable ttl support for qtypes (deprecated)])
     72 fi
     73 
     74 dnl Checks for libraries.
     75 
     76 dnl Checks for header files.
     77 AC_HEADER_STDC
     78 AC_HEADER_TIME
     79 AC_CHECK_HEADERS(limits.h)
     80 AC_CHECK_HEADERS(gnutls/openssl.h)
     81 AC_CHECK_HEADERS(openssl/md5.h)
     82 AC_CHECK_HEADERS(sys/uio.h)
     83 AC_CHECK_HEADERS(sys/utsname.h arpa/inet.h netdb.h syslog.h)
     84 AC_CHECK_HEADERS(sys/capability.h)
     85 AC_CHECK_HEADERS(pwd.h)
     86 AC_CHECK_HEADERS(netinet/in.h)
     87 AC_CHECK_HEADERS(netinet/ip6.h netinet/icmp6.h,,,[
     88 #if HAVE_SYS_TYPES_H
     89 # include <sys/types.h>
     90 #endif
     91 #if HAVE_NETINET_IN_H
     92 # include <netinet/in.h>
     93 #endif
     94 ])
     95 AC_CHECK_HEADERS(linux/rtnetlink.h,,,[
     96 #include <asm/types.h>
     97 #include <sys/socket.h>
     98 ])
     99 AC_CHECK_HEADERS(pthread.h)
    100 
    101 dnl Checks for typedefs, structures, and compiler characteristics.
    102 AC_C_BIGENDIAN
    103 AC_C_CONST
    104 AC_TYPE_SIZE_T
    105 
    106 AC_MSG_CHECKING([for struct icmp6_nodeinfo])
    107 AC_TRY_COMPILE([
    108 #include <sys/types.h>
    109 #include <netinet/in.h>
    110 #include <netinet/icmp6.h>
    111 ],[
    112 struct icmp6_nodeinfo nodeinfo;
    113 ],[
    114 	AC_MSG_RESULT([yes])
    115 	AC_DEFINE([HAVE_STRUCT_ICMP6_NODEINFO], 1,
    116 		  [Define to 1 if you have struct icmp6_nodeinfo])
    117 ],[
    118 	AC_MSG_RESULT([no])
    119 ])
    120 
    121 dnl Checks for library functions.
    122 AC_CHECK_FUNCS(nanosleep)
    123 AC_CHECK_LIB(pthread, pthread_create)
    124 AC_CHECK_LIB(cap, cap_init)
    125 
    126 AC_CHECK_LIB(gnutls-openssl, MD5_Init,
    127 	AC_DEFINE(HAVE_MD5_INIT)
    128 	LIBS="-lgnutls-openssl $LIBS",
    129 	AC_CHECK_LIB(crypto, MD5_Init,
    130 		AC_DEFINE(HAVE_MD5_INIT)
    131 		LIBS="-lcrypto $LIBS",
    132 	)
    133 )
    134 dnl AC_CHECK_LIB(crypto, MD5Init,
    135 dnl	AC_DEFINE(HAVE_MD5INIT)
    136 dnl	LIBS="-lcrypto $LIBS",
    137 dnl)
    138 
    139 dnl AC_SUBST(DEFS)
    140 
    141 AC_OUTPUT(Makefile ninfod.sh)
    142