automake build system fix: make dist always creates same dist regardless of configure parameters, test/Makefile.am made more clear

This commit is contained in:
roman_rybalko 2008-09-02 11:14:10 +00:00
parent c88071ae10
commit f9f7b689a3
5 changed files with 49 additions and 82 deletions

View File

@ -1,5 +1,6 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = include @ZLIBDIR@ src @EXAMPLESDIR@ @TESTSDIR@
#DISTCHECK_CONFIGURE_FLAGS = --enable-tests
SUBDIRS = include zlib src examples test
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

@ -292,18 +292,16 @@ case "$zlib" in
esac
if [[ "$zlib" = "shipped" ]]; then
ZLIB="\$(top_builddir)/zlib/libzlib.la"
ZLIBDIR="zlib"
AM_CONDITIONAL([ENABLE_SHIPPED_ZLIB], true)
ZLIBINCL="-I\$(top_srcdir)/zlib"
AC_CONFIG_FILES(zlib/Makefile)
elif [[ "$zlib" = "system" ]]; then
ZLIB="-lz"
ZLIBDIR=""
AM_CONDITIONAL([ENABLE_SHIPPED_ZLIB], false)
ZLIBINCL=""
fi
dnl make ZLIB and ZLIBDIR visible to Makefiles
AC_SUBST([ZLIB])
AC_SUBST([ZLIBDIR])
AC_SUBST([ZLIBINCL])
dnl Check whether the examples should be build
@ -318,23 +316,21 @@ AC_MSG_CHECKING([if the examples should be build])
case "$examples" in
"yes")
AC_MSG_RESULT(yes)
EXAMPLESDIR="examples"
AM_CONDITIONAL([ENABLE_EXAMPLES], true)
;;
"no")
AC_MSG_RESULT(no)
EXAMPLESDIR=""
AM_CONDITIONAL([ENABLE_EXAMPLES], false)
;;
"")
AC_MSG_RESULT(yes (default))
EXAMPLESDIR="examples"
AM_CONDITIONAL([ENABLE_EXAMPLES], true)
;;
*)
AC_MSG_RESULT()
AC_MSG_ERROR([Unknown --enable-examples option "$examples". Use either "yes" or "no".])
;;
esac
dnl make $examples visible to Makefiles
AC_SUBST([EXAMPLESDIR])
dnl Check whether the tests should be build
AC_ARG_ENABLE(
@ -348,23 +344,21 @@ AC_MSG_CHECKING([if test files should be build])
case "$tests" in
"yes")
AC_MSG_RESULT(yes)
TESTSDIR="test"
AM_CONDITIONAL([ENABLE_TESTS], true)
;;
"no")
AC_MSG_RESULT(no)
TESTSDIR=""
AM_CONDITIONAL([ENABLE_TESTS], false)
;;
"")
AC_MSG_RESULT(yes (default))
TESTSDIR="test"
AM_CONDITIONAL([ENABLE_TESTS], true)
;;
*)
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
@ -398,11 +392,4 @@ AC_SUBST(DEBUGFLAGS)
dnl Compile time options.
AC_SUBST(COMPILETIME_OPTIONS)
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
AC_OUTPUT([Makefile src/Makefile include/Makefile zlib/Makefile examples/Makefile test/Makefile libtorrent-rasterbar.pc])

View File

@ -1,5 +1,8 @@
if ENABLE_EXAMPLES
# no indent here! - BSD make issue
bin_PROGRAMS = @CLIENT_TEST_BIN@ dump_torrent make_torrent simple_client enum_if
EXTRA_PROGRAMS = client_test
endif
EXTRA_PROGRAMS = client_test dump_torrent make_torrent simple_client enum_if
EXTRA_DIST = Jamfile
client_test_SOURCES = client_test.cpp

View File

