configure.ac 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566
  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$
  9. AC_PREREQ(2.53)
  10. AC_INIT(Quagga, 0.99.12, [http://bugzilla.quagga.net])
  11. AC_CONFIG_SRCDIR(lib/zebra.h)
  12. dnl -----------------------------------
  13. dnl Get hostname and other information.
  14. dnl -----------------------------------
  15. AC_CANONICAL_BUILD()
  16. AC_CANONICAL_HOST()
  17. AC_CANONICAL_TARGET()
  18. AM_INIT_AUTOMAKE(1.6)
  19. AM_CONFIG_HEADER(config.h)
  20. dnl GNU awk is required for lib/memtype.h made by memtypes.awk.
  21. dnl BSD awk complains: awk: gensub doesn't support backreferences (subst "\1")
  22. AC_CHECK_PROG([GAWK],[gawk],[gawk],[/bin/false])
  23. AC_ARG_VAR([GAWK],[GNU AWK])
  24. dnl default is to match previous behavior
  25. exampledir=${sysconfdir}
  26. AC_ARG_ENABLE([exampledir],
  27. AC_HELP_STRING([--enable-exampledir],
  28. [specify alternate directory for examples]),
  29. exampledir="$enableval",)
  30. dnl XXX add --exampledir to autoconf standard directory list somehow
  31. AC_SUBST(exampledir)
  32. dnl default is to match previous behavior
  33. pkgsrcrcdir=""
  34. pkgsrcdir=""
  35. AC_ARG_ENABLE([pkgsrcrcdir],
  36. AC_HELP_STRING([--enable-pkgsrcrcdir],
  37. [specify directory for rc.d scripts]),
  38. pkgsrcrcdir="$enableval"; pkgsrcdir="pkgsrc",)
  39. dnl XXX add --pkgsrcrcdir to autoconf standard directory list somehow
  40. AC_SUBST(pkgsrcdir)
  41. AC_SUBST(pkgsrcrcdir)
  42. dnl ------------
  43. dnl Check CFLAGS
  44. dnl ------------
  45. AC_ARG_WITH(cflags,
  46. [ --with-cflags Set CFLAGS for use in compilation.])
  47. if test "x$with_cflags" != "x" ; then
  48. CFLAGS="$with_cflags" ; cflags_specified=yes ;
  49. elif test -n "$CFLAGS" ; then
  50. cflags_specified=yes ;
  51. fi
  52. dnl --------------------
  53. dnl Check CC and friends
  54. dnl --------------------
  55. AC_LANG([C])
  56. AC_PROG_CC
  57. AC_PROG_CPP
  58. AM_PROG_CC_C_O
  59. AC_PROG_EGREP
  60. dnl autoconf 2.59 appears not to support AC_PROG_SED
  61. dnl AC_PROG_SED
  62. AC_CHECK_PROG([SED],[sed],[sed],[/bin/false])
  63. dnl ------------------------------------------------------------------
  64. dnl Intel compiler check. Although Intel tries really hard to make icc
  65. dnl look like gcc, there are some differences. It's very verbose with
  66. dnl -Wall and it doesn't support the individual -W options.
  67. dnl ------------------------------------------------------------------
  68. if test "x${GCC}" = "xyes" ; then
  69. COMPILER="GCC"
  70. AC_MSG_CHECKING([whether we are using the Intel compiler])
  71. AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
  72. [AC_MSG_RESULT([no])],
  73. [COMPILER="ICC"
  74. AC_MSG_RESULT([yes])]
  75. )
  76. else
  77. AC_MSG_CHECKING([whether we are using SunPro compiler])
  78. AC_EGREP_CPP([^__SUNPRO_C.*0x5(7|8|9)], ["__SUNPRO_C" __SUNPRO_C],
  79. [AC_MSG_RESULT([no])],
  80. [COMPILER="SUNPRO"
  81. AC_MSG_RESULT([yes])]
  82. )
  83. fi
  84. dnl ---------------------------------------------
  85. dnl If CLFAGS doesn\'t exist set default value
  86. dnl AC_PROG_CC will have set minimal default
  87. dnl already, eg "-O2 -g" for gcc, "-g" for others
  88. dnl (Wall is gcc specific... have to make sure
  89. dnl gcc is being used before setting it)
  90. dnl
  91. dnl Intel icc 8.0 also sets __GNUC__,
  92. dnl but doesn't support all these fancy -W options.
  93. dnl Intel compiler warnings we ignore:
  94. dnl 279: controlling expression is constant.
  95. dnl 869: parameter "xxx" was never referenced - to avoid massive warnings
  96. dnl about "self", "vty", "argc" and "argv" never referenced in DEFUN
  97. dnl macro.
  98. dnl 981: operands are evaluated in unspecified order.
  99. dnl
  100. dnl Sun Studio 10 / SunPro 5.7 is also supported,
  101. dnl so lets set some sane CFLAGS for it.
  102. dnl ---------------------------------------------
  103. AC_MSG_CHECKING([whether to set a default CFLAGS])
  104. if test "x${cflags_specified}" = "x" ; then
  105. case ${COMPILER} in
  106. "ICC")
  107. CFLAGS="-Os -g -Wall -wd 279,869,981"
  108. AC_MSG_RESULT([Intel default])
  109. ;;
  110. "GCC")
  111. CFLAGS="-Os -fno-omit-frame-pointer -g -std=gnu99 -Wall"
  112. CFLAGS="${CFLAGS} -Wsign-compare -Wpointer-arith"
  113. CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings"
  114. CFLAGS="${CFLAGS} -Wmissing-prototypes -Wmissing-declarations"
  115. CFLAGS="${CFLAGS} -Wchar-subscripts -Wcast-qual"
  116. # TODO: conditionally addd -Wpacked if handled
  117. AC_MSG_RESULT([gcc default])
  118. ;;
  119. "SUNPRO")
  120. CFLAGS="-xO4 -v -g -xspace -xcode=pic32 -xstrconst -xc99"
  121. AC_MSG_RESULT([SunPro default])
  122. ;;
  123. *)
  124. AC_MSG_RESULT([unknown compiler])
  125. ;;
  126. esac
  127. else
  128. AC_MSG_RESULT([CFLAGS supplied by user])
  129. fi
  130. dnl --------------
  131. dnl Check programs
  132. dnl --------------
  133. AC_PROG_INSTALL
  134. AC_PROG_LN_S
  135. AC_PROG_MAKE_SET
  136. AC_CHECK_TOOL(AR, ar)
  137. dnl ---------------------------
  138. dnl We, perhaps unfortunately,
  139. dnl depend on GNU Make specific
  140. dnl constructs.
  141. dnl Give the user a warning if
  142. dnl not GNU Make.
  143. dnl ---------------------------
  144. AC_CACHE_CHECK([if ${MAKE-make} is GNU make], [quagga_cv_gnu_make],
  145. [quagga_cv_gnu_make=no
  146. if ${MAKE-make} --version 2>/dev/null | \
  147. grep '^GNU Make ' >/dev/null ; then
  148. quagga_cv_gnu_make=yes;
  149. fi
  150. ]
  151. )
  152. dnl -----------------
  153. dnl System extensions
  154. dnl -----------------
  155. AC_AIX
  156. AC_GNU_SOURCE
  157. dnl -------
  158. dnl libtool
  159. dnl -------
  160. AC_PROG_LIBTOOL
  161. dnl ----------------------
  162. dnl Packages configuration
  163. dnl ----------------------
  164. AC_ARG_ENABLE(vtysh,
  165. [ --enable-vtysh include integrated vty shell for Quagga])
  166. AC_ARG_ENABLE(ipv6,
  167. [ --disable-ipv6 turn off IPv6 related features and daemons])
  168. AC_ARG_ENABLE(zebra,
  169. [ --disable-zebra do not build zebra daemon])
  170. AC_ARG_ENABLE(bgpd,
  171. [ --disable-bgpd do not build bgpd])
  172. AC_ARG_ENABLE(ripd,
  173. [ --disable-ripd do not build ripd])
  174. AC_ARG_ENABLE(ripngd,
  175. [ --disable-ripngd do not build ripngd])
  176. AC_ARG_ENABLE(ospfd,
  177. [ --disable-ospfd do not build ospfd])
  178. AC_ARG_ENABLE(ospf6d,
  179. [ --disable-ospf6d do not build ospf6d])
  180. AC_ARG_ENABLE(watchquagga,
  181. [ --disable-watchquagga do not build watchquagga])
  182. AC_ARG_ENABLE(isisd,
  183. [ --enable-isisd build isisd])
  184. AC_ARG_ENABLE(solaris,
  185. [ --enable-solaris build solaris])
  186. AC_ARG_ENABLE(bgp-announce,
  187. [ --disable-bgp-announce, turn off BGP route announcement])
  188. AC_ARG_ENABLE(netlink,
  189. [ --enable-netlink force to use Linux netlink interface])
  190. AC_ARG_ENABLE(broken-aliases,
  191. [ --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X])
  192. AC_ARG_WITH(crypto,
  193. [ --without-crypto do not use libcrypto in SNMP])
  194. AC_ARG_ENABLE(snmp,
  195. [ --enable-snmp enable SNMP support])
  196. AC_ARG_WITH(libpam,
  197. [ --with-libpam use libpam for PAM support in vtysh])
  198. AC_ARG_ENABLE(tcp-zebra,
  199. [ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon])
  200. AC_ARG_ENABLE(opaque-lsa,
  201. [ --enable-opaque-lsa enable OSPF Opaque-LSA with OSPFAPI support (RFC2370)])
  202. AC_ARG_ENABLE(ospfapi,
  203. [ --disable-ospfapi do not build OSPFAPI to access the OSPF LSA Database,
  204. (this is the default if --enable-opaque-lsa is not set)])
  205. AC_ARG_ENABLE(ospfclient,
  206. [ --disable-ospfclient do not build OSPFAPI client for OSPFAPI,
  207. (this is the default if --disable-ospfapi is set)])
  208. AC_ARG_ENABLE(ospf-te,
  209. [ --enable-ospf-te enable Traffic Engineering Extension to OSPF])
  210. AC_ARG_ENABLE(multipath,
  211. [ --enable-multipath=ARG enable multipath function, ARG must be digit])
  212. AC_ARG_ENABLE(user,
  213. AC_HELP_STRING([--enable-user=user], [user to run Quagga suite as (default quagga)]))
  214. AC_ARG_ENABLE(group,
  215. AC_HELP_STRING([--enable-group=group], [group to run Quagga suite as (default quagga)]))
  216. AC_ARG_ENABLE(vty_group,
  217. [ --enable-vty-group=ARG set vty sockets to have specified group as owner])
  218. AC_ARG_ENABLE(configfile_mask,
  219. [ --enable-configfile-mask=ARG set mask for config files])
  220. AC_ARG_ENABLE(logfile_mask,
  221. [ --enable-logfile-mask=ARG set mask for log files])
  222. AC_ARG_ENABLE(rtadv,
  223. [ --disable-rtadv disable IPV6 router advertisement feature])
  224. AC_ARG_ENABLE(irdp,
  225. [ --enable-irdp enable IRDP server support in zebra])
  226. AC_ARG_ENABLE(isis_topology,
  227. [ --enable-isis-topology enable IS-IS topology generator])
  228. AC_ARG_ENABLE(capabilities,
  229. [ --disable-capabilities disable using POSIX capabilities])
  230. AC_ARG_ENABLE(gcc_ultra_verbose,
  231. [ --enable-gcc-ultra-verbose enable ultra verbose GCC warnings])
  232. AC_ARG_ENABLE(linux24_tcp_md5,
  233. [ --enable-linux24-tcp-md5 enable support for old, Linux-2.4 RFC2385 patch])
  234. AC_ARG_ENABLE(gcc-rdynamic,
  235. [ --enable-gcc-rdynamic enable gcc linking with -rdynamic for better backtraces])
  236. AC_ARG_ENABLE(time-check,
  237. [ --disable-time-check disable slow thread warning messages])
  238. AC_ARG_ENABLE(pcreposix,
  239. [ --enable-pcreposix enable using PCRE Posix libs for regex functions])
  240. if test x"${enable_gcc_ultra_verbose}" = x"yes" ; then
  241. CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
  242. CFLAGS="${CFLAGS} -Wmissing-declarations -Wmissing-noreturn"
  243. CFLAGS="${CFLAGS} -Wmissing-format-attribute -Wunreachable-code"
  244. CFLAGS="${CFLAGS} -Wpacked -Wpadded"
  245. fi
  246. if test x"${enable_gcc_rdynamic}" = x"yes" ; then
  247. LDFLAGS="${LDFLAGS} -rdynamic"
  248. fi
  249. if test x"${enable_time_check}" != x"no" ; then
  250. if test x"${enable_time_check}" = x"yes" -o x"${enable_time_check}" = x ; then
  251. AC_DEFINE(CONSUMED_TIME_CHECK,5000000,Consumed Time Check)
  252. else
  253. AC_DEFINE_UNQUOTED(CONSUMED_TIME_CHECK,$enable_time_check,Consumed Time Check)
  254. fi
  255. fi
  256. if test "${enable_broken_aliases}" = "yes"; then
  257. if test "${enable_netlink}" = "yes"
  258. then
  259. AC_MSG_FAILURE([Sorry you can not use netlink with broken aliases])
  260. fi
  261. AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias)
  262. enable_netlink=no
  263. fi
  264. if test "${enable_tcp_zebra}" = "yes"; then
  265. AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)
  266. fi
  267. if test "${enable_opaque_lsa}" = "yes"; then
  268. AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
  269. fi
  270. if test "${enable_ospf_te}" = "yes"; then
  271. AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
  272. AC_DEFINE(HAVE_OSPF_TE,,OSPF TE)
  273. fi
  274. if test "${enable_linux24_tcp_md5}" = "yes"; then
  275. AC_DEFINE(HAVE_TCP_MD5_LINUX24,,Old Linux 2.4 TCP MD5 Signature Patch)
  276. fi
  277. AC_MSG_CHECKING(if zebra should be configurable to send Route Advertisements)
  278. if test "${enable_rtadv}" != "no"; then
  279. AC_MSG_RESULT(yes)
  280. AC_DEFINE(HAVE_RTADV,,Enable IPv6 Routing Advertisement support)
  281. else
  282. AC_MSG_RESULT(no)
  283. fi
  284. if test "${enable_irdp}" = "yes"; then
  285. AC_DEFINE(HAVE_IRDP,, IRDP )
  286. fi
  287. if test "${enable_isisd}" = "yes" && test "${enable_isis_topology}" = yes; then
  288. AC_DEFINE(TOPOLOGY_GENERATE,,Enable IS-IS topology generator code)
  289. ISIS_TOPOLOGY_INCLUDES="-I./topology"
  290. ISIS_TOPOLOGY_DIR="topology"
  291. ISIS_TOPOLOGY_LIB="./topology/libtopology.a"
  292. fi
  293. AC_SUBST(ISIS_TOPOLOGY_INCLUDES)
  294. AC_SUBST(ISIS_TOPOLOGY_DIR)
  295. AC_SUBST(ISIS_TOPOLOGY_LIB)
  296. if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
  297. enable_user="quagga"
  298. elif test "${enable_user}" = "no"; then
  299. enable_user="root"
  300. fi
  301. if test "${enable_group}" = "yes" || test x"${enable_group}" = x""; then
  302. enable_group="quagga"
  303. elif test "${enable_group}" = "no"; then
  304. enable_group="root"
  305. fi
  306. if test x"${enable_vty_group}" = x"yes" ; then
  307. AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes])
  308. elif test x"${enable_vty_group}" != x""; then
  309. if test x"${enable_vty_group}" != x"no"; then
  310. AC_DEFINE_UNQUOTED(VTY_GROUP, "${enable_vty_group}", VTY Sockets Group)
  311. fi
  312. fi
  313. AC_SUBST([enable_user])
  314. AC_SUBST([enable_group])
  315. AC_SUBST([enable_vty_group])
  316. AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User)
  317. AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group)
  318. enable_configfile_mask=${enable_configfile_mask:-0600}
  319. AC_DEFINE_UNQUOTED(CONFIGFILE_MASK, ${enable_configfile_mask}, Mask for config files)
  320. enable_logfile_mask=${enable_logfile_mask:-0600}
  321. AC_DEFINE_UNQUOTED(LOGFILE_MASK, ${enable_logfile_mask}, Mask for log files)
  322. MULTIPATH_NUM=1
  323. case "${enable_multipath}" in
  324. [[0-9]|[1-9][0-9]])
  325. MULTIPATH_NUM="${enable_multipath}"
  326. ;;
  327. "")
  328. ;;
  329. *)
  330. AC_MSG_FAILURE([Please specify digit to enable multipath ARG])
  331. ;;
  332. esac
  333. AC_SUBST(MULTIPATH_NUM)
  334. dnl ------------------------------------
  335. dnl Check C keywords and standard types
  336. dnl ------------------------------------
  337. AC_C_CONST
  338. AC_C_INLINE
  339. AC_C_RESTRICT
  340. AC_C_VOLATILE
  341. AC_HEADER_STDC
  342. AC_HEADER_TIME
  343. AC_HEADER_SYS_WAIT
  344. dnl AC_TYPE_PID_T
  345. AC_TYPE_UID_T
  346. AC_TYPE_MODE_T
  347. AC_TYPE_SIZE_T
  348. AC_TYPE_SIGNAL
  349. AC_STRUCT_TM
  350. dnl -------------------------
  351. dnl Check other header files.
  352. dnl -------------------------
  353. AC_CHECK_HEADERS([stropts.h sys/ksym.h sys/times.h sys/select.h \
  354. sys/types.h linux/version.h netdb.h asm/types.h \
  355. sys/param.h limits.h signal.h libutil.h \
  356. sys/socket.h netinet/in.h time.h sys/time.h])
  357. dnl Utility macro to avoid retyping includes all the time
  358. m4_define([QUAGGA_INCLUDES],
  359. [#ifdef SUNOS_5
  360. #define _XPG4_2
  361. #define __EXTENSIONS__
  362. #endif
  363. #include <stdio.h>
  364. #if STDC_HEADERS
  365. # include <stdlib.h>
  366. # include <stddef.h>
  367. #else
  368. # if HAVE_STDLIB_H
  369. # include <stdlib.h>
  370. # endif
  371. #endif
  372. #if HAVE_SYS_TYPES_H
  373. # include <sys/types.h>
  374. #endif
  375. /* sys/conf.h depends on param.h on FBSD at least */
  376. #if HAVE_SYS_PARAM_H
  377. # include <sys/param.h>
  378. #endif
  379. /* Required for MAXSIG */
  380. #if HAVE_SIGNAL_H
  381. # include <signal.h>
  382. #endif
  383. #if HAVE_SYS_SOCKET_H
  384. # include <sys/socket.h>
  385. #endif
  386. #if HAVE_NETINET_IN_H
  387. # include <netinet/in.h>
  388. #endif
  389. #ifdef TIME_WITH_SYS_TIME
  390. # include <sys/time.h>
  391. # include <time.h>
  392. #else
  393. # ifdef HAVE_SYS_TIME_H
  394. # include <sys/time.h>
  395. # else
  396. # include <time.h>
  397. # endif
  398. #endif /* TIME_WITH_SYS_TIME */
  399. ])dnl
  400. AC_CHECK_HEADERS([sys/un.h net/if.h netinet/in_systm.h netinet/in_var.h \
  401. net/if_dl.h net/if_var.h net/netopt.h net/route.h \
  402. inet/nd.h arpa/inet.h netinet/ip_icmp.h \
  403. fcntl.h stddef.h sys/ioctl.h syslog.h wchar.h wctype.h \
  404. sys/sysctl.h sys/sockio.h kvm.h sys/conf.h],
  405. [], [], QUAGGA_INCLUDES)
  406. AC_CHECK_HEADERS([ucontext.h], [], [],
  407. [#ifndef __USE_GNU
  408. #define __USE_GNU
  409. #endif /* __USE_GNU */
  410. QUAGGA_INCLUDES
  411. ])
  412. m4_define([QUAGGA_INCLUDES],
  413. QUAGGA_INCLUDES
  414. [#if HAVE_NET_IF_H
  415. # include <net/if.h>
  416. #endif
  417. #if HAVE_SYS_UN_H
  418. # include <sys/un.h>
  419. #endif
  420. #if HAVE_NETINET_IN_SYSTM_H
  421. # include <netinet/in_systm.h>
  422. #endif
  423. #if HAVE_NETINET_IN_VAR_H
  424. # include <netinet/in_var.h>
  425. #endif
  426. #if HAVE_NET_IF_DL_H
  427. # include <net/if_dl.h>
  428. #endif
  429. #if HAVE_NET_IF_VAR_H
  430. # include <net/if_var.h>
  431. #endif
  432. #if HAVE_NET_NETOPT_H
  433. # include <net/netopt.h>
  434. #endif
  435. #if HAVE_NET_ROUTE_H
  436. # include <net/route.h>
  437. #endif
  438. #if HAVE_INET_ND_H
  439. # include <inet/nd.h>
  440. #endif
  441. #if HAVE_ARPA_INET_H
  442. # include <arpa/inet.h>
  443. #endif
  444. /* Required for IDRP */
  445. #if HAVE_NETINET_IP_ICMP_H
  446. # include <netinet/ip_icmp.h>
  447. #endif
  448. ])dnl
  449. dnl V6 headers are checked below, after we check for v6
  450. dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
  451. case "$host" in
  452. [*-sunos5.[6-7]*] | [*-solaris2.[6-7]*])
  453. opsys=sol2-6
  454. AC_DEFINE(SUNOS_56, 1, SunOS 5.6 to 5.7)
  455. AC_DEFINE(SUNOS_5, 1, SunOS 5)
  456. AC_CHECK_LIB(xnet, main)
  457. CURSES=-lcurses
  458. ;;
  459. [*-sunos5.[8-9]] \
  460. | [*-sunos5.1[0-9]] \
  461. | [*-sunos5.1[0-9].[0-9]] \
  462. | [*-solaris2.[8-9]] \
  463. | [*-solaris2.1[0-9]] \
  464. | [*-solaris2.1[0-9].[0-9]])
  465. opsys=sol8
  466. AC_DEFINE(SUNOS_59, 1, [SunOS 5.8 up])
  467. AC_DEFINE(SUNOS_5, 1, [SunOS 5])
  468. AC_CHECK_LIB(socket, main)
  469. AC_CHECK_LIB(nsl, main)
  470. AC_CHECK_LIB(umem, main)
  471. AC_CHECK_FUNCS([printstack],
  472. [AC_DEFINE([HAVE_PRINTSTACK],1,[Solaris printstack])
  473. AC_DEFINE([HAVE_STACK_TRACE],1,[Stack symbols decode functionality])
  474. ])
  475. CURSES=-lcurses
  476. ;;
  477. *-sunos5* | *-solaris2*)
  478. AC_DEFINE(SUNOS_5,,SunOS 5, Unknown SunOS)
  479. AC_CHECK_LIB(socket, main)
  480. AC_CHECK_LIB(nsl, main)
  481. CURSES=-lcurses
  482. ;;
  483. *-linux*)
  484. opsys=gnu-linux
  485. AC_DEFINE(GNU_LINUX,,GNU Linux)
  486. ;;
  487. *-nec-sysv4*)
  488. AC_CHECK_LIB(nsl, gethostbyname)
  489. AC_CHECK_LIB(socket, socket)
  490. ;;
  491. *-openbsd*)
  492. opsys=openbsd
  493. AC_DEFINE(OPEN_BSD,,OpenBSD)
  494. ;;
  495. *-bsdi*)
  496. opsys=bsdi
  497. OTHER_METHOD="mtu_kvm.o"
  498. AC_CHECK_LIB(kvm, main)
  499. ;;
  500. *-irix6.5)
  501. opsys=irix
  502. AC_DEFINE(IRIX_65,,IRIX 6.5)
  503. ;;
  504. esac
  505. dnl ---------------------
  506. dnl Integrated VTY option
  507. dnl ---------------------
  508. case "${enable_vtysh}" in
  509. "yes") VTYSH="vtysh";
  510. AC_DEFINE(VTYSH,,VTY shell)
  511. AC_PATH_PROG(PERL, perl)
  512. dnl Vtysh uses libreadline, which looks for termcap functions at
  513. dnl configure time. We follow readlines search order.
  514. dnl The required procedures are in libtermcap on NetBSD, in
  515. dnl [TODO] on Linux, and in [TODO] on Solaris.
  516. AC_CHECK_LIB(termcap, tputs, LIBREADLINE="$LIBREADLINE -ltermcap",
  517. [AC_CHECK_LIB(tinfo, tputs, LIBREADLINE="$LIBREADLINE -ltinfo",
  518. [AC_CHECK_LIB(curses, tputs, LIBREADLINE="$LIBREADLINE -lcurses",
  519. [AC_CHECK_LIB(ncurses, tputs,
  520. LIBREADLINE="$LIBREADLINE -lncurses")]
  521. )]
  522. )]
  523. )
  524. AC_CHECK_LIB(readline, main, LIBREADLINE="$LIBREADLINE -lreadline",,
  525. "$LIBREADLINE")
  526. if test $ac_cv_lib_readline_main = no; then
  527. AC_MSG_ERROR([vtysh needs libreadline but was not found and usable on your system.])
  528. fi
  529. AC_CHECK_HEADER(readline/history.h)
  530. if test $ac_cv_header_readline_history_h = no;then
  531. AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
  532. fi
  533. AC_CHECK_LIB(readline, rl_completion_matches,
  534. LIBREADLINE="$LIBREADLINE",, "$LIBREADLINE")
  535. if test $ac_cv_lib_readline_rl_completion_matches = no; then
  536. AC_DEFINE(rl_completion_matches,completion_matches,Old readline)
  537. fi
  538. ;;
  539. "no" ) VTYSH="";;
  540. * ) ;;
  541. esac
  542. AC_SUBST(LIBREADLINE)
  543. dnl ----------
  544. dnl PAM module
  545. dnl ----------
  546. if test "$with_libpam" = "yes"; then
  547. AC_CHECK_HEADER([security/pam_misc.h],
  548. [AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
  549. AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
  550. pam_conv_func="misc_conv"
  551. ],
  552. [], QUAGGA_INCLUDES)
  553. AC_CHECK_HEADER([security/openpam.h],
  554. [AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
  555. AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
  556. pam_conv_func="openpam_ttyconv"
  557. ],
  558. [], QUAGGA_INCLUDES)
  559. if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
  560. AC_MSG_WARN([*** pam support will not be built ***])
  561. with_libpam="no"
  562. fi
  563. fi
  564. if test "$with_libpam" = "yes"; then
  565. dnl took this test from proftpds configure.in and suited to our needs
  566. dnl -------------------------------------------------------------------------
  567. dnl
  568. dnl This next check looks funky due to a linker problem with some versions
  569. dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
  570. dnl omitted requiring libdl linking information. PAM-0.72 or better ships
  571. dnl with RedHat 6.2 and Debian 2.2 or better.
  572. AC_CHECK_LIB(pam, pam_start,
  573. [AC_CHECK_LIB(pam, $pam_conv_func,
  574. [AC_DEFINE(USE_PAM,,Use PAM for authentication)
  575. LIBPAM="-lpam"],
  576. [AC_DEFINE(USE_PAM,,Use PAM for authentication)
  577. LIBPAM="-lpam -lpam_misc"]
  578. )
  579. ],
  580. [AC_CHECK_LIB(pam, pam_end,
  581. [AC_CHECK_LIB(pam, $pam_conv_func,
  582. [AC_DEFINE(USE_PAM,,Use PAM for authentication)
  583. LIBPAM="-lpam -ldl"],
  584. [AC_DEFINE(USE_PAM,,Use PAM for authentication)
  585. LIBPAM="-lpam -ldl -lpam_misc"]
  586. )
  587. ],AC_MSG_WARN([*** pam support will not be built ***]),
  588. [-ldl])
  589. ]
  590. )
  591. fi
  592. AC_SUBST(LIBPAM)
  593. dnl -------------------------------
  594. dnl Endian-ness check
  595. dnl -------------------------------
  596. AC_WORDS_BIGENDIAN
  597. dnl -------------------------------
  598. dnl check the size in byte of the C
  599. dnl -------------------------------
  600. dnl AC_CHECK_SIZEOF(char)
  601. dnl AC_CHECK_SIZEOF(int)
  602. dnl AC_CHECK_SIZEOF(short)
  603. dnl AC_CHECK_SIZEOF(long)
  604. dnl ----------------------------
  605. dnl check existance of functions
  606. dnl ----------------------------
  607. AC_FUNC_CHOWN
  608. AC_FUNC_FNMATCH
  609. AC_FUNC_FORK
  610. AC_FUNC_MALLOC
  611. AC_FUNC_MEMCMP
  612. AC_FUNC_MKTIME
  613. AC_FUNC_STRFTIME
  614. AC_FUNC_REALLOC
  615. AC_FUNC_STAT
  616. AC_FUNC_SELECT_ARGTYPES
  617. AC_FUNC_STRFTIME
  618. dnl Avoid AC_FUNC_STRNLEN because it pulls in AC_SYSTEM_EXTENSIONS which
  619. dnl can lead to strange side effects. So we just check for strnlen
  620. dnl directly, see below.
  621. dnl AC_FUNC_STRNLENdnl
  622. AC_FUNC_VPRINTF
  623. dnl -------------------------------
  624. dnl bgpd needs pow() and hence libm
  625. dnl -------------------------------
  626. TMPLIBS="$LIBS"
  627. AC_CHECK_HEADER([math.h],
  628. [AC_CHECK_LIB([m], [pow],
  629. [LIBM="-lm"
  630. LIBS="$LIBS $LIBM"
  631. AC_DEFINE(HAVE_LIBM,, Have libm)
  632. AC_CHECK_FUNCS(pow,[],[LIBM=""])
  633. ])
  634. ])
  635. if test x"$LIBM" = x ; then
  636. AC_MSG_WARN([Unable to find working pow function - bgpd may not link])
  637. fi
  638. LIBS="$TMPLIBS"
  639. AC_SUBST(LIBM)
  640. dnl ---------------
  641. dnl other functions
  642. dnl ---------------
  643. AC_CHECK_FUNCS([dup2 ftruncate getcwd gethostbyname getpagesize gettimeofday \
  644. inet_ntoa inet_aton strnlen \
  645. memchr memmove memset select socket \
  646. strcasecmp strchr strcspn strdup strerror \
  647. strncasecmp strndup strrchr strspn strstr \
  648. strtol strtoul strlcat strlcpy \
  649. daemon snprintf vsnprintf \
  650. if_nametoindex if_indextoname getifaddrs \
  651. uname fcntl])
  652. AC_CHECK_FUNCS(setproctitle, ,
  653. [AC_CHECK_LIB(util, setproctitle,
  654. [LIBS="$LIBS -lutil"
  655. AC_DEFINE(HAVE_SETPROCTITLE,, Have setproctitle)
  656. ]
  657. )
  658. ]
  659. )
  660. dnl ------------------------------------
  661. dnl Determine routing get and set method
  662. dnl ------------------------------------
  663. AC_MSG_CHECKING(zebra between kernel interface method)
  664. if test x"$opsys" = x"gnu-linux"; then
  665. if test "${enable_netlink}" = "yes";then
  666. AC_MSG_RESULT(netlink)
  667. RT_METHOD=rt_netlink.o
  668. AC_DEFINE(HAVE_NETLINK,,netlink)
  669. netlink=yes
  670. elif test "${enable_netlink}" = "no"; then
  671. AC_MSG_RESULT(ioctl)
  672. RT_METHOD=rt_ioctl.o
  673. netlink=no
  674. else
  675. AC_MSG_RESULT(netlink)
  676. RT_METHOD=rt_netlink.o
  677. AC_DEFINE(HAVE_NETLINK,,netlink)
  678. netlink=yes
  679. fi
  680. elif test x"$opsys" = x"sol2-6";then
  681. AC_MSG_RESULT(Route socket)
  682. KERNEL_METHOD="kernel_socket.o"
  683. RT_METHOD="rt_socket.o"
  684. elif test x"$opsys" = x"sol8";then
  685. AC_MSG_RESULT(Route socket)
  686. KERNEL_METHOD="kernel_socket.o"
  687. RT_METHOD="rt_socket.o"
  688. elif test "$opsys" = "irix" ; then
  689. AC_MSG_RESULT(Route socket)
  690. KERNEL_METHOD="kernel_socket.o"
  691. RT_METHOD="rt_socket.o"
  692. else
  693. AC_TRY_RUN([#include <errno.h>
  694. #include <sys/types.h>
  695. #include <sys/socket.h>
  696. main ()
  697. {
  698. int ac_sock;
  699. ac_sock = socket (AF_ROUTE, SOCK_RAW, 0);
  700. if (ac_sock < 0 && errno == EINVAL)
  701. exit (1);
  702. exit (0);
  703. }],
  704. [KERNEL_METHOD=kernel_socket.o
  705. RT_METHOD=rt_socket.o
  706. AC_MSG_RESULT(socket)],
  707. [RT_METHOD=rt_ioctl.o
  708. AC_MSG_RESULT(ioctl)],
  709. [KERNEL_METHOD=kernel_socket.o
  710. RT_METHOD=rt_socket.o
  711. AC_MSG_RESULT(socket)])
  712. fi
  713. AC_SUBST(RT_METHOD)
  714. AC_SUBST(KERNEL_METHOD)
  715. AC_SUBST(OTHER_METHOD)
  716. dnl --------------------------
  717. dnl Determine IS-IS I/O method
  718. dnl --------------------------
  719. AC_CHECK_HEADER(net/bpf.h)
  720. AC_CHECK_HEADER(sys/dlpi.h)
  721. AC_MSG_CHECKING(zebra IS-IS I/O method)
  722. if test x"$opsys" = x"gnu-linux"; then
  723. AC_MSG_RESULT(pfpacket)
  724. ISIS_METHOD=isis_pfpacket.o
  725. elif test x"$opsys" = x"sol2-6" -o x"$opsys" = x"sol8"; then
  726. AC_MSG_RESULT(DLPI)
  727. ISIS_METHOD="isis_dlpi.o"
  728. else
  729. if test $ac_cv_header_net_bpf_h = no; then
  730. if test $ac_cv_header_sys_dlpi_h = no; then
  731. AC_MSG_RESULT(none)
  732. AC_MSG_WARN([*** IS-IS support will not be built ***])
  733. ISISD=""
  734. else
  735. AC_MSG_RESULT(DLPI)
  736. fi
  737. ISIS_METHOD="isis_dlpi.o"
  738. else
  739. AC_MSG_RESULT(BPF)
  740. ISIS_METHOD="isis_bpf.o"
  741. fi
  742. fi
  743. AC_SUBST(ISIS_METHOD)
  744. dnl ------------------------------------
  745. dnl check for broken CMSG_FIRSTHDR macro
  746. dnl ------------------------------------
  747. AC_MSG_CHECKING(for broken CMSG_FIRSTHDR)
  748. AC_RUN_IFELSE([AC_LANG_SOURCE([[
  749. #ifdef SUNOS_5
  750. #define _XPG4_2
  751. #define __EXTENSIONS__
  752. #endif
  753. #ifdef HAVE_STDLIB_H
  754. # include <stdlib.h>
  755. #endif
  756. #ifdef HAVE_SYS_TYPES_H
  757. #include <sys/types.h>
  758. #endif
  759. #ifdef HAVE_SYS_SOCKET_H
  760. #include <sys/socket.h>
  761. #endif
  762. main()
  763. {
  764. struct msghdr msg;
  765. char buf[4];
  766. msg.msg_control = buf;
  767. msg.msg_controllen = 0;
  768. if (CMSG_FIRSTHDR(&msg) != NULL)
  769. exit(0);
  770. exit (1);
  771. }]])],[AC_MSG_RESULT(yes - using workaround) AC_DEFINE(HAVE_BROKEN_CMSG_FIRSTHDR,,Broken CMSG_FIRSTHDR)],
  772. [AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
  773. dnl ------------------------------
  774. dnl check kernel route read method
  775. dnl ------------------------------
  776. AC_CACHE_CHECK(route read method check, zebra_rtread,
  777. [if test "$netlink" = yes; then
  778. RTREAD_METHOD="rtread_netlink.o"
  779. zebra_rtread="netlink"
  780. else
  781. for zebra_rtread in /proc/net/route /dev/ip /dev/null;
  782. do
  783. test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break
  784. done
  785. case $zebra_rtread in
  786. "/proc/net/route") RTREAD_METHOD="rtread_proc.o"
  787. zebra_rtread="proc";;
  788. "/dev/ip")
  789. case "$host" in
  790. *-freebsd*) RTREAD_METHOD=rtread_sysctl.o
  791. zebra_rtread="sysctl";;
  792. *) RTREAD_METHOD="rtread_getmsg.o"
  793. zebra_rtread="getmsg";;
  794. esac;;
  795. *) RTREAD_METHOD="rtread_sysctl.o"
  796. zebra_rtread="sysctl";;
  797. esac
  798. fi])
  799. AC_SUBST(RTREAD_METHOD)
  800. dnl -----------------------------
  801. dnl check interface lookup method
  802. dnl -----------------------------
  803. IOCTL_METHOD=ioctl.o
  804. AC_MSG_CHECKING(interface looking up method)
  805. if test "$netlink" = yes; then
  806. AC_MSG_RESULT(netlink)
  807. IF_METHOD=if_netlink.o
  808. elif test "$opsys" = "sol2-6";then
  809. AC_MSG_RESULT(Solaris GIF)
  810. IF_METHOD=if_ioctl.o
  811. elif test "$opsys" = "sol8";then
  812. AC_MSG_RESULT(Solaris GLIF)
  813. IF_METHOD=if_ioctl_solaris.o
  814. IOCTL_METHOD=ioctl_solaris.o
  815. elif test "$opsys" = "irix" ; then
  816. AC_MSG_RESULT(IRIX)
  817. IF_METHOD=if_ioctl.o
  818. elif test "$opsys" = "openbsd";then
  819. AC_MSG_RESULT(openbsd)
  820. IF_METHOD=if_ioctl.o
  821. elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
  822. AC_MSG_RESULT(sysctl)
  823. IF_METHOD=if_sysctl.o
  824. AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
  825. else
  826. AC_MSG_RESULT(ioctl)
  827. IF_METHOD=if_ioctl.o
  828. fi
  829. AC_SUBST(IF_METHOD)
  830. AC_SUBST(IOCTL_METHOD)
  831. dnl ---------------------------------------------------------------
  832. dnl figure out how to specify an interface in multicast sockets API
  833. dnl ---------------------------------------------------------------
  834. AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [], [], QUAGGA_INCLUDES)
  835. AC_MSG_CHECKING([for BSD struct ip_mreq hack])
  836. AC_TRY_COMPILE([#ifdef HAVE_SYS_PARAM_H
  837. #include <sys/param.h>
  838. #endif],[#if (defined(__FreeBSD__) && ((__FreeBSD_version >= 500022 && __FreeBSD_version < 700000) || (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) || (defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 106010000)
  839. return (0);
  840. #else
  841. #error No support for BSD struct ip_mreq hack detected
  842. #endif],[AC_MSG_RESULT(yes)
  843. AC_DEFINE(HAVE_BSD_STRUCT_IP_MREQ_HACK,,[Can pass ifindex in struct ip_mreq])],
  844. AC_MSG_RESULT(no))
  845. dnl ---------------------------------------------------------------
  846. dnl figure out how to check link-state
  847. dnl ---------------------------------------------------------------
  848. AC_CHECK_HEADER([net/if.h],
  849. [AC_CHECK_HEADER( [net/if_media.h],
  850. [m4_define([LINK_DETECT_INCLUDES],
  851. QUAGGA_INCLUDES
  852. [#include <net/if_media.h>
  853. ])
  854. AC_CHECK_MEMBERS( [struct ifmediareq.ifm_status],
  855. AC_DEFINE(HAVE_BSD_LINK_DETECT,,[BSD link-detect]),
  856. [], LINK_DETECT_INCLUDES)],
  857. [],
  858. QUAGGA_INCLUDES)],
  859. [], QUAGGA_INCLUDES )
  860. dnl ------------------------
  861. dnl TCP_MD5SIG socket option
  862. dnl ------------------------
  863. AC_CHECK_HEADER([netinet/tcp.h],
  864. [m4_define([MD5_INCLUDES],
  865. QUAGGA_INCLUDES
  866. [#include <netinet/tcp.h>
  867. ])
  868. AC_CHECK_DECLS([TCP_MD5SIG], [], [], MD5_INCLUDES)],
  869. [],
  870. QUAGGA_INCLUDES)
  871. if test $ac_cv_have_decl_TCP_MD5SIG = no; then
  872. AC_CHECK_HEADER([linux/tcp.h],
  873. [m4_define([MD5_INCLUDES],
  874. QUAGGA_INCLUDES
  875. [#include <linux/tcp.h>
  876. ])
  877. AC_CHECK_DECLS([TCP_MD5SIG], [], [], MD5_INCLUDES)])
  878. fi
  879. dnl -----------------------
  880. dnl check proc file system.
  881. dnl -----------------------
  882. if test "$netlink" != yes; then
  883. if test -r /proc/net/dev; then
  884. AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev)
  885. IF_PROC=if_proc.o
  886. fi
  887. if test -r /proc/net/if_inet6; then
  888. AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6)
  889. IF_PROC=if_proc.o
  890. fi
  891. fi
  892. AC_SUBST(IF_PROC)
  893. dnl -----------------------------
  894. dnl check ipforward detect method
  895. dnl -----------------------------
  896. AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path,
  897. [for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null;
  898. do
  899. test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break
  900. done
  901. case $zebra_ipforward_path in
  902. "/proc/net/snmp") IPFORWARD=ipforward_proc.o
  903. zebra_ipforward_path="proc";;
  904. "/dev/ip")
  905. case "$host" in
  906. *-nec-sysv4*) IPFORWARD=ipforward_ews.o
  907. zebra_ipforward_path="ews";;
  908. *-freebsd*) IPFORWARD=ipforward_sysctl.o
  909. zebra_ipforward_path="sysctl";;
  910. *) IPFORWARD=ipforward_solaris.o
  911. zebra_ipforward_path="solaris";;
  912. esac;;
  913. *) IPFORWARD=ipforward_sysctl.o
  914. zebra_ipforward_path="sysctl";;
  915. esac])
  916. AC_SUBST(IPFORWARD)
  917. AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
  918. dnl ----------
  919. dnl IPv6 check
  920. dnl ----------
  921. AC_MSG_CHECKING(whether does this OS have IPv6 stack)
  922. if test "${enable_ipv6}" = "no"; then
  923. AC_MSG_RESULT(disabled)
  924. else
  925. dnl ----------
  926. dnl INRIA IPv6
  927. dnl ----------
  928. if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then
  929. zebra_cv_ipv6=yes
  930. AC_DEFINE(HAVE_IPV6,1,INRIA IPv6)
  931. AC_DEFINE(INRIA_IPV6,1,INRIA IPv6)
  932. RIPNGD="ripngd"
  933. OSPF6D="ospf6d"
  934. LIB_IPV6=""
  935. AC_MSG_RESULT(INRIA IPv6)
  936. dnl ---------
  937. dnl KAME IPv6
  938. dnl ---------
  939. elif grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
  940. zebra_cv_ipv6=yes
  941. AC_DEFINE(HAVE_IPV6,1,KAME IPv6)
  942. AC_DEFINE(KAME,1,KAME IPv6)
  943. RIPNGD="ripngd"
  944. OSPF6D="ospf6d"
  945. if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
  946. LIB_IPV6="-L/usr/local/v6/lib -linet6"
  947. fi
  948. AC_MSG_RESULT(KAME)
  949. dnl -------------------------
  950. dnl MUSICA IPv6
  951. dnl default host check
  952. dnl It is not used by Kheops
  953. dnl -------------------------
  954. elif grep MUSICA /usr/include6/netinet6/in6.h >/dev/null 2>&1; then
  955. zebra_cv_ipv6=yes
  956. AC_DEFINE(HAVE_IPV6,1,Musicia IPv6)
  957. AC_DEFINE(MUSICA,1,Musica IPv6 stack)
  958. AC_DEFINE(KAME,1,KAME IPv6 stack)
  959. RIPNGD="ripngd"
  960. OSPF6D="ospf6d"
  961. if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
  962. LIB_IPV6="-L/usr/local/v6/lib -linet6"
  963. fi
  964. AC_MSG_RESULT(MUSICA)
  965. dnl ---------
  966. dnl NRL check
  967. dnl ---------
  968. elif grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then
  969. zebra_cv_ipv6=yes
  970. AC_DEFINE(HAVE_IPV6,1,NRL IPv6)
  971. AC_DEFINE(NRL,1,NRL)
  972. RIPNGD="ripngd"
  973. OSPF6D="ospf6d"
  974. if test x"$opsys" = x"bsdi";then
  975. AC_DEFINE(BSDI_NRL,,BSDI)
  976. AC_MSG_RESULT(BSDI_NRL)
  977. else
  978. AC_MSG_RESULT(NRL)
  979. fi
  980. dnl ------------------------------------
  981. dnl Solaris 9, 10 and potentially higher
  982. dnl ------------------------------------
  983. elif test x"$opsys" = x"sol8"; then
  984. zebra_cv_ipv6=yes;
  985. AC_DEFINE(HAVE_IPV6, 1, IPv6)
  986. AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6)
  987. RIPNGD="ripngd"
  988. OSPF6D="ospf6d"
  989. AC_MSG_RESULT(Solaris IPv6)
  990. dnl ----------
  991. dnl Linux IPv6
  992. dnl ----------
  993. elif test "${enable_ipv6}" = "yes"; then
  994. AC_EGREP_CPP(yes, [
  995. #include <linux/version.h>
  996. /* 2.1.128 or later */
  997. #if LINUX_VERSION_CODE >= 0x020180
  998. yes
  999. #endif],
  1000. [zebra_cv_ipv6=yes
  1001. zebra_cv_linux_ipv6=yes
  1002. AC_MSG_RESULT(Linux IPv6)])
  1003. else
  1004. if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route"
  1005. then
  1006. zebra_cv_ipv6=yes
  1007. zebra_cv_linux_ipv6=yes
  1008. AC_MSG_RESULT(Linux IPv6)
  1009. fi
  1010. fi
  1011. if test "$zebra_cv_linux_ipv6" = "yes";then
  1012. AC_MSG_CHECKING(whether libc has IPv6 support)
  1013. AC_TRY_LINK([#include <netinet/in.h>
  1014. ],[ int a; a = (int) in6addr_any.s6_addr[0]; if (a != 12345) return a; ],
  1015. [AC_MSG_RESULT(yes)
  1016. zebra_cv_ipv6=yes
  1017. zebra_cv_linux_ipv6=yes],
  1018. [AC_MSG_RESULT(no)
  1019. zebra_cv_ipv6=no
  1020. zebra_cv_linux_ipv6=no])
  1021. fi
  1022. if test "$zebra_cv_linux_ipv6" = "yes";then
  1023. AC_MSG_CHECKING(for GNU libc >= 2.1)
  1024. AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
  1025. AC_EGREP_CPP(yes, [
  1026. #include <features.h>
  1027. #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
  1028. yes
  1029. #endif],
  1030. [glibc=yes
  1031. AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
  1032. AC_MSG_RESULT(yes)],
  1033. AC_MSG_RESULT(no)
  1034. )
  1035. RIPNGD="ripngd"
  1036. OSPF6D="ospf6d"
  1037. if test "$glibc" != "yes"; then
  1038. INCLUDES="-I/usr/inet6/include"
  1039. if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then
  1040. LIB_IPV6="-L/usr/inet6/lib -linet6"
  1041. fi
  1042. fi
  1043. fi
  1044. dnl -----------------------
  1045. dnl Set IPv6 related values
  1046. dnl -----------------------
  1047. LIBS="$LIB_IPV6 $LIBS"
  1048. AC_SUBST(LIB_IPV6)
  1049. if test x"$RIPNGD" = x""; then
  1050. AC_MSG_RESULT(IPv4 only)
  1051. fi
  1052. fi
  1053. dnl ------------------
  1054. dnl IPv6 header checks
  1055. dnl ------------------
  1056. if test "x${zebra_cv_ipv6}" = "xyes"; then
  1057. AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \
  1058. netinet6/in6_var.h netinet6/nd6.h], [], [],
  1059. QUAGGA_INCLUDES)
  1060. fi
  1061. m4_define([QUAGGA_INCLUDES],dnl
  1062. QUAGGA_INCLUDES
  1063. [#if HAVE_NETINET6_IN6_H
  1064. #include <netinet6/in6.h>
  1065. #endif
  1066. #if HAVE_NETINET_IN6_VAR_H
  1067. #include <netinet/in6_var.h>
  1068. #endif
  1069. #if HAVE_NETINET_ICMP6_H
  1070. # include <netinet/icmp6.h>
  1071. #endif
  1072. #if HAVE_NETINET6_IN6_VAR_H
  1073. # include <netinet6/in6_var.h>
  1074. #endif
  1075. #if HAVE_NETINET6_ND6_H
  1076. # include <netinet6/nd6.h>
  1077. #endif
  1078. ])dnl
  1079. dnl --------------------
  1080. dnl Daemon disable check
  1081. dnl --------------------
  1082. if test "${enable_zebra}" = "no";then
  1083. ZEBRA=""
  1084. else
  1085. ZEBRA="zebra"
  1086. fi
  1087. if test "${enable_bgpd}" = "no";then
  1088. BGPD=""
  1089. else
  1090. BGPD="bgpd"
  1091. fi
  1092. if test "${enable_ripd}" = "no";then
  1093. RIPD=""
  1094. else
  1095. RIPD="ripd"
  1096. fi
  1097. if test "${enable_ospfd}" = "no";then
  1098. OSPFD=""
  1099. else
  1100. OSPFD="ospfd"
  1101. fi
  1102. if test "${enable_watchquagga}" = "no";then
  1103. WATCHQUAGGA=""
  1104. else
  1105. WATCHQUAGGA="watchquagga"
  1106. fi
  1107. OSPFCLIENT=""
  1108. if test "${enable_opaque_lsa}" = "yes"; then
  1109. if test "${enable_ospfapi}" != "no";then
  1110. AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI)
  1111. if test "${enable_ospfclient}" != "no";then
  1112. OSPFCLIENT="ospfclient"
  1113. fi
  1114. fi
  1115. fi
  1116. case "${enable_ripngd}" in
  1117. "yes") RIPNGD="ripngd";;
  1118. "no" ) RIPNGD="";;
  1119. * ) ;;
  1120. esac
  1121. case "${enable_ospf6d}" in
  1122. "yes") OSPF6D="ospf6d";;
  1123. "no" ) OSPF6D="";;
  1124. * ) ;;
  1125. esac
  1126. case "${enable_isisd}" in
  1127. "yes") ISISD="isisd";;
  1128. "no" ) ISISD="";;
  1129. * ) ;;
  1130. esac
  1131. # XXX Perhaps auto-enable on Solaris, but that's messy for cross builds.
  1132. case "${enable_solaris}" in
  1133. "yes") SOLARIS="solaris";;
  1134. "no" ) SOLARIS="";;
  1135. * ) ;;
  1136. esac
  1137. if test "${enable_bgp_announce}" = "no";then
  1138. AC_DEFINE(DISABLE_BGP_ANNOUNCE,1,Disable BGP installation to zebra)
  1139. else
  1140. AC_DEFINE(DISABLE_BGP_ANNOUNCE,0,Disable BGP installation to zebra)
  1141. fi
  1142. AC_SUBST(ZEBRA)
  1143. AC_SUBST(BGPD)
  1144. AC_SUBST(RIPD)
  1145. AC_SUBST(RIPNGD)
  1146. AC_SUBST(OSPFD)
  1147. AC_SUBST(OSPF6D)
  1148. AC_SUBST(WATCHQUAGGA)
  1149. AC_SUBST(ISISD)
  1150. AC_SUBST(SOLARIS)
  1151. AC_SUBST(VTYSH)
  1152. AC_SUBST(INCLUDES)
  1153. AC_SUBST(CURSES)
  1154. AC_SUBST(OSPFCLIENT)
  1155. AC_SUBST(OSPFAPI)
  1156. AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
  1157. AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
  1158. AC_CHECK_LIB(crypt, crypt)
  1159. AC_CHECK_LIB(resolv, res_init)
  1160. dnl ---------------------------------------------------
  1161. dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY
  1162. dnl ---------------------------------------------------
  1163. AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP,,__inet_ntop))
  1164. AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON,,__inet_pton))
  1165. AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON,,__inet_aton))
  1166. dnl ---------------------------
  1167. dnl check system has PCRE regexp
  1168. dnl ---------------------------
  1169. if test "x$enable_pcreposix" = "xyes"; then
  1170. AC_CHECK_LIB(pcreposix, pcreposix_regexec, ,[enable_pcreposix=no
  1171. AC_MSG_WARN([*** falling back to other regex library ***]) ])
  1172. fi
  1173. if test "x$enable_pcreposix" != "xyes"; then
  1174. dnl ---------------------------
  1175. dnl check system has GNU regexp
  1176. dnl ---------------------------
  1177. AC_MSG_CHECKING(whether system has GNU regex)
  1178. AC_CHECK_LIB(c, regexec,
  1179. [AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
  1180. LIB_REGEX=""],
  1181. [LIB_REGEX="regex.o"])
  1182. fi
  1183. AC_SUBST(HAVE_LIBPCREPOSIX)
  1184. AC_SUBST(LIB_REGEX)
  1185. dnl ------------------
  1186. dnl check Net-SNMP library
  1187. dnl ------------------
  1188. if test "${enable_snmp}" = "yes"; then
  1189. if test "$with_crypto" != "no"; then
  1190. LIBS="${LIBS} -lcrypto";
  1191. fi
  1192. AC_CHECK_LIB(netsnmp, asn_parse_int,
  1193. [AC_DEFINE(HAVE_NETSNMP,,Net SNMP)
  1194. AC_DEFINE(HAVE_SNMP,,SNMP)
  1195. LIBS="${LIBS} -lnetsnmp"],
  1196. [AC_MSG_ERROR([--enable-snmp given, but cannot find support for SNMP])])
  1197. AC_CHECK_HEADER([net-snmp/net-snmp-config.h],
  1198. [],
  1199. [AC_MSG_ERROR([--enable-snmp given, but cannot find net-snmp-config.h])],
  1200. QUAGGA_INCLUDES)
  1201. AC_SUBST(SNMP_INCLUDES)
  1202. fi
  1203. dnl ---------------------------
  1204. dnl sockaddr and netinet checks
  1205. dnl ---------------------------
  1206. AC_CHECK_TYPES([struct sockaddr, struct sockaddr_in,
  1207. struct sockaddr_in6, struct sockaddr_un, struct sockaddr_dl,
  1208. socklen_t,
  1209. struct ifaliasreq, struct if6_aliasreq, struct in6_aliasreq,
  1210. struct nd_opt_adv_interval, struct rt_addrinfo,
  1211. struct nd_opt_homeagent_info, struct nd_opt_adv_interval],
  1212. [], [], QUAGGA_INCLUDES)
  1213. AC_CHECK_MEMBERS([struct sockaddr.sa_len,
  1214. struct sockaddr_in.sin_len, struct sockaddr_un.sun_len,
  1215. struct sockaddr_in6.sin6_scope_id,
  1216. struct if6_aliasreq.ifra_lifetime,
  1217. struct nd_opt_adv_interval.nd_opt_ai_type],
  1218. [], [], QUAGGA_INCLUDES)
  1219. dnl ---------------------------
  1220. dnl IRDP/pktinfo/icmphdr checks
  1221. dnl ---------------------------
  1222. AC_CHECK_TYPES([struct in_pktinfo],
  1223. [AC_CHECK_TYPES([struct icmphdr],
  1224. [if test "${enable_irdp}" != "no"; then
  1225. AC_DEFINE(HAVE_IRDP,, IRDP)
  1226. fi],
  1227. [if test "${enable_irdp}" = "yes"; then
  1228. AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
  1229. fi], [QUAGGA_INCLUDES])],
  1230. [if test "${enable_irdp}" = "yes"; then
  1231. AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
  1232. fi], [QUAGGA_INCLUDES])
  1233. dnl --------------------------------------
  1234. dnl checking for getrusage struct and call
  1235. dnl --------------------------------------
  1236. AC_MSG_CHECKING(whether getrusage is available)
  1237. AC_TRY_COMPILE([#include <sys/resource.h>
  1238. ],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
  1239. [AC_MSG_RESULT(yes)
  1240. AC_DEFINE(HAVE_RUSAGE,,rusage)],
  1241. AC_MSG_RESULT(no))
  1242. dnl --------------------------------------
  1243. dnl checking for clock_time monotonic struct and call
  1244. dnl --------------------------------------
  1245. AC_CHECK_DECL(CLOCK_MONOTONIC,
  1246. [AC_CHECK_LIB(rt, clock_gettime, [LIBS="$LIBS -lrt"])
  1247. AC_DEFINE(HAVE_MONOTONIC_CLOCK,, Have monotonic clock)
  1248. ], [AC_MSG_RESULT(no)], [QUAGGA_INCLUDES])
  1249. dnl -------------------
  1250. dnl capabilities checks
  1251. dnl -------------------
  1252. if test "${enable_capabilities}" != "no"; then
  1253. AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available)
  1254. AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
  1255. [AC_MSG_RESULT(yes)
  1256. AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl)
  1257. quagga_ac_keepcaps="yes"],
  1258. AC_MSG_RESULT(no)
  1259. )
  1260. if test x"${quagga_ac_keepcaps}" = x"yes"; then
  1261. AC_CHECK_HEADERS(sys/capability.h)
  1262. fi
  1263. if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then
  1264. AC_CHECK_LIB(cap, cap_init,
  1265. [AC_DEFINE(HAVE_LCAPS,1,Capabilities)
  1266. LIBCAP="-lcap"
  1267. quagga_ac_lcaps="yes"]
  1268. )
  1269. else
  1270. AC_CHECK_HEADERS(priv.h,
  1271. [AC_MSG_CHECKING(Solaris style privileges are available)
  1272. AC_TRY_COMPILE([#include <priv.h>],[getpflags(PRIV_AWARE);],
  1273. [AC_MSG_RESULT(yes)
  1274. AC_DEFINE(HAVE_SOLARIS_CAPABILITIES,1,getpflags)
  1275. quagga_ac_scaps="yes"],
  1276. AC_MSG_RESULT(no)
  1277. )
  1278. ]
  1279. )
  1280. fi
  1281. if test x"${quagga_ac_scaps}" = x"yes" \
  1282. -o x"${quagga_ac_lcaps}" = x"yes"; then
  1283. AC_DEFINE(HAVE_CAPABILITIES,1,capabilities)
  1284. fi
  1285. fi
  1286. AC_SUBST(LIBCAP)
  1287. dnl ---------------------------
  1288. dnl check for glibc 'backtrace'
  1289. dnl ---------------------------
  1290. if test "${glibc}" = "yes"; then
  1291. AC_CHECK_HEADER([execinfo.h],
  1292. [AC_CHECK_FUNC([backtrace],
  1293. [AC_DEFINE(HAVE_GLIBC_BACKTRACE,,[Glibc backtrace])
  1294. AC_DEFINE(HAVE_STACK_TRACE,,[Stack symbol decoding])
  1295. ])
  1296. ])
  1297. fi
  1298. dnl -----------------------------------------
  1299. dnl check for malloc mallinfo struct and call
  1300. dnl this must try and link using LIBS, in
  1301. dnl order to check no alternative allocator
  1302. dnl has been specified, which might not provide
  1303. dnl mallinfo, e.g. such as Umem on Solaris.
  1304. dnl -----------------------------------------
  1305. AC_CHECK_HEADER([malloc.h],
  1306. [AC_MSG_CHECKING(whether mallinfo is available)
  1307. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]],
  1308. [[struct mallinfo ac_x; ac_x = mallinfo ();]])],
  1309. [AC_MSG_RESULT(yes)
  1310. AC_DEFINE(HAVE_MALLINFO,,mallinfo)],
  1311. AC_MSG_RESULT(no)
  1312. )
  1313. ], [], QUAGGA_INCLUDES)
  1314. dnl ----------
  1315. dnl configure date
  1316. dnl ----------
  1317. CONFDATE=`date '+%Y%m%d'`
  1318. AC_SUBST(CONFDATE)
  1319. dnl Conditionally enable PIE support for GNU toolchains.
  1320. AC_ARG_ENABLE(pie, AS_HELP_STRING([--disable-pie], [Do not build tools as a Position Independent Executables]))
  1321. if test "$enable_pie" != "no"; then
  1322. AC_CACHE_CHECK([whether $CC accepts PIE flags], [ap_cv_cc_pie], [
  1323. save_CFLAGS=$CFLAGS
  1324. save_LDFLAGS=$LDFLAGS
  1325. CFLAGS="$CFLAGS -fPIE"
  1326. LDFLAGS="$LDFLAGS -pie"
  1327. AC_LINK_IFELSE([AC_LANG_SOURCE([[static int foo[30000]; int main () { return 0; }]])],
  1328. [ap_cv_cc_pie=yes], [ap_cv_cc_pie=no]
  1329. )
  1330. CFLAGS=$save_CFLAGS
  1331. LDFLAGS=$save_LDFLAGS
  1332. ])
  1333. if test "$ap_cv_cc_pie" = "yes"; then
  1334. PICFLAGS="-fPIE"
  1335. PILDFLAGS="-pie"
  1336. fi
  1337. fi
  1338. AC_SUBST(PICFLAGS)
  1339. AC_SUBST(PILDFLAGS)
  1340. dnl ------------------------------
  1341. dnl set paths for state directory
  1342. dnl ------------------------------
  1343. if test "${prefix}" = "NONE"; then
  1344. quagga_statedir_prefix="";
  1345. else
  1346. quagga_statedir_prefix=${prefix}
  1347. fi
  1348. if test "${localstatedir}" = '${prefix}/var'; then
  1349. AC_CACHE_CHECK(state directory,ac_statedir,
  1350. [for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl
  1351. ${quagga_statedir_prefix}/var/adm dnl
  1352. ${quagga_statedir_prefix}/etc dnl
  1353. /var/run dnl
  1354. /var/adm dnl
  1355. /etc dnl
  1356. /dev/null;
  1357. do
  1358. test -d $QUAGGA_STATE_DIR && break
  1359. done
  1360. quagga_statedir=$QUAGGA_STATE_DIR])
  1361. else
  1362. quagga_statedir=${localstatedir}
  1363. AC_MSG_CHECKING(directory to use for state file)
  1364. AC_MSG_RESULT(${quagga_statedir})
  1365. AC_SUBST(quagga_statedir)
  1366. fi
  1367. if test $quagga_statedir = "/dev/null"; then
  1368. AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
  1369. fi
  1370. AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID)
  1371. AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID)
  1372. AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$quagga_statedir/ripngd.pid",ripngd PID)
  1373. AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID)
  1374. AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
  1375. AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
  1376. AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID)
  1377. AC_DEFINE_UNQUOTED(PATH_WATCHQUAGGA_PID, "$quagga_statedir/watchquagga.pid",watchquagga PID)
  1378. AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
  1379. AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
  1380. AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket)
  1381. AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$quagga_statedir/ripngd.vty",ripng vty socket)
  1382. AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket)
  1383. AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
  1384. AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
  1385. AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket)
  1386. AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$quagga_statedir",daemon vty directory)
  1387. dnl -------------------------------
  1388. dnl Quagga sources should always be
  1389. dnl current wrt interfaces. Dont
  1390. dnl allow deprecated interfaces to
  1391. dnl be exposed.
  1392. dnl -------------------------------
  1393. AC_DEFINE(QUAGGA_NO_DEPRECATED_INTERFACES, 1, Hide deprecated interfaces)
  1394. dnl ---------------------------
  1395. dnl Check htonl works correctly
  1396. dnl ---------------------------
  1397. AC_MSG_CHECKING(for working htonl)
  1398. AC_CACHE_VAL(ac_cv_htonl_works,
  1399. [AC_LINK_IFELSE([AC_LANG_PROGRAM([QUAGGA_INCLUDES],[htonl (0);])],
  1400. [ac_cv_htonl_works=yes], [ac_cv_htonl_works=no])
  1401. ]
  1402. )
  1403. AC_MSG_RESULT($ac_cv_htonl_works)
  1404. AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile
  1405. ripngd/Makefile bgpd/Makefile ospfd/Makefile watchquagga/Makefile
  1406. ospf6d/Makefile isisd/Makefile vtysh/Makefile doc/Makefile
  1407. ospfclient/Makefile tests/Makefile m4/Makefile redhat/Makefile
  1408. pkgsrc/Makefile
  1409. redhat/quagga.spec
  1410. lib/version.h
  1411. doc/defines.texi
  1412. isisd/topology/Makefile
  1413. pkgsrc/bgpd.sh pkgsrc/ospf6d.sh pkgsrc/ospfd.sh
  1414. pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh])
  1415. AC_CONFIG_FILES([solaris/Makefile])
  1416. AC_CONFIG_FILES([vtysh/extract.pl],[chmod +x vtysh/extract.pl])
  1417. ## Hack, but working solution to avoid rebuilding of quagga.info.
  1418. ## It's already in CVS until texinfo 4.7 is more common.
  1419. AC_OUTPUT
  1420. echo "
  1421. Quagga configuration
  1422. --------------------
  1423. quagga version : ${PACKAGE_VERSION}
  1424. host operationg system : ${host_os}
  1425. source code location : ${srcdir}
  1426. compiler : ${CC}
  1427. compiler flags : ${CFLAGS}
  1428. make : ${MAKE-make}
  1429. includes : ${INCLUDES} ${SNMP_INCLUDES}
  1430. linker flags : ${LDFLAGS} ${LIBS} ${LIBCAP} ${LIBREADLINE} ${LIBM}
  1431. state file directory : ${quagga_statedir}
  1432. config file directory : `eval echo \`echo ${sysconfdir}\``
  1433. example directory : `eval echo \`echo ${exampledir}\``
  1434. user to run as : ${enable_user}
  1435. group to run as : ${enable_group}
  1436. group for vty sockets : ${enable_vty_group}
  1437. config file mask : ${enable_configfile_mask}
  1438. log file mask : ${enable_logfile_mask}
  1439. The above user and group must have read/write access to the state file
  1440. directory and to the config files in the config file directory."
  1441. if test x"$quagga_cv_gnu_make" = x"no"; then echo "
  1442. Warning: The ${MAKE-make} programme detected, either in your path or
  1443. via the MAKE variable, is not GNU Make. GNU make may be installed as
  1444. gmake on some systems. and is required to complete a build of Quagga
  1445. " > /dev/stderr
  1446. fi