From 14eafb48f5c1ffce875b6a0940bf74f95986c9c7 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Tue, 6 Sep 2016 01:44:16 +0200 Subject: [PATCH] build: add flags to disable unwanted builds For now the flags are: --disable-doc --disable-test --disable-samples --disable-tutorial. --- configure.ac | 13 +++++++++++++ doc/Makefile.am | 3 ++- doc/samples/Makefile.am | 2 ++ doc/samples/math/Makefile.am | 2 ++ doc/samples/meshviewer/Makefile.am | 2 ++ doc/samples/sandbox/Makefile.am | 2 ++ doc/tutorial/Makefile.am | 2 ++ src/t/Makefile.am | 2 ++ 8 files changed, 27 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5efa0cfe..198ec057 100644 --- a/configure.ac +++ b/configure.ac @@ -91,6 +91,13 @@ AC_ARG_ENABLE(release, [ --enable-release build final release of the game (default no)]) AC_ARG_ENABLE(experimental, [ --enable-experimental experimental build (default no)]) + +AC_ARG_ENABLE(test, + [ --enable-test build test suite (default yes)]) +AC_ARG_ENABLE(tutorial, + [ --enable-tutorial build tutorial applications (default yes)]) +AC_ARG_ENABLE(samples, + [ --enable-samples build sample applications (default yes)]) AC_ARG_ENABLE(doc, [ --enable-doc build documentation (needs doxygen and LaTeX)]) @@ -236,6 +243,12 @@ dnl Can we build neercs? AM_CONDITIONAL(BUILD_NEERCS, test "${ac_cv_my_have_caca}" != "no") +dnl Optional features +AM_CONDITIONAL(BUILD_TEST, test "${enable_test}" != "no") +AM_CONDITIONAL(BUILD_TUTORIAL, test "${enable_tutorial}" != "no") +AM_CONDITIONAL(BUILD_SAMPLES, test "${enable_samples}" != "no") + + dnl Should we ship non-free data? AM_CONDITIONAL(HAVE_NONFREE, true) diff --git a/doc/Makefile.am b/doc/Makefile.am index 13a68544..63c641e5 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -60,6 +60,7 @@ endif $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 uninstall-local: - rm -f $(DESTDIR)$(datadir)/doc/libcucul-dev + rmdir $(DESTDIR)$(datadir)/doc/lolengine-dev/html 2>/dev/null || true + rmdir $(DESTDIR)$(datadir)/doc/lolengine-dev 2>/dev/null || true rmdir $(DESTDIR)$(datadir)/doc 2>/dev/null || true diff --git a/doc/samples/Makefile.am b/doc/samples/Makefile.am index 5379a336..0769bbf0 100644 --- a/doc/samples/Makefile.am +++ b/doc/samples/Makefile.am @@ -6,7 +6,9 @@ SUBDIRS = math meshviewer sandbox bench: benchsuite$(EXEEXT) ./benchsuite$(EXEEXT) +if BUILD_SAMPLES noinst_PROGRAMS = benchsuite btphystest nacl_phystest simplex +endif benchsuite_SOURCES = benchsuite.cpp \ benchmark/vector.cpp benchmark/half.cpp benchmark/trig.cpp \ diff --git a/doc/samples/math/Makefile.am b/doc/samples/math/Makefile.am index 65d88a2f..619d7a8c 100644 --- a/doc/samples/math/Makefile.am +++ b/doc/samples/math/Makefile.am @@ -1,7 +1,9 @@ include $(top_srcdir)/build/autotools/common.am +if BUILD_SAMPLES noinst_PROGRAMS = pi poly +endif pi_SOURCES = pi.cpp pi_CPPFLAGS = $(AM_CPPFLAGS) diff --git a/doc/samples/meshviewer/Makefile.am b/doc/samples/meshviewer/Makefile.am index 3154c053..d8146947 100644 --- a/doc/samples/meshviewer/Makefile.am +++ b/doc/samples/meshviewer/Makefile.am @@ -1,7 +1,9 @@ include $(top_srcdir)/build/autotools/common.am +if BUILD_SAMPLES noinst_PROGRAMS = meshviewer +endif meshviewer_SOURCES = meshviewer.cpp meshviewer.h \ scenesetup.cpp scenesetup.h \ diff --git a/doc/samples/sandbox/Makefile.am b/doc/samples/sandbox/Makefile.am index 83e43d8d..8a72b0ab 100644 --- a/doc/samples/sandbox/Makefile.am +++ b/doc/samples/sandbox/Makefile.am @@ -1,7 +1,9 @@ include $(top_srcdir)/build/autotools/common.am +if BUILD_SAMPLES bin_PROGRAMS = sample +endif sample_SOURCES = sample.cpp sample_CPPFLAGS = $(AM_CPPFLAGS) diff --git a/doc/tutorial/Makefile.am b/doc/tutorial/Makefile.am index 109e2775..78d33d9d 100644 --- a/doc/tutorial/Makefile.am +++ b/doc/tutorial/Makefile.am @@ -1,9 +1,11 @@ include $(top_srcdir)/build/autotools/common.am +if BUILD_TUTORIAL noinst_PROGRAMS = 01_triangle 02_cube 03_noise 04_texture 05_easymesh \ 06_sprite 07_input 08_fbo 11_fractal \ 12_voronoi 13_shader_builder 14_lol_lua +endif 01_triangle_SOURCES = 01_triangle.cpp 01_triangle.lolfx 01_triangle_CPPFLAGS = $(AM_CPPFLAGS) diff --git a/src/t/Makefile.am b/src/t/Makefile.am index fe6d607d..6514e52f 100644 --- a/src/t/Makefile.am +++ b/src/t/Makefile.am @@ -1,9 +1,11 @@ include $(top_srcdir)/build/autotools/common.am +if BUILD_TEST noinst_PROGRAMS = $(testsuite) TESTS = $(testsuite) +endif # Conditionally built for now because of STLport issues if !LOL_USE_ANDROID