* [Buildroot] Improving buildroot
@ 2008-07-25 1:39 Philip Prindeville
2008-07-26 6:49 ` Ulf Samuelsson
0 siblings, 1 reply; 2+ messages in thread
From: Philip Prindeville @ 2008-07-25 1:39 UTC (permalink / raw)
To: buildroot
Hi.
I'm new to the list, but not to linux nor the idea of cross-compiling
under Unix.
I've been using some of the buildroot work under the Astlinux project,
which I contribute to.
I've noticed some issues with particular projects, and some recurring
issues of a more generalized nature.
If any of this has been covered in the past, apologies for backtracking
on old terrain.
One of the first things I noticed was that there are a lot of braindead
configure.ac scripts out there that don't handle cross-compilation.
That won't be of news to anyone I don't think. The 2nd thing that I
followed on with was that by using the appropriate --with, --without,
--enable, --disable, and ac_cv_foo values when invoking ./configure, a
lot of this stuff could be mitigated.
The 2nd argument to AC_CHECK_SIZEOF() is a travesty, and there's no good
reason for having it. It will be wrong as often as it will be right, so
why bother having it at all?
I also noticed that some of the buildroot makefile's don't properly
order their targets or rely on their dependencies' ages properly, so
that doing a "make all" followed by another "make all" doesn't, in fact,
result in "Nothing to be done for `all'" as the result... but instead a
lot of rules are run again for no apparent reason.
I try to fix these as I encounter them, but I've not been very diligent
about noting them. I'll try to do better, and indeed to post my patches
to makefiles as I find them.
So... getting back to the first issue... incorrect detection of the
target environment's characteristics when cross-compiling... Why don't
we just capture most of this into a Makefile statically?
In the astlinux project, for instance, we have in one of our Makefiles
something like:
LINUX_VERSION_MAJOR:=$(shell echo $(LINUX_VERSION) | cut -d. -f1)
LINUX_VERSION_MINOR:=$(shell echo $(LINUX_VERSION) | cut -d. -f2)
LINUX_VERSION_TRIPLE:=$(shell echo $(LINUX_VERSION) | cut -d. -f1-3)
TARGET_CONFIGURE_OPTS+=\
ac_cv_linux_vers=$(LINUX_VERSION_MAJOR)
(yeah, it could be better written and more standardized... but it works
for now.) and in target/device/geni586/Makefile.in:
ifeq ($(ARCH),i586)
TARGET_CONFIGURE_OPTS+=\
ac_cv_sizeof_char=1 \
ac_cv_sizeof_unsigned_char=1 \
ac_cv_sizeof_short=2 \
ac_cv_sizeof_short_int=2 \
ac_cv_sizeof_unsigned_short=2 \
ac_cv_sizeof_unsigned_short_int=2 \
ac_cv_sizeof_int=4 \
ac_cv_sizeof_long=4 \
ac_cv_sizeof_long_int=4 \
ac_cv_sizeof_unsigned=4 \
ac_cv_sizeof_unsigned_int=4 \
ac_cv_sizeof_unsigned_long=4 \
ac_cv_sizeof_unsigned_long_int=4 \
ac_cv_sizeof_off_t=4 \
ac_cv_sizeof_size_t=4 \
ac_cv_sizeof_char_p=4 \
ac_cv_sizeof_unsigned_char_p=4 \
ac_cv_sizeof_voidp=4 \
ac_cv_sizeof_long_long=8 \
ac_cv_sizeof_long_long_int=8 \
ac_cv_sizeof_unsigned_long_long=8 \
ac_cv_sizeof_unsigned_long_long_int=8 \
ac_cv_sizeof_off64_t=8 \
ac_cv_sizeof_loff_t=8
endif
Since there are a lot of broken "configure" scripts out there, and
there's no point in having 50 or more packages try to figure out the
native size of a "long", then why not predefine a lot of this?
What am I missing?
I'll try to go over my mods to the makefiles, and if I see anything
useful, I'll post the diffs.
Thanks,
-Philip
^ permalink raw reply [flat|nested] 2+ messages in thread* [Buildroot] Improving buildroot
2008-07-25 1:39 [Buildroot] Improving buildroot Philip Prindeville
@ 2008-07-26 6:49 ` Ulf Samuelsson
0 siblings, 0 replies; 2+ messages in thread
From: Ulf Samuelsson @ 2008-07-26 6:49 UTC (permalink / raw)
To: buildroot
Best Regards
Ulf Samuelsson
> Hi.
>
> I'm new to the list, but not to linux nor the idea of cross-compiling
> under Unix.
>
[snip]
>
> One of the first things I noticed was that there are a lot of braindead
> configure.ac scripts out there that don't handle cross-compilation.
> That won't be of news to anyone I don't think. The 2nd thing that I
> followed on with was that by using the appropriate --with, --without,
> --enable, --disable, and ac_cv_foo values when invoking ./configure, a
> lot of this stuff could be mitigated.
>
> The 2nd argument to AC_CHECK_SIZEOF() is a travesty, and there's no good
> reason for having it. It will be wrong as often as it will be right, so
> why bother having it at all?
>
> I also noticed that some of the buildroot makefile's don't properly
> order their targets or rely on their dependencies' ages properly, so
> that doing a "make all" followed by another "make all" doesn't, in fact,
> result in "Nothing to be done for `all'" as the result... but instead a
> lot of rules are run again for no apparent reason.
>
Yes, this happens from time to time, when the rules are changed.
Patches to fix this are definitely welcome.
> I try to fix these as I encounter them, but I've not been very diligent
> about noting them. I'll try to do better, and indeed to post my patches
> to makefiles as I find them.
>
> So... getting back to the first issue... incorrect detection of the
> target environment's characteristics when cross-compiling... Why don't
> we just capture most of this into a Makefile statically?
>
> In the astlinux project, for instance, we have in one of our Makefiles
> something like:
>
> LINUX_VERSION_MAJOR:=$(shell echo $(LINUX_VERSION) | cut -d. -f1)
> LINUX_VERSION_MINOR:=$(shell echo $(LINUX_VERSION) | cut -d. -f2)
> LINUX_VERSION_TRIPLE:=$(shell echo $(LINUX_VERSION) | cut -d. -f1-3)
> TARGET_CONFIGURE_OPTS+=\
> ac_cv_linux_vers=$(LINUX_VERSION_MAJOR)
>
>
>
> (yeah, it could be better written and more standardized... but it works
> for now.) and in target/device/geni586/Makefile.in:
>
> ifeq ($(ARCH),i586)
> TARGET_CONFIGURE_OPTS+=\
> ac_cv_sizeof_char=1 \
> ac_cv_sizeof_unsigned_char=1 \
> ac_cv_sizeof_short=2 \
> ac_cv_sizeof_short_int=2 \
> ac_cv_sizeof_unsigned_short=2 \
> ac_cv_sizeof_unsigned_short_int=2 \
> ac_cv_sizeof_int=4 \
> ac_cv_sizeof_long=4 \
> ac_cv_sizeof_long_int=4 \
> ac_cv_sizeof_unsigned=4 \
> ac_cv_sizeof_unsigned_int=4 \
> ac_cv_sizeof_unsigned_long=4 \
> ac_cv_sizeof_unsigned_long_int=4 \
> ac_cv_sizeof_off_t=4 \
> ac_cv_sizeof_size_t=4 \
> ac_cv_sizeof_char_p=4 \
> ac_cv_sizeof_unsigned_char_p=4 \
> ac_cv_sizeof_voidp=4 \
> ac_cv_sizeof_long_long=8 \
> ac_cv_sizeof_long_long_int=8 \
> ac_cv_sizeof_unsigned_long_long=8 \
> ac_cv_sizeof_unsigned_long_long_int=8 \
> ac_cv_sizeof_off64_t=8 \
> ac_cv_sizeof_loff_t=8
> endif
>
>
> Since there are a lot of broken "configure" scripts out there, and
> there's no point in having 50 or more packages try to figure out the
> native size of a "long", then why not predefine a lot of this?
>
Probably because noone thought about this.
> What am I missing?
>
> I'll try to go over my mods to the makefiles, and if I see anything
> useful, I'll post the diffs.
>
> Thanks,
>
> -Philip
>
> _______________________________________________
> buildroot mailing list
> buildroot at uclibc.org
> http://busybox.net/mailman/listinfo/buildroot
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-26 6:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-25 1:39 [Buildroot] Improving buildroot Philip Prindeville
2008-07-26 6:49 ` Ulf Samuelsson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.