From 34018f1fe03072266a55f3cabfe16fe6808838b0 Mon Sep 17 00:00:00 2001 From: "Sergey V. Lobanov" Date: Sat, 29 Jan 2022 03:53:55 +0300 Subject: [PATCH] mandoc: fix build on macos ./configure scripts compiles&runs test so it detects darwin C-functions and defines that can not be used for Linux target. This patches expicitly specifies Linux-specific parameters that can not be detected correctly on Darwin. This patch removes 010-mandoc-1.14.5-fix-gnu-make.patch. mandoc provides its own way to redefine specific parameters (using configure.local file). Defines from this patch are moved to generated configure.local file. CONFIGURE_VARS are removed by this patch due to ./configure script does not use ENV vars specified by CONFIGURE_VARS This commit does not change compilation on Linux hosts (the resulted binary is exactly the same as before applying this commit). Binary compiled on MacOS host is exactly the same as compiled on Linux. Files generated by ./configure (config.h and Makefile.local) are exactly the same on Linux and MacOS build hosts Signed-off-by: Sergey V. Lobanov --- utils/mandoc/Makefile | 31 ++++++++++++++++--- .../010-mandoc-1.14.5-fix-gnu-make.patch | 29 ----------------- 2 files changed, 27 insertions(+), 33 deletions(-) delete mode 100644 utils/mandoc/patches/010-mandoc-1.14.5-fix-gnu-make.patch diff --git a/utils/mandoc/Makefile b/utils/mandoc/Makefile index 00b505ebb..1d66b3676 100644 --- a/utils/mandoc/Makefile +++ b/utils/mandoc/Makefile @@ -34,10 +34,33 @@ based on the libmandoc validating compiler, to format output for UTF-8 and ASCII UNIX terminals, HTML 5, PostScript, and PDF. endef -CONFIGURE_VARS=\ - CC=$(CC) \ - HAVE_FTS=0 \ - HAVE_REALLOCARRAY=0 \ +define Build/Prepare + $(call Build/Prepare/Default) + { \ + echo PREFIX=/usr; \ + echo HAVE_FTS=0; \ + echo HAVE_REALLOCARRAY=0; \ + echo "#Fix build on Darwin host (that values must be used for target build):"; \ + echo HAVE_DIRENT_NAMLEN=0; \ + echo HAVE_ENDIAN=1; \ + echo HAVE_SYS_ENDIAN=0; \ + echo HAVE_EFTYPE=0; \ + echo HAVE_PROGNAME=0; \ + echo HAVE_REWB_BSD=0; \ + echo HAVE_REWB_SYSV=1; \ + echo HAVE_STRCASESTR=1; \ + echo HAVE_STRINGLIST=0; \ + echo HAVE_STRLCAT=0; \ + echo HAVE_STRLCPY=0; \ + echo HAVE_STRPTIME=1; \ + echo HAVE_STRTONUM=0; \ + echo HAVE_VASPRINTF=1; \ + echo NEED_GNU_SOURCE=1; \ + echo HAVE_WCHAR=1; \ + echo UTF8_LOCALE=en_US.utf8; \ + echo STATIC=-static; \ + } > $(PKG_BUILD_DIR)/configure.local +endef define Package/mandoc/install $(INSTALL_DIR) $(1)/usr/bin/ diff --git a/utils/mandoc/patches/010-mandoc-1.14.5-fix-gnu-make.patch b/utils/mandoc/patches/010-mandoc-1.14.5-fix-gnu-make.patch deleted file mode 100644 index 45ccb96a4..000000000 --- a/utils/mandoc/patches/010-mandoc-1.14.5-fix-gnu-make.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/configure -+++ b/configure -@@ -62,7 +62,7 @@ HAVE_DIRENT_NAMLEN= - HAVE_EFTYPE= - HAVE_ENDIAN= - HAVE_ERR= --HAVE_FTS= -+HAVE_FTS=0 - HAVE_FTS_COMPARE_CONST= - HAVE_GETLINE= - HAVE_GETSUBOPT= -@@ -77,7 +77,7 @@ HAVE_OHASH= - HAVE_PATH_MAX= - HAVE_PLEDGE= - HAVE_PROGNAME= --HAVE_REALLOCARRAY= -+HAVE_REALLOCARRAY=0 - HAVE_RECALLOCARRAY= - HAVE_RECVMSG= - HAVE_REWB_BSD= -@@ -102,7 +102,7 @@ NEED_XPG4_2=0 - MANDOC_COBJS= - SOELIM_COBJS= - --PREFIX="/usr/local" -+PREFIX="/usr" - BINDIR= - SBINDIR= - BIN_FROM_SBIN=