changeset 3757:79f55f85ae1d

. Pull in a MacOS X compatible version of binary_file_verification from the MacOS X port. Obtained from: macosx-port (Alexander Strange <astrange@apple.com>)
author Greg Lewis <glewis@eyesbeyond.com>
date Tue, 08 Mar 2011 10:22:56 -0800
parents 52c2dff7c946
children 472f6c7fbb52
files make/common/shared/Defs-bsd.gmk make/common/shared/Defs-utils.gmk
diffstat 2 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/make/common/shared/Defs-bsd.gmk	Thu Mar 03 20:30:34 2011 -0800
+++ b/make/common/shared/Defs-bsd.gmk	Tue Mar 08 10:22:56 2011 -0800
@@ -177,6 +177,18 @@
 
 # Macro to check it's input file for banned dependencies and verify the
 #   binary built properly. Relies on process exit code.
+ifeq ($(OS_VENDOR), Apple)
+( \
+  $(ECHO) "Checking for mapfile use in: $1" && \
+  if [ "`$(NM) -g $1 | $(EGREP) 'SUNWprivate'`" = "" ] ; then \
+    $(ECHO) "WARNING: File was not built with a mapfile: $1"; \
+  fi && \
+  $(ECHO) "Library loads for: $1" && \
+  $(OTOOL) -L $1 && \
+  $(ECHO) "RUNPATH for: $1" && \
+  ( $(OTOOL) -l $1 | $(EGREP) 'path ' ) \
+)
+else
 define binary_file_verification # binary_file
 ( \
   $(ECHO) "Checking for mapfile use in: $1" && \
@@ -189,4 +201,4 @@
   ( $(READELF) -d $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \
 )
 endef
-
+endif
--- a/make/common/shared/Defs-utils.gmk	Thu Mar 03 20:30:34 2011 -0800
+++ b/make/common/shared/Defs-utils.gmk	Tue Mar 08 10:22:56 2011 -0800
@@ -119,6 +119,7 @@
 MV             = $(UTILS_COMMAND_PATH)mv
 NAWK           = $(UTILS_USR_BIN_PATH)nawk
 NM             = $(UTILS_CCS_BIN_PATH)nm
+OTOOL          = $(UTILS_USR_BIN_PATH)otool
 PKGMK          = $(UTILS_COMMAND_PATH)pkgmk
 PRINTF         = $(UTILS_USR_BIN_PATH)printf
 PWD            = $(UTILS_COMMAND_PATH)pwd