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, ...
This commit is contained in:
Marcus Meissner 2015-02-23 10:51:42 +01:00 committed by Brad King
parent d95d4c2c77
commit fe558718b3
1 changed files with 7 additions and 0 deletions

View File

@ -260,6 +260,13 @@ function(is_file_executable file result_var)
return() return()
endif() 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() else()
message(STATUS "warning: No 'file' command, skipping execute_process...") message(STATUS "warning: No 'file' command, skipping execute_process...")
endif() endif()