3 # We don't support srcdir != builddir
4 echo \
#buildapi-variable-no-builddir >/dev/null
8 enable_documentation
=yes
10 # Little helper function for reading args from the commandline.
11 # it automatically handles -a b and -a=b variants, and returns 1 if
12 # we need to shift $3.
17 local rematch
='^[^=]*=(.*)$'
18 if [[ $2 =~
$rematch ]]; then
19 read "$1" <<< "${BASH_REMATCH[1]}"
22 # There is no way to shift our callers args, so
23 # return 1 to indicate they should do it instead.
31 --prefix) read_arg prefix
"$@" ||
shift;;
32 --libdir) read_arg libdir
"$@" ||
shift;;
33 --datadir) read_arg datadir
"$@" ||
shift;;
34 --sysconfdir) read_arg sysconfdir
"$@" ||
shift;;
35 --sbindir) read_arg sbindir
"$@" ||
shift;;
36 --mandir) read_arg mandir
"$@" ||
shift;;
37 --disable-documentation) enable_documentation
=no
;;
38 --program-prefix) read_arg programprefix
"$@" ||
shift;;
39 --exec-prefix) read_arg execprefix
"$@" ||
shift;;
40 --bindir) read_arg bindir
"$@" ||
shift;;
41 --includedir) read_arg includedir
"$@" ||
shift;;
42 --libexecdir) read_arg libexecdir
"$@" ||
shift;;
43 --localstatedir) read_arg localstatedir
"$@" ||
shift;;
44 --sharedstatedir) read_arg sharedstatedir
"$@" ||
shift;;
45 --infodir) read_arg infodir
"$@" ||
shift;;
46 --systemdsystemunitdir) read_arg systemdsystemunitdir
"$@" ||
shift;;
47 --bashcompletiondir) read_arg bashcompletiondir
"$@" ||
shift;;
48 *) echo "Ignoring unknown option '$1'";;
53 cat > Makefile.inc.$$
<<EOF
55 libdir ?= ${libdir:-${prefix}/lib}
56 datadir ?= ${datadir:-${prefix}/share}
57 sysconfdir ?= ${sysconfdir:-${prefix}/etc}
58 sbindir ?= ${sbindir:-${prefix}/sbin}
59 mandir ?= ${mandir:-${prefix}/share/man}
60 enable_documentation ?= ${enable_documentation:-yes}
61 bindir ?= ${bindir:-${prefix}/bin}
65 [[ $programprefix ]] && echo "programprefix ?= ${programprefix}"
66 [[ $execprefix ]] && echo "execprefix ?= ${execprefix}"
67 [[ $includedir ]] && echo "includedir ?= ${includedir}"
68 [[ $libexecdir ]] && echo "libexecdir ?= ${libexecdir}"
69 [[ $localstatedir ]] && echo "localstatedir ?= ${localstatedir}"
70 [[ $sharedstatedir ]] && echo "sharedstatedir ?= ${sharedstatedir}"
71 [[ $infodir ]] && echo "infodir ?= ${infodir}"
72 [[ $systemdsystemunitdir ]] && echo "systemdsystemunitdir ?= ${systemdsystemunitdir}"
73 [[ $bashcompletiondir ]] && echo "bashcompletiondir ?= ${bashcompletiondir}"
76 mv Makefile.inc.$$ Makefile.inc