config_host.mk.in                      |    1 -
 configure.ac                           |   33 +++------------------------------
 instsetoo_native/CustomTarget_setup.mk |   13 -------------
 odk/CustomTarget_allheaders.mk         |   12 ------------
 officecfg/CustomTarget_registry.mk     |    7 -------
 solenv/gbuild/Tempfile.mk              |   21 ---------------------
 6 files changed, 3 insertions(+), 84 deletions(-)

New commits:
commit 57c5d044dc16f488788584851e8b9cc0cf98e8e0
Author:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
AuthorDate: Sat Dec 10 13:56:13 2022 +0100
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Tue Dec 13 15:03:24 2022 +0000

    bump minimum make version to 4.0 (for $(file …) function)
    
    This already was a requirement for Windows for a few years now, and make
    4.0 was released nearly 9 years ago, and it has been used in LO's build
    system since it has been added 11 years ago while it was only available
    in prerelease versions of make, providing an alternative workaround for
    systems that didn't have make built from cvs… I guess it is finally time
    to get rid of those workarounds and just require make 4.0 for everyone.
    
    NOTE: reading files with the $(file …) function was only added with
    version 4.2 of GNU make, and just using it without contents was added in
    4.1, so those usages aren't supported
    
    Change-Id: Ia1c2c86cfdbbd81f349bb9f7188299e16bdd155f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143910
    Tested-by: Jenkins
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>

diff --git a/config_host.mk.in b/config_host.mk.in
index 9cc66b5b6000..687cdd54048b 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -305,7 +305,6 @@ export 
HAVE_GCC_FNO_ENFORCE_EH_SPECS=@HAVE_GCC_FNO_ENFORCE_EH_SPECS@
 export HAVE_GCC_FNO_SIZED_DEALLOCATION=@HAVE_GCC_FNO_SIZED_DEALLOCATION@
 export HAVE_GCC_GGDB2=@HAVE_GCC_GGDB2@
 export HAVE_GCC_STACK_CLASH_PROTECTION=@HAVE_GCC_STACK_CLASH_PROTECTION@
-export HAVE_GNUMAKE_FILE_FUNC=@HAVE_GNUMAKE_FILE_FUNC@
 export HAVE_LD_BSYMBOLIC_FUNCTIONS=@HAVE_LD_BSYMBOLIC_FUNCTIONS@
 export HAVE_LD_HASH_STYLE=@HAVE_LD_HASH_STYLE@
 export HAVE_LIBCPP=@HAVE_LIBCPP@
diff --git a/configure.ac b/configure.ac
index 6325d8c50075..c5a7ee205090 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6315,36 +6315,12 @@ TAB=`printf '\t'`
 AC_MSG_CHECKING([the GNU Make version])
 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 
's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 
}'`
-if test "$_make_longver" -ge "038200"; then
+if test "$_make_longver" -ge "040000"; then
     AC_MSG_RESULT([$GNUMAKE $_make_version])
 else
-    AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
+    AC_MSG_ERROR([failed ($GNUMAKE version >= 4.0 needed)])
 fi
 
-# find if gnumake support file function
-AC_MSG_CHECKING([whether GNU Make supports the 'file' function])
-TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
-if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
-    TESTGMAKEFILEFUNC=`cygpath -m $TESTGMAKEFILEFUNC`
-fi
-$SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF
-\$(file >test.txt,Success )
-
-.PHONY: all
-all:
-<TAB>@cat test.txt
-
-EOF
-$GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
-if test -f $TESTGMAKEFILEFUNC/test.txt; then
-    HAVE_GNUMAKE_FILE_FUNC=TRUE
-    AC_MSG_RESULT([yes])
-else
-    AC_MSG_RESULT([no])
-fi
-rm -rf $TESTGMAKEFILEFUNC
-AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
-
 _make_ver_check=`$GNUMAKE --version | grep "Built for Windows"`
 STALE_MAKE=
 if test "$_make_ver_check" = ""; then
@@ -14839,7 +14815,7 @@ else
 fi
 
 
-if test \( "$STALE_MAKE" = "TRUE" -o "$HAVE_GNUMAKE_FILE_FUNC" != "TRUE" \) \
+if test \( "$STALE_MAKE" = "TRUE" \) \
         -a "$build_os" = "cygwin"; then
 
 cat << _EOS
@@ -14876,9 +14852,6 @@ Note: autogen.sh will try to use /opt/lo/bin/make if 
the environment variable GN
 Alternatively, you can install the 'new' make where ever you want and make 
sure that `which make` finds it.
 
 _EOS
-if test "$HAVE_GNUMAKE_FILE_FUNC" != "TRUE"; then
-    AC_MSG_ERROR([no file function found; the build will fail without it; use 
GNU make 4.0 or later])
-fi
 fi
 
 
diff --git a/instsetoo_native/CustomTarget_setup.mk 
b/instsetoo_native/CustomTarget_setup.mk
index ed27e27f8278..92fb00b14299 100644
--- a/instsetoo_native/CustomTarget_setup.mk
+++ b/instsetoo_native/CustomTarget_setup.mk
@@ -196,20 +196,7 @@ endef
 $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call 
gb_Helper_get_rcfile,version) :
        $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
        $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),ECH)
-ifeq ($(HAVE_GNUMAKE_FILE_FUNC),)
-       printf '[Version]\n' > $@ && \
-       printf 'AllLanguages=$(if $(gb_WITH_LANG),$(gb_WITH_LANG),en-US)\n' >> 
$@ && \
-       printf 'buildid=$(shell cd $(SRCDIR) && git log -1 --format=%H)\n' >> 
$@ && \
-       printf 
'ExtensionUpdateURL=https://updateexte.libreoffice.org/ExtensionUpdateService/check.Update\n'
 >> $@ && \
