Allow source location to be overridden

By default the configure script assumes that the source is located
relative to the script itself. By allowing this to be overridden, the
script can be shared by other projects, each passing their own location
as an extra parameter.
This commit is contained in:
Roland Kaufmann 2013-08-14 21:34:29 +02:00
parent e4a345a648
commit dcc972f128

View File

@ -1,6 +1,6 @@
#!/bin/bash
# where is the source tree located
# where is the source tree located by default relative to here
srcdir=$(dirname $(dirname $(dirname "$0")))
# display help text
@ -141,6 +141,11 @@ for OPT in "$@"; do
OPTARG=${OPT#--}
# OPTARG now contains everything after double dashes
case "${OPTARG}" in
src-dir=*)
# allow the user to use these build macros for another
# project (so source-dir is not relative to us)
srcdir=${OPTARG#*=}
;;
prefix=*)
# remove prefix consisting of everything up to equal sign
prefix=${OPTARG#*=}