mdadm: fix mdmon build without threads
authorBaruch Siach <baruch@tkos.co.il>
Fri, 19 Oct 2018 10:18:24 +0000 (13:18 +0300)
committerPeter Korsgaard <peter@korsgaard.com>
Sat, 20 Oct 2018 12:22:45 +0000 (14:22 +0200)
Commit 45498bbc62d8df (mdadm: also install mdmon) enabled build of hte
mdmon utility. This utility requires USE_PTHREADS make variable
undefined to build when threads are not supported.

Fixes:
http://autobuild.buildroot.net/results/4bd/4bdd03b1d8f30ef32177727aae46d8cf54fbc35e/

Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/mdadm/mdadm.mk

index 3ee4ddd059e9a7f384696f240afab6ac38b86251..b2ed5049aa1f22c68115cc0e32e28f41c245821a 100644 (file)
@@ -10,13 +10,17 @@ MDADM_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/raid/mdadm
 MDADM_LICENSE = GPL-2.0+
 MDADM_LICENSE_FILES = COPYING
 
+MDADM_BUILD_OPTS = $(TARGET_CONFIGURE_OPTS) \
+       CFLAGS="$(TARGET_CFLAGS) -DNO_COROSYNC -DNO_DLM" \
+       CPPFLAGS="$(TARGET_CPPFLAGS) -DBINDIR=\\\"/sbin\\\"" \
+       CHECK_RUN_DIR=0
+
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
+MDADM_BUILD_OPTS += USE_PTHREADS=
+endif
+
 define MDADM_BUILD_CMDS
-       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS) -DNO_COROSYNC -DNO_DLM" \
-               CPPFLAGS="$(TARGET_CPPFLAGS) -DBINDIR=\\\"/sbin\\\"" \
-               CHECK_RUN_DIR=0 \
-               mdadm mdmon
+       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(MDADM_BUILD_OPTS) mdadm mdmon
 endef
 
 define MDADM_INSTALL_TARGET_CMDS