gettext-full: bootstrap to local gnulib source

Using the local gnulib source during autogen.sh
allows for fine-grained control over the macros
and source files for use with gettext
but part of gnulib instead of gettext,
without having to wait for a release
or deal with gnulib as a git submodule.

This is an alternative to running autoreconf.

It also removes the need to patch macros
in the case where there is a conflict
between the source and our aclocal directory.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
This commit is contained in:
Michael Pratt 2023-04-16 18:32:14 -04:00 committed by Christian Marangi
parent 09f8f21ae3
commit d167adbc44
No known key found for this signature in database
GPG Key ID: AC001D09ADBFEAD7
2 changed files with 39 additions and 344 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=gettext-full
PKG_VERSION:=0.21.1
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=gettext-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/gettext
@ -21,7 +21,6 @@ PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=GPL-3.0-or-later
PKG_CPE_ID:=cpe:/a:gnu:gettext
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_BUILD_DEPENDS:=gettext-full/host libxml2
PKG_BUILD_PARALLEL:=0
@ -69,6 +68,8 @@ define Package/libintl-full
ABI_VERSION:=8
endef
export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR)
TARGET_CFLAGS += $(FPIC)
ifneq ($(HOST_OS),Linux)
TARGET_CFLAGS += -I$(STAGING_DIR_HOSTPKG)/include
@ -107,11 +108,47 @@ HOST_CONFIGURE_VARS += \
HOST_CFLAGS += $(HOST_FPIC)
define Host/Bootstrap
( \
cd $(HOST_BUILD_DIR); \
$(AM_TOOL_PATHS) \
./autogen.sh \
)
endef
define Host/Prepare
$(call Host/Prepare/Default)
$(if $(QUILT),,$(call Host/Bootstrap))
endef
define Host/Configure
$(if $(QUILT),$(call Host/Bootstrap))
$(call Host/Configure/Default)
endef
define Host/Compile
$(foreach makefile,$(PKG_MAKEFILES_FAKE),printf '%s\n%s\n' 'all:' 'install:' > $(HOST_BUILD_DIR)/$(makefile); )
$(call Host/Compile/Default,SUBDIRS='$(PKG_SUBDIRS)')
endef
define Build/Bootstrap
( \
cd $(PKG_BUILD_DIR); \
$(AM_TOOL_PATHS) \
./autogen.sh \
)
endef
define Build/Prepare
$(call Build/Prepare/Default)
$(if $(QUILT),,$(call Build/Bootstrap))
endef
define Build/Configure
$(if $(QUILT),$(call Build/Bootstrap))
$(call Build/Configure/Default)
endef
define Build/Compile
$(foreach makefile,$(PKG_MAKEFILES_FAKE),printf '%s\n%s\n' 'all:' 'install:' > $(PKG_BUILD_DIR)/$(makefile); )
$(call Build/Compile/Default,SUBDIRS='$(PKG_SUBDIRS)')

View File

