From: Daniel Elstner Date: Mon, 7 Sep 2015 20:24:44 +0000 (+0200) Subject: sigrok.m4: Add SR_PROG_MAKE_ORDER_ONLY macro X-Git-Tag: libsigrok-0.4.0~340 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c2b0f42989bb0f206e736dff5ac5946d93618545;p=libsigrok.git sigrok.m4: Add SR_PROG_MAKE_ORDER_ONLY macro --- diff --git a/m4/sigrok.m4 b/m4/sigrok.m4 index 352e5ac0..904fc875 100644 --- a/m4/sigrok.m4 +++ b/m4/sigrok.m4 @@ -319,6 +319,30 @@ _SR_ARG_OPT_PKG(m4_defn([_SR_VAR_OPT_PKG_FEATURES]), m4_shift3($@))[]dnl ]) +## SR_PROG_MAKE_ORDER_ONLY +## +## Check whether the make program supports order-only prerequisites. +## If so, set the substitution variable ORDER to '|', or to the empty +## string otherwise. +## +AC_DEFUN([SR_PROG_MAKE_ORDER_ONLY], +[dnl +AC_PROVIDE([$0])[]dnl +AC_CACHE_CHECK([whether [$]{MAKE:-make} supports order-only prerequisites], + [sr_cv_prog_make_order_only], [ +cat >conftest.mk <<'_SREOF' +a: b | c +a b c: ; @: +.PHONY: a b c +_SREOF +AS_IF([[$]{MAKE:-make} -f conftest.mk >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD], + [sr_cv_prog_make_order_only=yes], [sr_cv_prog_make_order_only=no]) +rm -f conftest.mk +]) +AS_IF([test "x$sr_cv_prog_make_order_only" = xyes], [ORDER='|'], [ORDER=]) +AC_SUBST([ORDER]) +]) + ## SR_CHECK_COMPILE_FLAGS(flags-var, description, flags) ## ## Find a compiler flag for . For each flag in , check