~ubuntu-branches/ubuntu/saucy/quagga/saucy

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2007-09-14 09:47:54 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070914094754-kqi815lcg6n8mh51
Tags: 0.99.9-1ubuntu1
* Merged new upstream version (LP: #139376)
  - Merged debian/changelog
* Fixes a DoS and some bugs introduced in 0.99.8
  (see: http://www.quagga.net/news2.php?y=2007&m=9&d=7#id1189190760)
* Remaining Ubuntu Patches:
  - debian/rules: use bash as shell
  - debian/quagga.prerm: handle upgrades more gracefully
  - debian/patches/81_32bit_u64.dpatch: Define __u64 as uint64_t
    before including the netlink headers, since that symbol does not exist
    by default on 32 bit arches. Fixes i386/powerpc FTBFS.
  - debian/patches/83_ifaddr_defs.dpatch:
    zebra/rt_netlink.c: #include <linux/if_addr.h> and define IF[L]A_RTA
    macros, so that the file compiles again with our kernel headers.
  - debian/patches/20_ht-20061217-0.99.6-bgp-md5.dpatch: updated for
    linux kernel 2.6.20.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
##  Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
6
6
##  Portions Copyright (c) 2003 Paul Jakma <paul@dishone.st>
7
7
##
8
 
## $Id: configure.ac,v 1.128 2007/04/29 20:13:35 paul Exp $
 
8
## $Id: configure.ac,v 1.139 2007/09/07 16:54:01 paul Exp $
9
9
AC_PREREQ(2.53)
10
10
 
11
 
AC_INIT(Quagga, 0.99.7, [http://bugzilla.quagga.net])
 
11
AC_INIT(Quagga, 0.99.9, [http://bugzilla.quagga.net])
12
12
AC_CONFIG_SRCDIR(lib/zebra.h)
13
13
 
14
14
dnl -----------------------------------
119
119
        AC_MSG_RESULT([Intel default])
120
120
        ;;
121
121
    "GCC")
122
 
        CFLAGS="-Os -fno-omit-frame-pointer -g -std=c99 -Wall"
 
122
        CFLAGS="-Os -fno-omit-frame-pointer -g -std=gnu99 -Wall"
123
123
        CFLAGS="${CFLAGS} -Wsign-compare -Wpointer-arith"
124
124
        CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings"
125
125
        CFLAGS="${CFLAGS} -Wmissing-prototypes -Wmissing-declarations"
143
143
dnl Check programs
144
144
dnl --------------
145
145
AC_PROG_INSTALL
 
146
AC_PROG_LN_S
146
147
AC_PROG_MAKE_SET
147
148
AC_CHECK_TOOL(AR, ar)
148
 
AC_CHECK_TOOL(RANLIB, ranlib, :)
149
149
 
150
150
dnl ---------------------------
151
151
dnl We, perhaps unfortunately,
163
163
        ]
164
164
)
165
165
 
166
 
dnl ---------
167
 
dnl AIX check
168
 
dnl ---------
 
166
dnl -----------------
 
167
dnl System extensions
 
168
dnl -----------------
169
169
AC_AIX
 
170
AC_GNU_SOURCE
170
171
 
171
172
dnl -------
172
173
dnl libtool
196
197
[  --disable-watchquagga   do not build watchquagga])
197
198
AC_ARG_ENABLE(isisd,
198
199
[  --enable-isisd          build isisd])
 
200
AC_ARG_ENABLE(solaris,
 
201
[  --enable-solaris          build solaris])
199
202
AC_ARG_ENABLE(bgp-announce,
200
203
[  --disable-bgp-announce, turn off BGP route announcement])
201
204
AC_ARG_ENABLE(netlink,
268
271
if test "${enable_broken_aliases}" = "yes"; then
269
272
  if test "${enable_netlink}" = "yes"
270
273
  then
271
 
    echo "Sorry, you can't use netlink with broken aliases"
272
 
    exit 1
 
274
    AC_MSG_FAILURE([Sorry you can not use netlink with broken aliases])
273
275
  fi
274
276
  AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias)
275
277
  enable_netlink=no
342
344
enable_logfile_mask=${enable_logfile_mask:-0600}
343
345
AC_DEFINE_UNQUOTED(LOGFILE_MASK, ${enable_logfile_mask}, Mask for log files)
344
346
 
345
 
changequote(, )dnl
346
 
 
347
347
MULTIPATH_NUM=1
348
348
 
349
349
case "${enable_multipath}" in
350
 
  [0-9]|[1-9][0-9])
 
350
  [[0-9]|[1-9][0-9]])
