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
This commit is contained in:
jljusten
2011-10-31 15:56:28 +00:00
parent ca3ba72cba
commit d142bb6337
2 changed files with 19 additions and 9 deletions

View File

@@ -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