# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(README) AM_CONFIG_HEADER(include/config.h) AM_INIT_AUTOMAKE(mcast-tools, 20050926) SUBDIRS="mcastread mcastsend mfc mtrace6 pim6dd pim6sd pmsft" AC_SUBST(SUBDIRS) # Checks for programs. AC_PROG_CC AC_PROG_YACC AC_PROG_INSTALL AM_PROG_LEX CFLAGS_ADD="$CFLAGS_ADD -Wall -Werror -Wno-unused" # Checks for libraries. AC_CHECK_LIB([fl], [main]) # FIXME: Replace `main' with a function in `-ll': AC_CHECK_LIB([l], [main]) AC_CHECK_LIB([y], [main]) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h paths.h stddef.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h]) AC_CHECK_HEADERS([sys/types.h sys/queue.h netinet/in.h net/if.h net/if_var.h netinet6/in6_var.h],,, [[ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_QUEUE_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_NET_IF_VAR_H #include #endif ]]) AC_CHECK_HEADERS([sys/types.h netinet6/pim6.h],,, [[ #ifdef HAVE_SYS_TYPES_H #include #endif ]]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_HEADER_STDC AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIGNAL AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h paths.h stdarg.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h) AC_MSG_CHECKING(if you have struct mld_hdr in your system) AC_CACHE_VAL(ts_cv_have_mld_hdr, [dnl AC_TRY_COMPILE([ #include #include #include ], [ int i; struct mld_hdr a; i = sizeof(a); ], [ts_cv_have_mld_hdr="yes"], [ts_cv_have_mld_hdr="no"])]) AC_MSG_RESULT($ts_cv_have_mld_hdr); if test "$ts_cv_have_mld_hdr" = yes; then AC_DEFINE([HAVE_MLD_HDR], 1, [Define to 1 if you have struct mld_hdr in your system]) fi # Checks for library functions. AC_FUNC_FORK AC_PROG_GCC_TRADITIONAL AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AC_FUNC_SETPGRP AC_FUNC_VPRINTF AC_CHECK_FUNCS([bzero dup2 gettimeofday isascii memset select socket strchr strdup strerror strrchr strlcpy strncpy]) dnl Checks for other features AC_MSG_CHECKING(if you have a length field in struct sockaddr*) AC_CACHE_VAL(ts_cv_sa_len, [dnl AC_TRY_COMPILE([ #include #include ], [ struct sockaddr a; a.sa_len = 1; ], [ts_cv_sa_len="yes"], [ts_cv_sa_len="no"])]) AC_MSG_RESULT($ts_cv_sa_len); if test "$ts_cv_sa_len" = yes; then AC_DEFINE([HAVE_SA_LEN], 1, [Define to 1 if you have a length field in struct sockaddr]) fi AC_MSG_CHECKING(if you enabled router-side mldv2) AC_ARG_ENABLE(mldv2router, [ --disable-mldv2router disables router-side MLDv2 functionality --enable-mldv2router enables router-side MLDv2 functionality], [], [enable_mldv2router=yes]) if test "$enable_mldv2router" = "yes"; then AC_DEFINE(HAVE_MLDV2, 1, [Define to 1 if you enables router-side MLDv2 functionality]) fi AC_MSG_RESULT($enable_mldv2router) AC_MSG_CHECKING(if you enabled host-side mldv2) AC_ARG_ENABLE(mldv2host, [ --disable-mldv2host disables host-side MLDv2 functionality --enable-mldv2host enables host-side MLDv2 functionality], [], [enable_mldv2host=no]) if test "$enable_mldv2host" = "yes"; then AC_DEFINE(HAVE_MLDV2HOST, 1, [Define to 1 if you have the host-side MLDv2 functionality]) fi AC_MSG_RESULT($enable_mldv2host) dnl Determine routing get and set method AC_MSG_CHECKING(userland-kernel interface for routing information) AC_TRY_RUN([#include #include #include main () { int ac_sock; ac_sock = socket (AF_ROUTE, SOCK_RAW, 0); if (ac_sock < 0 && errno == EINVAL) exit (1); exit (0); }], [AC_DEFINE(HAVE_ROUTING_SOCKETS) UK_METHOD=routesock.o AC_MSG_RESULT(routing socket)], [AC_DEFINE(HAVE_NETLINK) UK_METHOD=netlink.o AC_MSG_RESULT(netlink)]) AC_SUBST(UK_METHOD) dnl Checks for RFC3542 AC_CHECK_LIB([c], [inet6_opt_init], [AC_DEFINE(HAVE_RFC3542)], ) AC_CONFIG_FILES([Makefile mcastread/Makefile mcastsend/Makefile mfc/Makefile mtrace6/Makefile pim6dd/Makefile pim6sd/Makefile pmsft/Makefile]) AC_OUTPUT