351
351
    MULTIPATH_NUM="${enable_multipath}"
352
352
    ;;
353
353
  "")
354
354
    ;;
355
355
  *)           
356
 
    echo "Please specify digit to --enable-multipath ARG."
357
 
    exit 1
 
356
    AC_MSG_FAILURE([Please specify digit to enable multipath ARG])
358
357
    ;;
359
358
esac
360
359
 
361
 
changequote([, ])dnl
362
 
 
363
360
AC_SUBST(MULTIPATH_NUM)
364
361
 
365
 
dnl -------------------
366
 
dnl Check header files.
367
 
dnl -------------------
 
362
dnl ------------------------------------
 
363
dnl Check C keywords and standard  types
 
364
dnl ------------------------------------
 
365
AC_C_CONST
 
366
AC_C_INLINE
 
367
AC_C_RESTRICT
 
368
AC_C_VOLATILE
368
369
AC_HEADER_STDC
369
 
AC_CHECK_HEADERS([string.h stropts.h sys/conf.h sys/ksym.h sys/time.h \
370
 
                 sys/times.h sys/select.h sys/sysctl.h sys/sockio.h \
371
 
                 sys/types.h linux/version.h kvm.h netdb.h asm/types.h \
372
 
                 sys/param.h libutil.h limits.h stdint.h])
373
 
 
374
 
AC_CHECK_HEADERS([sys/socket.h netinet/in_systm.h netinet/in.h \
375
 
                 net/if_dl.h net/netopt.h inet/nd.h net/route.h \
376
 
                 net/if.h net/if_var.h netinet/in_var.h])
377
 
 
378
 
dnl V6 headers are checked below, after we check for v6
379
 
 
380
 
dnl check some types
381
 
AC_C_CONST
 
370
AC_HEADER_TIME
 
371
AC_HEADER_SYS_WAIT
382
372
dnl AC_TYPE_PID_T
 
373
AC_TYPE_UID_T
 
374
AC_TYPE_MODE_T
 
375
AC_TYPE_SIZE_T
383
376
AC_TYPE_SIGNAL
 
377
AC_STRUCT_TM
 
378
 
 
379
dnl -------------------------
 
380
dnl Check other header files.
 
381
dnl -------------------------
 
382
AC_CHECK_HEADERS([stropts.h sys/ksym.h sys/times.h sys/select.h \
 
383
        sys/types.h linux/version.h netdb.h asm/types.h \
 
384
        sys/param.h limits.h signal.h libutil.h \
 
385
        sys/socket.h netinet/in.h])
 
386
 
 
387
dnl Utility macro to avoid retyping includes all the time
 
388
m4_define([QUAGGA_INCLUDES],
 
389
[#ifdef SUNOS_5
 
390
#define _XPG4_2
 
391
#define __EXTENSIONS__
 
392
#endif
 
393
#include <stdio.h>
 
394
#if STDC_HEADERS
 
395
# include <stdlib.h>
 
396
# include <stddef.h>
 
397
#else
 
398
# if HAVE_STDLIB_H
 
399
#  include <stdlib.h>
 
400
# endif
 
401
#endif
 
402
#if HAVE_SYS_TYPES_H
 
403
# include <sys/types.h>
 
404
#endif
 
405
/* sys/conf.h depends on param.h on FBSD at least */
 
406
#if HAVE_SYS_PARAM_H
 
407
# include <sys/param.h>
 
408
#endif
 
409
/* Required for MAXSIG */
 
410
#if HAVE_SIGNAL_H
 
411
# include <signal.h>
 
412
#endif
 
413
#if HAVE_SYS_SOCKET_H
 
414
# include <sys/socket.h>
 
415
#endif
 
416
#if HAVE_NETINET_IN_H
 
417
# include <netinet/in.h>
 
418
#endif
 
419
])dnl
 
420
 
 
421
AC_CHECK_HEADERS([sys/un.h net/if.h netinet/in_systm.h netinet/in_var.h \
 
422
        net/if_dl.h net/if_var.h net/netopt.h net/route.h \
 
423
        inet/nd.h arpa/inet.h netinet/ip_icmp.h \
 
424
        fcntl.h stddef.h sys/ioctl.h syslog.h wchar.h wctype.h \
 
425
        sys/sysctl.h sys/sockio.h kvm.h sys/conf.h],
 
426
        [], [], QUAGGA_INCLUDES)
 
