Skip to content
Browse files

install.sh: Allow running from outside the extracted FB directory

  • Loading branch information...
1 parent 02feb61 commit 6fde2a6cec01ee7520fbb24233a666f4d5675b7b @dkl dkl committed Mar 19, 2013
Showing with 9 additions and 4 deletions.
  1. +9 −4 install.sh
View
13 install.sh
@@ -31,17 +31,22 @@ fi
case "$1" in
"-i")
+ dir="`dirname '$0'`/"
+ if [ "$dir" = "/" ]; then
+ dir=""
+ fi
+
mkdir -p -m 0755 "$prefix/bin"
- install bin/fbc "$prefix/bin"
+ install "${dir}"bin/fbc "$prefix/bin"
mkdir -p -m 0755 "$prefix/include/freebasic"
- cp -r include/freebasic/* "$prefix/include/freebasic"
+ cp -r "${dir}"include/freebasic/* "$prefix/include/freebasic"
mkdir -p -m 0755 "$prefix/lib/freebasic"
- cp -r lib/freebasic/* "$prefix/lib/freebasic"
+ cp -r "${dir}"lib/freebasic/ "$prefix/lib/freebasic"
mkdir -p -m 0755 "$prefix/man/man1"
- gzip -c doc/fbc.1 > "$prefix/man/man1/fbc.1.gz"
+ gzip -c "${dir}"doc/fbc.1 > "$prefix/man/man1/fbc.1.gz"
echo "FreeBASIC compiler successfully installed in $prefix"
;;

0 comments on commit 6fde2a6

Please sign in to comment.
Something went wrong with that request. Please try again.