]> granicus.if.org Git - curl/commitdiff
unit tests: disable unit tests for a given cross-compilation configuration.
authorYang Tse <yangsita@gmail.com>
Fri, 3 Jun 2011 18:06:42 +0000 (20:06 +0200)
committerYang Tse <yangsita@gmail.com>
Fri, 3 Jun 2011 18:08:00 +0000 (20:08 +0200)
cross-compilation of unit tests static library/programs fails when
libcurl shared library is also built. This might be due to a libtool or
automake issue. In this case we disable unit tests.

configure.ac

index 412242f4434cb34ed9797c5a244adc3bfb10a848..7482397cbe0c30e036ff211c5f386dadcfc81f77 100644 (file)
@@ -305,8 +305,23 @@ AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
 CURL_CHECK_CURLDEBUG
 AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
 
+supports_unittests=yes
+# cross-compilation of unit tests static library/programs fails when
+# libcurl shared library is built. This might be due to a libtool or
+# automake issue. In this case we disable unit tests.
+if test "x$cross_compiling" != "xno" &&
+   test "x$enable_shared" != "xno"; then
+  supports_unittests=no
+fi
+
 dnl Build unit tests when option --enable-debug is given.
-AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_debug = xyes)
+if test "x$want_debug" = "xyes" &&
+   test "x$supports_unittests" = "xyes"; then
+  want_unittests=yes
+else
+  want_unittests=no
+fi
+AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
 
 dnl **********************************************************************
 dnl Compilation based checks should not be done before this point.