dnl Process this file with autoconf to produce a configure script. AC_INIT AC_CONFIG_SRCDIR([dhcp6c.c]) dnl Checks for programs. AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_CC AC_PROG_CPP AC_PROG_YACC AC_PROG_LEX dnl Checks for libraries. dnl AC_CHECK_LIB(c, kvm_open, [], [AC_CHECK_LIB(kvm, kvm_open)]) dnl AC_CHECK_LIB(mld, nlist) AC_CHECK_LIB(crypto, MD5_Init, [], [AC_CHECK_LIB(ssl, MD5_Init)]) AC_CHECK_LIB(resolv, __dn_comp, [], []) dnl pcap library dnl CFLAGS="-I. $CFLAGS" dnl AC_MSG_CHECKING(for pcap library/header) dnl for dir in /usr/local/libpcap /usr/local/v6 /usr/local \ dnl ../libpcap* ../../libpcap*; do dnl ac_cv_pcap_lib=no dnl ac_cv_pcap_include=no dnl if test -d $dir -a -f $dir/libpcap.a; then dnl ac_cv_pcap_lib="$dir" dnl elif test -d $dir/lib -a -f $dir/lib/libpcap.a; then dnl ac_cv_pcap_lib="$dir/lib" dnl fi dnl if test -d $dir -a -f $dir/pcap.h; then dnl ac_cv_pcap_include="$dir" dnl elif test -d $dir/include -a -f $dir/include/pcap.h; then dnl ac_cv_pcap_include="$dir/include" dnl fi dnl if test "$ac_cv_pcap_lib" != "no" -a "$ac_cv_pcap_include" != "no"; then dnl LIBS="-L$ac_cv_pcap_lib $LIBS" dnl CFLAGS="-I$ac_cv_pcap_include $CFLAGS" dnl break dnl fi dnl done dnl if test "$ac_cv_pcap_lib" = "no" -a "$ac_cv_pcap_include" = "no"; then dnl AC_MSG_RESULT(no) dnl else dnl AC_MSG_RESULT($ac_cv_pcap_lib and $ac_cv_pcap_include) dnl fi dnl AC_CHECK_LIB(pcap, pcap_lookupdev, [], dnl [echo "Fatal: libpcap.a not found" dnl exit 1]) dnl AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[]])],[],[dnl dnl echo "Fatal: pcap.h not found" dnl exit 1]) CFLAGS="$CFLAGS -I\$(srcdir)" AC_MSG_CHECKING(for getaddrinfo/getnameinfo library) AC_EGREP_CPP(yes, [#include #ifdef __KAME__ yes #endif], [result=kame]) AC_MSG_RESULT($result) case $result in kame) AC_DEFINE(INET6) o_LIBS="$LIBS" LIBS="$LIBS -L/usr/local/v6/lib -L/usr/lib" AC_CHECK_LIB(inet6, getaddrinfo, [], [LIBS="$o_LIBS"]) ;; *) ;; esac AC_REPLACE_FUNCS(getaddrinfo) AC_REPLACE_FUNCS(getnameinfo) AC_REPLACE_FUNCS(ifaddrs) AC_CHECK_FUNCS(if_nametoindex) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h syslog.h unistd.h ifaddrs.h) AC_MSG_CHECKING(for socklen_t) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[socklen_t x; x = 1; return x;]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no) AC_CHECK_TYPE(socklen_t, int)]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM AC_STRUCT_TIMEZONE dnl Checks for library functions. AC_FUNC_GETPGRP AC_PROG_GCC_TRADITIONAL AC_FUNC_SETPGRP AC_TYPE_SIGNAL AC_CHECK_FUNCS(mktime select socket) dnl Checks for arc4random dnl AC_REPLACE_FUNCS(arc4random) dnl Checks for optinal parameters AC_MSG_CHECKING(if --enable-mediator option is specified) AC_ARG_WITH(mediator, [ --with-mediator build with mediator (obsolete)], [AC_DEFINE(MEDIATOR) with_mediator=yes], [with_mediator=no]) AC_MSG_RESULT($with_mediator); AC_MSG_CHECKING(if --enable-pedant option is specified) AC_ARG_ENABLE(pedant, [ --enable-pedant pedantic compilation], [if test "$enableval" = "yes"; then CFLAGS="-Wall -Werror $CFLAGS" fi], [enableval=no]) AC_MSG_RESULT($enableval); dnl Checks predeclared identifers of function names AC_MSG_CHECKING(ANSI predeclared __func__) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[void func(void) {printf("%s\n", __func__);}]])],[AC_MSG_RESULT(yes) pred_func_id=ansi],[AC_MSG_RESULT(no) pred_func_id=no]) if test $pred_func_id = no; then AC_MSG_CHECKING(gcc predelcared __FUNCTION__) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[void func(void) {printf("%s\n", __FUNCTION__);}]])],[AC_MSG_RESULT(yes) pred_func_id=gcc],[AC_MSG_RESULT(no) pred_func_id=no]) fi case $pred_func_id in ansi) AC_DEFINE(HAVE_ANSI_FUNC) ;; gcc) AC_DEFINE(HAVE_GCC_FUNCTION) ;; esac AC_CHECK_HEADERS(stdarg.h) AC_CONFIG_FILES([Makefile]) AC_OUTPUT