This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH to pre-select languages to be build (was: Re: No Fortran - IS ANYBODY WORKING ON IT?)
- To: manfred at s-direktnet dot de, Manfred dot Hollstein at ks dot sel dot alcatel dot de
- Subject: Re: PATCH to pre-select languages to be build (was: Re: No Fortran - IS ANYBODY WORKING ON IT?)
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 30 Sep 1998 03:19:22 -0600
- cc: burley at gnu dot org, jbuck at synopsys dot com, pfeifer at dbai dot tuwien dot ac dot at, egcs at cygnus dot com
- Reply-To: law at cygnus dot com
In message <13840.57066.10628.804866@slsvhmt>you write:
> On Wed, 16 September 1998, 08:39:53, manfred@s-direktnet.de wrote:
>
> > On Tue, 15 September 1998, 02:10:15, law@cygnus.com wrote:
> >
> > >
> > > This kind of scheme works better if we ever have an option to
> > > enable/disable a language at configure time. ie --disable-chill
> > > or something like that to disable the chill compiler, even if
> > > it is in your source tree and you don't remember LANGUAGES="..." :-)
> >
> > Is anybody working on this already? I'd like to implement this as I've
> > stumbled across this especially on my damn slow 68k machine (which is
> > - even worse - using multilibs :-( ); but unfortunately I'm rather
> > busy doing other things at the moment, I guess I'll be having a patch
> > available in 1 to 2 weeks. OK?
> >
> > manfred
>
> The approach you were talking about assumes, everybody who wants to
> restrict the languages to a particular subset
>
> - knows which languages do exist and which do I want.
>
> My patch below goes the other way round. It's based on the assumption
> that most people
>
> - know which languages they actually want to build.
>
> If the "--disable-chill" would have been available before the recent
> languages had been introduced, all users, that only wanted "c c++" to
> be built, would still get the new compilers, simply because they
> didn't know such a beast exists.
I think there's a much simpler way to do this. Something like this in gcc/configure.in
# Figure out what language subdirectories are present.
subdirs=
for lang in ${srcdir}/*/config-lang.in ..
do
case $lang in
..) ;;
# The odd quoting in the next line works around
# an apparent bug in bash 1.12 on linux.
${srcdir}/[[*]]/config-lang.in) ;;
# CYGNUS LOCAL nofortran/law
${srcdir}/f/config-lang.in)
if [[ x$enable_fortran = xyes ]]; then
subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([[^/]]*\)/config-lang.in$,\1,'`"
fi
;;
${srcdir}/objc/config-lang.in)
if [[ x$enable_objc = xyes ]]; then
subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([[^/]]*\)/config-lang.in$,\1,'`"
fi
;;
# END CYGNUS LOCAL
*) subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([[^/]]*\)/config-lang.in$,\1,'`" ;;
esac
done
This is what we're using inside Cygnus to disable fortran & objc. It's easily
extended to handle additional languages and to support a full enable/disable
syntax.
We then have the associated runtime libraries automatically disable themselves
if the proper compiler isn't found in <objdir>/gcc. This should be fairly
simple too, though we haven't actually tried it.
jeff