From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpCze-0007Fg-5R for qemu-devel@nongnu.org; Thu, 22 Oct 2015 06:21:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpCza-0001V4-58 for qemu-devel@nongnu.org; Thu, 22 Oct 2015 06:21:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpCzZ-0001V0-Tg for qemu-devel@nongnu.org; Thu, 22 Oct 2015 06:21:06 -0400 From: "Daniel P. Berrange" Date: Thu, 22 Oct 2015 11:20:49 +0100 Message-Id: <1445509249-30046-5-git-send-email-berrange@redhat.com> In-Reply-To: <1445509249-30046-1-git-send-email-berrange@redhat.com> References: <1445509249-30046-1-git-send-email-berrange@redhat.com> Subject: [Qemu-devel] [PULL v2 4/4] configure: avoid polluting global CFLAGS with tasn1 flags List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell The previous commit commit 9a2fd4347c40321f5cbb4ab4220e759fcbf87d03 Author: Daniel P. Berrange Date: Mon Apr 13 14:01:39 2015 +0100 crypto: add sanity checking of TLS x509 credentials defined new variables $TEST_LIBS and $TEST_CFLAGS and used them in tests/Makefile to augment $LIBS and $CFLAGS. Unfortunately this overlooks the fact that tests/Makefile is not executed via recursive-make, it is just pulled into the top level Makefile via an include statement. So rather than just augmenting the compiler/linker flags for tests it polluted the global flags. This is thought to be behind a reported failure when building the pixman module as a sub-module, since global $CFLAGS are passed down to configure in pixman. This change removes the $TEST_LIBS and $TEST_CFLAGS replacing them with $TASN1_LIBS and $TASN1_CFLAGS, setting only against specific objects/executables that need them. Signed-off-by: Daniel P. Berrange --- configure | 11 ++++------- tests/Makefile | 10 ++++++++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 4f0a08b..ac26b77 100755 --- a/configure +++ b/configure @@ -419,9 +419,6 @@ if test "$debug_info" = "yes"; then LDFLAGS="-g $LDFLAGS" fi -test_cflags="" -test_libs="" - # make source path absolute source_path=`cd "$source_path"; pwd` @@ -2365,11 +2362,11 @@ fi # libtasn1 - only for the TLS creds/session test suite tasn1=yes +tasn1_cflags="" +tasn1_libs="" if $pkg_config --exists "libtasn1"; then tasn1_cflags=`$pkg_config --cflags libtasn1` tasn1_libs=`$pkg_config --libs libtasn1` - test_cflags="$test_cflags $tasn1_cflags" - test_libs="$test_libs $tasn1_libs" else tasn1=no fi @@ -5392,8 +5389,8 @@ echo "EXESUF=$EXESUF" >> $config_host_mak echo "DSOSUF=$DSOSUF" >> $config_host_mak echo "LDFLAGS_SHARED=$LDFLAGS_SHARED" >> $config_host_mak echo "LIBS_QGA+=$libs_qga" >> $config_host_mak -echo "TEST_LIBS=$test_libs" >> $config_host_mak -echo "TEST_CFLAGS=$test_cflags" >> $config_host_mak +echo "TASN1_LIBS=$tasn1_libs" >> $config_host_mak +echo "TASN1_CFLAGS=$tasn1_cflags" >> $config_host_mak echo "POD2MAN=$POD2MAN" >> $config_host_mak echo "TRANSLATE_OPT_CFLAGS=$TRANSLATE_OPT_CFLAGS" >> $config_host_mak if test "$gcov" = "yes" ; then diff --git a/tests/Makefile b/tests/Makefile index 0531b30..9341498 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -444,8 +444,16 @@ tests/test-mul64$(EXESUF): tests/test-mul64.o $(test-util-obj-y) tests/test-bitops$(EXESUF): tests/test-bitops.o $(test-util-obj-y) tests/test-crypto-hash$(EXESUF): tests/test-crypto-hash.o $(test-crypto-obj-y) tests/test-crypto-cipher$(EXESUF): tests/test-crypto-cipher.o $(test-crypto-obj-y) + +tests/crypto-tls-x509-helpers.o-cflags := $(TASN1_CFLAGS) +tests/crypto-tls-x509-helpers.o-libs := $(TASN1_LIBS) +tests/pkix_asn1_tab.o-cflags := $(TASN1_CFLAGS) + +tests/test-crypto-tlscredsx509.o-cflags := $(TASN1_CFLAGS) tests/test-crypto-tlscredsx509$(EXESUF): tests/test-crypto-tlscredsx509.o \ tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o $(test-crypto-obj-y) + +tests/test-crypto-tlssession.o-cflags := $(TASN1_CFLAGS) tests/test-crypto-tlssession$(EXESUF): tests/test-crypto-tlssession.o \ tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o $(test-crypto-obj-y) @@ -518,8 +526,6 @@ tests/test-netfilter$(EXESUF): tests/test-netfilter.o $(qtest-obj-y) ifeq ($(CONFIG_POSIX),y) LIBS += -lutil endif -LIBS += $(TEST_LIBS) -CFLAGS += $(TEST_CFLAGS) # QTest rules -- 2.4.3