nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gn...@apache.org
Subject [incubator-nuttx] branch master updated: mkexport: Deal with ARCHSCRIPT containing multiple files
Date Tue, 03 Mar 2020 14:10:26 GMT
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new aa205b3  mkexport: Deal with ARCHSCRIPT containing multiple files
aa205b3 is described below

commit aa205b37326da2fe2e2b5ce19f4b39c950b8b2f0
Author: YAMAMOTO Takashi <yamamoto@midokura.com>
AuthorDate: Tue Mar 3 13:59:12 2020 +0900

    mkexport: Deal with ARCHSCRIPT containing multiple files
    
    This fixes "make export" for esp32-core.
---
 tools/mkexport.sh | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/tools/mkexport.sh b/tools/mkexport.sh
index 2b1d16a..0d78344 100755
--- a/tools/mkexport.sh
+++ b/tools/mkexport.sh
@@ -198,27 +198,31 @@ cp -f "${TOPDIR}/binfmt/libelf/gnu-elf.ld" "${EXPORTDIR}/scripts/."
 # Is there a linker script in this configuration?
 
 if [ "X${USRONLY}" != "Xy" ]; then
-  if [ ! -z "${LDPATH}" ]; then
+
+  # LDPATH can contain multiple files.
+  # The "Copy additional ld scripts" step might copy a file multiple times.
+
+  for LDSCRIPT in ${LDPATH}; do
 
     # Apparently so.  Verify that the script exists
 
-    if [ ! -f "${LDPATH}" ]; then
-      echo "MK: File ${LDPATH} does not exist"
+    if [ ! -f "${LDSCRIPT}" ]; then
+      echo "MK: File ${LDSCRIPT} does not exist"
       exit 1
     fi
 
     # Copy the linker script
 
-    cp -p "${LDPATH}" "${EXPORTDIR}/scripts/." || \
-      { echo "MK: cp ${LDPATH} failed"; exit 1; }
+    cp -p "${LDSCRIPT}" "${EXPORTDIR}/scripts/." || \
+      { echo "MK: cp ${LDSCRIPT} failed"; exit 1; }
 
     # Copy additional ld scripts
 
-    LDDIR="$(dirname "${LDPATH}")"
+    LDDIR="$(dirname "${LDSCRIPT}")"
     for f in "${LDDIR}"/*.ld ; do
       [ -f "${f}" ] && cp -f "${f}" "${EXPORTDIR}/scripts/."
     done
-  fi
+  done
 fi
 
 # Save the compilation options


Mime
View raw message