2 dnl $Id: configure.in,v 1.7 2002/06/15 10:25:04 psavola Exp $
5 dnl Lars Fenneberg <lf@elemental.net>
7 dnl This software is Copyright 1996-2000 by the above mentioned author(s),
8 dnl All Rights Reserved.
10 dnl The license which is distributed with this software in the file COPYRIGHT
11 dnl applies to this software. If your distribution is missing this file, you
12 dnl may request it from <lutchann@litech.org>.
16 AC_REVISION ($Id: configure.in,v 1.7 2002/06/15 10:25:04 psavola Exp $)
20 VERSION=`cat ${srcdir}/VERSION | grep -v '^#' | tr -d '\012'`
21 AM_INIT_AUTOMAKE(radvd,$VERSION,true)
23 echo $ac_n "building for architecture""... $ac_c" 1>&6
34 AC_MSG_RESULT(unknown)
36 [currently only Linux and BSD 4.4 with NRL's IPv6 code are
37 supported. If you have such a system and it is not guessed correctly
38 you must specifiy it with --target on the configure command line])
42 dnl Determine CC and preset CFLAGS
45 dnl Needed for normal compile
47 AC_PATH_PROG(RM, rm, NOTFOUND)
48 if test "x$RM" = xNOTFOUND; then
49 AC_MSG_ERROR(can't find rm in your path - check PATH)
51 AC_PATH_PROG(SED, sed, NOTFOUND)
52 if test "x$SED" = xNOTFOUND; then
53 AC_MSG_ERROR(can't find sed in your path - check PATH)
59 AC_PATH_PROG(TAR, tar)
60 AC_PATH_PROG(GZIP, gzip)
62 dnl Check where to put the logfile
63 AC_MSG_CHECKING(where to put logfile)
65 [ --with-logfile Path to the radvd logfile [/var/log/radvd.log]],
66 PATH_RADVD_LOG=$withval,
67 PATH_RADVD_LOG=/var/log/radvd.log)
68 AC_MSG_RESULT($PATH_RADVD_LOG)
70 dnl Check where to put the pidfile
71 AC_MSG_CHECKING(where to put pidfile)
73 [ --with-pidfile Path to the radvd pidfile [/var/run/radvd.pid]],
74 PATH_RADVD_PID=$withval,
75 PATH_RADVD_PID=/var/run/radvd.pid)
76 AC_MSG_RESULT($PATH_RADVD_PID)
78 dnl Check where to put the configfile
79 AC_MSG_CHECKING(where to find configfile)
80 AC_ARG_WITH(configfile,
81 [ --with-configfile Path to the radvd config file [SYSCONF/radvd.conf]],
82 PATH_RADVD_CONF=$withval,
83 PATH_RADVD_CONF=${sysconfdir}/radvd.conf)
84 AC_MSG_RESULT($PATH_RADVD_CONF)
86 dnl Checking which syslog facility to use
87 AC_MSG_CHECKING(which syslog facility to use)
89 [ --with-facility Syslog facility to use when using syslog logging],
90 LOG_FACILITY=$withval,
91 LOG_FACILITY=LOG_DAEMON)
92 AC_MSG_RESULT($LOG_FACILITY)
94 dnl Checks for libraries.
96 AC_CHECK_LIB(c, inet_ntop,,
97 AC_CHECK_LIB(inet6, inet_ntop,
100 unset ac_cv_lib_inet6_inet_ntop
102 LDFLAGS="$LDFLAGS -L/usr/inet6/lib"
103 echo $ac_n "with -L/usr/inet6/lib: $ac_c" 1>&6
104 AC_CHECK_LIB(inet6, inet_ntop,
107 unset ac_cv_lib_inet6_inet_ntop
109 LDFLAGS="$LDFLAGS -L/usr/ipv6/lib"
110 echo $ac_n "with -L/usr/ipv6/lib: $ac_c" 1>&6
111 AC_CHECK_LIB(inet6, inet_ntop,
114 AC_MSG_ERROR(can't continue without libinet6.a library - check your LDFLAGS)
120 unset ac_cv_lib_inet6_inet_ntop
122 dnl Checks for header files.
124 AC_CHECK_HEADERS(sys/time.h)
127 AC_CHECK_HEADER(netinet/ipv6.h, hdrfound=yes,
128 AC_CHECK_HEADER(netinet/ip6.h, hdrfound=yes, hdrfound=no)
130 if test "$hdrfound" = no
132 AC_MSG_CHECKING(for netinet/ip6.h or ipv6.h in /usr/inet6/include)
133 if test -f /usr/inet6/include/netinet/ipv6.h
135 AC_MSG_RESULT([yes (netinet/ipv6.h)])
136 CPPFLAGS="$CPPFLAGS -I/usr/inet6/include"
137 elif test -f /usr/inet6/include/netinet/ip6.h
139 AC_MSG_RESULT([yes (netinet/ip6.h)])
140 CPPFLAGS="$CPPFLAGS -I/usr/inet6/include"
143 AC_MSG_CHECKING(for netinet/ip6.h or ipv6.h in /usr/ipv6/include)
144 if test -f /usr/ipv6/include/netinet/ipv6.h
146 AC_MSG_RESULT([yes (netinet/ipv6.h)])
147 CPPFLAGS="$CPPFLAGS -I/usr/ipv6/include"
148 elif test -f /usr/ipv6/include/netinet/ip6.h
150 AC_MSG_RESULT([yes (netinet/ip6.h)])
151 CPPFLAGS="$CPPFLAGS -I/usr/ipv6/include"
157 AC_CHECK_HEADERS(sys/sockio.h getopt.h inttypes.h)
158 AC_CHECK_HEADERS(net/if_dl.h net/if_types.h net/if_arp.h)
159 AC_CHECK_HEADERS(sys/param.h)
160 AC_CHECK_HEADERS(machine/param.h)
161 AC_CHECK_HEADERS(machine/limits.h)
163 dnl Checks for typedefs, structures, and compiler characteristics.
166 AC_MSG_CHECKING(whether struct sockaddr_in6 has sin6_scope_id)
167 AC_TRY_COMPILE([#include <sys/types.h>
168 #include <netinet/in.h>], [static struct sockaddr_in6 ac_sin6; int ac_size =
169 sizeof (ac_sin6.sin6_scope_id);], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SIN6_SCOPE_ID)],
172 AC_MSG_CHECKING(whether struct in6_addr has u6_addrXX and defines s6_addrXX)
173 AC_TRY_COMPILE([#include <netinet/in.h>], [static struct in6_addr in6_u;
174 int u = in6_u.s6_addr16;], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_IN6_ADDR_S6_ADDR)],
177 dnl Checks for library functions.
178 AC_CHECK_FUNCS(getopt_long)
180 AC_LINK_FILES(device-${arch}.c, device.c)
183 AC_SUBST(PATH_RADVD_CONF)
184 AC_SUBST(PATH_RADVD_PID)
185 AC_SUBST(PATH_RADVD_LOG)
186 AC_SUBST(LOG_FACILITY)
188 AM_CONFIG_HEADER(config.h)