2009-10-16 06:20:23 +00:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
2009-11-05 14:05:26 +00:00
|
|
|
AC_PREREQ([2.59])
|
2010-02-03 17:28:49 +00:00
|
|
|
AC_INIT(bind10, 10.0.0, bind10-bugs@isc.org)
|
2009-10-16 06:20:23 +00:00
|
|
|
AC_CONFIG_SRCDIR(README)
|
|
|
|
AM_INIT_AUTOMAKE
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
|
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CXX
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
|
2010-01-26 22:15:42 +00:00
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
|
2009-12-03 08:21:01 +00:00
|
|
|
m4_define([_AM_PYTHON_INTERPRETER_LIST], [python python3 python3.1])
|
|
|
|
AM_PATH_PYTHON([3.1])
|
|
|
|
|
2010-01-26 22:15:42 +00:00
|
|
|
# default compiler warning settings
|
|
|
|
if test "X$GCC" = "Xyes"; then
|
2010-01-26 22:22:49 +00:00
|
|
|
#-Woverloaded-virtual will produce so many warnings. Suppress them for rapid
|
|
|
|
# prototyping, but we should soon fix the code, rather than ignoring the
|
|
|
|
# warnings!!
|
|
|
|
#CXXFLAGS="-g -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
|
|
|
|
CXXFLAGS="-g -Wall -Wwrite-strings -Wno-sign-compare"
|
2010-01-26 22:15:42 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# produce PIC unless we disable shared libraries. need this for python bindings.
|
|
|
|
if test $enable_shared != "no" -a "X$GCC" = "Xyes"; then
|
|
|
|
CXXFLAGS="$CXXFLAGS -fPIC"
|
|
|
|
fi
|
|
|
|
|
2009-10-16 06:20:23 +00:00
|
|
|
# Checks for libraries.
|
|
|
|
|
|
|
|
# Checks for header files.
|
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_HEADER_STDBOOL
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
|
2009-10-30 17:47:35 +00:00
|
|
|
AC_MSG_CHECKING(for sa_len in struct sockaddr)
|
|
|
|
AC_TRY_COMPILE([
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>],
|
|
|
|
[struct sockaddr sa; sa.sa_len = 0; return (0);],
|
|
|
|
[AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(HAVE_SIN_LEN, 1, Define to 1 if sockaddr_in has a sin_len member)],
|
|
|
|
AC_MSG_RESULT(no))
|
|
|
|
|
2009-12-29 16:07:20 +00:00
|
|
|
AC_ARG_WITH(lcov,
|
2009-12-31 18:13:15 +00:00
|
|
|
[ --with-lcov[=PROGRAM] enable gtest and coverage target using the specified lcov], lcov="$withval", lcov="no")
|
2009-12-29 16:07:20 +00:00
|
|
|
|
2009-10-27 00:09:38 +00:00
|
|
|
AC_ARG_WITH(gtest,
|
2009-12-29 14:03:40 +00:00
|
|
|
[ --with-gtest=PATH specify a path to gtest header files (PATH/include) and library (PATH/lib)],
|
2009-10-27 00:09:38 +00:00
|
|
|
gtest_path="$withval", gtest_path="no")
|
2009-12-29 16:07:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
USE_LCOV="no"
|
|
|
|
if test "$lcov" != "no"; then
|
|
|
|
# force gtest if not set
|
|
|
|
if test "$gtest_path" = "no"; then
|
2010-01-26 19:41:22 +00:00
|
|
|
# AC_MSG_ERROR("lcov needs gtest for test coverage report")
|
|
|
|
AC_MSG_NOTICE([gtest support is now enabled, because used by coverage tests])
|
2009-12-29 16:07:20 +00:00
|
|
|
gtest_path="yes"
|
|
|
|
fi
|
|
|
|
if test "$lcov" != "yes"; then
|
2010-01-26 19:41:22 +00:00
|
|
|
LCOV=$lcov
|
2009-12-29 16:07:20 +00:00
|
|
|
else
|
2010-01-26 19:41:22 +00:00
|
|
|
AC_PATH_PROG([LCOV], [lcov])
|
2009-12-29 16:07:20 +00:00
|
|
|
fi
|
2010-01-26 19:41:22 +00:00
|
|
|
if test -x "${LCOV}"; then
|
|
|
|
USE_LCOV="yes"
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([Cannot find lcov.])
|
2009-12-29 16:07:20 +00:00
|
|
|
fi
|
|
|
|
# is genhtml always in the same directory?
|
|
|
|
GENHTML=`echo "$LCOV" | sed s/lcov$/genhtml/`
|
|
|
|
if test ! -x $GENHTML; then
|
|
|
|
AC_MSG_ERROR([genhtml not found, needed for lcov])
|
|
|
|
fi
|
2009-12-31 18:13:15 +00:00
|
|
|
# GCC specific?
|
2010-01-26 19:41:22 +00:00
|
|
|
CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
|
2009-12-31 18:13:15 +00:00
|
|
|
LIBS=" $LIBS -lgcov"
|
2009-12-29 16:07:20 +00:00
|
|
|
AC_SUBST(CPPFLAGS)
|
|
|
|
AC_SUBST(LIBS)
|
|
|
|
AC_SUBST(LCOV)
|
|
|
|
AC_SUBST(GENHTML)
|
|
|
|
fi
|
|
|
|
AC_SUBST(USE_LCOV)
|
|
|
|
|
|
|
|
#
|
2010-01-26 19:41:22 +00:00
|
|
|
# Check availability of gtest, which will be used for unit tests.
|
2009-12-29 16:07:20 +00:00
|
|
|
#
|
2009-10-27 00:09:38 +00:00
|
|
|
if test "$gtest_path" != "no"
|
2009-10-17 00:14:33 +00:00
|
|
|
then
|
2009-12-29 14:03:40 +00:00
|
|
|
if test "$gtest_path" != "yes"; then
|
|
|
|
GTEST_PATHS=$gtest_path
|
2010-01-26 19:41:22 +00:00
|
|
|
if test -x "${gtest_path}/bin/gtest-config" ; then
|
|
|
|
GTEST_CONFIG="${gtest_path}/bin/gtest-config"
|
|
|
|
fi
|
2009-12-29 14:03:40 +00:00
|
|
|
else
|
2010-01-26 19:41:22 +00:00
|
|
|
AC_PATH_PROG([GTEST_CONFIG], [gtest-config])
|
2009-12-29 14:03:40 +00:00
|
|
|
fi
|
2010-01-26 19:41:22 +00:00
|
|
|
if test -x "${GTEST_CONFIG}" ; then :
|
|
|
|
# using cppflags instead of cxxflags
|
|
|
|
GTEST_INCLUDES=`${GTEST_CONFIG} --cppflags`
|
|
|
|
GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags`
|
|
|
|
GTEST_LDADD=`${GTEST_CONFIG} --libs`
|
|
|
|
GTEST_FOUND="true"
|
|
|
|
else
|
|
|
|
AC_MSG_WARN([Unable to locate Google Test gtest-config.])
|
|
|
|
if test -z "${GTEST_PATHS}" ; then
|
|
|
|
GTEST_PATHS="/usr /usr/local"
|
2009-12-29 14:03:40 +00:00
|
|
|
fi
|
2010-01-26 19:41:22 +00:00
|
|
|
GTEST_FOUND="false"
|
|
|
|
fi
|
|
|
|
if test "${GTEST_FOUND}" != "true"; then
|
|
|
|
GTEST_FOUND="false"
|
|
|
|
for dir in $GTEST_PATHS; do
|
|
|
|
if test -f "$dir/include/gtest/gtest.h"; then
|
|
|
|
GTEST_INCLUDES="-I$dir/include"
|
|
|
|
GTEST_LDFLAGS="-L$dir/lib"
|
|
|
|
GTEST_LDADD="-lgtest"
|
|
|
|
GTEST_FOUND="true"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
if test "${GTEST_FOUND}" != "true"; then
|
2009-12-29 14:03:40 +00:00
|
|
|
AC_MSG_ERROR([Cannot find gtest in: $GTEST_PATHS])
|
|
|
|
fi
|
2009-10-17 00:14:33 +00:00
|
|
|
else
|
2009-10-27 00:09:38 +00:00
|
|
|
GTEST_INCLUDES=
|
|
|
|
GTEST_LDFLAGS=
|
|
|
|
GTEST_LDADD=
|
2009-10-17 00:14:33 +00:00
|
|
|
fi
|
2009-10-27 00:09:38 +00:00
|
|
|
AM_CONDITIONAL(HAVE_GTEST, test $gtest_path != "no")
|
|
|
|
AC_SUBST(GTEST_INCLUDES)
|
|
|
|
AC_SUBST(GTEST_LDFLAGS)
|
|
|
|
AC_SUBST(GTEST_LDADD)
|
2009-10-17 00:14:33 +00:00
|
|
|
|
2009-10-16 06:20:23 +00:00
|
|
|
# Checks for library functions.
|
|
|
|
|
|
|
|
AC_CONFIG_FILES([Makefile
|
|
|
|
src/Makefile
|
2009-10-28 23:46:32 +00:00
|
|
|
src/bin/Makefile
|
2009-12-15 18:14:20 +00:00
|
|
|
src/bin/bind10/Makefile
|
2010-01-28 21:36:25 +00:00
|
|
|
src/bin/cmdctl/Makefile
|
2010-01-20 17:46:09 +00:00
|
|
|
src/bin/bindctl/Makefile
|
2010-01-28 21:20:05 +00:00
|
|
|
src/bin/cfgmgr/Makefile
|
2009-10-29 21:49:27 +00:00
|
|
|
src/bin/host/Makefile
|
2009-12-15 18:14:20 +00:00
|
|
|
src/bin/msgq/Makefile
|
2010-01-30 07:39:38 +00:00
|
|
|
src/bin/auth/Makefile
|
2009-10-28 23:46:32 +00:00
|
|
|
src/bin/parkinglot/Makefile
|
2009-10-16 06:20:23 +00:00
|
|
|
src/lib/Makefile
|
2009-10-30 17:28:17 +00:00
|
|
|
src/lib/cc/Makefile
|
|
|
|
src/lib/cc/cpp/Makefile
|
2010-01-28 21:00:50 +00:00
|
|
|
src/lib/cc/python/Makefile
|
2010-02-01 10:48:19 +00:00
|
|
|
src/lib/cc/python/isc/Makefile
|
|
|
|
src/lib/cc/python/isc/cc/Makefile
|
|
|
|
src/lib/cc/python/isc/Util/Makefile
|
2010-01-26 21:33:45 +00:00
|
|
|
src/lib/config/Makefile
|
|
|
|
src/lib/config/cpp/Makefile
|
2010-01-29 00:18:09 +00:00
|
|
|
src/lib/config/python/Makefile
|
|
|
|
src/lib/config/python/isc/Makefile
|
|
|
|
src/lib/config/python/isc/config/Makefile
|
2009-10-27 23:31:26 +00:00
|
|
|
src/lib/dns/Makefile
|
2010-01-26 22:15:42 +00:00
|
|
|
src/lib/dns/cpp/Makefile
|
2010-01-30 07:39:38 +00:00
|
|
|
src/lib/auth/Makefile
|
|
|
|
src/lib/auth/cpp/Makefile
|
2009-10-27 23:31:26 +00:00
|
|
|
])
|
2010-01-29 01:41:02 +00:00
|
|
|
AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
|
|
|
|
src/bin/cfgmgr/run_b10-cfgmgr.sh
|
2010-01-29 01:02:47 +00:00
|
|
|
src/bin/cmdctl/b10-cmdctl.py
|
|
|
|
src/bin/cmdctl/run_b10-cmdctl.sh
|
2010-01-29 00:30:15 +00:00
|
|
|
src/bin/bind10/bind10.py
|
2010-01-19 14:43:19 +00:00
|
|
|
src/bin/bind10/bind10_test
|
2010-01-29 00:30:15 +00:00
|
|
|
src/bin/bind10/run_bind10.sh
|
2010-01-26 22:06:30 +00:00
|
|
|
src/bin/bindctl/bindctl
|
2010-01-28 23:47:18 +00:00
|
|
|
src/bin/bindctl/unittest/bindctl_test
|
2010-01-29 01:02:47 +00:00
|
|
|
src/bin/msgq/msgq.py
|
2010-01-26 21:33:45 +00:00
|
|
|
src/bin/msgq/msgq_test
|
2010-01-29 01:02:47 +00:00
|
|
|
src/bin/msgq/run_msgq.sh
|
2010-01-30 07:39:38 +00:00
|
|
|
src/bin/auth/config.h
|
2009-11-23 09:41:58 +00:00
|
|
|
src/bin/parkinglot/config.h
|
2010-02-03 12:08:19 +00:00
|
|
|
src/lib/config/cpp/data_def_unittests_config.h
|
2010-02-04 12:13:46 +00:00
|
|
|
src/lib/config/python/isc/config/config_test
|
2010-01-29 09:36:01 +00:00
|
|
|
src/lib/dns/cpp/gen-rdatacode.py
|
2009-10-30 22:09:40 +00:00
|
|
|
], [
|
2010-01-29 01:41:02 +00:00
|
|
|
chmod +x src/bin/cfgmgr/run_b10-cfgmgr.sh
|
2010-01-29 01:02:47 +00:00
|
|
|
chmod +x src/bin/cmdctl/run_b10-cmdctl.sh
|
|
|
|
chmod +x src/bin/bind10/run_bind10.sh
|
2010-01-26 22:06:30 +00:00
|
|
|
chmod +x src/bin/bindctl/bindctl
|
2010-01-29 01:02:47 +00:00
|
|
|
chmod +x src/bin/msgq/run_msgq.sh
|
2009-12-03 08:56:12 +00:00
|
|
|
chmod +x src/bin/msgq/msgq_test
|
2010-01-29 09:36:01 +00:00
|
|
|
chmod +x src/lib/dns/cpp/gen-rdatacode.py
|
2009-10-30 20:51:37 +00:00
|
|
|
])
|
2009-10-16 06:20:23 +00:00
|
|
|
AC_OUTPUT
|