config now allows for custom installation paths (for easier packaging)

git-svn-id: svn://svn.code.sf.net/p/qjoypad/code/trunk@98 c05e91a0-76c8-4ec0-b377-ef19ce7cc080
This commit is contained in:
John Toman
2009-08-08 20:33:49 +00:00
committed by virtuoussin13
parent 78eb5aafb3
commit a23ba507aa
3 changed files with 22 additions and 602 deletions

View File

@@ -3,6 +3,7 @@
devdir="/dev/input"
prefix="/usr/local"
installdir="";
plain_keys=""
for arg in $*
@@ -24,8 +25,10 @@ Options:
filtering them for appearance. This will make displays
less attractive and readable, but will save processor power
and ensure that you see the right names for keys you press.
--help Show this message.
--install-dir=DIR Sets an optional installation path that will be prepended
to prefix during installation.
--help Show this message.
"; exit 0;;
--devdir=*) devdir=${arg##*=}
if [[ ! -d $devdir ]]
@@ -34,11 +37,17 @@ Options:
exit 1
fi ;;
--prefix=*) prefix=${arg##*=}
if [[ ! -d $prefix ]]
if [[ ! -d $prefix ]]
then
echo "Invalid prefix directory given: $prefix"
exit 1
fi ;;
fi;;
--install-dir=*) installdir=${arg##*=}
if [[ ! -d $installdir ]]
then
echo "invalid destination directory given: $installdir";
exit 1
fi;;
--plain_keys) plain_keys="PLAIN_KEYS";;
*) echo "Unrecognized argument: \"$arg\". Try ./config --help for help."
esac
@@ -47,8 +56,10 @@ done
arg1="DEVDIR=$devdir"
arg2="PREFIX=$prefix"
arg3="DEFINES += $plain_keys"
arg4="DESTDIR=${installdir}/${prefix}/bin"
arg5="INSTALL=$installdir"
qmake -makefile "$arg1" "$arg2" "$arg3" qjoypad.pro
qmake -makefile "$arg1" "$arg2" "$arg3" "$arg4" "$arg5" qjoypad.pro
echo "
Configuring QJoyPad installation...