mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-31 14:25:41 +00:00
Stephen's patch for ATF path.
This commit is contained in:
52
configure.ac
52
configure.ac
@@ -170,30 +170,40 @@ fi
|
|||||||
|
|
||||||
# Testing section
|
# Testing section
|
||||||
|
|
||||||
# Enable ATF unit tests (Automated Test Framework)
|
atf_path="no"
|
||||||
AC_ARG_ENABLE(atf,
|
AC_ARG_WITH([atf],
|
||||||
AC_HELP_STRING([--enable-atf],
|
AC_HELP_STRING([--with-atf=PATH],
|
||||||
[enable support for ATF unit-tests (default is no)]),
|
[specify location where atf was installed]),
|
||||||
[if test "$enableval" = "yes"; then
|
[atf_path="$withval"])
|
||||||
enable_atf=yes
|
if test "$atf_path" != "no" ; then
|
||||||
else
|
# Config path for pkg-config
|
||||||
enable_atf=no
|
atf_pcp=""
|
||||||
fi],
|
if test "$atf_path" != "yes" ; then
|
||||||
[enable_atf=no])
|
if test -f $atf_path/lib/pkgconfig/atf-c.pc ; then
|
||||||
|
atf_pcp=$atf_path/lib/pkgconfig
|
||||||
# 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
|
fi
|
||||||
AM_CONDITIONAL(HAVE_ATF, test "$enable_atf" != "no")
|
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_CFLAGS)
|
||||||
AC_SUBST(ATF_LDFLAGS)
|
AC_SUBST(ATF_LDFLAGS)
|
||||||
AC_SUBST(ATF_LIBS)
|
fi
|
||||||
# TODO: Not sure if LDFLAGS and LIBS should stay separate or not.
|
fi
|
||||||
# That was FAQ recommends: http://www.netbsd.org/~jmmv/atf/docs/faq.html
|
|
||||||
|
AM_CONDITIONAL(HAVE_ATF, test "$atf_pcp" != "")
|
||||||
|
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
|
### Path fun. Older versions of DHCP were installed in /usr/sbin, so we
|
||||||
|
Reference in New Issue
Block a user