textproc/enca: Fix cross-build.

This commit is contained in:
riastradh 2024-01-26 03:15:50 +00:00
parent 02c7236806
commit 52f08bf471
4 changed files with 57 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.8 2015/04/11 02:26:02 mef Exp $
# $NetBSD: Makefile,v 1.9 2024/01/26 03:15:50 riastradh Exp $
DISTNAME= enca-1.15
CATEGORIES= converters
@ -16,4 +16,21 @@ USE_PKGLOCALEDIR= yes
USE_TOOLS+= gmake
PKGCONFIG_OVERRIDE+= ${WRKSRC}/enca.pc.in
USE_TOOLS+= autoconf automake autoreconf
TOOL_DEPENDS+= autoconf-archive>=0:../../devel/autoconf-archive
TOOL_DEPENDS+= gettext-m4>=0:../../devel/gettext-m4
pre-configure:
@${STEP_MSG} Rebuilding Makefiles
${RUN} cd ${WRKSRC} && autoreconf -fiv
.include "../../mk/bsd.prefs.mk"
.if ${USE_CROSS_COMPILE:tl} == "yes"
CONFIGURE_ARGS+= CC_FOR_BUILD=${NATIVE_CC:Q}
CONFIGURE_ENV.NetBSD+= ac_cv_file__dev_random=yes
CONFIGURE_ENV.NetBSD+= ac_cv_file__dev_urandom=yes
CONFIGURE_ENV.NetBSD+= ac_cv_file__dev_srandom=no
CONFIGURE_ENV.NetBSD+= ac_cv_file__dev_arandom=no
.endif
.include "../../mk/bsd.pkg.mk"

View File

@ -1,5 +1,7 @@
$NetBSD: distinfo,v 1.9 2021/10/26 11:21:52 nia Exp $
$NetBSD: distinfo,v 1.10 2024/01/26 03:15:50 riastradh Exp $
BLAKE2s (enca-1.15.tar.bz2) = 4487af00052b8f07536685f3c4bd0010f55ce8e67ad0d07a6f2f1b19296f8e46
SHA512 (enca-1.15.tar.bz2) = f0b843b0b38fcb250991ad072fe2f1bcaa6aaad8348983446046f40b44a2523a7c3b46569f9693e5b2848356288f718595ea4cc9bc0b4685aac02291fe7393ba
Size (enca-1.15.tar.bz2) = 536627 bytes
SHA1 (patch-configure.ac) = fdfe12a86d37ba8182919061d6976b06a6ddd892
SHA1 (patch-tools_Makefile.am) = 01f8af341f2fb8c6d7816edf5b38690b5a9c53f8

View File

@ -0,0 +1,14 @@
$NetBSD: patch-configure.ac,v 1.4 2024/01/26 03:15:50 riastradh Exp $
Fix cross-build.
--- configure.ac.orig 2013-09-30 07:48:22.000000000 +0000
+++ configure.ac
@@ -36,6 +36,7 @@ RELEASE=1
dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC
+AX_PROG_CC_FOR_BUILD
AC_GNU_SOURCE
AC_AIX
AC_ISC_POSIX

View File

@ -0,0 +1,22 @@
$NetBSD: patch-tools_Makefile.am,v 1.3 2024/01/26 03:15:50 riastradh Exp $
Fix cross-build.
--- tools/Makefile.am.orig 2013-09-30 07:48:22.000000000 +0000
+++ tools/Makefile.am
@@ -30,8 +30,13 @@ all: encodings.h
encodings.sed: $(top_builddir)/iconvenc.h
sed -e 's/^#define \([A-Z0-9_]*\) \(.*\)/@\1@ \2/' -e 's/"//g' -e 's/NULL$$//' -e 's/ /\//' -e 's/^\(.*\)$$/s\/\1\//' $(top_builddir)/iconvenc.h >encodings.sed
-encodings.h: encodings.sed $(srcdir)/encodings.dat make_hash
- sed -f encodings.sed $(srcdir)/encodings.dat | ./make_hash >encodings.h
+tool_make_hash: tool_make_hash.o
+ $(CC_FOR_BUILD) -o $@ $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) tool_make_hash.o
+tool_make_hash.o: make_hash.c
+ $(CC_FOR_BUILD) -o $@ $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c make_hash.c
+
+encodings.h: encodings.sed $(srcdir)/encodings.dat tool_make_hash
+ sed -f encodings.sed $(srcdir)/encodings.dat | ./tool_make_hash >encodings.h
# Normally there's no need to regenerate tables, they are copy-and-pasted
# into the C source manually, but the rules are here. Run `make tables'