Skip to contentSkip to conversation

svn commit: trunk/buildroot/package/libpng

Buildroot laird at uclibc.org 3 participants 5 messages Oct 29, 2008

lore
Share & tools
lore
#0 lore raw

Author: laird
Date: 2008-10-29 05:49:38 -0700 (Wed, 29 Oct 2008) New Revision: 23851

Log:
package/libpng/libpng.mk: Change to autotools.in format

Move libpng into the new era.....

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

Changeset:
Modified: trunk/buildroot/package/libpng/libpng.mk
===================================================================

buildroot/package/libpng/libpng.mk +13 -76
@@ -3,93 +3,30 @@
 # libpng (Portable Network Graphic library)
 #
 #############################################################
-# Copyright (C) 2001-2003 by Erik Andersen <[email protected]>
-# Copyright (C) 2002 by Tim Riker <[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-
 LIBPNG_VERSION:=1.2.32
-LIBPNG_DIR:=$(BUILD_DIR)/libpng-$(LIBPNG_VERSION)
-LIBPNG_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/libpng
-LIBPNG_SOURCE:=libpng-$(LIBPNG_VERSION).tar.bz2
-LIBPNG_CAT:=$(BZCAT)
-
-$(DL_DIR)/$(LIBPNG_SOURCE):
-	 $(WGET) -P $(DL_DIR) $(LIBPNG_SITE)/$(LIBPNG_SOURCE)
-
-libpng-source: $(DL_DIR)/$(LIBPNG_SOURCE)
-
-$(LIBPNG_DIR)/.unpacked: $(DL_DIR)/$(LIBPNG_SOURCE)
-	$(LIBPNG_CAT) $(DL_DIR)/$(LIBPNG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
-	toolchain/patch-kernel.sh $(LIBPNG_DIR) package/libpng/ libpng\*.patch
-	$(CONFIG_UPDATE) $(LIBPNG_DIR)
-	touch $@
-
-$(LIBPNG_DIR)/.configured: $(LIBPNG_DIR)/.unpacked
-	(cd $(LIBPNG_DIR); rm -rf config.cache; \
-		$(TARGET_CONFIGURE_OPTS) \
-		$(TARGET_CONFIGURE_ARGS) \
+LIBPNG_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/libpng
+LIBPNG_SOURCE = libpng-$(LIBPNG_VERSION).tar.bz2
+LIBPNG_LIBTOOL_PATCH = NO
+LIBPNG_INSTALL_STAGING = YES
+LIBPNG_INSTALL_TARGET = YES
+LIBPNG_CONF_ENV = \
 		ac_cv_have_decl_malloc=yes \
 		gl_cv_func_malloc_0_nonnull=yes \
 		ac_cv_func_malloc_0_nonnull=yes \
 		ac_cv_func_calloc_0_nonnull=yes \
-		ac_cv_func_realloc_0_nonnull=yes \
-		./configure \
-		--target=$(GNU_TARGET_NAME) \
-		--host=$(GNU_TARGET_NAME) \
-		--build=$(GNU_HOST_NAME) \
-		--prefix=/usr \
-		--sysconfdir=/etc \
-		--localstatedir=/var \
+		ac_cv_func_realloc_0_nonnull=yes
+LIBPNG_CONF_OPT = \
 		--without-libpng-compat \
-		--without-x \
-	)
-	touch $@
+		--without-x
+LIBPNG_DEPENDENCIES = uclibc pkgconfig zlib
 
-$(LIBPNG_DIR)/.compiled: $(LIBPNG_DIR)/.configured
-	$(MAKE) -C $(LIBPNG_DIR)
-	touch $@
+$(eval $(call AUTOTARGETS,package,libpng))
 
-$(STAGING_DIR)/usr/lib/libpng.so: $(LIBPNG_DIR)/.compiled
-	$(MAKE) DESTDIR=$(STAGING_DIR) -C $(LIBPNG_DIR) install
-	$(SED) "s,^libdir=.*,libdir=\'$(STAGING_DIR)/usr/lib\',g" $(STAGING_DIR)/usr/lib/libpng12.la
+$(LIBPNG_HOOK_POST_INSTALL):
 	$(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" \
 		-e "s,^exec_prefix=.*,exec_prefix=\'$(STAGING_DIR)/usr\',g" \
 		-e "s,^includedir=.*,includedir=\'$(STAGING_DIR)/usr/include/libpng12\',g" \
 		-e "s,^libdir=.*,libdir=\'$(STAGING_DIR)/usr/lib\',g" \
 		$(STAGING_DIR)/usr/bin/libpng12-config
-	touch -c $@
+	touch $@
 
-$(TARGET_DIR)/usr/lib/libpng.so: $(STAGING_DIR)/usr/lib/libpng.so
-	cp -dpf $(STAGING_DIR)/usr/lib/libpng*.so* $(TARGET_DIR)/usr/lib/
-	-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libpng*
-
-png libpng: uclibc zlib pkgconfig $(TARGET_DIR)/usr/lib/libpng.so
-
-libpng-clean:
-	-$(MAKE) -C $(LIBPNG_DIR) clean
-
-libpng-dirclean:
-	rm -rf $(LIBPNG_DIR)
-
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(strip $(BR2_PACKAGE_LIBPNG)),y)
-TARGETS+=libpng
-endif
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"laird" == laird <[email protected]> writes:

laird> Author: laird
laird> Date: 2008-10-29 05:49:38 -0700 (Wed, 29 Oct 2008) laird> New Revision: 23851

laird> Log:
laird> package/libpng/libpng.mk: Change to autotools.in format

laird> Move libpng into the new era.....

Cool.

laird> +LIBPNG_CONF_ENV = \

 laird>  		ac_cv_have_decl_malloc=yes \
 laird>  		gl_cv_func_malloc_0_nonnull=yes \
 laird>  		ac_cv_func_malloc_0_nonnull=yes \
 laird>  		ac_cv_func_calloc_0_nonnull=yes \

laird> - ac_cv_func_realloc_0_nonnull=yes \

We have a BR2_AC_CV_FUNC_MALLOC_0_NONNULL for this (it seems to be missing calloc though).

laird> +LIBPNG_CONF_OPT = \
laird> --without-libpng-compat \
laird> - --without-x \
laird> - )
laird> - touch $@
laird> + --without-x

