wineprefixcreate: Make path searching relative.

This commit is contained in:
Pierre d'Herbemont 2006-03-11 21:12:11 +01:00 committed by Alexandre Julliard
parent 52645e1144
commit b1be724511
2 changed files with 26 additions and 3 deletions

View File

@ -70,7 +70,7 @@ bin2res$(EXEEXT): bin2res.o
$(CC) $(CFLAGS) -o $@ bin2res.o $(LIBPORT)
wineprefixcreate: wineprefixcreate.in
sed -e 's,@dlldir\@,$(dlldir),g' -e 's,@datadir\@,$(datadir),g' $(SRCDIR)/wineprefixcreate.in >$@ || ($(RM) $@ && false)
sed -e "s,@bintodlldir\@,`$(RELPATH) $(bindir) $(dlldir)`,g" -e "s,@bintodatadir\@,`$(RELPATH) $(bindir) $(datadir)`,g" $(SRCDIR)/wineprefixcreate.in >$@ || ($(RM) $@ && false)
chmod +x wineprefixcreate
install install-lib:: wineprefixcreate

View File

@ -36,8 +36,31 @@ usage()
set -e
dlldir="@dlldir@"
datadir="@datadir@/wine"
bindir=""
case "$0" in
*/*)
# $0 contains a path, use it
bindir=`dirname "$0"`
;;
*)
# no directory in $0, search in PATH
saved_ifs=$IFS
IFS=:
for d in $PATH
do
IFS=$saved_ifs
if [ -x "$d/$0" ]
then
bindir="$d"
break
fi
done
;;
esac
bindir=`cd "$bindir" && pwd`
dlldir="$bindir/@bintodlldir@"
datadir="$bindir/@bintodatadir@"
do_wait=0
quiet=0