OSDN Git Service

Add MS7619SE
[uclinux-h8/uClinux-dist.git] / user / radvd / configure.in
1 dnl
2 dnl  $Id: configure.in,v 1.7 2002/06/15 10:25:04 psavola Exp $
3 dnl
4 dnl   Authors:
5 dnl    Lars Fenneberg           <lf@elemental.net>       
6 dnl
7 dnl   This software is Copyright 1996-2000 by the above mentioned author(s), 
8 dnl   All Rights Reserved.
9 dnl
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>.
13 dnl
14 dnl
15
16 AC_REVISION ($Id: configure.in,v 1.7 2002/06/15 10:25:04 psavola Exp $)
17 AC_INIT(radvd.c)
18
19 AC_CANONICAL_SYSTEM
20 VERSION=`cat ${srcdir}/VERSION | grep -v '^#' | tr -d '\012'`
21 AM_INIT_AUTOMAKE(radvd,$VERSION,true)
22
23 echo $ac_n "building for architecture""... $ac_c" 1>&6
24 case "$target" in
25         *linux*)
26                 AC_MSG_RESULT(linux)
27                 arch=linux
28         ;;
29         *bsd*)
30                 AC_MSG_RESULT(bsd44)
31                 arch=bsd44
32         ;;
33         *)      
34                 AC_MSG_RESULT(unknown)
35                 AC_MSG_ERROR(
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])
39         ;;
40 esac
41
42 dnl Determine CC and preset CFLAGS
43 AC_PROG_CC
44
45 dnl Needed for normal compile
46 AC_PROG_INSTALL
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)
50 fi
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)
54 fi
55 dnl Not needed
56 AC_PATH_PROG(LN, ln)
57 AC_PROG_YACC
58 AM_PROG_LEX
59 AC_PATH_PROG(TAR, tar)
60 AC_PATH_PROG(GZIP, gzip)
61
62 dnl Check where to put the logfile
63 AC_MSG_CHECKING(where to put logfile)
64 AC_ARG_WITH(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)
69
70 dnl Check where to put the pidfile
71 AC_MSG_CHECKING(where to put pidfile)
72 AC_ARG_WITH(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)
77
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)
85
86 dnl Checking which syslog facility to use
87 AC_MSG_CHECKING(which syslog facility to use)
88 AC_ARG_WITH(facility,
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)
93
94 dnl Checks for libraries.
95
96 AC_CHECK_LIB(c, inet_ntop,,
97  AC_CHECK_LIB(inet6, inet_ntop,
98   LIBS="$LIBS -linet6"
99   ,
100   unset ac_cv_lib_inet6_inet_ntop
101   oldldflags=$LDFLAGS
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,
105    LIBS="$LIBS -linet6"
106    ,
107    unset ac_cv_lib_inet6_inet_ntop
108    LDFLAGS=$oldldflags
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,
112     LIBS="$LIBS -linet6"
113     ,
114     AC_MSG_ERROR(can't continue without libinet6.a library - check your LDFLAGS)
115    )
116   )
117  )
118 )
119 # prevent caching
120 unset ac_cv_lib_inet6_inet_ntop
121
122 dnl Checks for header files.
123 AC_HEADER_STDC
124 AC_CHECK_HEADERS(sys/time.h)
125 AC_HEADER_TIME
126
127 AC_CHECK_HEADER(netinet/ipv6.h, hdrfound=yes,
128  AC_CHECK_HEADER(netinet/ip6.h, hdrfound=yes, hdrfound=no)
129 )
130 if test "$hdrfound" = no
131 then
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
134  then
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
138  then
139   AC_MSG_RESULT([yes (netinet/ip6.h)])
140   CPPFLAGS="$CPPFLAGS -I/usr/inet6/include"
141  else
142   AC_MSG_RESULT(no)
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
145   then
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
149   then
150    AC_MSG_RESULT([yes (netinet/ip6.h)])
151    CPPFLAGS="$CPPFLAGS -I/usr/ipv6/include"
152   fi
153  fi
154 fi
155 unset hdrfound
156
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)
162
163 dnl Checks for typedefs, structures, and compiler characteristics.
164 AC_C_CONST
165
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)],
170 AC_MSG_RESULT(no))
171
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)],
175 AC_MSG_RESULT(no))
176
177 dnl Checks for library functions.
178 AC_CHECK_FUNCS(getopt_long)
179
180 AC_LINK_FILES(device-${arch}.c, device.c)
181
182 AC_SUBST(VERSION)
183 AC_SUBST(PATH_RADVD_CONF)
184 AC_SUBST(PATH_RADVD_PID)
185 AC_SUBST(PATH_RADVD_LOG)
186 AC_SUBST(LOG_FACILITY)
187
188 AM_CONFIG_HEADER(config.h)
189 AC_OUTPUT(Makefile)