--- embedaddon/dhcp/configure.ac 2012/02/21 22:30:18 1.1 +++ embedaddon/dhcp/configure.ac 2012/10/09 09:06:54 1.1.1.1 @@ -1,4 +1,4 @@ -AC_INIT([DHCP], [4.1-ESV-R4], [dhcp-users@isc.org]) +AC_INIT([DHCP], [4.1-ESV-R7], [dhcp-users@isc.org]) # we specify "foreign" to avoid having to have the GNU mandated files, # like AUTHORS, COPYING, and such @@ -50,7 +50,8 @@ AC_DEFINE_UNQUOTED([DHCP_BYTE_ORDER], [$byte_order], # Optional compile-time DEBUGging. AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], - [create a debug-only version of the software (default is no).])) + [create a debug-only version of the software (default is no).]), + [enable_debug=yes],[enable_debug=no]) # This is very much off by default. if test "$enable_debug" = "yes" ; then AC_DEFINE([DEBUG], [1], @@ -150,7 +151,7 @@ if test "$enable_early_chroot" = "yes" ; then [Define to any value to chroot() prior to loading config.]) fi -AC_ARG_ENABLE(IPv4_PKTINFO, +AC_ARG_ENABLE(ipv4_pktinfo, AC_HELP_STRING([--enable-ipv4-pktinfo], [enable use of pktinfo on IPv4 sockets (default is no)])) @@ -159,7 +160,7 @@ if test "$enable_ipv4_pktinfo" = "yes"; then [Define to 1 to enable IPv4 packet info support.]) fi -AC_ARG_ENABLE(USE_SOCKETS, +AC_ARG_ENABLE(use_sockets, AC_HELP_STRING([--enable-use-sockets], [use the standard BSD socket API (default is no)])) @@ -168,6 +169,44 @@ if test "$enable_use_sockets" = "yes"; then [Define to 1 to use the standard BSD socket API.]) fi +# Testing section + +atf_path="no" +AC_ARG_WITH([atf], + AC_HELP_STRING([--with-atf=PATH], + [specify location where atf was installed]), + [atf_path="$withval"]) +if test "$atf_path" != "no" ; then + # Config path for pkg-config + atf_pcp="" + if test "$atf_path" != "yes" ; then + if test -f $atf_path/lib/pkgconfig/atf-c.pc ; then + atf_pcp=$atf_path/lib/pkgconfig + fi + else + # Not specified, try some common paths + atf_dirs="/usr /usr/local /usr/pkg /opt /opt/local" + for d in $atf_dirs + do + if test -f $d/lib/pkgconfig/atf-c.pc ; then + atf_pcp=$d/lib/pkgconfig + fi + done + fi + if test "$atf_pcp" = "" ; then + AC_MSG_ERROR([Unable to find atf files in location specified]) + else + ATF_CFLAGS="`PKG_CONFIG_PATH=$atf_pcp pkg-config --cflags atf-c` -DUNIT_TEST" + ATF_LDFLAGS="`PKG_CONFIG_PATH=$atf_pcp pkg-config --libs atf-c`" + AC_SUBST(ATF_CFLAGS) + AC_SUBST(ATF_LDFLAGS) + fi +fi + +AM_CONDITIONAL(HAVE_ATF, test "$atf_pcp" != "") +### Uncomment this once docs.lab.isc.org upgrades to automake 1.11 +### AM_COND_IF([HAVE_ATF], [AC_DEFINE([HAVE_ATF], [1], [ATF framework specified?])]) + ### ### Path fun. Older versions of DHCP were installed in /usr/sbin, so we ### need to look there and potentially overwrite by default (but not if @@ -403,7 +442,7 @@ else AC_CHECK_HEADER(net/bpf.h, DO_BPF=1) if test -n "$DO_BPF" then - AC_DEFINE([HAVE_BPF], [""], + AC_DEFINE([HAVE_BPF], [1], [Define to 1 to use the Berkeley Packet Filter interface code.]) fi @@ -453,6 +492,18 @@ AC_TRY_LINK( [Define to 1 if the system has 'struct if_laddrreq'.])], [AC_MSG_RESULT(no)]) +# +# check for GCC noreturn attribute +# +AC_MSG_CHECKING(for GCC noreturn attribute) +AC_TRY_COMPILE([],[void foo() __attribute__((noreturn));], + [AC_MSG_RESULT(yes) + AC_DEFINE([ISC_DHCP_NORETURN], [__attribute__((noreturn))], + [Define to the string for a noreturn attribute.])], + [AC_MSG_RESULT(no) + AC_DEFINE([ISC_DHCP_NORETURN], [], + [Define to the string for a noreturn attribute.])]) + # Look for optional headers. AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h) @@ -488,7 +539,7 @@ AC_CHECK_SIZEOF(struct iaddr *, , [ #include ]) -# Solaris does not have the msg_control or msg_controlen members in +# Solaris does not have the msg_control or msg_controlen members # in the msghdr structure unless you define: # # _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED, and __EXTENSIONS__ @@ -535,5 +586,45 @@ AC_OUTPUT([ relay/Makefile server/Makefile tests/Makefile + server/tests/Makefile + doc/devel/doxyfile ]) +cat > config.report << END + + ISC DHCP source configure results: + -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +Package: + Name: $PACKAGE_NAME + Version: $PACKAGE_VERSION + +C Compiler: $CC + +Flags: + DEFS: $DEFS + CFLAGS: $CFLAGS + +Features: + debug: $enable_debug + failover: $enable_failover + execute: $enable_execute + +Developer: + ATF unittests : $atf_path + +END +# TODO: Add Perl system tests + +if test "$atf_path" != "no" +then +echo "ATF_CFLAGS : $ATF_CFLAGS" >> config.report +echo "ATF_LDFLAGS : $ATF_LDFLAGS" >> config.report +echo +fi + +cat config.report + +echo +echo Now you can type "make" to build ISC DHCP +echo