[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] build: nested automake conditionals do work



Revert 1b4e3844e959c8261ba5cab9a0c5c34bcb812344. Automake does
support nested conditionals just fine.

This also fixes the problem:

	./configure: line 15878: ENABLE_ZIP_ARCHIVE_AND_CXX11:
	command not found

caused by bad syntax:

	ENABLE_ZIP_ARCHIVE_AND_CXX11 = yes

(Variable assignments must not use spaces around '=').

	* configure.ac: remove (broken) assignment to the
	ENABLE_ZIP_ARCHIVE_AND_CXX11 variable
	* Makefile.am: replace variable assignments to
	ZIP_ARCHIVE_TESTS_FIRST_PART, ZIP_ARCHIVE_TESTS_SECOND_PART
	by ZIP_ARCHIVE_TESTS using the "+=" automake operator.
	Likewise for CXX11_TESTS.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
---
 configure.ac      |  8 --------
 tests/Makefile.am | 21 +++++++--------------
 2 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/configure.ac b/configure.ac
index 40c8d7d..2d6a59c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -144,14 +144,6 @@ fi
 
 AM_CONDITIONAL(ENABLE_CXX11, test x$ENABLE_CXX11 = xyes)
 
-ENABLE_ZIP_ARCHIVE_AND_CXX11=no
-if test x$ENABLE_CXX11 = xyes -a x$ENABLE_ZIP_ARCHIVE = xyes; then
-   ENABLE_ZIP_ARCHIVE_AND_CXX11 = yes
-fi
-
-AM_CONDITIONAL(ENABLE_ZIP_ARCHIVE_AND_CXX11, test x$ENABLE_ZIP_ARCHIVE_AND_CXX11 = xyes)
-
-
 dnl Check for the presence of doxygen program
 
 if test x$ENABLE_APIDOC != xno; then
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 50ab707..4afaa3a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,26 +1,19 @@
 SUBDIRS = data
 
+ZIP_ARCHIVE_TESTS =
 if ENABLE_ZIP_ARCHIVE
-ZIP_ARCHIVE_TESTS_FIRST_PART = runtestwritereadarchive
-else
-ZIP_ARCHIVE_TESTS_FIRST_PART =
+ZIP_ARCHIVE_TESTS += runtestwritereadarchive
+if ENABLE_CXX11
+ZIP_ARCHIVE_TESTS += runtestdot
+endif
 endif
 
+CXX11_TESTS =
 if ENABLE_CXX11
-CXX11_TESTS = runtestsvg
+CXX11_TESTS += runtestsvg
 AM_CXXFLAGS = "-std=gnu++11"
-else
-CXX11_TESTS =
 endif
 
-if ENABLE_ZIP_ARCHIVE_AND_CXX11
-ZIP_ARCHIVE_TESTS_SECOND_PART = runtestdot
-else
-ZIP_ARCHIVE_TESTS_SECOND_PART =
-endif
-
-ZIP_ARCHIVE_TESTS = $(ZIP_ARCHIVE_TESTS_FIRST_PART) $(ZIP_ARCHIVE_TESTS_SECOND_PART)
-
 TESTS=				\
 runtestreadwrite		\
 $(ZIP_ARCHIVE_TESTS)		\
-- 
2.1.2