This is the mail archive of the
newlib@sourceware.cygnus.com
mailing list for the newlib project.
newlib include directories during build
- To: newlib at sourceware dot cygnus dot com
- Subject: newlib include directories during build
- From: Joel Sherrill <joel dot sherrill at OARcorp dot com>
- Date: Mon, 03 Apr 2000 11:57:53 -0500
- Organization: OAR Corporation
- Reply-To: joel dot sherrill at OARcorp dot com
Hi,
I have locally noticed a build dependency problem with newlib
and other packages. It is simple to fix but touches a handful
of things other than newlib. I also think that I have found
a specific example of a more general problem -- packages that are
built "FOR A TARGET AND DEPEND ON THE C LIBRARY" have to be
aware of newlib. Right now, there is too much to know to get
it right reliably.
This started when I noticed that the target libiberty has to know
more than I would think proper about newlib to be able to
figure out what is supported. There are complex rules in
libiberty/configure.in to figure out what to build when using
newlib. These should be unnecessary if my approach is followed.
Currently newlib builds a targ-include directory
during configure that does not contain the "portable" .h files
from newlib/include. This requires that every package that
builds for the target has to know to look at targ-include AND
multiple directories within the newlib source. See the
stmp-targ-include stanza in newlib/Makefile.am for details.
This stanza should also put the .h files under newlib/include
in targ-include.
I discovered this because target-libiberty could not figure out what
was supported in newlib. I started to add the path information and
realized that libiberty should not have to know about
newlib/libc/machine and newlib/libc/sys/*.
My solution was pretty simple but is at such a level that I would
like some feedback.
====================================================================
Changes to newlib:
1. Modify stmp-targ-include in newlib/Makefile.am to also install
the .h files in newlib/include
=====================================================================
Changes to libiberty:
NOTE: Likely to apply to other packages built for the target that are
dependent on the C Library. This includes things like the C++
libraries.
1. top level Makefile.in distributed with gcc currently has:
configure-target-libiberty: $(ALL_GCC)
Should be:
configure-target-libiberty: $(ALL_GCC) configure-target-newlib
2. libiberty needs to recognize that when "with newlib", cppflags
needs to have a -I for targ-include. With this, it can figure out
what functionality is in newlib.
=====================================================================
GCC Issue:
I think that if newlib builds targ-include before gcc starts to build
target libraries, then "with newlib" can make sure .../target-include
is included in the target CPPFLAGS. This should be enough to remove
the -Dinhibit_libc.
=====================================================================
I know this is a pretty far reaching report. But it sure seems like
making targ-include complete would simplify things.
--
Joel Sherrill, Ph.D. Director of Research & Development
joel@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985