[oe] [PATCH 1/2] introduce global control on shared/static libraries

Stanislav Brabec utx at penguin.cz
Sun Jan 10 17:06:35 UTC 2010


This patch adds support for global enabling and disabling of shared or
static libraries in autoconf based packages.

All required fixes in packages that I was able to test are already in
place with exception of apmd (I plan to commit it soon as well).

diff --git a/classes/base.bbclass b/classes/base.bbclass
index 384a67d..ea1ea1e 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -346,10 +346,10 @@ oe_libinstall() {
 			silent=1
 			;;
 		-a)
-			require_static=1
+			if test "$enable_static" != "no" ; then require_static=1 ; fi
 			;;
 		-so)
-			require_shared=1
+			if test "$enable_shared" != "no" ; then require_shared=1 ; fi
 			;;
 		-*)
 			oefatal "oe_libinstall: unknown option: $1"
diff --git a/conf/bitbake.conf b/conf/bitbake.conf
index 3a68959..4903952 100644
--- a/conf/bitbake.conf
+++ b/conf/bitbake.conf
@@ -86,6 +86,10 @@ bindir_cross = "/bin"
 #
 target_datadir := "${datadir}"
 
+# Basic autoconf defaults
+export enable_static = "yes"
+export enable_shared = "yes"
+
 ##################################################################
 # Architecture-dependent build variables.
 ##################################################################
diff --git a/conf/local.conf.sample b/conf/local.conf.sample
index 643ae0b..3fa7a32 100644
--- a/conf/local.conf.sample
+++ b/conf/local.conf.sample
@@ -146,6 +146,12 @@ IMAGE_FSTYPES = "jffs2 tar"
 # SELECTED_OPTIMIZATION = "${PROFILE_OPTIMIZATION}"
 # LDFLAGS =+ "-pg"
 
+# Uncomment these and define whether you want to build stared and static
+# libraries by default.
+# Normally the DISTRO of your choosing will take care of this 
+# export enable_static = "yes"
+# export enable_shared = "yes"
+
 # Uncomment this to enable parallel make.
 # This allows make to spawn mutliple processes to take advantage of multiple 
 # processors. Useful on SMP machines. This may break some packages - we're



________________________________________________________________________
Stanislav Brabec
http://www.penguin.cz/~utx/zaurus





More information about the Openembedded-devel mailing list