This is the mail archive of the newlib@sourceware.org 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]
Other format: [Raw text]

Re: [PATCH] Automated the generation of the __NEWLIB__, __NEWLIB_MINOR__ and __NEWLIB_PATCHLEVEL__ macros.


On Thu, Feb 18, 2016 at 04:23:31PM +0000, Andre Vieira (lists) wrote:
> I'm getting build errors when building libgcc:
> fatal error: _newlib_version.h: No such file or directory
>  #include <_newlib_version.h>
> 
> I'm assuming its due to lack of regeneration of some configuration files.

Yes, you're probably right, but I added the following note to my patch:
    Note: This patch does _not_ include the modifications to the following
    files, as these should all be generated any way.

> Help with the magic automake/autoconf/aclocal commands is welcome!

I attached a patch that contains a README.bootstrap and two
bootstrap shell scripts. These files are not perfect, but at
least one could bootstrap and build the newlib part with it.

At the moment the following files do not get generated with the
method, described in README.bootstrap (in the patch), but as
you'll read later, this is _not_ a problem.

# $ git status . |grep deleted |awk '{print $NF}'
# libc/machine/xscale/Makefile.in
# libc/machine/xscale/aclocal.m4
# libc/machine/xscale/configure
# libc/sys/linux/include/rpc/Makefile
# libm/test/Makefile.in
# stamp-h.in

The libc/machine/xscale/ stuff is not set up in the configure.host
file yet, so it won't be generated. 

libc/sys/linux/include/rpc/Makefile probably found its way in there
due to an erroneous commit.

libm/test/Makefile.in has no Makefile.am, and is also not
configured in libm/configure.in, so it won't be generated.

stamp-h.in is an old temporary file, which should be removed
from git. In fact, hundreds of files (actually 510 files,
over a million lines) are redundant, but for some reason,
checked into git.

Here's the proof:
$ find . -type f -name aclocal.m4 |xargs rm -f
$ find . -type d -name autom4te.cache |xargs rm -rf
$ find . -type f -name config.guess |xargs rm -f
$ find . -type f -name config.log |xargs rm -f
$ find . -type f -name config.status |xargs rm -f
$ find . -type f -name config.sub |xargs rm -f
$ find . -type f -name configure |xargs rm -f
$ find . -type f -name stamp\-\* |xargs rm -rf
$ find . -type f -name Makefile |xargs rm -f
$ find . -type f -name Makefile.in |xargs rm -f
$ git diff --stat |tail -1
 510 files changed, 3 insertions(+), 1135934 deletions(-)

I would like to remove these, but I'll post a patch for
that, once:
  - I'm sure that it's OK with the maintainers.
    @maintainers: May I?
  - I have figured out a bootstrap for libgloss/.
    I guess I'll have to RTFM ;)
    The winsup/ directory seems to rely on autogen.sh, so
    I'll leave that, as is.

FYI, I used the following tool versions:

$ libtoolize --version
libtoolize (GNU libtool) 2.4.6
Written by Gary V. Vaughan <gary@gnu.org>, 2003

Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ autoconf --version
autoconf (GNU Autoconf) 2.64
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later
<http://gnu.org/licenses/old-licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.

$ automake --version
automake (GNU automake) 1.12
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Tom Tromey <tromey@redhat.com>
and Alexandre Duret-Lutz <adl@gnu.org>.
       
$ gcc --version
gcc (Debian 5.3.1-8) 5.3.1 20160205
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

--
Pieter du Preez
>From 0431d45660cf866854da014f5313beeb79cade2c Mon Sep 17 00:00:00 2001
From: Pieter du Preez <pdupreez@gmail.com>
Date: Thu, 18 Feb 2016 21:28:24 +0100
Subject: [PATCH] Added some bootstrapping stuff for newlib.

Signed-off-by: Pieter du Preez <pdupreez@gmail.com>
---
 README.bootstap  | 11 +++++++++++
 bootstrap        | 18 ++++++++++++++++++
 newlib/bootstrap | 17 +++++++++++++++++
 3 files changed, 46 insertions(+)
 create mode 100644 README.bootstap
 create mode 100755 bootstrap
 create mode 100755 newlib/bootstrap

diff --git a/README.bootstap b/README.bootstap
new file mode 100644
index 0000000..a6c3309
--- /dev/null
+++ b/README.bootstap
@@ -0,0 +1,11 @@
+Using the bootstrap scripts
+===========================
+
+The following only covers bootstrapping (generating new Makefiles)
+and building for the newlib/ directory. It does not cover libgloss/
+and possible others.
+
+1. Run './bootstrap' in this directory.
+2. cd newlib
+3. Run './bootstrap' in the newlib/ directory.
+4. Run 'make clean all' in the newlib/ directory.
diff --git a/bootstrap b/bootstrap
new file mode 100755
index 0000000..e6613bc
--- /dev/null
+++ b/bootstrap
@@ -0,0 +1,18 @@
+#!/bin/sh -x
+
+find . -type f -name aclocal.m4 |xargs rm -f
+find . -type d -name autom4te.cache |xargs rm -rf
+find . -type f -name config.guess |xargs rm -f
+find . -type f -name config.log |xargs rm -f
+find . -type f -name config.status |xargs rm -f
+find . -type f -name config.sub |xargs rm -f
+find . -type f -name configure |xargs rm -f
+find . -type f -name stamp\-\* |xargs rm -rf
+find . -type f -name Makefile |xargs rm -f
+find . -type f -name Makefile.in |xargs rm -f
+
+aclocal \
+&& autoconf \
+&& autogen Makefile.def \
+&& (automake --add-missing || true) \
+&& ./configure
diff --git a/newlib/bootstrap b/newlib/bootstrap
new file mode 100755
index 0000000..bf9f4dd
--- /dev/null
+++ b/newlib/bootstrap
@@ -0,0 +1,17 @@
+#!/bin/sh -x
+
+find . -type f -name aclocal.m4 |xargs rm -f
+find . -type d -name autom4te.cache |xargs rm -rf
+find . -type f -name config.guess |xargs rm -f
+find . -type f -name config.log |xargs rm -f
+find . -type f -name config.status |xargs rm -f
+find . -type f -name config.sub |xargs rm -f
+find . -type f -name configure |xargs rm -f
+find . -type f -name stamp\-\* |xargs rm -rf
+find . -type f -name Makefile |xargs rm -f
+find . -type f -name Makefile.in |xargs rm -f
+
+aclocal -I.. \
+&& (autoreconf || true) \
+&& automake \
+&& ./configure
-- 
2.7.0


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