Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: jacmet at uclibc.org <jacmet@uclibc.org>
To: buildroot@busybox.net
Subject: [Buildroot] svn commit: trunk/buildroot/package/zlib
Date: Mon,  8 Dec 2008 06:41:48 -0800 (PST)	[thread overview]
Message-ID: <20081208144148.2D52E3C776@busybox.net> (raw)

Author: jacmet
Date: 2008-12-08 06:41:47 -0800 (Mon, 08 Dec 2008)
New Revision: 24324

Log:
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>

Modified:
   trunk/buildroot/package/zlib/zlib.mk


Changeset:
Modified: trunk/buildroot/package/zlib/zlib.mk
===================================================================
--- trunk/buildroot/package/zlib/zlib.mk	2008-12-08 13:48:37 UTC (rev 24323)
+++ trunk/buildroot/package/zlib/zlib.mk	2008-12-08 14:41:47 UTC (rev 24324)
@@ -18,13 +18,23 @@
 	$(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 @@
 	)
 	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 @@
 	-$(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 @@
 
 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)
 

             reply	other threads:[~2008-12-08 14:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-08 14:41 jacmet at uclibc.org [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-12-11 14:40 [Buildroot] svn commit: trunk/buildroot/package/zlib egtvedt at uclibc.org
2008-10-31 16:37 correa at uclibc.org
2008-10-31 12:10 correa at uclibc.org
2008-10-31 15:31 ` Thomas Petazzoni
2008-10-31 16:37   ` Thiago A. Corrêa
2008-07-17 13:19 jacmet at uclibc.org
2007-06-29  8:18 aldot at uclibc.org
2007-06-25  9:07 aldot at uclibc.org
2007-06-25  9:01 aldot at uclibc.org

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=20081208144148.2D52E3C776@busybox.net \
    --to=jacmet@uclibc.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