From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21176 invoked by alias); 23 Nov 2011 11:53:18 -0000 Received: (qmail 21165 invoked by uid 22791); 23 Nov 2011 11:53:17 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-yw0-f41.google.com (HELO mail-yw0-f41.google.com) (209.85.213.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Nov 2011 11:53:02 +0000 Received: by ywm14 with SMTP id 14so475975ywm.0 for ; Wed, 23 Nov 2011 03:53:02 -0800 (PST) Received: by 10.50.158.227 with SMTP id wx3mr27109239igb.52.1322049181806; Wed, 23 Nov 2011 03:53:01 -0800 (PST) Received: from [192.168.1.56] ([58.37.193.48]) by mx.google.com with ESMTPS id g16sm72574348ibs.8.2011.11.23.03.52.54 (version=SSLv3 cipher=OTHER); Wed, 23 Nov 2011 03:53:01 -0800 (PST) Message-ID: <4ECCDE85.7090308@linaro.org> Date: Wed, 23 Nov 2011 11:53:00 -0000 From: Zhenqiang Chen User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: yann.morin.1998@anciens.enib.fr CC: crossgcc@sourceware.org Subject: [updated zlib PATCH 1 of 3] complibs/zlib: add zlib support Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org X-SW-Source: 2011-11/txt/msg00149.txt.bz2 # HG changeset patch # User Zhenqiang Chen # Date 1322037095 -28800 # Node ID ffb01c946be470adbd63b2a2f4784bd01fa25771 # Parent 2f4e3c312b659422e4a9950f13a0fc507b97c1fd complibs/zlib: add zlib as a companion library Use our own version to remove dependence on system zlib in case users want to run the binary toolchains on different systems. e.g. build toolchains on a 32-bit system and run on a 64-bit system. Signed-off-by: Zhenqiang Chen diff --git a/config/companion_libs.in b/config/companion_libs.in --- a/config/companion_libs.in +++ b/config/companion_libs.in @@ -37,6 +37,9 @@ select LIBELF select COMPLIBS_NEEDED +config ZLIB_NEEDED + bool + config COMPLIBS bool diff --git a/patches/zlib/1.2.5/zlib-1.2.5.patch b/patches/zlib/1.2.5/zlib-1.2.5.patch new file mode 100644 --- /dev/null +++ b/patches/zlib/1.2.5/zlib-1.2.5.patch @@ -0,0 +1,19 @@ +diff --git a/Makefile.in b/Makefile.in +index 5b15bd0..6817b94 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -167,8 +167,12 @@ install-libs: $(LIBS) + -@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi + -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi + -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi +- cp $(STATICLIB) $(DESTDIR)$(libdir) +- cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir) ++ if [ "x$(STATICLIB)" != "x" ] && [ -e $(STATICLIB) ] ; then \ ++ cp $(STATICLIB) $(DESTDIR)$(libdir) ; \ ++ fi ++ if [ "x$(SHAREDLIBV)" != "x" ] && [ -e $(SHAREDLIBV) ] ; then \ ++ cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir) ; \ ++ fi + cd $(DESTDIR)$(libdir); chmod u=rw,go=r $(STATICLIB) + -@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 + -@cd $(DESTDIR)$(sharedlibdir); if test "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \ diff --git a/scripts/build/companion_libs/zlib.sh b/scripts/build/companion_libs/zlib.sh new file mode 100644 --- /dev/null +++ b/scripts/build/companion_libs/zlib.sh @@ -0,0 +1,50 @@ +# This file adds the functions to build the ZLIB library +# Copyright 2011 Michael Edwards +# Licensed under the GPL v2. See COPYING in the root of this package + +do_zlib_get() { :; } +do_zlib_extract() { :; } +do_zlib() { :; } + +CT_ZLIB_VERSION="1.2.5" +# Override functions depending on configuration +if [ "${CT_ZLIB_NEEDED}" = "y" ]; then + +do_zlib_get() { + CT_GetFile "zlib-${CT_ZLIB_VERSION}" .tar.gz \ + http://sourceforge.net/projects/libpng/files +} + +do_zlib_extract() { + CT_Extract "zlib-${CT_ZLIB_VERSION}" + CT_Patch "zlib" "${CT_ZLIB_VERSION}" +} + +do_zlib() { + mkdir -p "${CT_BUILD_DIR}/build-zlib" + cd "${CT_BUILD_DIR}/build-zlib" + + CT_DoStep INFO "Installing zlib" + + cp -a "${CT_SRC_DIR}/zlib-${CT_ZLIB_VERSION}" "${CT_BUILD_DIR}/build-zlib" + CT_Pushd "${CT_BUILD_DIR}/build-zlib/zlib-${CT_ZLIB_VERSION}" + + CT_DoLog EXTRA "Configuring zlib" + + CT_DoExecLog CFG \ + CFLAGS="${CT_CFLAGS_FOR_HOST}" \ + CXXFLAGS="${CT_CFLAGS_FOR_HOST}" \ + ./configure --prefix="${CT_COMPLIBS_DIR}/zlib" \ + --static + + CT_DoLog EXTRA "Building zlib" + CT_DoExecLog ALL make ${JOBSFLAGS} + + CT_DoLog EXTRA "Installing zlib" + CT_DoExecLog ALL make install + + CT_Popd + CT_EndStep +} + +fi # CT_ZLIB_NEEDED diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in --- a/scripts/crosstool-NG.sh.in +++ b/scripts/crosstool-NG.sh.in @@ -117,6 +117,7 @@ . "${CT_LIB_DIR}/scripts/build/companion_libs/cloog.sh" . "${CT_LIB_DIR}/scripts/build/companion_libs/mpc.sh" . "${CT_LIB_DIR}/scripts/build/companion_libs/libelf.sh" +. "${CT_LIB_DIR}/scripts/build/companion_libs/zlib.sh" . "${CT_LIB_DIR}/scripts/build/binutils/binutils.sh" . "${CT_LIB_DIR}/scripts/build/binutils/elf2flt.sh" . "${CT_LIB_DIR}/scripts/build/binutils/sstrip.sh" @@ -527,6 +528,7 @@ do_cloog_get do_mpc_get do_libelf_get + do_zlib_get do_binutils_get do_elf2flt_get do_sstrip_get @@ -557,6 +559,7 @@ do_cloog_extract do_mpc_extract do_libelf_extract + do_zlib_extract do_binutils_extract do_elf2flt_extract do_sstrip_extract diff --git a/steps.mk b/steps.mk --- a/steps.mk +++ b/steps.mk @@ -23,6 +23,7 @@ cloog \ mpc \ libelf \ + zlib \ binutils \ elf2flt \ sstrip \ -- For unsubscribe information see http://sourceware.org/lists.html#faq