From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17110 invoked by alias); 7 Jul 2011 20:22:57 -0000 Received: (qmail 17087 invoked by uid 22791); 7 Jul 2011 20:22:55 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,TO_NO_BRKTS_PCNT,TW_GC,TW_IB,TW_JW X-Spam-Check-By: sourceware.org Received: from einhorn.in-berlin.de (HELO einhorn.in-berlin.de) (192.109.42.8) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Jul 2011 20:22:41 +0000 X-Envelope-From: doko@ubuntu.com Received: from [192.168.42.17] (dslb-088-073-111-027.pools.arcor-ip.net [88.73.111.27]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id p67KMdmY032354; Thu, 7 Jul 2011 22:22:39 +0200 Message-ID: <4E16158D.3060206@ubuntu.com> Date: Thu, 07 Jul 2011 20:22:00 -0000 From: Matthias Klose User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 MIME-Version: 1.0 To: java-patches@gcc.gnu.org CC: GCC Patches Subject: Re: [patch] Disable static build for libjava References: <4E15DE84.5030809@ubuntu.com> <4E15E3F6.3050502@cavium.com> <4E15E56E.4070209@ubuntu.com> <4E15E6AF.4050508@cavium.com> <4E15F34D.7050800@redhat.com> In-Reply-To: <4E15F34D.7050800@redhat.com> Content-Type: multipart/mixed; boundary="------------090808020607090205080002" X-IsSubscribed: yes Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2011-q3/txt/msg00013.txt.bz2 This is a multi-part message in MIME format. --------------090808020607090205080002 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 1741 On 07/07/2011 07:56 PM, Andrew Haley wrote: > On 07/07/11 18:02, David Daney wrote: >> On 07/07/2011 09:57 AM, Matthias Klose wrote: >>> On 07/07/2011 06:51 PM, David Daney wrote: >>>> On 07/07/2011 09:27 AM, Matthias Klose wrote: >>>>> As discussed at the Google GCC gathering, disable the build of static libraries >>>>> in libjava, which should cut the build time of libjava by 50%. The static >>>>> libjava build isn't useful out of the box, and I don't see it packaged by Linux >>>>> distributions either. >>>>> >>>>> The AC_PROG_LIBTOOL check is needed to get access to the enable_shared macro. >>>>> I'm unsure about the check in the switch construct. Taken from libtool.m4, and >>>>> determining the value of enable_shared_with_static_runtimes. >>>>> >>>>> Ok for the trunk? >>>>> >>>>> 2011-07-07 Matthias Klose >>>>> >>>>> * Makefile.def (target_modules/libjava): Pass >>>>> $(libjava_disable_static). >>>>> * configure.ac: Check for libtool, pass --disable-static >>>>> in libjava_disable_static. >>>>> * Makefile.in: Regenerate. >>>>> * configure: Likewise. >>>>> >>>> >>>> My autoconf fu is not what it used to be. It is fine if static libraries are >>>> disabled by default, but it should be possible to enable them from the configure >>>> command line. It is unclear to me if this patch does that. >>> >>> no. I assume an extra option --enable-static-libjava would be needed. >> >> Not being a libjava maintainer, I cannot force you to add something like >> that as part of the patch, but I think it would be a good idea. > > I think so. Here is the updated patch, including the --enable-static-libjava option ok for the trunk? Matthias --------------090808020607090205080002 Content-Type: text/x-diff; name="j.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="j.diff" Content-length: 2935 gcc/ 2011-07-07 Matthias Klose * doc/install.texi: Document --enable-static-libjava. 2011-07-07 Matthias Klose * Makefile.tpl (EXTRA_CONFIGARGS_LIBJAVA): Define. * Makefile.def (target_modules/libjava): Pass $(EXTRA_CONFIGARGS_LIBJAVA). * configure.ac: Check for libtool, pass --disable-static in EXTRA_CONFIGARGS_LIBJAVA, if not configured with --enable-static-libjava. * Makefile.in: Regenerate. * configure: Likewise. Index: gcc/doc/install.texi =================================================================== --- gcc/doc/install.texi (revision 175964) +++ gcc/doc/install.texi (working copy) @@ -1956,6 +1956,10 @@ @item --enable-browser-plugin Build the gcjwebplugin web browser plugin. +@item --enable-static-libjava +Build static libraries in libjava. The default is to only build shared +libraries if the target supports shared libraries. + @table @code @item ansi Use the single-byte @code{char} and the Win32 A functions natively, Index: Makefile.tpl =================================================================== --- Makefile.tpl (revision 175964) +++ Makefile.tpl (working copy) @@ -319,6 +319,8 @@ HOST_LIBELFLIBS = @libelflibs@ HOST_LIBELFINC = @libelfinc@ +EXTRA_CONFIGARGS_LIBJAVA = @EXTRA_CONFIGARGS_LIBJAVA@ + # ---------------------------------------------- # Programs producing files for the BUILD machine # ---------------------------------------------- Index: Makefile.def =================================================================== --- Makefile.def (revision 175964) +++ Makefile.def (working copy) @@ -132,7 +132,8 @@ target_modules = { module= winsup; }; target_modules = { module= libgloss; no_check=true; }; target_modules = { module= libffi; }; -target_modules = { module= libjava; raw_cxx=true; }; +target_modules = { module= libjava; raw_cxx=true; + extra_configure_flags="$(EXTRA_CONFIGARGS_LIBJAVA)"; }; target_modules = { module= zlib; }; target_modules = { module= boehm-gc; }; target_modules = { module= rda; }; Index: configure.ac =================================================================== --- configure.ac (revision 175964) +++ configure.ac (working copy) @@ -443,7 +443,27 @@ ;; esac +AC_ARG_ENABLE(static-libjava, +[AS_HELP_STRING([[--enable-static-libjava[=ARG]]], + [build static libjava @<:@default=no@:>@])], +ENABLE_STATIC_LIBJAVA=$enableval, +ENABLE_STATIC_LIBJAVA=no) +enable_static_libjava= +if test "${ENABLE_STATIC_LIBJAVA}" = "yes" ; then + enable_static_libjava=yes +fi +AC_PROG_LIBTOOL +if test x$enable_shared = xyes && test x$enable_static_libjava != xyes ; then + case $host_cpu in + cygwin* | mingw* | pw32* | cegcc*) + ;; + *) + EXTRA_CONFIGARGS_LIBJAVA=--disable-static + esac +fi +AC_SUBST(EXTRA_CONFIGARGS_LIBJAVA) + # Disable libmudflap on some systems. if test x$enable_libmudflap = x ; then case "${target}" in --------------090808020607090205080002--