Import buildroot 2016.02.01
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
Build objects twice for shared and static libraries
|
||||
|
||||
The existing Makefile causes problems on MIPS because the same object
|
||||
files (not compiled with -fPIC) are used in static and shared libraries.
|
||||
MIPS will refuce to link non-pic objects in shared libraries.
|
||||
We fix this problems by creating a new rule for the shared library
|
||||
and build the shared objects as *.sho instead of *.o.
|
||||
Then, we use these objects to create the shared library.
|
||||
|
||||
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
|
||||
|
||||
Index: bzip2-1.0.6/Makefile-libbz2_so
|
||||
===================================================================
|
||||
--- bzip2-1.0.6.orig/Makefile-libbz2_so
|
||||
+++ bzip2-1.0.6/Makefile-libbz2_so
|
||||
@@ -25,13 +25,13 @@ SHELL=/bin/sh
|
||||
CC=gcc
|
||||
override CFLAGS += -fpic -fPIC -Wall
|
||||
|
||||
-OBJS= blocksort.o \
|
||||
- huffman.o \
|
||||
- crctable.o \
|
||||
- randtable.o \
|
||||
- compress.o \
|
||||
- decompress.o \
|
||||
- bzlib.o
|
||||
+OBJS= blocksort.sho \
|
||||
+ huffman.sho \
|
||||
+ crctable.sho \
|
||||
+ randtable.sho \
|
||||
+ compress.sho \
|
||||
+ decompress.sho \
|
||||
+ bzlib.sho
|
||||
|
||||
all: $(OBJS)
|
||||
$(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS)
|
||||
@@ -45,17 +45,5 @@ install:
|
||||
clean:
|
||||
rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared
|
||||
|
||||
-blocksort.o: blocksort.c
|
||||
- $(CC) $(CFLAGS) -c blocksort.c
|
||||
-huffman.o: huffman.c
|
||||
- $(CC) $(CFLAGS) -c huffman.c
|
||||
-crctable.o: crctable.c
|
||||
- $(CC) $(CFLAGS) -c crctable.c
|
||||
-randtable.o: randtable.c
|
||||
- $(CC) $(CFLAGS) -c randtable.c
|
||||
-compress.o: compress.c
|
||||
- $(CC) $(CFLAGS) -c compress.c
|
||||
-decompress.o: decompress.c
|
||||
- $(CC) $(CFLAGS) -c decompress.c
|
||||
-bzlib.o: bzlib.c
|
||||
- $(CC) $(CFLAGS) -c bzlib.c
|
||||
+%.sho: %.c
|
||||
+ $(CC) $(CFLAGS) -o $@ -c $<
|
||||
@@ -0,0 +1,84 @@
|
||||
Improve bzip2 build system
|
||||
|
||||
This patch makes a number of improvements to the bzip2 build system:
|
||||
|
||||
* Remove the BIGFILE variable that was used to force largefile
|
||||
support. Now, the user of the Makefile is supposed to pass
|
||||
-D_FILE_OFFSET_BITS=64 when largefile support is desired.
|
||||
|
||||
* Use override CFLAGS += so that additional CFLAGS can be passed on
|
||||
the command line.
|
||||
|
||||
* Removed "forced" CFLAGS -O2, -g and -Winline. We don't want them by
|
||||
default, and want the build system to use its own ones.
|
||||
|
||||
* When creating the symbolic links bzegrep, bzfgrep, bzless and
|
||||
bzcmp, don't link them to an absolute path, or they'll point to
|
||||
some path on the build machine.
|
||||
|
||||
* Provide an install target for the shared library, which creates the
|
||||
appropriate symbolic links.
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
|
||||
Index: b/Makefile
|
||||
===================================================================
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -20,8 +20,7 @@
|
||||
RANLIB=ranlib
|
||||
LDFLAGS=
|
||||
|
||||
-BIGFILES=-D_FILE_OFFSET_BITS=64
|
||||
-CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
|
||||
+override CFLAGS += -Wall
|
||||
|
||||
# Where you want it installed when you do 'make install'
|
||||
PREFIX=/usr/local
|
||||
@@ -90,14 +89,14 @@
|
||||
cp -f libbz2.a $(PREFIX)/lib
|
||||
chmod a+r $(PREFIX)/lib/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
|
||||
+ ln -s -f bzgrep $(PREFIX)/bin/bzegrep
|
||||
+ ln -s -f bzgrep $(PREFIX)/bin/bzfgrep
|
||||
chmod a+x $(PREFIX)/bin/bzgrep
|
||||
cp -f bzmore $(PREFIX)/bin/bzmore
|
||||
- ln -s -f $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless
|
||||
+ ln -s -f bzmore $(PREFIX)/bin/bzless
|
||||
chmod a+x $(PREFIX)/bin/bzmore
|
||||
cp -f bzdiff $(PREFIX)/bin/bzdiff
|
||||
- ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
|
||||
+ ln -s -f bzdiff $(PREFIX)/bin/bzcmp
|
||||
chmod a+x $(PREFIX)/bin/bzdiff
|
||||
cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
|
||||
chmod a+r $(PREFIX)/man/man1/bzgrep.1
|
||||
Index: b/Makefile-libbz2_so
|
||||
===================================================================
|
||||
--- a/Makefile-libbz2_so
|
||||
+++ b/Makefile-libbz2_so
|
||||
@@ -23,8 +23,7 @@
|
||||
|
||||
SHELL=/bin/sh
|
||||
CC=gcc
|
||||
-BIGFILES=-D_FILE_OFFSET_BITS=64
|
||||
-CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES)
|
||||
+override CFLAGS += -fpic -fPIC -Wall
|
||||
|
||||
OBJS= blocksort.o \
|
||||
huffman.o \
|
||||
@@ -37,8 +36,11 @@
|
||||
all: $(OBJS)
|
||||
$(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS)
|
||||
$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
|
||||
- rm -f libbz2.so.1.0
|
||||
- ln -s libbz2.so.1.0.6 libbz2.so.1.0
|
||||
+
|
||||
+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
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared
|
||||
9
firmware/buildroot/package/bzip2/Config.in
Normal file
9
firmware/buildroot/package/bzip2/Config.in
Normal file
@@ -0,0 +1,9 @@
|
||||
config BR2_PACKAGE_BZIP2
|
||||
bool "bzip2"
|
||||
help
|
||||
Freely available, patent free, high-quality data compressor.
|
||||
It typically compresses files to within 10% to 15% of the best
|
||||
available techniques, while being around twice as fast at
|
||||
compression and six times faster at decompression.
|
||||
|
||||
http://sources.redhat.com/bzip2/
|
||||
2
firmware/buildroot/package/bzip2/bzip2.hash
Normal file
2
firmware/buildroot/package/bzip2/bzip2.hash
Normal file
@@ -0,0 +1,2 @@
|
||||
# From http://www.bzip.org/downloads.html
|
||||
md5 00b516f4704d4a7cb50a1d97e6e8e15b bzip2-1.0.6.tar.gz
|
||||
69
firmware/buildroot/package/bzip2/bzip2.mk
Normal file
69
firmware/buildroot/package/bzip2/bzip2.mk
Normal file
@@ -0,0 +1,69 @@
|
||||
################################################################################
|
||||
#
|
||||
# bzip2
|
||||
#
|
||||
################################################################################
|
||||
|
||||
BZIP2_VERSION = 1.0.6
|
||||
BZIP2_SITE = http://www.bzip.org/$(BZIP2_VERSION)
|
||||
BZIP2_INSTALL_STAGING = YES
|
||||
BZIP2_LICENSE = bzip2 license
|
||||
BZIP2_LICENSE_FILES = LICENSE
|
||||
|
||||
ifeq ($(BR2_STATIC_LIBS),)
|
||||
define BZIP2_BUILD_SHARED_CMDS
|
||||
$(TARGET_MAKE_ENV)
|
||||
$(MAKE) -C $(@D) -f Makefile-libbz2_so $(TARGET_CONFIGURE_OPTS)
|
||||
endef
|
||||
endif
|
||||
|
||||
define BZIP2_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV)
|
||||
$(MAKE) -C $(@D) libbz2.a bzip2 bzip2recover $(TARGET_CONFIGURE_OPTS)
|
||||
$(BZIP2_BUILD_SHARED_CMDS)
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_STATIC_LIBS),)
|
||||
define BZIP2_INSTALL_STAGING_SHARED_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) \
|
||||
-f Makefile-libbz2_so PREFIX=$(STAGING_DIR)/usr -C $(@D) install
|
||||
endef
|
||||
endif
|
||||
|
||||
define BZIP2_INSTALL_STAGING_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) \
|
||||
PREFIX=$(STAGING_DIR)/usr -C $(@D) install
|
||||
$(BZIP2_INSTALL_STAGING_SHARED_CMDS)
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_STATIC_LIBS),)
|
||||
define BZIP2_INSTALL_TARGET_SHARED_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) \
|
||||
-f Makefile-libbz2_so PREFIX=$(TARGET_DIR)/usr -C $(@D) install
|
||||
endef
|
||||
endif
|
||||
|
||||
# make sure busybox doesn't get overwritten by make install
|
||||
define BZIP2_INSTALL_TARGET_CMDS
|
||||
rm -f $(addprefix $(TARGET_DIR)/usr/bin/,bzip2 bunzip2 bzcat)
|
||||
$(TARGET_MAKE_ENV) $(MAKE) \
|
||||
PREFIX=$(TARGET_DIR)/usr -C $(@D) install
|
||||
$(BZIP2_INSTALL_TARGET_SHARED_CMDS)
|
||||
endef
|
||||
|
||||
define HOST_BZIP2_BUILD_CMDS
|
||||
$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) \
|
||||
$(MAKE) -C $(@D) -f Makefile-libbz2_so
|
||||
$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) \
|
||||
$(MAKE) -C $(@D) libbz2.a bzip2 bzip2recover
|
||||
endef
|
||||
|
||||
define HOST_BZIP2_INSTALL_CMDS
|
||||
$(HOST_MAKE_ENV) \
|
||||
$(MAKE) PREFIX=$(HOST_DIR)/usr -C $(@D) install
|
||||
$(HOST_MAKE_ENV) \
|
||||
$(MAKE) -f Makefile-libbz2_so PREFIX=$(HOST_DIR)/usr -C $(@D) install
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
$(eval $(host-generic-package))
|
||||
Reference in New Issue
Block a user