-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure
executable file
·98 lines (86 loc) · 1.92 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
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/sh
#
# display help screeen
#
help() {
cat << END
Usage: configure [options]
--prefix=DIR set arch independent install prefix to DIR [$prefix]
--exec-prefix=DIR set arch dependent install prefix to DIR [\$prefix]
--bindir=DIR install executables in DIR [\$exec_prefix/bin]
--mandir=DIR install man pages in DIR [\$prefix/man]
END
}
#
# defaults
#
prefix=/usr/local # where to install sndiokeys
unset vars # variables passed as arguments
unset exec_prefix # prefix for arch. independent files
unset bindir # path where to install binaries
unset mandir # path where to install man pages
sndio_inc=`pkg-config --cflags sndio` # extra -I for X11
sndio_lib=`pkg-config --libs sndio` # extra -L and -l for X11
x11_inc=`pkg-config --cflags x11` # extra -I for X11
x11_lib=`pkg-config --libs x11` # extra -L and -l for X11
#
# guess OS-specific parameters
#
case `uname` in
Linux)
ldadd="-lrt -lbsd"
;;
esac
# shell word separator (none)
IFS=''
# sed-quoted new-line
nl='\
'
for i; do
case "$i" in
--prefix=*)
prefix="${i#--prefix=}"
shift;;
--exec-prefix=*)
exec_prefix="${i#--exec-prefix=}"
shift;;
--bindir=*)
bindir="${i#--bindir=}"
shift;;
--mandir=*)
mandir="${i#--mandir=}"
shift;;
CC=*|CFLAGS=*|LDFLAGS=*)
vars="$vars$i$nl"
shift;;
*)
help
exit 1
;;
esac
done
#
# if $xxxdir is not specified, define it to $prefix/xxx
#
exec_prefix="${exec_prefix:-$prefix}"
bindir="${bindir:-$exec_prefix/bin}"
mandir="${mandir:-$prefix/man}"
for f in Makefile
do
sed \
-e "s:@bindir@:$bindir:" \
-e "s:@mandir@:$mandir:" \
-e "s:@defs@:$defs:" \
-e "s:@ldadd@:$ldadd:" \
-e "s:@vars@:${vars}:" \
-e "s:@sndio_inc@:${sndio_inc}:" \
-e "s:@sndio_lib@:${sndio_lib}:" \
-e "s:@x11_inc@:${x11_inc}:" \
-e "s:@x11_lib@:${x11_lib}:" \
< $f.in > $f
done
cat <<EOF
bindir................... $bindir
mandir................... $mandir
Do "make && make install" to compile and install sndiokeys
EOF