-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakeKitBuild
244 lines (201 loc) · 5.98 KB
/
MakeKitBuild
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
PROJECT_NAME="platform"
MODULES="core compiler autotools moonunit pkg-config likewise dceidl fortune"
LW_ALL_BUNDLED="krb5 cyrus-sasl openldap libiconv popt \
libuuid sqlite openssl curl libxml2"
SUBDIRS="$LW_ALL_BUNDLED \
lwbase lwmsg lwreg lwadvapi netlogon \
lwio libschannel dcerpc centutils lwsm eventlog lsass lwdns \
lwnetapi domainjoin lwconfig lwupgrade config \
package"
defaults()
{
MK_PREFIX="/opt/likewise"
MK_SYSCONFDIR="/etc/likewise"
MK_LOCALSTATEDIR="/var"
MK_DATADIR="/opt/likewise/share"
MK_DOCDIR="/opt/likewise/share/doc"
MK_MANDIR="/usr/share/man"
if [ "`uname`" = "Darwin" ]
then
MK_LOCALSTATEDIR="/private/var"
MK_SYSCONFDIR="/private/etc/likewise"
fi
# Fail on warnings
MK_FAIL_ON_WARN=yes
}
option()
{
case "${MK_HOST_OS}-${LW_FEATURE_LEVEL}" in
*-auth)
default_bundled="libuuid krb5 cyrus-sasl openldap sqlite openssl popt"
;;
linux-*)
default_bundled="libuuid krb5 cyrus-sasl openldap sqlite openssl curl libxml2 popt"
;;
*)
default_bundled="libiconv libuuid krb5 cyrus-sasl openldap sqlite openssl curl libxml2 popt"
;;
esac
mk_option \
OPTION=samba-interop \
PARAM="yes|no" \
VAR="LW_SAMBA_INTEROP" \
DEFAULT="yes" \
HELP="Build samba interop libraries"
mk_option \
OPTION=lw-bundled-libs \
PARAM='...' \
VAR=LW_BUNDLED \
DEFAULT="$default_bundled" \
HELP="Use bundled libraries"
_LW_BUNDLED="$LW_BUNDLED"
unset LW_BUNDLED
for i in ${_LW_BUNDLED}
do
case "$i" in
+*)
[ -z "$LW_BUNDLED" ] && LW_BUNDLED="$default_bundled"
LW_BUNDLED="${LW_BUNDLED:+$LW_BUNDLED }${i#+}"
;;
-*)
[ -z "$LW_BUNDLED" ] && LW_BUNDLED="$default_bundled"
lw_filter_bundled "${i#-}"
;;
*)
LW_BUNDLED="${LW_BUNDLED:+$LW_BUNDLED }${i}"
;;
esac
done
mk_option \
OPTION="build-revision" \
PARAM="rev" \
VAR="LW_BUILD_REVISION" \
DEFAULT="" \
HELP="Official build revision"
mk_option \
OPTION="build-id" \
PARAM="id" \
VAR="LW_BUILD_ID" \
DEFAULT="" \
HELP="Official build id"
}
configure()
{
LW_VENDOR="likewise"
LW_PRODUCT="platform"
LW_VERSION="6.1.${LW_BUILD_ID:-0}"
mk_msg "configuring $LW_VENDOR $LW_PRODUCT $LW_VERSION"
mk_msg "using bundled libraries: $LW_BUNDLED"
for comp in ${LW_ALL_BUNDLED}
do
lw_use_bundled "$comp" || mk_skip_subdir "$comp"
done
[ "$LW_SAMBA_INTEROP" = "yes" ] || mk_skip_subdir "samba-interop"
case "$LW_FEATURE_LEVEL" in
auth)
mk_skip_subdir libschannel
mk_skip_subdir srvsvc
mk_skip_subdir lwnetapi
mk_skip_subdir lwtools
mk_skip_subdir nfs
;;
esac
case "$LW_DEVICE_PROFILE" in
embedded)
mk_skip_subdir eventlog
mk_skip_subdir domainjoin
mk_skip_subdir centutils
mk_skip_subdir lwconfig
mk_skip_subdir lwupgrade
;;
esac
}
make()
{
bundled_targets=""
for comp in ${LW_ALL_BUNDLED}
do
lw_use_bundled "$comp" && bundled_targets="$bundled_targets @$comp"
done
mk_target \
TARGET="@bundled" \
DEPS="$bundled_targets @lwreg/libedit @dcerpc/flex-2.5.4"
mk_add_phony_target "$result"
case "$MK_HOST_OS:$MK_HOST_ARCH" in
hpux:ia64|solaris:x86)
# Add target to build everything without attempting to
# unpack staging archive from other build machine
_local_targets=""
mk_unquote_list "$SUBDIRS"
for subdir
do
[ "$subdir" != "package" -a "$subdir" != "installer" ] &&
_local_targets="$_local_targets @$subdir"
done
mk_target \
TARGET="@all-local" \
DEPS="$_local_targets"
mk_add_phony_target "$result"
;;
solaris:x86_64)
# Add target to build only compat bits
mk_target \
TARGET="@compat" \
DEPS="/usr/lib/64/nss_lsass.la /usr/lib/security/64/pam_lsass.la"
mk_add_phony_target "$result"
;;
esac
lw_print_features
}
lw_filter_bundled()
{
__needle="$1"
set -- ${LW_BUNDLED}
unset LW_BUNDLED
for i
do
if [ "$i" != "$__needle" ]
then
LW_BUNDLED="${LW_BUNDLED:+$LW_BUNDLED }${i}"
fi
done
}
lw_use_bundled()
{
for _dep in ${LW_BUNDLED}
do
[ "$_dep" = "$1" ] && return 0
done
return 1
}
lw_print_feature()
{
printf "%-30s%s\n" "$1:" "$2"
}
lw_print_features()
{
printf -- "\n---\nConfiguration summary\n---\n\n"
set -- ${MK_HOST_ISAS}
if [ "$#" -gt 1 -a "$MK_HOST_MULTIARCH" != "none" ]
then
lw_print_feature "Host system" "$MK_HOST_OS ($MK_HOST_MULTIARCH $MK_HOST_ISAS)"
else
lw_print_feature "Host system" "$MK_HOST_OS ($MK_HOST_ISAS)"
fi
lw_print_feature "Device profile" "$LW_DEVICE_PROFILE"
lw_print_feature "Feature level" "$LW_FEATURE_LEVEL"
lw_print_feature "Bundled libraries" "$LW_BUNDLED"
lw_print_feature "Threadpool backend" "$LWBASE_THREADPOOL_BACKEND"
if [ "$LW_FEATURE_LEVEL" != "auth" ]
then
lw_print_feature "FUSE support" "$LWIO_FUSE_ENABLED"
lw_print_feature "EA support" "$LWIO_EA_ENABLED"
lw_print_feature "Domain join GUI" "$DJ_GUI_INTERFACE"
fi
lw_print_feature "Samba interoperability" "$LW_SAMBA_INTEROP"
types=""
mk_rpm_enabled && types="$types rpm"
mk_deb_enabled && types="$types deb"
[ -z "$types" ] && types="none"
lw_print_feature "Package types" "${types# }"
}