-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·75 lines (62 loc) · 2.35 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
#!/bin/sh
#
# You only need to run this script if you want to use 'make install' or
# bake particular values of $CC or similar into the makefile. Otherwise,
# 'make -f Makefile.in' will build a functional libsd-daemon.a and the header
# file in systemd/sd-daemon.h can be used as is.
set -eu
rm -f config.var
prefix=${prefix:-/usr/local}
exec_prefix=${exec_prefix:-'${prefix}'}
includedir=${includedir:-'${prefix}'/include}
libdir=${libdir:-'${exec_prefix}'/lib}
pkgconfigdir=${pkgconfigdir:-'${libdir}'/pkgconfig}
for name in AR ARFLAGS CC CFLAGS DESTDIR GIT INSTALL INSTALL_DATA LDFLAGS; do
eval 'present=${'$name':+yes}'
if [ "$present" ]; then
eval 'value=$'$name
eval 'export '$name; eval $name'=$value'
echo "$name = $value" >> config.var
fi
done
while [ "$#" -gt 0 ]; do case "$1" in
--prefix=*) prefix=${1#--prefix=}; shift;;
--prefix) prefix=$2; shift 2;;
--exec-prefix=*) exec_prefix=${1#--exec-prefix=}; shift;;
--exec-prefix) exec_prefix=$2; shift 2;;
--includedir=*) includedir=${1#--includedir=}; shift;;
--includedir) includedir=$2; shift 2;;
--libdir=*) libdir=${1#--libdir=}; shift;;
--libdir) libdir=$2; shift 2;;
--with-pkgconfigdir=*) pkgconfigdir=${1#--with-pkgconfigdir=}; shift;;
--with-pkgconfigdir) pkgconfigdir=$2; shift 2;;
--build|--host|--srcdir) echo "$0: illegal argument $1 $2" >&2; exit 1;;
--build=*|--host=*|--srcdir=*) echo "$0: illegal argument $1" >&2; exit 1;;
--*=*) echo "$0: ignored $1" >&2; shift;;
--enable-*|--disable-*|--with-*|--without-*) echo "$0: ignored $1" >&2; shift;;
-*) echo "$0: illegal argument $1" >&2; exit 1;;
*=*) name=${1%%=*}; value=${1#*=}
echo "$name = $value" >> config.var
eval 'export '$name; eval $name'=$value'
shift;;
*) echo "$0: illegal argument $1" >&2; exit 1;;
esac; done
if [ -z "${version:=`./describe`}" ]; then
echo "$0: no known version number, assuming 0.0.0" >&2
version=0.0.0
fi
set sed -e 's/^#@//' -e '/^@$/{r config.var' -e d -e '}'
for name in prefix exec_prefix includedir libdir pkgconfigdir version; do
eval 'value=$'$name
eval 'export '$name
case $value in
*' '*|*'&'*|*\\*|*@*)
echo "$0: invalid character in $name=$value" >&2; exit 1;;
esac
set "$@" -e "s @$name@ $value g"
echo "$name = $value" >> config.var
done
set "$@" -e "s/@configure@/This file was generated by configure./" -e s/@@/@/g
for file in Makefile sd-daemon.pc; do
"$@" < "$file.in" > "$file"
done