configure.ac 46 KB

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