Patchwork stress: honor the BR2_PREFER_STATIC_LIB preference

login
register
mail settings
Submitter Tzu-Jung Lee
Date March 4, 2013, 5:47 p.m.
Message ID <1362419240-7979-1-git-send-email-roylee17@gmail.com>
Download mbox | patch
Permalink /patch/224777/
State Accepted
Commit 1b9a4f1e91ac98d836775c293acb9a947b846de1
Headers show

Comments

Tzu-Jung Lee - March 4, 2013, 5:47 p.m.
From: roylee17 <roylee17@gmail.com>

Stress is linked statically if the --enable-static is specified.
However, this option is always specified in the global
SHARED_STATIC_LIBS_OPTS to tell packages to build static libraries,
if supported.

If the BR2_PREFER_STATIC_LIB is not defined, we have to specify
--disable-static explicitly to get stress linked dynamically.

Signed-off-by: Tzu-Jung Lee <tjlee@ambarella.com>
---
 package/stress/stress.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)
Peter Korsgaard - March 4, 2013, 7:59 p.m.
>>>>> "T" == Tzu-Jung Lee <roylee17@gmail.com> writes:

 T> From: roylee17 <roylee17@gmail.com>
 T> Stress is linked statically if the --enable-static is specified.
 T> However, this option is always specified in the global
 T> SHARED_STATIC_LIBS_OPTS to tell packages to build static libraries,
 T> if supported.

 T> If the BR2_PREFER_STATIC_LIB is not defined, we have to specify
 T> --disable-static explicitly to get stress linked dynamically.

 T> Signed-off-by: Tzu-Jung Lee <tjlee@ambarella.com>

Committed, thanks.

Patch

diff --git a/package/stress/stress.mk b/package/stress/stress.mk
index 3a047b5..a20b0c6 100644
--- a/package/stress/stress.mk
+++ b/package/stress/stress.mk
@@ -10,4 +10,14 @@  STRESS_VERSION = 1.0.4
 STRESS_SITE    = http://weather.ou.edu/~apw/projects/stress
 STRESS_AUTORECONF = YES
 
+# Stress is linked statically if the --enable-static is specified.
+# However, this option is always specified in the global
+# SHARED_STATIC_LIBS_OPTS to tell packages to build static libraries,
+# if supported.
+#
+# If the BR2_PREFER_STATIC_LIB is not defined, we have to specify
+# --disable-static explicitly to get stress linked dynamically.
+STRESS_CONF_OPT = \
+	$(if $(BR2_PREFER_STATIC_LIB),,--disable-static)
+
 $(eval $(autotools-package))