Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Mayer <mmayer@broadcom.com>
To: buildroot@busybox.net
Subject: [Buildroot] [RFC 5/6] bzip2: introduce make variable $(LIBDIR)
Date: Thu, 15 Feb 2018 16:56:11 -0800	[thread overview]
Message-ID: <20180216005612.69593-6-mmayer@broadcom.com> (raw)
In-Reply-To: <20180216005612.69593-1-mmayer@broadcom.com>

In order to allow us to install libz2 into a location other than
/usr/lib, we introduce a variable called $(LIBDIR) that can be set by
the build system to an alternate location.

$(LIBDIR) defaults to /usr/lib, so the behaviour doesn't change if
$(LIBDIR) is never set.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
---
 package/bzip2/0003-add-libdir-to-makefile.patch    | 36 ++++++++++++++++++++++
 .../bzip2/0004-add-libdir-to-makefile-libbz2.patch | 31 +++++++++++++++++++
 2 files changed, 67 insertions(+)
 create mode 100644 package/bzip2/0003-add-libdir-to-makefile.patch
 create mode 100644 package/bzip2/0004-add-libdir-to-makefile-libbz2.patch

diff --git a/package/bzip2/0003-add-libdir-to-makefile.patch b/package/bzip2/0003-add-libdir-to-makefile.patch
new file mode 100644
index 000000000000..8a724484bd1e
--- /dev/null
+++ b/package/bzip2/0003-add-libdir-to-makefile.patch
@@ -0,0 +1,36 @@
+Introduce $(LIBDIR) to Makefile
+
+The variable $(LIBDIR) allows us to override where libbz2 is installed.
+
+Index: bzip2-1.0.6/Makefile
+===================================================================
+--- bzip2-1.0.6.orig/Makefile	2010-09-10 15:46:02.000000000 -0700
++++ bzip2-1.0.6/Makefile	2017-11-23 12:51:53.318896836 -0800
+@@ -19,6 +19,7 @@
+ AR=ar
+ RANLIB=ranlib
+ LDFLAGS=
++LIBDIR ?= lib
+ 
+ override CFLAGS += -Wall
+ 
+@@ -71,7 +73,7 @@
+ 
+ install: bzip2 bzip2recover
+ 	if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
+-	if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi
++	if ( test ! -d $(PREFIX)/$(LIBDIR) ) ; then mkdir -p $(PREFIX)/$(LIBDIR) ; fi
+ 	if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi
+ 	if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi
+ 	if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
+@@ -87,8 +89,8 @@
+ 	chmod a+r $(PREFIX)/man/man1/bzip2.1
+ 	cp -f bzlib.h $(PREFIX)/include
+ 	chmod a+r $(PREFIX)/include/bzlib.h
+-	cp -f libbz2.a $(PREFIX)/lib
+-	chmod a+r $(PREFIX)/lib/libbz2.a
++	cp -f libbz2.a $(PREFIX)/$(LIBDIR)
++	chmod a+r $(PREFIX)/$(LIBDIR)/libbz2.a
+ 	cp -f bzgrep $(PREFIX)/bin/bzgrep
+ 	ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
+ 	ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
diff --git a/package/bzip2/0004-add-libdir-to-makefile-libbz2.patch b/package/bzip2/0004-add-libdir-to-makefile-libbz2.patch
new file mode 100644
index 000000000000..9b2f6b114fc6
--- /dev/null
+++ b/package/bzip2/0004-add-libdir-to-makefile-libbz2.patch
@@ -0,0 +1,31 @@
+Introduce $(LIBDIR) to Makefile-libbz2_so
+
+The variable $(LIBDIR) allows us to override where libbz2 is installed.
+
+Index: bzip2-1.0.6/Makefile
+===================================================================
+--- bzip2-1.0.6/Makefile-libbz2_so.orig	2017-11-23 11:08:33.067637637 -0800
++++ bzip2-1.0.6/Makefile-libbz2_so	2017-11-23 12:51:38.694728036 -0800
+@@ -23,6 +23,9 @@
+ 
+ SHELL=/bin/sh
+ CC=gcc
++
++LIBDIR ?= lib
++
+ override CFLAGS += -fpic -fPIC -Wall
+ 
+ OBJS= blocksort.sho  \
+@@ -38,9 +41,9 @@
+ 	$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
+ 
+ install:
+-	install -m 0755 -D libbz2.so.1.0.6 $(PREFIX)/lib/libbz2.so.1.0.6
+-	ln -sf libbz2.so.1.0.6 $(PREFIX)/lib/libbz2.so
+-	ln -sf libbz2.so.1.0.6 $(PREFIX)/lib/libbz2.so.1.0
++	install -m 0755 -D libbz2.so.1.0.6 $(PREFIX)/$(LIBDIR)/libbz2.so.1.0.6
++	ln -sf libbz2.so.1.0.6 $(PREFIX)/$(LIBDIR)/libbz2.so
++	ln -sf libbz2.so.1.0.6 $(PREFIX)/$(LIBDIR)/libbz2.so.1.0
+ 
+ clean: 
+ 	rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared
-- 
2.7.4

  parent reply	other threads:[~2018-02-16  0:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-16  0:56 [Buildroot] [RFC 0/6] Support 32-bit binaries on a 64-bit architecture Markus Mayer
2018-02-16  0:56 ` [Buildroot] [RFC 1/6] support/scripts/check-bin-arch: improve architecture check Markus Mayer
2018-02-16  0:56 ` [Buildroot] [RFC 2/6] system/Config.in: add configuration options for 32-bit library support Markus Mayer
2018-02-16  0:56 ` [Buildroot] [RFC 3/6] core: system and toolchain: 32-bit run-time support on 64-bit platform Markus Mayer
2018-02-16  0:56 ` [Buildroot] [RFC 4/6] core/pkg-toolchain-external: copy external 32-bit libraries to staging Markus Mayer
2018-02-16  0:56 ` Markus Mayer [this message]
2018-02-16  0:56 ` [Buildroot] [RFC 6/6] package: use BR2_ROOTFS_LIB_DIR for all libraries we use Markus Mayer
2018-02-16  6:45 ` [Buildroot] [RFC 0/6] Support 32-bit binaries on a 64-bit architecture Baruch Siach
2018-02-16 20:59   ` Thomas Petazzoni
2018-02-16 23:00     ` Florian Fainelli

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=20180216005612.69593-6-mmayer@broadcom.com \
    --to=mmayer@broadcom.com \
    --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