This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch for newlib/Makefile.am


Joel Sherrill wrote:
> 
> 
> Content-Type: multipart/mixed;
>  boundary="------------5C025487B59045A712A05F6E"
> 
> This is a multi-part message in MIME format.
> --------------5C025487B59045A712A05F6E
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> 
> This patch corrects the way newlib/Makefile.am passes
> information to subordinate Makefiles.
> 
> This patch is the results of discussions on the RTEMS list
> with some feedback from Ian Lance Taylor.   We tripped this
> while trying to build distributable tool binaries for various
> hosts.  In particular, the override of $prefix during
> "make install" by RPMs tripped problems.
> 
> Ralf's explanation and part of an email thread when I
> asked him to refresh my memory follow:
> 
> ------------
> 
> They are multilib related bug fixes to newlib:
> 
> 1. INSTALL can be a relative path to $(top_srcdir)/install.sh, so
> passing INSTALL=$(INSTALL) will incorrectly override the correct
> autoconf detected values inside of the Makefiles. This bug rarely is
> visible, because on most hosts another install but install-sh will
> get used.
> 
> Deinstall install on you build host and you'll probably see this
> issue.
> 
> 2. If not adding AM_MAKEFLAGS to FLAGS_TO_PASS, they will get lost
> and multilibs will not get installed correctly. - I have just found
> the relevant mail from an discussion with Ian (forward will follow)
> -------------------
> Ian's Mail...
> 
> >
> >          Ian Lance Taylor <ian@zembu.com>
> >                                                                      10/21/99 23:50
> >
> >  Subject:
> >          Re: [Fwd: newlib does not honor overriding $prefix]
> >      To:
> >          corsepiu@faw.uni-ulm.de
> >      CC:
> >          joel.sherrill@OARcorp.com
> >
> >
> >
> >    Date: Fri, 22 Oct 1999 01:57:33 +0200
> >    From: Ralf Corsepius <corsepiu@faw.uni-ulm.de>
> >
> >    * Later we try to install to /tmp/opt/rtems using this:
> >
> >    make prefix=/tmp/opt/rtems install
> >
> >    Now the observation is that all files except newlib's multilibs get
> >    installed to /tmp/opt/rtems.
> >
> >    I assume that $prefix might get lost somewhere between
> >    build/<target_alias>/newlib/Makefile.am, probably in multi-do, ie. in
> >    config-ml.in generated parts of newlib/Makefile.
> >
> >    If I add this patch to gcc-2.95.1/config-ml.in
> >
> >    --- gcc-2.95.1.orig/config-ml.in        Tue Apr 13 16:46:07 1999
> >    +++ gcc-2.95.1/config-ml.in     Thu Oct 21 16:48:13 1999
> >    @@ -430,6 +430,7 @@
> >                  if [ -d ../$${dir}/$${lib} ]; then \
> >                    flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
> >                    if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \
> >    +                               prefix="$(prefix)" \
> >                                    CFLAGS="$(CFLAGS) $${flags}" \
> >                                    CXXFLAGS="$(CXXFLAGS) $${flags}" \
> >                                    LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
> >
> >
> >    all newlib's multilibed libraries get correctly installed to /tmp/opt/rtems
> >    when using "make prefix=/tmp/opt/rtems install".
> >
> >    I assume this might not the correct fix, but it may give you some indication
> >    on what might be going wrong.
> >
> >    My gut feeling is telling me that AM_MAKEFLAGS possibly should be passed to
> >    MAKE in multi-do (the fragment generated by the stanza from config-ml.in
> >    above) in newlib/Makefile.am. At least adding FLAGS_TO_PASS=$(AM_MAKEFLAGS)
> >    to newlib/Makefile.am also seems to fix our problem.
> >
> > GNU make normally passes down command line arguments automatically in
> > the definition of $(MAKE).  So ordinarily the recursive invocation
> > would include the command line definition of prefix.  However, the
> > newlib Makefile.am file sets MAKEOVERRIDES, which prevents this.
> > There was some good reason to set this, but I no longer remember what
> > it was.
> >
> > I think that setting FLAGS_TO_PASS in newlib/Makefile.am, as you
> > suggest, is the right fix.
> >
> > Ian
> >
> =======================================
> 
> And now the ChangeLog entry:
> 
> 2000-12-06      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
> 
>         * Makefile.am: $(INSTALL), $(INSTALL_DATA), and
> $(INSTALL_PROGRAM)
>         can be a relative path to $(top_srcdir)/install.sh so ensure the
>         autoconf detected settings are properly passed recursively.
>         Similarly, add AM_MAKEFLAGS to FLAGS_TO_PASS so they also get
> passed
>         properly to subdirectories.
>

Patch has been checked in.

-- Jeff J.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]