From 3980dfcd05741bd650d0e3d0938bfd071ffa7824 Mon Sep 17 00:00:00 2001 From: Tony Ambardar Date: Tue, 29 Nov 2022 17:52:46 -0800 Subject: [PATCH 01/23] kernel: fix handling of CONFIG_DYNAMIC_DEBUG Since CONFIG_DYNAMIC_DEBUG is already managed via the KERNEL_DYNAMIC_DEBUG setting in Config-kernel.in (default N), remove or disable it in target configs which unconditionally enable it, along with the related setting CONFIG_DYNAMIC_DEBUG_CORE. This saves several KB in the kernels for ipq40xx, ipq806x, filogic, mt7622, qoriq, and sunxi. Signed-off-by: Tony Ambardar --- target/linux/generic/config-5.10 | 2 +- target/linux/generic/config-5.15 | 2 +- target/linux/ipq40xx/config-5.15 | 1 - target/linux/ipq806x/config-5.10 | 1 - target/linux/ipq806x/config-5.15 | 1 - target/linux/mediatek/filogic/config-5.15 | 1 - target/linux/mediatek/mt7622/config-5.15 | 1 - target/linux/qoriq/config-5.15 | 1 - target/linux/sunxi/config-5.15 | 1 - 9 files changed, 2 insertions(+), 9 deletions(-) diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index 49325971f6..9c4aad86c1 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -1746,7 +1746,7 @@ CONFIG_DVB_MAX_ADAPTERS=16 # CONFIG_DW_EDMA_PCIE is not set # CONFIG_DW_WATCHDOG is not set # CONFIG_DYNAMIC_DEBUG is not set -CONFIG_DYNAMIC_DEBUG_CORE=y +# CONFIG_DYNAMIC_DEBUG_CORE is not set # CONFIG_E100 is not set # CONFIG_E1000 is not set # CONFIG_E1000E is not set diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index c6af24ec66..132f65c806 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -1830,7 +1830,7 @@ CONFIG_DVB_MAX_ADAPTERS=16 # CONFIG_DW_WATCHDOG is not set # CONFIG_DW_XDATA_PCIE is not set # CONFIG_DYNAMIC_DEBUG is not set -CONFIG_DYNAMIC_DEBUG_CORE=y +# CONFIG_DYNAMIC_DEBUG_CORE is not set # CONFIG_E100 is not set # CONFIG_E1000 is not set # CONFIG_E1000E is not set diff --git a/target/linux/ipq40xx/config-5.15 b/target/linux/ipq40xx/config-5.15 index 32260fa08c..88029caf76 100644 --- a/target/linux/ipq40xx/config-5.15 +++ b/target/linux/ipq40xx/config-5.15 @@ -144,7 +144,6 @@ CONFIG_DMA_SHARED_BUFFER=y CONFIG_DMA_VIRTUAL_CHANNELS=y CONFIG_DTC=y CONFIG_DT_IDLE_STATES=y -CONFIG_DYNAMIC_DEBUG=y CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y CONFIG_EEPROM_AT24=y diff --git a/target/linux/ipq806x/config-5.10 b/target/linux/ipq806x/config-5.10 index 826dd73455..1f1af06b29 100644 --- a/target/linux/ipq806x/config-5.10 +++ b/target/linux/ipq806x/config-5.10 @@ -135,7 +135,6 @@ CONFIG_DT_IDLE_STATES=y # CONFIG_DWMAC_GENERIC is not set CONFIG_DWMAC_IPQ806X=y # CONFIG_DWMAC_QCOM_ETHQOS is not set -CONFIG_DYNAMIC_DEBUG=y CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y CONFIG_ETHERNET_PACKET_MANGLE=y diff --git a/target/linux/ipq806x/config-5.15 b/target/linux/ipq806x/config-5.15 index 0bd6dde11c..6d710e61f5 100644 --- a/target/linux/ipq806x/config-5.15 +++ b/target/linux/ipq806x/config-5.15 @@ -136,7 +136,6 @@ CONFIG_DT_IDLE_STATES=y # CONFIG_DWMAC_GENERIC is not set CONFIG_DWMAC_IPQ806X=y # CONFIG_DWMAC_QCOM_ETHQOS is not set -CONFIG_DYNAMIC_DEBUG=y CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y CONFIG_ETHERNET_PACKET_MANGLE=y diff --git a/target/linux/mediatek/filogic/config-5.15 b/target/linux/mediatek/filogic/config-5.15 index 883e194be4..41f127ea5b 100644 --- a/target/linux/mediatek/filogic/config-5.15 +++ b/target/linux/mediatek/filogic/config-5.15 @@ -127,7 +127,6 @@ CONFIG_DMA_OF=y CONFIG_DMA_REMAP=y CONFIG_DMA_VIRTUAL_CHANNELS=y CONFIG_DTC=y -CONFIG_DYNAMIC_DEBUG=y CONFIG_EDAC_SUPPORT=y CONFIG_EINT_MTK=y CONFIG_EXT4_FS=y diff --git a/target/linux/mediatek/mt7622/config-5.15 b/target/linux/mediatek/mt7622/config-5.15 index 9fb6f7befd..1ce6d852ba 100644 --- a/target/linux/mediatek/mt7622/config-5.15 +++ b/target/linux/mediatek/mt7622/config-5.15 @@ -150,7 +150,6 @@ CONFIG_DMA_OF=y CONFIG_DMA_REMAP=y CONFIG_DMA_VIRTUAL_CHANNELS=y CONFIG_DTC=y -CONFIG_DYNAMIC_DEBUG=y CONFIG_EDAC_SUPPORT=y CONFIG_EINT_MTK=y CONFIG_EXT4_FS=y diff --git a/target/linux/qoriq/config-5.15 b/target/linux/qoriq/config-5.15 index bf487462d5..8ebee2bb14 100644 --- a/target/linux/qoriq/config-5.15 +++ b/target/linux/qoriq/config-5.15 @@ -93,7 +93,6 @@ CONFIG_DMA_OPS_BYPASS=y CONFIG_DPAA_ERRATUM_A050385=y CONFIG_DTC=y CONFIG_DUMMY_CONSOLE=y -CONFIG_DYNAMIC_DEBUG=y CONFIG_E500=y # CONFIG_E5500_CPU is not set CONFIG_E6500_CPU=y diff --git a/target/linux/sunxi/config-5.15 b/target/linux/sunxi/config-5.15 index 17c4d910c8..9771ee8b4c 100644 --- a/target/linux/sunxi/config-5.15 +++ b/target/linux/sunxi/config-5.15 @@ -136,7 +136,6 @@ CONFIG_DVB_CORE=y CONFIG_DWMAC_GENERIC=y # CONFIG_DWMAC_SUN8I is not set CONFIG_DWMAC_SUNXI=y -CONFIG_DYNAMIC_DEBUG=y CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y CONFIG_ELF_CORE=y From 3d66f551611de37b88182c64efa091298a9e7f2c Mon Sep 17 00:00:00 2001 From: Tony Ambardar Date: Mon, 24 Apr 2023 22:28:44 -0700 Subject: [PATCH 02/23] kernel: improve handling of CONFIG_IO_URING Kernel setting CONFIG_IO_URING supports high-performance I/O for file access and servers, generally for more performant platforms, and adds ~45 KB to kernel sizes. The need for this on less "beefy" devices is questionable, as is the size cost considering many platforms have kernel size limits which require tricky repartitioning if outgrown. The size cost is also large relative to the ~180 KB bump expected between major OpenWRT kernel releases. No OpenWrt packages have hard dependencies on this; samba4 and mariadb can take advantage if available (+KERNEL_IO_URING:liburing) but otherwise build and work fine. Since CONFIG_IO_URING is already managed via the KERNEL_IO_URING setting in Config-kernel.in (default Y), remove it from those target configs which unconditionally enable it, and update the defaults to enable it conditionally only on more powerful 64-bit x86 and arm devices. It may still be manually enabled as needed for high-performance custom builds. Signed-off-by: Tony Ambardar --- config/Config-kernel.in | 3 ++- target/linux/airoha/config-5.15 | 1 - target/linux/bcm53xx/config-5.10 | 1 - target/linux/bcm53xx/config-5.15 | 1 - target/linux/gemini/config-5.10 | 1 - target/linux/gemini/config-5.15 | 1 - target/linux/imx/config-5.15 | 1 - target/linux/ipq40xx/config-5.15 | 1 - target/linux/mediatek/filogic/config-5.15 | 1 - target/linux/mediatek/mt7623/config-5.15 | 1 - target/linux/mediatek/mt7629/config-5.15 | 1 - target/linux/rockchip/armv8/config-5.10 | 1 - target/linux/rockchip/armv8/config-5.15 | 1 - target/linux/x86/config-5.10 | 1 - target/linux/x86/config-5.15 | 1 - 15 files changed, 2 insertions(+), 15 deletions(-) diff --git a/config/Config-kernel.in b/config/Config-kernel.in index c7b1864235..979a44660d 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -469,7 +469,8 @@ config KERNEL_AIO config KERNEL_IO_URING bool "Compile the kernel with io_uring support" - default y if !SMALL_FLASH + depends on !SMALL_FLASH + default y if (x86_64 || aarch64) config KERNEL_FHANDLE bool "Compile the kernel with support for fhandle syscalls" diff --git a/target/linux/airoha/config-5.15 b/target/linux/airoha/config-5.15 index adc8cdfb9b..2ccdb05060 100644 --- a/target/linux/airoha/config-5.15 +++ b/target/linux/airoha/config-5.15 @@ -135,7 +135,6 @@ CONFIG_INITRAMFS_SOURCE="" # CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set # CONFIG_IOMMU_IO_PGTABLE_LPAE is not set CONFIG_IOMMU_SUPPORT=y -CONFIG_IO_URING=y CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y diff --git a/target/linux/bcm53xx/config-5.10 b/target/linux/bcm53xx/config-5.10 index 9850aa9563..04b972131a 100644 --- a/target/linux/bcm53xx/config-5.10 +++ b/target/linux/bcm53xx/config-5.10 @@ -165,7 +165,6 @@ CONFIG_HW_RANDOM_BCM2835=y CONFIG_HZ_FIXED=0 CONFIG_HZ_PERIODIC=y CONFIG_INITRAMFS_SOURCE="" -CONFIG_IO_URING=y CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y diff --git a/target/linux/bcm53xx/config-5.15 b/target/linux/bcm53xx/config-5.15 index 3941c22b9c..a09937defa 100644 --- a/target/linux/bcm53xx/config-5.15 +++ b/target/linux/bcm53xx/config-5.15 @@ -171,7 +171,6 @@ CONFIG_HW_RANDOM_BCM2835=y CONFIG_HZ_FIXED=0 CONFIG_HZ_PERIODIC=y CONFIG_INITRAMFS_SOURCE="" -CONFIG_IO_URING=y CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y diff --git a/target/linux/gemini/config-5.10 b/target/linux/gemini/config-5.10 index 698dc44b49..19dc2692f2 100644 --- a/target/linux/gemini/config-5.10 +++ b/target/linux/gemini/config-5.10 @@ -216,7 +216,6 @@ CONFIG_INPUT_KEYBOARD=y # CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set # CONFIG_IOMMU_IO_PGTABLE_LPAE is not set CONFIG_IOMMU_SUPPORT=y -CONFIG_IO_URING=y CONFIG_IPC_NS=y CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y diff --git a/target/linux/gemini/config-5.15 b/target/linux/gemini/config-5.15 index b3b7a7dd12..b76371fbdc 100644 --- a/target/linux/gemini/config-5.15 +++ b/target/linux/gemini/config-5.15 @@ -217,7 +217,6 @@ CONFIG_INPUT_KEYBOARD=y # CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set # CONFIG_IOMMU_IO_PGTABLE_LPAE is not set CONFIG_IOMMU_SUPPORT=y -CONFIG_IO_URING=y CONFIG_IPC_NS=y CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y diff --git a/target/linux/imx/config-5.15 b/target/linux/imx/config-5.15 index 0c9b7d22b4..90b8c285fd 100644 --- a/target/linux/imx/config-5.15 +++ b/target/linux/imx/config-5.15 @@ -233,7 +233,6 @@ CONFIG_IMX_SDMA=y CONFIG_IMX_THERMAL=y # CONFIG_IMX_WEIM is not set CONFIG_INITRAMFS_SOURCE="" -CONFIG_IO_URING=y CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y diff --git a/target/linux/ipq40xx/config-5.15 b/target/linux/ipq40xx/config-5.15 index 88029caf76..d5bde55178 100644 --- a/target/linux/ipq40xx/config-5.15 +++ b/target/linux/ipq40xx/config-5.15 @@ -210,7 +210,6 @@ CONFIG_INITRAMFS_SOURCE="" # CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set # CONFIG_IOMMU_IO_PGTABLE_LPAE is not set CONFIG_IOMMU_SUPPORT=y -CONFIG_IO_URING=y # CONFIG_IPQ_APSS_PLL is not set CONFIG_IPQ_GCC_4019=y # CONFIG_IPQ_GCC_6018 is not set diff --git a/target/linux/mediatek/filogic/config-5.15 b/target/linux/mediatek/filogic/config-5.15 index 41f127ea5b..96ff95be13 100644 --- a/target/linux/mediatek/filogic/config-5.15 +++ b/target/linux/mediatek/filogic/config-5.15 @@ -186,7 +186,6 @@ CONFIG_I2C_MT65XX=y CONFIG_ICPLUS_PHY=y CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 CONFIG_INITRAMFS_SOURCE="" -CONFIG_IO_URING=y CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y diff --git a/target/linux/mediatek/mt7623/config-5.15 b/target/linux/mediatek/mt7623/config-5.15 index fa99dd50bb..2d3523d762 100644 --- a/target/linux/mediatek/mt7623/config-5.15 +++ b/target/linux/mediatek/mt7623/config-5.15 @@ -281,7 +281,6 @@ CONFIG_IOMMU_IO_PGTABLE_ARMV7S=y # CONFIG_IOMMU_IO_PGTABLE_ARMV7S_SELFTEST is not set # CONFIG_IOMMU_IO_PGTABLE_LPAE is not set CONFIG_IOMMU_SUPPORT=y -CONFIG_IO_URING=y CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y diff --git a/target/linux/mediatek/mt7629/config-5.15 b/target/linux/mediatek/mt7629/config-5.15 index 46104ece48..03fad40cca 100644 --- a/target/linux/mediatek/mt7629/config-5.15 +++ b/target/linux/mediatek/mt7629/config-5.15 @@ -142,7 +142,6 @@ CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_MTK=y CONFIG_HZ_FIXED=0 CONFIG_INITRAMFS_SOURCE="" -CONFIG_IO_URING=y CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y diff --git a/target/linux/rockchip/armv8/config-5.10 b/target/linux/rockchip/armv8/config-5.10 index 2d250219a8..637c54be6f 100644 --- a/target/linux/rockchip/armv8/config-5.10 +++ b/target/linux/rockchip/armv8/config-5.10 @@ -287,7 +287,6 @@ CONFIG_IOMMU_IO_PGTABLE_LPAE=y # CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set CONFIG_IOMMU_SUPPORT=y # CONFIG_IO_STRICT_DEVMEM is not set -CONFIG_IO_URING=y CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y diff --git a/target/linux/rockchip/armv8/config-5.15 b/target/linux/rockchip/armv8/config-5.15 index bb7f44a2c4..51a14055f3 100644 --- a/target/linux/rockchip/armv8/config-5.15 +++ b/target/linux/rockchip/armv8/config-5.15 @@ -287,7 +287,6 @@ CONFIG_IOMMU_IO_PGTABLE_LPAE=y # CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set CONFIG_IOMMU_SUPPORT=y # CONFIG_IO_STRICT_DEVMEM is not set -CONFIG_IO_URING=y CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y diff --git a/target/linux/x86/config-5.10 b/target/linux/x86/config-5.10 index 6868dec18a..4616fcba07 100644 --- a/target/linux/x86/config-5.10 +++ b/target/linux/x86/config-5.10 @@ -181,7 +181,6 @@ CONFIG_IO_DELAY_0X80=y # CONFIG_IO_DELAY_0XED is not set # CONFIG_IO_DELAY_NONE is not set # CONFIG_IO_DELAY_UDELAY is not set -CONFIG_IO_URING=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_IRQ_FORCED_THREADING=y diff --git a/target/linux/x86/config-5.15 b/target/linux/x86/config-5.15 index a3d8db26ae..ee7ab9d6de 100644 --- a/target/linux/x86/config-5.15 +++ b/target/linux/x86/config-5.15 @@ -183,7 +183,6 @@ CONFIG_IO_DELAY_0X80=y # CONFIG_IO_DELAY_0XED is not set # CONFIG_IO_DELAY_NONE is not set # CONFIG_IO_DELAY_UDELAY is not set -CONFIG_IO_URING=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_IRQ_FORCED_THREADING=y From 8469e1968b8a02ea235470b98155721eaf97117a Mon Sep 17 00:00:00 2001 From: Aleksander Jan Bajkowski Date: Thu, 4 May 2023 14:02:04 +0200 Subject: [PATCH 03/23] Revert "lantiq: mark source only" This reverts commit c306385474f4f183657423be708ac7813ee38b47. It should be sufficient to disable only the xrx200 subtarget. Signed-off-by: Aleksander Jan Bajkowski --- target/linux/lantiq/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/lantiq/Makefile b/target/linux/lantiq/Makefile index 69746eb05c..08618fa9a3 100644 --- a/target/linux/lantiq/Makefile +++ b/target/linux/lantiq/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk BOARD:=lantiq BOARDNAME:=Lantiq -FEATURES:=squashfs source-only +FEATURES:=squashfs SUBTARGETS:=xrx200 xway xway_legacy falcon ase KERNEL_PATCHVER:=5.10 From 0c117e1f6ccbee684ea0589d9024ca9dec4679c9 Mon Sep 17 00:00:00 2001 From: Aleksander Jan Bajkowski Date: Thu, 4 May 2023 13:30:35 +0200 Subject: [PATCH 04/23] lantiq: xrx200: mark subtarget as source-only The current problems blocking the switch to the kernel 5.15 are related to the GSWIP driver. This driver is only used by the xrx200 subtarget. The other subtargets are unaffected by this problem. Signed-off-by: Aleksander Jan Bajkowski --- target/linux/lantiq/xrx200/target.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/lantiq/xrx200/target.mk b/target/linux/lantiq/xrx200/target.mk index 0f119edd6f..6e01fc79e4 100644 --- a/target/linux/lantiq/xrx200/target.mk +++ b/target/linux/lantiq/xrx200/target.mk @@ -1,7 +1,7 @@ ARCH:=mips SUBTARGET:=xrx200 BOARDNAME:=XRX200 -FEATURES+=atm nand ramdisk +FEATURES+=atm nand ramdisk source-only CPU_TYPE:=24kc DEFAULT_PACKAGES+=kmod-leds-gpio \ From ffd7c05aa72ee56b836903159540f9470aeef121 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Thu, 20 Apr 2023 12:31:16 -0400 Subject: [PATCH 05/23] prereq-build: add check for true and false Some uses cases, like with autotools, need a path for 'true' if we use them to force something to skip. This will work by default on Linux hosts, and require MacOS hosts to get coreutils, which is currently installed in the CI for 'macos-latest' host. In the future, prereq stage can be reworked to search for the actual binary instead of relying on env. Signed-off-by: Michael Pratt --- include/prereq-build.mk | 7 +++++++ rules.mk | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 8fae92ab97..14a2210880 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -8,6 +8,13 @@ include $(INCLUDE_DIR)/prereq.mk SHELL:=sh PKG_NAME:=Build dependency +$(eval $(call TestHostCommand,true, \ + Please install GNU 'coreutils', \ + $(TRUE))) + +$(eval $(call TestHostCommand,false, \ + Please install GNU 'coreutils', \ + $(FALSE); [ $$$$$$$$? = 1 ] && $(TRUE))) # Required for the toolchain $(eval $(call TestHostCommand,working-make, \ diff --git a/rules.mk b/rules.mk index 57d7995d4f..cc7904ac72 100644 --- a/rules.mk +++ b/rules.mk @@ -268,6 +268,14 @@ FIND:=find PATCH:=patch PYTHON:=python3 +ifeq ($(HOST_OS),Darwin) + TRUE:=/usr/bin/env gtrue + FALSE:=/usr/bin/env gfalse +else + TRUE:=/usr/bin/env true + FALSE:=/usr/bin/env false +endif + INSTALL_BIN:=install -m0755 INSTALL_SUID:=install -m4755 INSTALL_DIR:=install -d -m0755 From c52d938481651b6f9e0a4087652c99b805716ed8 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Fri, 14 Apr 2023 02:06:53 -0400 Subject: [PATCH 06/23] autotools: add list of fake paths to tools A list that can be used by some packages in order to force the skipping of every execution of autoreconf. Signed-off-by: Michael Pratt --- include/autotools.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/autotools.mk b/include/autotools.mk index c378efe6f9..d0e4b3642f 100644 --- a/include/autotools.mk +++ b/include/autotools.mk @@ -26,6 +26,8 @@ AM_TOOL_PATHS:= \ AUTOPOINT=true \ GTKDOCIZE=true +AM_TOOL_PATHS_FAKE:=$(subst = ,=,$(patsubst "%,"$(TRUE)",$(subst =,= ",$(AM_TOOL_PATHS)))) + # 1: build dir # 2: remove files # 3: automake paths From fe33d5ba13370027165b9acf2bd895f5b4d9a4ea Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 22 Mar 2023 18:29:24 -0400 Subject: [PATCH 07/23] tools: add gnulib source By having a local copy of gnulib, we can: import the latest macro fixes into any package, get rid of some statically stored macros that were otherwise missing, bootstrap GNU tools with the latest relevant source without having to wait for a release or rely on git submodules, and possibly more... The patch assists in bootstrapping by ignoring the building of po files using gettext, and also to allow a user-defined path to a program to include parameters. Signed-off-by: Michael Pratt --- rules.mk | 1 + tools/Makefile | 1 + tools/gnulib/Makefile | 25 +++++++++++ tools/gnulib/patches/000-bootstrap.patch | 54 ++++++++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 tools/gnulib/Makefile create mode 100644 tools/gnulib/patches/000-bootstrap.patch diff --git a/rules.mk b/rules.mk index cc7904ac72..dcac49667b 100644 --- a/rules.mk +++ b/rules.mk @@ -358,6 +358,7 @@ ifeq ($(CONFIG_BUILD_LOG),y) endif export BISON_PKGDATADIR:=$(STAGING_DIR_HOST)/share/bison +export HOST_GNULIB_SRCDIR:=$(STAGING_DIR_HOST)/share/gnulib export M4:=$(STAGING_DIR_HOST)/bin/m4 define shvar diff --git a/tools/Makefile b/tools/Makefile index 7e8fbad107..3bf94827cf 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -45,6 +45,7 @@ tools-y += findutils tools-y += firmware-utils tools-y += flex tools-y += gengetopt +tools-y += gnulib tools-y += libressl tools-y += libtool tools-y += lzma diff --git a/tools/gnulib/Makefile b/tools/gnulib/Makefile new file mode 100644 index 0000000000..c5b7e78c54 --- /dev/null +++ b/tools/gnulib/Makefile @@ -0,0 +1,25 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=gnulib +PKG_CPE_ID:=cpe:/a:gnu:$(PKG_NAME) +PKG_VERSION:=f9a4ee73c3e7b544f640d0d04b55983d3a7b894e# # master + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://git.savannah.gnu.org/cgit/$(PKG_NAME).git/snapshot +PKG_HASH:=514716d58987a9c0de0d69fb22d42bcd19edf80eed099882a004ff162060f1a8 + +include $(INCLUDE_DIR)/host-build.mk + +define Host/Configure +endef + +define Host/Install + $(INSTALL_DIR) $(1)/share/gnulib + $(CP) $(HOST_BUILD_DIR)/* $(1)/share/gnulib/ +endef + +define Host/Clean + rm -rf $(STAGING_DIR_HOST)/share/gnulib +endef + +$(eval $(call HostBuild)) diff --git a/tools/gnulib/patches/000-bootstrap.patch b/tools/gnulib/patches/000-bootstrap.patch new file mode 100644 index 0000000000..40ed41125c --- /dev/null +++ b/tools/gnulib/patches/000-bootstrap.patch @@ -0,0 +1,54 @@ +--- a/build-aux/bootstrap ++++ b/build-aux/bootstrap +@@ -237,14 +237,14 @@ test -r "$conffile" && . "$conffile" + + check_exists() { + if test "$1" = "--verbose"; then +- ($2 --version /dev/null 2>&1 ++ ($2 $3 $4 --version /dev/null 2>&1 + if test $? -ge 126; then + # If not found, run with diagnostics as one may be + # presented with env variables to set to find the right version +- ($2 --version /dev/null 2>&1 ++ ($@ --version /dev/null 2>&1 + fi + + test $? -lt 126 +@@ -309,7 +309,7 @@ p + q' + + get_version() { +- app=$1 ++ app="$@" + + $app --version >/dev/null 2>&1 || { $app --version; return 1; } + +@@ -366,13 +366,13 @@ check_versions() { + if [ "$req_ver" = "-" ]; then + # Merely require app to exist; not all prereq apps are well-behaved + # so we have to rely on $? rather than get_version. +- if ! check_exists --verbose $app; then ++ if ! check_exists --verbose "$app"; then + warn_ "Error: '$app' not found" + ret=1 + fi + else + # Require app to produce a new enough version string. +- inst_ver=$(get_version $app) ++ inst_ver=$(get_version "$app") + if [ ! "$inst_ver" ]; then + warn_ "Error: '$app' not found" + ret=1 +@@ -1135,7 +1135,7 @@ autogen() + # two just-pre-run programs. + + # Import from gettext. +- with_gettext=yes ++ with_gettext=no + grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \ + with_gettext=no + From e4977f614ffa2aaaaba0b5944747848b5b02f25a Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 22 Mar 2023 18:46:30 -0400 Subject: [PATCH 08/23] tools/missing-macros: prefer macros provided by gnulib source These 7 macro files are provided by gnulib, so we can now replace these statically stored copies with the latest copy from GNU sources. Signed-off-by: Michael Pratt --- tools/gnulib/Makefile | 2 + tools/missing-macros/src/README | 13 - tools/missing-macros/src/m4/inttypes_h.m4 | 26 - tools/missing-macros/src/m4/lib-ld.m4 | 110 --- tools/missing-macros/src/m4/lib-link.m4 | 774 ---------------------- tools/missing-macros/src/m4/lib-prefix.m4 | 224 ------- tools/missing-macros/src/m4/progtest.m4 | 92 --- tools/missing-macros/src/m4/stdint_h.m4 | 26 - tools/missing-macros/src/m4/wint_t.m4 | 28 - 9 files changed, 2 insertions(+), 1293 deletions(-) delete mode 100644 tools/missing-macros/src/m4/inttypes_h.m4 delete mode 100644 tools/missing-macros/src/m4/lib-ld.m4 delete mode 100644 tools/missing-macros/src/m4/lib-link.m4 delete mode 100644 tools/missing-macros/src/m4/lib-prefix.m4 delete mode 100644 tools/missing-macros/src/m4/progtest.m4 delete mode 100644 tools/missing-macros/src/m4/stdint_h.m4 delete mode 100644 tools/missing-macros/src/m4/wint_t.m4 diff --git a/tools/gnulib/Makefile b/tools/gnulib/Makefile index c5b7e78c54..43d86c213c 100644 --- a/tools/gnulib/Makefile +++ b/tools/gnulib/Makefile @@ -14,6 +14,8 @@ define Host/Configure endef define Host/Install + $(INSTALL_DIR) $(1)/share/aclocal + $(INSTALL_DATA) $(HOST_BUILD_DIR)/m4/*.m4 $(1)/share/aclocal/ $(INSTALL_DIR) $(1)/share/gnulib $(CP) $(HOST_BUILD_DIR)/* $(1)/share/gnulib/ endef diff --git a/tools/missing-macros/src/README b/tools/missing-macros/src/README index d2305ff557..dd9a9d3c96 100644 --- a/tools/missing-macros/src/README +++ b/tools/missing-macros/src/README @@ -2,26 +2,13 @@ The m4/ directory below contains various m4 macros used by different packages in the OpenWrt feed. -From GNU gettext: -Library linking and rpath helper macros. - - lib-ld.m4 - lib-link.m4 - lib-prefix.m4 - Integer data type test macros. intmax.m4 - wint_t.m4 inttypes-pri.m4 uintmax_t.m4 - stdint_h.m4 intdiv0.m4 - inttypes_h.m4 -Program test macro. - - progtest.m4 GNU libc version test macros. diff --git a/tools/missing-macros/src/m4/inttypes_h.m4 b/tools/missing-macros/src/m4/inttypes_h.m4 deleted file mode 100644 index 782d77ed8b..0000000000 --- a/tools/missing-macros/src/m4/inttypes_h.m4 +++ /dev/null @@ -1,26 +0,0 @@ -# inttypes_h.m4 serial 9 -dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Paul Eggert. - -# Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, -# doesn't clash with , and declares uintmax_t. - -AC_DEFUN([gl_AC_HEADER_INTTYPES_H], -[ - AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h], - [AC_TRY_COMPILE( - [#include -#include ], - [uintmax_t i = (uintmax_t) -1; return !i;], - [gl_cv_header_inttypes_h=yes], - [gl_cv_header_inttypes_h=no])]) - if test $gl_cv_header_inttypes_h = yes; then - AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1], - [Define if exists, doesn't clash with , - and declares uintmax_t. ]) - fi -]) diff --git a/tools/missing-macros/src/m4/lib-ld.m4 b/tools/missing-macros/src/m4/lib-ld.m4 deleted file mode 100644 index ebb30528bd..0000000000 --- a/tools/missing-macros/src/m4/lib-ld.m4 +++ /dev/null @@ -1,110 +0,0 @@ -# lib-ld.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. - -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. -AC_DEFUN([AC_LIB_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -case `$LD -v 2>&1 conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - [re_direlt='/[^/][^/]*/\.\./'] - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL([acl_cv_path_LD], -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; - *) - test "$with_gnu_ld" != yes && break ;; - esac - fi - done - IFS="$ac_save_ifs" -else - acl_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$acl_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT([$LD]) -else - AC_MSG_RESULT([no]) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_LIB_PROG_LD_GNU -]) diff --git a/tools/missing-macros/src/m4/lib-link.m4 b/tools/missing-macros/src/m4/lib-link.m4 deleted file mode 100644 index c73bd8e3a4..0000000000 --- a/tools/missing-macros/src/m4/lib-link.m4 +++ /dev/null @@ -1,774 +0,0 @@ -# lib-link.m4 serial 21 (gettext-0.18) -dnl Copyright (C) 2001-2010 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -AC_PREREQ([2.54]) - -dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and -dnl augments the CPPFLAGS variable. -dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname -dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. -AC_DEFUN([AC_LIB_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - pushdef([Name],[translit([$1],[./-], [___])]) - pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - ac_cv_lib[]Name[]_libs="$LIB[]NAME" - ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" - ac_cv_lib[]Name[]_cppflags="$INC[]NAME" - ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" - ]) - LIB[]NAME="$ac_cv_lib[]Name[]_libs" - LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" - INC[]NAME="$ac_cv_lib[]Name[]_cppflags" - LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - AC_SUBST([LIB]NAME[_PREFIX]) - dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the - dnl results of this search when this library appears as a dependency. - HAVE_LIB[]NAME=yes - popdef([NAME]) - popdef([Name]) -]) - -dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message]) -dnl searches for libname and the libraries corresponding to explicit and -dnl implicit dependencies, together with the specified include files and -dnl the ability to compile and link the specified testcode. The missing-message -dnl defaults to 'no' and may contain additional hints for the user. -dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} -dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and -dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs -dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. -dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname -dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. -AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - pushdef([Name],[translit([$1],[./-], [___])]) - pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - - dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME - dnl accordingly. - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - - dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, - dnl because if the user has installed lib[]Name and not disabled its use - dnl via --without-lib[]Name-prefix, he wants to use it. - ac_save_CPPFLAGS="$CPPFLAGS" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - - AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ - ac_save_LIBS="$LIBS" - dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS, - dnl because these -l options might require -L options that are present in - dnl LIBS. -l options benefit only from the -L options listed before it. - dnl Otherwise, add it to the front of LIBS, because it may be a static - dnl library that depends on another static library that is present in LIBS. - dnl Static libraries benefit only from the static libraries listed after - dnl it. - case " $LIB[]NAME" in - *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; - *) LIBS="$LIB[]NAME $LIBS" ;; - esac - AC_TRY_LINK([$3], [$4], - [ac_cv_lib[]Name=yes], - [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) - LIBS="$ac_save_LIBS" - ]) - if test "$ac_cv_lib[]Name" = yes; then - HAVE_LIB[]NAME=yes - AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.]) - AC_MSG_CHECKING([how to link with lib[]$1]) - AC_MSG_RESULT([$LIB[]NAME]) - else - HAVE_LIB[]NAME=no - dnl If $LIB[]NAME didn't lead to a usable library, we don't need - dnl $INC[]NAME either. - CPPFLAGS="$ac_save_CPPFLAGS" - LIB[]NAME= - LTLIB[]NAME= - LIB[]NAME[]_PREFIX= - fi - AC_SUBST([HAVE_LIB]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - AC_SUBST([LIB]NAME[_PREFIX]) - popdef([NAME]) - popdef([Name]) -]) - -dnl Determine the platform dependent parameters needed to use rpath: -dnl acl_libext, -dnl acl_shlibext, -dnl acl_hardcode_libdir_flag_spec, -dnl acl_hardcode_libdir_separator, -dnl acl_hardcode_direct, -dnl acl_hardcode_minus_L. -AC_DEFUN([AC_LIB_RPATH], -[ - dnl Tell automake >= 1.10 to complain if config.rpath is missing. - m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) - AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS - AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld - AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host - AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir - AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done - ]) - wl="$acl_cv_wl" - acl_libext="$acl_cv_libext" - acl_shlibext="$acl_cv_shlibext" - acl_libname_spec="$acl_cv_libname_spec" - acl_library_names_spec="$acl_cv_library_names_spec" - acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - acl_hardcode_direct="$acl_cv_hardcode_direct" - acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" - dnl Determine whether the user wants rpath handling at all. - AC_ARG_ENABLE([rpath], - [ --disable-rpath do not hardcode runtime library paths], - :, enable_rpath=yes) -]) - -dnl AC_LIB_FROMPACKAGE(name, package) -dnl declares that libname comes from the given package. The configure file -dnl will then not have a --with-libname-prefix option but a -dnl --with-package-prefix option. Several libraries can come from the same -dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar -dnl macro call that searches for libname. -AC_DEFUN([AC_LIB_FROMPACKAGE], -[ - pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - define([acl_frompackage_]NAME, [$2]) - popdef([NAME]) - pushdef([PACK],[$2]) - pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - define([acl_libsinpackage_]PACKUP, - m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1]) - popdef([PACKUP]) - popdef([PACK]) -]) - -dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. -dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found -dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. -AC_DEFUN([AC_LIB_LINKFLAGS_BODY], -[ - AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) - pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) - pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) - dnl Autoconf >= 2.61 supports dots in --with options. - pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_ARG_WITH(P_A_C_K[-prefix], -[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib - --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/$acl_libdirstem" - if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then - additional_libdir="$withval/$acl_libdirstem2" - fi - fi - fi -]) - dnl Search the library and its dependencies in $additional_libdir and - dnl $LDFLAGS. Using breadth-first-seach. - LIB[]NAME= - LTLIB[]NAME= - INC[]NAME= - LIB[]NAME[]_PREFIX= - dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been - dnl computed. So it has to be reset here. - HAVE_LIB[]NAME= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='$1 $2' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - dnl See if it was already located by an earlier AC_LIB_LINKFLAGS - dnl or AC_LIB_HAVE_LINKFLAGS call. - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" - else - dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined - dnl that this library doesn't exist. So just drop it. - : - fi - else - dnl Search the library lib$name in $additional_libdir and $LDFLAGS - dnl and the already constructed $LIBNAME/$LTLIBNAME. - found_dir= - found_la= - found_so= - found_a= - eval libname=\"$acl_libname_spec\" # typically: libname=lib$name - if test -n "$acl_shlibext"; then - shrext=".$acl_shlibext" # typically: shrext=.so - else - shrext= - fi - if test $use_additional = yes; then - dir="$additional_libdir" - dnl The same code as in the loop below: - dnl First look for a shared library. - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - dnl Then look for a static library. - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - dnl First look for a shared library. - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - dnl Then look for a static library. - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - dnl Found the library. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - dnl Linking with a shared library. We attempt to hardcode its - dnl directory into the executable's runpath, unless it's the - dnl standard /usr/lib. - if test "$enable_rpath" = no \ - || test "X$found_dir" = "X/usr/$acl_libdirstem" \ - || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then - dnl No hardcoding is needed. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - dnl The hardcoding into $LIBNAME is system dependent. - if test "$acl_hardcode_direct" = yes; then - dnl Using DIR/libNAME.so during linking hardcodes DIR into the - dnl resulting binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - dnl Rely on "-L$found_dir". - dnl But don't add it if it's already contained in the LDFLAGS - dnl or the already constructed $LIBNAME - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" - fi - if test "$acl_hardcode_minus_L" != no; then - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH - dnl here, because this doesn't fit in flags passed to the - dnl compiler. So give up. No hardcoding. This affects only - dnl very old systems. - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - dnl Linking with a static library. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" - else - dnl We shouldn't come here, but anyway it's good to have a - dnl fallback. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" - fi - fi - dnl Assume the include files are nearby. - additional_includedir= - case "$found_dir" in - */$acl_libdirstem | */$acl_libdirstem/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - if test "$name" = '$1'; then - LIB[]NAME[]_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - */$acl_libdirstem2 | */$acl_libdirstem2/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` - if test "$name" = '$1'; then - LIB[]NAME[]_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - dnl Potentially add $additional_includedir to $INCNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's /usr/local/include and we are using GCC on Linux, - dnl 3. if it's already present in $CPPFLAGS or the already - dnl constructed $INCNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INC[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $INCNAME. - INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - dnl Look for dependencies. - if test -n "$found_la"; then - dnl Read the .la file. It defines the variables - dnl dlname, library_names, old_library, dependency_libs, current, - dnl age, revision, installed, dlopen, dlpreopen, libdir. - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - dnl We use only dependency_libs. - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's /usr/local/lib and we are using GCC on Linux, - dnl 3. if it's already present in $LDFLAGS or the already - dnl constructed $LIBNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ - && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ - || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LIBNAME. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LTLIBNAME. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - dnl Handle this in the next round. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - dnl Handle this in the next round. Throw away the .la's - dnl directory; it is already contained in a preceding -L - dnl option. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - dnl Most likely an immediate library name. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" - ;; - esac - done - fi - else - dnl Didn't find the library; assume it is in the system directories - dnl known to the linker and runtime loader. (All the system - dnl directories known to the linker should also be known to the - dnl runtime loader, otherwise the system is severely misconfigured.) - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$acl_hardcode_libdir_separator"; then - dnl Weird platform: only the last -rpath option counts, the user must - dnl pass all path elements in one option. We can arrange that for a - dnl single library, but not when more than one $LIBNAMEs are used. - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" - done - dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - else - dnl The -rpath options are cumulative. - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - dnl When using libtool, the option that works for both libraries and - dnl executables is -R. The -R options are cumulative. - for found_dir in $ltrpathdirs; do - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" - done - fi - popdef([P_A_C_K]) - popdef([PACKLIBS]) - popdef([PACKUP]) - popdef([PACK]) - popdef([NAME]) -]) - -dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, -dnl unless already present in VAR. -dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes -dnl contains two or three consecutive elements that belong together. -AC_DEFUN([AC_LIB_APPENDTOVAR], -[ - for element in [$2]; do - haveit= - for x in $[$1]; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - [$1]="${[$1]}${[$1]:+ }$element" - fi - done -]) - -dnl For those cases where a variable contains several -L and -l options -dnl referring to unknown libraries and directories, this macro determines the -dnl necessary additional linker options for the runtime path. -dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) -dnl sets LDADDVAR to linker options needed together with LIBSVALUE. -dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, -dnl otherwise linking without libtool is assumed. -AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], -[ - AC_REQUIRE([AC_LIB_RPATH]) - AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) - $1= - if test "$enable_rpath" != no; then - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - dnl Use an explicit option to hardcode directories into the resulting - dnl binary. - rpathdirs= - next= - for opt in $2; do - if test -n "$next"; then - dir="$next" - dnl No need to hardcode the standard /usr/lib. - if test "X$dir" != "X/usr/$acl_libdirstem" \ - && test "X$dir" != "X/usr/$acl_libdirstem2"; then - rpathdirs="$rpathdirs $dir" - fi - next= - else - case $opt in - -L) next=yes ;; - -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` - dnl No need to hardcode the standard /usr/lib. - if test "X$dir" != "X/usr/$acl_libdirstem" \ - && test "X$dir" != "X/usr/$acl_libdirstem2"; then - rpathdirs="$rpathdirs $dir" - fi - next= ;; - *) next= ;; - esac - fi - done - if test "X$rpathdirs" != "X"; then - if test -n ""$3""; then - dnl libtool is used for linking. Use -R options. - for dir in $rpathdirs; do - $1="${$1}${$1:+ }-R$dir" - done - else - dnl The linker is used for linking directly. - if test -n "$acl_hardcode_libdir_separator"; then - dnl Weird platform: only the last -rpath option counts, the user - dnl must pass all path elements in one option. - alldirs= - for dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - $1="$flag" - else - dnl The -rpath options are cumulative. - for dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$dir" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - $1="${$1}${$1:+ }$flag" - done - fi - fi - fi - fi - fi - AC_SUBST([$1]) -]) diff --git a/tools/missing-macros/src/m4/lib-prefix.m4 b/tools/missing-macros/src/m4/lib-prefix.m4 deleted file mode 100644 index 1601ceaefd..0000000000 --- a/tools/missing-macros/src/m4/lib-prefix.m4 +++ /dev/null @@ -1,224 +0,0 @@ -# lib-prefix.m4 serial 7 (gettext-0.18) -dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and -dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't -dnl require excessive bracketing. -ifdef([AC_HELP_STRING], -[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], -[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) - -dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed -dnl to access previously installed libraries. The basic assumption is that -dnl a user will want packages to use other packages he previously installed -dnl with the same --prefix option. -dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate -dnl libraries, but is otherwise very convenient. -AC_DEFUN([AC_LIB_PREFIX], -[ - AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_LIB_ARG_WITH([lib-prefix], -[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib - --without-lib-prefix don't search for libraries in includedir and libdir], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/$acl_libdirstem" - fi - fi -]) - if test $use_additional = yes; then - dnl Potentially add $additional_includedir to $CPPFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's already present in $CPPFLAGS, - dnl 3. if it's /usr/local/include and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - for x in $CPPFLAGS; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $CPPFLAGS. - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" - fi - fi - fi - fi - dnl Potentially add $additional_libdir to $LDFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's already present in $LDFLAGS, - dnl 3. if it's /usr/local/lib and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then - haveit= - for x in $LDFLAGS; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LDFLAGS. - LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" - fi - fi - fi - fi - fi -]) - -dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, -dnl acl_final_exec_prefix, containing the values to which $prefix and -dnl $exec_prefix will expand at the end of the configure script. -AC_DEFUN([AC_LIB_PREPARE_PREFIX], -[ - dnl Unfortunately, prefix and exec_prefix get only finally determined - dnl at the end of configure. - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else - acl_final_prefix="$prefix" - fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' - else - acl_final_exec_prefix="$exec_prefix" - fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" -]) - -dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the -dnl variables prefix and exec_prefix bound to the values they will have -dnl at the end of the configure script. -AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], -[ - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - $1 - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" -]) - -dnl AC_LIB_PREPARE_MULTILIB creates -dnl - a variable acl_libdirstem, containing the basename of the libdir, either -dnl "lib" or "lib64" or "lib/64", -dnl - a variable acl_libdirstem2, as a secondary possible value for -dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or -dnl "lib/amd64". -AC_DEFUN([AC_LIB_PREPARE_MULTILIB], -[ - dnl There is no formal standard regarding lib and lib64. - dnl On glibc systems, the current practice is that on a system supporting - dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under - dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine - dnl the compiler's default mode by looking at the compiler's library search - dnl path. If at least one of its elements ends in /lib64 or points to a - dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. - dnl Otherwise we use the default, namely "lib". - dnl On Solaris systems, the current practice is that on a system supporting - dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under - dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or - dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. - AC_REQUIRE([AC_CANONICAL_HOST]) - acl_libdirstem=lib - acl_libdirstem2= - case "$host_os" in - solaris*) - dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment - dnl . - dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." - dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the - dnl symlink is missing, so we set acl_libdirstem2 too. - AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], - [AC_EGREP_CPP([sixtyfour bits], [ -#ifdef _LP64 -sixtyfour bits -#endif - ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) - ]) - if test $gl_cv_solaris_64bit = yes; then - acl_libdirstem=lib/64 - case "$host_cpu" in - sparc*) acl_libdirstem2=lib/sparcv9 ;; - i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; - esac - fi - ;; - *) - searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` - if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" - for searchdir in $searchpath; do - if test -d "$searchdir"; then - case "$searchdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - */../ | */.. ) - # Better ignore directories of this form. They are misleading. - ;; - *) searchdir=`cd "$searchdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac ;; - esac - fi - done - IFS="$acl_save_IFS" - fi - ;; - esac - test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" -]) diff --git a/tools/missing-macros/src/m4/progtest.m4 b/tools/missing-macros/src/m4/progtest.m4 deleted file mode 100644 index 2d804ac99d..0000000000 --- a/tools/missing-macros/src/m4/progtest.m4 +++ /dev/null @@ -1,92 +0,0 @@ -# progtest.m4 serial 6 (gettext-0.18) -dnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. -dnl -dnl This file can can be used in projects which are not available under -dnl the GNU General Public License or the GNU Library General Public -dnl License but which still want to provide support for the GNU gettext -dnl functionality. -dnl Please note that the actual code of the GNU gettext library is covered -dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. -dnl They are *not* in the public domain. - -dnl Authors: -dnl Ulrich Drepper , 1996. - -AC_PREREQ([2.50]) - -# Search path for a program which passes the given test. - -dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, -dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) -AC_DEFUN([AM_PATH_PROG_WITH_TEST], -[ -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Find out how to test for executable files. Don't use a zero-byte file, -# as systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - ac_executable_p="test -x" -else - ac_executable_p="test -f" -fi -rm -f conf$$.file - -# Extract the first word of "$2", so it can be a program name with args. -set dummy $2; ac_word=[$]2 -AC_MSG_CHECKING([for $ac_word]) -AC_CACHE_VAL([ac_cv_path_$1], -[case "[$]$1" in - [[\\/]]* | ?:[[\\/]]*) - ac_cv_path_$1="[$]$1" # Let the user override the test with a path. - ;; - *) - ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in ifelse([$5], , $PATH, [$5]); do - IFS="$ac_save_IFS" - test -z "$ac_dir" && ac_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then - echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD - if [$3]; then - ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" - break 2 - fi - fi - done - done - IFS="$ac_save_IFS" -dnl If no 4th arg is given, leave the cache variable unset, -dnl so AC_PATH_PROGS will keep looking. -ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" -])dnl - ;; -esac])dnl -$1="$ac_cv_path_$1" -if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then - AC_MSG_RESULT([$][$1]) -else - AC_MSG_RESULT([no]) -fi -AC_SUBST([$1])dnl -]) diff --git a/tools/missing-macros/src/m4/stdint_h.m4 b/tools/missing-macros/src/m4/stdint_h.m4 deleted file mode 100644 index b8e3c6cc71..0000000000 --- a/tools/missing-macros/src/m4/stdint_h.m4 +++ /dev/null @@ -1,26 +0,0 @@ -# stdint_h.m4 serial 8 -dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Paul Eggert. - -# Define HAVE_STDINT_H_WITH_UINTMAX if exists, -# doesn't clash with , and declares uintmax_t. - -AC_DEFUN([gl_AC_HEADER_STDINT_H], -[ - AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h], - [AC_TRY_COMPILE( - [#include -#include ], - [uintmax_t i = (uintmax_t) -1; return !i;], - [gl_cv_header_stdint_h=yes], - [gl_cv_header_stdint_h=no])]) - if test $gl_cv_header_stdint_h = yes; then - AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1], - [Define if exists, doesn't clash with , - and declares uintmax_t. ]) - fi -]) diff --git a/tools/missing-macros/src/m4/wint_t.m4 b/tools/missing-macros/src/m4/wint_t.m4 deleted file mode 100644 index a6c7d15cb5..0000000000 --- a/tools/missing-macros/src/m4/wint_t.m4 +++ /dev/null @@ -1,28 +0,0 @@ -# wint_t.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. -dnl Test whether has the 'wint_t' type. -dnl Prerequisite: AC_PROG_CC - -AC_DEFUN([gt_TYPE_WINT_T], -[ - AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], - [AC_TRY_COMPILE([ -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.0.1 has a bug: , and must be included - before . */ -#include -#include -#include -#include - wint_t foo = (wchar_t)'\0';], , - [gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])]) - if test $gt_cv_c_wint_t = yes; then - AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) - fi -]) From d39c6cd29b212a6ad5d864893c7687f976600dd4 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Thu, 23 Mar 2023 03:42:04 -0400 Subject: [PATCH 09/23] tools/missing-macros: bump version of makeinfo alternative script Some new releases of GNU tools are checking for a higher version of makeinfo than what our scripted alternative shows when working with checked-out sources instead of releases. Since this is a "fake" makeinfo we can also just fake the version. Signed-off-by: Michael Pratt --- tools/missing-macros/src/bin/makeinfo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/missing-macros/src/bin/makeinfo b/tools/missing-macros/src/bin/makeinfo index e163cba084..d698f7b79c 100755 --- a/tools/missing-macros/src/bin/makeinfo +++ b/tools/missing-macros/src/bin/makeinfo @@ -26,7 +26,7 @@ Getopt::Long::GetOptions( if ($version) { - print "makeinfo (OpenWrt stub) 4.13\n"; + print "makeinfo (OpenWrt stub) 9.99\n"; exit 0; } From 89a8269c109b56364bc5c7a63afb8e2888ba9143 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 29 Mar 2023 17:00:18 -0400 Subject: [PATCH 10/23] tools/automake: move file requirements to higher strictness GNU standards requires certain files at the top-level directory of a package that automake is used with, mostly documentation. If one of these files happens to be missing, autoreconf would fail. Move these file requirements to the more strict 'GNITS' setting. Link: https://www.gnu.org/software/automake/manual/html_node/Strictness.html Signed-off-by: Michael Pratt --- .../patches/101-do-not-require-files.patch | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tools/automake/patches/101-do-not-require-files.patch diff --git a/tools/automake/patches/101-do-not-require-files.patch b/tools/automake/patches/101-do-not-require-files.patch new file mode 100644 index 0000000000..3a8c9fcb47 --- /dev/null +++ b/tools/automake/patches/101-do-not-require-files.patch @@ -0,0 +1,29 @@ +--- a/bin/automake.in ++++ b/bin/automake.in +@@ -4513,7 +4513,7 @@ sub handle_gettext () + && grep ($_ eq 'intl', @subdirs)); + } + +- require_file ($ac_gettext_location, GNU, 'ABOUT-NLS'); ++ require_file ($ac_gettext_location, GNITS, 'ABOUT-NLS'); + } + + # Emit makefile footer. +@@ -5641,7 +5641,7 @@ sub check_gnu_standards () + # otherwise require non-.md. + my $required + = (! -f $file && -f "$file.md") ? "$file.md" : $file; +- require_file ("$am_file.am", GNU, $required); ++ require_file ("$am_file.am", GNITS, $required); + } + + # Accept one of these three licenses; default to COPYING. +@@ -5655,7 +5655,7 @@ sub check_gnu_standards () + last; + } + } +- require_file ("$am_file.am", GNU, 'COPYING') ++ require_file ("$am_file.am", GNITS, 'COPYING') + unless $license; + } + From e764a909e3d468a5597373cac087ecc008540e2d Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Sat, 25 Mar 2023 01:01:36 -0400 Subject: [PATCH 11/23] tools/flex: override SUBDIRS variable with Makefile Instead of editing the SUBDIRS variable with a patch, it can be overriden at the end of the command line when invoking Make. Skip the build for po files as well, which is causing a conflict depending on the version of gettext detected, and macros present. Signed-off-by: Michael Pratt --- tools/flex/Makefile | 8 ++++++-- tools/flex/patches/100-disable-tests-docs.patch | 13 ------------- 2 files changed, 6 insertions(+), 15 deletions(-) delete mode 100644 tools/flex/patches/100-disable-tests-docs.patch diff --git a/tools/flex/Makefile b/tools/flex/Makefile index da037ae72d..86ba5a4415 100644 --- a/tools/flex/Makefile +++ b/tools/flex/Makefile @@ -21,13 +21,17 @@ include $(INCLUDE_DIR)/host-build.mk HOST_CONFIGURE_ARGS += --disable-shared +define Host/Compile + $(call Host/Compile/Default,SUBDIRS='src tools') +endef + define Host/Install - $(call Host/Install/Default) + $(call Host/Compile/Default,install SUBDIRS='src tools') $(LN) flex $(STAGING_DIR_HOST)/bin/lex endef define Host/Uninstall - -$(call Host/Compile/Default,uninstall) + -$(call Host/Compile/Default,uninstall SUBDIRS='src tools') endef define Host/Clean diff --git a/tools/flex/patches/100-disable-tests-docs.patch b/tools/flex/patches/100-disable-tests-docs.patch deleted file mode 100644 index f7097f2127..0000000000 --- a/tools/flex/patches/100-disable-tests-docs.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/Makefile.am -+++ b/Makefile.am -@@ -43,10 +43,7 @@ EXTRA_DIST = \ - - SUBDIRS = \ - src \ -- doc \ -- examples \ - po \ -- tests \ - tools - - # Create the ChangeLog, but only if we're inside a git working directory From 4437434b8a4c8c4f9000caeb773c1aa248a6d29a Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Sun, 26 Mar 2023 04:11:13 -0400 Subject: [PATCH 12/23] tools/gengetopt: override SUBDIRS variable with Makefile Instead of editing the SUBDIRS variable with a patch, it can be overriden at the end of the command line when invoking Make. This tool has a series of recursive Makefiles in each subdirectory, therefore SUBDIRS is set to a pattern of Make functions so that the result is variable depending on the current subdirectory that Make is being invoked in. By eliminating the patch, autoreconf is no longer required. Signed-off-by: Michael Pratt --- tools/gengetopt/Makefile | 6 +++- .../gengetopt/patches/100-no-tests-docs.patch | 33 ------------------- 2 files changed, 5 insertions(+), 34 deletions(-) delete mode 100644 tools/gengetopt/patches/100-no-tests-docs.patch diff --git a/tools/gengetopt/Makefile b/tools/gengetopt/Makefile index 563ecccf9d..5a5b5eb7cb 100644 --- a/tools/gengetopt/Makefile +++ b/tools/gengetopt/Makefile @@ -13,12 +13,16 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/$(PKG_NAME) PKG_HASH:=b941aec9011864978dd7fdeb052b1943535824169d2aa2b0e7eae9ab807584ac -HOST_FIXUP:=autoreconf +PKG_SUBDIRS:=$$$$(foreach dir,gl src skels,$$$$(wildcard $$$$(dir)) ) HOST_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/host-build.mk +define Host/Compile + $(call Host/Compile/Default,SUBDIRS='$(PKG_SUBDIRS)') +endef + define Host/Install $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/gengetopt $(STAGING_DIR_HOST)/bin/ endef diff --git a/tools/gengetopt/patches/100-no-tests-docs.patch b/tools/gengetopt/patches/100-no-tests-docs.patch deleted file mode 100644 index d8c53af4fb..0000000000 --- a/tools/gengetopt/patches/100-no-tests-docs.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- a/Makefile.am -+++ b/Makefile.am -@@ -18,7 +18,7 @@ - ACLOCAL_AMFLAGS = -I m4 -I gl/m4 - - EXTRA_DIST = configure TODO LICENSE gl/m4/gnulib-cache.m4 --SUBDIRS = gl src doc tests -+SUBDIRS = gl src - - gengetoptdoc_DATA = ChangeLog COPYING NEWS THANKS INSTALL README LICENSE - ---- a/Makefile.in -+++ b/Makefile.in -@@ -593,7 +593,7 @@ top_builddir = @top_builddir@ - top_srcdir = @top_srcdir@ - ACLOCAL_AMFLAGS = -I m4 -I gl/m4 - EXTRA_DIST = configure TODO LICENSE gl/m4/gnulib-cache.m4 --SUBDIRS = gl src doc tests -+SUBDIRS = gl src - gengetoptdoc_DATA = ChangeLog COPYING NEWS THANKS INSTALL README LICENSE - TARBALL = $(top_builddir)/gengetopt-$(PACKAGE_VERSION).tar.xz - all: config.h ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -16,7 +16,7 @@ - # with gengetopt; see the file COPYING. If not, write to the Free Software - # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - --SUBDIRS = skels tests -+SUBDIRS = skels - - bin_PROGRAMS = gengetopt - From ca8577f930713999fe27bdb2bd8c33ac8afb5bc8 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Sat, 15 Apr 2023 19:54:43 -0400 Subject: [PATCH 13/23] gettext-full: override SUBDIRS variable with Makefile Instead of editing the SUBDIRS variable with a patch, it can be overriden at the end of the command line when invoking Make. This tool has a series of recursive Makefiles in each subdirectory, therefore SUBDIRS is set to a pattern of Make functions so that the result is variable depending on the current subdirectory that Make is being invoked in. Some of the subdirectories don't have a Makefile and are just storing files for another subdirectory Makefile target, therefore we have to place a fake Makefile that does nothing. Signed-off-by: Michael Pratt --- package/libs/gettext-full/Makefile | 45 ++++++++++++++++++- .../patches/001-no_examples_and_tests.patch | 22 --------- 2 files changed, 44 insertions(+), 23 deletions(-) delete mode 100644 package/libs/gettext-full/patches/001-no_examples_and_tests.patch diff --git a/package/libs/gettext-full/Makefile b/package/libs/gettext-full/Makefile index 2319401baf..6e185a37ab 100644 --- a/package/libs/gettext-full/Makefile +++ b/package/libs/gettext-full/Makefile @@ -27,6 +27,35 @@ PKG_BUILD_DEPENDS:=gettext-full/host PKG_BUILD_PARALLEL:=0 HOST_BUILD_PARALLEL:=0 +PKG_SUBDIRS:= \ + $$$$(foreach dir, \ + intl \ + intl-csharp \ + intl-java \ + its \ + gnulib-lib \ + gnulib-local \ + lib \ + $$$$(SUBDIR_libasprintf) \ + libgettextpo \ + libgrep \ + libtextstyle \ + m4 \ + misc \ + po \ + projects \ + src \ + styles \ + gettext-runtime \ + gettext-tools \ + ,$$$$(wildcard $$$$(dir)) ) + +PKG_MAKEFILES_FAKE:= \ + gnulib-local/m4/Makefile \ + libtextstyle/gnulib-local/Makefile \ + libtextstyle/m4/Makefile \ + m4/Makefile + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk @@ -75,6 +104,16 @@ HOST_CONFIGURE_VARS += \ HOST_CFLAGS += $(HOST_FPIC) +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/Compile + $(foreach makefile,$(PKG_MAKEFILES_FAKE),printf '%s\n%s\n' 'all:' 'install:' > $(PKG_BUILD_DIR)/$(makefile); ) + $(call Build/Compile/Default,SUBDIRS='$(PKG_SUBDIRS)') +endef + define Build/InstallDev $(INSTALL_DIR) $(1)/usr/lib/libintl-full/include $(CP) $(PKG_INSTALL_DIR)/usr/include/libintl.h $(1)/usr/lib/libintl-full/include/ @@ -89,10 +128,14 @@ define Build/InstallDev endef define Host/Install - $(call Host/Install/Default) + $(call Host/Compile/Default,install SUBDIRS='$(PKG_SUBDIRS)') $(LN) msgfmt $(STAGING_DIR_HOSTPKG)/bin/gmsgfmt endef +define Build/Install + $(call Build/Install/Default,install SUBDIRS='$(PKG_SUBDIRS)') +endef + define Package/libintl-full/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libintl.so.* $(1)/usr/lib/ diff --git a/package/libs/gettext-full/patches/001-no_examples_and_tests.patch b/package/libs/gettext-full/patches/001-no_examples_and_tests.patch deleted file mode 100644 index d813d20ed6..0000000000 --- a/package/libs/gettext-full/patches/001-no_examples_and_tests.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/gettext-runtime/Makefile.am -+++ b/gettext-runtime/Makefile.am -@@ -27,7 +27,7 @@ SUBDIR_libasprintf = libasprintf - else - SUBDIR_libasprintf = - endif --SUBDIRS = doc intl intl-java intl-csharp gnulib-lib $(SUBDIR_libasprintf) src po man m4 tests -+SUBDIRS = intl intl-java intl-csharp gnulib-lib $(SUBDIR_libasprintf) src po m4 - - EXTRA_DIST = BUGS - ---- a/gettext-tools/Makefile.am -+++ b/gettext-tools/Makefile.am -@@ -19,7 +19,7 @@ - AUTOMAKE_OPTIONS = 1.5 gnu no-dependencies - ACLOCAL_AMFLAGS = -I m4 -I ../gettext-runtime/m4 -I ../m4 -I gnulib-m4 -I libgrep/gnulib-m4 -I libgettextpo/gnulib-m4 - --SUBDIRS = intl gnulib-lib libgrep src libgettextpo po its projects styles emacs misc man m4 tests system-tests gnulib-tests examples doc -+SUBDIRS = intl gnulib-lib libgrep src libgettextpo po its projects styles misc m4 - - EXTRA_DIST = misc/DISCLAIM - MOSTLYCLEANFILES = core *.stackdump From 2070a2ca27bdb2b1e4e1587274e192e42f247516 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 19 Apr 2023 04:40:42 -0400 Subject: [PATCH 14/23] gperf: add from packages feed Add gperf which is required for building gettext after using the autogen.sh script. Signed-off-by: Michael Pratt --- package/devel/gperf/Makefile | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 package/devel/gperf/Makefile diff --git a/package/devel/gperf/Makefile b/package/devel/gperf/Makefile new file mode 100644 index 0000000000..f0f794ee2d --- /dev/null +++ b/package/devel/gperf/Makefile @@ -0,0 +1,36 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=gperf +PKG_VERSION:=3.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/gperf +PKG_HASH:=588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2 + +PKG_LICENSE:=GPL-3.0 +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk + +HOST_CPPFLAGS:=-I$(HOST_BUILD_DIR)/lib -I$(HOST_BUILD_DIR)/src $(HOST_CPPFLAGS) +TARGET_CPPFLAGS:=-I$(PKG_BUILD_DIR)/lib -I$(PKG_BUILD_DIR)/src $(TARGET_CPPFLAGS) + +define Package/gperf + SECTION:=devel + CATEGORY:=Development + TITLE:=GNU gperf + URL:=http://www.gnu.org/software/gperf +endef + +define Package/gperf/description + GNU gperf is a perfect hash function generator. For a given list of strings, + it produces a hash function and hash table, in form of C or C++ code, + for looking up a value depending on the input string. + The hash function is perfect, which means that the hash table has no collisions, + and the hash table lookup needs a single string comparison only. +endef + +$(eval $(call HostBuild)) +$(eval $(call BuildPackage,gperf)) From 9b0b46985c112c664354dc745d8cfb313166744b Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 19 Apr 2023 12:52:04 -0400 Subject: [PATCH 15/23] libxml2: add from packages feed Add libxml2 which can be used to build gettext instead of the old built-in substitute for it. Signed-off-by: Michael Pratt --- package/libs/libxml2/Makefile | 206 +++++++++++++++++++ package/libs/libxml2/patches/010-iconv.patch | 12 ++ 2 files changed, 218 insertions(+) create mode 100644 package/libs/libxml2/Makefile create mode 100644 package/libs/libxml2/patches/010-iconv.patch diff --git a/package/libs/libxml2/Makefile b/package/libs/libxml2/Makefile new file mode 100644 index 0000000000..e93d1c06bd --- /dev/null +++ b/package/libs/libxml2/Makefile @@ -0,0 +1,206 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=libxml2 +PKG_VERSION:=2.10.3 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@GNOME/libxml2/$(basename $(PKG_VERSION)) +PKG_HASH:=5d2cc3d78bec3dbe212a9d7fa629ada25a7da928af432c93060ff5c17ee28a9c + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:xmlsoft:libxml2 + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/libxml2 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Gnome XML library + URL:=http://xmlsoft.org/ + DEPENDS:=+libpthread +zlib $(ICONV_DEPENDS) +endef + +define Package/libxml2/description + A library for manipulating XML and HTML resources. +endef + +define Package/libxml2-dev + SECTION:=devel + CATEGORY:=Development + SUBMENU:=Libraries + TITLE:=Development files for libxml2 + URL:=http://xmlsoft.org/ + DEPENDS:=+libxml2 +endef + +define Package/libxml2-dev/description + A library for manipulating XML and HTML resources. + + This package contains the headers and xml2-config binary. +endef + +define Package/libxml2-utils + SECTION:=utils + CATEGORY:=Utilities + TITLE:=XML command line utilities (xmllint...) + URL:=http://xmlsoft.org/ + DEPENDS:=+libxml2 +endef + +define Package/libxml2-utils/description + This package contains the binaries xmllint and xmlcatalog + from libxml2, a library for manipulating XML and HTML resources. +endef + +CMAKE_HOST_OPTIONS += \ + -DBUILD_SHARED_LIBS=OFF \ + -DLIBXML2_WITH_C14N=ON \ + -DLIBXML2_WITH_CATALOG=OFF \ + -DLIBXML2_WITH_DEBUG=ON \ + -DLIBXML2_WITH_FTP=OFF \ + -DLIBXML2_WITH_HTML=ON \ + -DLIBXML2_WITH_HTTP=OFF \ + -DLIBXML2_WITH_ICONV=ON \ + -DLIBXML2_WITH_ICU=OFF \ + -DLIBXML2_WITH_ISO8859X=OFF \ + -DLIBXML2_WITH_LEGACY=OFF \ + -DLIBXML2_WITH_LZMA=OFF \ + -DLIBXML2_WITH_MEM_DEBUG=OFF \ + -DLIBXML2_WITH_MODULES=OFF \ + -DLIBXML2_WITH_OUTPUT=ON \ + -DLIBXML2_WITH_PATTERN=ON \ + -DLIBXML2_WITH_PROGRAMS=OFF \ + -DLIBXML2_WITH_PUSH=ON \ + -DLIBXML2_WITH_PYTHON=OFF \ + -DLIBXML2_WITH_READER=ON \ + -DLIBXML2_WITH_REGEXPS=ON \ + -DLIBXML2_WITH_RUN_DEBUG=OFF \ + -DLIBXML2_WITH_SAX1=ON \ + -DLIBXML2_WITH_SCHEMAS=ON \ + -DLIBXML2_WITH_SCHEMATRON=OFF \ + -DLIBXML2_WITH_TESTS=OFF \ + -DLIBXML2_WITH_THREADS=ON \ + -DLIBXML2_WITH_THREAD_ALLOC=OFF \ + -DLIBXML2_WITH_TREE=ON \ + -DLIBXML2_WITH_VALID=ON \ + -DLIBXML2_WITH_WRITER=ON \ + -DLIBXML2_WITH_XINCLUDE=ON \ + -DLIBXML2_WITH_XPATH=ON \ + -DLIBXML2_WITH_XPTR=ON \ + -DLIBXML2_WITH_XPTR_LOCS=ON \ + -DLIBXML2_WITH_ZLIB=ON + +CMAKE_OPTIONS += \ + -DBUILD_SHARED_LIBS=ON \ + -DLIBXML2_WITH_C14N=ON \ + -DLIBXML2_WITH_CATALOG=OFF \ + -DLIBXML2_WITH_DEBUG=ON \ + -DLIBXML2_WITH_FTP=OFF \ + -DLIBXML2_WITH_HTML=ON \ + -DLIBXML2_WITH_HTTP=OFF \ + -DLIBXML2_WITH_ICONV=ON \ + -DLIBXML2_WITH_ICU=OFF \ + -DLIBXML2_WITH_ISO8859X=OFF \ + -DLIBXML2_WITH_LEGACY=OFF \ + -DLIBXML2_WITH_LZMA=OFF \ + -DLIBXML2_WITH_MEM_DEBUG=OFF \ + -DLIBXML2_WITH_MODULES=OFF \ + -DLIBXML2_WITH_OUTPUT=ON \ + -DLIBXML2_WITH_PATTERN=ON \ + -DLIBXML2_WITH_PROGRAMS=ON \ + -DLIBXML2_WITH_PUSH=ON \ + -DLIBXML2_WITH_PYTHON=OFF \ + -DLIBXML2_WITH_READER=ON \ + -DLIBXML2_WITH_REGEXPS=ON \ + -DLIBXML2_WITH_RUN_DEBUG=OFF \ + -DLIBXML2_WITH_SAX1=ON \ + -DLIBXML2_WITH_SCHEMAS=ON \ + -DLIBXML2_WITH_SCHEMATRON=OFF \ + -DLIBXML2_WITH_TESTS=OFF \ + -DLIBXML2_WITH_THREADS=ON \ + -DLIBXML2_WITH_THREAD_ALLOC=OFF \ + -DLIBXML2_WITH_TREE=ON \ + -DLIBXML2_WITH_VALID=ON \ + -DLIBXML2_WITH_WRITER=ON \ + -DLIBXML2_WITH_XINCLUDE=ON \ + -DLIBXML2_WITH_XPATH=ON \ + -DLIBXML2_WITH_XPTR=ON \ + -DLIBXML2_WITH_XPTR_LOCS=ON \ + -DLIBXML2_WITH_ZLIB=ON \ + -DHAVE_LIBHISTORY=OFF \ + -DHAVE_LIBREADLINE=OFF + +define Build/InstallDev + $(INSTALL_DIR) $(2)/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xml2-config \ + $(2)/bin/$(GNU_TARGET_NAME)-xml2-config + $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \ + $(2)/bin/$(GNU_TARGET_NAME)-xml2-config + $(LN) $(GNU_TARGET_NAME)-xml2-config $(2)/bin/xml2-config + + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/xmlcatalog $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/xmllint $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libxml2 $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.so* $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/cmake/libxml2 + $(CP) $(PKG_INSTALL_DIR)/usr/lib/cmake/libxml2-$(PKG_VERSION)/*.cmake \ + $(1)/usr/lib/cmake/libxml2 + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libxml-2.0.pc $(1)/usr/lib/pkgconfig/ + + $(INSTALL_DIR) $(2)/share/aclocal/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(2)/share/aclocal +endef + +define Host/Install + $(call Host/Install/Default) + mv $(1)/bin/xml2-config $(1)/bin/$(GNU_HOST_NAME)-xml2-config + $(LN) $(GNU_HOST_NAME)-xml2-config $(1)/bin/xml2-config +endef + +define Package/libxml2/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.so.* $(1)/usr/lib/ +endef + +define Package/libxml2-dev/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/xml2-config $(1)/usr/bin/ + $(SED) "s,$(STAGING_DIR),,g" $(1)/usr/bin/xml2-config + + $(INSTALL_DIR) $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.so $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/{cmake,pkgconfig} + $(CP) $(PKG_INSTALL_DIR)/usr/lib/{cmake,pkgconfig} $(1)/usr/lib/ + $(SED) "s,$(STAGING_DIR),,g" $(1)/usr/lib/pkgconfig/*.pc + + $(INSTALL_DIR) $(1)/usr/share/aclocal + $(CP) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(1)/usr/share/aclocal +endef + +define Package/libxml2-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/xmllint $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/xmlcatalog $(1)/usr/bin/ +endef + +$(eval $(call HostBuild)) +$(eval $(call BuildPackage,libxml2)) +$(eval $(call BuildPackage,libxml2-dev)) +$(eval $(call BuildPackage,libxml2-utils)) diff --git a/package/libs/libxml2/patches/010-iconv.patch b/package/libs/libxml2/patches/010-iconv.patch new file mode 100644 index 0000000000..e35b7ce939 --- /dev/null +++ b/package/libs/libxml2/patches/010-iconv.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -496,6 +496,9 @@ if(LIBXML2_WITH_PROGRAMS) + add_executable(LibXml2::${PROGRAM} ALIAS ${PROGRAM}) + target_compile_definitions(${PROGRAM} PRIVATE SYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}") + target_link_libraries(${PROGRAM} LibXml2) ++ if(LIBXML2_WITH_ICONV AND NOT Iconv_IS_BUILT_IN) ++ target_link_libraries(${PROGRAM} iconv) ++ endif() + if(HAVE_LIBHISTORY) + target_link_libraries(${PROGRAM} history) + endif() From f7fbe77115924d831dfa7e5b9dc8903b4ccaaf07 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Sun, 16 Apr 2023 23:20:57 -0400 Subject: [PATCH 16/23] gettext-full: set gperf as build prerequisite Require gperf to be built before gettext. Signed-off-by: Michael Pratt --- package/libs/gettext-full/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/libs/gettext-full/Makefile b/package/libs/gettext-full/Makefile index 6e185a37ab..440cff1341 100644 --- a/package/libs/gettext-full/Makefile +++ b/package/libs/gettext-full/Makefile @@ -25,6 +25,8 @@ PKG_FIXUP:=autoreconf PKG_INSTALL:=1 PKG_BUILD_DEPENDS:=gettext-full/host PKG_BUILD_PARALLEL:=0 + +HOST_BUILD_DEPENDS:=gperf/host HOST_BUILD_PARALLEL:=0 PKG_SUBDIRS:= \ From d95d5d2a3a895f5374b56ab349f628578cd4149b Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Sun, 16 Apr 2023 11:04:31 -0400 Subject: [PATCH 17/23] gettext-full: link to local libxml2 Some users have reported that gettext builds are attempting to link to libxml2 while it was supposed to be configured to use it's own built-in substitute. Configure gettext to require and link to our local libxml2 explicitly. Add a patch to revert upstream commit 87927a4e2 which forces libtextstyle to use the built-in libxml, no matter what the configuration is, making that option configurable again after the configure script is regenerated. Reported-by: Tianling Shen Signed-off-by: Michael Pratt --- package/libs/gettext-full/Makefile | 7 +++-- .../100-libxml-no-force-included.patch | 31 +++++++++++++++++++ .../patches/150-disable_libxml_iconv.patch | 22 ------------- 3 files changed, 35 insertions(+), 25 deletions(-) create mode 100644 package/libs/gettext-full/patches/100-libxml-no-force-included.patch delete mode 100644 package/libs/gettext-full/patches/150-disable_libxml_iconv.patch diff --git a/package/libs/gettext-full/Makefile b/package/libs/gettext-full/Makefile index 440cff1341..a92932f375 100644 --- a/package/libs/gettext-full/Makefile +++ b/package/libs/gettext-full/Makefile @@ -23,10 +23,10 @@ PKG_CPE_ID:=cpe:/a:gnu:gettext PKG_FIXUP:=autoreconf PKG_INSTALL:=1 -PKG_BUILD_DEPENDS:=gettext-full/host +PKG_BUILD_DEPENDS:=gettext-full/host libxml2 PKG_BUILD_PARALLEL:=0 -HOST_BUILD_DEPENDS:=gperf/host +HOST_BUILD_DEPENDS:=gperf/host libxml2/host HOST_BUILD_PARALLEL:=0 PKG_SUBDIRS:= \ @@ -86,6 +86,7 @@ CONFIGURE_ARGS += \ --with-included-gettext \ --without-libintl-prefix \ --without-libexpat-prefix \ + --with-libxml2-prefix=$(STAGING_DIR) \ --without-emacs HOST_CONFIGURE_ARGS += \ @@ -96,7 +97,7 @@ HOST_CONFIGURE_ARGS += \ --disable-java \ --disable-openmp \ --without-emacs \ - --without-libxml2-prefix + --with-libxml2-prefix=$(STAGING_DIR_HOSTPKG) HOST_CONFIGURE_VARS += \ EMACS="no" \ diff --git a/package/libs/gettext-full/patches/100-libxml-no-force-included.patch b/package/libs/gettext-full/patches/100-libxml-no-force-included.patch new file mode 100644 index 0000000000..af5c0a47ee --- /dev/null +++ b/package/libs/gettext-full/patches/100-libxml-no-force-included.patch @@ -0,0 +1,31 @@ +--- a/libtextstyle/gnulib-local/modules/libxml.diff ++++ /dev/null +@@ -1,28 +0,0 @@ +-*** libxml.orig 2018-10-28 14:37:07.007164889 +0100 +---- libxml 2019-02-14 22:19:29.994771110 +0100 +-*************** +-*** 118,124 **** +- fabs +- +- configure.ac: +-! gl_LIBXML +- +- Makefile.am: +- if INCLUDED_LIBXML +---- 118,133 ---- +- fabs +- +- configure.ac: +-! # In libtextstyle, we don't want to use an external libxml, because its +-! # dependencies and their dynamic relocations have an impact on the startup +-! # time of a program that is linked with it. As you can see by using +-! # 'readelf -r ... | wc -l' and 'readelf -d ... | grep NEEDED': +-! # - libxml2.so has more than 3300 relocations and depends on libicuuc. +-! # - libicuuc.so has more than 4900 relocations and depends on libstdc++. +-! # - libstdc++.so has more than 4600 relocations. +-! # These are more than 12800 relocations, to perform at program startup. +-! # So, force the use of the included libxml part. +-! gl_LIBXML([yes]) +- +- Makefile.am: +- if INCLUDED_LIBXML diff --git a/package/libs/gettext-full/patches/150-disable_libxml_iconv.patch b/package/libs/gettext-full/patches/150-disable_libxml_iconv.patch deleted file mode 100644 index bf60ecbdb5..0000000000 --- a/package/libs/gettext-full/patches/150-disable_libxml_iconv.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/gettext-tools/gnulib-lib/libxml/xmlversion.in.h -+++ b/gettext-tools/gnulib-lib/libxml/xmlversion.in.h -@@ -302,7 +302,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(i - * - * Whether iconv support is available - */ --#if 1 -+#if 0 - #define LIBXML_ICONV_ENABLED - #endif - ---- a/gnulib-local/lib/libxml/xmlversion.in.h -+++ b/gnulib-local/lib/libxml/xmlversion.in.h -@@ -302,7 +302,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(i - * - * Whether iconv support is available - */ --#if 1 -+#if 0 - #define LIBXML_ICONV_ENABLED - #endif - From 87e902fcdcce0e3d1287deb901f934aabf7ec183 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Thu, 23 Mar 2023 03:53:52 -0400 Subject: [PATCH 18/23] tools/libtool: bootstrap to local gnulib source Using the local gnulib source during bootstrap allows for fine-grained control over the macros and source files for use with libtool but part of gnulib instead of libtool, without having to wait for a release or deal with gnulib as a git submodule. Signed-off-by: Michael Pratt --- tools/Makefile | 2 +- tools/libtool/Makefile | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index 3bf94827cf..3f12828a8f 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -104,7 +104,7 @@ $(curdir)/gmp/compile := $(curdir)/libtool/compile $(curdir)/isl/compile := $(curdir)/gmp/compile $(curdir)/liblzo/compile := $(curdir)/cmake/compile $(curdir)/libressl/compile := $(curdir)/pkgconf/compile -$(curdir)/libtool/compile := $(curdir)/automake/compile $(curdir)/missing-macros/compile +$(curdir)/libtool/compile := $(curdir)/automake/compile $(curdir)/gnulib/compile $(curdir)/missing-macros/compile $(curdir)/lz4/compile := $(curdir)/meson/compile $(curdir)/lzma-old/compile := $(curdir)/zlib/compile $(curdir)/lzop/compile := $(curdir)/cmake/compile $(curdir)/liblzo/compile diff --git a/tools/libtool/Makefile b/tools/libtool/Makefile index b4f3ecc36b..1187191478 100644 --- a/tools/libtool/Makefile +++ b/tools/libtool/Makefile @@ -18,17 +18,31 @@ HOST_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/host-build.mk +export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR) + HOST_CONFIGURE_VARS += \ lt_cv_sys_dlsearch_path="" +define Host/Bootstrap + ( \ + cd $(HOST_BUILD_DIR); \ + $(AM_TOOL_PATHS) \ + ./bootstrap \ + --force \ + --skip-git \ + --skip-po \ + --gnulib-srcdir=$(GNULIB_SRCDIR) \ + ) +endef + define Host/Prepare $(call Host/Prepare/Default) $(call Host/Uninstall) - $(if $(QUILT),,(cd $(HOST_BUILD_DIR); touch README-release; $(AM_TOOL_PATHS) ./bootstrap --skip-git --skip-po --force)) + $(if $(QUILT),,$(call Host/Bootstrap)) endef define Host/Configure - $(if $(QUILT),(cd $(HOST_BUILD_DIR); touch README-release; $(AM_TOOL_PATHS) ./bootstrap --skip-git --skip-po --force)) + $(if $(QUILT),$(call Host/Bootstrap)) $(call Host/Configure/Default) endef From 09f8f21ae33402201c14a125a37b64746415642d Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Thu, 23 Mar 2023 03:49:01 -0400 Subject: [PATCH 19/23] tools/coreutils: bootstrap to local gnulib source Using the local gnulib source during bootstrap allows for fine-grained control over the macros and source files for use with coreutils but part of gnulib instead of coreutils, without having to wait for a release or deal with gnulib as a git submodule. In this case, the execution of autotools must be skipped by force. Autoconf and Automake during bootstrap on coreutils only works right when using directly checked-out source. There is a symbol in gnulib, @GNULIB_TIME@ that is not yet defined in coreutils source, so we use the backup of lib/time.in.h instead of the one provided by gnulib source. Signed-off-by: Michael Pratt --- tools/Makefile | 1 + tools/coreutils/Makefile | 27 +++++++++++++ tools/coreutils/patches/000-bootstrap.patch | 45 +++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 tools/coreutils/patches/000-bootstrap.patch diff --git a/tools/Makefile b/tools/Makefile index 3f12828a8f..40c3ec1ab0 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -127,6 +127,7 @@ $(curdir)/squashfs4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile $(curdir)/zstd/compile := $(curdir)/meson/compile ifneq ($(HOST_OS),Linux) + $(curdir)/coreutils/compile += $(curdir)/automake/compile $(curdir)/bison/compile $(curdir)/gnulib/compile $(curdir)/squashfs4/compile += $(curdir)/coreutils/compile tools-y += coreutils endif diff --git a/tools/coreutils/Makefile b/tools/coreutils/Makefile index f799e83c5b..233ab1585d 100644 --- a/tools/coreutils/Makefile +++ b/tools/coreutils/Makefile @@ -20,15 +20,42 @@ BUILD_PROGRAMS = date readlink touch ln chown ginstall include $(INCLUDE_DIR)/host-build.mk +export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR) + BUILD_BINS = $(patsubst %,src/%,$(BUILD_PROGRAMS)) HOST_CONFIGURE_ARGS += \ --enable-install-program=$(subst $(space),$(comma),$(strip $(BUILD_PROGRAMS))) HOST_MAKE_FLAGS += \ + $(AM_TOOL_PATHS_FAKE) \ PROGRAMS="$(BUILD_BINS)" \ LIBRARIES= MANS= SUBDIRS=. +define Host/Bootstrap + ( \ + cd $(HOST_BUILD_DIR); \ + $(AM_TOOL_PATHS_FAKE) \ + ./bootstrap \ + --bootstrap-sync \ + --force \ + --no-git \ + --skip-po \ + --gnulib-srcdir=$(GNULIB_SRCDIR) \ + ) +endef + +define Host/Prepare + $(call Host/Prepare/Default) + $(if $(QUILT),,$(call Host/Bootstrap)) +endef + +define Host/Configure + $(if $(QUILT),$(call Host/Bootstrap)) + -$(CP) $(HOST_BUILD_DIR)/lib/time.in.h~ $(HOST_BUILD_DIR)/lib/time.in.h # @GNULIB_TIME@ not defined + $(call Host/Configure/Default) +endef + define Host/Install $(INSTALL_DIR) $(1)/bin $(INSTALL_BIN) $(patsubst %,$(HOST_BUILD_DIR)/%,$(BUILD_BINS)) $(1)/bin/ diff --git a/tools/coreutils/patches/000-bootstrap.patch b/tools/coreutils/patches/000-bootstrap.patch new file mode 100644 index 0000000000..91be9d338a --- /dev/null +++ b/tools/coreutils/patches/000-bootstrap.patch @@ -0,0 +1,45 @@ +--- a/bootstrap ++++ b/bootstrap +@@ -278,7 +278,7 @@ check_exists() { + ($2 --version /dev/null 2>&1 ++ ($@ --version /dev/null 2>&1 + fi + + test $? -lt 126 +@@ -563,7 +563,7 @@ p + q' + + get_version() { +- app=$1 ++ app="$@" + + $app --version >/dev/null 2>&1 || { $app --version; return 1; } + +@@ -620,13 +620,13 @@ check_versions() { + if [ "$req_ver" = "-" ]; then + # Merely require app to exist; not all prereq apps are well-behaved + # so we have to rely on $? rather than get_version. +- if ! check_exists --verbose $app; then ++ if ! check_exists --verbose "$app"; then + warn_ "Error: '$app' not found" + ret=1 + fi + else + # Require app to produce a new enough version string. +- inst_ver=$(get_version $app) ++ inst_ver=$(get_version "$app") + if [ ! "$inst_ver" ]; then + warn_ "Error: '$app' not found" + ret=1 +@@ -923,7 +923,7 @@ version_controlled_file() { + # two just-pre-run programs. + + # Import from gettext. +-with_gettext=yes ++with_gettext=no + grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \ + with_gettext=no + From d167adbc4418b664dd825b8b4e7085c2c7322271 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Sun, 16 Apr 2023 18:32:14 -0400 Subject: [PATCH 20/23] 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 --- package/libs/gettext-full/Makefile | 41 ++- .../libs/gettext-full/patches/010-m4.patch | 342 ------------------ 2 files changed, 39 insertions(+), 344 deletions(-) delete mode 100644 package/libs/gettext-full/patches/010-m4.patch diff --git a/package/libs/gettext-full/Makefile b/package/libs/gettext-full/Makefile index a92932f375..c8700de550 100644 --- a/package/libs/gettext-full/Makefile +++ b/package/libs/gettext-full/Makefile @@ -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 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)') diff --git a/package/libs/gettext-full/patches/010-m4.patch b/package/libs/gettext-full/patches/010-m4.patch deleted file mode 100644 index fe896db312..0000000000 --- a/package/libs/gettext-full/patches/010-m4.patch +++ /dev/null @@ -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 , 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 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 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 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 has the 'wint - dnl or 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 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 has the 'wint - dnl or 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 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 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 has the 'wint - dnl or 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 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 has the 'wint - dnl or 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 , 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 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 , 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 to declare max_align_t. - AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) From 97d20525b24e96558f974858f4d8ad6d9148e61f Mon Sep 17 00:00:00 2001 From: Yuu Toriyama Date: Thu, 4 May 2023 19:26:13 +0900 Subject: [PATCH 21/23] wireless-regdb: update to 2023.05.03 Changes: 43f81b4 wireless-regdb: update regulatory database based on preceding changes 66f245d wireless-regdb: Update regulatory rules for Hong Kong (HK) e78c450 wireless-regdb: update regulatory rules for India (IN) 1647bb6 wireless-regdb: Update regulatory rules for Russia (RU). Remove DFS requirement. c076f21 Update regulatory info for Russia (RU) on 6GHz Signed-off-by: Yuu Toriyama --- package/firmware/wireless-regdb/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/firmware/wireless-regdb/Makefile b/package/firmware/wireless-regdb/Makefile index 9b4a5c105f..9ce2a397ff 100644 --- a/package/firmware/wireless-regdb/Makefile +++ b/package/firmware/wireless-regdb/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wireless-regdb -PKG_VERSION:=2023.02.13 +PKG_VERSION:=2023.05.03 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/network/wireless-regdb/ -PKG_HASH:=fe81e8a8694dc4753a45087a1c4c7e1b48dee5a59f5f796ce374ea550f0b2e73 +PKG_HASH:=f254d08ab3765aeae2b856222e11a95d44aef519a6663877c71ef68fae4c8c12 PKG_MAINTAINER:=Felix Fietkau From 9464e9e209bb2df22f314276785bea80b1cfee0e Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Wed, 3 May 2023 20:10:32 +0200 Subject: [PATCH 22/23] lantiq: xway: use capital letters in Fritz!Box name Rename to Fritz!Box to keep naming uniform. Fixes: ceac4ae3b403 ("lantiq: xway: add support for AVM FRITZ!Box 7330") Signed-off-by: Nick Hainke --- target/linux/lantiq/image/ar9.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/lantiq/image/ar9.mk b/target/linux/lantiq/image/ar9.mk index 5732a3432c..9a0d68433c 100644 --- a/target/linux/lantiq/image/ar9.mk +++ b/target/linux/lantiq/image/ar9.mk @@ -18,7 +18,7 @@ define Device/avm_fritz7320 DEVICE_ALT0_VENDOR := 1&1 DEVICE_ALT0_MODEL := HomeServer DEVICE_ALT1_VENDOR := AVM - DEVICE_ALT1_MODEL := Fritz!box 7330 + DEVICE_ALT1_MODEL := Fritz!Box 7330 SOC := ar9 IMAGE_SIZE := 15744k LOADER_FLASH_OFFS := 0x31000 From c6419d1946996aa859cef9df897a0c1c1f796d11 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Wed, 22 Feb 2023 19:55:56 +0100 Subject: [PATCH 23/23] lantiq: switch to Kernel 5.15 by default Getting ready for the next release. Signed-off-by: Paul Spooren --- target/linux/lantiq/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/lantiq/Makefile b/target/linux/lantiq/Makefile index 08618fa9a3..2e166a5f37 100644 --- a/target/linux/lantiq/Makefile +++ b/target/linux/lantiq/Makefile @@ -9,8 +9,7 @@ BOARDNAME:=Lantiq FEATURES:=squashfs SUBTARGETS:=xrx200 xway xway_legacy falcon ase -KERNEL_PATCHVER:=5.10 -KERNEL_TESTING_PATCHVER:=5.15 +KERNEL_PATCHVER:=5.15 define Target/Description Build firmware images for Lantiq SoC