configure.ac 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181
  1. ##
  2. ## Configure template file for Quagga.
  3. ## autoconf will generate configure script.
  4. ##
  5. ## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
  6. ## Portions Copyright (c) 2003 Paul Jakma <paul@dishone.st>
  7. ##
  8. ## $Id: configure.ac,v 1.73 2004/11/07 22:34:23 paul Exp $
  9. AC_PREREQ(2.53)
  10. AC_INIT(Quagga, 0.97.2, [http://bugzilla.quagga.net])
  11. AC_CONFIG_SRCDIR(lib/zebra.h)
  12. AM_INIT_AUTOMAKE(1.6)
  13. AM_CONFIG_HEADER(config.h)
  14. dnl default is to match previous behavior
  15. exampledir=${sysconfdir}
  16. AC_ARG_ENABLE([exampledir],
  17. AC_HELP_STRING([--enable-exampledir],
  18. [specify alternate directory for examples]),
  19. exampledir="$enableval",)
  20. dnl XXX add --exampledir to autoconf standard directory list somehow
  21. AC_SUBST(exampledir)
  22. dnl default is to match previous behavior
  23. pkgsrcrcdir=""
  24. pkgsrcdir=""
  25. AC_ARG_ENABLE([pkgsrcrcdir],
  26. AC_HELP_STRING([--enable-pkgsrcrcdir],
  27. [specify directory for rc.d scripts]),
  28. pkgsrcrcdir="$enableval"; pkgsrcdir="pkgsrc",)
  29. dnl XXX add --pkgsrcrcdir to autoconf standard directory list somehow
  30. AC_SUBST(pkgsrcdir)
  31. AC_SUBST(pkgsrcrcdir)
  32. dnl -----------------------------------
  33. dnl Get hostname and other information.
  34. dnl -----------------------------------
  35. AC_CANONICAL_HOST
  36. dnl ------------
  37. dnl Check CFLAGS
  38. dnl ------------
  39. AC_ARG_WITH(cflags,
  40. [ --with-cflags Set CFLAGS for use in compilation.])
  41. if test "x$with_cflags" != "x" ; then
  42. CFLAGS="$with_cflags" ; cflags_specified=yes ;
  43. elif test -n "$CFLAGS" ; then
  44. cflags_specified=yes ;
  45. fi
  46. dnl --------
  47. dnl Check CC
  48. dnl --------
  49. AC_PROG_CC
  50. dnl ---------------------------------------------
  51. dnl If CLFAGS doesn\'t exist set default value
  52. dnl AC_PROG_CC will have set minimal default
  53. dnl already, eg "-O2 -g" for gcc, "-g" for others
  54. dnl (Wall is gcc specific... have to make sure
  55. dnl gcc is being used before setting it)
  56. dnl ---------------------------------------------
  57. dnl
  58. if test "x$cflags_specified" = "x" ; then
  59. if test "x${GCC}" = "xyes"; then
  60. CFLAGS="-Os -g -Wall -Wsign-compare -Wpointer-arith"
  61. CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings"
  62. fi
  63. # TODO: conditionally addd -Wpacked if handled
  64. fi
  65. dnl --------------
  66. dnl Check programs
  67. dnl --------------
  68. AC_PROG_CPP
  69. AC_PROG_INSTALL
  70. AC_PROG_MAKE_SET
  71. AC_CHECK_TOOL(AR, ar)
  72. AC_CHECK_TOOL(RANLIB, ranlib, :)
  73. dnl ---------
  74. dnl AIX check
  75. dnl ---------
  76. AC_AIX
  77. dnl -------
  78. dnl libtool
  79. dnl -------
  80. AC_PROG_LIBTOOL
  81. dnl ----------------------
  82. dnl Packages configuration
  83. dnl ----------------------
  84. AC_ARG_ENABLE(vtysh,
  85. [ --enable-vtysh include integrated vty shell for Quagga])
  86. AC_ARG_ENABLE(ipv6,
  87. [ --disable-ipv6 turn off IPv6 related features and daemons])
  88. AC_ARG_ENABLE(zebra,
  89. [ --disable-zebra do not build zebra daemon])
  90. AC_ARG_ENABLE(bgpd,
  91. [ --disable-bgpd do not build bgpd])
  92. AC_ARG_ENABLE(ripd,
  93. [ --disable-ripd do not build ripd])
  94. AC_ARG_ENABLE(ripngd,
  95. [ --disable-ripngd do not build ripngd])
  96. AC_ARG_ENABLE(ospfd,
  97. [ --disable-ospfd do not build ospfd])
  98. AC_ARG_ENABLE(ospf6d,
  99. [ --disable-ospf6d do not build ospf6d])
  100. AC_ARG_ENABLE(isisd,
  101. [ --enable-isisd build isisd])
  102. AC_ARG_ENABLE(bgp-announce,
  103. [ --disable-bgp-announce, turn off BGP route announcement])
  104. AC_ARG_ENABLE(netlink,
  105. [ --enable-netlink force to use Linux netlink interface])
  106. AC_ARG_ENABLE(broken-aliases,
  107. [ --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X])
  108. AC_ARG_ENABLE(snmp,
  109. [ --enable-snmp enable SNMP support])
  110. AC_ARG_WITH(libpam,
  111. [ --with-libpam use libpam for PAM support in vtysh])
  112. AC_ARG_ENABLE(tcp-zebra,
  113. [ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon])
  114. AC_ARG_ENABLE(opaque-lsa,
  115. [ --enable-opaque-lsa enable OSPF Opaque-LSA with OSPFAPI support (RFC2370)])
  116. AC_ARG_ENABLE(ospfapi,
  117. [ --disable-ospfapi do not build OSPFAPI to access the OSPF LSA Database,
  118. (this is the default if --enable-opaque-lsa is not set)])
  119. AC_ARG_ENABLE(ospfclient,
  120. [ --disable-ospfclient do not build OSPFAPI client for OSPFAPI,
  121. (this is the default if --disable-ospfapi is set)])
  122. AC_ARG_ENABLE(ospf-te,
  123. [ --enable-ospf-te enable Traffic Engineering Extension to OSPF])
  124. AC_ARG_ENABLE(multipath,
  125. [ --enable-multipath=ARG enable multipath function, ARG must be digit])
  126. AC_ARG_ENABLE(quagga_user,
  127. [ --enable-user=ARG user to run Quagga suite as (default quagga)])
  128. AC_ARG_ENABLE(quagga_group,
  129. [ --enable-group=ARG group to run Quagga suite as (default quagga)])
  130. AC_ARG_ENABLE(vty_group,
  131. [ --enable-vty-group=ARG set vty sockets to have specified group as owner])
  132. AC_ARG_ENABLE(configfile_mask,
  133. [ --enable-configfile-mask=ARG set mask for config files])
  134. AC_ARG_ENABLE(logfile_mask,
  135. [ --enable-logfile-mask=ARG set mask for log files])
  136. AC_ARG_ENABLE(rtadv,
  137. [ --disable-rtadv disable IPV6 router advertisement feature])
  138. AC_ARG_ENABLE(irdp,
  139. [ --enable-irdp enable IRDP server support in zebra])
  140. AC_ARG_ENABLE(capabilities,
  141. [ --disable-capabilities disable using POSIX capabilities])
  142. AC_ARG_ENABLE(gcc_ultra_verbose,
  143. [ --enable-gcc-ultra-verbose enable ultra verbose GCC warnings])
  144. if test x"${enable_gcc_ultra_verbose}" = x"yes" ; then
  145. CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
  146. CFLAGS="${CFLAGS} -Wmissing-declarations -Wmissing-noreturn"
  147. CFLAGS="${CFLAGS} -Wmissing-format-attribute -Wunreachable-code"
  148. CFLAGS="${CFLAGS} -Wpacked -Wpadded"
  149. fi
  150. if test "${enable_broken_aliases}" = "yes"; then
  151. if test "${enable_netlink}" = "yes"
  152. then
  153. echo "Sorry, you can't use netlink with broken aliases"
  154. exit 1
  155. fi
  156. AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias)
  157. enable_netlink=no
  158. fi
  159. if test "${enable_tcp_zebra}" = "yes"; then
  160. AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)
  161. fi
  162. if test "${enable_opaque_lsa}" = "yes"; then
  163. AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
  164. fi
  165. if test "${enable_ospf_te}" = "yes"; then
  166. AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
  167. AC_DEFINE(HAVE_OSPF_TE,,OSPF TE)
  168. fi
  169. AC_MSG_CHECKING(if zebra should be configurable to send Route Advertisements)
  170. if test "${enable_rtadv}" != "no"; then
  171. AC_MSG_RESULT(yes)
  172. AC_DEFINE(HAVE_RTADV,,Enable IPv6 Routing Advertisement support)
  173. else
  174. AC_MSG_RESULT(no)
  175. fi
  176. if test "${enable_irdp}" = "yes"; then
  177. AC_DEFINE(HAVE_IRDP,, IRDP )
  178. fi
  179. if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
  180. enable_user="quagga"
  181. elif test "${enable_user}" = "no"; then
  182. enable_user="root"
  183. fi
  184. AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User)
  185. if test "${enable_group}" = "yes" || test x"${enable_group}" = x""; then
  186. enable_group="quagga"
  187. elif test "${enable_group}" = "no"; then
  188. enable_group="root"
  189. fi
  190. AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group)
  191. if test x"${enable_vty_group}" = x"yes" ; then
  192. AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes])
  193. elif test x"${enable_vty_group}" != x""; then
  194. if test x"${enable_vty_group}" != x"no"; then
  195. AC_DEFINE_UNQUOTED(VTY_GROUP, "${enable_vty_group}", VTY Sockets Group)
  196. fi
  197. fi
  198. enable_configfile_mask=${enable_configfile_mask:-0600}
  199. AC_DEFINE_UNQUOTED(CONFIGFILE_MASK, ${enable_configfile_mask}, Mask for config files)
  200. enable_logfile_mask=${enable_logfile_mask:-0600}
  201. AC_DEFINE_UNQUOTED(LOGFILE_MASK, ${enable_logfile_mask}, Mask for log files)
  202. changequote(, )dnl
  203. MULTIPATH_NUM=1
  204. case "${enable_multipath}" in
  205. [0-9]|[1-9][0-9])
  206. MULTIPATH_NUM="${enable_multipath}"
  207. ;;
  208. "")
  209. ;;
  210. *)
  211. echo "Please specify digit to --enable-multipath ARG."
  212. exit 1
  213. ;;
  214. esac
  215. changequote([, ])dnl
  216. AC_SUBST(MULTIPATH_NUM)
  217. dnl -------------------
  218. dnl Check header files.
  219. dnl -------------------
  220. AC_HEADER_STDC
  221. AC_CHECK_HEADERS([string.h stropts.h sys/conf.h sys/ksym.h sys/time.h \
  222. sys/times.h sys/select.h sys/sysctl.h sys/sockio.h \
  223. sys/types.h linux/version.h kvm.h netdb.h asm/types.h \
  224. libutil.h limits.h])
  225. AC_CHECK_HEADERS([sys/socket.h netinet/in_systm.h netinet/in.h \
  226. net/if_dl.h net/netopt.h inet/nd.h net/route.h \
  227. net/if.h net/if_var.h netinet/in_var.h])
  228. dnl V6 headers are checked below, after we check for v6
  229. dnl check some types
  230. AC_C_CONST
  231. dnl AC_TYPE_PID_T
  232. AC_TYPE_SIGNAL
  233. dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
  234. case "$host" in
  235. [*-sunos5.[6-8]*] | [*-solaris2.[6-8]*])
  236. opsys=sol2-6
  237. AC_DEFINE(SUNOS_56, 1, SunOS 5.6 to 5.8)
  238. AC_DEFINE(SUNOS_5, 1, SunOS 5)
  239. AC_CHECK_LIB(xnet, main)
  240. CURSES=-lcurses
  241. ;;
  242. [*-sunos5.[8-9]] | [*-sunos5.1[0-9]] \
  243. | [*-solaris2.[8-9]] | [*-solaris2.1[0-9]])
  244. opsys=sol9
  245. AC_DEFINE(SUNOS_59,,SunOS 5.9 up)
  246. AC_DEFINE(SUNOS_5, 1, SunOS 5)
  247. AC_CHECK_LIB(socket, main)
  248. AC_CHECK_LIB(nsl, main)
  249. CURSES=-lcurses
  250. ;;
  251. *-sunos5* | *-solaris2*)
  252. AC_DEFINE(SUNOS_5,,SunOS 5, Unknown SunOS)
  253. AC_CHECK_LIB(socket, main)
  254. AC_CHECK_LIB(nsl, main)
  255. CURSES=-lcurses
  256. ;;
  257. *-linux-*)
  258. opsys=gnu-linux
  259. AC_DEFINE(GNU_LINUX,,GNU Linux)
  260. ;;
  261. *-nec-sysv4*)
  262. AC_CHECK_LIB(nsl, gethostbyname)
  263. AC_CHECK_LIB(socket, socket)
  264. ;;
  265. *-freebsd3.2)
  266. AC_DEFINE(FREEBSD_32,,FreeBSD 3.2)
  267. ;;
  268. *-openbsd*)
  269. opsys=openbsd
  270. AC_DEFINE(OPEN_BSD,,OpenBSD)
  271. ;;
  272. *-bsdi*)
  273. opsys=bsdi
  274. OTHER_METHOD="mtu_kvm.o"
  275. AC_CHECK_LIB(kvm, main)
  276. ;;
  277. *-irix6.5)
  278. opsys=irix
  279. AC_DEFINE(IRIX_65,,IRIX 6.5)
  280. ;;
  281. esac
  282. dnl ---------------------
  283. dnl Integrated VTY option
  284. dnl ---------------------
  285. case "${enable_vtysh}" in
  286. "yes") VTYSH="vtysh";
  287. AC_DEFINE(VTYSH,,VTY shell)
  288. AC_PATH_PROG(PERL, perl)
  289. dnl Vtysh uses libreadline, which looks for termcap functions at
  290. dnl configure time. We follow readline's search order.
  291. dnl The required procedures are in libtermcap on NetBSD, in
  292. dnl [TODO] on Linux, and in [TODO] on Solaris.
  293. AC_CHECK_LIB(termcap, tputs, ,
  294. AC_CHECK_LIB(tinfo, tputs, ,
  295. AC_CHECK_LIB(curses, tputs, ,
  296. AC_CHECK_LIB(ncurses, tputs))))
  297. AC_CHECK_LIB(readline, main)
  298. if test $ac_cv_lib_readline_main = no; then
  299. AC_MSG_ERROR([vtysh needs libreadline but was not found and usable on your system.])
  300. fi
  301. AC_CHECK_HEADER(readline/history.h)
  302. if test $ac_cv_header_readline_history_h = no;then
  303. AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
  304. fi
  305. AC_CHECK_LIB(readline, rl_completion_matches)
  306. if test $ac_cv_lib_readline_rl_completion_matches = no; then
  307. AC_DEFINE(rl_completion_matches,completion_matches,Old readline)
  308. fi
  309. ;;
  310. "no" ) VTYSH="";;
  311. * ) ;;
  312. esac
  313. dnl ----------
  314. dnl PAM module
  315. dnl ----------
  316. if test "$with_libpam" = "yes"; then
  317. AC_CHECK_HEADER(security/pam_misc.h)
  318. if test "$ac_cv_header_security_pam_misc_h" = yes; then
  319. AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
  320. AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
  321. pam_conv_func="misc_conv"
  322. fi
  323. AC_CHECK_HEADER(security/openpam.h)
  324. if test "$ac_cv_header_security_openpam_h" = yes; then
  325. AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
  326. AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
  327. pam_conv_func="openpam_ttyconv"
  328. fi
  329. if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
  330. AC_MSG_WARN([*** pam support will not be built ***])
  331. with_libpam="no"
  332. fi
  333. fi
  334. if test "$with_libpam" = "yes"; then
  335. dnl took this test from proftpd's configure.in and suited to our needs
  336. dnl -------------------------------------------------------------------------
  337. dnl
  338. dnl This next check looks funky due to a linker problem with some versions
  339. dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
  340. dnl omitted requiring libdl linking information. PAM-0.72 or better ships
  341. dnl with RedHat 6.2 and Debian 2.2 or better.
  342. AC_CHECK_LIB(pam, pam_start,
  343. [AC_CHECK_LIB(pam, $pam_conv_func,
  344. [AC_DEFINE(USE_PAM,,Use PAM for authentication)
  345. LIBPAM="-lpam"],
  346. [AC_DEFINE(USE_PAM,,Use PAM for authentication)
  347. LIBPAM="-lpam -lpam_misc"]
  348. )
  349. ],
  350. [AC_CHECK_LIB(pam, pam_end,
  351. [AC_CHECK_LIB(pam, $pam_conv_func,
  352. [AC_DEFINE(USE_PAM,,Use PAM for authentication)
  353. LIBPAM="-lpam -ldl"],
  354. [AC_DEFINE(USE_PAM,,Use PAM for authentication)
  355. LIBPAM="-lpam -ldl -lpam_misc"]
  356. )
  357. ],AC_MSG_WARN([*** pam support will not be built ***]),
  358. [-ldl])
  359. ]
  360. )
  361. fi
  362. AC_SUBST(LIBPAM)
  363. dnl -------------------------------
  364. dnl Endian-ness check
  365. dnl -------------------------------
  366. AC_WORDS_BIGENDIAN
  367. dnl -------------------------------
  368. dnl check the size in byte of the C
  369. dnl -------------------------------
  370. dnl AC_CHECK_SIZEOF(char)
  371. dnl AC_CHECK_SIZEOF(int)
  372. dnl AC_CHECK_SIZEOF(short)
  373. dnl AC_CHECK_SIZEOF(long)
  374. dnl ----------------------------
  375. dnl check existance of functions
  376. dnl ----------------------------
  377. AC_CHECK_FUNCS(memset memcpy strerror inet_aton daemon snprintf vsnprintf \
  378. strlcat strlcpy if_nametoindex if_indextoname getifaddrs \
  379. fcntl)
  380. AC_CHECK_FUNCS(setproctitle, ,
  381. [AC_CHECK_LIB(util, setproctitle,
  382. [LIBS="$LIBS -lutil"
  383. AC_DEFINE(HAVE_SETPROCTITLE,, Have setproctitle)
  384. ]
  385. )
  386. ]
  387. )
  388. dnl ------------------------------------
  389. dnl Determine routing get and set method
  390. dnl ------------------------------------
  391. AC_MSG_CHECKING(zebra between kernel interface method)
  392. if test x"$opsys" = x"gnu-linux"; then
  393. if test "${enable_netlink}" = "yes";then
  394. AC_MSG_RESULT(netlink)
  395. RT_METHOD=rt_netlink.o
  396. AC_DEFINE(HAVE_NETLINK,,netlink)
  397. netlink=yes
  398. elif test "${enable_netlink}" = "no"; then
  399. AC_MSG_RESULT(ioctl)
  400. RT_METHOD=rt_ioctl.o
  401. netlink=no
  402. else
  403. AC_MSG_RESULT(netlink)
  404. RT_METHOD=rt_netlink.o
  405. AC_DEFINE(HAVE_NETLINK,,netlink)
  406. netlink=yes
  407. fi
  408. elif test x"$opsys" = x"sol2-6";then
  409. AC_MSG_RESULT(Route socket)
  410. KERNEL_METHOD="kernel_socket.o"
  411. RT_METHOD="rt_socket.o"
  412. elif test x"$opsys" = x"sol9";then
  413. AC_MSG_RESULT(Route socket)
  414. KERNEL_METHOD="kernel_socket.o"
  415. RT_METHOD="rt_socket.o"
  416. elif test "$opsys" = "irix" ; then
  417. AC_MSG_RESULT(Route socket)
  418. KERNEL_METHOD="kernel_socket.o"
  419. RT_METHOD="rt_socket.o"
  420. else
  421. AC_TRY_RUN([#include <errno.h>
  422. #include <sys/types.h>
  423. #include <sys/socket.h>
  424. main ()
  425. {
  426. int ac_sock;
  427. ac_sock = socket (AF_ROUTE, SOCK_RAW, 0);
  428. if (ac_sock < 0 && errno == EINVAL)
  429. exit (1);
  430. exit (0);
  431. }],
  432. [KERNEL_METHOD=kernel_socket.o
  433. RT_METHOD=rt_socket.o
  434. AC_MSG_RESULT(socket)],
  435. [RT_METHOD=rt_ioctl.o
  436. AC_MSG_RESULT(ioctl)],
  437. [KERNEL_METHOD=kernel_socket.o
  438. RT_METHOD=rt_socket.o
  439. AC_MSG_RESULT(socket)])
  440. fi
  441. AC_SUBST(RT_METHOD)
  442. AC_SUBST(KERNEL_METHOD)
  443. AC_SUBST(OTHER_METHOD)
  444. dnl ------------------------------
  445. dnl check kernel route read method
  446. dnl ------------------------------
  447. AC_CACHE_CHECK(route read method check, zebra_rtread,
  448. [if test "$netlink" = yes; then
  449. RTREAD_METHOD="rtread_netlink.o"
  450. zebra_rtread="netlink"
  451. else
  452. for zebra_rtread in /proc/net/route /dev/ip /dev/null;
  453. do
  454. test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break
  455. done
  456. case $zebra_rtread in
  457. "/proc/net/route") RTREAD_METHOD="rtread_proc.o"
  458. zebra_rtread="proc";;
  459. "/dev/ip")
  460. case "$host" in
  461. *-freebsd*) RTREAD_METHOD=rtread_sysctl.o
  462. zebra_rtread="sysctl";;
  463. *) RTREAD_METHOD="rtread_getmsg.o"
  464. zebra_rtread="getmsg";;
  465. esac;;
  466. *) RTREAD_METHOD="rtread_sysctl.o"
  467. zebra_rtread="sysctl";;
  468. esac
  469. fi])
  470. AC_SUBST(RTREAD_METHOD)
  471. dnl -----------------------------
  472. dnl check interface lookup method
  473. dnl -----------------------------
  474. IOCTL_METHOD=ioctl.o
  475. AC_MSG_CHECKING(interface looking up method)
  476. if test "$netlink" = yes; then
  477. AC_MSG_RESULT(netlink)
  478. IF_METHOD=if_netlink.o
  479. elif test "$opsys" = "sol2-6";then
  480. AC_MSG_RESULT(Solaris GIF)
  481. IF_METHOD=if_ioctl.o
  482. elif test "$opsys" = "sol9";then
  483. AC_MSG_RESULT(Solaris GLIF)
  484. IF_METHOD=if_ioctl_solaris.o
  485. IOCTL_METHOD=ioctl_solaris.o
  486. elif test "$opsys" = "irix" ; then
  487. AC_MSG_RESULT(IRIX)
  488. IF_METHOD=if_ioctl.o
  489. elif test "$opsys" = "openbsd";then
  490. AC_MSG_RESULT(openbsd)
  491. IF_METHOD=if_ioctl.o
  492. elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
  493. AC_MSG_RESULT(sysctl)
  494. IF_METHOD=if_sysctl.o
  495. AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
  496. else
  497. AC_MSG_RESULT(ioctl)
  498. IF_METHOD=if_ioctl.o
  499. fi
  500. AC_SUBST(IF_METHOD)
  501. AC_SUBST(IOCTL_METHOD)
  502. dnl -----------------------
  503. dnl check proc file system.
  504. dnl -----------------------
  505. if test -r /proc/net/dev; then
  506. AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev)
  507. IF_PROC=if_proc.o
  508. fi
  509. if test -r /proc/net/if_inet6; then
  510. AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6)
  511. IF_PROC=if_proc.o
  512. fi
  513. AC_SUBST(IF_PROC)
  514. dnl -----------------------------
  515. dnl check ipforward detect method
  516. dnl -----------------------------
  517. AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path,
  518. [for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null;
  519. do
  520. test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break
  521. done
  522. case $zebra_ipforward_path in
  523. "/proc/net/snmp") IPFORWARD=ipforward_proc.o
  524. zebra_ipforward_path="proc";;
  525. "/dev/ip")
  526. case "$host" in
  527. *-nec-sysv4*) IPFORWARD=ipforward_ews.o
  528. zebra_ipforward_path="ews";;
  529. *-freebsd*) IPFORWARD=ipforward_sysctl.o
  530. zebra_ipforward_path="sysctl";;
  531. *) IPFORWARD=ipforward_solaris.o
  532. zebra_ipforward_path="solaris";;
  533. esac;;
  534. *) IPFORWARD=ipforward_sysctl.o
  535. zebra_ipforward_path="sysctl";;
  536. esac])
  537. AC_SUBST(IPFORWARD)
  538. AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
  539. dnl ----------
  540. dnl IPv6 check
  541. dnl ----------
  542. AC_MSG_CHECKING(whether does this OS have IPv6 stack)
  543. if test "${enable_ipv6}" = "no"; then
  544. AC_MSG_RESULT(disabled)
  545. else
  546. dnl ----------
  547. dnl INRIA IPv6
  548. dnl ----------
  549. if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then
  550. zebra_cv_ipv6=yes
  551. AC_DEFINE(HAVE_IPV6,1,INRIA IPv6)
  552. AC_DEFINE(INRIA_IPV6,1,INRIA IPv6)
  553. RIPNGD="ripngd"
  554. OSPF6D="ospf6d"
  555. LIB_IPV6=""
  556. AC_MSG_RESULT(INRIA IPv6)
  557. dnl ---------
  558. dnl KAME IPv6
  559. dnl ---------
  560. elif grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
  561. zebra_cv_ipv6=yes
  562. AC_DEFINE(HAVE_IPV6,1,KAME IPv6)
  563. AC_DEFINE(KAME,1,KAME IPv6)
  564. RIPNGD="ripngd"
  565. OSPF6D="ospf6d"
  566. if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
  567. LIB_IPV6="-L/usr/local/v6/lib -linet6"
  568. fi
  569. AC_MSG_RESULT(KAME)
  570. dnl -------------------------
  571. dnl MUSICA IPv6
  572. dnl default host check
  573. dnl It is not used by Kheops
  574. dnl -------------------------
  575. elif grep MUSICA /usr/include6/netinet6/in6.h >/dev/null 2>&1; then
  576. zebra_cv_ipv6=yes
  577. AC_DEFINE(HAVE_IPV6,1,Musicia IPv6)
  578. AC_DEFINE(MUSICA,1,Musica IPv6 stack)
  579. AC_DEFINE(KAME,1,KAME IPv6 stack)
  580. RIPNGD="ripngd"
  581. OSPF6D="ospf6d"
  582. if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
  583. LIB_IPV6="-L/usr/local/v6/lib -linet6"
  584. fi
  585. AC_MSG_RESULT(MUSICA)
  586. dnl ---------
  587. dnl NRL check
  588. dnl ---------
  589. elif grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then
  590. zebra_cv_ipv6=yes
  591. AC_DEFINE(HAVE_IPV6,1,NRL IPv6)
  592. AC_DEFINE(NRL,1,NRL)
  593. RIPNGD="ripngd"
  594. OSPF6D="ospf6d"
  595. if test x"$opsys" = x"bsdi";then
  596. AC_DEFINE(BSDI_NRL,,BSDI)
  597. AC_MSG_RESULT(BSDI_NRL)
  598. else
  599. AC_MSG_RESULT(NRL)
  600. fi
  601. dnl ------------------------------------
  602. dnl Solaris 9, 10 and potentially higher
  603. dnl ------------------------------------
  604. elif test x"$opsys" = x"sol9"; then
  605. zebra_cv_ipv6=yes;
  606. AC_DEFINE(HAVE_IPV6, 1, IPv6)
  607. AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6)
  608. RIPNGD="ripngd"
  609. OSPF6D="ospf6d"
  610. AC_MSG_RESULT(Solaris IPv6)
  611. dnl ----------
  612. dnl Linux IPv6
  613. dnl ----------
  614. elif test "${enable_ipv6}" = "yes"; then
  615. AC_EGREP_CPP(yes, [
  616. #include <linux/version.h>
  617. /* 2.1.128 or later */
  618. #if LINUX_VERSION_CODE >= 0x020180
  619. yes
  620. #endif],
  621. [zebra_cv_ipv6=yes
  622. zebra_cv_linux_ipv6=yes
  623. AC_MSG_RESULT(Linux IPv6)])
  624. else
  625. if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route"
  626. then
  627. zebra_cv_ipv6=yes
  628. zebra_cv_linux_ipv6=yes
  629. AC_MSG_RESULT(Linux IPv6)
  630. fi
  631. fi
  632. if test "$zebra_cv_linux_ipv6" = "yes";then
  633. AC_MSG_CHECKING(for GNU libc >= 2.1)
  634. AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
  635. AC_EGREP_CPP(yes, [
  636. #include <features.h>
  637. #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
  638. yes
  639. #endif],
  640. [glibc=yes
  641. AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
  642. AC_MSG_RESULT(yes)],
  643. AC_MSG_RESULT(no)
  644. )
  645. RIPNGD="ripngd"
  646. OSPF6D="ospf6d"
  647. if test "$glibc" != "yes"; then
  648. INCLUDES="-I/usr/inet6/include"
  649. if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then
  650. LIB_IPV6="-L/usr/inet6/lib -linet6"
  651. fi
  652. fi
  653. fi
  654. dnl -----------------------
  655. dnl Set IPv6 related values
  656. dnl -----------------------
  657. LIBS="$LIB_IPV6 $LIBS"
  658. AC_SUBST(LIB_IPV6)
  659. if test x"$RIPNGD" = x""; then
  660. AC_MSG_RESULT(IPv4 only)
  661. fi
  662. fi
  663. dnl ------------------
  664. dnl IPv6 header checks
  665. dnl ------------------
  666. if test "x${zebra_cv_ipv6}" = "xyes"; then
  667. AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \
  668. netinet6/in6_var.h netinet6/nd6.h])
  669. fi
  670. dnl --------------------
  671. dnl Daemon disable check
  672. dnl --------------------
  673. if test "${enable_zebra}" = "no";then
  674. ZEBRA=""
  675. else
  676. ZEBRA="zebra"
  677. fi
  678. if test "${enable_bgpd}" = "no";then
  679. BGPD=""
  680. else
  681. BGPD="bgpd"
  682. fi
  683. if test "${enable_ripd}" = "no";then
  684. RIPD=""
  685. else
  686. RIPD="ripd"
  687. fi
  688. if test "${enable_ospfd}" = "no";then
  689. OSPFD=""
  690. else
  691. OSPFD="ospfd"
  692. fi
  693. OSPFCLIENT=""
  694. if test "${enable_opaque_lsa}" = "yes"; then
  695. if test "${enable_ospfapi}" != "no";then
  696. AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI)
  697. if test "${enable_ospfclient}" != "no";then
  698. OSPFCLIENT="ospfclient"
  699. fi
  700. fi
  701. fi
  702. case "${enable_ripngd}" in
  703. "yes") RIPNGD="ripngd";;
  704. "no" ) RIPNGD="";;
  705. * ) ;;
  706. esac
  707. case "${enable_ospf6d}" in
  708. "yes") OSPF6D="ospf6d";;
  709. "no" ) OSPF6D="";;
  710. * ) ;;
  711. esac
  712. case "${enable_isisd}" in
  713. "yes") ISISD="isisd";;
  714. "no" ) ISISD="";;
  715. * ) ;;
  716. esac
  717. if test "${enable_bgp_announce}" = "no";then
  718. AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra)
  719. fi
  720. AC_SUBST(ZEBRA)
  721. AC_SUBST(BGPD)
  722. AC_SUBST(RIPD)
  723. AC_SUBST(RIPNGD)
  724. AC_SUBST(OSPFD)
  725. AC_SUBST(OSPF6D)
  726. AC_SUBST(ISISD)
  727. AC_SUBST(VTYSH)
  728. AC_SUBST(INCLUDES)
  729. AC_SUBST(CURSES)
  730. AC_SUBST(OSPFCLIENT)
  731. AC_SUBST(OSPFAPI)
  732. AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
  733. AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
  734. AC_CHECK_LIB(crypt, crypt)
  735. AC_CHECK_LIB(resolv, res_init)
  736. AC_CHECK_LIB(m, main)
  737. dnl ---------------------------------------------------
  738. dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY
  739. dnl ---------------------------------------------------
  740. AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP,,__inet_ntop))
  741. AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON,,__inet_pton))
  742. AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON,,__inet_aton))
  743. dnl ---------------------------
  744. dnl check system has GNU regexp
  745. dnl ---------------------------
  746. dnl AC_MSG_CHECKING(whether system has GNU regex)
  747. AC_CHECK_LIB(c, regexec,
  748. [AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
  749. LIB_REGEX=""],
  750. [LIB_REGEX="regex.o"])
  751. AC_SUBST(LIB_REGEX)
  752. dnl ------------------
  753. dnl check SNMP library
  754. dnl ------------------
  755. if test "${enable_snmp}" = "yes";then
  756. dnl AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
  757. if test "${HAVE_SNMP}" = ""; then
  758. old_libs="${LIBS}"
  759. LIBS="-L/usr/lib"
  760. unset ac_cv_lib_snmp_asn_parse_int
  761. AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
  762. if test "${NEED_CRYPTO}" = ""; then
  763. AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes ])
  764. else
  765. AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes; NEED_CRYPTO=yes;LIBS="$LIBS -lcrypto" ],,"-lcrypto")
  766. fi
  767. LIBS="${old_libs}"
  768. fi
  769. if test "${HAVE_SNMP}" = ""; then
  770. old_libs="${LIBS}"
  771. LIBS="-L/usr/lib"
  772. unset ac_cv_lib_snmp_asn_parse_int
  773. AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes, )
  774. if test "${HAVE_SNMP}" = ""; then
  775. unset ac_cv_lib_snmp_asn_parse_int
  776. AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
  777. if test "${NEED_CRYPTO}" = "yes"; then
  778. AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
  779. fi
  780. fi
  781. LIBS="${old_libs}"
  782. fi
  783. if test "${HAVE_SNMP}" = ""; then
  784. old_libs="${LIBS}"
  785. LIBS="-L/usr/local/lib"
  786. unset ac_cv_lib_snmp_asn_parse_int
  787. AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
  788. if test "${HAVE_SNMP}" = ""; then
  789. unset ac_cv_lib_snmp_asn_parse_int
  790. AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
  791. if test "${NEED_CRYPTO}" = "yes"; then
  792. AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
  793. fi
  794. fi
  795. LIBS="${old_libs}"
  796. fi
  797. if test "${HAVE_SNMP}" = "yes"; then
  798. for ac_snmp in /usr/include/net-snmp/library/asn1.h /usr/include/ucd-snmp/asn1.h /usr/local/include/ucd-snmp/asn1.h /dev/null
  799. do
  800. test -f "${ac_snmp}" && break
  801. done
  802. case ${ac_snmp} in
  803. /usr/include/net-snmp/*)
  804. AC_DEFINE(HAVE_SNMP,,SNMP)
  805. AC_DEFINE(HAVE_NETSNMP,,SNMP)
  806. AC_DEFINE(UCD_COMPATIBLE,,SNMP)
  807. CFLAGS="${CFLAGS} -I/usr/include/net-snmp -I/usr/include/net-snmp/library"
  808. if test "${HAVE_NETSNMP}" = "yes"; then
  809. LIBS="${LIBS} -lnetsnmp"
  810. else
  811. LIBS="${LIBS} -lsnmp"
  812. fi
  813. ;;
  814. /usr/include/ucd-snmp/*)
  815. AC_DEFINE(HAVE_SNMP,,SNMP)
  816. CFLAGS="${CFLAGS} -I/usr/include/ucd-snmp"
  817. LIBS="${LIBS} -lsnmp"
  818. ;;
  819. /usr/local/include/ucd-snmp/*)
  820. AC_DEFINE(HAVE_SNMP,,SNMP)
  821. CFLAGS="${CFLAGS} -I/usr/local/include/ucd-snmp"
  822. LIBS="${LIBS} -L/usr/local/lib -lsnmp"
  823. ;;
  824. /usr/local/include/net-snmp/*)
  825. AC_DEFINE(HAVE_SNMP,,SNMP)
  826. AC_DEFINE(HAVE_NET_SNMP,,SNMP)
  827. AC_DEFINE(UCD_COMPATIBLE,,SNMP)
  828. CFLAGS="${CFLAGS} -I/usr/local/include/net-snmp"
  829. LIBS="${LIBS} -L/usr/local/lib -lnetsnmp"
  830. ;;
  831. esac
  832. if test "${NEED_CRYPTO}" = "yes"; then
  833. LIBS="${LIBS} -lcrypto"
  834. fi
  835. fi
  836. fi
  837. dnl ----------------------------
  838. dnl check sa_len of sockaddr
  839. dnl ----------------------------
  840. AC_MSG_CHECKING(whether struct sockaddr has a sa_len field)
  841. AC_TRY_COMPILE([#include <sys/types.h>
  842. #include <sys/socket.h>
  843. ],[static struct sockaddr ac_i;int ac_j = sizeof (ac_i.sa_len);],
  844. [AC_MSG_RESULT(yes)
  845. AC_DEFINE(HAVE_SA_LEN,,sa_len)],
  846. AC_MSG_RESULT(no))
  847. dnl ----------------------------
  848. dnl check sin_len of sockaddr_in
  849. dnl ----------------------------
  850. AC_MSG_CHECKING(whether struct sockaddr_in has a sin_len field)
  851. AC_TRY_COMPILE([#include <sys/types.h>
  852. #include <netinet/in.h>
  853. ],[static struct sockaddr_in ac_i;int ac_j = sizeof (ac_i.sin_len);],
  854. [AC_MSG_RESULT(yes)
  855. AC_DEFINE(HAVE_SIN_LEN,,sin_len)],
  856. AC_MSG_RESULT(no))
  857. dnl ----------------------------
  858. dnl check sun_len of sockaddr_un
  859. dnl ----------------------------
  860. AC_MSG_CHECKING(whether struct sockaddr_un has a sun_len field)
  861. AC_TRY_COMPILE([#include <sys/types.h>
  862. #include <sys/un.h>
  863. ],[static struct sockaddr_un ac_i;int ac_j = sizeof (ac_i.sun_len);],
  864. [AC_MSG_RESULT(yes)
  865. AC_DEFINE(HAVE_SUN_LEN,,sun_len)],
  866. AC_MSG_RESULT(no))
  867. dnl -----------------------------------
  868. dnl check sin6_scope_id of sockaddr_in6
  869. dnl -----------------------------------
  870. if test "$zebra_cv_ipv6" = yes; then
  871. AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field)
  872. AC_TRY_COMPILE([#include <sys/types.h>
  873. #include <netinet/in.h>
  874. ],[static struct sockaddr_in6 ac_i;int ac_j = sizeof (ac_i.sin6_scope_id);],
  875. [AC_MSG_RESULT(yes)
  876. AC_DEFINE(HAVE_SIN6_SCOPE_ID,,scope id)],
  877. AC_MSG_RESULT(no))
  878. fi
  879. dnl ----------------------------
  880. dnl check socklen_t exist or not
  881. dnl ----------------------------
  882. AC_MSG_CHECKING(whther socklen_t is defined)
  883. AC_TRY_COMPILE([#include <sys/types.h>
  884. #include <sys/socket.h>
  885. #include <netinet/in.h>
  886. ],[socklen_t ac_x;],
  887. [AC_MSG_RESULT(yes)
  888. AC_DEFINE(HAVE_SOCKLEN_T,,socklen_t)],
  889. AC_MSG_RESULT(no))
  890. dnl ------------------------
  891. dnl check struct sockaddr_dl
  892. dnl ------------------------
  893. AC_MSG_CHECKING(whether struct sockaddr_dl exist)
  894. AC_EGREP_HEADER(sockaddr_dl,
  895. net/if_dl.h,
  896. [AC_MSG_RESULT(yes)
  897. AC_DEFINE(HAVE_SOCKADDR_DL,,sockaddr_dl)],
  898. AC_MSG_RESULT(no))
  899. dnl --------------------------
  900. dnl check structure ifaliasreq
  901. dnl --------------------------
  902. AC_MSG_CHECKING(whether struct ifaliasreq exist)
  903. AC_EGREP_HEADER(ifaliasreq,
  904. net/if.h,
  905. [AC_MSG_RESULT(yes)
  906. AC_DEFINE(HAVE_IFALIASREQ,,ifaliasreq)],
  907. AC_MSG_RESULT(no))
  908. dnl ----------------------------
  909. dnl check structure in6_aliasreq
  910. dnl ----------------------------
  911. AC_MSG_CHECKING(whether struct in6_aliasreq exist)
  912. AC_EGREP_HEADER(in6_aliasreq,
  913. netinet6/in6_var.h,
  914. [AC_MSG_RESULT(yes)
  915. AC_DEFINE(HAVE_IN6_ALIASREQ,,in6_aliasreq)],
  916. AC_MSG_RESULT(no))
  917. dnl -----------------------------------
  918. dnl check ifra_lifetime of in6_aliasreq
  919. dnl -----------------------------------
  920. AC_MSG_CHECKING(whether in6_aliasreq.ifra_lifetime exist)
  921. AC_TRY_COMPILE([#include <sys/types.h>
  922. #include <netinet6/in6_var.h>
  923. ],[static struct if6_aliasreq ac_i;int ac_j = sizeof (ac_i.ifra_lifetime);],
  924. [AC_MSG_RESULT(yes)
  925. AC_DEFINE(HAVE_IFRA_LIFETIME,,Have in6_aliasreq.ifra_lifetime)],
  926. AC_MSG_RESULT(no))
  927. dnl ---------------------------
  928. dnl check structure rt_addrinfo
  929. dnl ---------------------------
  930. AC_MSG_CHECKING(whether struct rt_addrinfo exist)
  931. AC_EGREP_HEADER(rt_addrinfo,
  932. net/route.h,
  933. [AC_MSG_RESULT(yes)
  934. AC_DEFINE(HAVE_RT_ADDRINFO,,rt_addrinfo)],
  935. AC_MSG_RESULT(no))
  936. dnl --------------------------
  937. dnl check structure in_pktinfo
  938. dnl --------------------------
  939. AC_MSG_CHECKING(whether struct in_pktinfo exist)
  940. AC_TRY_COMPILE([#include <netinet/in.h>
  941. ],[struct in_pktinfo ac_x;],
  942. [AC_MSG_RESULT(yes)
  943. AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)],
  944. AC_MSG_RESULT(no))
  945. dnl --------------------------------------
  946. dnl checking for getrusage struct and call
  947. dnl --------------------------------------
  948. AC_MSG_CHECKING(whether getrusage is available)
  949. AC_TRY_COMPILE([#include <sys/resource.h>
  950. ],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
  951. [AC_MSG_RESULT(yes)
  952. AC_DEFINE(HAVE_RUSAGE,,rusage)],
  953. AC_MSG_RESULT(no))
  954. dnl -------------------
  955. dnl capabilities checks
  956. dnl -------------------
  957. if test "${enable_capabilities}" != "no"; then
  958. AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available)
  959. AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
  960. [AC_MSG_RESULT(yes)
  961. AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl)
  962. quagga_ac_keepcaps="yes"],
  963. AC_MSG_RESULT(no)
  964. )
  965. if test x"${quagga_ac_keepcaps}" = x"yes"; then
  966. AC_CHECK_HEADERS(sys/capability.h)
  967. fi
  968. if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then
  969. AC_CHECK_LIB(cap, cap_init,
  970. [AC_DEFINE(HAVE_LCAPS,1,Capabilities)
  971. LIBCAP="-lcap"
  972. ]
  973. )
  974. fi
  975. fi
  976. AC_SUBST(LIBCAP)
  977. dnl ---------------------------
  978. dnl check for glibc 'backtrace'
  979. dnl ---------------------------
  980. if test "${glibc}" = "yes"; then
  981. AC_CHECK_HEADER(execinfo.h)
  982. fi
  983. if test x"${ac_cv_header_execinfo_h}" = x"yes"; then
  984. AC_CHECK_FUNC(backtrace,
  985. [AC_DEFINE(HAVE_GLIBC_BACKTRACE,,Glibc backtrace)]
  986. )
  987. fi
  988. dnl ----------
  989. dnl configure date
  990. dnl ----------
  991. CONFDATE=`date '+%Y%m%d'`
  992. AC_SUBST(CONFDATE)
  993. dnl ------------------------------
  994. dnl set paths for state directory
  995. dnl ------------------------------
  996. if test "${prefix}" = "NONE"; then
  997. quagga_statedir_prefix="";
  998. else
  999. quagga_statedir_prefix=${prefix}
  1000. fi
  1001. if test "${localstatedir}" = '${prefix}/var'; then
  1002. AC_CACHE_CHECK(state directory,ac_statedir,
  1003. [for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl
  1004. ${quagga_statedir_prefix}/var/adm dnl
  1005. ${quagga_statedir_prefix}/etc dnl
  1006. /var/run dnl
  1007. /var/adm dnl
  1008. /etc dnl
  1009. /dev/null;
  1010. do
  1011. test -d $QUAGGA_STATE_DIR && break
  1012. done
  1013. quagga_statedir=$QUAGGA_STATE_DIR])
  1014. else
  1015. quagga_statedir=${localstatedir}
  1016. AC_MSG_CHECKING(directory to use for state file)
  1017. AC_MSG_RESULT(${quagga_statedir})
  1018. fi
  1019. if test $quagga_statedir = "/dev/null"; then
  1020. AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
  1021. fi
  1022. AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID)
  1023. AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID)
  1024. AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$quagga_statedir/ripngd.pid",ripngd PID)
  1025. AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID)
  1026. AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
  1027. AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
  1028. AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID)
  1029. AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
  1030. AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
  1031. AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket)
  1032. AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$quagga_statedir/ripngd.vty",ripng vty socket)
  1033. AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket)
  1034. AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
  1035. AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
  1036. AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket)
  1037. dnl ---------------------------
  1038. dnl Check htonl works correctly
  1039. dnl ---------------------------
  1040. AC_MSG_CHECKING(for working htonl)
  1041. AC_CACHE_VAL(ac_cv_htonl_works, [
  1042. AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H
  1043. #include <sys/types.h>
  1044. #endif
  1045. #ifdef HAVE_NETDB_H
  1046. #include <netdb.h>
  1047. #endif
  1048. #ifdef HAVE_NETINET_IN_H
  1049. #include <netinet/in.h>
  1050. #endif],
  1051. [htonl (0);],
  1052. ac_cv_htonl_works=yes,
  1053. ac_cv_htonl_works=no)])
  1054. AC_MSG_RESULT($ac_cv_htonl_works)
  1055. AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile
  1056. ripngd/Makefile bgpd/Makefile ospfd/Makefile
  1057. ospf6d/Makefile isisd/Makefile vtysh/Makefile doc/Makefile
  1058. ospfclient/Makefile tests/Makefile m4/Makefile redhat/Makefile
  1059. pkgsrc/Makefile
  1060. vtysh/extract.pl redhat/quagga.spec
  1061. lib/version.h
  1062. doc/defines.texi
  1063. pkgsrc/bgpd.sh pkgsrc/ospf6d.sh pkgsrc/ospfd.sh
  1064. pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh],
  1065. [chmod +x vtysh/extract.pl])
  1066. AC_OUTPUT
  1067. echo "
  1068. Quagga configuration
  1069. --------------------
  1070. quagga version : ${PACKAGE_VERSION}
  1071. host operationg system : ${host_os}
  1072. source code location : ${srcdir}
  1073. compiler : ${CC}
  1074. compiler flags : ${CFLAGS}
  1075. linker flags : ${LDFLAGS} ${LIBS}
  1076. state file directory : ${quagga_statedir}
  1077. config file directory : `eval echo \`echo ${sysconfdir}\``
  1078. example directory : `eval echo \`echo ${exampledir}\``
  1079. user to run as : ${enable_user}
  1080. group to run as : ${enable_group}
  1081. group for vty sockets : ${enable_vty_group}
  1082. config file mask : ${enable_configfile_mask}
  1083. log file mask : ${enable_logfile_mask}
  1084. The above user and group must have read/write access to the state file
  1085. directory and to the config files in the config file directory.
  1086. "