-       printf 'UpdateChannel=$(if $(ENABLE_ONLINE_UPDATE_MAR),$(shell cd 
$(SRCDIR) && bin/update/get_update_channel.py $(UPDATE_CONFIG)))\n' >> $@ && \
-       printf 'ReferenceOOoMajorMinor=4.1\n' >> $@ && \
-       printf 'UpdateID=$(PRODUCTNAME)_$(LIBO_VERSION_MAJOR)_en-US\n' >> $@ && 
\
-       printf 'UpdateURL=$(if 
$(ENABLE_ONLINE_UPDATE),https://update.libreoffice.org/check.php$(if 
$(filter-out WNT,$(OS)),?pkgfmt=$(PKGFORMAT)))\n' >> $@ && \
-       printf 'UpdateUserAgent=<PRODUCT> ($${buildid}; $${_OS}; $${_ARCH}; 
<OPTIONAL_OS_HW_DATA>)\n' >> $@ && \
-       printf 'Vendor=$(OOO_VENDOR)\n' >> $@
-else
        $(file > $@,$(call instsetoo_native_genversionini))
-endif
        $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),ECH)
 
 # vim: set noet sw=4 ts=4:
diff --git a/odk/CustomTarget_allheaders.mk b/odk/CustomTarget_allheaders.mk
index ea632209ea6b..eb75ec7321bb 100644
--- a/odk/CustomTarget_allheaders.mk
+++ b/odk/CustomTarget_allheaders.mk
@@ -35,21 +35,9 @@ $(odk_allheaders_DIR)/allheaders.hxx : \
             | $(odk_allheaders_DIR)/.dir
        $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
        $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),ECH)
-ifeq ($(HAVE_GNUMAKE_FILE_FUNC),)
-       printf '// Generated list of sal includes\n' > $@ && \
-       printf '#ifdef _WIN32\n' >> $@ && \
-       printf '#include <windows.h>\n' >> $@ && \
-       printf '#endif\n' >> $@ \
-       $(foreach file,$(shell cat $^),\
-               $(if $(findstring /win32/,$(file)),&& printf '#ifdef _WIN32\n' 
>> $@) \
-           && printf '#include <%s>\n' $(subst 
$(INSTDIR)/$(SDKDIRNAME)/include/,,$(file)) >> $@ \
-               $(if $(findstring /win32/,$(file)),&& printf '#endif\n' >> $@) \
-       )
-else
        $(file >$@,\
                $(call odk_genincludesheader) \
                $(foreach file,$(shell cat $^),$(call 
odk_geninclude,$(file),$(findstring /win32/,$(file)))))
-endif
        $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),ECH)
 
 # vim: set noet sw=4 ts=4:
diff --git a/officecfg/CustomTarget_registry.mk 
b/officecfg/CustomTarget_registry.mk
index 77803b60a25b..dd1efa6f22da 100644
--- a/officecfg/CustomTarget_registry.mk
+++ b/officecfg/CustomTarget_registry.mk
@@ -24,14 +24,7 @@ $(call 
gb_CustomTarget_get_workdir,officecfg/registry)/officecfg/officecfg_qa_al
                $(SRCDIR)/officecfg/files.mk
        $(call gb_Output_announce,officecfg_qa_allheaders.hxx,$(true),CAT,1)
        $(call gb_Trace_StartRange,officecfg_qa_allheaders.hxx,CAT)
-ifeq ($(HAVE_GNUMAKE_FILE_FUNC),)
-       mkdir -p $(dir $@) && \
-       rm -f $@ \
-       $(foreach file,$(officecfg_XCSFILES),\
-               && echo "#include <officecfg/$(file).hxx>" >> $@)
-else
        mv $(call gb_var2file,$(shell mkdir -p $(dir $@) && cat /dev/null 
>$@.tmp && echo $@.tmp),100,$(foreach file,$(officecfg_XCSFILES),$(call 
officecfg_geninclude,$(file)))) $@
-endif
        $(call gb_Trace_EndRange,officecfg_qa_allheaders.hxx,CAT)
 
 # pass the stem as space separated path elements and get a set of 
--stringparam ns<level> <element> in return
diff --git a/solenv/gbuild/Tempfile.mk b/solenv/gbuild/Tempfile.mk
index ee0593db8b1b..a88f0133963b 100644
--- a/solenv/gbuild/Tempfile.mk
+++ b/solenv/gbuild/Tempfile.mk
@@ -17,29 +17,8 @@
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
 
-ifneq ($(HAVE_GNUMAKE_FILE_FUNC),)
 define gb_var2file
 $(file >$(1),$(3))$(1)
 endef
-else
-# Write string to temporary file by chopping into pieces that
-# fit the commandline
-# parameters: filename, maxitems (for one write), string
-# returns: filename
-define gb_var2file
-$(strip $(1)
-$(eval gb_var2file_helpervar := $$(shell printf "%s" "" > $(1) ))\
-$(eval gb_var2file_curblock := $(firstword $(3)))\
-$(foreach item,$(wordlist 2,99999,$(3)),$(eval gb_var2file_curblock += $(item)
-       ifeq ($$(words $$(gb_var2file_curblock)),$(2)) 
-               gb_var2file_helpervar := $$(shell printf "%s" 
"$$(gb_var2file_curblock)" >> $(1) )
-               gb_var2file_curblock :=
-       endif
-       ))\
-       $(eval gb_var2file_helpervar := $(shell printf "%s\n" 
"$(gb_var2file_curblock)" >> $(1) )
-               gb_var2file_curblock :=
-       ))
-endef
-endif
 
 # vim: set noet sw=4 ts=4:

Reply via email to