Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
michael@0 | 1 | #!/bin/sh |
michael@0 | 2 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 5 | |
michael@0 | 6 | # arguments: |
michael@0 | 7 | # 1: full path to DIST/OBJDIR (parent dir of "lib") |
michael@0 | 8 | # 2: full path to shlibsign executable (DIST/OBJDIR/bin) |
michael@0 | 9 | # 3: OS_TARGET |
michael@0 | 10 | # 4: full path to DIST/OBJDIR/lib |
michael@0 | 11 | # 5: full path to library that is to be signed |
michael@0 | 12 | |
michael@0 | 13 | case "${3}" in |
michael@0 | 14 | WIN*) |
michael@0 | 15 | if echo "${PATH}" | grep -c \; >/dev/null; then |
michael@0 | 16 | PATH=${1}/lib\;${1}/bin\;${4}\;${PATH} |
michael@0 | 17 | else |
michael@0 | 18 | # ARG1 is ${1} with the drive letter escaped. |
michael@0 | 19 | if echo "${1}" | grep -c : >/dev/null; then |
michael@0 | 20 | ARG1=`(cd ${1}; pwd)` |
michael@0 | 21 | else |
michael@0 | 22 | ARG1=${1} |
michael@0 | 23 | fi |
michael@0 | 24 | if echo "${4}" | grep -c : >/dev/null; then |
michael@0 | 25 | ARG4=`(cd ${4}; pwd)` |
michael@0 | 26 | else |
michael@0 | 27 | ARG4=${4} |
michael@0 | 28 | fi |
michael@0 | 29 | PATH=${ARG1}/lib:${ARG1}/bin:${ARG4}:${PATH} |
michael@0 | 30 | fi |
michael@0 | 31 | export PATH |
michael@0 | 32 | echo "${2}"/shlibsign -v -i "${5}" |
michael@0 | 33 | "${2}"/shlibsign -v -i "${5}" |
michael@0 | 34 | ;; |
michael@0 | 35 | *) |
michael@0 | 36 | LIBPATH=`(cd "${1}"/lib; pwd)`:`(cd "${4}"; pwd)`:$LIBPATH |
michael@0 | 37 | export LIBPATH |
michael@0 | 38 | SHLIB_PATH=${1}/lib:${4}:$SHLIB_PATH |
michael@0 | 39 | export SHLIB_PATH |
michael@0 | 40 | LD_LIBRARY_PATH=${1}/lib:${4}:$LD_LIBRARY_PATH |
michael@0 | 41 | export LD_LIBRARY_PATH |
michael@0 | 42 | DYLD_LIBRARY_PATH=${1}/lib:${4}:$DYLD_LIBRARY_PATH |
michael@0 | 43 | export DYLD_LIBRARY_PATH |
michael@0 | 44 | LIBRARY_PATH=${1}/lib:${4}:$LIBRARY_PATH |
michael@0 | 45 | export LIBRARY_PATH |
michael@0 | 46 | ADDON_PATH=${1}/lib:${4}:$ADDON_PATH |
michael@0 | 47 | export ADDON_PATH |
michael@0 | 48 | echo "${2}"/shlibsign -v -i "${5}" |
michael@0 | 49 | "${2}"/shlibsign -v -i "${5}" |
michael@0 | 50 | ;; |
michael@0 | 51 | esac |