I'm preparing myself to port newlib to an environment of my own.
Before all, I'm just trying to build newlib in cygwin...
and I'm impressed by the number of difficulties I encounted.
Then, I've tried to join the newlib mailing-list but seems to be dead.
The origin of boring is that a newlib maintainer had the bright idea to create a dirent.h file in the newlib source with the following content :
Code: Select all
/* <dirent.h> includes <sys/dirent.h>, which is this file. On a
system which supports <dirent.h>, this file is overridden by
dirent.h in the libc/sys/.../sys directory. On a system which does
not support <dirent.h>, we will get this file which uses #error to force
an error. */
#ifdef __cplusplus
extern "C" {
#endif
#error "<dirent.h> not supported"
#ifdef __cplusplus
}
#endif
I doubt this piece of code has been tested by the maintainer.
But, trying to find a solution, I invoked GNU configure with the following :
CFLAGS="-nostdinc" CPPFLAGS="-I/usr/include ..."
Then, if CFLAGS is taken into account, CPPFLAGS, not. If I gather CPPFLAGS content with CFLAGS, these compilation options are at the end of the gcc command line, after the newlib includes paths.
Does someone have a solution ?
Thanks for your attention and the suggestion you could make.