Added --enable-tests option to configure script.

This commit is contained in:
cg25 2008-07-02 23:23:55 +00:00
parent 66a7f98d84
commit f09b9c6252
2 changed files with 35 additions and 2 deletions

View File

@ -1,5 +1,5 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = include @ZLIBDIR@ src @EXAMPLESDIR@ test
SUBDIRS = include @ZLIBDIR@ src @EXAMPLESDIR@ @TESTSDIR@
EXTRA_DIST = autotool.sh docs/manual.html docs/manual.rst docs/extension_protocol.rst \
docs/extension_protocol.html \
docs/projects.rst docs/projects.html \

View File

@ -336,6 +336,36 @@ esac
dnl make $examples visible to Makefiles
AC_SUBST([EXAMPLESDIR])
dnl Check whether the tests should be build
AC_ARG_ENABLE(
[tests],
AS_HELP_STRING([--enable-tests],[Build test files. Default is not to build them.]),
[[tests=$enableval]],
[[tests=no]]
)
dnl Check the value of the --with-tests switch
AC_MSG_CHECKING([if test files should be build])
case "$tests" in
"yes")
AC_MSG_RESULT(yes)
TESTSDIR="test"
;;
"no")
AC_MSG_RESULT(no)
TESTSDIR=""
;;
"")
AC_MSG_RESULT(yes (default))
TESTSDIR="test"
;;
*)
AC_MSG_RESULT()
AC_MSG_ERROR([Unknown --enable-tests option "$examples". Use either "yes" or "no".])
;;
esac
dnl make $examples visible to Makefiles
AC_SUBST([TESTSDIR])
dnl Set some defines if we are building a shared library
if [[ "x$enable_shared" == "xyes" ]]; then
AC_DEFINE(TORRENT_BUILDING_SHARED,,[Make sure the functions and classes are exported.])
@ -368,8 +398,11 @@ AC_SUBST(DEBUGFLAGS)
dnl Compile time options.
AC_SUBST(COMPILETIME_OPTIONS)
AC_CONFIG_FILES(Makefile src/Makefile include/Makefile test/Makefile libtorrent-rasterbar.pc)
AC_CONFIG_FILES(Makefile src/Makefile include/Makefile libtorrent-rasterbar.pc)
if [[ "x$examples" == "xyes" ]]; then
AC_CONFIG_FILES(examples/Makefile)
fi
if [[ "x$tests" == "xyes" ]]; then
AC_CONFIG_FILES(test/Makefile)
fi
AC_OUTPUT