]> git.ipfire.org Git - thirdparty/dracut.git/blame - configure
mdraid/mdraid_start.sh: remove mdmon workaround
[thirdparty/dracut.git] / configure
CommitLineData
103281f3
CW
1#!/bin/bash
2# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3# ex: ts=8 sw=4 sts=4 et filetype=sh
4
5# We don't support srcdir != builddir
6echo \#buildapi-variable-no-builddir >/dev/null
7
8prefix=/usr
9
2692a422
CW
10enable_documentation=yes
11
103281f3
CW
12# Little helper function for reading args from the commandline.
13# it automatically handles -a b and -a=b variants, and returns 1 if
14# we need to shift $3.
15read_arg() {
16 # $1 = arg name
17 # $2 = arg value
18 # $3 = arg parameter
19 local rematch='^[^=]*=(.*)$'
20 if [[ $2 =~ $rematch ]]; then
21 read "$1" <<< "${BASH_REMATCH[1]}"
22 else
23 read "$1" <<< "$3"
24 # There is no way to shift our callers args, so
25 # return 1 to indicate they should do it instead.
26 return 1
27 fi
28}
29
30while (($# > 0)); do
31 case "${1%%=*}" in
32 --prefix) read_arg prefix "$@" || shift;;
33 --libdir) read_arg libdir "$@" || shift;;
34 --datadir) read_arg datadir "$@" || shift;;
35 --sysconfdir) read_arg sysconfdir "$@" || shift;;
36 --sbindir) read_arg sbindir "$@" || shift;;
37 --mandir) read_arg mandir "$@" || shift;;
2692a422 38 --disable-documentation) enable_documentation=no;;
103281f3
CW
39 *) echo "Ignoring unknown option '$1'";;
40 esac
41 shift
42done
43
44cat > Makefile.inc.tmp <<EOF
45prefix ?= ${prefix}
46libdir ?= ${libdir:-${prefix}/lib}
47datadir ?= ${datadir:-${prefix}/share}
48sysconfdir ?= ${sysconfdir:-${prefix}/etc}
49sbindir ?= ${sbindir:-${prefix}/sbin}
50mandir ?= ${mandir:-${prefix}/share/man}
2692a422 51enable_documentation ?= ${enable_documentation}
103281f3
CW
52EOF
53mv Makefile.inc.tmp Makefile.inc