target library dependancies (was Re: [PATCH] Don't build libzgcj all the time)

Phil Edwards pedwards@disaster.jaj.com
Sat Nov 18 19:14:00 GMT 2000


On Tue, Nov 14, 2000 at 05:20:53PM -0500, DJ Delorie wrote:
> 
> All I meant was some generic "extra_target_libs" that's built based on
> other config options.  We'd add zlib if java was enabled, libstdc++ if
> C++ is enabled, etc.  IIRC, your patch had a $target_zlib variable,
> which isn't very generic.

Oh, it wasn't supposed to be.  :-)

Here's a first cut at a generic solution for target libraries.  I did
three bootstraps with three different values for '--enable-languages':

    + with 'c', we build libiberty
    + with 'c++', we build libiberty and libstdc++-vN
    + with no language restrictions (i.e., all langs), we build libiberty,
      libstdc++-vN, libf2c, libobjc, and zlib.

The larval patch below only addresses libstdc++-vN (where N is determined
earlier in the script) and zlib.  We've already had some bug reports
about the v3 library trying to build when C++ hasn't been enabled.
I haven't tried to do anything with libjava, or FORTRAN, or any of the
other langauges' libraries.

PROBLEM:  entries have to be added twice, once for "language foo explicitly
listed by the user," and again for "the default configuration of all
languages."  This bugs me, but since that part of the script shouldn't
be edited very often, maybe a stern comment is all we would need.  (Ha,
yeah, right.)  I'd appreciate any suggestions on how to clean that up
before submitting this for approval.


Phil


Index: configure.in
===================================================================
RCS file: /cvs/gcc/egcs/configure.in,v
retrieving revision 1.73
diff -c -3 -p -r1.73 configure.in
*** configure.in	2000/11/18 22:06:40	1.73
--- configure.in	2000/11/19 03:02:48
*************** fi
*** 63,82 ****
  # know that we are building the simulator.
  host_tools="texinfo byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext zip"
  
  # these libraries are built for the target environment, and are built after
  # the host libraries and the host tools (which may be a cross compiler)
  #
! target_libs="target-libiberty \
  		target-libgloss \
  		target-newlib \
  		target-librx \
- 		${libstdcxx_version} \
  		target-libg++ \
  		target-libf2c \
  		target-libchill \
  		target-libffi \
  		target-libjava \
- 		target-zlib \
  		target-boehm-gc \
  		target-qthreads \
  		target-libobjc"
--- 63,96 ----
  # know that we are building the simulator.
  host_tools="texinfo byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext zip"
  
+ # Based on configuration parameters, we additionally build certain target
+ # libraries, e.g., if C++ is not a configured languages, don't bother trying
+ # to build a C++ library.
+ target_extra_libs=
+ case x"$enable_languages" in
+     x|xall)   target_extra_libs="${target_extra_libs} ${libstdcxx_version} \
+                                   target-zlib"
+               ;;
+     *java* )  target_extra_libs="${target_extra_libs} target-zlib"
+               ;;
+     *c++* )   target_extra_libs="${target_extra_libs} ${libstdcxx_version}"
+               ;;
+     *)        ;;
+ esac
+ 
  # these libraries are built for the target environment, and are built after
  # the host libraries and the host tools (which may be a cross compiler)
  #
! target_libs="${target_extra_libs} \
!                   target-libiberty \
  		target-libgloss \
  		target-newlib \
  		target-librx \
  		target-libg++ \
  		target-libf2c \
  		target-libchill \
  		target-libffi \
  		target-libjava \
  		target-boehm-gc \
  		target-qthreads \
  		target-libobjc"


More information about the Gcc-patches mailing list