Browse Source

FreeBSD: fix build.

This makes it build for me on FreeBSD 11:
1. $(MAKE) has to passed through into update-mocks.
2. FreeBSD sed doesn't turn \n into a newline on RHS.
3. Bash and mako dependencies were missing from INSTALL.md

Fixes: #2850
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
pull/2938/head
Rusty Russell 5 years ago
committed by Christian Decker
parent
commit
9e5b9a31c9
  1. 2
      Makefile
  2. 2
      doc/INSTALL.md
  3. 3
      tools/mockup.sh
  4. 2
      tools/test/Makefile
  5. 2
      tools/update-mocks.sh

2
Makefile

@ -367,7 +367,7 @@ coverage: coverage/coverage.info
# We make libwallycore.la a dependency, so that it gets built normally, without ncc. # We make libwallycore.la a dependency, so that it gets built normally, without ncc.
# Ncc can't handle the libwally source code (yet). # Ncc can't handle the libwally source code (yet).
ncc: external/libwally-core/src/libwallycore.la ncc: external/libwally-core/src/libwallycore.la
make CC="ncc -ncgcc -ncld -ncfabs" AR=nccar LD=nccld $(MAKE) CC="ncc -ncgcc -ncld -ncfabs" AR=nccar LD=nccld
# Ignore test/ directories. # Ignore test/ directories.
TAGS: FORCE TAGS: FORCE

2
doc/INSTALL.md

@ -135,7 +135,7 @@ OS version: FreeBSD 11.1-RELEASE or above
Get dependencies: Get dependencies:
# pkg install -y \ # pkg install -y \
autoconf automake git gmp asciidoc gmake libtool python python3 sqlite3 libsodium autoconf automake git gmp asciidoc gmake libtool python python3 sqlite3 libsodium py36-mako bash
If you don't have Bitcoin installed locally you'll need to install that If you don't have Bitcoin installed locally you'll need to install that
as well: as well:

3
tools/mockup.sh

@ -20,7 +20,8 @@ for SYMBOL; do
# has notleak_ as a declaration, and then an inline). # has notleak_ as a declaration, and then an inline).
WHERE=$(grep -nH "^[a-zA-Z0-9_ (),]* [*]*$SYMBOL(" ./*/*.h | head -n1) WHERE=$(grep -nH "^[a-zA-Z0-9_ (),]* [*]*$SYMBOL(" ./*/*.h | head -n1)
if [ x"$WHERE" != x ]; then if [ x"$WHERE" != x ]; then
STUB='\n{ fprintf(stderr, "'$SYMBOL' called!\\n"); abort(); }' STUB='\
{ fprintf(stderr, "'$SYMBOL' called!\\n"); abort(); }'
else else
echo "/* Could not find declaration for $SYMBOL */" echo "/* Could not find declaration for $SYMBOL */"
continue continue

2
tools/test/Makefile

@ -31,7 +31,7 @@ tools/test/gen_test.h:
tools/test/gen_test.c: tools/test/gen_test.c:
$(BOLT_GEN) --page impl ${@:.c=.h} test_type < tools/test/test_cases > $@ $(BOLT_GEN) --page impl ${@:.c=.h} test_type < tools/test/test_cases > $@
@tools/update-mocks.sh "$@" @MAKE=$(MAKE) tools/update-mocks.sh "$@"
tools/test/gen_print.h: wire/gen_onion_wire.h tools/test/gen_print.h: wire/gen_onion_wire.h
$(BOLT_GEN) -P --page header $@ test_type < tools/test/test_cases > $@ $(BOLT_GEN) -P --page header $@ test_type < tools/test/test_cases > $@

2
tools/update-mocks.sh

@ -18,7 +18,7 @@ if [ -n "$START" ]; then
head -n "$START" "${BASE}.old" > "$FILE" head -n "$START" "${BASE}.old" > "$FILE"
tail -n +"$END" "${BASE}.old" >> "$FILE" tail -n +"$END" "${BASE}.old" >> "$FILE"
# Try to make binary. # Try to make binary.
if ! make "${FILE/%.c/}" 2> "${BASE}.err" >/dev/null; then if ! $MAKE "${FILE/%.c/}" 2> "${BASE}.err" >/dev/null; then
tools/mockup.sh < "${BASE}.err" >> "${BASE}.stubs" tools/mockup.sh < "${BASE}.err" >> "${BASE}.stubs"
# If there are no link errors, maybe compile fail for other reason? # If there are no link errors, maybe compile fail for other reason?
if ! grep -F -q 'Generated stub for' "${BASE}.stubs"; then if ! grep -F -q 'Generated stub for' "${BASE}.stubs"; then

Loading…
Cancel
Save