configure.ac 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571
  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.13, [http://bugzilla.quagga.net])
  11. AC_CONFIG_SRCDIR(lib/zebra.h)
  12. dnl -----------------------------------
  13. dnl Get hostname and other information.
  14. dnl -----------------------------------
  15. AC_CANONICAL_BUILD()
  16. AC_CANONICAL_HOST()
  17. AC_CANONICAL_TARGET()
  18. AM_INIT_AUTOMAKE(1.6)
  19. AM_CONFIG_HEADER(config.h)
  20. 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. AC_SYS_LARGEFILE
  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. dnl ---------------------
  510. dnl Integrated VTY option
  511. dnl ---------------------
  512. case "${enable_vtysh}" in
  513. "yes") VTYSH="vtysh";
  514. AC_DEFINE(VTYSH,,VTY shell)
  515. AC_PATH_PROG(PERL, perl)
  516. dnl Vtysh uses libreadline, which looks for termcap functions at
  517. dnl configure time. We follow readlines search order.
  518. dnl The required procedures are in libtermcap on NetBSD, in
  519. dnl [TODO] on Linux, and in [TODO] on Solaris.
  520. AC_CHECK_LIB(termcap, tputs, LIBREADLINE="$LIBREADLINE -ltermcap",
  521. [AC_CHECK_LIB(tinfo, tputs, LIBREADLINE="$LIBREADLINE -ltinfo",
  522. [AC_CHECK_LIB(curses, tputs, LIBREADLINE="$LIBREADLINE -lcurses",
  523. [AC_CHECK_LIB(ncurses, tputs,
  524. LIBREADLINE="$LIBREADLINE -lncurses")]
  525. )]
  526. )]
  527. )
  528. AC_CHECK_LIB(readline, main, LIBREADLINE="$LIBREADLINE -lreadline",,
  529. "$LIBREADLINE")
  530. if test $ac_cv_lib_readline_main = no; then
  531. AC_MSG_ERROR([vtysh needs libreadline but was not found and usable on your system.])
  532. fi
  533. AC_CHECK_HEADER(readline/history.h)
  534. if test $ac_cv_header_readline_history_h = no;then
  535. AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
  536. fi
  537. AC_CHECK_LIB(readline, rl_completion_matches,
  538. LIBREADLINE="$LIBREADLINE",, "$LIBREADLINE")
  539. if test $ac_cv_lib_readline_rl_completion_matches = no; then
  540. AC_DEFINE(rl_completion_matches,completion_matches,Old readline)
  541. fi
  542. ;;
  543. "no" ) VTYSH="";;
  544. * ) ;;
  545. esac
  546. AC_SUBST(LIBREADLINE)
  547. dnl ----------
  548. dnl PAM module
  549. dnl ----------
  550. if test "$with_libpam" = "yes"; then
  551. AC_CHECK_HEADER([security/pam_misc.h],
  552. [AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
  553. AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
  554. pam_conv_func="misc_conv"
  555. ],
  556. [], QUAGGA_INCLUDES)
  557. AC_CHECK_HEADER([security/openpam.h],
  558. [AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
  559. AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
  560. pam_conv_func="openpam_ttyconv"
  561. ],
  562. [], QUAGGA_INCLUDES)
  563. if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
  564. AC_MSG_WARN([*** pam support will not be built ***])
  565. with_libpam="no"
  566. fi
  567. fi
  568. if test "$with_libpam" = "yes"; then
  569. dnl took this test from proftpds configure.in and suited to our needs
  570. dnl -------------------------------------------------------------------------
  571. dnl
  572. dnl This next check looks funky due to a linker problem with some versions
  573. dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
  574. dnl omitted requiring libdl linking information. PAM-0.72 or better ships
  575. dnl with RedHat 6.2 and Debian 2.2 or better.
  576. AC_CHECK_LIB(pam, pam_start,
  577. [AC_CHECK_LIB(pam, $pam_conv_func,
  578. [AC_DEFINE(USE_PAM,,Use PAM for authentication)
  579. LIBPAM="-lpam"],
  580. [AC_DEFINE(USE_PAM,,Use PAM for authentication)
  581. LIBPAM="-lpam -lpam_misc"]
  582. )
  583. ],
  584. [AC_CHECK_LIB(pam, pam_end,
  585. [AC_CHECK_LIB(pam, $pam_conv_func,
  586. [AC_DEFINE(USE_PAM,,Use PAM for authentication)
  587. LIBPAM="-lpam -ldl"],
  588. [AC_DEFINE(USE_PAM,,Use PAM for authentication)
  589. LIBPAM="-lpam -ldl -lpam_misc"]
  590. )
  591. ],AC_MSG_WARN([*** pam support will not be built ***]),
  592. [-ldl])
  593. ]
  594. )
  595. fi
  596. AC_SUBST(LIBPAM)
  597. dnl -------------------------------
  598. dnl Endian-ness check
  599. dnl -------------------------------
  600. AC_WORDS_BIGENDIAN
  601. dnl -------------------------------
  602. dnl check the size in byte of the C
  603. dnl -------------------------------
  604. dnl AC_CHECK_SIZEOF(char)
  605. dnl AC_CHECK_SIZEOF(int)
  606. dnl AC_CHECK_SIZEOF(short)
  607. dnl AC_CHECK_SIZEOF(long)
  608. dnl ----------------------------
  609. dnl check existance of functions
  610. dnl ----------------------------
  611. AC_FUNC_CHOWN
  612. AC_FUNC_FNMATCH
  613. AC_FUNC_FORK
  614. AC_FUNC_MALLOC
  615. AC_FUNC_MEMCMP
  616. AC_FUNC_MKTIME
  617. AC_FUNC_STRFTIME
  618. AC_FUNC_REALLOC
  619. AC_FUNC_STAT
  620. AC_FUNC_SELECT_ARGTYPES
  621. AC_FUNC_STRFTIME
  622. dnl Avoid AC_FUNC_STRNLEN because it pulls in AC_SYSTEM_EXTENSIONS which
  623. dnl can lead to strange side effects. So we just check for strnlen
  624. dnl directly, see below.
  625. dnl AC_FUNC_STRNLENdnl
  626. AC_FUNC_VPRINTF
  627. dnl -------------------------------
  628. dnl bgpd needs pow() and hence libm
  629. dnl -------------------------------
  630. TMPLIBS="$LIBS"
  631. AC_CHECK_HEADER([math.h],
  632. [AC_CHECK_LIB([m], [pow],
  633. [LIBM="-lm"
  634. LIBS="$LIBS $LIBM"
  635. AC_DEFINE(HAVE_LIBM,, Have libm)
  636. AC_CHECK_FUNCS(pow,[],[LIBM=""])
  637. ])
  638. ])
  639. if test x"$LIBM" = x ; then
  640. AC_MSG_WARN([Unable to find working pow function - bgpd may not link])
  641. fi
  642. LIBS="$TMPLIBS"
  643. AC_SUBST(LIBM)
  644. dnl ---------------
  645. dnl other functions
  646. dnl ---------------
  647. AC_CHECK_FUNCS([dup2 ftruncate getcwd gethostbyname getpagesize gettimeofday \
  648. inet_ntoa inet_aton strnlen \
  649. memchr memmove memset select socket \
  650. strcasecmp strchr strcspn strdup strerror \
  651. strncasecmp strndup strrchr strspn strstr \
  652. strtol strtoul strlcat strlcpy \
  653. daemon snprintf vsnprintf \
  654. if_nametoindex if_indextoname getifaddrs \
  655. uname fcntl])
  656. AC_CHECK_FUNCS(setproctitle, ,
  657. [AC_CHECK_LIB(util, setproctitle,
  658. [LIBS="$LIBS -lutil"
  659. AC_DEFINE(HAVE_SETPROCTITLE,, Have setproctitle)
  660. ]
  661. )
  662. ]
  663. )
  664. dnl ------------------------------------
  665. dnl Determine routing get and set method
  666. dnl ------------------------------------
  667. AC_MSG_CHECKING(zebra between kernel interface method)
  668. if test x"$opsys" = x"gnu-linux"; then
  669. if test "${enable_netlink}" = "yes";then
  670. AC_MSG_RESULT(netlink)
  671. RT_METHOD=rt_netlink.o
  672. AC_DEFINE(HAVE_NETLINK,,netlink)
  673. netlink=yes
  674. elif test "${enable_netlink}" = "no"; then
  675. AC_MSG_RESULT(ioctl)
  676. RT_METHOD=rt_ioctl.o
  677. netlink=no
  678. else
  679. AC_MSG_RESULT(netlink)
  680. RT_METHOD=rt_netlink.o
  681. AC_DEFINE(HAVE_NETLINK,,netlink)
  682. netlink=yes
  683. fi
  684. elif test x"$opsys" = x"sol2-6";then
  685. AC_MSG_RESULT(Route socket)
  686. KERNEL_METHOD="kernel_socket.o"
  687. RT_METHOD="rt_socket.o"
  688. elif test x"$opsys" = x"sol8";then
  689. AC_MSG_RESULT(Route socket)
  690. KERNEL_METHOD="kernel_socket.o"
  691. RT_METHOD="rt_socket.o"
  692. elif test "$opsys" = "irix" ; then
  693. AC_MSG_RESULT(Route socket)
  694. KERNEL_METHOD="kernel_socket.o"
  695. RT_METHOD="rt_socket.o"
  696. else
  697. AC_TRY_RUN([#include <errno.h>
  698. #include <sys/types.h>
  699. #include <sys/socket.h>
  700. main ()
  701. {
  702. int ac_sock;
  703. ac_sock = socket (AF_ROUTE, SOCK_RAW, 0);
  704. if (ac_sock < 0 && errno == EINVAL)
  705. exit (1);
  706. exit (0);
  707. }],
  708. [KERNEL_METHOD=kernel_socket.o
  709. RT_METHOD=rt_socket.o
  710. AC_MSG_RESULT(socket)],
  711. [RT_METHOD=rt_ioctl.o
  712. AC_MSG_RESULT(ioctl)],
  713. [KERNEL_METHOD=kernel_socket.o
  714. RT_METHOD=rt_socket.o
  715. AC_MSG_RESULT(socket)])
  716. fi
  717. AC_SUBST(RT_METHOD)
  718. AC_SUBST(KERNEL_METHOD)
  719. AC_SUBST(OTHER_METHOD)
  720. dnl --------------------------
  721. dnl Determine IS-IS I/O method
  722. dnl --------------------------
  723. AC_CHECK_HEADER(net/bpf.h)
  724. AC_CHECK_HEADER(sys/dlpi.h)
  725. AC_MSG_CHECKING(zebra IS-IS I/O method)
  726. if test x"$opsys" = x"gnu-linux"; then
  727. AC_MSG_RESULT(pfpacket)
  728. ISIS_METHOD=isis_pfpacket.o
  729. elif test x"$opsys" = x"sol2-6" -o x"$opsys" = x"sol8"; then
  730. AC_MSG_RESULT(DLPI)
  731. ISIS_METHOD="isis_dlpi.o"
  732. else
  733. if test $ac_cv_header_net_bpf_h = no; then
  734. if test $ac_cv_header_sys_dlpi_h = no; then
  735. AC_MSG_RESULT(none)
  736. AC_MSG_WARN([*** IS-IS support will not be built ***])
  737. ISISD=""
  738. else
  739. AC_MSG_RESULT(DLPI)
  740. fi
  741. ISIS_METHOD="isis_dlpi.o"
  742. else
  743. AC_MSG_RESULT(BPF)
  744. ISIS_METHOD="isis_bpf.o"
  745. fi
  746. fi
  747. AC_SUBST(ISIS_METHOD)
  748. dnl ------------------------------------
  749. dnl check for broken CMSG_FIRSTHDR macro
  750. dnl ------------------------------------
  751. AC_MSG_CHECKING(for broken CMSG_FIRSTHDR)
  752. AC_RUN_IFELSE([AC_LANG_SOURCE([[
  753. #ifdef SUNOS_5
  754. #define _XPG4_2
  755. #define __EXTENSIONS__
  756. #endif
  757. #ifdef HAVE_STDLIB_H
  758. # include <stdlib.h>
  759. #endif
  760. #ifdef HAVE_SYS_TYPES_H
  761. #include <sys/types.h>
  762. #endif
  763. #ifdef HAVE_SYS_SOCKET_H
  764. #include <sys/socket.h>
  765. #endif
  766. main()
  767. {
  768. struct msghdr msg;
  769. char buf[4];
  770. msg.msg_control = buf;
  771. msg.msg_controllen = 0;
  772. if (CMSG_FIRSTHDR(&msg) != NULL)
  773. exit(0);
  774. exit (1);
  775. }]])],[AC_MSG_RESULT(yes - using workaround) AC_DEFINE(HAVE_BROKEN_CMSG_FIRSTHDR,,Broken CMSG_FIRSTHDR)],
  776. [AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
  777. dnl ------------------------------
  778. dnl check kernel route read method
  779. dnl ------------------------------
  780. AC_CACHE_CHECK([route read method], [quagga_cv_rtread_method],
  781. [if test "x$netlink" = xyes; then
  782. quagga_cv_rtread_method="netlink"
  783. else
  784. for quagga_cv_rtread_method in /proc/net/route /dev/ip /dev/null;
  785. do
  786. test x`ls $quagga_cv_rtread_method 2>/dev/null` = x"$quagga_cv_rtread_method" && break
  787. done
  788. case $quagga_cv_rtread_method in
  789. "/proc/net/route") quagga_cv_rtread_method="proc";;
  790. "/dev/ip")
  791. case "$host" in
  792. *-freebsd*) quagga_cv_rtread_method="sysctl";;
  793. *) quagga_cv_rtread_method="getmsg";;
  794. esac;;
  795. *)
  796. quagga_cv_rtread_method="sysctl";;
  797. esac
  798. fi])
  799. RTREAD_METHOD=rtread_${quagga_cv_rtread_method}.o
  800. AC_SUBST(RTREAD_METHOD)
  801. dnl -----------------------------
  802. dnl check interface lookup method
  803. dnl -----------------------------
  804. IOCTL_METHOD=ioctl.o
  805. AC_MSG_CHECKING(interface looking up method)
  806. if test "$netlink" = yes; then
  807. AC_MSG_RESULT(netlink)
  808. IF_METHOD=if_netlink.o
  809. elif test "$opsys" = "sol2-6";then
  810. AC_MSG_RESULT(Solaris GIF)
  811. IF_METHOD=if_ioctl.o
  812. elif test "$opsys" = "sol8";then
  813. AC_MSG_RESULT(Solaris GLIF)
  814. IF_METHOD=if_ioctl_solaris.o
  815. IOCTL_METHOD=ioctl_solaris.o
  816. elif test "$opsys" = "irix" ; then
  817. AC_MSG_RESULT(IRIX)
  818. IF_METHOD=if_ioctl.o
  819. elif test "$opsys" = "openbsd";then
  820. AC_MSG_RESULT(openbsd)
  821. IF_METHOD=if_ioctl.o
  822. elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
  823. AC_MSG_RESULT(sysctl)
  824. IF_METHOD=if_sysctl.o
  825. AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
  826. else
  827. AC_MSG_RESULT(ioctl)
  828. IF_METHOD=if_ioctl.o
  829. fi
  830. AC_SUBST(IF_METHOD)
  831. AC_SUBST(IOCTL_METHOD)
  832. dnl ---------------------------------------------------------------
  833. dnl figure out how to specify an interface in multicast sockets API
  834. dnl ---------------------------------------------------------------
  835. AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [], [], QUAGGA_INCLUDES)
  836. AC_MSG_CHECKING([for BSD struct ip_mreq hack])
  837. AC_TRY_COMPILE([#ifdef HAVE_SYS_PARAM_H
  838. #include <sys/param.h>
  839. #endif],[#if (defined(__FreeBSD__) && ((__FreeBSD_version >= 500022 && __FreeBSD_version < 700000) || (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) || (defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 106010000)
  840. return (0);
  841. #else
  842. #error No support for BSD struct ip_mreq hack detected
  843. #endif],[AC_MSG_RESULT(yes)
  844. AC_DEFINE(HAVE_BSD_STRUCT_IP_MREQ_HACK,,[Can pass ifindex in struct ip_mreq])],
  845. AC_MSG_RESULT(no))
  846. dnl ---------------------------------------------------------------
  847. dnl figure out how to check link-state
  848. dnl ---------------------------------------------------------------
  849. AC_CHECK_HEADER([net/if.h],
  850. [AC_CHECK_HEADER( [net/if_media.h],
  851. [m4_define([LINK_DETECT_INCLUDES],
  852. QUAGGA_INCLUDES
  853. [#include <net/if_media.h>
  854. ])
  855. AC_CHECK_MEMBERS( [struct ifmediareq.ifm_status],
  856. AC_DEFINE(HAVE_BSD_LINK_DETECT,,[BSD link-detect]),
  857. [], LINK_DETECT_INCLUDES)],
  858. [],
  859. QUAGGA_INCLUDES)],
  860. [], QUAGGA_INCLUDES )
  861. dnl ------------------------
  862. dnl TCP_MD5SIG socket option
  863. dnl ------------------------
  864. AC_CHECK_HEADER([netinet/tcp.h],
  865. [m4_define([MD5_INCLUDES],
  866. QUAGGA_INCLUDES
  867. [#include <netinet/tcp.h>
  868. ])
  869. AC_CHECK_DECLS([TCP_MD5SIG], [], [], MD5_INCLUDES)],
  870. [],
  871. QUAGGA_INCLUDES)
  872. if test $ac_cv_have_decl_TCP_MD5SIG = no; then
  873. AC_CHECK_HEADER([linux/tcp.h],
  874. [m4_define([MD5_INCLUDES],
  875. QUAGGA_INCLUDES
  876. [#include <linux/tcp.h>
  877. ])
  878. AC_CHECK_DECLS([TCP_MD5SIG], [], [], MD5_INCLUDES)])
  879. fi
  880. dnl -----------------------
  881. dnl check proc file system.
  882. dnl -----------------------
  883. if test "$netlink" != yes; then
  884. if test -r /proc/net/dev; then
  885. AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev)
  886. IF_PROC=if_proc.o
  887. fi
  888. if test -r /proc/net/if_inet6; then
  889. AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6)
  890. IF_PROC=if_proc.o
  891. fi
  892. fi
  893. AC_SUBST(IF_PROC)
  894. dnl -----------------------------
  895. dnl check ipforward detect method
  896. dnl -----------------------------
  897. AC_CACHE_CHECK([ipforward method], [quagga_cv_ipforward_method],
  898. [for quagga_cv_ipforward_method in /proc/net/snmp /dev/ip /dev/null;
  899. do
  900. test x`ls $quagga_cv_ipforward_method 2>/dev/null` = x"$quagga_cv_ipforward_method" && break
  901. done
  902. case $quagga_cv_ipforward_method in
  903. "/proc/net/snmp") quagga_cv_ipforward_method="proc";;
  904. "/dev/ip")
  905. case "$host" in
  906. *-nec-sysv4*) quagga_cv_ipforward_method="ews";;
  907. *-freebsd*) quagga_cv_ipforward_method="sysctl";;
  908. *) quagga_cv_ipforward_method="solaris";;
  909. esac;;
  910. *) quagga_cv_ipforward_method="sysctl";;
  911. esac])
  912. IPFORWARD=ipforward_${quagga_cv_ipforward_method}.o
  913. AC_SUBST(IPFORWARD)
  914. AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
  915. dnl ----------
  916. dnl IPv6 check
  917. dnl ----------
  918. AC_MSG_CHECKING(whether does this OS have IPv6 stack)
  919. if test "${enable_ipv6}" = "no"; then
  920. AC_MSG_RESULT(disabled)
  921. else
  922. dnl ----------
  923. dnl INRIA IPv6
  924. dnl ----------
  925. if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then
  926. zebra_cv_ipv6=yes
  927. AC_DEFINE(HAVE_IPV6,1,INRIA IPv6)
  928. AC_DEFINE(INRIA_IPV6,1,INRIA IPv6)
  929. RIPNGD="ripngd"
  930. OSPF6D="ospf6d"
  931. LIB_IPV6=""
  932. AC_MSG_RESULT(INRIA IPv6)
  933. dnl ---------
  934. dnl KAME IPv6
  935. dnl ---------
  936. elif grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
  937. zebra_cv_ipv6=yes
  938. AC_DEFINE(HAVE_IPV6,1,KAME IPv6)
  939. AC_DEFINE(KAME,1,KAME IPv6)
  940. RIPNGD="ripngd"
  941. OSPF6D="ospf6d"
  942. if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
  943. LIB_IPV6="-L/usr/local/v6/lib -linet6"
  944. fi
  945. AC_MSG_RESULT(KAME)
  946. dnl -------------------------
  947. dnl MUSICA IPv6
  948. dnl default host check
  949. dnl It is not used by Kheops
  950. dnl -------------------------
  951. elif grep MUSICA /usr/include6/netinet6/in6.h >/dev/null 2>&1; then
  952. zebra_cv_ipv6=yes
  953. AC_DEFINE(HAVE_IPV6,1,Musicia IPv6)
  954. AC_DEFINE(MUSICA,1,Musica IPv6 stack)
  955. AC_DEFINE(KAME,1,KAME IPv6 stack)
  956. RIPNGD="ripngd"
  957. OSPF6D="ospf6d"
  958. if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
  959. LIB_IPV6="-L/usr/local/v6/lib -linet6"
  960. fi
  961. AC_MSG_RESULT(MUSICA)
  962. dnl ---------
  963. dnl NRL check
  964. dnl ---------
  965. elif grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then
  966. zebra_cv_ipv6=yes
  967. AC_DEFINE(HAVE_IPV6,1,NRL IPv6)
  968. AC_DEFINE(NRL,1,NRL)
  969. RIPNGD="ripngd"
  970. OSPF6D="ospf6d"
  971. if test x"$opsys" = x"bsdi";then
  972. AC_DEFINE(BSDI_NRL,,BSDI)
  973. AC_MSG_RESULT(BSDI_NRL)
  974. else
  975. AC_MSG_RESULT(NRL)
  976. fi
  977. dnl ------------------------------------
  978. dnl Solaris 9, 10 and potentially higher
  979. dnl ------------------------------------
  980. elif test x"$opsys" = x"sol8"; then
  981. zebra_cv_ipv6=yes;
  982. AC_DEFINE(HAVE_IPV6, 1, IPv6)
  983. AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6)
  984. RIPNGD="ripngd"
  985. OSPF6D="ospf6d"
  986. AC_MSG_RESULT(Solaris IPv6)
  987. dnl ----------
  988. dnl Linux IPv6
  989. dnl ----------
  990. elif test "${enable_ipv6}" = "yes"; then
  991. AC_EGREP_CPP(yes, [
  992. #include <linux/version.h>
  993. /* 2.1.128 or later */
  994. #if LINUX_VERSION_CODE >= 0x020180
  995. yes
  996. #endif],
  997. [zebra_cv_ipv6=yes
  998. zebra_cv_linux_ipv6=yes
  999. AC_MSG_RESULT(Linux IPv6)])
  1000. else
  1001. if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route"
  1002. then
  1003. zebra_cv_ipv6=yes
  1004. zebra_cv_linux_ipv6=yes
  1005. AC_MSG_RESULT(Linux IPv6)
  1006. fi
  1007. fi
  1008. if test "$zebra_cv_linux_ipv6" = "yes";then
  1009. AC_MSG_CHECKING(whether libc has IPv6 support)
  1010. AC_TRY_LINK([#include <netinet/in.h>
  1011. ],[ int a; a = (int) in6addr_any.s6_addr[0]; if (a != 12345) return a; ],
  1012. [AC_MSG_RESULT(yes)
  1013. zebra_cv_ipv6=yes
  1014. zebra_cv_linux_ipv6=yes],
  1015. [AC_MSG_RESULT(no)
  1016. zebra_cv_ipv6=no
  1017. zebra_cv_linux_ipv6=no])
  1018. fi
  1019. if test "$zebra_cv_linux_ipv6" = "yes";then
  1020. AC_MSG_CHECKING(for GNU libc >= 2.1)
  1021. AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
  1022. AC_EGREP_CPP(yes, [
  1023. #include <features.h>
  1024. #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
  1025. yes
  1026. #endif],
  1027. [glibc=yes
  1028. AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
  1029. AC_MSG_RESULT(yes)],
  1030. AC_MSG_RESULT(no)
  1031. )
  1032. RIPNGD="ripngd"
  1033. OSPF6D="ospf6d"
  1034. if test "$glibc" != "yes"; then
  1035. INCLUDES="-I/usr/inet6/include"
  1036. if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then
  1037. LIB_IPV6="-L/usr/inet6/lib -linet6"
  1038. fi
  1039. fi
  1040. fi
  1041. dnl -----------------------
  1042. dnl Set IPv6 related values
  1043. dnl -----------------------
  1044. LIBS="$LIB_IPV6 $LIBS"
  1045. AC_SUBST(LIB_IPV6)
  1046. if test x"$RIPNGD" = x""; then
  1047. AC_MSG_RESULT(IPv4 only)
  1048. fi
  1049. fi
  1050. dnl ------------------
  1051. dnl IPv6 header checks
  1052. dnl ------------------
  1053. if test "x${zebra_cv_ipv6}" = "xyes"; then
  1054. AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \
  1055. netinet6/in6_var.h netinet6/nd6.h], [], [],
  1056. QUAGGA_INCLUDES)
  1057. fi
  1058. m4_define([QUAGGA_INCLUDES],dnl
  1059. QUAGGA_INCLUDES
  1060. [#if HAVE_NETINET6_IN6_H
  1061. #include <netinet6/in6.h>
  1062. #endif
  1063. #if HAVE_NETINET_IN6_VAR_H
  1064. #include <netinet/in6_var.h>
  1065. #endif
  1066. #if HAVE_NETINET_ICMP6_H
  1067. # include <netinet/icmp6.h>
  1068. #endif
  1069. #if HAVE_NETINET6_IN6_VAR_H
  1070. # include <netinet6/in6_var.h>
  1071. #endif
  1072. #if HAVE_NETINET6_ND6_H
  1073. # include <netinet6/nd6.h>
  1074. #endif
  1075. ])dnl
  1076. dnl disable doc check
  1077. if test "${enable_doc}" = "no";then
  1078. DOC=""
  1079. else
  1080. DOC="doc"
  1081. fi
  1082. dnl --------------------
  1083. dnl Daemon disable check
  1084. dnl --------------------
  1085. if test "${enable_zebra}" = "no";then
  1086. ZEBRA=""
  1087. else
  1088. ZEBRA="zebra"
  1089. fi
  1090. if test "${enable_bgpd}" = "no";then
  1091. BGPD=""
  1092. else
  1093. BGPD="bgpd"
  1094. fi
  1095. if test "${enable_ripd}" = "no";then
  1096. RIPD=""
  1097. else
  1098. RIPD="ripd"
  1099. fi
  1100. if test "${enable_ospfd}" = "no";then
  1101. OSPFD=""
  1102. else
  1103. OSPFD="ospfd"
  1104. fi
  1105. if test "${enable_watchquagga}" = "no";then
  1106. WATCHQUAGGA=""
  1107. else
  1108. WATCHQUAGGA="watchquagga"
  1109. fi
  1110. OSPFCLIENT=""
  1111. if test "${enable_opaque_lsa}" = "yes"; then
  1112. if test "${enable_ospfapi}" != "no";then
  1113. AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI)
  1114. if test "${enable_ospfclient}" != "no";then
  1115. OSPFCLIENT="ospfclient"
  1116. fi
  1117. fi
  1118. fi
  1119. case "${enable_ripngd}" in
  1120. "yes") RIPNGD="ripngd";;
  1121. "no" ) RIPNGD="";;
  1122. * ) ;;
  1123. esac
  1124. case "${enable_ospf6d}" in
  1125. "yes") OSPF6D="ospf6d";;
  1126. "no" ) OSPF6D="";;
  1127. * ) ;;
  1128. esac
  1129. case "${enable_isisd}" in
  1130. "yes") ISISD="isisd";;
  1131. "no" ) ISISD="";;
  1132. * ) ;;
  1133. esac
  1134. # XXX Perhaps auto-enable on Solaris, but that's messy for cross builds.
  1135. case "${enable_solaris}" in
  1136. "yes") SOLARIS="solaris";;
  1137. "no" ) SOLARIS="";;
  1138. * ) ;;
  1139. esac
  1140. if test "${enable_bgp_announce}" = "no";then
  1141. AC_DEFINE(DISABLE_BGP_ANNOUNCE,1,Disable BGP installation to zebra)
  1142. else
  1143. AC_DEFINE(DISABLE_BGP_ANNOUNCE,0,Disable BGP installation to zebra)
  1144. fi
  1145. AC_SUBST(DOC)
  1146. AC_SUBST(ZEBRA)
  1147. AC_SUBST(BGPD)
  1148. AC_SUBST(RIPD)
  1149. AC_SUBST(RIPNGD)
  1150. AC_SUBST(OSPFD)
  1151. AC_SUBST(OSPF6D)
  1152. AC_SUBST(WATCHQUAGGA)
  1153. AC_SUBST(ISISD)
  1154. AC_SUBST(SOLARIS)
  1155. AC_SUBST(VTYSH)
  1156. AC_SUBST(INCLUDES)
  1157. AC_SUBST(CURSES)
  1158. AC_SUBST(OSPFCLIENT)
  1159. AC_SUBST(OSPFAPI)
  1160. AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
  1161. AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
  1162. AC_CHECK_LIB(crypt, crypt)
  1163. AC_CHECK_LIB(resolv, res_init)
  1164. dnl ---------------------------------------------------
  1165. dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY
  1166. dnl ---------------------------------------------------
  1167. AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP,,__inet_ntop))
  1168. AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON,,__inet_pton))
  1169. AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON,,__inet_aton))
  1170. dnl ---------------------------
  1171. dnl check system has PCRE regexp
  1172. dnl ---------------------------
  1173. if test "x$enable_pcreposix" = "xyes"; then
  1174. AC_CHECK_LIB(pcreposix, pcreposix_regexec, ,[enable_pcreposix=no
  1175. AC_MSG_WARN([*** falling back to other regex library ***]) ])
  1176. fi
  1177. if test "x$enable_pcreposix" != "xyes"; then
  1178. dnl ---------------------------
  1179. dnl check system has GNU regexp
  1180. dnl ---------------------------
  1181. AC_MSG_CHECKING(whether system has GNU regex)
  1182. AC_CHECK_LIB(c, regexec,
  1183. [AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
  1184. LIB_REGEX=""],
  1185. [LIB_REGEX="regex.o"])
  1186. fi
  1187. AC_SUBST(HAVE_LIBPCREPOSIX)
  1188. AC_SUBST(LIB_REGEX)
  1189. dnl ------------------
  1190. dnl check Net-SNMP library
  1191. dnl ------------------
  1192. if test "${enable_snmp}" = "yes"; then
  1193. if test "$with_crypto" != "no"; then
  1194. LIBS="${LIBS} -lcrypto";
  1195. fi
  1196. AC_CHECK_LIB(netsnmp, asn_parse_int,
  1197. [AC_DEFINE(HAVE_NETSNMP,,Net SNMP)
  1198. AC_DEFINE(HAVE_SNMP,,SNMP)
  1199. LIBS="${LIBS} -lnetsnmp"],
  1200. [AC_MSG_ERROR([--enable-snmp given, but cannot find support for SNMP])])
  1201. AC_CHECK_HEADER([net-snmp/net-snmp-config.h],
  1202. [],
  1203. [AC_MSG_ERROR([--enable-snmp given, but cannot find net-snmp-config.h])],
  1204. QUAGGA_INCLUDES)
  1205. AC_SUBST(SNMP_INCLUDES)
  1206. fi
  1207. dnl ---------------------------
  1208. dnl sockaddr and netinet checks
  1209. dnl ---------------------------
  1210. AC_CHECK_TYPES([struct sockaddr, struct sockaddr_in,
  1211. struct sockaddr_in6, struct sockaddr_un, struct sockaddr_dl,
  1212. socklen_t,
  1213. struct ifaliasreq, struct if6_aliasreq, struct in6_aliasreq,
  1214. struct nd_opt_adv_interval, struct rt_addrinfo,
  1215. struct nd_opt_homeagent_info, struct nd_opt_adv_interval],
  1216. [], [], QUAGGA_INCLUDES)
  1217. AC_CHECK_MEMBERS([struct sockaddr.sa_len,
  1218. struct sockaddr_in.sin_len, struct sockaddr_un.sun_len,
  1219. struct sockaddr_in6.sin6_scope_id,
  1220. struct if6_aliasreq.ifra_lifetime,
  1221. struct nd_opt_adv_interval.nd_opt_ai_type],
  1222. [], [], QUAGGA_INCLUDES)
  1223. dnl ---------------------------
  1224. dnl IRDP/pktinfo/icmphdr checks
  1225. dnl ---------------------------
  1226. AC_CHECK_TYPES([struct in_pktinfo],
  1227. [AC_CHECK_TYPES([struct icmphdr],
  1228. [if test "${enable_irdp}" != "no"; then
  1229. AC_DEFINE(HAVE_IRDP,, IRDP)
  1230. fi],
  1231. [if test "${enable_irdp}" = "yes"; then
  1232. AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
  1233. fi], [QUAGGA_INCLUDES])],
  1234. [if test "${enable_irdp}" = "yes"; then
  1235. AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
  1236. fi], [QUAGGA_INCLUDES])
  1237. dnl --------------------------------------
  1238. dnl checking for getrusage struct and call
  1239. dnl --------------------------------------
  1240. AC_MSG_CHECKING(whether getrusage is available)
  1241. AC_TRY_COMPILE([#include <sys/resource.h>
  1242. ],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
  1243. [AC_MSG_RESULT(yes)
  1244. AC_DEFINE(HAVE_RUSAGE,,rusage)],
  1245. AC_MSG_RESULT(no))
  1246. dnl --------------------------------------
  1247. dnl checking for clock_time monotonic struct and call
  1248. dnl --------------------------------------
  1249. AC_CHECK_DECL(CLOCK_MONOTONIC,
  1250. [AC_CHECK_LIB(rt, clock_gettime, [LIBS="$LIBS -lrt"])
  1251. AC_DEFINE(HAVE_MONOTONIC_CLOCK,, Have monotonic clock)
  1252. ], [AC_MSG_RESULT(no)], [QUAGGA_INCLUDES])
  1253. dnl -------------------
  1254. dnl capabilities checks
  1255. dnl -------------------
  1256. if test "${enable_capabilities}" != "no"; then
  1257. AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available)
  1258. AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
  1259. [AC_MSG_RESULT(yes)
  1260. AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl)
  1261. quagga_ac_keepcaps="yes"],
  1262. AC_MSG_RESULT(no)
  1263. )
  1264. if test x"${quagga_ac_keepcaps}" = x"yes"; then
  1265. AC_CHECK_HEADERS(sys/capability.h)
  1266. fi
  1267. if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then
  1268. AC_CHECK_LIB(cap, cap_init,
  1269. [AC_DEFINE(HAVE_LCAPS,1,Capabilities)
  1270. LIBCAP="-lcap"
  1271. quagga_ac_lcaps="yes"]
  1272. )
  1273. else
  1274. AC_CHECK_HEADERS(priv.h,
  1275. [AC_MSG_CHECKING(Solaris style privileges are available)
  1276. AC_TRY_COMPILE([#include <priv.h>],[getpflags(PRIV_AWARE);],
  1277. [AC_MSG_RESULT(yes)
  1278. AC_DEFINE(HAVE_SOLARIS_CAPABILITIES,1,getpflags)
  1279. quagga_ac_scaps="yes"],
  1280. AC_MSG_RESULT(no)
  1281. )
  1282. ]
  1283. )
  1284. fi
  1285. if test x"${quagga_ac_scaps}" = x"yes" \
  1286. -o x"${quagga_ac_lcaps}" = x"yes"; then
  1287. AC_DEFINE(HAVE_CAPABILITIES,1,capabilities)
  1288. fi
  1289. fi
  1290. AC_SUBST(LIBCAP)
  1291. dnl ---------------------------
  1292. dnl check for glibc 'backtrace'
  1293. dnl ---------------------------
  1294. if test "${glibc}" = "yes"; then
  1295. AC_CHECK_HEADER([execinfo.h],
  1296. [AC_CHECK_FUNC([backtrace],
  1297. [AC_DEFINE(HAVE_GLIBC_BACKTRACE,,[Glibc backtrace])
  1298. AC_DEFINE(HAVE_STACK_TRACE,,[Stack symbol decoding])
  1299. ])
  1300. ])
  1301. fi
  1302. dnl -----------------------------------------
  1303. dnl check for malloc mallinfo struct and call
  1304. dnl this must try and link using LIBS, in
  1305. dnl order to check no alternative allocator
  1306. dnl has been specified, which might not provide
  1307. dnl mallinfo, e.g. such as Umem on Solaris.
  1308. dnl -----------------------------------------
  1309. AC_CHECK_HEADER([malloc.h],
  1310. [AC_MSG_CHECKING(whether mallinfo is available)
  1311. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]],
  1312. [[struct mallinfo ac_x; ac_x = mallinfo ();]])],
  1313. [AC_MSG_RESULT(yes)
  1314. AC_DEFINE(HAVE_MALLINFO,,mallinfo)],
  1315. AC_MSG_RESULT(no)
  1316. )
  1317. ], [], QUAGGA_INCLUDES)
  1318. dnl ----------
  1319. dnl configure date
  1320. dnl ----------
  1321. CONFDATE=`date '+%Y%m%d'`
  1322. AC_SUBST(CONFDATE)
  1323. dnl Conditionally enable PIE support for GNU toolchains.
  1324. AC_ARG_ENABLE(pie, AS_HELP_STRING([--disable-pie], [Do not build tools as a Position Independent Executables]))
  1325. if test "$enable_pie" != "no"; then
  1326. AC_CACHE_CHECK([whether $CC accepts PIE flags], [ap_cv_cc_pie], [
  1327. save_CFLAGS=$CFLAGS
  1328. save_LDFLAGS=$LDFLAGS
  1329. CFLAGS="$CFLAGS -fPIE"
  1330. LDFLAGS="$LDFLAGS -pie"
  1331. AC_LINK_IFELSE([AC_LANG_SOURCE([[static int foo[30000]; int main () { return 0; }]])],
  1332. [ap_cv_cc_pie=yes], [ap_cv_cc_pie=no]
  1333. )
  1334. CFLAGS=$save_CFLAGS
  1335. LDFLAGS=$save_LDFLAGS
  1336. ])
  1337. if test "$ap_cv_cc_pie" = "yes"; then
  1338. PICFLAGS="-fPIE"
  1339. PILDFLAGS="-pie"
  1340. fi
  1341. fi
  1342. AC_SUBST(PICFLAGS)
  1343. AC_SUBST(PILDFLAGS)
  1344. dnl ------------------------------
  1345. dnl set paths for state directory
  1346. dnl ------------------------------
  1347. AC_MSG_CHECKING(directory to use for state file)
  1348. if test "${prefix}" = "NONE"; then
  1349. quagga_statedir_prefix="";
  1350. else
  1351. quagga_statedir_prefix=${prefix}
  1352. fi
  1353. if test "${localstatedir}" = '${prefix}/var'; then
  1354. for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl
  1355. ${quagga_statedir_prefix}/var/adm dnl
  1356. ${quagga_statedir_prefix}/etc dnl
  1357. /var/run dnl
  1358. /var/adm dnl
  1359. /etc dnl
  1360. /dev/null;
  1361. do
  1362. test -d $QUAGGA_STATE_DIR && break
  1363. done
  1364. quagga_statedir=$QUAGGA_STATE_DIR
  1365. else
  1366. quagga_statedir=${localstatedir}
  1367. fi
  1368. if test $quagga_statedir = "/dev/null"; then
  1369. AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
  1370. fi
  1371. AC_MSG_RESULT(${quagga_statedir})
  1372. AC_SUBST(quagga_statedir)
  1373. AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID)
  1374. AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID)
  1375. AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$quagga_statedir/ripngd.pid",ripngd PID)
  1376. AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID)
  1377. AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
  1378. AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
  1379. AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID)
  1380. AC_DEFINE_UNQUOTED(PATH_WATCHQUAGGA_PID, "$quagga_statedir/watchquagga.pid",watchquagga PID)
  1381. AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
  1382. AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
  1383. AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket)
  1384. AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$quagga_statedir/ripngd.vty",ripng vty socket)
  1385. AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket)
  1386. AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
  1387. AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
  1388. AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket)
  1389. AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$quagga_statedir",daemon vty directory)
  1390. dnl -------------------------------
  1391. dnl Quagga sources should always be
  1392. dnl current wrt interfaces. Dont
  1393. dnl allow deprecated interfaces to
  1394. dnl be exposed.
  1395. dnl -------------------------------
  1396. AC_DEFINE(QUAGGA_NO_DEPRECATED_INTERFACES, 1, Hide deprecated interfaces)
  1397. dnl ---------------------------
  1398. dnl Check htonl works correctly
  1399. dnl ---------------------------
  1400. AC_MSG_CHECKING(for working htonl)
  1401. AC_CACHE_VAL(ac_cv_htonl_works,
  1402. [AC_LINK_IFELSE([AC_LANG_PROGRAM([QUAGGA_INCLUDES],[htonl (0);])],
  1403. [ac_cv_htonl_works=yes], [ac_cv_htonl_works=no])
  1404. ]
  1405. )
  1406. AC_MSG_RESULT($ac_cv_htonl_works)
  1407. AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile
  1408. ripngd/Makefile bgpd/Makefile ospfd/Makefile watchquagga/Makefile
  1409. ospf6d/Makefile isisd/Makefile vtysh/Makefile doc/Makefile
  1410. ospfclient/Makefile tests/Makefile m4/Makefile redhat/Makefile
  1411. pkgsrc/Makefile
  1412. redhat/quagga.spec
  1413. lib/version.h
  1414. doc/defines.texi
  1415. isisd/topology/Makefile
  1416. pkgsrc/bgpd.sh pkgsrc/ospf6d.sh pkgsrc/ospfd.sh
  1417. pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh])
  1418. AC_CONFIG_FILES([solaris/Makefile])
  1419. AC_CONFIG_FILES([vtysh/extract.pl],[chmod +x vtysh/extract.pl])
  1420. ## Hack, but working solution to avoid rebuilding of quagga.info.
  1421. ## It's already in CVS until texinfo 4.7 is more common.
  1422. AC_OUTPUT
  1423. echo "
  1424. Quagga configuration
  1425. --------------------
  1426. quagga version : ${PACKAGE_VERSION}
  1427. host operationg system : ${host_os}
  1428. source code location : ${srcdir}
  1429. compiler : ${CC}
  1430. compiler flags : ${CFLAGS}
  1431. make : ${MAKE-make}
  1432. includes : ${INCLUDES} ${SNMP_INCLUDES}
  1433. linker flags : ${LDFLAGS} ${LIBS} ${LIBCAP} ${LIBREADLINE} ${LIBM}
  1434. state file directory : ${quagga_statedir}
  1435. config file directory : `eval echo \`echo ${sysconfdir}\``
  1436. example directory : `eval echo \`echo ${exampledir}\``
  1437. user to run as : ${enable_user}
  1438. group to run as : ${enable_group}
  1439. group for vty sockets : ${enable_vty_group}
  1440. config file mask : ${enable_configfile_mask}
  1441. log file mask : ${enable_logfile_mask}
  1442. The above user and group must have read/write access to the state file
  1443. directory and to the config files in the config file directory."
  1444. if test x"$quagga_cv_gnu_make" = x"no"; then echo "
  1445. Warning: The ${MAKE-make} programme detected, either in your path or
  1446. via the MAKE variable, is not GNU Make. GNU make may be installed as
  1447. gmake on some systems. and is required to complete a build of Quagga
  1448. " > /dev/stderr
  1449. fi