427
 
 
428
AC_CHECK_HEADERS([ucontext.h], [], [],
 
429
[#ifndef __USE_GNU
 
430
#define __USE_GNU
 
431
#endif /* __USE_GNU */
 
432
QUAGGA_INCLUDES
 
433
])
 
434
 
 
435
m4_define([QUAGGA_INCLUDES],
 
436
QUAGGA_INCLUDES
 
437
[#if HAVE_NET_IF_H
 
438
# include <net/if.h>
 
439
#endif
 
440
#if HAVE_SYS_UN_H
 
441
# include <sys/un.h>
 
442
#endif
 
443
#if HAVE_NETINET_IN_SYSTM_H
 
444
# include <netinet/in_systm.h>
 
445
#endif
 
446
#if HAVE_NETINET_IN_VAR_H
 
447
# include <netinet/in_var.h>
 
448
#endif
 
449
#if HAVE_NET_IF_DL_H
 
450
# include <net/if_dl.h>
 
451
#endif
 
452
#if HAVE_NET_IF_VAR_H
 
453
# include <net/if_var.h>
 
454
#endif
 
455
#if HAVE_NET_NETOPT_H
 
456
# include <net/netopt.h>
 
457
#endif
 
458
#if HAVE_NET_ROUTE_H
 
459
# include <net/route.h>
 
460
#endif
 
461
#if HAVE_INET_ND_H
 
462
# include <inet/nd.h>
 
463
#endif
 
464
#if HAVE_ARPA_INET_H
 
465
# include <arpa/inet.h>
 
466
#endif
 
467
/* Required for IDRP */
 
468
#if HAVE_NETINET_IP_ICMP_H
 
469
# include <netinet/ip_icmp.h>
 
470
#endif
 
471
])dnl
 
472
 
 
473
dnl V6 headers are checked below, after we check for v6
384
474
 
385
475
dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
386
476
case "$host" in
446
536
         AC_DEFINE(VTYSH,,VTY shell)
447
537
         AC_PATH_PROG(PERL, perl)
448
538
dnl      Vtysh uses libreadline, which looks for termcap functions at
449
 
dnl      configure time.  We follow readline's search order.
 
