Adding upstream version 6.02+dfsg.
[syslinux-debian/hramrach.git] / efi / find-gnu-efi.sh
blobbf203d84fb9b149629e5100ae5c9e6bc977802f0
1 #!/bin/sh
3 # Find where the gnu-efi package has been installed as this location
4 # differs across distributions.
6 include_dirs="/usr/include /usr/local/include"
7 lib_dirs="/usr/lib /usr/lib64 /usr/local/lib /usr/lib32"
9 find_include()
11 for d in $include_dirs; do
12 found=`find $d -name efi -type d 2> /dev/null`
13 if [ "$found"x != "x" ] && [ -e $found/$ARCH/efibind.h ]; then
14 echo $found
15 break;
17 done
20 find_lib()
22 for d in $lib_dirs; do
23 found=`find $d -name libgnuefi.a 2> /dev/null`
24 if [ "$found"x != "x" ]; then
25 crt_name='crt0-efi-'$ARCH'.o'
26 crt=`find $d -name $crt_name 2> /dev/null`
27 if [ "$crt"x != "x" ]; then
28 echo $d
29 break;
32 done
35 ARCH=$2
36 case $1 in
37 include)
38 find_include
40 lib)
41 find_lib
43 esac