[uClibc] [PATCH] fix makefile when not cross-compiling.

Erik Andersen andersen at codepoet.org
Mon Sep 1 17:52:26 UTC 2003


On Tue Aug 19, 2003 at 08:37:26AM -0400, Rob Landley wrote:
> Here's a patch to fix it.  If we're not cross-compiling, and the target has
> an asm symlink or directory already, just use it.  (This may even allow
> uclibc to compile against the sanitized glibc-headers or some such, I
> haven't tried it...)  If you're compiling against a freshly extracted
> kernel source tarball, or cross-compiling, the logic should be unchanged.
> 
> --- uClibc-old/Makefile 2003-06-30 14:22:43.000000000 -0400
> +++ uClibc-0.9.20/Makefile      2003-08-19 08:15:30.849333136 -0400
> @@ -120,7 +120,10 @@
> 
>  headers: include/bits/uClibc_config.h
>         rm -f include/asm;
> -       @if [ "$(TARGET_ARCH)" = "powerpc" ];then \
> +       @if [ $(CROSS)x == x ] && \
> +           [ -f "$(KERNEL_SOURCE)/include/asm/unistd.h" ]; then  \
> +               ln -fs $(KERNEL_SOURCE)/include/asm include/asm; \
> +       elif [ "$(TARGET_ARCH)" = "powerpc" ];then \
>             ln -fs $(KERNEL_SOURCE)/include/asm-ppc include/asm; \
>         elif [ "$(TARGET_ARCH)" = "mips" ];then \
>             ln -fs $(KERNEL_SOURCE)/include/asm-mips include/asm; \

Stepping back a bit and looking at the larger picture...  I think
there are really just a few cases we need to deal with.  The
first is the trivial case where the specified kernel headers are
entirely missing.  That is easy to deal with by aborting the
build.

The next case is where we have kernel headers provided by an
already configured kernel source tree, where the include/asm-*
symlink matches the arch for which uClibc is being built.  That
is of course also trivial, since nothing needs to be done.  

Anything beyond those two cases and we basically have to guess...
I just removed most of the guessing stuff and moved it into a
standalone shell script (extra/scripts/fix_includes.sh).  Care to
see if the latest and greatest is working for you as expected?

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the uClibc mailing list