diff options
author | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-10-31 15:56:28 +0000 |
---|---|---|
committer | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-10-31 15:56:28 +0000 |
commit | d142bb6337b7df78c45130b03d5e4f0288ad5f9d (patch) | |
tree | e60d4afac9dd0045f586840804150e9482cc223e /EmulatorPkg/build.sh | |
parent | ca3ba72cba575ffcad203bbc708b36d03e93ab97 (diff) | |
download | edk2-d142bb6337b7df78c45130b03d5e4f0288ad5f9d.tar.gz edk2-d142bb6337b7df78c45130b03d5e4f0288ad5f9d.tar.bz2 edk2-d142bb6337b7df78c45130b03d5e4f0288ad5f9d.zip |
EmulatorPkg Linux: Improve detection of libraries for host executable
build.sh will detect the locations of the libraries required by
the host executable, and sets the HOST_DLINK_PATHS environment
variable.
In EmulatorPkg/Unix/Host/Host.inf, this environment variable is
used in the linking build step.
Signed-off-by: jljusten
Reviewed-by: andrewfish
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12612 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EmulatorPkg/build.sh')
-rwxr-xr-x | EmulatorPkg/build.sh | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/EmulatorPkg/build.sh b/EmulatorPkg/build.sh index 06ec37a4c1..ecf56e6402 100755 --- a/EmulatorPkg/build.sh +++ b/EmulatorPkg/build.sh @@ -159,19 +159,27 @@ case $PROCESSOR in IA32) ARCH_SIZE=32 BUILD_OUTPUT_DIR=$WORKSPACE/Build/Emulator32 - if [ -d /lib32 ]; then - export LIB_ARCH_SFX=32 - fi + LIB_NAMES="ld-linux.so.2 crt1.o crti.o crtn.o" + LIB_SEARCH_PATHS="/usr/lib/i386-linux-gnu /usr/lib32 /lib32 /usr/lib /lib" ;; X64) ARCH_SIZE=64 BUILD_OUTPUT_DIR=$WORKSPACE/Build/Emulator - if [ -d /lib64 ]; then - export LIB_ARCH_SFX=64 - fi + LIB_NAMES="ld-linux-x86-64.so.2 crt1.o crti.o crtn.o" + LIB_SEARCH_PATHS="/usr/lib/x86_64-linux-gnu /usr/lib64 /lib64 /usr/lib /lib" ;; esac +for libname in $LIB_NAMES +do + for dirname in $LIB_SEARCH_PATHS + do + if [ -e $dirname/$libname ]; then + export HOST_DLINK_PATHS="$HOST_DLINK_PATHS $dirname/$libname" + break + fi + done +done PLATFORMFILE=$WORKSPACE/EmulatorPkg/EmulatorPkg.dsc BUILD_ROOT_ARCH=$BUILD_OUTPUT_DIR/DEBUG_"$TARGET_TOOLS"/$PROCESSOR |