Browse Source

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 <sergey@lobanov.in>
lilik-openwrt-22.03
Sergey V. Lobanov 2 years ago
committed by Rosen Penev
parent
commit
34018f1fe0
2 changed files with 27 additions and 33 deletions
  1. +27
    -4
      utils/mandoc/Makefile
  2. +0
    -29
      utils/mandoc/patches/010-mandoc-1.14.5-fix-gnu-make.patch

+ 27
- 4
utils/mandoc/Makefile View File

@ -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/


+ 0
- 29
utils/mandoc/patches/010-mandoc-1.14.5-fix-gnu-make.patch View File

@ -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=

Loading…
Cancel
Save