539
dnl      configure time.  We follow readlines search order.
450
540
dnl      The required procedures are in libtermcap on NetBSD, in
451
541
dnl      [TODO] on Linux, and in [TODO] on Solaris.
452
542
         AC_CHECK_LIB(termcap, tputs, LIBREADLINE="$LIBREADLINE -ltermcap",
481
571
dnl PAM module
482
572
dnl ----------
483
573
if test "$with_libpam" = "yes"; then
484
 
  AC_CHECK_HEADER(security/pam_misc.h)
485
 
  if test "$ac_cv_header_security_pam_misc_h" = yes; then
486
 
    AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
487
 
    AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
488
 
    pam_conv_func="misc_conv"
489
 
  fi
490
 
  AC_CHECK_HEADER(security/openpam.h)
491
 
  if test "$ac_cv_header_security_openpam_h" = yes; then
492
 
    AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
493
 
    AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
494
 
    pam_conv_func="openpam_ttyconv"
495
 
  fi
 
574
  AC_CHECK_HEADER([security/pam_misc.h],
 
575
    [AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
 
576
     AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
 
577
     pam_conv_func="misc_conv"
 
578
    ],
 
579
    [], QUAGGA_INCLUDES)
 
580
  AC_CHECK_HEADER([security/openpam.h],
 
581
    [AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
 
582
     AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
 
583
     pam_conv_func="openpam_ttyconv"
 
584
    ],
 
585
    [], QUAGGA_INCLUDES)
496
586
  if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
497
587
    AC_MSG_WARN([*** pam support will not be built ***])
498
588
    with_libpam="no"
500
590
fi
501
591
 
502
592
if test "$with_libpam" = "yes"; then
503
 
dnl took this test from proftpd's configure.in and suited to our needs
 
593
dnl took this test from proftpds configure.in and suited to our needs
504
594
dnl -------------------------------------------------------------------------
505
595
dnl
506
596
dnl This next check looks funky due to a linker problem with some versions
546
636
dnl ----------------------------
547
637
dnl check existance of functions
548
638
dnl ----------------------------
549
 
AC_CHECK_FUNCS(memset memcpy strerror inet_aton daemon snprintf vsnprintf \
550
 
               strlcat strlcpy if_nametoindex if_indextoname getifaddrs \
551
 
               fcntl strnlen strndup)
 
639
AC_FUNC_CHOWN
 
640
AC_FUNC_FNMATCH
 
641
AC_FUNC_FORK
 
642
AC_FUNC_MALLOC
 
643
AC_FUNC_MEMCMP
 
644
AC_FUNC_MKTIME
 
645
AC_FUNC_STRFTIME
 
646
AC_FUNC_REALLOC
 
647
AC_FUNC_STAT
 
648
AC_FUNC_SELECT_ARGTYPES
 
649
AC_FUNC_STRFTIME
 
650
dnl Avoid AC_FUNC_STRNLEN because it pulls in AC_SYSTEM_EXTENSIONS which
 
651
dnl can lead to strange side effects.  So we just check for strnlen
 
652
dnl directly, see below.
 
653
dnl AC_FUNC_STRNLENdnl
 
654
AC_FUNC_VPRINTF
 
655
 
 
656
dnl -------------------------------
 
657
dnl bgpd needs pow() and hence libm
 
658
dnl -------------------------------
 
659
TMPLIBS="$LIBS"
 
660
AC_CHECK_HEADER([math.h],
 
661
  [AC_CHECK_LIB([m], [pow],
 
662
    [LIBM="-lm"
 
663
     LIBS="$LIBS $LIBM"
 
664
     AC_DEFINE(HAVE_LIBM,, Have libm)
 
665
     AC_CHECK_FUNCS(pow,[],[LIBM=""])
 
666
    ])
 
667
])
 
668
if test x"$LIBM" = x ; then
 
669
  AC_MSG_WARN([Unable to find working pow function - bgpd may not link])
 
670
fi
 
671
LIBS="$TMPLIBS"
 
672
AC_SUBST(LIBM)
 
673
 
 
674
dnl ---------------
 
675
dnl other functions
 
676
dnl ---------------
 
677
AC_CHECK_FUNCS([dup2 ftruncate getcwd gethostbyname getpagesize gettimeofday \
 
678
        inet_ntoa inet_aton strnlen \
 
679
        memchr memmove memset select socket \
 
680
        strcasecmp strchr strcspn strdup strerror \
 
681
        strncasecmp strndup strrchr strspn strstr \
 
682
        strtol strtoul strlcat strlcpy \
 
683
        daemon snprintf vsnprintf \
 
684
        if_nametoindex if_indextoname getifaddrs \
 
685
        uname fcntl])
 
686
 
552
687
AC_CHECK_FUNCS(setproctitle, ,
553
688
  [AC_CHECK_LIB(util, setproctitle, 
554
689
     [LIBS="$LIBS -lutil"
617
752
AC_SUBST(KERNEL_METHOD)
618
753
AC_SUBST(OTHER_METHOD)
619
754
 
 
755
dnl --------------------------
 
756
dnl Determine IS-IS I/O method
 
757
dnl --------------------------
 
758
AC_CHECK_HEADER(net/bpf.h)
 
759
AC_CHECK_HEADER(sys/dlpi.h)
 
760
AC_MSG_CHECKING(zebra IS-IS I/O method)
 
761
if test x"$opsys" = x"gnu-linux"; then
 
762
  AC_MSG_RESULT(pfpacket)
 
763
  ISIS_METHOD=isis_pfpacket.o
 
764
elif test x"$opsys" = x"sol2-6" -o x"$opsys" = x"sol8"; then
 
765
  AC_MSG_RESULT(DLPI)
 
766
  ISIS_METHOD="isis_dlpi.o"
 
767
else
 
768
  if test $ac_cv_header_net_bpf_h = no; then
 
769
    if test $ac_cv_header_sys_dlpi_h = no; then
 
770
      AC_MSG_RESULT(none)
 
771
      AC_MSG_WARN([*** IS-IS support will not be built ***])
 
772
      ISISD=""
 
773
    else
 
774
      AC_MSG_RESULT(DLPI)
 
775
    fi
 
776
    ISIS_METHOD="isis_dlpi.o"
 
777
  else
 
778
    AC_MSG_RESULT(BPF)
 
779
    ISIS_METHOD="isis_bpf.o"
 
780
  fi
 
781
fi
 
782
AC_SUBST(ISIS_METHOD)
 
783
 
620
784
dnl ------------------------------------
621
785
dnl check for broken CMSG_FIRSTHDR macro
622
786
dnl ------------------------------------
626
790
#define _XPG4_2
627
791
#define __EXTENSIONS__
628
792
#endif
629
 
#include <stdlib.h>
 
793
#ifdef HAVE_STDLIB_H
 
794
# include <stdlib.h>
 
795
#endif
 
796
#ifdef HAVE_SYS_TYPES_H
630
797
#include <sys/types.h>
 
798
#endif
 
799
#ifdef HAVE_SYS_SOCKET_H
631
800
#include <sys/socket.h>
 
801
#endif
632
802
 
633
803
main()
634
804
{
707
877
dnl ---------------------------------------------------------------
708
878
dnl figure out how to specify an interface in multicast sockets API
709
879
dnl ---------------------------------------------------------------
710
 
AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex],,,[#ifdef HAVE_SYS_TYPES_H
711
 
#include <sys/types.h>
712
 
#endif
713
 
#ifdef HAVE_NETINET_IN_H
714
 
#include <netinet/in.h>
715
 
#endif])
 
880
AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [], [], QUAGGA_INCLUDES)
716
881
 
717
882
AC_MSG_CHECKING([for BSD struct ip_mreq hack])
718
883
AC_TRY_COMPILE([#ifdef HAVE_SYS_PARAM_H
911
1076
dnl ------------------
912
1077
if test "x${zebra_cv_ipv6}" = "xyes"; then
913
1078
AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \
914
 
                 netinet6/in6_var.h netinet6/nd6.h])
 
1079
        netinet6/in6_var.h netinet6/nd6.h], [], [],
 
1080
        QUAGGA_INCLUDES)
915
1081
fi
916
1082
 
 
1083
m4_define([QUAGGA_INCLUDES],dnl
 
1084
QUAGGA_INCLUDES
 
1085
[#if HAVE_NETINET6_IN6_H
 
1086
#include <netinet6/in6.h>
 
1087
#endif
 
1088
#if HAVE_NETINET_IN6_VAR_H
 
1089
#include <netinet/in6_var.h>
 
1090
#endif
 
1091
#if HAVE_NETINET_ICMP6_H
 
1092
# include <netinet/icmp6.h>
 
1093
#endif
 
1094
#if HAVE_NETINET6_IN6_VAR_H
 
1095
# include <netinet6/in6_var.h>
 
1096
#endif
 
1097
#if HAVE_NETINET6_ND6_H
 
1098
# include <netinet6/nd6.h>
 
1099
#endif
 
1100
])dnl
 
1101
 
917
1102
dnl --------------------
918
1103
dnl Daemon disable check
919
1104
dnl --------------------
977
1162
  *    ) ;;
978
1163
esac
979
1164
 
 
1165
# XXX Perhaps auto-enable on Solaris, but that's messy for cross builds.
 
1166
case "${enable_solaris}" in
 
1167
  "yes") SOLARIS="solaris";;
 
1168
  "no" ) SOLARIS="";;
 
