Commit c328aed8 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[2270] Merge branch 'master' into trac2270

Conflicts:
	ChangeLog
	doc/devel/02-dhcp.dox
	src/bin/dhcp4/ctrl_dhcp4_srv.cc
	src/bin/dhcp4/dhcp4_srv.cc
	src/bin/dhcp4/dhcp4_srv.h
	src/bin/dhcp6/config_parser.cc
	src/bin/dhcp6/config_parser.h
parents de29c071 92758ecf
4XX. [func] tomek
525. [func] tomek
b10-dhcp4: DHCPv4 server is now able to parse configuration. It
is possible to specify IPv4 subnets with dynamic pools within
them. Although configuration is accepted, it is not used yet. This
will be implemented shortly.
(Trac #2270, git de29c07129d41c96ee0d5eebdd30a1ea7fb9ac8a)
524. [func] tomek
b10-dhcp6 is now able to handle RENEW messages. Leases are
renewed and REPLY responses are sent back to clients.
(Trac #2325, git 7f6c9d057cc0a7a10f41ce7da9c8565b9ee85246)
523. [bug] muks
Fixed a problem in inmem NSEC3 lookup (for, instance when using a
zone with no non-apex names) which caused exceptions when the zone
origin was not added as an explicit NSEC3 record.
(Trac #2503, git 6fe86386be0e7598633fe35999112c1a6e3b0370)
522. [func]* jelte
Configuration of TSIG keys for b10-xfrin has changed; instead of
specifying the full TSIG key (<name>:<base64>:<algo>) it now expects
just the name, and uses the global TSIG Key Ring like all the other
components (configuration list /tsig_keys/keys).
Note: this is not automatically updated, so if you use TSIG in
xfrin, you need to update your configuration.
(Trac #1351, git e65b7b36f60f14b7abe083da411e6934cdfbae7a)
521. [func] marcin
Implemented definitions for DHCPv6 standard options identified
by codes up to 48. These definitions are now used by the DHCPv6
server to create instances of options being sent to a client.
(Trac #2491, git 0a4faa07777189ed9c25211987a1a9b574015a95)
520. [func] jelte
The system no longer prints initial log messages to stdout
regardless of what logging configuration is present, but it
temporarily stores any log messages until the configuration is
processed. If there is no specific configuration, or if the
configuration cannot be accessed, it will still fall back to stdout.
Note that there are still a few instances where output is printed,
these shall be addressed separately.
Note also that, currently, in case it falls back to stdout (such as
when it cannot connect to b10-cfgmgr), all log messages are always
printed (including debug messages), regardless of whether -v was
used. This shall also be addressed in a future change.
(Trac #2445, git 74a0abe5a6d10b28e4a3e360e87b129c232dea68)
519. [bug] muks
Fixed a problem in inmem NSEC lookup which caused returning an
incorrect NSEC record or (in rare cases) assert failures
when a non-existent domain was queried, which was a sub-domain of
a domain that existed.
(Trac #2504, git 835553eb309d100b062051f7ef18422d2e8e3ae4)
518. [func] stephen
Extend DHCP MySQL backend to handle IPv4 addresses.
(Trac #2404, git ce7db48d3ff5d5aad12b1da5e67ae60073cb2607)
517. [func] stephen
Added IOAddress::toBytes() to get byte representation of address.
Also added convenience methods for V4/V6 address determination.
(Trac #2396, git c23f87e8ac3ea781b38d688f8f7b58539f85e35a)
516. [bug] marcin
Fixed 'make distcheck' failure when running perfdhcp unit tests.
The unit tests used to read files from the folder specified
with the path relative to current folder, thus when the test was
run from a different folder the files could not be found.
(Trac #2479, git 4e8325e1b309f1d388a3055ec1e1df98c377f383)
515. [bug] jinmei
The in-memory data source now accepts an RRSIG provided without
a covered RRset in loading. A subsequent query for its owner name
of the covered type would generally result in NXRRSET; if the
covered RRset is of type NSEC3, the corresponding NSEC3 processing
would result in SERVFAIL.
(Trac #2420, git 6744c100953f6def5500bcb4bfc330b9ffba0f5f)
514. [bug] jelte
b10-msgq now handles socket errors more gracefully when sending data
to clients. It no longer exits with 'broken pipe' errors, and is
also better at resending data on temporary error codes from send().
(Trac #2398, git 9f6b45ee210a253dca608848a58c824ff5e0d234)
513. [func] marcin
Implemented the OptionCustom class for DHCPv4 and DHCPv6.
This class represents an option which has a defined
structure: a set of data fields of specific types and order.
It is used to represent those options that can't be
represented by any other specialized class.
(Trac #2312, git 28d885b457dda970d9aecc5de018ec1120143a10)
512. [func] jelte
Added a new tool b10-certgen, to check and update the self-signed
SSL certificate used by b10-cmdctl. The original certificate
provided has been removed, and a fresh one is generated upon first
build. See the b10-certgen manpage for information on how to update
existing installed certificates.
(Trac #1044, git 510773dd9057ccf6caa8241e74a7a0b34ca971ab)
511. [bug] stephen
Fixed a race condition in the DHCP tests whereby the test program
spawned a subprocess and attempted to read (without waiting) from
the interconnecting pipe before the subprocess had written
anything. The lack of output was being interpreted as a test
failure.
(Trac #2410, git f53e65cdceeb8e6da4723730e4ed0a17e4646579)
510. [func] marcin
DHCP option instances can be created using a collection of strings.
Each string represents a value of a particular data field within
an option. The data field values, given as strings, are validated
against the actual types of option fields specified in the options
definitions.
(Trac #2490, git 56cfd6612fcaeae9acec4a94e1e5f1a88142c44d)
509. [func] muks
Log messages now include the pid of the process that logged the
message.
(Trac #1745, git fc8bbf3d438e8154e7c2bdd322145a7f7854dc6a)
508. [bug] stephen
Split the DHCP library into two directories, each with its own
Makefile. This properly solves the problem whereby a "make"
operation with multiple threads could fail because of the
dependencies between two libraries in the same directory.
(Trac #2475, git 834fa9e8f5097c6fd06845620f68547a97da8ff8)
bind10-devel-20121115 released on November 15, 2012
507. [doc] jelte
Added a chapter about the use of the bindctl command tool to
to the BIND 10 guide.
(Trac #2305, git c4b0294b5bf4a9d32fb18ab62ca572f492788d72)
506. [security] jinmei
Fixed a use-after-free case in handling DNAME record with the
in-memory data source. This could lead to a crash of b10-auth
if it serves a zone containing a DNAME RR from the in-memory
data source. This bug was introduced at bind10-devel-20120927.
(Trac #2471, git 2b1793ac78f972ddb1ae2fd092a7f539902223ff)
505. [bug] jelte
Fixed a bug in b10-xfrin where a wrong call was made during the
final check of a TSIG-signed transfer, incorrectly rejecting the
transfer.
(Trac #2464, git eac81c0cbebee72f6478bdb5cda915f5470d08e1)
504. [bug]* naokikambe
Fixed an XML format viewed from b10-stats-httpd. Regarding
per-zone counters as zones of Xfrout, a part of the item
values wasn't an exact XML format. A zone name can be
specified in URI as
/bind10/statistics/xml/Xfrout/zones/example.org/xfrreqdone.
XSD and XSL formats are also changed to constant ones due
to these changes.
(Trac #2298, git 512d2d46f3cb431bcdbf8d90af27bff8874ba075)
503. [func] Stephen
Add initial version of a MySQL backend for the DHCP code. This
implements the basic IPv6 lease access functions - add lease, delete
lease and update lease. The backend is enabled by specifying
--with-dhcp-mysql on the "configure" command line: without this
switch, the MySQL code is not compiled, so leaving BIND 10 able to
be built on systems without MySQL installed.
(Trac #2342, git c7defffb89bd0f3fdd7ad2437c78950bcb86ad37)
502. [func] vorner
TTLs can be specified with units as well as number of seconds now.
This allows specifications like "1D3H".
(Trac #2384, git 44c321c37e17347f33ced9d0868af0c891ff422b)
501. [func] tomek
Added DHCPv6 allocation engine, now used in the processing of DHCPv6
messages.
(Trac #2414, git b3526430f02aa3dc3273612524d23137b8f1fe87)
500. [bug] jinmei
Corrected the autoconf example in the examples directory so it can
use the configured path to Boost to check availability of the BIND 10
library. Previously the sample configure script could fail if
Boost is installed in an uncommon place. Also, it now provides a
helper m4 function and example usage for embedding the library
path to executable (using linker options like -Wl,-R) to help
minimize post-build hassles.
(Trac #2356, git 36514ddc884c02a063e166d44319467ce6fb1d8f)
499. [func] team
The b10-auth 'loadzone' command now uses the internal thread
introduced in 495 to (re)load a zone in the background, so that
query processing isn't blocked while loading a zone.
(Trac #2213, git 686594e391c645279cc4a95e0e0020d1c01fba7e)
498. [func] marcin
Implemented DHCPv6 option values configuration using configuration
manager. In order to set values for data fields carried by the
particular option, user specifies the string of hexadecimal digits
that is in turn converted to binary data and stored into option
buffer. More user friendly way of option content specification is
planned.
(Trac #2318, git e75c686cd9c14f4d6c2a242a0a0853314704fee9)
497. [bug] jinmei
Fixed several issues in isc-sysinfo:
- make sure it doesn't report a negative value for free memory
size (this happened on FreeBSD, but can possibly occur on other
BSD variants)
- correctly identifies the SMP support in kernel on FreeBSD
- print more human readable uptime as well as the time in seconds
(Trac #2297, git 59a449f506948e2371ffa87dcd19059388bd1657)
496. [func] tomek
DHCPv6 Allocation Engine implemented. It allows address allocation
from the configured subnets/pools. It currently features a single
allocator: IterativeAllocator, which assigns addresses iteratively.
Other allocators (hashed, random) are planned.
(Trac #2324, git 8aa188a10298e3a55b725db36502a99d2a8d638a)
495. [func] team
b10-auth now handles reconfiguration of data sources in
background using a separate thread. This means even if the new
configuration includes a large amount of data to be loaded into
memory (very large zones and/or a very large number of zones),
the reconfiguration doesn't block query handling.
(Multiple Trac tickets up to #2211)
494. [bug] jinmei
Fixed a problem that shutting down BIND 10 kept some of the
processes alive. It was two-fold: when the main bind10 process
started as a root, started b10-sockcreator with the privilege, and
then dropped the privilege, the bind10 process cannot kill the
sockcreator via signal any more (when it has to), but it kept
sending the signal and didn't stop. Also, when running on Python
3.1 (or older), the sockcreator had some additional file
descriptor open, which prevented it from exiting even after the
bind10 process terminated. Now the bind10 process simply gives up
killing a subprocess if it fails due to lack of permission, and it
makes sure the socket creator is spawned without any unnecessary
FDs open.
(Trac #1858, git 405d85c8a0042ba807a3a123611ff383c4081ee1)
493. [build] jinmei
Fixed build failure with newer versions of clang++. These
versions are stricter regarding "unused variable" and "unused
(driver) arguments" warnings, and cause fatal build error
with -Werror. The affected versions of clang++ include Apple's
customized version 4.1 included in Xcode 4.5.1. So this fix
will solve build errors for Mac OS X that uses newer versions of
Xcode.
(Trac #2340, git 55be177fc4f7537143ab6ef5a728bd44bdf9d783,
3e2a372012e633d017a97029d13894e743199741 and commits before it
with [2340] in the commit log)
492. [func] tomek
libdhcpsrv: The DHCP Configuration Manager is now able to store
......@@ -33,7 +280,7 @@
488. [build] jinmei
On configure, changed the search order for Python executable.
It first ties more specific file names such as "python3.2" before
It first tries more specific file names such as "python3.2" before
more generic "python3". This will prevent configure failure on
Mac OS X that installs Python3 via recent versions of Homebrew.
(Trac #2339, git 88db890d8d1c64de49be87f03c24a2021bcf63da)
......
ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS}
ACLOCAL_AMFLAGS = -I m4macros -I examples/m4 ${ACLOCAL_FLAGS}
# ^^^^^^^^ This has to be the first line and cannot come later in this
# Makefile.am due to some bork in some versions of autotools.
......@@ -20,6 +20,13 @@ dist_doc_DATA = AUTHORS COPYING ChangeLog README
.PHONY: check-valgrind check-valgrind-suppress
install-exec-hook:
-@echo -e "\033[1;33m" # switch to yellow color text
@echo "NOTE: BIND 10 does not automatically start DNS services when it is run"
@echo " in its default configuration. Please see the Guide for information"
@echo " on how to configure these services to be started automatically."
-@echo -e "\033[m" # switch back to normal
check-valgrind:
if HAVE_VALGRIND
@VALGRIND_COMMAND="$(VALGRIND) -q --gen-suppressions=all --track-origins=yes --num-callers=48 --leak-check=full --fullpath-after=" \
......
This is the source for the development version of BIND 10.
This is the source for the BIND 10 suite.
BIND is the popular implementation of a DNS server, developer
interfaces, and DNS tools. BIND 10 is a rewrite of BIND 9 and ISC
DHCP. BIND 10 is written in C++ and Python and provides a modular
environment for serving, maintaining, and developing DNS and DHCP.
BIND10-devel is new development leading up to the production
BIND 10 release. It contains prototype code and experimental
interfaces. Nevertheless it is ready to use now for testing the
new BIND 10 infrastructure ideas.
This release includes the bind10 master process, b10-msgq message
bus, b10-auth authoritative DNS server (with SQLite3 and in-memory
backends), b10-resolver recursive or forwarding DNS server, b10-cmdctl
......@@ -62,3 +57,8 @@ For operating system specific tips see the wiki at:
http://bind10.isc.org/wiki/SystemSpecificNotes
Please see the wiki and the doc/ directory for various documentation.
The BIND 10 suite is started by running "bind10". Note that the default
configuration does not start any DNS or DHCP services. Please see the
Guide for information on how to configure these services to be started
automatically.
......@@ -12,6 +12,20 @@ AC_CONFIG_MACRO_DIR([m4macros])
# Checks for programs.
AC_PROG_CXX
# Enable low-performing debugging facilities? This option optionally
# enables some debugging aids that perform slowly and hence aren't built
# by default.
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug],
[enable debugging (default is no)]),
[case "${enableval}" in
yes) debug_enabled=yes ;;
no) debug_enabled=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac],[debug_enabled=no])
AM_CONDITIONAL([DEBUG_ENABLED], [test x$debug_enabled = xyes])
AM_COND_IF([DEBUG_ENABLED], [AC_DEFINE([ENABLE_DEBUG], [1], [Enable low-performing debugging facilities?])])
# Libtool configuration
#
......@@ -50,25 +64,109 @@ AM_CONDITIONAL(USE_CLANGPP, test "X${CLANGPP}" = "Xyes")
# Linker options
# check -R and -Wl,-R rather than gcc specific -rpath to be as portable
# as possible.
AC_MSG_CHECKING([whether -R flag is available in linker])
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS -R/usr/lib"
AC_TRY_LINK([],[],
[ AC_MSG_RESULT(yes)
rpath_flag=-R
],[ AC_MSG_RESULT(no)
AC_MSG_CHECKING([whether -Wl,-R flag is available in linker])
LDFLAGS="$LDFLAGS_SAVED -Wl,-R"
AC_TRY_LINK([], [],
[ AC_MSG_RESULT(yes)
rpath_flag=-Wl,-R
],[ AC_MSG_RESULT(no)
rpath_flag=no
])
])
LDFLAGS=$LDFLAGS_SAVED
# check -R, "-Wl,-R" or -rpath (we share the AX function defined in
# examples/m4)
AX_ISC_RPATH
# Compiler dependent settings: define some mandatory CXXFLAGS here.
# We also use a separate variable B10_CXXFLAGS. This will (and should) be
# used as the default value for each specific AM_CXXFLAGS:
# AM_CXXFLAGS = $(B10_CXXFLAGS)
# AM_CXXFLAGS += ... # add module specific flags
# We need this so that we can disable some specific compiler warnings per
# module basis; since AM_CXXFLAGS are placed before CXXFLAGS, and since
# gcc's -Wno-XXX option must be specified after -Wall or -Wextra, we cannot
# specify the default warning flags in CXXFLAGS and let specific modules
# "override" the default.
# This may be used to try linker flags.
AC_DEFUN([BIND10_CXX_TRY_FLAG], [
AC_MSG_CHECKING([whether $CXX supports $1])
bind10_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $1"
AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void){ return 0;}])],
[bind10_cxx_flag=yes], [bind10_cxx_flag=no])
CXXFLAGS="$bind10_save_CXXFLAGS"
if test "x$bind10_cxx_flag" = "xyes"; then
ifelse([$2], , :, [$2])
else
ifelse([$3], , :, [$3])
fi
AC_MSG_RESULT([$bind10_cxx_flag])
])
# SunStudio compiler requires special compiler options for boost
# (http://blogs.sun.com/sga/entry/boost_mini_howto)
if test "$SUNCXX" = "yes"; then
CXXFLAGS="$CXXFLAGS -library=stlport4 -features=tmplife -features=tmplrefstatic"
MULTITHREADING_FLAG="-mt"
fi
# Newer versions of clang++ promotes "unused driver arguments" warnings to
# a fatal error with -Werror, causing build failure. Since we use multiple
# compilers on multiple systems, this can easily happen due to settings for
# non clang++ environments that could be just ignored otherwise. It can also
# happen if clang++ is used via ccache. So, although probably suboptimal,
# we suppress this particular warning. Note that it doesn't weaken checks
# on the source code.
if test "$CLANGPP" = "yes"; then
B10_CXXFLAGS="$B10_CXXFLAGS -Qunused-arguments"
fi
BIND10_CXX_TRY_FLAG([-Wno-missing-field-initializers],
[WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG="-Wno-missing-field-initializers"])
AC_SUBST(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)
# gcc specific settings:
if test "X$GXX" = "Xyes"; then
B10_CXXFLAGS="$B10_CXXFLAGS -Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
case "$host" in
*-solaris*)
MULTITHREADING_FLAG=-pthreads
# In Solaris, IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT need -Wno-missing-braces
B10_CXXFLAGS="$B10_CXXFLAGS -Wno-missing-braces"
;;
*)
MULTITHREADING_FLAG=-pthread
;;
esac
# Don't use -Werror if configured not to
AC_ARG_WITH(werror,
AC_HELP_STRING([--with-werror], [Compile using -Werror (default=yes)]),
[
case "${withval}" in
yes) with_werror=1 ;;
no) with_werror=0 ;;
*) AC_MSG_ERROR(bad value ${withval} for --with-werror) ;;
esac],
[with_werror=1])
werror_ok=0
# Certain versions of gcc (g++) have a bug that incorrectly warns about
# the use of anonymous name spaces even if they're closed in a single
# translation unit. For these versions we have to disable -Werror.
if test $with_werror = 1; then
CXXFLAGS_SAVED="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $B10_CXXFLAGS -Werror"
AC_MSG_CHECKING(for in-TU anonymous namespace breakage)
AC_TRY_COMPILE([namespace { class Foo {}; }
namespace isc {class Bar {Foo foo_;};} ],,
[AC_MSG_RESULT(no)
werror_ok=1
B10_CXXFLAGS="$B10_CXXFLAGS -Werror"],
[AC_MSG_RESULT(yes)])
CXXFLAGS="$CXXFLAGS_SAVED"
fi
fi dnl GXX = yes
AM_CONDITIONAL(GCC_WERROR_OK, test $werror_ok = 1)
# allow building programs with static link. we need to make it selective
# because loadable modules cannot be statically linked.
......@@ -103,6 +201,10 @@ case "$host" in
CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
# "now" binding is necessary to prevent deadlocks in C++ static initialization code
LDFLAGS="$LDFLAGS -z now"
# Destroying locked mutexes, condition variables being waited
# on, etc. are undefined behavior on Solaris, so we set it as
# such here.
AC_DEFINE([HAS_UNDEFINED_PTHREAD_BEHAVIOR], [1], [Does this platform have some undefined pthreads behavior?])
;;
*-apple-darwin*)
# Starting with OSX 10.7 (Lion) we must choose which IPv6 API to use
......@@ -214,10 +316,10 @@ fi
# modules, we embed the path to the modules when possible. We do this even
# when the path is known in the common operational environment (e.g. when
# it's stored in a common "hint" file) for simplicity.
if test $rpath_flag != no; then
if test "x$ISC_RPATH_FLAG" != "x"; then
python_rpath=
for flag in ${PYTHON_LDFLAGS}; do
python_rpath="${python_rpath} `echo $flag | sed -ne "s/^\(\-L\)/${rpath_flag}/p"`"
python_rpath="${python_rpath} `echo $flag | sed -ne "s/^\(\-L\)/${ISC_RPATH_FLAG}/p"`"
done
PYTHON_LDFLAGS="${PYTHON_LDFLAGS} ${python_rpath}"
fi
......@@ -256,95 +358,11 @@ fi
# TODO: check for _sqlite3.py module
# Compiler dependent settings: define some mandatory CXXFLAGS here.
# We also use a separate variable B10_CXXFLAGS. This will (and should) be
# used as the default value for each specific AM_CXXFLAGS:
# AM_CXXFLAGS = $(B10_CXXFLAGS)
# AM_CXXFLAGS += ... # add module specific flags
# We need this so that we can disable some specific compiler warnings per
# module basis; since AM_CXXFLAGS are placed before CXXFLAGS, and since
# gcc's -Wno-XXX option must be specified after -Wall or -Wextra, we cannot
# specify the default warning flags in CXXFLAGS and let specific modules
# "override" the default.
# This may be used to try linker flags.
AC_DEFUN([BIND10_CXX_TRY_FLAG], [
AC_MSG_CHECKING([whether $CXX supports $1])
bind10_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $1"
AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void){ return 0;}])],
[bind10_cxx_flag=yes], [bind10_cxx_flag=no])
CXXFLAGS="$bind10_save_CXXFLAGS"
if test "x$bind10_cxx_flag" = "xyes"; then
ifelse([$2], , :, [$2])
else
ifelse([$3], , :, [$3])
fi
AC_MSG_RESULT([$bind10_cxx_flag])
])
# SunStudio compiler requires special compiler options for boost
# (http://blogs.sun.com/sga/entry/boost_mini_howto)
if test "$SUNCXX" = "yes"; then
CXXFLAGS="$CXXFLAGS -library=stlport4 -features=tmplife -features=tmplrefstatic"
MULTITHREADING_FLAG="-mt"
fi
BIND10_CXX_TRY_FLAG([-Wno-missing-field-initializers],
[WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG="-Wno-missing-field-initializers"])
AC_SUBST(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)
# gcc specific settings:
if test "X$GXX" = "Xyes"; then
B10_CXXFLAGS="-Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
case "$host" in
*-solaris*)
MULTITHREADING_FLAG=-pthreads
# In Solaris, IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT need -Wno-missing-braces
B10_CXXFLAGS="$B10_CXXFLAGS -Wno-missing-braces"
;;
*)
MULTITHREADING_FLAG=-pthread
;;
esac
# Don't use -Werror if configured not to
AC_ARG_WITH(werror,
AC_HELP_STRING([--with-werror], [Compile using -Werror (default=yes)]),
[
case "${withval}" in
yes) with_werror=1 ;;
no) with_werror=0 ;;
*) AC_MSG_ERROR(bad value ${withval} for --with-werror) ;;
esac],
[with_werror=1])
werror_ok=0
# Certain versions of gcc (g++) have a bug that incorrectly warns about
# the use of anonymous name spaces even if they're closed in a single
# translation unit. For these versions we have to disable -Werror.
if test $with_werror = 1; then
CXXFLAGS_SAVED="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $B10_CXXFLAGS -Werror"
AC_MSG_CHECKING(for in-TU anonymous namespace breakage)
AC_TRY_COMPILE([namespace { class Foo {}; }
namespace isc {class Bar {Foo foo_;};} ],,
[AC_MSG_RESULT(no)
werror_ok=1
B10_CXXFLAGS="$B10_CXXFLAGS -Werror"],
[AC_MSG_RESULT(yes)])
CXXFLAGS="$CXXFLAGS_SAVED"
fi
# (g++ only check)
# Python 3.2 has an unused parameter in one of its headers. This
# has been reported, but not fixed as of yet, so we check if we need
# to set -Wno-unused-parameter.
if test $werror_ok = 1; then
if test "X$GXX" = "Xyes" -a $werror_ok = 1; then
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS=${PYTHON_INCLUDES}
CXXFLAGS_SAVED="$CXXFLAGS"
......@@ -370,10 +388,6 @@ if test $werror_ok = 1; then
CPPFLAGS="$CPPFLAGS_SAVED"
fi
fi dnl GXX = yes
AM_CONDITIONAL(GCC_WERROR_OK, test $werror_ok = 1)
# produce PIC unless we disable shared libraries. need this for python bindings.
if test $enable_shared != "no" -a "X$GXX" = "Xyes"; then
B10_CXXFLAGS="$B10_CXXFLAGS -fPIC"
......@@ -671,10 +685,10 @@ for flag in ${BOTAN_LIBS}; do
done
# See python_rpath for some info on why we do this
if test $rpath_flag != no; then
if test "x$ISC_RPATH_FLAG" != "x"; then
BOTAN_RPATH=
for flag in ${BOTAN_LIBS}; do
BOTAN_RPATH="${BOTAN_RPATH} `echo $flag | sed -ne "s/^\(\-L\)/${rpath_flag}/p"`"
BOTAN_RPATH="${BOTAN_RPATH} `echo $flag | sed -ne "s/^\(\-L\)/${ISC_RPATH_FLAG}/p"`"
done
AC_SUBST(BOTAN_RPATH)
......@@ -691,7 +705,6 @@ fi
AC_SUBST(BOTAN_LDFLAGS)
AC_SUBST(BOTAN_LIBS)
AC_SUBST(BOTAN_INCLUDES)
# Even though chances are high we already performed a real compilation check
# in the search for the right (pkg)config data, we try again here, to
# be sure.
......@@ -719,6 +732,60 @@ AC_LINK_IFELSE(
CPPFLAGS=$CPPFLAGS_SAVED
LIBS=$LIBS_SAVED
# Check for MySql. The path to the mysql_config program is given with
# the --with-mysql-config (default to /usr/bin/mysql-config). By default,
# the software is not built with MySQL support enabled.
mysql_config="no"
AC_ARG_WITH([dhcp-mysql],
AC_HELP_STRING([--with-dhcp-mysql=PATH],
[path to the MySQL 'mysql_config' script (MySQL is used for the DHCP database)]),
[mysql_config="$withval"])
if test "${mysql_config}" = "yes" ; then
MYSQL_CONFIG="/usr/bin/mysql_config"
elif test "${mysql_config}" != "no" ; then
MYSQL_CONFIG="${withval}"
fi
if test "$MYSQL_CONFIG" != "" ; then
if test -d "$MYSQL_CONFIG" -o ! -x "$MYSQL_CONFIG" ; then
AC_MSG_ERROR([--with-dhcp-mysql should point to a mysql_config program])
fi
MYSQL_CPPFLAGS=`$MYSQL_CONFIG --cflags`