From: Daniel Elstner Date: Wed, 26 Aug 2015 11:13:39 +0000 (+0200) Subject: Build: Use TESTS prefix instead of CHECK for flag variables X-Git-Tag: libsigrok-0.4.0~388 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=65489c1ada6a362a492b7929c1a567a80266f202;p=libsigrok.git Build: Use TESTS prefix instead of CHECK for flag variables In order to avoid confusion of the flags-gathering pkg-config result with the actual test for the availability of "check", change the pkg-config output variable prefix from CHECK to TESTS. --- diff --git a/Makefile.am b/Makefile.am index c6f61a15..d4f87518 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,9 +31,9 @@ endif # Ensure that local include directories are always searched first. AM_CPPFLAGS = $(local_includes) -D_POSIX_C_SOURCE=200112L -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"' -# The check CFLAGS are a superset of the libsigrok CFLAGS, and the +# The tests CFLAGS are a superset of the libsigrok CFLAGS, and the # python bindings CFLAGS are a superset of the C++ bindings CFLAGS. -AM_CFLAGS = $(SR_EXTRA_CFLAGS) $(SR_WFLAGS) $(CHECK_CFLAGS) +AM_CFLAGS = $(SR_EXTRA_CFLAGS) $(SR_WFLAGS) $(TESTS_CFLAGS) AM_CXXFLAGS = $(SR_WXXFLAGS) $(PYSIGROK_CFLAGS) lib_LTLIBRARIES = libsigrok.la @@ -470,10 +470,9 @@ EXTRA_DIST = \ contrib/z60_libsigrok.rules if HAVE_CHECK - TESTS = tests/main - check_PROGRAMS = ${TESTS} +endif tests_main_SOURCES = \ include/libsigrok/libsigrok.h \ @@ -492,9 +491,7 @@ tests_main_SOURCES = \ tests/device.c \ tests/trigger.c -tests_main_LDADD = libsigrok.la $(SR_EXTRA_LIBS) $(CHECK_LIBS) - -endif +tests_main_LDADD = libsigrok.la $(SR_EXTRA_LIBS) $(TESTS_LIBS) BUILD_EXTRA = INSTALL_EXTRA = diff --git a/configure.ac b/configure.ac index f283ca00..01163cde 100644 --- a/configure.ac +++ b/configure.ac @@ -73,7 +73,7 @@ SR_PKG_CHECK_SUMMARY([sr_pkglibs_summary]) # These are used to derive the compiler flags and for the "Requires.private" # field in the generated libsigrok.pc file. SR_VAR_OPT_PKG([SR_PKGLIBS], [sr_deps_avail]) -SR_PKGLIBS_CHECK= +SR_PKGLIBS_TESTS= SR_PKGLIBS_CXX= SR_PKGLIBS_PYTHON= @@ -101,7 +101,7 @@ SR_ARG_OPT_PKG([libgpib], [LIBGPIB], [NEED_GPIB], ###################### # The Check unit testing framework is optional. Disable if not found. -SR_PKG_CHECK([check], [SR_PKGLIBS_CHECK], [check >= 0.9.4]) +SR_PKG_CHECK([check], [SR_PKGLIBS_TESTS], [check >= 0.9.4]) AM_CONDITIONAL([HAVE_CHECK], [test "x$sr_have_check" = xyes]) AC_LANG([C]) @@ -395,7 +395,7 @@ AC_SUBST([SR_PKGLIBS]) # Retrieve the compile and link flags for all modules combined. # Also, bail out at this point if any module dependency is not met. PKG_CHECK_MODULES([LIBSIGROK], [glib-2.0 >= 2.32.0 $SR_PKGLIBS]) -PKG_CHECK_MODULES([CHECK], [$SR_PKGLIBS_CHECK glib-2.0 $SR_PKGLIBS]) +PKG_CHECK_MODULES([TESTS], [$SR_PKGLIBS_TESTS glib-2.0 $SR_PKGLIBS]) # SR_PKGLIBS_CXX may be empty, so only invoke these checks when # the C++ bindings are enabled.