1169
  *    ) ;;
 
1170
esac
 
1171
 
980
1172
if test "${enable_bgp_announce}" = "no";then
981
1173
  AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra)
982
1174
fi
989
1181
AC_SUBST(OSPF6D)
990
1182
AC_SUBST(WATCHQUAGGA)
991
1183
AC_SUBST(ISISD)
 
1184
AC_SUBST(SOLARIS)
992
1185
AC_SUBST(VTYSH)
993
1186
AC_SUBST(INCLUDES)
994
1187
AC_SUBST(CURSES)
998
1191
AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
999
1192
AC_CHECK_LIB(crypt, crypt)
1000
1193
AC_CHECK_LIB(resolv, res_init)
1001
 
AC_CHECK_LIB(m, main)
1002
1194
 
1003
1195
dnl ---------------------------------------------------
1004
1196
dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY
1047
1239
    AC_SUBST(SNMP_INCLUDES)
1048
1240
fi
1049
1241
 
1050
 
dnl ----------------------------
1051
 
dnl check sa_len of sockaddr
1052
 
dnl ----------------------------
1053
 
AC_MSG_CHECKING(whether struct sockaddr has a sa_len field)
1054
 
AC_TRY_COMPILE([#include <sys/types.h>
1055
 
#include <sys/socket.h>
1056
 
],[static struct sockaddr ac_i;int ac_j = sizeof (ac_i.sa_len);],
1057
 
[AC_MSG_RESULT(yes)
1058
 
 AC_DEFINE(HAVE_SA_LEN,,sa_len)],
1059
 
 AC_MSG_RESULT(no))
1060
 
 
1061
 
dnl ----------------------------
1062
 
dnl check sin_len of sockaddr_in
1063
 
dnl ----------------------------
1064
 
AC_MSG_CHECKING(whether struct sockaddr_in has a sin_len field)
1065
 
