Am 09.01.2014 11:11, schrieb Denys Vlasenko:
> On Wed, Jan 8, 2014 at 10:33 PM, Matthias Andree <[email protected]> wrote:
>>> Please try current git.
>>
>> Better, but still does not work due to use of alloca.h in
>> scripts/basic/fixdep.c l. 116 and scripts/basic/docproc.c l. 42.
>
> I removed the include, please try current git again.
>
>> BTW I forgot to mention that the sed scripts running underneath GEN are
>> also GNU-sed specific,
>
> In what way are they GNU-specific?
In that BSD sed does not accept some of the programs (1) due to missing
linefeeds, and misinterprets others (2):
(1):
sed: 1: "/^INSERT$/ { :l; n; p; ...": unexpected EOF (pending }'s)
(2) And if you fix that by replacing semicolons by line breaks, you get:
HOSTCC applets/usage
In file included from applets/usage.c:24:
include/usage.h:18: error: stray '#' in program
include/usage.h:18: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'define'
include/usage.h:18: error: stray '#' in program
Looking into the file you see stray "n" characters (not #).
$ nl -ba include/usage.h|grep -4w ' 18'
14 #define BB_USAGE_H 1
15
16 #define NOUSAGE_STR "\b"
17
18 n#define ar_trivial_usage \
19 "[-o] [-v] [-p] [-t] [-x] ARCHIVE FILES" \
20 n#define ar_full_usage "\n\n" \
21 "Extract or list FILES from an ar archive\n" \
22 "\n -o Preserve original dates" \
The issue is that BSD sed does not accept \t or \n, and misses lines
that match ^//usage:\t
Tab and line feed characters need to be inserted literally, and the
latter must be preceded by a backslash.
The attached patch (for git am) achieves all that and enables the
current busybox Git master to build on FreeBSD without further ado.
To be sure about spacing, check the SHA256 sum before applying it:
1fa4c85fa30f548ac63e1844f9e308cc4e54a5f1c6062d14506fc11e4f32951c
*busybox-sed.gitpatch
In doubt, you can download it again from
<http://people.freebsd.org/~mandree/busybox-sed.gitpatch>
>From 769aceff4f54bbbcf78781fa41a4141cad7bce35 Mon Sep 17 00:00:00 2001
From: Matthias Andree <[email protected]>
Date: Thu, 9 Jan 2014 20:07:19 +0100
Subject: [PATCH] Fix non-portable sed constructs.
This includes proper line breaks for labels and closing braces,
and removing non-portable \n and \t in s/// functions.
Signed-off-by: Matthias Andree <[email protected]>
---
scripts/gen_build_files.sh | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/scripts/gen_build_files.sh b/scripts/gen_build_files.sh
index 0989b2f..18b9c4f 100755
--- a/scripts/gen_build_files.sh
+++ b/scripts/gen_build_files.sh
@@ -31,7 +31,12 @@ generate()
# copy stdin to stdout
cat
# print everything after INSERT line
- sed -n '/^INSERT$/ { :l; n; p; bl }' "${src}"
+ sed -n '/^INSERT$/ {
+ :l
+ n
+ p
+ bl
+ }' "${src}"
} >"${dst}.tmp"
if ! cmp -s "${dst}" "${dst}.tmp"; then
gen "${dst}"
@@ -52,7 +57,9 @@ sed -n 's@^//applet:@@p' "$srctree"/*/*.c "$srctree"/*/*/*.c \
# We add line continuation backslash after each line,
# and insert empty line before each line which doesn't start
# with space or tab
-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' \
"$srctree"/*/*.c "$srctree"/*/*/*.c \
| generate \
"$srctree/include/usage.src.h" \
--
1.8.4.3
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox