Skip to content

Commit

Permalink
Makefile.am: avoid use of non-portable echo arguments
Browse files Browse the repository at this point in the history
This fixes tests with a non-bash shell as /bin/sh (in this case, dash) which
does not support `echo -e`. echo itself is portable, but not echo with any arguments.

Use `printf` instead.

Fixes: d9a1e0c ('build: add "check-local-build-headers" test target to build public headers')

#360
  • Loading branch information
thesamesam authored and thom311 committed Aug 31, 2023
1 parent 9aab12d commit 052a97c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ EXTRA_DIST += \

%.build-headers-test.c: %
mkdir -p "$(dir $@)"
echo -e "#include <$$(echo "$<" | sed 's|.*\<include/netlink/|netlink/|')>\nint main(int argc, char **argv) { return 0; }" > $@
printf "#include <$$(echo "$<" | sed 's|.*\<include/netlink/|netlink/|')>\nint main(int argc, char **argv) { return 0; }" > $@

%.build-headers-test.o: %.build-headers-test.c
$(COMPILE) -Wall -Werror -Wno-error=cpp -I$(srcdir)/include -I$(builddir)/include -c -o $@ $<
Expand Down

0 comments on commit 052a97c

Please sign in to comment.