From patchwork Wed Jan 3 02:59:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 123271 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp9680222qgn; Tue, 2 Jan 2018 19:05:13 -0800 (PST) X-Google-Smtp-Source: ACJfBovaTtuKPD8tlDaQtYloiQMm+dueXTPBvr1QoygnyCmVmnh9VPq4kr9s1eSgdSJBAWbGif3D X-Received: by 10.200.45.89 with SMTP id o25mr97088qta.227.1514948713110; Tue, 02 Jan 2018 19:05:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514948713; cv=none; d=google.com; s=arc-20160816; b=DeIuuuf0VJMr5Omn9mBYt1hBxzl7bBb4RqrAvTT7+/Ct52gaMfcjKw7Vb3wjhsXf70 jMnC6mq7AzoNvQ3wF2kdwjDUrPvYWhSuVOgHLFWfiqjUzBvca06WCd0AxS/Nqxp7HTZ4 0sktpzOdunoh5ius3iOmOy+FSdqZZ/iHU40PY4uLPpMOWE1cuBU7woQKtHvbKQOqP/rD toQk0OmMR2IgetIHZ8Pl4YDfTh9kBVfh1ci/q2vFwNQFNf2SZ9YqGmlfhOGqT7ZIam/I 9YdcZUZDhiQrDbojMCUT1yXaPZbPohAi8YkWkj8lOvOZLftThEszQDmAuO8LIusvzO7r 5JVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=4XfMReZwTAbOaO1nVoLOQFZ21nv48jkH0VNwkZlfPt0=; b=nV1UrA8TvSEuz5pNiFWUf6Dzhr1OB9B9vocaH3P/98kgytrL6A/s5rJv6WcDF54ijk XKry8iRJ16eV13tWIBr69aTUic8OE3sWDx169zczQYhDOayLRmExCpS780cCSfL5wnTN t8kSNwXVkmsB0vwktd8wAQE5ltIKjgEyvzy5D1wJe/itpD2Yt/lhJ28AzBfimM0v7EkE zgnwhVKEFtVfDmV6oIhXq5HkJ8nG0LDWVDGSELyhOkHrJ1uJnjreNTLY7VMN92zM3fJz XaFuIw+CMeC8x5JiSWVY5pJOzHn0aduMy5KI0EcDmvo/1BTNFMvzkse7GJ3CVCEcP5Ct fOOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id b30si67721qtc.248.2018.01.02.19.05.12; Tue, 02 Jan 2018 19:05:13 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id C1EAA60928; Wed, 3 Jan 2018 03:05:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id C3B5B60975; Wed, 3 Jan 2018 03:00:39 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A673A608EC; Wed, 3 Jan 2018 03:00:20 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id 64F70607FE for ; Wed, 3 Jan 2018 03:00:14 +0000 (UTC) Received: from mxback10g.mail.yandex.net (mxback10g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:171]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 2C9A15A0232C for ; Wed, 3 Jan 2018 06:00:13 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback10g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id zldpXdVoih-0Dx4aptW; Wed, 03 Jan 2018 06:00:13 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id zIYVm0231v-0CZacInp; Wed, 03 Jan 2018 06:00:12 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 3 Jan 2018 05:59:59 +0300 Message-Id: <1514948409-30862-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514948409-30862-1-git-send-email-odpbot@yandex.ru> References: <1514948409-30862-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 377 Subject: [lng-odp] [PATCH v9 5/15] build: provide an option to link examples dynamically X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Distributions won't like statically-linked binaries. Provide configure switch to link examples and tests dynamically. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 377 (lumag:misc-fixes) ** https://github.com/Linaro/odp/pull/377 ** Patch: https://github.com/Linaro/odp/pull/377.patch ** Base sha: 49ebafae0edebbc750742d8874ad0a7588286dea ** Merge commit sha: 3bb30027436d5acc0d387f475d127a6f7ed86496 **/ configure.ac | 11 +++++++++++ example/Makefile.inc | 4 ++++ test/Makefile.inc | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/configure.ac b/configure.ac index 177881a58..3242c453c 100644 --- a/configure.ac +++ b/configure.ac @@ -172,6 +172,16 @@ AS_IF([test "${with_platform}" = "linux-generic"], AC_DEFINE_UNQUOTED([IMPLEMENTATION_NAME], ["$IMPLEMENTATION_NAME"], [Define to the name of the implementation]) +########################################################################## +# Build examples/tests dynamically +########################################################################## +AC_ARG_ENABLE([static-tests], + [AS_HELP_STRING([--disable-static-tests], + [disable static linking of examples and tests] + [ with ODP])], [], + [enable_static_tests=yes]) +AM_CONDITIONAL([STATIC_LINK], [test "x$enable_static_tests" != "xno"]) + ########################################################################## # Include m4 files ########################################################################## @@ -383,6 +393,7 @@ AC_MSG_RESULT([ Deprecated APIs: ${deprecated} debug: ${enable_debug} cunit: ${cunit_support} + static tests linkage: ${enable_static_tests} test_vald: ${test_vald} test_perf: ${test_perf} test_perf_proc: ${test_perf_proc} diff --git a/example/Makefile.inc b/example/Makefile.inc index 1609066e6..4cf5cfacc 100644 --- a/example/Makefile.inc +++ b/example/Makefile.inc @@ -13,4 +13,8 @@ AM_CFLAGS = \ -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \ -I$(top_builddir)/include +if STATIC_LINK AM_LDFLAGS = -L$(LIB) -static +else +AM_LDFLAGS = +endif diff --git a/test/Makefile.inc b/test/Makefile.inc index f7c0da214..d7e435038 100644 --- a/test/Makefile.inc +++ b/test/Makefile.inc @@ -18,7 +18,11 @@ INCFLAGS = \ AM_CPPFLAGS = $(INCFLAGS) AM_CFLAGS = $(CUNIT_CFLAGS) +if STATIC_LINK AM_LDFLAGS = -L$(LIB) -static +else +AM_LDFLAGS = +endif @VALGRIND_CHECK_RULES@