the following Makefile builds successfully for me on Musl toolchain:
I think the main issue was that you included package-defaults.mk and
kernel-defaults.mk in the middle of your Makefile which messed up
several build variables.
Another problem might have been the fact that you called autogen.sh
yourself which will cause host autoconf to be picked up which can
usually lead to troubles later on.
The configure script successfully detects argp-standalone:
checking for library containing argp_parse... -largp
The resulting gcc command line looks fine too:
x86_64-openwrt-linux-musl-gcc [...] -lnl-genl-3 -lnl-3 -largp
I had to fix up your build dependency spec to be processed correctly but
all in all your Makefile was already quite close to a working version.
Lede-dev mailing list