From patchwork Sun Dec 31 10:00:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 123014 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp6664014qgn; Sun, 31 Dec 2017 02:03:48 -0800 (PST) X-Google-Smtp-Source: ACJfBotaJFD3D+ZyflzUPPKyokdOJ7uXPWwgOR4926Buc7yn7OO00P/ANamfvpT7m/uTj+AGEnmO X-Received: by 10.200.58.67 with SMTP id w61mr52437595qte.296.1514714628544; Sun, 31 Dec 2017 02:03:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514714628; cv=none; d=google.com; s=arc-20160816; b=zPPVgsdjhWNl80vBzcyVDJF7PI82Q32pLFpMjCEFQCo3dCgrgH8AH5RNeS7TkUiymm 9nxqLKSxWSeQ29fjIiOmRIrBoHwSVAeCS+Fd8f4M5IwiDY29IwDulZKBojwWW4IFmudM qR0amTXgcRswae0BUKYxWbWXEpLe7hFELlCr7TQVK9DBkR55St/DT9YhUo+D+Iw8VCqI G8sHbiYKBvGDUgf8YPNiIYgC4ygTQ6sDODDNM9Ln/rT72mAiNkjgJV3udwRD3ruNDtOw 5hfydvdpGTsTUH7rwaPlqIbI3Od6J0DFJhDaXd31N3+ggUtbRg54VOW9orEkCszkcd4K fLDg== 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=A+FtEnrQDIWzxrIsZqtQWD8NFpMQv8E2MB/S1X8MTE4=; b=xhWkAz7eT5X38th21zLuu+bV/B7Z9U5V0Ff7oIac019JTmRgrLM+pP7sgAByr+sGus Sir2WobgEOJSifvAaSRGMsql6C0GyPHl4TqMdy1T9vA86/2G9Uo62+xmsunLnnbXi7GQ kbUqGRpyWSZs4NNshc32L1QnhCHeJsEZYdRqhwtcLGNJSQ4KFaKTWHjv0Lf8niLo1p+4 S1xH1cbz/Q5de5z5R6Dfa2zHnl7ZbuARPmuzRbHKUsvuM/peB3GpeOL1Yl9Cv+2XeUo0 N5raY2MaLjNhQsr1dpUsmjIsoNMYKY4J+WyBG4PX6uaNRNU2b5lUGhfnzeQFy4YE5TYP qUTQ== 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 v21si1438370qtv.402.2017.12.31.02.03.48; Sun, 31 Dec 2017 02:03:48 -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 2E6256151D; Sun, 31 Dec 2017 10:03:48 +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 63F3C61555; Sun, 31 Dec 2017 10:00:37 +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 E32FB61514; Sun, 31 Dec 2017 10:00:18 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id 1888B60B34 for ; Sun, 31 Dec 2017 10:00:13 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward105p.mail.yandex.net (Yandex) with ESMTP id AC0924083B5C for ; Sun, 31 Dec 2017 13:00:11 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id z27glrYWNC-0BmeajfY; Sun, 31 Dec 2017 13:00:11 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id fDOtarRzt4-0BLG4NQZ; Sun, 31 Dec 2017 13:00:11 +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: Sun, 31 Dec 2017 13:00:04 +0300 Message-Id: <1514714407-7846-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514714407-7846-1-git-send-email-odpbot@yandex.ru> References: <1514714407-7846-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 377 Subject: [lng-odp] [PATCH v2 5/8] 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: 220e6aded9453e606a66be584a78d7d08718be8d **/ configure.ac | 10 ++++++++++ example/Makefile.inc | 4 ++++ test/Makefile.inc | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/configure.ac b/configure.ac index 177881a58..109eaea9e 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-link], + [AS_HELP_STRING([--disable-static-link], + [disable static linking of examples and tests])], + [static_link=$enableval], + [static_link=yes]) +AM_CONDITIONAL([STATIC_LINK], [test "x$static_link" != "xno"]) + ########################################################################## # Include m4 files ########################################################################## 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@