[RFA] Change how CC, CFLAGS get set

Jeff Johnston jjohnstn@redhat.com
Thu Jul 1 17:38:00 GMT 2004

Christopher Faylor wrote:
> On Mon, Jun 28, 2004 at 08:31:14PM -0400, Jeff Johnston wrote:
>>I have a number of concerns with the patch you have submitted, but no 
>>objections to the concept.
>>First of all, if you go around changing acinclude.m4, then "all" aclocal.m4 
>>files and configure files have to be regenerated in the newlib directory.
>>Second, if you can, please use aclocal-1.4-p6 so as to minimize changes 
>>being introduced.
> I'll try to track that version down.
>>Thirdly, the code moved to acinclude.m4 won't work for lower level 
>>directories because it is using `pwd` which will change the targ-include 
>>directory every time.
> Isn't newlib_basedir set to the top level of newlib by every package?
> It sure seems like that is what is going on in all of the sub-configures.
> If so, then this:
>   abs_newlib_basedir=`cd ${newlib_basedir} && pwd`
> should always equate to the same thing no matter where it's run.  In
> the subjdirectories, it will just get rid of trailing ..'s which bring
> you back to the top.

+# These get added in the top-level configure.in, except in the case where
+# newlib is being built natively.
+LIBC_INCLUDE_GREP=`echo ${CC} | grep \/libc\/include`
+abs_newlib_basedir=`cd ${newlib_basedir} && pwd`
+if test -z "${LIBC_INCLUDE_GREP}"; then
+  newlib_cflags="$newlib_cflags -I$PWD/targ-include 

My apologies.  I meant the $PWD that is used just prior to targ-include.  That 
doesn't work.  The abs_newlib_basedir is the source directory.  You need to 
point to the one targ-include in the build directory.

> cgf

More information about the Newlib mailing list