Does libpng configure really have a --without-x option? I'm pretty sure it doesn't.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

I just did the port to Autotools.in first and now I will do a tidy up.......

Cheers
Dan

#3 lore raw
In reply to Peter Korsgaard

The BR2_AC_CV_FUNC_MALLOC_0_NONNULL value seems to depend up a value called MALLOC_GLIBC_COMPAT. This is only set in the uClibC config files. This means GLIBC based external toolchains cant use this BR2_AC_CV_FUNC_MALLOC_0_NONNULL if they want it set to yes like libpng does.

1. We could add the calloc stuff
2. We could have
ac_cv_have_decl_malloc=yes \
gl_cv_func_malloc_0_nonnull=yes \
ac_cv_func_malloc_0_nonnull=yes \
ac_cv_func_calloc_0_nonnull=yes \
ac_cv_func_realloc_0_nonnull=yes

When using an external toolchain as well

Any thoughts?

Cheers
Dan

-----Original Message-----
From: [email protected] [mailto:buildroot-bounces at uclibc.org] On Behalf Of Peter Korsgaard
Sent: 2008 Oct 29 13:53
To: buildroot at uclibc.org
Subject: Re: [Buildroot] svn commit: trunk/buildroot/package/libpng

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"laird" == laird <[email protected]> writes:

laird> Author: laird
laird> Date: 2008-10-29 05:49:38 -0700 (Wed, 29 Oct 2008) laird> New Revision: 23851

laird> Log:
laird> package/libpng/libpng.mk: Change to autotools.in format

laird> Move libpng into the new era.....

Cool.

laird> +LIBPNG_CONF_ENV = \

 laird>  		ac_cv_have_decl_malloc=yes \
 laird>  		gl_cv_func_malloc_0_nonnull=yes \
 laird>  		ac_cv_func_malloc_0_nonnull=yes \
 laird>  		ac_cv_func_calloc_0_nonnull=yes \

laird> - ac_cv_func_realloc_0_nonnull=yes \

We have a BR2_AC_CV_FUNC_MALLOC_0_NONNULL for this (it seems to be missing calloc though).

laird> +LIBPNG_CONF_OPT = \
laird> --without-libpng-compat \
laird> - --without-x \
laird> - )
laird> - touch $@
laird> + --without-x

Does libpng configure really have a --without-x option? I'm pretty sure it doesn't.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot at uclibc.org
http://busybox.net/mailman/listinfo/buildroot
#4 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Daniel" == Daniel J Laird <[email protected]> writes:

Daniel> The BR2_AC_CV_FUNC_MALLOC_0_NONNULL value seems to depend up a value called MALLOC_GLIBC_COMPAT. This is only set in the uClibC config files. This means GLIBC based external toolchains cant use this BR2_AC_CV_FUNC_MALLOC_0_NONNULL if they want it set to yes like libpng does. Daniel> 1. We could add the calloc stuff
Daniel> 2. We could have
Daniel> ac_cv_have_decl_malloc=yes \
Daniel> gl_cv_func_malloc_0_nonnull=yes \
Daniel> ac_cv_func_malloc_0_nonnull=yes \
Daniel> ac_cv_func_calloc_0_nonnull=yes \
Daniel> ac_cv_func_realloc_0_nonnull=yes

Daniel> When using an external toolchain as well

Or provide an option to let the user set it to whatever their toolchain does. I'm not familiar with the external toolchain stuff, how's the other toolchain settins handled (largefile, locales, wchar, ..)?

Signature · 1 line
Bye, Peter Korsgaard