Re: Generate porting.info in build tree rather than source tree

Torbjorn SVENSSON <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Hi Mike,

Thanks for your reply.

On 2022-10-29 15:32, Mike Frysinger wrote:
> On 28 Oct 2022 17:40, Torbjorn SVENSSON wrote:
>> With the recent improvements in the build system by Mike Frysinger, I've
>> noticed a minor regression.
> 
> this is not new behavior.  you can check out newlib-4.1.0 which doesn't
> contain any of my build changes and it does the same thing.
> 
>> When building newlib, the file libgloss/doc/porting.info is always
>> created in the source tree rather than the build tree. Looking at the
>> libgloss/Makefile.* files, it appears that this is derived from the
>> libgloss/doc/Makefile.inc line:
>> info_TEXINFOS += %D%/porting.texi
>>
>> To my knowledge (no automake wiz...), %D% is a relative path, so I
>> suppose the generated path should not use $(srcdir), yet the Makefile.in
>> does contain $(srcdir)/doc/porting.info.
>>
>> Would it be possible to have this porting.info file generated in the
>> build tree rather than the source tree to avoid having the source tree
>> in a dirty state after a build?
> 
> this is WAI.  info files are distributed with releases, so it should be
> generated in the source tree.  this is documented here:
> https://www.gnu.org/prep/standards/html_node/Standard-Targets.html#Standard-Targets
>> 'info'
>> Normally a GNU distribution comes with Info files, and that means the Info
>> files are present in the source directory. Therefore, the Make rule for an
>> info file should update it in the source directory. When users build the
>> package, ordinarily Make will not update the Info files because they will
>> already be up to date.
> -mike

Okay, so in that case, something changed in the newlib build process to 
generate and install the porting.info file as it was not required in the 
Arm snapshot included in their 10.3-2021.10 release (commit 
2a3a03972b35377aef8d3d52d873ac3b8fcc512c in newlib tree).

You can find the source tree of the 10.3-2021.10 release here:
https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-src.tar.bz2

In the tarball, there is a build-toolchain.sh that builds newlib using:

  $SRCDIR/$NEWLIB/configure  \
         $NEWLIB_CONFIG_OPTS \
         --target=$TARGET \
         --prefix=$INSTALLDIR_NATIVE \
         --infodir=$INSTALLDIR_NATIVE_DOC/info \
         --mandir=$INSTALLDIR_NATIVE_DOC/man \
         --htmldir=$INSTALLDIR_NATIVE_DOC/html \
         --pdfdir=$INSTALLDIR_NATIVE_DOC/pdf \
         --enable-newlib-io-long-long \
         --enable-newlib-io-c99-formats \
         --enable-newlib-reent-check-verify \
         --enable-newlib-register-fini \
         --enable-newlib-retargetable-locking \
         --disable-newlib-supplied-syscalls \
         --disable-nls
     make -j$JOBS
     make pdf
     make html

According to the build I did yesterday of a more recent snapshot of 
newlib (bfee9c6ab0c3c9a5742e84509d01ec6472aa62c4), the porting.info file 
is generated by the "make -j$JOBS" command.

Please note that I do get porting.info, but not libc.info, libm.info or 
any other .info files in my build. I suppose a build should generate all 
.info files or none from the source tree?

Kind regards,
Torbjörn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.