AC_TRY_COMPILE([#include <sys/types.h>
1066
 
#include <netinet/in.h>
1067
 
],[static struct sockaddr_in ac_i;int ac_j = sizeof (ac_i.sin_len);],
1068
 
[AC_MSG_RESULT(yes)
1069
 
 AC_DEFINE(HAVE_SIN_LEN,,sin_len)],
1070
 
 AC_MSG_RESULT(no))
1071
 
 
1072
 
dnl ----------------------------
1073
 
dnl check sun_len of sockaddr_un
1074
 
dnl ----------------------------
1075
 
AC_MSG_CHECKING(whether struct sockaddr_un has a sun_len field)
1076
 
AC_TRY_COMPILE([#include <sys/types.h>
1077
 
#include <sys/un.h>
1078
 
],[static struct sockaddr_un ac_i;int ac_j = sizeof (ac_i.sun_len);],
1079
 
[AC_MSG_RESULT(yes)
1080
 
 AC_DEFINE(HAVE_SUN_LEN,,sun_len)],
1081
 
 AC_MSG_RESULT(no))
1082
 
 
1083
 
dnl -----------------------------------
1084
 
dnl check sin6_scope_id of sockaddr_in6
1085
 
dnl -----------------------------------
1086
 
if test "$zebra_cv_ipv6" = yes; then
1087
 
  AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field)
1088
 
  AC_TRY_COMPILE([#include <sys/types.h>
1089
 
#include <netinet/in.h>
1090
 
],[static struct sockaddr_in6 ac_i;int ac_j = sizeof (ac_i.sin6_scope_id);],
1091
 
[AC_MSG_RESULT(yes)
1092
 
 AC_DEFINE(HAVE_SIN6_SCOPE_ID,,scope id)],
1093
 
 AC_MSG_RESULT(no))
1094
 
fi
1095
 
 
1096
 
dnl ----------------------------
1097
 
dnl check socklen_t exist or not
1098
 
dnl ----------------------------
1099
 
AC_MSG_CHECKING(whther socklen_t is defined)
1100
 
AC_TRY_COMPILE([#include <sys/types.h>
1101
 
#include <sys/socket.h>
1102
 
#include <netinet/in.h>
1103
 
],[socklen_t ac_x;],
1104
 
[AC_MSG_RESULT(yes)
1105
 
 AC_DEFINE(HAVE_SOCKLEN_T,,socklen_t)],
1106
 
 AC_MSG_RESULT(no))
1107
 
 
1108
 
dnl ------------------------
1109
 
dnl check struct sockaddr_dl
1110
 
dnl ------------------------
1111
 
AC_MSG_CHECKING(whether struct sockaddr_dl exist)
1112
 
AC_EGREP_HEADER(sockaddr_dl,
1113
 
net/if_dl.h,
1114
 
[AC_MSG_RESULT(yes)
1115
 
 AC_DEFINE(HAVE_SOCKADDR_DL,,sockaddr_dl)],
1116
 
 AC_MSG_RESULT(no))
1117
 
 
1118
 
dnl --------------------------
1119
 
dnl check structure ifaliasreq
1120
 
dnl --------------------------
1121
 
AC_MSG_CHECKING(whether struct ifaliasreq exist)
1122
 
AC_EGREP_HEADER(ifaliasreq,
1123
 
net/if.h,
1124
 
[AC_MSG_RESULT(yes)
1125
 
 AC_DEFINE(HAVE_IFALIASREQ,,ifaliasreq)],
1126
 
 AC_MSG_RESULT(no))
1127
 
 
1128
 
dnl ----------------------------
1129
 
dnl check structure in6_aliasreq
1130
 
dnl ----------------------------
1131
 
AC_MSG_CHECKING(whether struct in6_aliasreq exist)
1132
 
AC_EGREP_HEADER(in6_aliasreq,
1133
 
netinet6/in6_var.h,
1134
 
[AC_MSG_RESULT(yes)
1135
 
 AC_DEFINE(HAVE_IN6_ALIASREQ,,in6_aliasreq)],
1136
 
 AC_MSG_RESULT(no))
1137
 
 
1138
 
dnl -----------------------------------
1139
 
dnl check ifra_lifetime of in6_aliasreq
1140
 
dnl -----------------------------------
1141
 
AC_MSG_CHECKING(whether in6_aliasreq.ifra_lifetime exist)
1142
 
