diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-07 20:57:33 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-07 20:57:33 +0000 |
commit | 7fee968e82d2ab2948b2712fed874b21d6e58222 (patch) | |
tree | 82c5f5b8a9200d8c9437747f0275363a51ff100c | |
parent | 9aff3e749be07838b251dcd675dbc39a4cadd6d2 (diff) | |
download | chromium_src-7fee968e82d2ab2948b2712fed874b21d6e58222.zip chromium_src-7fee968e82d2ab2948b2712fed874b21d6e58222.tar.gz chromium_src-7fee968e82d2ab2948b2712fed874b21d6e58222.tar.bz2 |
Linux: Change the generic chrome-wrapper script to look for missing libs and create symlinks.
BUG=30810
TEST=Continuous builds work out of the box on RPM distros.
Review URL: http://codereview.chromium.org/518052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35727 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | chrome/tools/build/linux/chrome-wrapper | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/chrome/tools/build/linux/chrome-wrapper b/chrome/tools/build/linux/chrome-wrapper index 12ca820..e7ec420 100755 --- a/chrome/tools/build/linux/chrome-wrapper +++ b/chrome/tools/build/linux/chrome-wrapper @@ -25,6 +25,22 @@ exists_desktop_file() { return 1 } +# Checks a file to see if it's a 32 or 64-bit +check_executable() { + out=$(file $(readlink -f $1) 2> /dev/null) + echo $out | grep -qs "ELF 32-bit LSB" + if [ $? = 0 ]; then + echo 32 + return + fi + echo $out | grep -qs "ELF 64-bit LSB" + if [ $? = 0 ]; then + echo 64 + return + fi + echo neither +} + # Generate a desktop file that will run this script generate_desktop_file() { apps="${XDG_DATA_HOME:-$HOME/.local/share}/applications" @@ -62,6 +78,47 @@ esac # Always use our ffmpeg and other shared libs. export LD_LIBRARY_PATH="$HERE:$HERE/lib:$HERE/lib.target:$LD_LIBRARY_PATH" +MISSING_LIBS=$(ldd "$HERE/chrome" 2> /dev/null |grep "not found$" | cut -d" " -f 1|sed 's/\t//') +CHROME_ARCH=$(check_executable "$HERE/chrome") +uname -m | grep -qs x86_64 +if [ $? = 1 ]; then + LIBDIRS="/lib /lib32 /usr/lib /usr/lib32" +else + LIBDIRS="/lib64 /lib /usr/lib64 /usr/lib" +fi + +echo $MISSING_LIBS | grep -qs libbz2.so.1.0 +if [ $? = 0 ]; then + for dir in $LIBDIRS + do + if [ -e "$dir/libbz2.so.1" ]; then + LIB_ARCH=$(check_executable "$dir/libbz2.so.1") + if [ "$CHROME_ARCH" = "$LIB_ARCH" ]; then + ln -s "$dir/libbz2.so.1" "$HERE/libbz2.so.1.0" + break; + fi + fi + done +fi + +for lib in libnspr4.so.0d libnss3.so.1d libnssutil3.so.1d libplc4.so.0d libplds4.so.0d libsmime3.so.1d libssl3.so.1d +do + echo $MISSING_LIBS | grep -qs $lib + if [ $? = 0 ]; then + reallib=$(echo $lib | sed 's/\.[01]d$//') + for dir in $LIBDIRS + do + if [ -e "$dir/$reallib" ]; then + LIB_ARCH=$(check_executable "$dir/$reallib") + if [ "$CHROME_ARCH" = "$LIB_ARCH" ]; then + ln -s "$dir/$reallib" "$HERE/$lib" + break; + fi + fi + done + fi +done + # Custom version string for this release. This can be used to add a downstream # vendor string or release channel information. export CHROME_VERSION_EXTRA="custom" |