shadowsocks-libev: fix build on riscv
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Tue, 13 Nov 2018 21:30:43 +0000 (22:30 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 13 Nov 2018 21:52:55 +0000 (22:52 +0100)
Define _REENTRANT otherwise pthread detection will fail

Fixes:
 - http://autobuild.buildroot.org/results/c5406206190b46e15d35d05c5ed026ee7632f5b1

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/shadowsocks-libev/shadowsocks-libev.mk

index caae2176b4366a637eaf150620b2c0f1bf3d2350..7fdcd3f772fe76fe1bd8a3c69d95dab59b24b6a4 100644 (file)
@@ -14,4 +14,11 @@ SHADOWSOCKS_LIBEV_CONF_OPTS = \
        --with-pcre=$(STAGING_DIR)/usr \
        --disable-ssp
 
+# gcc on riscv doesn't define _REENTRANT when -pthread is passed while
+# it should. Compensate this deficiency here otherwise shadowsocks-libev
+# configure script doesn't find that thread support is enabled.
+ifeq ($(BR2_riscv),y)
+SHADOWSOCKS_LIBEV_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -D_REENTRANT"
+endif
+
 $(eval $(autotools-package))