configure.ac 34 KB

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