@ -1,342 +0,0 @@
--- a/gettext-runtime/gnulib-m4/stddef_h.m4
+++ b/gettext-runtime/gnulib-m4/stddef_h.m4
@@ -9,7 +9,7 @@ dnl A placeholder for <stddef.h>, for pl
AC_DEFUN_ONCE([gl_STDDEF_H],
[
AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
dnl Persuade OpenBSD <stddef.h> to declare max_align_t.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
--- a/gettext-runtime/gnulib-m4/stdint.m4
+++ b/gettext-runtime/gnulib-m4/stdint.m4
@@ -15,7 +15,7 @@ AC_DEFUN_ONCE([gl_STDINT_H],
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_REQUIRE([gl_LIMITS_H])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
dnl For backward compatibility. Some packages may still be testing these
dnl macros.
--- a/gettext-runtime/gnulib-m4/wchar_h.m4
+++ b/gettext-runtime/gnulib-m4/wchar_h.m4
@@ -27,7 +27,7 @@ AC_DEFUN_ONCE([gl_WCHAR_H],
AC_REQUIRE([gl_FEATURES_H])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
if test $gt_cv_c_wint_t = yes; then
HAVE_WINT_T=1
else
--- a/gettext-runtime/gnulib-m4/wchar_t.m4
+++ b/gettext-runtime/gnulib-m4/wchar_t.m4
@@ -8,7 +8,7 @@ dnl From Bruno Haible.
dnl Test whether <stddef.h> has the 'wchar_t' type.
dnl Prerequisite: AC_PROG_CC
-AC_DEFUN([gt_TYPE_WCHAR_T],
+AC_DEFUN([gt_TYPE_WCHAR_T_GT],
[
AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
[AC_COMPILE_IFELSE(
--- a/gettext-runtime/gnulib-m4/wctype_h.m4
+++ b/gettext-runtime/gnulib-m4/wctype_h.m4
@@ -22,7 +22,7 @@ AC_DEFUN_ONCE([gl_WCTYPE_H],
fi
AC_SUBST([HAVE_ISWCNTRL])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
if test $gt_cv_c_wint_t = yes; then
HAVE_WINT_T=1
else
--- a/gettext-runtime/gnulib-m4/wcwidth.m4
+++ b/gettext-runtime/gnulib-m4/wcwidth.m4
@@ -12,8 +12,8 @@ AC_DEFUN([gl_FUNC_WCWIDTH],
dnl Persuade glibc <wchar.h> to declare wcwidth().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
AC_CHECK_HEADERS_ONCE([wchar.h])
AC_CHECK_FUNCS_ONCE([wcwidth])
--- a/gettext-runtime/gnulib-m4/wint_t.m4
+++ b/gettext-runtime/gnulib-m4/wint_t.m4
@@ -9,7 +9,7 @@ dnl Test whether <wchar.h> has the 'wint
dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'.
dnl Prerequisite: AC_PROG_CC
-AC_DEFUN([gt_TYPE_WINT_T],
+AC_DEFUN([gt_TYPE_WINT_T_GT],
[
AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
[AC_COMPILE_IFELSE(
--- a/gettext-runtime/libasprintf/configure.ac
+++ b/gettext-runtime/libasprintf/configure.ac
@@ -76,8 +76,8 @@ dnl Checks for typedefs, structures, and
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_LONG_LONG_INT
-gt_TYPE_WCHAR_T
-gt_TYPE_WINT_T
+gt_TYPE_WCHAR_T_GT
+gt_TYPE_WINT_T_GT
AC_TYPE_MBSTATE_T
AC_CHECK_TYPE([ptrdiff_t], ,
[AC_DEFINE([ptrdiff_t], [long],
--- a/gettext-runtime/libasprintf/gnulib-m4/wchar_t.m4
+++ b/gettext-runtime/libasprintf/gnulib-m4/wchar_t.m4
@@ -8,7 +8,7 @@ dnl From Bruno Haible.
dnl Test whether <stddef.h> has the 'wchar_t' type.
dnl Prerequisite: AC_PROG_CC
-AC_DEFUN([gt_TYPE_WCHAR_T],
+AC_DEFUN([gt_TYPE_WCHAR_T_GT],
[
AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
[AC_COMPILE_IFELSE(
--- a/gettext-runtime/libasprintf/gnulib-m4/wint_t.m4
+++ b/gettext-runtime/libasprintf/gnulib-m4/wint_t.m4
@@ -9,7 +9,7 @@ dnl Test whether <wchar.h> has the 'wint
dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'.
dnl Prerequisite: AC_PROG_CC
-AC_DEFUN([gt_TYPE_WINT_T],
+AC_DEFUN([gt_TYPE_WINT_T_GT],
[
AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
[AC_COMPILE_IFELSE(
--- a/gettext-runtime/m4/intl.m4
+++ b/gettext-runtime/m4/intl.m4
@@ -31,8 +31,8 @@ AC_DEFUN([AM_INTL_SUBDIR],
AC_REQUIRE([gl_VISIBILITY])dnl
AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
- AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
- AC_REQUIRE([gt_TYPE_WINT_T])dnl
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])dnl
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])dnl
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
AC_REQUIRE([gt_TYPE_INTMAX_T])
AC_REQUIRE([gt_PRINTF_POSIX])
--- a/gettext-tools/gnulib-m4/stdint.m4
+++ b/gettext-tools/gnulib-m4/stdint.m4
@@ -15,7 +15,7 @@ AC_DEFUN_ONCE([gl_STDINT_H],
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_REQUIRE([gl_LIMITS_H])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
dnl For backward compatibility. Some packages may still be testing these
dnl macros.
--- a/gettext-tools/gnulib-m4/vasnprintf.m4
+++ b/gettext-tools/gnulib-m4/vasnprintf.m4
@@ -32,16 +32,16 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF],
# Prerequisites of lib/printf-args.h, lib/printf-args.c.
AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
[
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
])
# Prerequisites of lib/printf-parse.h, lib/printf-parse.c.
AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
[
AC_REQUIRE([gl_FEATURES_H])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
AC_REQUIRE([AC_TYPE_SIZE_T])
AC_CHECK_TYPE([ptrdiff_t], ,
[AC_DEFINE([ptrdiff_t], [long],
@@ -54,8 +54,8 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
[
AC_REQUIRE([AC_FUNC_ALLOCA])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
dnl Use the _snprintf function only if it is declared (because on NetBSD it
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
--- a/gettext-tools/gnulib-m4/wchar_h.m4
+++ b/gettext-tools/gnulib-m4/wchar_h.m4
@@ -27,7 +27,7 @@ AC_DEFUN_ONCE([gl_WCHAR_H],
AC_REQUIRE([gl_FEATURES_H])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
if test $gt_cv_c_wint_t = yes; then
HAVE_WINT_T=1
else
--- a/gettext-tools/gnulib-m4/wchar_t.m4
+++ b/gettext-tools/gnulib-m4/wchar_t.m4
@@ -8,7 +8,7 @@ dnl From Bruno Haible.
dnl Test whether <stddef.h> has the 'wchar_t' type.
dnl Prerequisite: AC_PROG_CC
-AC_DEFUN([gt_TYPE_WCHAR_T],
+AC_DEFUN([gt_TYPE_WCHAR_T_GT],
[
AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
[AC_COMPILE_IFELSE(
--- a/gettext-tools/gnulib-m4/wctype_h.m4
+++ b/gettext-tools/gnulib-m4/wctype_h.m4
@@ -22,7 +22,7 @@ AC_DEFUN_ONCE([gl_WCTYPE_H],
fi
AC_SUBST([HAVE_ISWCNTRL])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
if test $gt_cv_c_wint_t = yes; then
HAVE_WINT_T=1
else
--- a/gettext-tools/gnulib-m4/wcwidth.m4
+++ b/gettext-tools/gnulib-m4/wcwidth.m4
@@ -12,8 +12,8 @@ AC_DEFUN([gl_FUNC_WCWIDTH],
dnl Persuade glibc <wchar.h> to declare wcwidth().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
AC_CHECK_HEADERS_ONCE([wchar.h])
AC_CHECK_FUNCS_ONCE([wcwidth])
--- a/gettext-tools/gnulib-m4/wint_t.m4
+++ b/gettext-tools/gnulib-m4/wint_t.m4
@@ -9,7 +9,7 @@ dnl Test whether <wchar.h> has the 'wint
dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'.
dnl Prerequisite: AC_PROG_CC
-AC_DEFUN([gt_TYPE_WINT_T],
+AC_DEFUN([gt_TYPE_WINT_T_GT],
[
AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
[AC_COMPILE_IFELSE(
--- a/libtextstyle/gnulib-m4/stdint.m4
+++ b/libtextstyle/gnulib-m4/stdint.m4
@@ -15,7 +15,7 @@ AC_DEFUN_ONCE([gl_STDINT_H],
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_REQUIRE([gl_LIMITS_H])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
dnl For backward compatibility. Some packages may still be testing these
dnl macros.
--- a/libtextstyle/gnulib-m4/vasnprintf.m4
+++ b/libtextstyle/gnulib-m4/vasnprintf.m4
@@ -32,16 +32,16 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF],
# Prerequisites of lib/printf-args.h, lib/printf-args.c.
AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
[
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
])
# Prerequisites of lib/printf-parse.h, lib/printf-parse.c.
AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
[
AC_REQUIRE([gl_FEATURES_H])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
AC_REQUIRE([AC_TYPE_SIZE_T])
AC_CHECK_TYPE([ptrdiff_t], ,
[AC_DEFINE([ptrdiff_t], [long],
@@ -54,8 +54,8 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
[
AC_REQUIRE([AC_FUNC_ALLOCA])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
dnl Use the _snprintf function only if it is declared (because on NetBSD it
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
--- a/libtextstyle/gnulib-m4/wchar_h.m4
+++ b/libtextstyle/gnulib-m4/wchar_h.m4
@@ -27,7 +27,7 @@ AC_DEFUN_ONCE([gl_WCHAR_H],
AC_REQUIRE([gl_FEATURES_H])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
if test $gt_cv_c_wint_t = yes; then
HAVE_WINT_T=1
else
--- a/libtextstyle/gnulib-m4/wchar_t.m4
+++ b/libtextstyle/gnulib-m4/wchar_t.m4
@@ -8,7 +8,7 @@ dnl From Bruno Haible.
dnl Test whether <stddef.h> has the 'wchar_t' type.
dnl Prerequisite: AC_PROG_CC
-AC_DEFUN([gt_TYPE_WCHAR_T],
+AC_DEFUN([gt_TYPE_WCHAR_T_GT],
[
AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
[AC_COMPILE_IFELSE(
--- a/libtextstyle/gnulib-m4/wint_t.m4
+++ b/libtextstyle/gnulib-m4/wint_t.m4
@@ -9,7 +9,7 @@ dnl Test whether <wchar.h> has the 'wint
dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'.
dnl Prerequisite: AC_PROG_CC
-AC_DEFUN([gt_TYPE_WINT_T],
+AC_DEFUN([gt_TYPE_WINT_T_GT],
[
AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
[AC_COMPILE_IFELSE(
--- a/gettext-tools/gnulib-m4/gnulib-comp.m4
+++ b/gettext-tools/gnulib-m4/gnulib-comp.m4
@@ -2218,8 +2218,8 @@ changequote([, ])dnl
AC_REQUIRE([gl_SOCKETLIB])
AC_REQUIRE([gl_SOCKETS])
gl_TYPE_SOCKLEN_T
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
+ AC_REQUIRE([gt_TYPE_WINT_T_GT])
gl_FUNC_STRERROR_R
AS_IF([test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1], [
AC_LIBOBJ([strerror_r])
--- a/libtextstyle/gnulib-m4/stddef_h.m4
+++ b/libtextstyle/gnulib-m4/stddef_h.m4
@@ -9,7 +9,7 @@ dnl A placeholder for <stddef.h>, for pl
AC_DEFUN_ONCE([gl_STDDEF_H],
[
AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
dnl Persuade OpenBSD <stddef.h> to declare max_align_t.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
--- a/gettext-tools/gnulib-m4/stddef_h.m4
+++ b/gettext-tools/gnulib-m4/stddef_h.m4
@@ -9,7 +9,7 @@ dnl A placeholder for <stddef.h>, for pl
AC_DEFUN_ONCE([gl_STDDEF_H],
[
AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
+ AC_REQUIRE([gt_TYPE_WCHAR_T_GT])
dnl Persuade OpenBSD <stddef.h> to declare max_align_t.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])