source: trunk/dports/science/htcondor/files/patch-src-condor_scripts-macosx_rewrite_libs.diff @ 105270

Last change on this file since 105270 was 105270, checked in by aronnax@…, 7 years ago

htcondor: new port, specialized workload management system for compute-intensive jobs

File size: 1.2 KB
  • src/condor_scripts/macosx_rewrite_libs

    old new  
    11#!/bin/sh
    2 
    3 # Given a list of files, rewrite the non-system shared library
    4 # dependencies of executables and libraries to be
    5 # @executable_path/../lib/condor/... or @executable_path/../lib/...
    6 # Other types of files are ignored.
    7 
    8 if [ "$1" = "" ] ; then
    9   echo "Usage:" `basename $0` "<executable/library> ..."
    10   exit 1
    11 fi
    12 for filename in "$@" ; do
    13   type=`file -h $filename`
    14   if echo $type | grep -q -e 'dynamically linked shared library' -e 'executable' ; then
    15     basefile=`basename $filename`
    16     libraries=`otool -L $filename | grep '^[[:space:]][^@]' | sed 's|^.\([^ ]*\) .*|\1|' | grep -v '^/usr/lib' | grep -v '^/System/' | grep -v "$basefile "`
    17    
    18     for lib in $libraries ; do
    19       echo $lib
    20       baselib=`basename $lib`
    21       if echo $baselib | grep -q -e 'classad' -e 'condor' ; then
    22         install_name_tool -change "$lib" "@executable_path/../lib/$baselib" $filename
    23       else
    24         install_name_tool -change "$lib" "@executable_path/../lib/condor/$baselib" $filename
    25       fi
    26     done
    27   fi
    28 done
Note: See TracBrowser for help on using the repository browser.