<div dir="ltr">This won't work when there's C++ compiler but no 'which', but I think that's ok, since it only affects 1 test.<div><br></div><div>Reviewed-by: Mariusz Ceier <<a href="mailto:mceier%2Bwayland@gmail.com">mceier+wayland@gmail.com</a>></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 December 2014 at 17:40, Marek Chalupa <span dir="ltr"><<a href="mailto:mchqwerty@gmail.com" target="_blank">mchqwerty@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Do not try to build it if no C++ compiler is present<br>
<br>
Signed-off-by: Marek Chalupa <<a href="mailto:mchqwerty@gmail.com">mchqwerty@gmail.com</a>><br>
---<br>
Makefile.am | 10 ++++++++--<br>
<a href="http://configure.ac" target="_blank">configure.ac</a> | 13 ++++++++++++-<br>
2 files changed, 20 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/Makefile.am b/Makefile.am<br>
index ea9ffc1..43b741a 100644<br>
--- a/Makefile.am<br>
+++ b/Makefile.am<br>
@@ -128,8 +128,11 @@ TESTS = \<br>
queue-test \<br>
signal-test \<br>
resources-test \<br>
- message-test \<br>
- cpp-compile-test<br>
+ message-test<br>
+<br>
+if ENABLE_CPP_TEST<br>
+TESTS += cpp-compile-test<br>
+endif<br>
<br>
check_PROGRAMS = \<br>
$(TESTS) \<br>
@@ -181,7 +184,10 @@ resources_test_SOURCES = tests/resources-test.c<br>
resources_test_LDADD = <a href="http://libtest-runner.la" target="_blank">libtest-runner.la</a><br>
message_test_SOURCES = tests/message-test.c<br>
message_test_LDADD = <a href="http://libtest-runner.la" target="_blank">libtest-runner.la</a><br>
+<br>
+if ENABLE_CPP_TEST<br>
cpp_compile_test_SOURCES = tests/cpp-compile-test.cpp<br>
+endif<br>
<br>
fixed_benchmark_SOURCES = tests/fixed-benchmark.c<br>
fixed_benchmark_LDADD = <a href="http://libtest-runner.la" target="_blank">libtest-runner.la</a><br>
diff --git a/<a href="http://configure.ac" target="_blank">configure.ac</a> b/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
index a5f7e61..0822d39 100644<br>
--- a/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
+++ b/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
@@ -25,8 +25,19 @@ AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz subdir-objects])<br>
AM_SILENT_RULES([yes])<br>
<br>
# Check for programs<br>
-AC_PROG_CXX<br>
AC_PROG_CC<br>
+AC_PROG_CXX<br>
+<br>
+# check if we have C++ compiler. This is hacky workaround,<br>
+# for a reason why it is this way see<br>
+# <a href="http://lists.gnu.org/archive/html/bug-autoconf/2010-05/msg00001.html" target="_blank">http://lists.gnu.org/archive/html/bug-autoconf/2010-05/msg00001.html</a><br>
+have_cpp_compiler=yes<br>
+<br>
+if ! which "$CXX" &>/dev/null; then<br>
+ have_cpp_compiler=no<br>
+fi<br>
+<br>
+AM_CONDITIONAL(ENABLE_CPP_TEST, test "x$have_cpp_compiler" = "xyes")<br>
<br>
# Initialize libtool<br>
LT_PREREQ([2.2])<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.0<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</font></span></blockquote></div></div>