diff mbox

Disable static build for libjava

Message ID 4E15DE84.5030809@ubuntu.com
State New
Headers show

Commit Message

Matthias Klose July 7, 2011, 4:27 p.m. UTC
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  <doko@ubuntu.com>

        * 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.

Comments

David Daney July 7, 2011, 4:51 p.m. UTC | #1
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<doko@ubuntu.com>
>
>          * 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.

Also I would like to go on record as disagreeing with the statement that 
'static libjava build isn't useful out of the box'

David Daney


> Index: Makefile.def
> ===================================================================
> --- Makefile.def	(revision 175963)
> +++ 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="$(libjava_disable_static)"; };
>   target_modules = { module= zlib; };
>   target_modules = { module= boehm-gc; };
>   target_modules = { module= rda; };
> Index: configure.ac
> ===================================================================
> --- configure.ac	(revision 175963)
> +++ configure.ac	(working copy)
> @@ -443,6 +443,16 @@
>     ;;
>   esac
>
> +AC_PROG_LIBTOOL
> +if test x$enable_shared = xyes ; then
> +  case $host_cpu in
> +  cygwin* | mingw* | pw32* | cegcc*)
> +    ;;
> +  *)
> +    libjava_disable_static=--disable-static
> +  esac
> +fi
> +AC_SUBST(libjava_disable_static)
>
>   # Disable libmudflap on some systems.
>   if test x$enable_libmudflap = x ; then
>
>
Matthias Klose July 7, 2011, 4:57 p.m. UTC | #2
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<doko@ubuntu.com>
>>
>>          * 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.

> Also I would like to go on record as disagreeing with the statement that 'static
> libjava build isn't useful out of the box'

I remember that there were some restrictions with the static library. but maybe
I'm wrong.

  Matthias
David Daney July 7, 2011, 5:02 p.m. UTC | #3
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<doko@ubuntu.com>
>>>
>>>           * 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.

>
>> Also I would like to go on record as disagreeing with the statement that 'static
>> libjava build isn't useful out of the box'
>
> I remember that there were some restrictions with the static library. but maybe
> I'm wrong.
>

There are restrictions, but it is still useful for some embedded 
environments.

David Daney
diff mbox

Patch

Index: Makefile.def
===================================================================
--- Makefile.def	(revision 175963)
+++ 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="$(libjava_disable_static)"; };
 target_modules = { module= zlib; };
 target_modules = { module= boehm-gc; };
 target_modules = { module= rda; };
Index: configure.ac
===================================================================
--- configure.ac	(revision 175963)
+++ configure.ac	(working copy)
@@ -443,6 +443,16 @@ 
   ;;
 esac

+AC_PROG_LIBTOOL
+if test x$enable_shared = xyes ; then
+  case $host_cpu in
+  cygwin* | mingw* | pw32* | cegcc*)
+    ;;
+  *)
+    libjava_disable_static=--disable-static
+  esac
+fi
+AC_SUBST(libjava_disable_static)

 # Disable libmudflap on some systems.
 if test x$enable_libmudflap = x ; then