AC_TRY_COMPILE([#include <sys/types.h>
1143
 
#include <netinet6/in6_var.h>
1144
 
],[static struct if6_aliasreq ac_i;int ac_j = sizeof (ac_i.ifra_lifetime);],
1145
 
[AC_MSG_RESULT(yes)
1146
 
 AC_DEFINE(HAVE_IFRA_LIFETIME,,Have in6_aliasreq.ifra_lifetime)],
1147
 
 AC_MSG_RESULT(no))
1148
 
 
1149
 
dnl ---------------------------
1150
 
dnl check structure rt_addrinfo
1151
 
dnl ---------------------------
1152
 
AC_MSG_CHECKING(whether struct rt_addrinfo exist)
1153
 
AC_EGREP_HEADER(rt_addrinfo,
1154
 
net/route.h,
1155
 
[AC_MSG_RESULT(yes)
1156
 
 AC_DEFINE(HAVE_RT_ADDRINFO,,rt_addrinfo)],
1157
 
 AC_MSG_RESULT(no))
1158
 
 
1159
 
dnl --------------------------
1160
 
dnl check structure in_pktinfo
1161
 
dnl --------------------------
1162
 
AC_MSG_CHECKING(whether struct in_pktinfo exist)
1163
 
AC_TRY_COMPILE([#include <netinet/in.h>
1164
 
],[struct in_pktinfo ac_x;],
1165
 
[AC_MSG_RESULT(yes)
1166
 
 AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)],
1167
 
 AC_MSG_RESULT(no))
1168
 
 
1169
 
dnl ----------------------------------
1170
 
dnl check struct nd_opt_homeagent_info
1171
 
dnl ----------------------------------
1172
 
AC_MSG_CHECKING(whether struct nd_opt_homeagent_info exist)
1173
 
AC_EGREP_HEADER(nd_opt_homeagent_info,
1174
 
netinet/icmp6.h,
1175
 
[AC_MSG_RESULT(yes)
1176
 
 AC_DEFINE(HAVE_ND_OPT_HOMEAGENT_INFO,,nd_opt_homeagent_info)],
1177
 
 AC_MSG_RESULT(no))
1178
 
 
1179
 
dnl --------------------------------
1180
 
dnl check struct nd_opt_adv_interval
1181
 
dnl --------------------------------
1182
 
AC_MSG_CHECKING(whether struct nd_opt_adv_interval exist)
1183
 
AC_EGREP_HEADER(nd_opt_adv_interval,
1184
 
netinet/icmp6.h,
1185
 
[AC_MSG_RESULT(yes)
1186
 
 AC_DEFINE(HAVE_ND_OPT_ADV_INTERVAL,,nd_opt_adv_interval)],
1187
 
 AC_MSG_RESULT(no))
1188
 
 
1189
 
dnl ------------------------------------
1190
 
dnl check fields in  nd_opt_adv_interval
1191
 
dnl ------------------------------------
1192
 
AC_MSG_CHECKING(whether nd_opt_ai_type field exist)
1193
 
AC_EGREP_HEADER(nd_opt_ai_type,
1194
 
netinet/icmp6.h,
1195
 
[AC_MSG_RESULT(yes)
1196
 
 AC_DEFINE(HAVE_ND_OPT_ADV_INTERVAL_AI_FIELDS,,nd_opt_ai_type)],
1197
 
 AC_MSG_RESULT(no))
 
1242
dnl ---------------------------
 
1243
dnl sockaddr and netinet checks
 
1244
dnl ---------------------------
 
1245
AC_CHECK_TYPES([struct sockaddr, struct sockaddr_in,
 
1246
        struct sockaddr_in6, struct sockaddr_un, struct sockaddr_dl,
 
1247
        socklen_t,
 
1248
        struct ifaliasreq, struct if6_aliasreq, struct in6_aliasreq,
 
1249
        struct nd_opt_adv_interval, struct rt_addrinfo,
 
1250
        struct nd_opt_homeagent_info, struct nd_opt_adv_interval],
 
1251
        [], [], QUAGGA_INCLUDES)
 
1252
 
 
1253
AC_CHECK_MEMBERS([struct sockaddr.sa_len,
 
1254
        struct sockaddr_in.sin_len, struct sockaddr_un.sun_len,
 
1255
        struct sockaddr_in6.sin6_scope_id,
 
1256
        struct if6_aliasreq.ifra_lifetime,
 
1257
        struct nd_opt_adv_interval.nd_opt_ai_type],
 
1258
        [], [], QUAGGA_INCLUDES)
 
1259
 
 
1260
dnl ---------------------------
 
1261
dnl IRDP/pktinfo/icmphdr checks
 
