libkrb5: fix build on riscv
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Sun, 11 Nov 2018 17:52:10 +0000 (18:52 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 11 Nov 2018 21:08:25 +0000 (22:08 +0100)
Define _REENTRANT otherwise pthread detection will fail

Fixes:
 - http://autobuild.buildroot.org/results/39a51d0c3feab74edd8a17c9174d031ccc7ffe1d

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

index d9d7160ae8d554df6bf4ffb7bf30da2d6d7e1bb3..6534c069eef1d7c196a68604c26e3eeaa369096c 100644 (file)
@@ -52,7 +52,14 @@ else
 LIBKRB5_CONF_OPTS += --without-readline
 endif
 
-ifneq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
+# gcc on riscv doesn't define _REENTRANT when -pthread is passed while
+# it should. Compensate this deficiency here otherwise libkrb5 configure
+# script doesn't find that thread support is enabled.
+ifeq ($(BR2_riscv),y)
+LIBKRB5_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -D_REENTRANT"
+endif
+else
 LIBKRB5_CONF_OPTS += --disable-thread-support
 endif