support/scripts/fix-rpath: check if the patchelf utility is executable
authorWolfgang Grandegger <wg@grandegger.com>
Sat, 22 Jul 2017 11:15:41 +0000 (13:15 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 22 Jul 2017 12:35:55 +0000 (14:35 +0200)
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
support/scripts/fix-rpath

index f7c70b7c7e1b539690d0088aec8d02aec3fd4067..f92e6013daaa1c6dd5235e400ea13aa47de5b87a 100755 (executable)
@@ -45,6 +45,9 @@ Environment:
 
     TOOLCHAIN_EXTERNAL_DOWNLOAD_INSTALL_DIR
                  (default HOST_DIR/opt/ext-toolchain)
+
+Returns:         0 if success or 1 in case of error
+
 EOF
 }
 
@@ -60,6 +63,11 @@ main() {
     local find_args=( )
     local sanitize_extra_args=( )
 
+    if ! "${PATCHELF}" --version > /dev/null 2>&1; then
+       echo "Error: can't execute patchelf utility '${PATCHELF}'"
+       exit 1
+    fi
+
     case "${tree}" in
         host)
             rootdir="${HOST_DIR}"