[PATCH] nixio HAS_SHADOW test link error
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 29 Aug 2012 13:04:44 +0000 (13:04 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 29 Aug 2012 13:04:44 +0000 (13:04 +0000)
The nixio library can mistakenly build without shadow password support due to the
compile-time test failing.

Because the test for HAS_SHADOW in the nixio Makefile uses the default CC flags,
the test may attempt to cross-compile with different VFP abi than libc does and
will therefore not link. Passing CCFLAGS on the command line builds the test
correctly and will enable HAS_SHADOW if available.

libs/nixio/Makefile

index 24ccb01..49ba3ff 100644 (file)
@@ -10,7 +10,7 @@ AXTLS_VERSION = 1.2.1
 AXTLS_DIR     = axTLS
 AXTLS_FILE    = $(AXTLS_DIR)-$(AXTLS_VERSION).tar.gz
 #NIXIO_TLS    ?= openssl
-NIXIO_SHADOW ?= $(shell echo 'int main(void){ return !getspnam("root"); }' | $(CC) -include shadow.h -xc -o/dev/null - 2>/dev/null && echo yes)
+NIXIO_SHADOW ?= $(shell echo 'int main(void){ return !getspnam("root"); }' | $(CC) $(CFLAGS) -include shadow.h -xc -o/dev/null - 2>/dev/null && echo yes)
 NIXIO_SO      = nixio.so
 NIXIO_LDFLAGS =