From: Tomek Mrugalski Date: Tue, 31 Jan 2012 15:35:25 +0000 (+0000) Subject: Support for ATF added in configure.ac X-Git-Tag: v4_3_0a1~77^2~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2898f89e821d4af09a7e6bc5ae290b4a2bdeb5ff;p=thirdparty%2Fdhcp.git Support for ATF added in configure.ac --- diff --git a/configure.ac b/configure.ac index 91c207e05..e2af932be 100644 --- a/configure.ac +++ b/configure.ac @@ -168,6 +168,33 @@ if test "$enable_use_sockets" = "yes"; then [Define to 1 to use the standard BSD socket API.]) fi +# Testing section + +# Enable ATF unit tests (Automated Test Framework) +AC_ARG_ENABLE(atf, + AC_HELP_STRING([--enable-atf], + [enable support for ATF unit-tests (default is no)]), + [if test "$enableval" = "yes"; then + enable_atf=yes + else + enable_atf=no + fi], + [enable_atf=no]) + +# TODO: Check if atf-run is actually available. If it is not, abort +# configuration. +if test "$enable_atf" != "no"; then + ATF_CFLAGS="`pkg-config --cflags atf-c` -DUNIT_TEST" + ATF_LDFLAGS="`pkg-config --libs-only-l --libs-only-other atf-c`" + ATF_LIBS="`pkg-config --libs-only-l atf-c`" +fi +AM_CONDITIONAL(HAVE_ATF, test "$enable_atf" != "no") +AC_SUBST(ATF_CFLAGS) +AC_SUBST(ATF_LDFLAGS) +AC_SUBST(ATF_LIBS) +# TODO: Not sure if LDFLAGS and LIBS should stay separate or not. +# That was FAQ recommends: http://www.netbsd.org/~jmmv/atf/docs/faq.html + ### ### 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 @@ -585,6 +612,48 @@ AC_OUTPUT([ relay/Makefile server/Makefile tests/Makefile + server/tests/Makefile ]) sh util/bindvar.sh + +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 : $enable_atf + +END +# TODO: Add unit tests +# TODO: Add Perl system tests + +if test "$enable_atf" != "no" +then +echo "ATF_CFLAGS : $ATF_CFLAGS" >> config.report +echo "ATF_LDFLAGS : $ATF_LDFLAGS" >> config.report +echo "ATF_LIBS : $ATF_LIBS" >> config.report +echo +fi + +cat config.report + +echo +echo Now you can type "make" to build ISC DHCP +echo