treewide: update packages to use new toolchain define
authorChristian Marangi <ansuelsmth@gmail.com>
Thu, 19 Oct 2023 16:24:57 +0000 (18:24 +0200)
committerTianling Shen <cnsztl@gmail.com>
Tue, 28 May 2024 07:42:30 +0000 (15:42 +0800)
Update packages to use new toolchain define and drop usage of
TOOLCHAIN_DIR.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
devel/gcc/Makefile
lang/perl/Makefile
lang/rust/Makefile
net/net-snmp/Makefile
utils/gpsd/Makefile
utils/gummiboot/Makefile

index cf2178f2ffb1dc650eee3b029d0e70f3a9f21604..26e44f49c988b24edcdeaf6b5ed6c84198dce7f4 100644 (file)
@@ -73,15 +73,15 @@ define Package/gcc/config
 endef
 
 ifeq ($(CONFIG_INCLUDE_STATIC_LIBC),y)
-       COPY_STATIC_LIBC=cp -a $(TOOLCHAIN_DIR)/lib/libc.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
+       COPY_STATIC_LIBC=cp -a $(TOOLCHAIN_ROOT_DIR)/lib/libc.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
 endif
 
 ifeq ($(CONFIG_INCLUDE_STATIC_LIBPTHREAD),y)
-       COPY_STATIC_LIBPTHREAD=cp -a $(TOOLCHAIN_DIR)/lib/libpthread.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
+       COPY_STATIC_LIBPTHREAD=cp -a $(TOOLCHAIN_ROOT_DIR)/lib/libpthread.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
 endif
 
 ifeq ($(CONFIG_INCLUDE_STATIC_LIBSTDC),y)
-       COPY_STATIC_LIBSTDC=cp -a $(TOOLCHAIN_DIR)/lib/libstdc++.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
+       COPY_STATIC_LIBSTDC=cp -a $(TOOLCHAIN_ROOT_DIR)/lib/libstdc++.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
 endif
 
 ifeq ($(CONFIG_INCLUDE_STATIC_LINK_SPEC),y)
@@ -95,9 +95,9 @@ PKGVERSION=OpenWrt GCC $(PKG_VERSION)
 TARGET_CPPFLAGS += -D_GLIBCXX_INCLUDE_NEXT_C_HEADERS
 
 # not using sstrip here as this messes up the .so's somehow
-STRIP:=$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)strip
+STRIP:=$(firstword $(TOOLCHAIN_BIN_DIRS))/$(TARGET_CROSS)strip
 RSTRIP:= \
-       NM="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)nm" \
+       NM="$(firstword $(TOOLCHAIN_BIN_DIRS))/$(TARGET_CROSS)nm" \
        STRIP="$(STRIP)" \
        STRIP_KMOD="$(STRIP) --strip-debug" \
        $(SCRIPT_DIR)/rstrip.sh
@@ -224,10 +224,10 @@ define Package/gcc/install
        ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/cc
        ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc-$(PKG_VERSION)
        cp -ar $(PKG_INSTALL_DIR)/usr/lib/gcc $(1)/usr/lib
-       cp -ar $(TOOLCHAIN_DIR)/include $(1)/usr
-       cp -a $(TOOLCHAIN_DIR)/lib/*.{o,so*} $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
-       cp -a $(TOOLCHAIN_DIR)/lib/*nonshared*.a  $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
-       cp -a $(TOOLCHAIN_DIR)/lib/libm.a  $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
+       cp -ar $(TOOLCHAIN_ROOT_DIR)/include $(1)/usr
+       cp -a $(TOOLCHAIN_ROOT_DIR)/lib/*.{o,so*} $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
+       cp -a $(TOOLCHAIN_ROOT_DIR)/lib/*nonshared*.a  $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
+       cp -a $(TOOLCHAIN_ROOT_DIR)/lib/libm.a  $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
        $(COPY_STATIC_LIBC)
        $(COPY_STATIC_LIBPTHREAD)
        $(COPY_STATIC_LIBSTDC)
index 6b748019bc49c7952948b35811b206bfeacfaa66..dbc982d6bc9b9f24e24850ce7acd711899ee6a1f 100644 (file)
@@ -102,7 +102,7 @@ define Build/Configure
                                        -Dowrt:threads=$(if $(CONFIG_PERL_THREADS),yes,no) \
                                        -Dowrt:staging_dir='$(STAGING_DIR)' \
                                        -Dowrt:host_perl_prefix='$(HOST_PERL_PREFIX)' \
-                                       -Dsysroot='$(TOOLCHAIN_DIR)' \
+                                       -Dsysroot='$(TOOLCHAIN_ROOT_DIR)' \
                                        files/version.config \
                                        files/base.config \
                                        files/$(patsubst i386,i486,$(ARCH)).config \
index cdf3c2adf97a7b55294e03707de3c1f414f31641..f0d6a866f8312639bd2938ced9532ea9c05c3f58 100644 (file)
@@ -54,7 +54,7 @@ TARGET_CONFIGURE_ARGS = \
        --set=target.$(RUSTC_TARGET_ARCH).linker=$(TARGET_CC_NOCACHE) \
        --set=target.$(RUSTC_TARGET_ARCH).ranlib=$(TARGET_RANLIB) \
        --set=target.$(RUSTC_TARGET_ARCH).crt-static=false \
-       $(if $(CONFIG_USE_MUSL),--set=target.$(RUSTC_TARGET_ARCH).musl-root=$(TOOLCHAIN_DIR))
+       $(if $(CONFIG_USE_MUSL),--set=target.$(RUSTC_TARGET_ARCH).musl-root=$(TOOLCHAIN_ROOT_DIR))
 
 # CARGO_HOME is an environmental
 HOST_CONFIGURE_VARS += CARGO_HOME="$(CARGO_HOME)"
index d7e51c037ffe09157ef1be884850eb81336d5aed..7e6a7b10596d5aaa656afa3e3e1ba82447b90a74 100644 (file)
@@ -223,8 +223,6 @@ ifeq ($(CONFIG_IPV6),y)
 SNMP_TRANSPORTS_INCLUDED+= UDPIPv6
 endif
 
-TARGET_LDFLAGS += -L$(TOOLCHAIN_DIR)/usr/lib
-
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
                INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
index dcd00a956d10af1596e185b69cbb99fba4e32c66..928c4a06e452594fc1a1381a6435701eb078c04a 100644 (file)
@@ -119,7 +119,7 @@ SCONS_OPTIONS += \
        implicit_link=no \
        chrpath=no \
        manbuild=no \
-       sysroot="$(TOOLCHAIN_DIR)" \
+       sysroot="$(TOOLCHAIN_ROOT_DIR)" \
        target="$(TARGET_CROSS:-=)"
 
 define Build/InstallDev
index 688764e43ccda647dece2c0862e8f5e24082b4f2..2295a0b39cdb87dc5dc3b2fa4a2b8122f28c768b 100644 (file)
@@ -44,14 +44,14 @@ CONFIGURE_ARGS += \
        --disable-manpages
 
 define Build/Compile
-       +$(MAKE_VARS) EFI_CFLAGS="-I$(TOOLCHAIN_DIR)/include $(TARGET_CFLAGS)" \
+       +$(MAKE_VARS) EFI_CFLAGS="$(patsubst %,-I%,$(TOOLCHAIN_INC_DIRS)) $(TARGET_CFLAGS)" \
        $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
                $(MAKE_FLAGS) \
                $(1);
 endef
 
 define Build/Install
-       $(MAKE_VARS) EFI_CFLAGS="-I$(TOOLCHAIN_DIR)/include $(TARGET_CFLAGS)" \
+       $(MAKE_VARS) EFI_CFLAGS="$(patsubst %,-I%,$(TOOLCHAIN_INC_DIRS)) $(TARGET_CFLAGS)" \
        $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
                $(MAKE_INSTALL_FLAGS) install
 endef