Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michael S. Zick <minimod@morethan.org>
To: buildroot@busybox.net
Subject: [Buildroot]  Add ability to force a static BB build
Date: Thu, 19 Nov 2009 05:51:06 -0600	[thread overview]
Message-ID: <200911190551.09090.minimod@morethan.org> (raw)

This one I find to be useful for people (like myself)
that need a static linked busybox before setting up
a dynamically linked system.

A1: Yes, this feature could be selected in the busybox config file;
but exposing the feature in BR allows the use of "canned" BB config
files without creating a custom one with only "static" changed.

"Signed-off-by" == "works for me"

Signed-off-by: Michael S. Zick <minimod@morethan.org>

diff --git a/package/busybox/Config.in b/package/busybox/Config.in
index 7438a8d..90cec45 100644
--- a/package/busybox/Config.in
+++ b/package/busybox/Config.in
@@ -56,6 +56,20 @@ config BR2_PACKAGE_BUSYBOX_FULLINSTALL
 
 	  If you wish to just install /bin/busybox, then answer N.
 
+config BR2_PACKAGE_BUSYBOX_MKSTATIC
+    bool "Build a staticly linked BusyBox"
+    depends on BR2_PACKAGE_BUSYBOX
+    default n
+    help
+        This will produce a staticly linked BusyBox.
+
+        Over-rides the selection made in the BusyBox config file.
+
+        Generates a larger BusyBox that can be run independently
+        of the rest of the system being built.
+        Useful if you need to run BusyBox before setting up for
+        a dynamically linked system.
+
 config BR2_PACKAGE_BUSYBOX_CONFIG
 	string "BusyBox configuration file to use?"
 	depends on BR2_PACKAGE_BUSYBOX
diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index eb79134..187a06a 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -77,6 +77,11 @@ ifeq ($(BR2_INET_RPC),y)
 else
 	$(SED) "s/^.*CONFIG_FEATURE_MOUNT_NFS.*/CONFIG_FEATURE_MOUNT_NFS=n/;" $(BUSYBOX_DIR)/.config
 endif
+ifeq ($(BR2_PACKAGE_BUSYBOX_MKSTATIC),y)
+	# force static build on
+	$(SED) "s/^.*CONFIG_STATIC.*/CONFIG_STATIC=y/" $(BUSYBOX_DIR)/.config
+	$(SED) "s/^.*CONFIG_PIE.*/CONFIG_PIE=n/" $(BUSYBOX_DIR)/.config
+endif
 ifeq ($(BR2_PACKAGE_BUSYBOX_SKELETON),y)
 	# force mdev on
 	$(SED) "s/^.*CONFIG_MDEV.*/CONFIG_MDEV=y/" $(BUSYBOX_DIR)/.config

             reply	other threads:[~2009-11-19 11:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-19 11:51 Michael S. Zick [this message]
2009-11-19 13:10 ` [Buildroot] Add ability to force a static BB build Michael S. Zick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200911190551.09090.minimod@morethan.org \
    --to=minimod@morethan.org \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox