1.22.0 builds still broken due to strchrnul mis-declaration on FreeBSD
Matthias Andree
mandree at FreeBSD.org
Fri Jan 10 19:10:12 UTC 2014
Am 10.01.2014 11:57, schrieb Denys Vlasenko:
> On Thu, Jan 9, 2014 at 8:14 PM, Matthias Andree <mandree at freebsd.org> wrote:
>> The attached patch (for git am) achieves all that and enables the
>> current busybox Git master to build on FreeBSD without further ado.
>
> -sed -n -e 's@^//usage:\([ \t].*\)$@\1 \\@p' -e 's@^//usage:\([^
> \t].*\)$@\n\1 \\@p' \
> +TAB="$(printf '\tX')" ; TAB="${TAB%X}"
> +sed -n -e 's@^//usage:\([ '"$TAB"'].*\)$@\1 \\@p' -e 's@^//usage:\([^
> '"$TAB"']..*\)$@\
> +\1 \\@p' \ ///vda
>
>
> Why .* turned into ..* ?
..* is effectively .+ spelt out as obsolete regular expression, to make
sure that there is at least one character before the EOL - this is a
robustness feature because you have //usage: lines.
On second thought, it is not required.
> Figuring out that second sed -e CMD has an embedded newline
> took some time.
Sorry, could have mentioned that.
>
> I'm going with this:
>
> TAB="$(printf '\tX')"
> TAB="${TAB%X}"
> LF="$(printf '\nX')"
> LF="${LF%X}"
> sed -n -e 's@^//usage:\([ '"$TAB"'].*\)$@\1 \\@p' \
> -e 's@^//usage:\([^ '"$TAB"'].*\)$@\'"$LF"'\1 \\@p' \
> "$srctree"/*/*.c "$srctree"/*/*/*.c \
>
Works for me. I had a similar approach which did not work out right,
but that was because I only had LF (but not yet TAB) at that time.
Thanks a bunch, given the proper configuration (excluding features that
rely on Linux kernel features absent in FreeBSD), busybox now compiles
out of the box on FreeBSD, and the configuration I am currently using
with 1.22.0 is online in FreeBSD's repository browser at
<http://svnweb.freebsd.org/ports/head/sysutils/busybox-unstable/files/data-.config?revision=338397&view=co>
More information about the busybox
mailing list