[RFC] build system replacement

Bernhard Fischer rep.dot.nop at gmail.com
Fri Jun 6 13:41:09 UTC 2008

On Tue, Jun 03, 2008 at 04:54:20PM +0200, Bernd Schmidt wrote:
> Bernhard Fischer wrote:
>> I would prefer the attached, completely untested hunks.
>> Please apply if it works for you.
> I'd drop the STRIP_FILES, as only STRIP_T_FILES really makes sense here.
> Also, I noticed that libpthread isn't the only place that does this, so  
> we'll have to expand this a little :-/

Meanwhile i've adjusted those to strip the archives and not their

I attach my corrent improvement WRT header dependencies, installation
and printing prettyness (prettiness? who knows):

1) There was a wrong dependency "include/bits" for the config targets
which tricked make into
-extra/config/conf extra/config/mconf: include/bits
-# TODO: this results in "make[1]: `conf' is up to date" printed
-# on every rebuild, because extra/config/conf is already built
-# on previous make run. Make it "test -x $@ || ..." (simple & a bit wrong)
-# or "make -q -C extra/config $(notdir $@) || ..." (less readable)?

I've renamed it to $(suspicious_dependency) and set it to empty. We will
remove this later.

2) reasons to re-generate include/bits/uClibc_config.h
the script which generates it has to be a prereq, too.
Added a nice disp_gen while at it.

3) libc/sysdeps
libc/sysdeps/linux/{$(TARGET_ARCH,common}/ #excuse that sh+make slang
are linked to include/. _linked_. This means that make(1) will ignore
any symlink's timestamp unless
-L, --check-symlink-times
is specified. Since the sysdep headers are usually older than the
.config, we cannot make include/* depend on uClibc_config.h but do some
kind of indirection.
I solved this the easy (and friendly to eventually broken make(1)s) way
by saying that iff we have to regenerate uClibc_config.h then in this
very rule, we make headers-y.
This is IMHO the cleanest and simplest solution without relying on -L.
Several helper variables were added to Makefile.in that contain
ALL_HEADERS_*. These are in a helper variable target-headers-sysdep and
are added to headers-y (but that's obvious from the patch).

4) header symlinks
Somehow related to 3) above, add pretty-printing for LN
Provide explicit rules to symlink common, arch, subarch specific headers
into include/
This is the block in Makefile.in perusing do_ln

5) headers_clean
The links from 3) and 4) above are put on a prune-list scheduled for
removal. There is a small problem with threads in this respect, goto
EOM for details.

6) pregen and install_dev
pregen generates the stringently important sysnum.h
Versions up to and including 0.9.29-release needed
        # older uClibc without the signum.h generation fix
        set -x && $(MAKE1) -C $(UCLIBC_DIR) \
                PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \
                DEVEL_PREFIX=/usr/ \
                RUNTIME_PREFIX=$(TOOL_BUILD_DIR)/uClibc_dev/ \
                HOSTCC="$(HOSTCC)" \
                BUILD_CFLAGS="$(HOST_CFLAGS)" \
                BUILD_LDFLAGS="$(HOST_LDFLAGS)" \
                pregen install_dev

Since a couple of hundred revisions that pregen is not needed anymore, a
"simple" install_dev will do.
This patch verified that the pure install_dev works fine so one can
build a proper stageN compiler with these headers.

7) other cosmetics
Preparation of do_unifdef, do_mkdir, do_ln
do_ln, disp_ln, cmd_ln could need a cosmetic cleanup to work with it's
arguments. The current patch leaves this as an exercise for the curious
reader (or helpful janitor) and works well otherwise.

I intend to apply this patch in the next few days since it seems
to be correct (afaics) but i'd be happy if somebody who uses powerpc or
bfin regularly could test it. There are two corner-cases that i couldn't
test and i wouldn't be surprised if they wouldn't work out of the box,
although they are supposed to.


The linuxthreads hickup (no pun intended WRT mythological NPTL ;)

Turning off threads doesn't wipe threads-headers from include/
This is a real problem but doesn't affect me since i'm not doing
threads. Nice, eh?
libpthread/Makefile should hardcode clean targets for all available
thread impls.

thanks for taking the time to read that far && cheers,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uClibc.066-makefile-fixup.patch
Type: text/x-diff
Size: 15116 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20080606/73b93249/attachment.bin 

More information about the uClibc mailing list