configure.ac 47 KB

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