1262
dnl ---------------------------
 
1263
AC_CHECK_TYPES([struct in_pktinfo], 
 
1264
 [AC_CHECK_TYPES([struct icmphdr],
 
1265
   [if test "${enable_irdp}" != "no"; then
 
1266
      AC_DEFINE(HAVE_IRDP,, IRDP)
 
1267
    fi],
 
1268
   [if test "${enable_irdp}" = "yes"; then
 
1269
      AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
 
1270
    fi], [QUAGGA_INCLUDES])],
 
1271
 [if test "${enable_irdp}" = "yes"; then
 
1272
    AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
 
1273
  fi], [QUAGGA_INCLUDES])
1198
1274
 
1199
1275
dnl --------------------------------------
1200
1276
dnl checking for getrusage struct and call
1245
1321
fi
1246
1322
AC_SUBST(LIBCAP)
1247
1323
 
1248
 
dnl -------------------
1249
 
dnl test for ucontext.h
1250
 
dnl -------------------
1251
 
AC_CHECK_HEADERS(ucontext.h)
1252
 
 
1253
1324
dnl ---------------------------
1254
1325
dnl check for glibc 'backtrace'
1255
1326
dnl --------------------------- 
1269
1340
dnl has been specified, which might not provide
1270
1341
dnl mallinfo, e.g. such as Umem on Solaris.
1271
1342
dnl -----------------------------------------
1272
 
AC_CHECK_HEADERS(malloc.h,
 
1343
AC_CHECK_HEADER([malloc.h],
1273
1344
 [AC_MSG_CHECKING(whether mallinfo is available)
1274
1345
  AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]],
1275
1346
                        [[struct mallinfo ac_x; ac_x = mallinfo ();]])],
1277
1348
       AC_DEFINE(HAVE_MALLINFO,,mallinfo)],
1278
1349
       AC_MSG_RESULT(no)
1279
1350
  )
1280
 
 ]
1281
 
)
 
1351
 ], [], QUAGGA_INCLUDES)
1282
1352
 
1283
1353
dnl ----------
1284
1354
dnl configure date
1347
1417
dnl Check htonl works correctly
1348
1418
dnl ---------------------------
1349
1419
AC_MSG_CHECKING(for working htonl)
1350
 
AC_CACHE_VAL(ac_cv_htonl_works, [
1351
 
AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H
1352
 
#include <sys/types.h>
1353
 
#endif
1354
 
#ifdef HAVE_NETDB_H
1355
 
#include <netdb.h>
1356
 
#endif
1357
 
#ifdef HAVE_NETINET_IN_H
1358
 
#include <netinet/in.h>
1359
 
#endif],
1360
 
[htonl (0);],
1361
 
ac_cv_htonl_works=yes,
1362
 
ac_cv_htonl_works=no)])
 
1420
AC_CACHE_VAL(ac_cv_htonl_works,
 
1421
 [AC_LINK_IFELSE([AC_LANG_PROGRAM([QUAGGA_INCLUDES],[htonl (0);])],
 
1422
                [ac_cv_htonl_works=yes], [ac_cv_htonl_works=no])
 
1423
 ]
 
1424
)
1363
1425
AC_MSG_RESULT($ac_cv_htonl_works)
1364
1426
 
1365
1427
AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile 
1378
1440
AC_CONFIG_FILES([vtysh/extract.pl],[chmod +x vtysh/extract.pl])
1379
1441
## Hack, but working solution to avoid rebuilding of quagga.info.
1380
1442
## It's already in CVS until texinfo 4.7 is more common.
1381
 
AC_CONFIG_COMMANDS([info-time],[touch doc/quagga.info])
1382
1443
AC_OUTPUT
1383
1444
 
1384
1445
echo "
1389
1450
source code location    : ${srcdir}
1390
1451
compiler                : ${CC}
1391
1452
compiler flags          : ${CFLAGS}
 
1453
make                    : ${MAKE-make}
1392
1454
includes                : ${INCLUDES} ${SNMP_INCLUDES}
1393
 
linker flags            : ${LDFLAGS} ${LIBS} ${LIBCAP} ${LIBREADLINE}
 
1455
linker flags            : ${LDFLAGS} ${LIBS} ${LIBCAP} ${LIBREADLINE} ${LIBM}
1394
1456
state file directory    : ${quagga_statedir}
1395
1457
config file directory   : `eval echo \`echo ${sysconfdir}\``
1396
1458
example directory       : `eval echo \`echo ${exampledir}\``