-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·143 lines (126 loc) · 3.63 KB
/
configure
File metadata and controls
executable file
·143 lines (126 loc) · 3.63 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/sh -x
. `dirname "$0"`/functions
. detect-environment
. compile-options
. version
case "$PROJECT" in
community) NOVA=no ;;
nova) NOVA=yes ;;
*) fatal "Unknown project: $PROJECT" ;;
esac
P=$BUILDPREFIX
ARGS="--prefix=$P --libdir=$P/lib --with-workdir=$P --sysconfdir=/etc --with-openssl=$P --with-pcre2=$P --with-init-script"
if [ $EMBEDDED_DB = lmdb ]
then
var_append ARGS "--with-lmdb=$P"
fi
case "$DEPS" in
*pthreads-w32*) var_append ARGS "--with-pthreads=$P" ;;
esac
case "$DEPS" in
*openldap*) var_append ARGS "--with-ldap=$P" ;;
*) var_append ARGS "--without-ldap" ;;
esac
case "$DEPS" in
*libxml2*) var_append ARGS "--with-libxml2=$P" ;;
*) var_append ARGS "--without-libxml2" ;;
esac
case "$DEPS" in
*libyaml*) var_append ARGS "--with-libyaml=$P" ;;
*) var_append ARGS "--without-libyaml" ;;
esac
case "$DEPS" in
*postgresql*) var_append ARGS "--with-postgresql=$P --without-mysql" ;;
*) var_append ARGS "--without-sql" ;;
esac
case "$DEPS" in
*libacl*) var_append ARGS "--with-libacl=$P" ;;
*) var_append ARGS "--without-libacl" ;;
esac
case "$DEPS" in
*libvirt*) var_append ARGS "--with-libvirt=$P" ;;
*) var_append ARGS "--without-libvirt" ;;
esac
# both libcurl or libcurl-hub are valid
case "$DEPS" in
*libcurl*) var_append ARGS "--with-libcurl=$P" ;;
*) var_append ARGS "--without-libcurl" ;;
esac
case "$ROLE" in
hub) var_append ARGS "--with-cfmod --with-enterprise-api --with-postgresql=$P" ;;
agent) var_append ARGS "--without-cfmod --without-postgresql" ;;
*) fatal "Unknown ROLE: $ROLE" ;;
esac
case "$WITH_SYSTEMD" in
yes) var_append ARGS "--with-systemd-service" ;;
*) var_append ARGS "--without-systemd-service" ;;
esac
# RHEL 8+ requires an SELinux policy and --without-pam to use vendored openssl
if [ "x$OS" = "xrhel" ] && [ "${VER%\.*}" -gt "7" ]; then
var_append ARGS "--with-selinux-policy"
fi
# rhel >= 7 or opensuse >= 15 need --without-pam in order to use vendored openssl
if [ "$OS" = "rhel" ] && expr "$_OS_MAJOR_VERSION" ">=" "8" >/dev/null
then
var_append ARGS "--without-pam"
fi
if [ "$OS" = "opensuse" ] || [ "$OS" = "sles" ]
then
if expr "$_OS_MAJOR_VERSION" ">=" "15"
then
var_append ARGS "--without-pam"
fi
fi
# Cross-compiling Windows?
case "$ARCH-${OS_FAMILY}" in
x86-mingw) var_append ARGS "--host=i686-w64-mingw32" ;;
x64-mingw) var_append ARGS "--host=x86_64-w64-mingw32" ;;
esac
case "$BUILD_TYPE" in
RELEASE)
CFLAGS="-g2 -O2 -DNDEBUG $CFLAGS"
;;
DEBUG)
ARGS="$ARGS --enable-debug"
# Override the default "-g3 -O0" that comes with ./configure --enable-debug
# in order to reduce the size of the packages
CFLAGS="-g2 -O1 $CFLAGS"
;;
CODE_COVERAGE)
ARGS="$ARGS --enable-debug"
# lcov is not found in Windows and other platforms
case "${OS}-${OS_VERSION}" in
mingw*)
;;
hpux*)
;;
solaris*)
;;
rhel-4.*)
;;
aix*)
;;
*)
ARGS="$ARGS --enable-coverage"
;;
esac
;;
*)
echo "Unknown build type: $BUILD_TYPE"
exit 42
;;
esac
if [ "x$OS" = "xsolaris" ]
then
export PKG_CONFIG_PATH="$BUILDPREFIX/lib/pkgconfig"
fi
( cd $BASEDIR/core && env $OPTS CFLAGS="$CFLAGS" ./configure $ARGS )
if [ "x$NOVA" = "xyes" ]
then
( cd $BASEDIR/enterprise && env $OPTS CFLAGS="$CFLAGS" ./configure $ARGS )
if [ "x$ROLE" = "xhub" ]
then
( cd $BASEDIR/nova && env $OPTS CFLAGS="$CFLAGS" ./configure $ARGS )
fi
fi
( cd $BASEDIR/masterfiles && env $OPTS CFLAGS="$CFLAGS" ./configure $ARGS )