forked from jjk-jacky/pam_rundir
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure
executable file
·85 lines (69 loc) · 1.68 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/sh
usage() {
cat <<EOF
usage: ./configure [OPTION...]
Defaults are in brackets.
--prefix=PREFIX Use PREFIX as main prefix [/]
--securedir=DIR Use DIR as path to install to [PREFIX/lib/security]
--with-parentdir=DIR Set DIR as parent directory for runtime dirs [/run/users]
--with-varname=NAME Set NAME as variable name in the environment [XDG_RUNTIME_DIR]
EOF
exit $1
}
prefix=/
securedir=
parentdir=/run/users
varname=XDG_RUNTIME_DIR
cmdline="$0 $@"
while [ $# -ge 1 ]; do
opt=${1%%=*}
val=${1#*=}
case "$opt" in
"--prefix")
prefix="$val"
;;
"--securedir")
securedir="$val"
;;
"--with-parentdir")
parentdir="$val"
;;
"--with-varname")
varname="$val"
;;
"-h"|"--help")
usage 0
;;
*)
echo "invalid option: $opt"
usage 1
;;
esac
shift
done
prefix=${prefix%/}
if [ -z "$securedir" ]; then
securedir="$prefix/lib/security"
fi
exec 4>&1 1>config.mak
cat <<EOF
# This file was generated with: $cmdline
# Do not edit manually.
securedir := $securedir
EOF
exec 1>&4 4<&-
exec 4>&1 1>config.h
cat <<EOF
/* This file was generated with: $cmdline */
/* Do not edit manually. */
/* name of variable to set in environment */
#define VAR_NAME "$varname"
/* parent dir for runtime dirs */
#define PARENT_DIR "$parentdir"
EOF
exec 1>&4 4<&-
cat <<EOF
Parent dir of runtime dirs $parentdir
Variable to set in environment $varname
Install module to: $securedir
EOF