weirdness with ada/Make-lang.in on 3.4 branch
Joel Sherrill
joel.sherrill@oarcorp.com
Tue Mar 16 15:45:00 GMT 2004
Jim Wilson wrote:
> Joel Sherrill wrote:
>
>> I have
>> noticed that when I install the cross gnat tools
>> (XXX-rtems-gnatmake, etc), the native version of the
>> same tool is deleted from ${prefix}/bin.
>
>
> Use "make -d" instead of just "make". Pipe the output to a file, and
> then browse through it to see what went wrong.
>
> The install rules come from ada/Make-lang.in, in the
> ada.install-common rule. Just from a casual glance, it appears to be OK.
After more head scratching and searching over multiple log files, I have
a suspicion that the build order is critical. RTEMS is a newlib target
so you only have a C library installed when the toolset being built
is installed. gnatlib requires the C library to be installed. The
procedure
I was using is (simplified):
make
make install
if ada
make cross-gnattools
make ada.all.cross
make gnatlib
make install
This used to use the LANGUAGE override to avoid getting ada at all.
Now the above procedure ends up with gnat1 installed as before the
"if ada" and the 1st make install gets confused because there is a
gnat1 but no gnatmake. It then ends up destroying the native gnat tools
that are installed at the $prefix. I put echos in the following if to
figure this
out:
=======================
-if [ -f gnat1$(exeext) ] ; \
then \
if [ -f gnatmake-cross$(exeext) ] ; \
then \
echo JOELA; \
$(RM)
$(DESTDIR)$(bindir)/$(target_noncanonical)-gnatmake$(exeext); \
$(INSTALL_PROGRAM) gnatmake-cross$(exeext)
$(DESTDIR)$(bindir)/$(target_noncanonical)-gnatmake$(exeext); \
if [ -d $(DESTDIR)$(tooldir)/bin/. ] ; then \
echo JOELB; \
rm -f $(DESTDIR)$(tooldir)/bin/gnatmake$(exeext); \
$(INSTALL_PROGRAM) gnatmake-cross$(exeext)
$(DESTDIR)$(tooldir)/bin/gnatmake$(exeext); \
fi; \
else \
echo JOELC; \
$(RM) $(DESTDIR)$(bindir)/gnatmake$(exeext); \
$(INSTALL_PROGRAM) gnatmake$(exeext)
$(DESTDIR)$(bindir)/gnatmake$(exeext); \
fi ; \
fi
=======================
On the first make install, you get JOELC while on the second you
correctly get JOELA followed by JOELB
I think that where I have the JOELC, there should be a check to
make sure gnatmake exists in the build directory before removing
something at the install point.
Is this a bug or just a fragile procedure for a cross embedded build?
--joel
More information about the Gcc
mailing list