blob: ec0351dbdebf15e12873dd8baa6b774614ecfcb4 [file] [log] [blame]
paul7ea487b2003-03-17 02:05:07 +00001##
paule8f29842003-08-12 13:08:31 +00002## Configure template file for Quagga.
paul7ea487b2003-03-17 02:05:07 +00003## autoconf will generate configure script.
4##
5## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
paule8f29842003-08-12 13:08:31 +00006## Portions Copyright (c) 2003 Paul Jakma <paul@dishone.st>
paul7ea487b2003-03-17 02:05:07 +00007##
Paul Jakmaf9f47312016-02-16 11:30:33 +00008AC_PREREQ(2.60)
paul7ea487b2003-03-17 02:05:07 +00009
Donald Sharp86c5d2e2016-03-15 19:17:17 -040010AC_INIT(Quagga, 1.0.20160315, [https://bugzilla.quagga.net])
David Lamparter7abd8752014-11-22 10:43:29 -080011CONFIG_ARGS="$*"
12AC_SUBST(CONFIG_ARGS)
paulfa1253d2003-09-24 05:09:26 +000013AC_CONFIG_SRCDIR(lib/zebra.h)
Paul Jakma62c9f502009-07-19 17:33:21 +010014AC_CONFIG_MACRO_DIR([m4])
ajsdfb9a542005-04-11 14:55:55 +000015
16dnl -----------------------------------
17dnl Get hostname and other information.
18dnl -----------------------------------
19AC_CANONICAL_BUILD()
20AC_CANONICAL_HOST()
21AC_CANONICAL_TARGET()
22
gdt81b81822004-04-07 22:48:47 +000023AM_INIT_AUTOMAKE(1.6)
Pawel Wieczorkiewicz2ab67a72016-04-01 12:54:38 +020024
25m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
David Lampartercc813082015-02-10 11:39:39 +010026AM_SILENT_RULES([yes])
Hasso Tepper303bb002013-01-13 17:45:28 +000027AC_CONFIG_HEADERS(config.h)
paul7ea487b2003-03-17 02:05:07 +000028
David Lamparter0be793e2012-11-27 01:34:56 +000029AC_PATH_PROG(PERL, perl)
Jeremy Jackson7ec57362009-01-21 22:10:40 -050030AC_CHECK_PROG([GAWK],[gawk],[gawk],[not-in-PATH])
31if test "x$GAWK" = "xnot-in-PATH" ; then
32 AC_MSG_ERROR([GNU awk is required for lib/memtype.h made by memtypes.awk.
33BSD awk complains: awk: gensub doesn't support backreferences (subst "\1") ])
34fi
paul03ecfb62005-04-16 15:38:23 +000035AC_ARG_VAR([GAWK],[GNU AWK])
36
gdtd6b72f72003-12-03 17:24:27 +000037dnl default is to match previous behavior
gdtc4f0efe2003-12-04 15:39:25 +000038exampledir=${sysconfdir}
gdtd6b72f72003-12-03 17:24:27 +000039AC_ARG_ENABLE([exampledir],
David Lamparterb6fa7602014-06-28 22:15:59 +020040 AS_HELP_STRING([--enable-exampledir],
gdtd6b72f72003-12-03 17:24:27 +000041 [specify alternate directory for examples]),
42 exampledir="$enableval",)
gdtc4f0efe2003-12-04 15:39:25 +000043dnl XXX add --exampledir to autoconf standard directory list somehow
gdtd6b72f72003-12-03 17:24:27 +000044AC_SUBST(exampledir)
45
gdtcbd04082004-08-31 18:16:36 +000046dnl default is to match previous behavior
47pkgsrcrcdir=""
48pkgsrcdir=""
49AC_ARG_ENABLE([pkgsrcrcdir],
David Lamparterb6fa7602014-06-28 22:15:59 +020050 AS_HELP_STRING([--enable-pkgsrcrcdir],
gdtcbd04082004-08-31 18:16:36 +000051 [specify directory for rc.d scripts]),
52 pkgsrcrcdir="$enableval"; pkgsrcdir="pkgsrc",)
53dnl XXX add --pkgsrcrcdir to autoconf standard directory list somehow
54AC_SUBST(pkgsrcdir)
55AC_SUBST(pkgsrcrcdir)
56
paul7ea487b2003-03-17 02:05:07 +000057dnl ------------
58dnl Check CFLAGS
59dnl ------------
60AC_ARG_WITH(cflags,
61[ --with-cflags Set CFLAGS for use in compilation.])
62if test "x$with_cflags" != "x" ; then
63 CFLAGS="$with_cflags" ; cflags_specified=yes ;
64elif test -n "$CFLAGS" ; then
65 cflags_specified=yes ;
66fi
67
hasso1969e4b2005-03-27 13:07:23 +000068dnl --------------------
69dnl Check CC and friends
70dnl --------------------
Paul P Komkoff Jr46bc0e42008-08-13 16:17:04 +010071AC_LANG([C])
paul7ea487b2003-03-17 02:05:07 +000072AC_PROG_CC
hasso1969e4b2005-03-27 13:07:23 +000073AC_PROG_CPP
Paul P Komkoff Jr46bc0e42008-08-13 16:17:04 +010074AM_PROG_CC_C_O
Paul Jakmaf9f47312016-02-16 11:30:33 +000075AC_PROG_RANLIB
hasso1969e4b2005-03-27 13:07:23 +000076AC_PROG_EGREP
Greg Troxel553bdfe2007-02-06 20:10:35 +000077
78dnl autoconf 2.59 appears not to support AC_PROG_SED
79dnl AC_PROG_SED
80AC_CHECK_PROG([SED],[sed],[sed],[/bin/false])
hasso1969e4b2005-03-27 13:07:23 +000081
Paul Jakmafa482832012-03-08 13:51:21 +000082dnl pdflatex and latexmk are needed to build HACKING.pdf
83AC_CHECK_PROG([PDFLATEX],[pdflatex],[pdflatex],[/bin/false])
84AC_CHECK_PROG([LATEXMK],[latexmk],[latexmk],[/bin/false])
85if test "x$PDFLATEX" = "x/bin/false" -o "x$LATEXMK" = "x/bin/false"; then
86 AC_MSG_WARN([Will not be able to make PDF versions of TeX documents])
87else
88 HAVE_LATEX=true
89fi
90AM_CONDITIONAL([HAVE_LATEX], [test "x$HAVE_LATEX" = "xtrue"])
91
David Lamparter3a7e83c2015-03-03 09:55:51 +010092if test "x${GCC}" != "xyes" ; then
paul6a4b8832005-11-26 08:28:00 +000093 AC_MSG_CHECKING([whether we are using SunPro compiler])
94 AC_EGREP_CPP([^__SUNPRO_C.*0x5(7|8|9)], ["__SUNPRO_C" __SUNPRO_C],
95 [AC_MSG_RESULT([no])],
96 [COMPILER="SUNPRO"
97 AC_MSG_RESULT([yes])]
98 )
99fi
paul7ea487b2003-03-17 02:05:07 +0000100
paula49c0ff2004-09-30 06:08:58 +0000101dnl ---------------------------------------------
paul7ea487b2003-03-17 02:05:07 +0000102dnl If CLFAGS doesn\'t exist set default value
paula49c0ff2004-09-30 06:08:58 +0000103dnl AC_PROG_CC will have set minimal default
104dnl already, eg "-O2 -g" for gcc, "-g" for others
paul27eebb32004-07-22 18:16:59 +0000105dnl (Wall is gcc specific... have to make sure
106dnl gcc is being used before setting it)
107dnl
paul6a4b8832005-11-26 08:28:00 +0000108dnl Sun Studio 10 / SunPro 5.7 is also supported,
109dnl so lets set some sane CFLAGS for it.
110dnl ---------------------------------------------
hasso1969e4b2005-03-27 13:07:23 +0000111
David Lamparter3a7e83c2015-03-03 09:55:51 +0100112AC_USE_SYSTEM_EXTENSIONS()
113AC_DEFUN([AC_C_FLAG], [{
114 AC_LANG_PUSH(C)
115 ac_c_flag_save="$CFLAGS"
116 CFLAGS="$CFLAGS $1"
117 AC_MSG_CHECKING([[whether $CC supports $1]])
118 AC_COMPILE_IFELSE(
119 [AC_LANG_PROGRAM([[]])],
120 [
121 AC_MSG_RESULT([yes])
122 m4_if([$3], [], [], [
123 CFLAGS="$ac_c_flag_save"
124 $3
125 ])
126 ], [
127 CFLAGS="$ac_c_flag_save"
128 AC_MSG_RESULT([no])
129 $2
130 ])
131 AC_LANG_POP(C)
132 }])
133
paul6a4b8832005-11-26 08:28:00 +0000134AC_MSG_CHECKING([whether to set a default CFLAGS])
135if test "x${cflags_specified}" = "x" ; then
136 case ${COMPILER} in
paul6a4b8832005-11-26 08:28:00 +0000137 "SUNPRO")
David Lamparter3a7e83c2015-03-03 09:55:51 +0100138 CFLAGS="-xO4 -v -g -xspace -xcode=pic32 -xstrconst -xc99"
139 AC_MSG_RESULT([SunPro default])
140 ;;
paul6a4b8832005-11-26 08:28:00 +0000141 *)
David Lamparter3a7e83c2015-03-03 09:55:51 +0100142 AC_MSG_RESULT([autodetecting])
143
144 AC_C_FLAG([-diag-error 10006])
145 AC_C_FLAG([-std=gnu99])
146 AC_C_FLAG([-g])
147 AC_C_FLAG([-Os], [
148 AC_C_FLAG([-O2])
149 ])
Paul Jakma52c0bc72015-08-20 21:30:17 +0100150 AC_C_FLAG([-fpie])
David Lamparter3a7e83c2015-03-03 09:55:51 +0100151 AC_C_FLAG([-fno-omit-frame-pointer])
152 AC_C_FLAG([-Wall])
153 AC_C_FLAG([-Wextra])
154 AC_C_FLAG([-Wmissing-prototypes])
155 AC_C_FLAG([-Wmissing-declarations])
156 AC_C_FLAG([-Wpointer-arith])
157 AC_C_FLAG([-Wbad-function-cast])
158 AC_C_FLAG([-Wwrite-strings])
159 if test x"${enable_gcc_ultra_verbose}" = x"yes" ; then
160 AC_C_FLAG([-Wcast-qual])
161 AC_C_FLAG([-Wstrict-prototypes])
162 AC_C_FLAG([-Wmissing-noreturn])
163 AC_C_FLAG([-Wmissing-format-attribute])
164 AC_C_FLAG([-Wunreachable-code])
165 AC_C_FLAG([-Wpacked])
166 AC_C_FLAG([-Wpadded])
167 else
168 AC_C_FLAG([-Wno-unused-result])
169 fi
170 AC_C_FLAG([-Wno-unused-parameter])
171 AC_C_FLAG([-Wno-missing-field-initializers])
172 # ICC emits a broken warning for const char *x = a ? "b" : "c";
173 # for some reason the string consts get 'promoted' to char *,
174 # triggering a const to non-const conversion warning.
175 AC_C_FLAG([-diag-disable 3179])
paul6a4b8832005-11-26 08:28:00 +0000176 ;;
177 esac
178else
179 AC_MSG_RESULT([CFLAGS supplied by user])
hasso1969e4b2005-03-27 13:07:23 +0000180fi
181
David Lamparterc0bedeb2015-03-03 10:00:43 +0100182if test x"${enable_werror}" = x"yes" ; then
183 WERROR="-Werror"
184fi
185AC_SUBST(WERROR)
186
paul7ea487b2003-03-17 02:05:07 +0000187dnl --------------
188dnl Check programs
189dnl --------------
paul7ea487b2003-03-17 02:05:07 +0000190AC_PROG_INSTALL
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000191AC_PROG_LN_S
paul7ea487b2003-03-17 02:05:07 +0000192AC_PROG_MAKE_SET
193AC_CHECK_TOOL(AR, ar)
paul7ea487b2003-03-17 02:05:07 +0000194
Paul Jakma105b8232006-05-28 08:02:41 +0000195dnl ---------------------------
196dnl We, perhaps unfortunately,
197dnl depend on GNU Make specific
198dnl constructs.
199dnl Give the user a warning if
200dnl not GNU Make.
201dnl ---------------------------
202AC_CACHE_CHECK([if ${MAKE-make} is GNU make], [quagga_cv_gnu_make],
203 [quagga_cv_gnu_make=no
204 if ${MAKE-make} --version 2>/dev/null | \
205 grep '^GNU Make ' >/dev/null ; then
206 quagga_cv_gnu_make=yes;
207 fi
208 ]
209)
210
Paul Jakmad46d2a22007-05-10 16:53:04 +0000211dnl -----------------
212dnl System extensions
213dnl -----------------
Paul Jakmad46d2a22007-05-10 16:53:04 +0000214AC_GNU_SOURCE
paul7ea487b2003-03-17 02:05:07 +0000215
gdt87efd642004-06-30 17:36:11 +0000216dnl -------
217dnl libtool
218dnl -------
Paul Jakma52c0bc72015-08-20 21:30:17 +0100219LT_INIT
gdt87efd642004-06-30 17:36:11 +0000220
paul7ea487b2003-03-17 02:05:07 +0000221dnl ----------------------
222dnl Packages configuration
223dnl ----------------------
Joachim Nilsson1080c132012-05-30 08:15:48 +0200224AC_ARG_WITH(pkg-extra-version,
225 AS_HELP_STRING([--with-pkg-extra-version=VER], [add extra version field, for packagers/distributions]),
226 [EXTRAVERSION=$withval],)
David Lamparter0be793e2012-11-27 01:34:56 +0000227AC_ARG_WITH(pkg-git-version,
228 AS_HELP_STRING([--with-pkg-git-version], [add git information to MOTD and build version string]),
David Lampartera16dcf72012-12-13 11:20:50 +0100229 [ test "x$withval" != "xno" && with_pkg_git_version="yes" ])
paul7ea487b2003-03-17 02:05:07 +0000230AC_ARG_ENABLE(vtysh,
Donald Sharpe6756782015-07-16 21:18:34 -0400231 AS_HELP_STRING([--disable-vtysh], [do not build integrated vty shell for Quagga]))
Joakim Tjernlundcbcd9bf2009-02-16 09:40:39 +0100232AC_ARG_ENABLE(doc,
David Lamparterb6fa7602014-06-28 22:15:59 +0200233 AS_HELP_STRING([--disable-doc], [do not build docs]))
paul7ea487b2003-03-17 02:05:07 +0000234AC_ARG_ENABLE(zebra,
David Lamparterb6fa7602014-06-28 22:15:59 +0200235 AS_HELP_STRING([--disable-zebra], [do not build zebra daemon]))
paul7ea487b2003-03-17 02:05:07 +0000236AC_ARG_ENABLE(bgpd,
David Lamparterb6fa7602014-06-28 22:15:59 +0200237 AS_HELP_STRING([--disable-bgpd], [do not build bgpd]))
paul7ea487b2003-03-17 02:05:07 +0000238AC_ARG_ENABLE(ripd,
David Lamparterb6fa7602014-06-28 22:15:59 +0200239 AS_HELP_STRING([--disable-ripd], [do not build ripd]))
paul7ea487b2003-03-17 02:05:07 +0000240AC_ARG_ENABLE(ripngd,
David Lamparterb6fa7602014-06-28 22:15:59 +0200241 AS_HELP_STRING([--disable-ripngd], [do not build ripngd]))
paul7ea487b2003-03-17 02:05:07 +0000242AC_ARG_ENABLE(ospfd,
David Lamparterb6fa7602014-06-28 22:15:59 +0200243 AS_HELP_STRING([--disable-ospfd], [do not build ospfd]))
paul7ea487b2003-03-17 02:05:07 +0000244AC_ARG_ENABLE(ospf6d,
David Lamparterb6fa7602014-06-28 22:15:59 +0200245 AS_HELP_STRING([--disable-ospf6d], [do not build ospf6d]))
ajsd0199432004-12-22 14:03:52 +0000246AC_ARG_ENABLE(watchquagga,
David Lamparterb6fa7602014-06-28 22:15:59 +0200247 AS_HELP_STRING([--disable-watchquagga], [do not build watchquagga]))
jardin9e867fe2003-12-23 08:56:18 +0000248AC_ARG_ENABLE(isisd,
David Lamparter656a2c02015-02-09 11:36:10 +0100249 AS_HELP_STRING([--disable-isisd], [do not build isisd]))
Everton Marques871dbcf2009-08-11 15:43:05 -0300250AC_ARG_ENABLE(pimd,
Donald Sharpe6756782015-07-16 21:18:34 -0400251 AS_HELP_STRING([--disable-pimd], [do not build pimd]))
paul7ea487b2003-03-17 02:05:07 +0000252AC_ARG_ENABLE(bgp-announce,
David Lamparterb6fa7602014-06-28 22:15:59 +0200253 AS_HELP_STRING([--disable-bgp-announce,], [turn off BGP route announcement]))
paul7ea487b2003-03-17 02:05:07 +0000254AC_ARG_ENABLE(snmp,
David Lamparterb6fa7602014-06-28 22:15:59 +0200255 AS_HELP_STRING([--enable-snmp=ARG], [enable SNMP support (smux or agentx)]))
paul7ea487b2003-03-17 02:05:07 +0000256AC_ARG_WITH(libpam,
David Lamparterb6fa7602014-06-28 22:15:59 +0200257 AS_HELP_STRING([--with-libpam], [use libpam for PAM support in vtysh]))
hasso71c0fb52003-05-25 20:18:13 +0000258AC_ARG_ENABLE(tcp-zebra,
David Lamparterb6fa7602014-06-28 22:15:59 +0200259 AS_HELP_STRING([--enable-tcp-zebra], [enable TCP/IP socket connection between zebra and protocol daemon]))
paul1ef74ef2003-03-21 15:16:05 +0000260AC_ARG_ENABLE(ospfapi,
David Lamparterb6fa7602014-06-28 22:15:59 +0200261 AS_HELP_STRING([--disable-ospfapi], [do not build OSPFAPI to access the OSPF LSA Database]))
paul1ef74ef2003-03-21 15:16:05 +0000262AC_ARG_ENABLE(ospfclient,
David Lamparterb6fa7602014-06-28 22:15:59 +0200263 AS_HELP_STRING([--disable-ospfclient], [do not build OSPFAPI client for OSPFAPI,
264 (this is the default if --disable-ospfapi is set)]))
paul7ea487b2003-03-17 02:05:07 +0000265AC_ARG_ENABLE(multipath,
David Lamparterb6fa7602014-06-28 22:15:59 +0200266 AS_HELP_STRING([--enable-multipath=ARG], [enable multipath function, ARG must be digit]))
Paul P Komkoff Jrfe86b482008-08-13 16:56:05 +0100267AC_ARG_ENABLE(user,
David Lamparterb6fa7602014-06-28 22:15:59 +0200268 AS_HELP_STRING([--enable-user=USER], [user to run Quagga suite as (default quagga)]))
Paul P Komkoff Jrfe86b482008-08-13 16:56:05 +0100269AC_ARG_ENABLE(group,
David Lamparterb6fa7602014-06-28 22:15:59 +0200270 AS_HELP_STRING([--enable-group=GROUP], [group to run Quagga suite as (default quagga)]))
pauledd7c242003-06-04 13:59:38 +0000271AC_ARG_ENABLE(vty_group,
David Lamparterb6fa7602014-06-28 22:15:59 +0200272 AS_HELP_STRING([--enable-vty-group=ARG], [set vty sockets to have specified group as owner]))
gdtaa593d52003-12-22 20:15:53 +0000273AC_ARG_ENABLE(configfile_mask,
David Lamparterb6fa7602014-06-28 22:15:59 +0200274 AS_HELP_STRING([--enable-configfile-mask=ARG], [set mask for config files]))
gdtaa593d52003-12-22 20:15:53 +0000275AC_ARG_ENABLE(logfile_mask,
David Lamparterb6fa7602014-06-28 22:15:59 +0200276 AS_HELP_STRING([--enable-logfile-mask=ARG], [set mask for log files]))
pauledd7c242003-06-04 13:59:38 +0000277
hasso71c0fb52003-05-25 20:18:13 +0000278AC_ARG_ENABLE(rtadv,
David Lamparterb6fa7602014-06-28 22:15:59 +0200279 AS_HELP_STRING([--disable-rtadv], [disable IPV6 router advertisement feature]))
hassoca776982004-06-12 14:33:05 +0000280AC_ARG_ENABLE(irdp,
David Lamparterb6fa7602014-06-28 22:15:59 +0200281 AS_HELP_STRING([--enable-irdp], [enable IRDP server support in zebra]))
hassof695b012005-04-02 19:03:39 +0000282AC_ARG_ENABLE(isis_topology,
David Lamparterb6fa7602014-06-28 22:15:59 +0200283 AS_HELP_STRING([--enable-isis-topology], [enable IS-IS topology generator]))
hasso41d3fc92004-04-06 11:59:00 +0000284AC_ARG_ENABLE(capabilities,
David Lamparterb6fa7602014-06-28 22:15:59 +0200285 AS_HELP_STRING([--disable-capabilities], [disable using POSIX capabilities]))
Stephen Hemminger47f6aef2013-01-04 22:29:22 +0000286AC_ARG_ENABLE(rusage,
David Lamparterb6fa7602014-06-28 22:15:59 +0200287 AS_HELP_STRING([--disable-rusage], [disable using getrusage]))
paul6b6942f2004-10-22 04:55:05 +0000288AC_ARG_ENABLE(gcc_ultra_verbose,
David Lamparterb6fa7602014-06-28 22:15:59 +0200289 AS_HELP_STRING([--enable-gcc-ultra-verbose], [enable ultra verbose GCC warnings]))
Paul Jakma3453a712009-06-12 14:21:02 +0100290AC_ARG_ENABLE(linux24_tcp_md5,
David Lamparterb6fa7602014-06-28 22:15:59 +0200291 AS_HELP_STRING([--enable-linux24-tcp-md5], [enable support for old, Linux-2.4 RFC2385 patch]))
ajs3cade262004-12-29 17:50:22 +0000292AC_ARG_ENABLE(gcc-rdynamic,
David Lamparterb6fa7602014-06-28 22:15:59 +0200293 AS_HELP_STRING([--enable-gcc-rdynamic], [enable linking with -rdynamic for better backtraces (default if gcc)]))
David Lamparter8c99b4c2013-08-01 07:43:36 +0000294AC_ARG_ENABLE(backtrace,
David Lamparterb6fa7602014-06-28 22:15:59 +0200295 AS_HELP_STRING([--disable-backtrace,], [disable crash backtraces (default autodetect)]))
ajs924b9222005-04-16 17:11:24 +0000296AC_ARG_ENABLE(time-check,
David Lamparterb6fa7602014-06-28 22:15:59 +0200297 AS_HELP_STRING([--disable-time-check], [disable slow thread warning messages]))
Jeremy Jackson25f45882009-01-12 16:06:12 -0500298AC_ARG_ENABLE(pcreposix,
David Lamparterb6fa7602014-06-28 22:15:59 +0200299 AS_HELP_STRING([--enable-pcreposix], [enable using PCRE Posix libs for regex functions]))
Avneesh Sachdev5adc2522012-11-13 22:48:59 +0000300AC_ARG_ENABLE(fpm,
David Lamparterb6fa7602014-06-28 22:15:59 +0200301 AS_HELP_STRING([--enable-fpm], [enable Forwarding Plane Manager support]))
David Lamparterc0bedeb2015-03-03 10:00:43 +0100302AC_ARG_ENABLE(werror,
303 AS_HELP_STRING([--enable-werror], [enable -Werror (recommended for developers only)]))
paul6b6942f2004-10-22 04:55:05 +0000304
David Lamparter8c99b4c2013-08-01 07:43:36 +0000305if test x"${enable_gcc_rdynamic}" != x"no" ; then
306 if test x"${enable_gcc_rdynamic}" = x"yes" -o x"$COMPILER" = x"GCC"; then
307 LDFLAGS="${LDFLAGS} -rdynamic"
308 fi
ajs3cade262004-12-29 17:50:22 +0000309fi
310
ajs924b9222005-04-16 17:11:24 +0000311if test x"${enable_time_check}" != x"no" ; then
312 if test x"${enable_time_check}" = x"yes" -o x"${enable_time_check}" = x ; then
313 AC_DEFINE(CONSUMED_TIME_CHECK,5000000,Consumed Time Check)
314 else
315 AC_DEFINE_UNQUOTED(CONSUMED_TIME_CHECK,$enable_time_check,Consumed Time Check)
316 fi
317fi
318
Avneesh Sachdev5adc2522012-11-13 22:48:59 +0000319if test "${enable_fpm}" = "yes"; then
320 AC_DEFINE(HAVE_FPM,,Forwarding Plane Manager support)
321fi
322
paul7ea487b2003-03-17 02:05:07 +0000323if test "${enable_tcp_zebra}" = "yes"; then
324 AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)
325fi
326
Paul Jakma3453a712009-06-12 14:21:02 +0100327if test "${enable_linux24_tcp_md5}" = "yes"; then
328 AC_DEFINE(HAVE_TCP_MD5_LINUX24,,Old Linux 2.4 TCP MD5 Signature Patch)
329fi
330
gdtd2a0ccc2003-12-03 18:13:48 +0000331AC_MSG_CHECKING(if zebra should be configurable to send Route Advertisements)
332if test "${enable_rtadv}" != "no"; then
hasso71c0fb52003-05-25 20:18:13 +0000333 AC_MSG_RESULT(yes)
gdtd2a0ccc2003-12-03 18:13:48 +0000334 AC_DEFINE(HAVE_RTADV,,Enable IPv6 Routing Advertisement support)
paul2487bea2003-05-25 23:51:31 +0000335else
336 AC_MSG_RESULT(no)
hasso71c0fb52003-05-25 20:18:13 +0000337fi
paul7ea487b2003-03-17 02:05:07 +0000338
hassoca776982004-06-12 14:33:05 +0000339if test "${enable_irdp}" = "yes"; then
340 AC_DEFINE(HAVE_IRDP,, IRDP )
341fi
342
David Lamparter656a2c02015-02-09 11:36:10 +0100343if test "${enable_isisd}" != "no" && test "${enable_isis_topology}" = yes; then
hassof695b012005-04-02 19:03:39 +0000344 AC_DEFINE(TOPOLOGY_GENERATE,,Enable IS-IS topology generator code)
David Lamparteree1ac2d2012-07-19 12:58:59 +0200345 ISIS_TOPOLOGY_INCLUDES="-I\$(srcdir)/topology"
hassof695b012005-04-02 19:03:39 +0000346 ISIS_TOPOLOGY_DIR="topology"
347 ISIS_TOPOLOGY_LIB="./topology/libtopology.a"
348fi
349
350AC_SUBST(ISIS_TOPOLOGY_INCLUDES)
351AC_SUBST(ISIS_TOPOLOGY_DIR)
352AC_SUBST(ISIS_TOPOLOGY_LIB)
353
paul79cb2162003-06-06 12:19:53 +0000354if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
paule8f29842003-08-12 13:08:31 +0000355 enable_user="quagga"
pauledd7c242003-06-04 13:59:38 +0000356elif test "${enable_user}" = "no"; then
357 enable_user="root"
358fi
pauledd7c242003-06-04 13:59:38 +0000359
paul79cb2162003-06-06 12:19:53 +0000360if test "${enable_group}" = "yes" || test x"${enable_group}" = x""; then
paule8f29842003-08-12 13:08:31 +0000361 enable_group="quagga"
pauledd7c242003-06-04 13:59:38 +0000362elif test "${enable_group}" = "no"; then
363 enable_group="root"
364fi
pauledd7c242003-06-04 13:59:38 +0000365
366if test x"${enable_vty_group}" = x"yes" ; then
paul8d4aee52003-06-06 00:30:35 +0000367 AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes])
paul79cb2162003-06-06 12:19:53 +0000368elif test x"${enable_vty_group}" != x""; then
paul8d4aee52003-06-06 00:30:35 +0000369 if test x"${enable_vty_group}" != x"no"; then
pauledd7c242003-06-04 13:59:38 +0000370 AC_DEFINE_UNQUOTED(VTY_GROUP, "${enable_vty_group}", VTY Sockets Group)
371 fi
372fi
paul26275b02005-04-11 07:10:47 +0000373AC_SUBST([enable_user])
374AC_SUBST([enable_group])
375AC_SUBST([enable_vty_group])
376AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User)
377AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group)
pauledd7c242003-06-04 13:59:38 +0000378
gdtaa593d52003-12-22 20:15:53 +0000379enable_configfile_mask=${enable_configfile_mask:-0600}
380AC_DEFINE_UNQUOTED(CONFIGFILE_MASK, ${enable_configfile_mask}, Mask for config files)
381
382enable_logfile_mask=${enable_logfile_mask:-0600}
383AC_DEFINE_UNQUOTED(LOGFILE_MASK, ${enable_logfile_mask}, Mask for log files)
384
Donald Sharpd1839632015-12-09 08:24:44 -0500385MPATH_NUM=1
paul7ea487b2003-03-17 02:05:07 +0000386
387case "${enable_multipath}" in
Donald Sharpd1839632015-12-09 08:24:44 -0500388 0)
389 MPATH_NUM=64
390 ;;
391 [[1-9]|[1-9][0-9]|[1-9][0-9][0-9]])
392 MPATH_NUM="${enable_multipath}"
paul7ea487b2003-03-17 02:05:07 +0000393 ;;
394 "")
395 ;;
396 *)
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000397 AC_MSG_FAILURE([Please specify digit to enable multipath ARG])
paul7ea487b2003-03-17 02:05:07 +0000398 ;;
399esac
400
Donald Sharpd1839632015-12-09 08:24:44 -0500401AC_DEFINE_UNQUOTED(MULTIPATH_NUM, $MPATH_NUM, Maximum number of paths for a route)
paul7ea487b2003-03-17 02:05:07 +0000402
Joachim Nilsson1080c132012-05-30 08:15:48 +0200403dnl -----------------------------------
404dnl Add extra version string to package
405dnl name, string and version fields.
406dnl -----------------------------------
407if test "x${EXTRAVERSION}" != "x" ; then
David Lamparter0be793e2012-11-27 01:34:56 +0000408 VERSION="${VERSION}${EXTRAVERSION}"
409 PACKAGE_VERSION="${PACKAGE_VERSION}${EXTRAVERSION}"
410 PACKAGE_STRING="${PACKAGE_STRING}${EXTRAVERSION}"
Joachim Nilsson1080c132012-05-30 08:15:48 +0200411fi
412
David Lampartera16dcf72012-12-13 11:20:50 +0100413if test "x$with_pkg_git_version" = "xyes"; then
414 if test -d "${srcdir}/.git"; then
415 AC_DEFINE(GIT_VERSION, [1], [include git version info])
416 else with_pkg_git_version="no"
417 AC_MSG_WARN([--with-pkg-git-version given, but this is not a git checkout])
418 fi
419fi
420AM_CONDITIONAL([GIT_VERSION], [test "x$with_pkg_git_version" = "xyes"])
David Lamparter0be793e2012-11-27 01:34:56 +0000421
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000422dnl ------------------------------------
423dnl Check C keywords and standard types
424dnl ------------------------------------
425AC_C_CONST
426AC_C_INLINE
427AC_C_RESTRICT
428AC_C_VOLATILE
pauldc7a2bf2003-10-22 00:07:44 +0000429AC_HEADER_STDC
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000430AC_HEADER_TIME
431AC_HEADER_SYS_WAIT
Paul Jakmae8441a82015-09-15 16:15:27 +0100432AC_HEADER_STDBOOL
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000433dnl AC_TYPE_PID_T
434AC_TYPE_UID_T
435AC_TYPE_MODE_T
436AC_TYPE_SIZE_T
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000437AC_STRUCT_TM
pauldc7a2bf2003-10-22 00:07:44 +0000438
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000439dnl -------------------------
440dnl Check other header files.
441dnl -------------------------
442AC_CHECK_HEADERS([stropts.h sys/ksym.h sys/times.h sys/select.h \
443 sys/types.h linux/version.h netdb.h asm/types.h \
Timo Teräs16ffb262014-07-29 09:41:54 +0000444 sys/cdefs.h sys/param.h limits.h signal.h \
Paul Jakma6511cab2009-06-18 17:38:01 +0100445 sys/socket.h netinet/in.h time.h sys/time.h])
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000446
447dnl Utility macro to avoid retyping includes all the time
448m4_define([QUAGGA_INCLUDES],
449[#ifdef SUNOS_5
450#define _XPG4_2
451#define __EXTENSIONS__
452#endif
453#include <stdio.h>
454#if STDC_HEADERS
455# include <stdlib.h>
456# include <stddef.h>
457#else
458# if HAVE_STDLIB_H
459# include <stdlib.h>
460# endif
461#endif
462#if HAVE_SYS_TYPES_H
463# include <sys/types.h>
464#endif
465/* sys/conf.h depends on param.h on FBSD at least */
466#if HAVE_SYS_PARAM_H
467# include <sys/param.h>
468#endif
469/* Required for MAXSIG */
470#if HAVE_SIGNAL_H
471# include <signal.h>
472#endif
473#if HAVE_SYS_SOCKET_H
474# include <sys/socket.h>
475#endif
Hasso Tepperea057672013-01-13 17:45:29 +0000476#ifdef __APPLE__
477# define __APPLE_USE_RFC_3542
478#endif
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000479#if HAVE_NETINET_IN_H
480# include <netinet/in.h>
481#endif
Paul Jakma6511cab2009-06-18 17:38:01 +0100482#ifdef TIME_WITH_SYS_TIME
483# include <sys/time.h>
484# include <time.h>
485#else
486# ifdef HAVE_SYS_TIME_H
487# include <sys/time.h>
488# else
489# include <time.h>
490# endif
491#endif /* TIME_WITH_SYS_TIME */
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000492])dnl
493
Denis Ovsienko2b43bf22011-07-14 16:30:08 +0400494dnl HAVE_NET_IF_H must be discovered by the time the longer AC_CHECK_HEADERS
495dnl round below execution begins, otherwise it doesn't properly detect
496dnl HAVE_NETINET6_IN6_VAR_H, HAVE_NET_IF_VAR_H and HAVE_STRUCT_IN6_ALIASREQ
497dnl on FreeBSD (BZ#408).
498
499AC_CHECK_HEADERS([net/if.h], [], [], QUAGGA_INCLUDES)
500
501m4_define([QUAGGA_INCLUDES],
502QUAGGA_INCLUDES
503[#if HAVE_NET_IF_H
504# include <net/if.h>
505#endif
506])dnl
507
508dnl Same applies for HAVE_NET_IF_VAR_H, which HAVE_NETINET6_ND6_H and
509dnl HAVE_NETINET_IN_VAR_H depend upon. But if_var.h depends on if.h, hence
510dnl an additional round for it.
511
512AC_CHECK_HEADERS([net/if_var.h], [], [], QUAGGA_INCLUDES)
513
514m4_define([QUAGGA_INCLUDES],
515QUAGGA_INCLUDES
516[#if HAVE_NET_IF_VAR_H
517# include <net/if_var.h>
518#endif
519])dnl
520
521AC_CHECK_HEADERS([sys/un.h netinet/in_systm.h netinet/in_var.h \
522 net/if_dl.h net/netopt.h net/route.h \
Paul Jakma11770e12007-06-22 16:14:42 +0000523 inet/nd.h arpa/inet.h netinet/ip_icmp.h \
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000524 fcntl.h stddef.h sys/ioctl.h syslog.h wchar.h wctype.h \
525 sys/sysctl.h sys/sockio.h kvm.h sys/conf.h],
526 [], [], QUAGGA_INCLUDES)
527
528AC_CHECK_HEADERS([ucontext.h], [], [],
529[#ifndef __USE_GNU
530#define __USE_GNU
531#endif /* __USE_GNU */
532QUAGGA_INCLUDES
533])
534
Joakim Tjernlundb166ea22009-06-25 16:40:06 +0100535m4_define([UCONTEXT_INCLUDES],
536[#include <ucontext.h>])dnl
537
538AC_CHECK_MEMBERS([ucontext_t.uc_mcontext.uc_regs],
539 [], [], [UCONTEXT_INCLUDES])
540AC_CHECK_MEMBERS([ucontext_t.uc_mcontext.regs],
541 [AC_CHECK_MEMBERS([ucontext_t.uc_mcontext.regs.nip],
542 [], [], [UCONTEXT_INCLUDES])],
543 [], [UCONTEXT_INCLUDES])
544AC_CHECK_MEMBERS([ucontext_t.uc_mcontext.gregs],
545 [], [], [UCONTEXT_INCLUDES])
546
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000547m4_define([QUAGGA_INCLUDES],
548QUAGGA_INCLUDES
Denis Ovsienko2b43bf22011-07-14 16:30:08 +0400549[#if HAVE_SYS_UN_H
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000550# include <sys/un.h>
551#endif
552#if HAVE_NETINET_IN_SYSTM_H
553# include <netinet/in_systm.h>
554#endif
555#if HAVE_NETINET_IN_VAR_H
556# include <netinet/in_var.h>
557#endif
558#if HAVE_NET_IF_DL_H
559# include <net/if_dl.h>
560#endif
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000561#if HAVE_NET_NETOPT_H
562# include <net/netopt.h>
563#endif
564#if HAVE_NET_ROUTE_H
565# include <net/route.h>
566#endif
567#if HAVE_INET_ND_H
568# include <inet/nd.h>
569#endif
570#if HAVE_ARPA_INET_H
571# include <arpa/inet.h>
572#endif
Paul Jakma11770e12007-06-22 16:14:42 +0000573/* Required for IDRP */
574#if HAVE_NETINET_IP_ICMP_H
575# include <netinet/ip_icmp.h>
576#endif
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000577])dnl
pauldc7a2bf2003-10-22 00:07:44 +0000578
gdtfa3232e2003-12-03 17:52:30 +0000579dnl V6 headers are checked below, after we check for v6
paul7ea487b2003-03-17 02:05:07 +0000580
paul7ea487b2003-03-17 02:05:07 +0000581dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
582case "$host" in
paulafd8a122005-03-12 06:36:10 +0000583 [*-sunos5.[6-7]*] | [*-solaris2.[6-7]*])
paul7ea487b2003-03-17 02:05:07 +0000584 opsys=sol2-6
paulafd8a122005-03-12 06:36:10 +0000585 AC_DEFINE(SUNOS_56, 1, SunOS 5.6 to 5.7)
paul19877dd2004-05-11 10:49:35 +0000586 AC_DEFINE(SUNOS_5, 1, SunOS 5)
paul7ea487b2003-03-17 02:05:07 +0000587 AC_CHECK_LIB(xnet, main)
588 CURSES=-lcurses
David Lampartere8d0d242014-06-28 22:07:41 +0200589 SOLARIS="solaris"
paul7ea487b2003-03-17 02:05:07 +0000590 ;;
paul1b73de82005-04-10 16:31:51 +0000591 [*-sunos5.[8-9]] \
592 | [*-sunos5.1[0-9]] \
593 | [*-sunos5.1[0-9].[0-9]] \
594 | [*-solaris2.[8-9]] \
595 | [*-solaris2.1[0-9]] \
596 | [*-solaris2.1[0-9].[0-9]])
paulafd8a122005-03-12 06:36:10 +0000597 opsys=sol8
Paul Jakmafb66b292006-05-28 08:26:15 +0000598 AC_DEFINE(SUNOS_59, 1, [SunOS 5.8 up])
599 AC_DEFINE(SUNOS_5, 1, [SunOS 5])
paul19877dd2004-05-11 10:49:35 +0000600 AC_CHECK_LIB(socket, main)
601 AC_CHECK_LIB(nsl, main)
paul1b73de82005-04-10 16:31:51 +0000602 AC_CHECK_LIB(umem, main)
Paul Jakmafb66b292006-05-28 08:26:15 +0000603 AC_CHECK_FUNCS([printstack],
604 [AC_DEFINE([HAVE_PRINTSTACK],1,[Solaris printstack])
605 AC_DEFINE([HAVE_STACK_TRACE],1,[Stack symbols decode functionality])
606 ])
paul19877dd2004-05-11 10:49:35 +0000607 CURSES=-lcurses
David Lampartere8d0d242014-06-28 22:07:41 +0200608 SOLARIS="solaris"
paul19877dd2004-05-11 10:49:35 +0000609 ;;
paul7ea487b2003-03-17 02:05:07 +0000610 *-sunos5* | *-solaris2*)
paul19877dd2004-05-11 10:49:35 +0000611 AC_DEFINE(SUNOS_5,,SunOS 5, Unknown SunOS)
paul7ea487b2003-03-17 02:05:07 +0000612 AC_CHECK_LIB(socket, main)
613 AC_CHECK_LIB(nsl, main)
614 CURSES=-lcurses
David Lampartere8d0d242014-06-28 22:07:41 +0200615 SOLARIS="solaris"
paul7ea487b2003-03-17 02:05:07 +0000616 ;;
hassoc45eb832005-02-19 13:58:06 +0000617 *-linux*)
paul7ea487b2003-03-17 02:05:07 +0000618 opsys=gnu-linux
619 AC_DEFINE(GNU_LINUX,,GNU Linux)
620 ;;
paul7ea487b2003-03-17 02:05:07 +0000621 *-openbsd*)
622 opsys=openbsd
623 AC_DEFINE(OPEN_BSD,,OpenBSD)
624 ;;
paul7ea487b2003-03-17 02:05:07 +0000625esac
626
Paul Jakma62c9f502009-07-19 17:33:21 +0100627AC_SYS_LARGEFILE
628
paul7ea487b2003-03-17 02:05:07 +0000629dnl ---------------------
630dnl Integrated VTY option
631dnl ---------------------
632case "${enable_vtysh}" in
Donald Sharpe6756782015-07-16 21:18:34 -0400633 "no") VTYSH="";;
634 *) VTYSH="vtysh";
paul7ea487b2003-03-17 02:05:07 +0000635 AC_DEFINE(VTYSH,,VTY shell)
gdtfc9d0742004-06-30 14:25:12 +0000636dnl Vtysh uses libreadline, which looks for termcap functions at
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000637dnl configure time. We follow readlines search order.
gdtfc9d0742004-06-30 14:25:12 +0000638dnl The required procedures are in libtermcap on NetBSD, in
639dnl [TODO] on Linux, and in [TODO] on Solaris.
hassoc0689392005-08-25 12:00:58 +0000640 AC_CHECK_LIB(termcap, tputs, LIBREADLINE="$LIBREADLINE -ltermcap",
paula9694592005-08-25 14:50:05 +0000641 [AC_CHECK_LIB(tinfo, tputs, LIBREADLINE="$LIBREADLINE -ltinfo",
642 [AC_CHECK_LIB(curses, tputs, LIBREADLINE="$LIBREADLINE -lcurses",
643 [AC_CHECK_LIB(ncurses, tputs,
644 LIBREADLINE="$LIBREADLINE -lncurses")]
645 )]
646 )]
647 )
648 AC_CHECK_LIB(readline, main, LIBREADLINE="$LIBREADLINE -lreadline",,
649 "$LIBREADLINE")
paul7ea487b2003-03-17 02:05:07 +0000650 if test $ac_cv_lib_readline_main = no; then
gdtfc9d0742004-06-30 14:25:12 +0000651 AC_MSG_ERROR([vtysh needs libreadline but was not found and usable on your system.])
paul7ea487b2003-03-17 02:05:07 +0000652 fi
653 AC_CHECK_HEADER(readline/history.h)
654 if test $ac_cv_header_readline_history_h = no;then
655 AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
656 fi
paula9694592005-08-25 14:50:05 +0000657 AC_CHECK_LIB(readline, rl_completion_matches,
658 LIBREADLINE="$LIBREADLINE",, "$LIBREADLINE")
paul3d3de8c2003-05-23 10:33:49 +0000659 if test $ac_cv_lib_readline_rl_completion_matches = no; then
660 AC_DEFINE(rl_completion_matches,completion_matches,Old readline)
661 fi
662 ;;
paul7ea487b2003-03-17 02:05:07 +0000663 "no" ) VTYSH="";;
paul7ea487b2003-03-17 02:05:07 +0000664esac
hassoc0689392005-08-25 12:00:58 +0000665AC_SUBST(LIBREADLINE)
David Wardf027d332012-04-30 11:36:15 -0400666AM_CONDITIONAL(VTYSH, test "x$VTYSH" = "xvtysh")
paul7ea487b2003-03-17 02:05:07 +0000667
668dnl ----------
669dnl PAM module
Denis Ovsienko61599282011-07-15 00:24:15 +0400670dnl
671dnl Quagga detects the PAM library it is built against by checking for a
672dnl functional pam_misc.h (Linux-PAM) or openpam.h (OpenPAM) header. pam_misc.h
673dnl is known to #include pam_appl.h, the standard header of a PAM library, and
674dnl openpam.h doesn't do that, although depends on the header too. Hence a
675dnl little assistance to AC_CHECK_HEADER is necessary for the proper detection
676dnl of OpenPAM.
paul7ea487b2003-03-17 02:05:07 +0000677dnl ----------
678if test "$with_libpam" = "yes"; then
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000679 AC_CHECK_HEADER([security/pam_misc.h],
680 [AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
681 AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
682 pam_conv_func="misc_conv"
683 ],
684 [], QUAGGA_INCLUDES)
685 AC_CHECK_HEADER([security/openpam.h],
686 [AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
687 AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
688 pam_conv_func="openpam_ttyconv"
689 ],
Denis Ovsienko61599282011-07-15 00:24:15 +0400690 [], QUAGGA_INCLUDES[#include <security/pam_appl.h>])
paul24cd4352003-05-06 12:16:27 +0000691 if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
692 AC_MSG_WARN([*** pam support will not be built ***])
693 with_libpam="no"
694 fi
695fi
696
697if test "$with_libpam" = "yes"; then
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000698dnl took this test from proftpds configure.in and suited to our needs
paul7ea487b2003-03-17 02:05:07 +0000699dnl -------------------------------------------------------------------------
700dnl
701dnl This next check looks funky due to a linker problem with some versions
702dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
703dnl omitted requiring libdl linking information. PAM-0.72 or better ships
704dnl with RedHat 6.2 and Debian 2.2 or better.
705AC_CHECK_LIB(pam, pam_start,
paul24cd4352003-05-06 12:16:27 +0000706 [AC_CHECK_LIB(pam, $pam_conv_func,
paul7ea487b2003-03-17 02:05:07 +0000707 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
708 LIBPAM="-lpam"],
709 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
710 LIBPAM="-lpam -lpam_misc"]
711 )
712 ],
713
714 [AC_CHECK_LIB(pam, pam_end,
paul24cd4352003-05-06 12:16:27 +0000715 [AC_CHECK_LIB(pam, $pam_conv_func,
paula159ed92003-06-04 11:01:45 +0000716 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000717 LIBPAM="-lpam -ldl"],
paula159ed92003-06-04 11:01:45 +0000718 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
paul7ea487b2003-03-17 02:05:07 +0000719 LIBPAM="-lpam -ldl -lpam_misc"]
720 )
721 ],AC_MSG_WARN([*** pam support will not be built ***]),
722 [-ldl])
723 ]
724)
725fi
726AC_SUBST(LIBPAM)
727
728dnl -------------------------------
729dnl Endian-ness check
730dnl -------------------------------
731AC_WORDS_BIGENDIAN
732
733dnl -------------------------------
734dnl check the size in byte of the C
735dnl -------------------------------
736dnl AC_CHECK_SIZEOF(char)
737dnl AC_CHECK_SIZEOF(int)
738dnl AC_CHECK_SIZEOF(short)
739dnl AC_CHECK_SIZEOF(long)
740
741dnl ----------------------------
742dnl check existance of functions
743dnl ----------------------------
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000744AC_FUNC_CHOWN
745AC_FUNC_FNMATCH
746AC_FUNC_FORK
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000747AC_FUNC_MEMCMP
748AC_FUNC_MKTIME
749AC_FUNC_STRFTIME
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000750AC_FUNC_STAT
751AC_FUNC_SELECT_ARGTYPES
752AC_FUNC_STRFTIME
Paul Jakmad46d2a22007-05-10 16:53:04 +0000753dnl Avoid AC_FUNC_STRNLEN because it pulls in AC_SYSTEM_EXTENSIONS which
754dnl can lead to strange side effects. So we just check for strnlen
755dnl directly, see below.
Paul Jakma2b5cb412007-05-10 17:05:16 +0000756dnl AC_FUNC_STRNLENdnl
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000757AC_FUNC_VPRINTF
758
759dnl -------------------------------
760dnl bgpd needs pow() and hence libm
761dnl -------------------------------
762TMPLIBS="$LIBS"
763AC_CHECK_HEADER([math.h],
764 [AC_CHECK_LIB([m], [pow],
765 [LIBM="-lm"
766 LIBS="$LIBS $LIBM"
767 AC_DEFINE(HAVE_LIBM,, Have libm)
768 AC_CHECK_FUNCS(pow,[],[LIBM=""])
769 ])
770])
771if test x"$LIBM" = x ; then
772 AC_MSG_WARN([Unable to find working pow function - bgpd may not link])
773fi
774LIBS="$TMPLIBS"
775AC_SUBST(LIBM)
776
777dnl ---------------
778dnl other functions
779dnl ---------------
780AC_CHECK_FUNCS([dup2 ftruncate getcwd gethostbyname getpagesize gettimeofday \
Paul Jakmad46d2a22007-05-10 16:53:04 +0000781 inet_ntoa inet_aton strnlen \
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000782 memchr memmove memset select socket \
783 strcasecmp strchr strcspn strdup strerror \
784 strncasecmp strndup strrchr strspn strstr \
785 strtol strtoul strlcat strlcpy \
786 daemon snprintf vsnprintf \
787 if_nametoindex if_indextoname getifaddrs \
David Lamparter12bbd622015-09-15 02:26:44 -0700788 uname fcntl getgrouplist])
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000789
paul7ea487b2003-03-17 02:05:07 +0000790
Feng Lu55cfa2f2014-07-03 18:24:34 +0800791AC_CHECK_HEADER([asm-generic/unistd.h],
792 [AC_CHECK_DECL(__NR_setns,
793 AC_DEFINE(HAVE_NETNS,, Have netns),,
794 QUAGGA_INCLUDES [#include <asm-generic/unistd.h>
795 ])
796 AC_CHECK_FUNCS(setns, AC_DEFINE(HAVE_SETNS,, Have setns))]
797 )
798
paul7ea487b2003-03-17 02:05:07 +0000799dnl ------------------------------------
800dnl Determine routing get and set method
801dnl ------------------------------------
802AC_MSG_CHECKING(zebra between kernel interface method)
803if test x"$opsys" = x"gnu-linux"; then
David Lamparter2e5ca492014-06-28 20:54:31 +0200804 AC_MSG_RESULT(netlink)
805 RT_METHOD=rt_netlink.o
806 AC_DEFINE(HAVE_NETLINK,,netlink)
807 netlink=yes
paul7ea487b2003-03-17 02:05:07 +0000808else
David Lamparter39b233f2014-06-28 21:49:18 +0200809 AC_MSG_RESULT(Route socket)
810 KERNEL_METHOD="kernel_socket.o"
811 RT_METHOD="rt_socket.o"
paul7ea487b2003-03-17 02:05:07 +0000812fi
813AC_SUBST(RT_METHOD)
814AC_SUBST(KERNEL_METHOD)
Avneesh Sachdev5adc2522012-11-13 22:48:59 +0000815AM_CONDITIONAL([HAVE_NETLINK], [test "x$netlink" = "xyes"])
paul7ea487b2003-03-17 02:05:07 +0000816
Paul Jakma238497f2007-08-07 18:49:18 +0000817dnl --------------------------
818dnl Determine IS-IS I/O method
819dnl --------------------------
David Lamparter745bf052010-02-02 21:49:35 +0100820AC_DEFINE(ISIS_METHOD_PFPACKET, 1, [ constant value for isis method pfpacket ])
821AC_DEFINE(ISIS_METHOD_DLPI, 2, [ constant value for isis method dlpi ])
822AC_DEFINE(ISIS_METHOD_BPF, 3, [ constant value for isis method bpf ])
Paul Jakma238497f2007-08-07 18:49:18 +0000823AC_CHECK_HEADER(net/bpf.h)
824AC_CHECK_HEADER(sys/dlpi.h)
825AC_MSG_CHECKING(zebra IS-IS I/O method)
826if test x"$opsys" = x"gnu-linux"; then
827 AC_MSG_RESULT(pfpacket)
David Lamparter745bf052010-02-02 21:49:35 +0100828 ISIS_METHOD_MACRO="ISIS_METHOD_PFPACKET"
Paul Jakma238497f2007-08-07 18:49:18 +0000829elif test x"$opsys" = x"sol2-6" -o x"$opsys" = x"sol8"; then
830 AC_MSG_RESULT(DLPI)
David Lamparter745bf052010-02-02 21:49:35 +0100831 ISIS_METHOD_MACRO="ISIS_METHOD_DLPI"
Paul Jakma238497f2007-08-07 18:49:18 +0000832else
833 if test $ac_cv_header_net_bpf_h = no; then
834 if test $ac_cv_header_sys_dlpi_h = no; then
835 AC_MSG_RESULT(none)
836 AC_MSG_WARN([*** IS-IS support will not be built ***])
837 ISISD=""
838 else
839 AC_MSG_RESULT(DLPI)
840 fi
David Lamparter745bf052010-02-02 21:49:35 +0100841 ISIS_METHOD_MACRO="ISIS_METHOD_DLPI"
Paul Jakma238497f2007-08-07 18:49:18 +0000842 else
843 AC_MSG_RESULT(BPF)
David Lamparter745bf052010-02-02 21:49:35 +0100844 ISIS_METHOD_MACRO="ISIS_METHOD_BPF"
Paul Jakma238497f2007-08-07 18:49:18 +0000845 fi
846fi
David Lamparter745bf052010-02-02 21:49:35 +0100847AC_DEFINE_UNQUOTED(ISIS_METHOD, $ISIS_METHOD_MACRO, [ selected method for isis, == one of the constants ])
Paul Jakma238497f2007-08-07 18:49:18 +0000848
ajsb99760a2005-01-04 16:24:43 +0000849dnl ------------------------------------
850dnl check for broken CMSG_FIRSTHDR macro
851dnl ------------------------------------
gdt6c200462005-01-04 17:02:48 +0000852AC_MSG_CHECKING(for broken CMSG_FIRSTHDR)
hasso5b087522005-04-03 23:46:37 +0000853AC_RUN_IFELSE([AC_LANG_SOURCE([[
ajsb99760a2005-01-04 16:24:43 +0000854#ifdef SUNOS_5
855#define _XPG4_2
856#define __EXTENSIONS__
857#endif
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000858#ifdef HAVE_STDLIB_H
859# include <stdlib.h>
860#endif
861#ifdef HAVE_SYS_TYPES_H
ajsb99760a2005-01-04 16:24:43 +0000862#include <sys/types.h>
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000863#endif
864#ifdef HAVE_SYS_SOCKET_H
ajsb99760a2005-01-04 16:24:43 +0000865#include <sys/socket.h>
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000866#endif
ajsb99760a2005-01-04 16:24:43 +0000867
868main()
869{
870 struct msghdr msg;
871 char buf[4];
872
873 msg.msg_control = buf;
874 msg.msg_controllen = 0;
875
876 if (CMSG_FIRSTHDR(&msg) != NULL)
877 exit(0);
878 exit (1);
hasso5b087522005-04-03 23:46:37 +0000879}]])],[AC_MSG_RESULT(yes - using workaround) AC_DEFINE(HAVE_BROKEN_CMSG_FIRSTHDR,,Broken CMSG_FIRSTHDR)],
hassod33e8d72005-04-03 13:07:21 +0000880[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
ajsb99760a2005-01-04 16:24:43 +0000881
paul7ea487b2003-03-17 02:05:07 +0000882dnl ------------------------------
883dnl check kernel route read method
884dnl ------------------------------
Jeremy Jackson5589ffa2009-01-21 18:27:37 -0500885AC_CACHE_CHECK([route read method], [quagga_cv_rtread_method],
886[if test "x$netlink" = xyes; then
887 quagga_cv_rtread_method="netlink"
paul7ea487b2003-03-17 02:05:07 +0000888else
David Lamparter2e5ca492014-06-28 20:54:31 +0200889for quagga_cv_rtread_method in /dev/ip /dev/null;
paul7ea487b2003-03-17 02:05:07 +0000890do
Jeremy Jackson5589ffa2009-01-21 18:27:37 -0500891 test x`ls $quagga_cv_rtread_method 2>/dev/null` = x"$quagga_cv_rtread_method" && break
paul7ea487b2003-03-17 02:05:07 +0000892done
Jeremy Jackson5589ffa2009-01-21 18:27:37 -0500893case $quagga_cv_rtread_method in
paul9c30ab62003-07-08 08:36:17 +0000894 "/dev/ip")
895 case "$host" in
Jeremy Jackson5589ffa2009-01-21 18:27:37 -0500896 *-freebsd*) quagga_cv_rtread_method="sysctl";;
897 *) quagga_cv_rtread_method="getmsg";;
paul9c30ab62003-07-08 08:36:17 +0000898 esac;;
Jeremy Jackson5589ffa2009-01-21 18:27:37 -0500899 *)
900 quagga_cv_rtread_method="sysctl";;
paul7ea487b2003-03-17 02:05:07 +0000901esac
902fi])
Jeremy Jackson5589ffa2009-01-21 18:27:37 -0500903RTREAD_METHOD=rtread_${quagga_cv_rtread_method}.o
paul7ea487b2003-03-17 02:05:07 +0000904AC_SUBST(RTREAD_METHOD)
905
906dnl -----------------------------
907dnl check interface lookup method
908dnl -----------------------------
paul19877dd2004-05-11 10:49:35 +0000909IOCTL_METHOD=ioctl.o
paul7ea487b2003-03-17 02:05:07 +0000910AC_MSG_CHECKING(interface looking up method)
911if test "$netlink" = yes; then
912 AC_MSG_RESULT(netlink)
913 IF_METHOD=if_netlink.o
paul19877dd2004-05-11 10:49:35 +0000914elif test "$opsys" = "sol2-6";then
915 AC_MSG_RESULT(Solaris GIF)
916 IF_METHOD=if_ioctl.o
paulafd8a122005-03-12 06:36:10 +0000917elif test "$opsys" = "sol8";then
paul19877dd2004-05-11 10:49:35 +0000918 AC_MSG_RESULT(Solaris GLIF)
919 IF_METHOD=if_ioctl_solaris.o
920 IOCTL_METHOD=ioctl_solaris.o
paul19877dd2004-05-11 10:49:35 +0000921elif test "$opsys" = "openbsd";then
922 AC_MSG_RESULT(openbsd)
923 IF_METHOD=if_ioctl.o
924elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
925 AC_MSG_RESULT(sysctl)
paul7ea487b2003-03-17 02:05:07 +0000926 IF_METHOD=if_sysctl.o
927 AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
paul19877dd2004-05-11 10:49:35 +0000928else
paul7ea487b2003-03-17 02:05:07 +0000929 AC_MSG_RESULT(ioctl)
930 IF_METHOD=if_ioctl.o
paul7ea487b2003-03-17 02:05:07 +0000931fi
932AC_SUBST(IF_METHOD)
paul19877dd2004-05-11 10:49:35 +0000933AC_SUBST(IOCTL_METHOD)
paul7ea487b2003-03-17 02:05:07 +0000934
paul42c98192005-05-07 02:22:51 +0000935dnl ---------------------------------------------------------------
936dnl figure out how to specify an interface in multicast sockets API
937dnl ---------------------------------------------------------------
Paul Jakma6f0e3f62007-05-10 02:38:51 +0000938AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [], [], QUAGGA_INCLUDES)
paul42c98192005-05-07 02:22:51 +0000939
Donald Sharp1934e782015-06-05 12:15:44 -0700940AC_CHECK_HEADERS([linux/mroute.h], [], [],
941[
942#if HAVE_NETINET_IN_H
943#include<netinet/in.h>
944#endif])
paul42c98192005-05-07 02:22:51 +0000945AC_MSG_CHECKING([for BSD struct ip_mreq hack])
946AC_TRY_COMPILE([#ifdef HAVE_SYS_PARAM_H
947#include <sys/param.h>
Brian Bennettb8a893c2015-02-17 22:32:22 +0000948#endif],[#if (defined(__FreeBSD__) && ((__FreeBSD_version >= 500022 && __FreeBSD_version < 700000) || (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) || (defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 106010000) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__DragonFly__) || defined(__sun)
paul42c98192005-05-07 02:22:51 +0000949 return (0);
950#else
951 #error No support for BSD struct ip_mreq hack detected
952#endif],[AC_MSG_RESULT(yes)
953AC_DEFINE(HAVE_BSD_STRUCT_IP_MREQ_HACK,,[Can pass ifindex in struct ip_mreq])],
954AC_MSG_RESULT(no))
955
Dmitrij Tejblum10d04cd2011-08-22 11:39:35 +0400956AC_MSG_CHECKING([for RFC3678 protocol-independed API])
957AC_TRY_COMPILE([
958#include <sys/types.h>
959#include <netinet/in.h>
960], [struct group_req gr; int sock; setsockopt(sock, IPPROTO_IP, MCAST_JOIN_GROUP, (void*)&gr, sizeof(gr));
961], [AC_MSG_RESULT(yes)
962AC_DEFINE(HAVE_RFC3678,1,[Have RFC3678 protocol-independed API])],
963AC_MSG_RESULT(no))
964
Andrew J. Schorrc543a172008-01-10 15:24:32 +0000965dnl ---------------------------------------------------------------
966dnl figure out how to check link-state
967dnl ---------------------------------------------------------------
Andrew J. Schorr6418bed2008-01-11 16:33:59 +0000968AC_CHECK_HEADER([net/if.h],
969 [AC_CHECK_HEADER( [net/if_media.h],
970 [m4_define([LINK_DETECT_INCLUDES],
971 QUAGGA_INCLUDES
972 [#include <net/if_media.h>
973 ])
974 AC_CHECK_MEMBERS( [struct ifmediareq.ifm_status],
975 AC_DEFINE(HAVE_BSD_LINK_DETECT,,[BSD link-detect]),
976 [], LINK_DETECT_INCLUDES)],
977 [],
978 QUAGGA_INCLUDES)],
979 [], QUAGGA_INCLUDES )
Andrew J. Schorrc543a172008-01-10 15:24:32 +0000980
Doug VanLeuven9234b382012-10-10 16:12:32 -0700981dnl ---------------------------------------------------------------
982dnl Additional, newer way to check link-state using ifi_link_state.
983dnl Not available in all BSD's when ifmediareq available
984dnl ---------------------------------------------------------------
985AC_CHECK_HEADER([net/if.h],
986 AC_CHECK_MEMBERS([struct if_data.ifi_link_state],
987 AC_DEFINE(HAVE_BSD_IFI_LINK_STATE,,[BSD ifi_link_state available]),
988 [], QUAGGA_INCLUDES),
989 ,)
990
Paul Jakma0df7c912008-07-21 21:02:49 +0000991dnl ------------------------
992dnl TCP_MD5SIG socket option
993dnl ------------------------
994
995AC_CHECK_HEADER([netinet/tcp.h],
996 [m4_define([MD5_INCLUDES],
997 QUAGGA_INCLUDES
998 [#include <netinet/tcp.h>
999 ])
1000 AC_CHECK_DECLS([TCP_MD5SIG], [], [], MD5_INCLUDES)],
1001 [],
1002 QUAGGA_INCLUDES)
1003if test $ac_cv_have_decl_TCP_MD5SIG = no; then
1004 AC_CHECK_HEADER([linux/tcp.h],
1005 [m4_define([MD5_INCLUDES],
1006 QUAGGA_INCLUDES
1007 [#include <linux/tcp.h>
1008 ])
1009 AC_CHECK_DECLS([TCP_MD5SIG], [], [], MD5_INCLUDES)])
1010fi
1011
paul7ea487b2003-03-17 02:05:07 +00001012dnl -----------------------------
1013dnl check ipforward detect method
1014dnl -----------------------------
Jeremy Jackson5589ffa2009-01-21 18:27:37 -05001015AC_CACHE_CHECK([ipforward method], [quagga_cv_ipforward_method],
David Lamparterca9f3422009-09-16 02:11:00 +02001016[if test x$cross_compiling = xyes; then
1017 if test x"$opsys" = x"gnu-linux"; then
1018 quagga_cv_ipforward_method=/proc/net/snmp
1019 else
1020 quagga_cv_ipforward_method=/dev/ip
1021 fi
1022else
1023 for quagga_cv_ipforward_method in /proc/net/snmp /dev/ip /dev/null;
1024 do
1025 test x`ls $quagga_cv_ipforward_method 2>/dev/null` = x"$quagga_cv_ipforward_method" && break
1026 done
1027fi
Jeremy Jackson5589ffa2009-01-21 18:27:37 -05001028case $quagga_cv_ipforward_method in
1029 "/proc/net/snmp") quagga_cv_ipforward_method="proc";;
paul7ea487b2003-03-17 02:05:07 +00001030 "/dev/ip")
1031 case "$host" in
Jeremy Jackson5589ffa2009-01-21 18:27:37 -05001032 *-freebsd*) quagga_cv_ipforward_method="sysctl";;
1033 *) quagga_cv_ipforward_method="solaris";;
paul7ea487b2003-03-17 02:05:07 +00001034 esac;;
Jeremy Jackson5589ffa2009-01-21 18:27:37 -05001035 *) quagga_cv_ipforward_method="sysctl";;
paul7ea487b2003-03-17 02:05:07 +00001036esac])
Jeremy Jackson5589ffa2009-01-21 18:27:37 -05001037IPFORWARD=ipforward_${quagga_cv_ipforward_method}.o
paul7ea487b2003-03-17 02:05:07 +00001038AC_SUBST(IPFORWARD)
1039
1040AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
1041
1042dnl ----------
1043dnl IPv6 check
1044dnl ----------
1045AC_MSG_CHECKING(whether does this OS have IPv6 stack)
paul7ea487b2003-03-17 02:05:07 +00001046dnl ---------
1047dnl KAME IPv6
1048dnl ---------
David Lamparter6d6df302014-06-28 21:12:37 +02001049 if grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
paula159ed92003-06-04 11:01:45 +00001050 AC_DEFINE(KAME,1,KAME IPv6)
paula159ed92003-06-04 11:01:45 +00001051 AC_MSG_RESULT(KAME)
paul19877dd2004-05-11 10:49:35 +00001052dnl ------------------------------------
1053dnl Solaris 9, 10 and potentially higher
1054dnl ------------------------------------
paulafd8a122005-03-12 06:36:10 +00001055 elif test x"$opsys" = x"sol8"; then
paul19877dd2004-05-11 10:49:35 +00001056 AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6)
paul19877dd2004-05-11 10:49:35 +00001057 AC_MSG_RESULT(Solaris IPv6)
paul7ea487b2003-03-17 02:05:07 +00001058dnl ----------
1059dnl Linux IPv6
1060dnl ----------
David Lamparter29ed6222014-06-28 21:42:25 +02001061 elif test x"$opsys" = x"gnu-linux"; then
Timo Teräs3ef0b872014-07-29 09:41:56 +00001062 AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
David Lamparter29ed6222014-06-28 21:42:25 +02001063 AC_MSG_RESULT(Linux IPv6)
1064 else
David Lamparter7fe17e62014-11-22 10:31:33 -08001065 AC_MSG_ERROR([Failed to detect IPv6 stack])
paula159ed92003-06-04 11:01:45 +00001066 fi
paul7ea487b2003-03-17 02:05:07 +00001067
David Lamparter7fe17e62014-11-22 10:31:33 -08001068dnl this is unconditial, for compatibility
1069AC_DEFINE(HAVE_IPV6,1,IPv6)
paul7ea487b2003-03-17 02:05:07 +00001070
gdtfa3232e2003-12-03 17:52:30 +00001071dnl ------------------
1072dnl IPv6 header checks
1073dnl ------------------
gdtfa3232e2003-12-03 17:52:30 +00001074AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \
David Lamparter05a69d22015-05-27 22:15:37 +02001075 netinet6/in6_var.h netinet6/nd6.h], [], [],
Paul Jakma6f0e3f62007-05-10 02:38:51 +00001076 QUAGGA_INCLUDES)
gdtfa3232e2003-12-03 17:52:30 +00001077
Paul Jakma6f0e3f62007-05-10 02:38:51 +00001078m4_define([QUAGGA_INCLUDES],dnl
1079QUAGGA_INCLUDES
1080[#if HAVE_NETINET6_IN6_H
1081#include <netinet6/in6.h>
1082#endif
1083#if HAVE_NETINET_IN6_VAR_H
1084#include <netinet/in6_var.h>
1085#endif
1086#if HAVE_NETINET_ICMP6_H
1087# include <netinet/icmp6.h>
1088#endif
1089#if HAVE_NETINET6_IN6_VAR_H
1090# include <netinet6/in6_var.h>
1091#endif
1092#if HAVE_NETINET6_ND6_H
Hasso Tepperfbf24542007-06-25 19:30:59 +00001093# include <netinet6/nd6.h>
Paul Jakma6f0e3f62007-05-10 02:38:51 +00001094#endif
1095])dnl
1096
Joakim Tjernlundcbcd9bf2009-02-16 09:40:39 +01001097dnl disable doc check
1098if test "${enable_doc}" = "no";then
1099 DOC=""
1100else
1101 DOC="doc"
1102fi
1103
paul7ea487b2003-03-17 02:05:07 +00001104dnl --------------------
1105dnl Daemon disable check
1106dnl --------------------
1107if test "${enable_zebra}" = "no";then
1108 ZEBRA=""
1109else
1110 ZEBRA="zebra"
1111fi
David Wardf027d332012-04-30 11:36:15 -04001112AM_CONDITIONAL(ZEBRA, test "x$ZEBRA" = "xzebra")
paul7ea487b2003-03-17 02:05:07 +00001113
1114if test "${enable_bgpd}" = "no";then
1115 BGPD=""
1116else
1117 BGPD="bgpd"
1118fi
David Wardf027d332012-04-30 11:36:15 -04001119AM_CONDITIONAL(BGPD, test "x$BGPD" = "xbgpd")
paul7ea487b2003-03-17 02:05:07 +00001120
1121if test "${enable_ripd}" = "no";then
1122 RIPD=""
1123else
1124 RIPD="ripd"
1125fi
David Wardf027d332012-04-30 11:36:15 -04001126AM_CONDITIONAL(RIPD, test "x$RIPD" = "xripd")
paul7ea487b2003-03-17 02:05:07 +00001127
1128if test "${enable_ospfd}" = "no";then
1129 OSPFD=""
1130else
1131 OSPFD="ospfd"
1132fi
David Wardf027d332012-04-30 11:36:15 -04001133AM_CONDITIONAL(OSPFD, test "x$OSPFD" = "xospfd")
paul7ea487b2003-03-17 02:05:07 +00001134
ajsd0199432004-12-22 14:03:52 +00001135if test "${enable_watchquagga}" = "no";then
1136 WATCHQUAGGA=""
1137else
1138 WATCHQUAGGA="watchquagga"
1139fi
David Wardf027d332012-04-30 11:36:15 -04001140AM_CONDITIONAL(WATCHQUAGGA, test "x$WATCHQUAGGA" = "xwatchquagga")
ajsd0199432004-12-22 14:03:52 +00001141
paul1ef74ef2003-03-21 15:16:05 +00001142OSPFCLIENT=""
Donald Sharp36fef572015-12-16 14:22:10 -05001143if test "${enable_ospfapi}" != "no";then
paul9a569842003-03-28 01:45:13 +00001144 AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI)
paul1ef74ef2003-03-21 15:16:05 +00001145
Donald Sharp36fef572015-12-16 14:22:10 -05001146 if test "${enable_ospfclient}" != "no";then
paul1ef74ef2003-03-21 15:16:05 +00001147 OSPFCLIENT="ospfclient"
paul1ef74ef2003-03-21 15:16:05 +00001148 fi
paul7ea487b2003-03-17 02:05:07 +00001149fi
Donald Sharp36fef572015-12-16 14:22:10 -05001150
David Wardf027d332012-04-30 11:36:15 -04001151AM_CONDITIONAL(OSPFCLIENT, test "x$OSPFCLIENT" = "xospfclient")
paul7ea487b2003-03-17 02:05:07 +00001152
1153case "${enable_ripngd}" in
paul7ea487b2003-03-17 02:05:07 +00001154 "no" ) RIPNGD="";;
David Lamparter7fe17e62014-11-22 10:31:33 -08001155 * ) RIPNGD="ripngd";;
paul7ea487b2003-03-17 02:05:07 +00001156esac
David Wardf027d332012-04-30 11:36:15 -04001157AM_CONDITIONAL(RIPNGD, test "x$RIPNGD" = "xripngd")
paul7ea487b2003-03-17 02:05:07 +00001158
1159case "${enable_ospf6d}" in
paul7ea487b2003-03-17 02:05:07 +00001160 "no" ) OSPF6D="";;
David Lamparter7fe17e62014-11-22 10:31:33 -08001161 * ) OSPF6D="ospf6d";;
paul7ea487b2003-03-17 02:05:07 +00001162esac
David Wardf027d332012-04-30 11:36:15 -04001163AM_CONDITIONAL(OSPF6D, test "x$OSPF6D" = "xospf6d")
paul7ea487b2003-03-17 02:05:07 +00001164
jardin9e867fe2003-12-23 08:56:18 +00001165case "${enable_isisd}" in
jardin9e867fe2003-12-23 08:56:18 +00001166 "no" ) ISISD="";;
David Lamparter656a2c02015-02-09 11:36:10 +01001167 * ) ISISD="isisd";;
jardin9e867fe2003-12-23 08:56:18 +00001168esac
David Wardf027d332012-04-30 11:36:15 -04001169AM_CONDITIONAL(ISISD, test "x$ISISD" = "xisisd")
jardin9e867fe2003-12-23 08:56:18 +00001170
Everton Marques871dbcf2009-08-11 15:43:05 -03001171case "${enable_pimd}" in
Everton Marques871dbcf2009-08-11 15:43:05 -03001172 "no" ) PIMD="";;
Donald Sharpe6756782015-07-16 21:18:34 -04001173 * ) PIMD="pimd";;
Everton Marques871dbcf2009-08-11 15:43:05 -03001174esac
Everton Marquesff57d362014-06-25 15:54:03 -03001175AM_CONDITIONAL(PIMD, test "x$PIMD" = "xpimd")
Everton Marques871dbcf2009-08-11 15:43:05 -03001176
paul7ea487b2003-03-17 02:05:07 +00001177if test "${enable_bgp_announce}" = "no";then
Paul Jakma750e8142008-07-22 21:11:48 +00001178 AC_DEFINE(DISABLE_BGP_ANNOUNCE,1,Disable BGP installation to zebra)
1179else
1180 AC_DEFINE(DISABLE_BGP_ANNOUNCE,0,Disable BGP installation to zebra)
paul7ea487b2003-03-17 02:05:07 +00001181fi
1182
Joakim Tjernlundcbcd9bf2009-02-16 09:40:39 +01001183AC_SUBST(DOC)
paul7ea487b2003-03-17 02:05:07 +00001184AC_SUBST(ZEBRA)
1185AC_SUBST(BGPD)
1186AC_SUBST(RIPD)
1187AC_SUBST(RIPNGD)
1188AC_SUBST(OSPFD)
1189AC_SUBST(OSPF6D)
ajsd0199432004-12-22 14:03:52 +00001190AC_SUBST(WATCHQUAGGA)
jardin9e867fe2003-12-23 08:56:18 +00001191AC_SUBST(ISISD)
Everton Marques871dbcf2009-08-11 15:43:05 -03001192AC_SUBST(PIMD)
Greg Troxel97cee872007-08-02 13:36:56 +00001193AC_SUBST(SOLARIS)
paul7ea487b2003-03-17 02:05:07 +00001194AC_SUBST(VTYSH)
paul7ea487b2003-03-17 02:05:07 +00001195AC_SUBST(CURSES)
1196AC_SUBST(OSPFCLIENT)
paul1ef74ef2003-03-21 15:16:05 +00001197AC_SUBST(OSPFAPI)
paul7ea487b2003-03-17 02:05:07 +00001198AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
1199AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
1200AC_CHECK_LIB(crypt, crypt)
1201AC_CHECK_LIB(resolv, res_init)
paul7ea487b2003-03-17 02:05:07 +00001202
paul7ea487b2003-03-17 02:05:07 +00001203dnl ---------------------------
Jeremy Jackson25f45882009-01-12 16:06:12 -05001204dnl check system has PCRE regexp
1205dnl ---------------------------
1206if test "x$enable_pcreposix" = "xyes"; then
1207 AC_CHECK_LIB(pcreposix, pcreposix_regexec, ,[enable_pcreposix=no
1208 AC_MSG_WARN([*** falling back to other regex library ***]) ])
1209fi
1210
1211if test "x$enable_pcreposix" != "xyes"; then
1212dnl ---------------------------
paul7ea487b2003-03-17 02:05:07 +00001213dnl check system has GNU regexp
1214dnl ---------------------------
Jeremy Jackson25f45882009-01-12 16:06:12 -05001215AC_MSG_CHECKING(whether system has GNU regex)
paul7ea487b2003-03-17 02:05:07 +00001216AC_CHECK_LIB(c, regexec,
1217[AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
1218 LIB_REGEX=""],
1219[LIB_REGEX="regex.o"])
Jeremy Jackson25f45882009-01-12 16:06:12 -05001220fi
1221AC_SUBST(HAVE_LIBPCREPOSIX)
paul7ea487b2003-03-17 02:05:07 +00001222AC_SUBST(LIB_REGEX)
1223
1224dnl ------------------
paulb1fc9ac2006-01-31 10:09:27 +00001225dnl check Net-SNMP library
paul7ea487b2003-03-17 02:05:07 +00001226dnl ------------------
Vincent Bernatd6be5fb2012-05-24 09:44:43 +02001227if test "${enable_snmp}" != ""; then
Vincent Bernat08d7f652012-05-22 22:29:17 +02001228 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], [no])
1229 if test x"$NETSNMP_CONFIG" = x"no"; then
1230 AC_MSG_ERROR([--enable-snmp given but unable to find net-snmp-config])
1231 fi
1232 LIBS="$LIBS `${NETSNMP_CONFIG} --agent-libs`"
1233 CFLAGS="`${NETSNMP_CONFIG} --base-cflags` $CFLAGS"
1234 AC_MSG_CHECKING([whether we can link to Net-SNMP])
1235 AC_LINK_IFELSE([AC_LANG_PROGRAM([
1236int main(void);
1237],
1238[
1239{
1240 return 0;
1241}
1242])],[AC_MSG_RESULT(yes)],[
1243 AC_MSG_RESULT(no)
1244 AC_MSG_ERROR([--enable-snmp given but not usable])])
1245 AC_DEFINE(HAVE_SNMP,,SNMP)
Vincent Bernatd6be5fb2012-05-24 09:44:43 +02001246 case "${enable_snmp}" in
1247 yes)
1248 SNMP_METHOD=agentx
1249 ;;
1250 smux|agentx)
1251 SNMP_METHOD="${enable_snmp}"
1252 ;;
1253 *)
1254 AC_MSG_ERROR([--enable-snmp given with an unknown method (${enable_snmp}). Use smux or agentx])
1255 ;;
1256 esac
1257 AH_TEMPLATE([SNMP_SMUX], [Use SNMP SMUX to interface with snmpd])
1258 AH_TEMPLATE([SNMP_AGENTX], [Use SNMP AgentX to interface with snmpd])
1259 AC_DEFINE_UNQUOTED(AS_TR_CPP(SNMP_${SNMP_METHOD}),,SNMP method to interface with snmpd)
paul7ea487b2003-03-17 02:05:07 +00001260fi
1261
Paul Jakma6f0e3f62007-05-10 02:38:51 +00001262dnl ---------------------------
1263dnl sockaddr and netinet checks
1264dnl ---------------------------
1265AC_CHECK_TYPES([struct sockaddr, struct sockaddr_in,
1266 struct sockaddr_in6, struct sockaddr_un, struct sockaddr_dl,
Everton Marques871dbcf2009-08-11 15:43:05 -03001267 socklen_t, struct vifctl, struct mfcctl, struct sioc_sg_req,
1268 vifi_t, struct sioc_vif_req, struct igmpmsg,
Paul Jakma6f0e3f62007-05-10 02:38:51 +00001269 struct ifaliasreq, struct if6_aliasreq, struct in6_aliasreq,
1270 struct nd_opt_adv_interval, struct rt_addrinfo,
Paul Jakma11770e12007-06-22 16:14:42 +00001271 struct nd_opt_homeagent_info, struct nd_opt_adv_interval],
Paul Jakma6f0e3f62007-05-10 02:38:51 +00001272 [], [], QUAGGA_INCLUDES)
paul7ea487b2003-03-17 02:05:07 +00001273
Paul Jakma6f0e3f62007-05-10 02:38:51 +00001274AC_CHECK_MEMBERS([struct sockaddr.sa_len,
1275 struct sockaddr_in.sin_len, struct sockaddr_un.sun_len,
1276 struct sockaddr_in6.sin6_scope_id,
David Lamparterca3ccd82012-09-26 14:52:39 +02001277 struct sockaddr_dl.sdl_len,
Paul Jakma6f0e3f62007-05-10 02:38:51 +00001278 struct if6_aliasreq.ifra_lifetime,
1279 struct nd_opt_adv_interval.nd_opt_ai_type],
1280 [], [], QUAGGA_INCLUDES)
hasso71c0fb52003-05-25 20:18:13 +00001281
paul7ea487b2003-03-17 02:05:07 +00001282dnl ---------------------------
Paul Jakma11770e12007-06-22 16:14:42 +00001283dnl IRDP/pktinfo/icmphdr checks
paul7ea487b2003-03-17 02:05:07 +00001284dnl ---------------------------
Paul Jakma6f0e3f62007-05-10 02:38:51 +00001285AC_CHECK_TYPES([struct in_pktinfo],
Paul Jakma11770e12007-06-22 16:14:42 +00001286 [AC_CHECK_TYPES([struct icmphdr],
1287 [if test "${enable_irdp}" != "no"; then
1288 AC_DEFINE(HAVE_IRDP,, IRDP)
1289 fi],
1290 [if test "${enable_irdp}" = "yes"; then
1291 AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
1292 fi], [QUAGGA_INCLUDES])],
Paul Jakma6f0e3f62007-05-10 02:38:51 +00001293 [if test "${enable_irdp}" = "yes"; then
1294 AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
1295 fi], [QUAGGA_INCLUDES])
vincent29c4c9b2005-03-25 13:05:47 +00001296
Everton Marques871dbcf2009-08-11 15:43:05 -03001297dnl -----------------------
1298dnl checking for IP_PKTINFO
1299dnl -----------------------
1300AC_MSG_CHECKING(for IP_PKTINFO)
1301AC_TRY_COMPILE([#include <netdb.h>], [
1302 int opt = IP_PKTINFO;
1303], [
1304 AC_MSG_RESULT(yes)
1305 AC_DEFINE(HAVE_IP_PKTINFO, 1, [Have IP_PKTINFO])
1306], [
1307 AC_MSG_RESULT(no)
1308])
1309
1310dnl ---------------------------
1311dnl checking for IP_RECVDSTADDR
1312dnl ---------------------------
1313AC_MSG_CHECKING(for IP_RECVDSTADDR)
1314AC_TRY_COMPILE([#include <netinet/in.h>], [
1315 int opt = IP_RECVDSTADDR;
1316], [
1317 AC_MSG_RESULT(yes)
1318 AC_DEFINE(HAVE_IP_RECVDSTADDR, 1, [Have IP_RECVDSTADDR])
1319], [
1320 AC_MSG_RESULT(no)
1321])
1322
1323dnl ----------------------
1324dnl checking for IP_RECVIF
1325dnl ----------------------
1326AC_MSG_CHECKING(for IP_RECVIF)
1327AC_TRY_COMPILE([#include <netinet/in.h>], [
1328 int opt = IP_RECVIF;
1329], [
1330 AC_MSG_RESULT(yes)
1331 AC_DEFINE(HAVE_IP_RECVIF, 1, [Have IP_RECVIF])
1332], [
1333 AC_MSG_RESULT(no)
1334])
1335
paul7ea487b2003-03-17 02:05:07 +00001336dnl --------------------------------------
1337dnl checking for getrusage struct and call
1338dnl --------------------------------------
Stephen Hemminger47f6aef2013-01-04 22:29:22 +00001339if test "${enable_rusage}" != "no"; then
1340 AC_MSG_CHECKING(whether getrusage is available)
1341 AC_TRY_COMPILE([#include <sys/resource.h>],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
1342 [AC_MSG_RESULT(yes)
1343 AC_DEFINE(HAVE_RUSAGE,,rusage)],
1344 AC_MSG_RESULT(no))
1345fi
paul7ea487b2003-03-17 02:05:07 +00001346
Stephen Hemmingerc4376c92009-05-28 15:29:10 -07001347dnl --------------------------------------
1348dnl checking for clock_time monotonic struct and call
1349dnl --------------------------------------
Paul Jakma6511cab2009-06-18 17:38:01 +01001350AC_CHECK_DECL(CLOCK_MONOTONIC,
1351 [AC_CHECK_LIB(rt, clock_gettime, [LIBS="$LIBS -lrt"])
Dmitry Tejblum9964fcf2009-11-05 16:50:36 +03001352 AC_DEFINE(HAVE_CLOCK_MONOTONIC,, Have monotonic clock)
Paul Jakma6511cab2009-06-18 17:38:01 +01001353], [AC_MSG_RESULT(no)], [QUAGGA_INCLUDES])
Stephen Hemmingerc4376c92009-05-28 15:29:10 -07001354
pauledd7c242003-06-04 13:59:38 +00001355dnl -------------------
1356dnl capabilities checks
1357dnl -------------------
hasso41d3fc92004-04-06 11:59:00 +00001358if test "${enable_capabilities}" != "no"; then
1359 AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available)
1360 AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
1361 [AC_MSG_RESULT(yes)
1362 AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl)
1363 quagga_ac_keepcaps="yes"],
1364 AC_MSG_RESULT(no)
pauledd7c242003-06-04 13:59:38 +00001365 )
hasso41d3fc92004-04-06 11:59:00 +00001366 if test x"${quagga_ac_keepcaps}" = x"yes"; then
1367 AC_CHECK_HEADERS(sys/capability.h)
1368 fi
1369 if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then
1370 AC_CHECK_LIB(cap, cap_init,
1371 [AC_DEFINE(HAVE_LCAPS,1,Capabilities)
1372 LIBCAP="-lcap"
paulceacedb2005-09-29 14:39:32 +00001373 quagga_ac_lcaps="yes"]
hasso41d3fc92004-04-06 11:59:00 +00001374 )
paulceacedb2005-09-29 14:39:32 +00001375 else
1376 AC_CHECK_HEADERS(priv.h,
1377 [AC_MSG_CHECKING(Solaris style privileges are available)
1378 AC_TRY_COMPILE([#include <priv.h>],[getpflags(PRIV_AWARE);],
1379 [AC_MSG_RESULT(yes)
1380 AC_DEFINE(HAVE_SOLARIS_CAPABILITIES,1,getpflags)
1381 quagga_ac_scaps="yes"],
1382 AC_MSG_RESULT(no)
1383 )
1384 ]
1385 )
1386 fi
1387 if test x"${quagga_ac_scaps}" = x"yes" \
1388 -o x"${quagga_ac_lcaps}" = x"yes"; then
1389 AC_DEFINE(HAVE_CAPABILITIES,1,capabilities)
hasso41d3fc92004-04-06 11:59:00 +00001390 fi
pauledd7c242003-06-04 13:59:38 +00001391fi
1392AC_SUBST(LIBCAP)
1393
Doug VanLeuven327c4cd2012-12-14 14:58:30 +02001394dnl ---------------------------------------------------------------------------
1395dnl http://www.gnu.org/software/autoconf-archive/ax_sys_weak_alias.html
1396dnl Check for and set one of the following = 1
1397dnl HAVE_SYS_WEAK_ALIAS_ATTRIBUTE
1398dnl HAVE_SYS_WEAK_ALIAS_PRAGMA
1399dnl HAVE_SYS_WEAK_ALIAS_HPSECONDARY
1400dnl HAVE_SYS_WEAK_ALIAS_CRIDUPLICATE
1401dnl If any scheme is found, set
1402dnl HAVE_SYS_WEAK_ALIAS=1
1403dnl The following variable is set to text value
1404dnl WEAK_ALIAS = "attribute" || "pragma" || "hpsecondary" || "criduplicate" || "no"
1405dnl If weak alias can cross object file boundaries
1406dnl WEAK_ALIAS_CROSSFILE = "yes" || "no"
1407dnl ---------------------------------------------------------------------------
1408AX_SYS_WEAK_ALIAS
1409
paulfb2d1502003-06-04 09:40:54 +00001410dnl ---------------------------
1411dnl check for glibc 'backtrace'
1412dnl ---------------------------
David Lamparter8c99b4c2013-08-01 07:43:36 +00001413if test x"${enable_backtrace}" != x"no" ; then
1414 backtrace_ok=no
1415 AC_CHECK_HEADER([execinfo.h], [
1416 AC_SEARCH_LIBS([backtrace], [execinfo], [
1417 AC_DEFINE(HAVE_GLIBC_BACKTRACE,,[Glibc backtrace])
1418 AC_DEFINE(HAVE_STACK_TRACE,,[Stack symbol decoding])
1419 backtrace_ok=yes
1420 ],, [-lm])
Dmitrij Tejblumeda35292011-09-15 20:00:33 +04001421 ])
David Lamparter8c99b4c2013-08-01 07:43:36 +00001422
1423 if test x"${enable_backtrace}" = x"yes" -a x"${backtrace_ok}" = x"no"; then
1424 dnl user explicitly requested backtrace but we failed to find support
1425 AC_MSG_FAILURE([failed to find backtrace support])
1426 fi
1427fi
paulfb2d1502003-06-04 09:40:54 +00001428
Paul Jakma41be32b2006-03-30 13:53:59 +00001429dnl -----------------------------------------
1430dnl check for malloc mallinfo struct and call
1431dnl this must try and link using LIBS, in
1432dnl order to check no alternative allocator
1433dnl has been specified, which might not provide
1434dnl mallinfo, e.g. such as Umem on Solaris.
1435dnl -----------------------------------------
Paul Jakma6f0e3f62007-05-10 02:38:51 +00001436AC_CHECK_HEADER([malloc.h],
Paul Jakma41be32b2006-03-30 13:53:59 +00001437 [AC_MSG_CHECKING(whether mallinfo is available)
1438 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]],
1439 [[struct mallinfo ac_x; ac_x = mallinfo ();]])],
1440 [AC_MSG_RESULT(yes)
1441 AC_DEFINE(HAVE_MALLINFO,,mallinfo)],
1442 AC_MSG_RESULT(no)
1443 )
Paul Jakma6f0e3f62007-05-10 02:38:51 +00001444 ], [], QUAGGA_INCLUDES)
Paul Jakma41be32b2006-03-30 13:53:59 +00001445
paul408ad942003-05-20 00:03:33 +00001446dnl ----------
1447dnl configure date
1448dnl ----------
1449CONFDATE=`date '+%Y%m%d'`
1450AC_SUBST(CONFDATE)
1451
David Lamparterf281ab92013-02-26 16:21:20 +01001452dnl -------
1453dnl DejaGNU
1454dnl -------
1455if test x"$DEJAGNU" = x
1456then
1457 DEJAGNU="\$(top_srcdir)/tests/global-conf.exp"
1458fi
1459RUNTESTDEFAULTFLAGS="-x --tool \$\$tool"
1460
1461AC_SUBST(DEJAGNU)
1462AC_SUBST(RUNTESTDEFAULTFLAGS)
1463
paul7ea487b2003-03-17 02:05:07 +00001464dnl ------------------------------
paula159ed92003-06-04 11:01:45 +00001465dnl set paths for state directory
paul23bd12c2003-04-07 06:11:09 +00001466dnl ------------------------------
Jeremy Jacksone84999d2009-01-21 20:29:39 -05001467AC_MSG_CHECKING(directory to use for state file)
paul23bd12c2003-04-07 06:11:09 +00001468if test "${prefix}" = "NONE"; then
paule8f29842003-08-12 13:08:31 +00001469 quagga_statedir_prefix="";
paul23bd12c2003-04-07 06:11:09 +00001470else
paule8f29842003-08-12 13:08:31 +00001471 quagga_statedir_prefix=${prefix}
paul23bd12c2003-04-07 06:11:09 +00001472fi
1473if test "${localstatedir}" = '${prefix}/var'; then
Jeremy Jacksone84999d2009-01-21 20:29:39 -05001474 for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl
paule8f29842003-08-12 13:08:31 +00001475 ${quagga_statedir_prefix}/var/adm dnl
1476 ${quagga_statedir_prefix}/etc dnl
paula159ed92003-06-04 11:01:45 +00001477 /var/run dnl
1478 /var/adm dnl
1479 /etc dnl
1480 /dev/null;
paul23bd12c2003-04-07 06:11:09 +00001481 do
paule8f29842003-08-12 13:08:31 +00001482 test -d $QUAGGA_STATE_DIR && break
paul23bd12c2003-04-07 06:11:09 +00001483 done
Jeremy Jacksone84999d2009-01-21 20:29:39 -05001484 quagga_statedir=$QUAGGA_STATE_DIR
paul23bd12c2003-04-07 06:11:09 +00001485else
paule8f29842003-08-12 13:08:31 +00001486 quagga_statedir=${localstatedir}
paul23bd12c2003-04-07 06:11:09 +00001487fi
paule8f29842003-08-12 13:08:31 +00001488if test $quagga_statedir = "/dev/null"; then
paula159ed92003-06-04 11:01:45 +00001489 AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
1490fi
Jeremy Jacksone84999d2009-01-21 20:29:39 -05001491AC_MSG_RESULT(${quagga_statedir})
1492AC_SUBST(quagga_statedir)
paula159ed92003-06-04 11:01:45 +00001493
paule8f29842003-08-12 13:08:31 +00001494AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID)
1495AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID)
1496AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$quagga_statedir/ripngd.pid",ripngd PID)
1497AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID)
1498AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
1499AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
jardin9e867fe2003-12-23 08:56:18 +00001500AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID)
Everton Marques871dbcf2009-08-11 15:43:05 -03001501AC_DEFINE_UNQUOTED(PATH_PIMD_PID, "$quagga_statedir/pimd.pid",pimd PID)
ajsd0199432004-12-22 14:03:52 +00001502AC_DEFINE_UNQUOTED(PATH_WATCHQUAGGA_PID, "$quagga_statedir/watchquagga.pid",watchquagga PID)
paule8f29842003-08-12 13:08:31 +00001503AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
1504AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
1505AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket)
1506AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$quagga_statedir/ripngd.vty",ripng vty socket)
1507AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket)
1508AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
1509AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
jardin9e867fe2003-12-23 08:56:18 +00001510AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket)
Everton Marques871dbcf2009-08-11 15:43:05 -03001511AC_DEFINE_UNQUOTED(PIM_VTYSH_PATH, "$quagga_statedir/pimd.vty",pimd vty socket)
ajs515210b2004-12-22 15:35:12 +00001512AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$quagga_statedir",daemon vty directory)
paul7ea487b2003-03-17 02:05:07 +00001513
paul1eb8ef22005-04-07 07:30:20 +00001514dnl -------------------------------
1515dnl Quagga sources should always be
1516dnl current wrt interfaces. Dont
1517dnl allow deprecated interfaces to
1518dnl be exposed.
1519dnl -------------------------------
1520AC_DEFINE(QUAGGA_NO_DEPRECATED_INTERFACES, 1, Hide deprecated interfaces)
1521
paul7ea487b2003-03-17 02:05:07 +00001522dnl ---------------------------
1523dnl Check htonl works correctly
1524dnl ---------------------------
1525AC_MSG_CHECKING(for working htonl)
Paul Jakma6f0e3f62007-05-10 02:38:51 +00001526AC_CACHE_VAL(ac_cv_htonl_works,
1527 [AC_LINK_IFELSE([AC_LANG_PROGRAM([QUAGGA_INCLUDES],[htonl (0);])],
1528 [ac_cv_htonl_works=yes], [ac_cv_htonl_works=no])
1529 ]
1530)
paul7ea487b2003-03-17 02:05:07 +00001531AC_MSG_RESULT($ac_cv_htonl_works)
1532
paul14c17fd2004-11-07 22:34:23 +00001533AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile
ajsd0199432004-12-22 14:03:52 +00001534 ripngd/Makefile bgpd/Makefile ospfd/Makefile watchquagga/Makefile
Paul Jakma336724d2015-05-11 15:13:31 +01001535 ospf6d/Makefile isisd/Makefile vtysh/Makefile
David Lamparterf281ab92013-02-26 16:21:20 +01001536 doc/Makefile ospfclient/Makefile tests/Makefile m4/Makefile
Everton Marques871dbcf2009-08-11 15:43:05 -03001537 pimd/Makefile
David Lamparter5bb7e4d2013-02-26 17:53:30 +01001538 tests/bgpd.tests/Makefile
David Lamparterc69905b2013-01-24 01:39:14 +01001539 tests/libzebra.tests/Makefile
David Lamparterf281ab92013-02-26 16:21:20 +01001540 redhat/Makefile
gdt69f1fc22004-08-27 15:57:35 +00001541 pkgsrc/Makefile
paul670bbf12004-11-12 09:05:00 +00001542 redhat/quagga.spec
gdtb7a97f82004-07-23 16:23:56 +00001543 lib/version.h
paul14c17fd2004-11-07 22:34:23 +00001544 doc/defines.texi
hassof695b012005-04-02 19:03:39 +00001545 isisd/topology/Makefile
gdtcbd04082004-08-31 18:16:36 +00001546 pkgsrc/bgpd.sh pkgsrc/ospf6d.sh pkgsrc/ospfd.sh
paulf31293a2004-11-12 09:27:04 +00001547 pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh])
paul26275b02005-04-11 07:10:47 +00001548AC_CONFIG_FILES([solaris/Makefile])
1549
paul670bbf12004-11-12 09:05:00 +00001550AC_CONFIG_FILES([vtysh/extract.pl],[chmod +x vtysh/extract.pl])
hasso48577192004-11-19 06:41:49 +00001551## Hack, but working solution to avoid rebuilding of quagga.info.
1552## It's already in CVS until texinfo 4.7 is more common.
paul14c17fd2004-11-07 22:34:23 +00001553AC_OUTPUT
paul7ea487b2003-03-17 02:05:07 +00001554
1555echo "
hassoc89f6492004-08-26 12:21:28 +00001556Quagga configuration
1557--------------------
1558quagga version : ${PACKAGE_VERSION}
Joachim Nilsson1080c132012-05-30 08:15:48 +02001559host operating system : ${host_os}
paul7ea487b2003-03-17 02:05:07 +00001560source code location : ${srcdir}
1561compiler : ${CC}
1562compiler flags : ${CFLAGS}
Paul Jakma6f0e3f62007-05-10 02:38:51 +00001563make : ${MAKE-make}
Paul Jakma6f0e3f62007-05-10 02:38:51 +00001564linker flags : ${LDFLAGS} ${LIBS} ${LIBCAP} ${LIBREADLINE} ${LIBM}
paule8f29842003-08-12 13:08:31 +00001565state file directory : ${quagga_statedir}
pauldc7a2bf2003-10-22 00:07:44 +00001566config file directory : `eval echo \`echo ${sysconfdir}\``
gdtd6b72f72003-12-03 17:24:27 +00001567example directory : `eval echo \`echo ${exampledir}\``
paul8d4aee52003-06-06 00:30:35 +00001568user to run as : ${enable_user}
1569group to run as : ${enable_group}
1570group for vty sockets : ${enable_vty_group}
gdtaa593d52003-12-22 20:15:53 +00001571config file mask : ${enable_configfile_mask}
1572log file mask : ${enable_logfile_mask}
pauldc7a2bf2003-10-22 00:07:44 +00001573
1574The above user and group must have read/write access to the state file
Paul Jakma105b8232006-05-28 08:02:41 +00001575directory and to the config files in the config file directory."
1576
1577if test x"$quagga_cv_gnu_make" = x"no"; then echo "
1578Warning: The ${MAKE-make} programme detected, either in your path or
1579via the MAKE variable, is not GNU Make. GNU make may be installed as
1580gmake on some systems. and is required to complete a build of Quagga
1581" > /dev/stderr
1582fi