diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2013-01-28 15:54:27 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2013-01-28 15:54:27 +0000 |
commit | 1f66b53038092f0eecca87a7b75c9e3b30ee190d (patch) | |
tree | cc8b9e3e4259f094222075ff2debcf0fe59b6128 /scripts | |
parent | 1b4e6e5e760aa7ea5f0029f07c6997e44d442c5c (diff) | |
download | master-187ad058-1f66b53038092f0eecca87a7b75c9e3b30ee190d.tar.gz master-187ad058-1f66b53038092f0eecca87a7b75c9e3b30ee190d.tar.bz2 master-187ad058-1f66b53038092f0eecca87a7b75c9e3b30ee190d.zip |
scripts: bundle-libraries.sh: support mixing 32bit and 64bit binaries
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35349 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bundle-libraries.sh | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/bundle-libraries.sh b/scripts/bundle-libraries.sh index 08b52b9906..869286bdba 100755 --- a/scripts/bundle-libraries.sh +++ b/scripts/bundle-libraries.sh @@ -1,9 +1,8 @@ #!/usr/bin/env bash # # Script to install host system binaries along with required libraries. -# Refer to the --help output for more information. # -# Copyright (C) 2012 Jo-Philipp Wich <jow@openwrt.org> +# Copyright (C) 2012-2013 Jo-Philipp Wich <jow@openwrt.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -90,17 +89,19 @@ for BIN in "$@"; do if [ -n "$LDSO" ]; then _cp "$BIN" "$DIR/bundled/${BIN##*/}" - [ -x "$DIR/bundled/run.sh" ] || { - cat <<-EOF > "$DIR/bundled/run.sh" + RUN="${LDSO#ld-}"; RUN="run-${RUN%%.so*}.sh" + + [ -x "$DIR/bundled/$RUN" ] || { + cat <<-EOF > "$DIR/bundled/$RUN" #!/usr/bin/env bash dir="\$(dirname "\$0")" bin="\$(basename "\$0")" exec -a "\$0" "\$dir/bundled/lib/$LDSO" --library-path "\$dir/bundled/lib" "\$dir/bundled/\$bin" "\$@" EOF - chmod ${VERBOSE:+-v} 0755 "$DIR/bundled/run.sh" + chmod ${VERBOSE:+-v} 0755 "$DIR/bundled/$RUN" } - _ln "./bundled/run.sh" "$DIR/${BIN##*/}" + _ln "./bundled/$RUN" "$DIR/${BIN##*/}" # is a static executable or non-elf binary else |