diff --git a/m4/ax_check_gnu_make.m4 b/m4/ax_check_gnu_make.m4 index 6762e9e..785dc96 100644 --- a/m4/ax_check_gnu_make.m4 +++ b/m4/ax_check_gnu_make.m4 @@ -1,10 +1,10 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_check_gnu_make.html +# https://www.gnu.org/software/autoconf-archive/ax_check_gnu_make.html # =========================================================================== # # SYNOPSIS # -# AX_CHECK_GNU_MAKE() +# AX_CHECK_GNU_MAKE([run-if-true],[run-if-false]) # # DESCRIPTION # @@ -13,6 +13,10 @@ # * The makefile variable `ifGNUmake' is set to the empty string, otherwise # it is set to "#". This is useful for including a special features in a # Makefile, which cannot be handled by other versions of make. +# * The makefile variable `ifnGNUmake' is set to #, otherwise +# it is set to the empty string. This is useful for including a special +# features in a Makefile, which can be handled +# by other versions of make or to specify else like clause. # * The variable `_cv_gnu_make_command` is set to the command to invoke # GNU make if it exists, the empty string otherwise. # * The variable `ax_cv_gnu_make_command` is set to the command to invoke @@ -20,6 +24,8 @@ # * If GNU Make is found, its version is extracted from the output of # `make --version` as the last field of a record of space-separated # columns and saved into the variable `ax_check_gnu_make_version`. +# * Additionally if GNU Make is found, run shell code run-if-true +# else run shell code run-if-false. # # Here is an example of its use: # @@ -31,6 +37,8 @@ # # @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND))) # @ifGNUmake@ include $(DEPEND) +# @ifGNUmake@ else +# fallback code # @ifGNUmake@ endif # # Then configure.in would normally contain: @@ -61,7 +69,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 8 +#serial 12 AC_DEFUN([AX_CHECK_GNU_MAKE],dnl [AC_PROG_AWK @@ -79,6 +87,9 @@ dnl Search all the common names for GNU make done ;]) dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifGNUmake], ["#"])], [AS_VAR_SET([ifGNUmake], [""])]) + AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifnGNUmake], [""])], [AS_VAR_SET([ifnGNUmake], ["#"])]) AS_VAR_IF([_cv_gnu_make_command], [""], [AS_UNSET(ax_cv_gnu_make_command)], [AS_VAR_SET([ax_cv_gnu_make_command], [${_cv_gnu_make_command}])]) + AS_VAR_IF([_cv_gnu_make_command], [""],[$2],[$1]) AC_SUBST([ifGNUmake]) + AC_SUBST([ifnGNUmake]) ]) diff --git a/m4/giella-macros.m4 b/m4/giella-macros.m4 index ca04e9b..dec47eb 100644 --- a/m4/giella-macros.m4 +++ b/m4/giella-macros.m4 @@ -274,31 +274,24 @@ AM_CONDITIONAL([CAN_MERGE], [test "x$can_merge" != xno ]) AC_CANONICAL_HOST # Check for which host we are on and setup a few things # specifically based on the host -# This is the minimum GNU Make version required (except on OSX): +# This is the minimum GNU Make version required _GNU_make_min_version=m4_default([$1], [3.82]) -# Then we check against different hosts: -case $host_os in - darwin* ) - # Do nothing for mac: the included make is fine - true - ;; - *) - # Default Case: in all other cases check that we are using GNU make - # and that it is new enough: - AX_CHECK_GNU_MAKE() - AC_MSG_CHECKING([whether GNU make is at least $_GNU_make_min_version]) - AX_COMPARE_VERSION([$ax_check_gnu_make_version], [ge], - [$_GNU_make_min_version], - [ - AC_MSG_RESULT([yes]) - # Reset the MAKE variable, to ensure we're using GNU make: - MAKE=$_cv_gnu_make_command - ], - [AC_MSG_ERROR([GNU Make too old ($ax_check_gnu_make_version), please install at least $_GNU_make_min_version]) - ]) - ;; -esac +AX_CHECK_GNU_MAKE(, + [AC_MSG_WARN([GNU make will be required])]) +AC_MSG_CHECKING([whether GNU make is at least $_GNU_make_min_version]) +AX_COMPARE_VERSION([$ax_check_gnu_make_version], [ge], + [$_GNU_make_min_version], + [ + AC_MSG_RESULT([yes]) + # Reset the MAKE variable, to ensure we're using GNU make: + MAKE=$_cv_gnu_make_command + ], + [AC_MSG_RESULT([no]) + AC_MSG_WARN([GNU Make too old ($ax_check_gnu_make_version), please install at least $_GNU_make_min_version]) + gt_need_gnu_make=yes + ]) + ################ END of GNU Make check ################ # We need special treatment of Java paths in Cygwin: @@ -1108,6 +1101,12 @@ cd .. git clone git@github.com:giellalt/$gt_SHARED_FAILS cd $gt_SHARED_FAILS ./autogen.sh && ./configure && make])]) +AS_IF([test "x$gt_need_gnu_make" = xyes], + [AC_MSG_WARN([GNU make will be required to build giellalt from now on (Feb 2025): + +if you are using a MacOS do: + sudo brew install make +see https://github.com/giellalt/giella-core/issues/79 for background and further instructions])]) ]) # gt_PRINT_FOOTER # vim: set ft=config: