Hi,

when using an external toolchain the base-files package copies libc, libgcc and
others from the library directory.

The file list is given as following in the .config:
CONFIG_LIBC_FILE_SPEC="./lib/ld{-*.so,-linux*.so.*} 
./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*}"

Because the filenames are composed with different endings, not all files exist
and will be skipped. Currently, this works only if the last composed file
(util.so.*) really exists. At the moment this works - but only if you don't add
a new file like 'uClibc'.

Adding it at the end '...resolv,util,uClibc}{-*.so,.so.*}' will lead to this
message, because the combination 'libuClibc.so.*' doesn't exist and Make will
evaluate the last copy statement of the for loop.

--- Message Snippet ---
cp: cannot stat 
`/home/user/Desktop/code/meetwise/toolchain/staging_dir/toolchain-arm_v5te_gcc-linaro_uClibc-0.9.32_eabi/./lib/libnss_files.so.*':
 No such file or directory
cp: cannot stat 
`/home/user/Desktop/code/meetwise/toolchain/staging_dir/toolchain-arm_v5te_gcc-linaro_uClibc-0.9.32_eabi/./lib/libresolv-*.so':
 No such file or directory
cp: cannot stat 
`/home/user/Desktop/code/meetwise/toolchain/staging_dir/toolchain-arm_v5te_gcc-linaro_uClibc-0.9.32_eabi/./lib/libresolv.so.*':
 No such file or directory
cp: cannot stat 
`/home/user/Desktop/code/meetwise/toolchain/staging_dir/toolchain-arm_v5te_gcc-linaro_uClibc-0.9.32_eabi/./lib/libuClibc.so.*':
 No such file or directory
make[2]: *** 
[/home/user/Desktop/code/meetwise/openwrt/bin/at91/packages/libc_-68_at91.ipk] 
Error 1
make[2]: Leaving directory 
`/home/user/Desktop/code/meetwise/openwrt/package/base-files'
make[1]: *** [package/base-files/compile] Error 2
make[1]: Leaving directory `/home/user/Desktop/code/meetwise/openwrt'
make: *** [package/base-files/compile] Error 2
--- /Message Snippet/ ---

To fix this unwanted behaviour I added an extra 'exit 0' to each for-loop and
make ignores non-existing files as before.

Signed-off-by: Sven Bachmann <d...@mcbachmann.de>
---
 package/base-files/Makefile |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 63b506d..947d103 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -576,7 +576,8 @@ else
                dir=`dirname $$$$file` ; \
                $(INSTALL_DIR) $(1)/$$$$dir ; \
                $(CP) $(call qstrip,$(CONFIG_LIBGCC_ROOT_DIR))/$$$$file 
$(1)/$$$$dir/ ; \
-       done
+       done ; \
+       exit 0
   endef
 
   define Package/libssp/install
@@ -584,7 +585,8 @@ else
                dir=`dirname $$$$file` ; \
                $(INSTALL_DIR) $(1)/$$$$dir ; \
                $(CP) $(call qstrip,$(CONFIG_LIBSSP_ROOT_DIR))/$$$$file 
$(1)/$$$$dir/ ; \
-       done
+       done ; \
+       exit 0
   endef
 
   define Package/libstdcpp/install
@@ -592,7 +594,8 @@ else
                dir=`dirname $$$$file` ; \
                $(INSTALL_DIR) $(1)/$$$$dir ; \
                $(CP) $(call qstrip,$(CONFIG_LIBSTDCPP_ROOT_DIR))/$$$$file 
$(1)/$$$$dir/ ; \
-       done
+       done ; \
+       exit 0
   endef
 
   define Package/libc/install
@@ -600,7 +603,8 @@ else
                dir=`dirname $$$$file` ; \
                $(INSTALL_DIR) $(1)/$$$$dir ; \
                $(CP) $(call qstrip,$(CONFIG_LIBC_ROOT_DIR))/$$$$file 
$(1)/$$$$dir/ ; \
-       done
+       done ; \
+       exit 0
   endef
 
   define Package/libpthread/install
@@ -608,7 +612,8 @@ else
                dir=`dirname $$$$file` ; \
                $(INSTALL_DIR) $(1)/$$$$dir ; \
                $(CP) $(call qstrip,$(CONFIG_LIBPTHREAD_ROOT_DIR))/$$$$file 
$(1)/$$$$dir/ ; \
-       done
+       done ; \
+       exit 0
   endef
 
   define Package/librt/install
@@ -616,7 +621,8 @@ else
                dir=`dirname $$$$file` ; \
                $(INSTALL_DIR) $(1)/$$$$dir ; \
                $(CP) $(call qstrip,$(CONFIG_LIBRT_ROOT_DIR))/$$$$file 
$(1)/$$$$dir/ ; \
-       done
+       done ; \
+       exit 0
   endef
 
   define Package/ldd/install
@@ -624,7 +630,8 @@ else
                dir=`dirname $$$$file` ; \
                $(INSTALL_DIR) $(1)/$$$$dir ; \
                $(CP) $(call qstrip,$(CONFIG_LDD_ROOT_DIR))/$$$$file 
$(1)/$$$$dir/ ; \
-       done
+       done ; \
+       exit 0
   endef
 
   define Package/ldconfig/install
@@ -632,7 +639,8 @@ else
                dir=`dirname $$$$file` ; \
                $(INSTALL_DIR) $(1)/$$$$dir ; \
                $(CP) $(call qstrip,$(CONFIG_LDCONFIG_ROOT_DIR))/$$$$file 
$(1)/$$$$dir/ ; \
-       done
+       done ; \
+       exit 0
   endef
 
 endif
-- 
1.7.1

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to