michael@0: #!/bin/sh michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: # arguments: michael@0: # 1: full path to DIST/OBJDIR (parent dir of "lib") michael@0: # 2: full path to shlibsign executable (DIST/OBJDIR/bin) michael@0: # 3: OS_TARGET michael@0: # 4: full path to DIST/OBJDIR/lib michael@0: # 5: full path to library that is to be signed michael@0: michael@0: case "${3}" in michael@0: WIN*) michael@0: if echo "${PATH}" | grep -c \; >/dev/null; then michael@0: PATH=${1}/lib\;${1}/bin\;${4}\;${PATH} michael@0: else michael@0: # ARG1 is ${1} with the drive letter escaped. michael@0: if echo "${1}" | grep -c : >/dev/null; then michael@0: ARG1=`(cd ${1}; pwd)` michael@0: else michael@0: ARG1=${1} michael@0: fi michael@0: if echo "${4}" | grep -c : >/dev/null; then michael@0: ARG4=`(cd ${4}; pwd)` michael@0: else michael@0: ARG4=${4} michael@0: fi michael@0: PATH=${ARG1}/lib:${ARG1}/bin:${ARG4}:${PATH} michael@0: fi michael@0: export PATH michael@0: echo "${2}"/shlibsign -v -i "${5}" michael@0: "${2}"/shlibsign -v -i "${5}" michael@0: ;; michael@0: *) michael@0: LIBPATH=`(cd "${1}"/lib; pwd)`:`(cd "${4}"; pwd)`:$LIBPATH michael@0: export LIBPATH michael@0: SHLIB_PATH=${1}/lib:${4}:$SHLIB_PATH michael@0: export SHLIB_PATH michael@0: LD_LIBRARY_PATH=${1}/lib:${4}:$LD_LIBRARY_PATH michael@0: export LD_LIBRARY_PATH michael@0: DYLD_LIBRARY_PATH=${1}/lib:${4}:$DYLD_LIBRARY_PATH michael@0: export DYLD_LIBRARY_PATH michael@0: LIBRARY_PATH=${1}/lib:${4}:$LIBRARY_PATH michael@0: export LIBRARY_PATH michael@0: ADDON_PATH=${1}/lib:${4}:$ADDON_PATH michael@0: export ADDON_PATH michael@0: echo "${2}"/shlibsign -v -i "${5}" michael@0: "${2}"/shlibsign -v -i "${5}" michael@0: ;; michael@0: esac