summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Meissner <meissner@suse.de>2015-02-23 09:51:42 (GMT)
committerBrad King <brad.king@kitware.com>2015-02-23 16:50:29 (GMT)
commitfe558718b30da989db8b880374012a0e580574e6 (patch)
tree0946ced3f67d2103cae57cb8691bf38efd3252a7
parentd95d4c2c775e6eb6db1800be869d97b5464628ab (diff)
downloadCMake-fe558718b30da989db8b880374012a0e580574e6.zip
CMake-fe558718b30da989db8b880374012a0e580574e6.tar.gz
CMake-fe558718b30da989db8b880374012a0e580574e6.tar.bz2
GetPrerequisites: Update output matching for newer 'file' versions
Detect PIE binaries with newer 'file' (5.22). It no longer prints "(uses shared libraries)" but does print "interpreter": # file 5.19 $ file /usr/bin/su /usr/bin/su: ... shared object, ..., dynamically linked (uses shared libs), ... # file 5.22 $ file /usr/bin/su /usr/bin/su: ... shared object, ..., dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, ...
-rw-r--r--Modules/GetPrerequisites.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 712a41c..9fb85fe 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -260,6 +260,13 @@ function(is_file_executable file result_var)
return()
endif()
+ # "file" version 5.22 does not print "(used shared libraries)"
+ # but uses "interpreter"
+ if("${file_ov}" MATCHES "shared object.*interpreter")
+ set(${result_var} 1 PARENT_SCOPE)
+ return()
+ endif()
+
else()
message(STATUS "warning: No 'file' command, skipping execute_process...")
endif()