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