diff options
author | Peter Korsgaard <jacmet@sunsite.dk> | 2008-12-08 14:41:47 +0000 |
---|---|---|
committer | Peter Korsgaard <jacmet@sunsite.dk> | 2008-12-08 14:41:47 +0000 |
commit | 8e436ee7727164603dd8e9cc24af74872752b73e (patch) | |
tree | a16d60ee6fb6bfef929918c3cd6244db146814fa /package/zlib/zlib.mk | |
parent | 38abffd280846d5f915db571755329e319c12f67 (diff) | |
download | buildroot-novena-8e436ee7727164603dd8e9cc24af74872752b73e.tar.gz buildroot-novena-8e436ee7727164603dd8e9cc24af74872752b73e.zip |
have zlib respect BR2_PREFER_STATIC_LIB
The ARM uClinux BFLT format apparently doesn't support shared libs nor
-fPIC. So let's distinguish between shared and non shared builds by
having split rules for libz.a and libz.so based on BR2_PREFER_STATIC_LIB.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Diffstat (limited to 'package/zlib/zlib.mk')
-rw-r--r-- | package/zlib/zlib.mk | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/package/zlib/zlib.mk b/package/zlib/zlib.mk index 27c1e0113..aa87ff7b7 100644 --- a/package/zlib/zlib.mk +++ b/package/zlib/zlib.mk @@ -18,13 +18,23 @@ $(ZLIB_DIR)/.patched: $(DL_DIR)/$(ZLIB_SOURCE) $(CONFIG_UPDATE) $(@D) touch $@ +ifneq ($(BR2_PREFER_STATIC_LIB),y) +ZLIB_PIC := -fPIC +ZLIB_SHARED := --shared +ZLIB_TARGET := $(TARGET_DIR)/usr/lib/libz.so +else +ZLIB_PIC := +ZLIB_SHARED := +ZLIB_TARGET := $(STAGING_DIR)/usr/lib/libz.a +endif + $(ZLIB_DIR)/.configured: $(ZLIB_DIR)/.patched (cd $(ZLIB_DIR); rm -rf config.cache; \ $(TARGET_CONFIGURE_ARGS) \ $(TARGET_CONFIGURE_OPTS) \ - CFLAGS="$(TARGET_CFLAGS) -fPIC" \ + CFLAGS="$(TARGET_CFLAGS) $(ZLIB_PIC)" \ ./configure \ - --shared \ + $(ZLIB_SHARED) \ --prefix=/usr \ --exec-prefix=$(STAGING_DIR)/usr/bin \ --libdir=$(STAGING_DIR)/usr/lib \ @@ -32,14 +42,17 @@ $(ZLIB_DIR)/.configured: $(ZLIB_DIR)/.patched ) touch $@ -$(ZLIB_DIR)/libz.so: $(ZLIB_DIR)/.configured +$(ZLIB_DIR)/libz.a: $(ZLIB_DIR)/.configured $(MAKE) -C $(ZLIB_DIR) all libz.a touch -c $@ -$(STAGING_DIR)/usr/lib/libz.so: $(ZLIB_DIR)/libz.so +$(STAGING_DIR)/usr/lib/libz.a: $(ZLIB_DIR)/libz.a $(INSTALL) -D $(ZLIB_DIR)/libz.a $(STAGING_DIR)/usr/lib/libz.a $(INSTALL) -D $(ZLIB_DIR)/zlib.h $(STAGING_DIR)/usr/include/zlib.h $(INSTALL) $(ZLIB_DIR)/zconf.h $(STAGING_DIR)/usr/include/ + touch -c $@ + +$(STAGING_DIR)/usr/lib/libz.so: $(STAGING_DIR)/usr/lib/libz.a $(INSTALL) $(ZLIB_DIR)/libz.so* $(STAGING_DIR)/usr/lib/ touch -c $@ @@ -49,7 +62,7 @@ $(TARGET_DIR)/usr/lib/libz.so: $(STAGING_DIR)/usr/lib/libz.so -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@ touch -c $@ -$(TARGET_DIR)/usr/lib/libz.a: $(STAGING_DIR)/usr/lib/libz.so +$(TARGET_DIR)/usr/lib/libz.a: $(STAGING_DIR)/usr/lib/libz.a $(INSTALL) -D $(STAGING_DIR)/usr/include/zlib.h $(TARGET_DIR)/usr/include/zlib.h $(INSTALL) $(STAGING_DIR)/usr/include/zconf.h $(TARGET_DIR)/usr/include/ $(INSTALL) -D $(STAGING_DIR)/usr/lib/libz.a $(TARGET_DIR)/usr/lib/libz.a @@ -57,7 +70,7 @@ $(TARGET_DIR)/usr/lib/libz.a: $(STAGING_DIR)/usr/lib/libz.so zlib-headers: $(TARGET_DIR)/usr/lib/libz.a -zlib: uclibc $(TARGET_DIR)/usr/lib/libz.so +zlib: uclibc $(ZLIB_TARGET) zlib-source: $(DL_DIR)/$(ZLIB_SOURCE) |