@ -1,70 +1,43 @@
check_PROGRAMS = test_hasher test_bencoding test_ip_filter test_piece_picker \
test_programs = test_hasher test_bencoding test_ip_filter test_piece_picker \
test_storage test_metadata_extension test_buffer test_swarm test_pe_crypto test_primitives \
test_bandwidth_limiter test_upnp test_fast_extension test_pex test_web_seed \
test_http_connection test_torrent test_transfer test_lsd
if ENABLE_TESTS
# no indent here! - BSD make issue
check_PROGRAMS = $(test_programs)
noinst_LTLIBRARIES = libtest.la
endif
TESTS = $(check_PROGRAMS)
EXTRA_DIST = Jamfile
test_lsd_SOURCES = main.cpp setup_transfer.cpp test_lsd.cpp
test_lsd_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_http_connection_SOURCES = main.cpp setup_transfer.cpp test_http_connection.cpp
test_http_connection_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_web_seed_SOURCES = main.cpp setup_transfer.cpp test_web_seed.cpp
test_web_seed_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_pex_SOURCES = main.cpp setup_transfer.cpp test_pex.cpp
test_pex_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_fast_extension_SOURCES = main.cpp setup_transfer.cpp test_fast_extension.cpp
test_fast_extension_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_upnp_SOURCES = test_upnp.cpp
test_upnp_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_hasher_SOURCES = main.cpp test_hasher.cpp
test_hasher_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_bencoding_SOURCES = main.cpp test_bencoding.cpp
test_bencoding_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_ip_filter_SOURCES = main.cpp test_ip_filter.cpp
test_ip_filter_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_piece_picker_SOURCES = main.cpp test_piece_picker.cpp
test_piece_picker_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_storage_SOURCES = main.cpp setup_transfer.cpp test_storage.cpp
test_storage_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_buffer_SOURCES = main.cpp test_buffer.cpp
test_buffer_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_metadata_extension_SOURCES = main.cpp setup_transfer.cpp test_metadata_extension.cpp
test_metadata_extension_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_swarm_SOURCES = main.cpp setup_transfer.cpp test_swarm.cpp
test_swarm_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_pe_crypto_SOURCES = main.cpp setup_transfer.cpp test_pe_crypto.cpp
test_pe_crypto_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_primitives_SOURCES = main.cpp test_primitives.cpp
test_primitives_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_bandwidth_limiter_SOURCES = main.cpp test_bandwidth_limiter.cpp
test_bandwidth_limiter_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_torrent_SOURCES = main.cpp test_torrent.cpp
test_torrent_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
test_transfer_SOURCES = main.cpp test_transfer.cpp
test_transfer_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
EXTRA_PROGRAMS = $(test_programs)
noinst_HEADERS = test.hpp setup_transfer.hpp
libtest_la_SOURCES = main.cpp setup_transfer.cpp
test_lsd_SOURCES = test_lsd.cpp
test_http_connection_SOURCES = test_http_connection.cpp
test_web_seed_SOURCES = test_web_seed.cpp
test_pex_SOURCES = test_pex.cpp
test_fast_extension_SOURCES = test_fast_extension.cpp
test_upnp_SOURCES = test_upnp.cpp
test_hasher_SOURCES = test_hasher.cpp
test_bencoding_SOURCES = test_bencoding.cpp
test_ip_filter_SOURCES = test_ip_filter.cpp
test_piece_picker_SOURCES = test_piece_picker.cpp
test_storage_SOURCES = test_storage.cpp
test_buffer_SOURCES = test_buffer.cpp
test_metadata_extension_SOURCES = test_metadata_extension.cpp
test_swarm_SOURCES = test_swarm.cpp
test_pe_crypto_SOURCES = test_pe_crypto.cpp
test_primitives_SOURCES = test_primitives.cpp
test_bandwidth_limiter_SOURCES = test_bandwidth_limiter.cpp
test_torrent_SOURCES = test_torrent.cpp
test_transfer_SOURCES = test_transfer.cpp
LDADD = $(top_builddir)/src/libtorrent-rasterbar.la libtest.la
AM_CXXFLAGS=-ftemplate-depth-50 -I$(top_srcdir)/include -I$(top_srcdir)/include/libtorrent @DEBUGFLAGS@ @PTHREAD_CFLAGS@ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION
AM_LDFLAGS= @BOOST_SYSTEM_LIB@ @BOOST_IOSTREAMS_LIB@ @BOOST_DATE_TIME_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @PTHREAD_LIBS@ @SSL_LDFLAGS@ @SSL_LIBS@

View File

@ -1,4 +1,7 @@
if ENABLE_SHIPPED_ZLIB
# no indent here! - BSD make issue
noinst_LTLIBRARIES = libzlib.la
endif
libzlib_la_SOURCES = adler32.c compress.c crc32.c deflate.c \
gzio.c infback.c inffast.c inflate.c \