1 | #!/bin/sh
|
---|
2 | # The purpose of this script is to check for all external tools, headers, and
|
---|
3 | # libraries VBox OSE depends on.
|
---|
4 |
|
---|
5 | #
|
---|
6 | # Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
7 | #
|
---|
8 | # This file is part of VirtualBox base platform packages, as
|
---|
9 | # available from https://www.virtualbox.org.
|
---|
10 | #
|
---|
11 | # This program is free software; you can redistribute it and/or
|
---|
12 | # modify it under the terms of the GNU General Public License
|
---|
13 | # as published by the Free Software Foundation, in version 3 of the
|
---|
14 | # License.
|
---|
15 | #
|
---|
16 | # This program is distributed in the hope that it will be useful, but
|
---|
17 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
19 | # General Public License for more details.
|
---|
20 | #
|
---|
21 | # You should have received a copy of the GNU General Public License
|
---|
22 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
23 | #
|
---|
24 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
25 | #
|
---|
26 |
|
---|
27 | LC_ALL=C
|
---|
28 | export LC_ALL
|
---|
29 |
|
---|
30 | # append some extra paths
|
---|
31 | PATH="$PATH:/opt/gnome/bin"
|
---|
32 | # Solaris (order of paths important for tr, grep, sed to work)
|
---|
33 | PATH="/usr/xpg4/bin:$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin"
|
---|
34 | ORGPATH=$PATH
|
---|
35 |
|
---|
36 | # Wrapper for ancient /usr/bin/which on darwin that always returns 0
|
---|
37 | which_wrapper()
|
---|
38 | {
|
---|
39 | if [ -z "$have_ancient_which" ]; then
|
---|
40 | if which /bin/___cErTaINly_a_nOn_eXisTing_fIle___ 2> /dev/null > /dev/null; then
|
---|
41 | have_ancient_which="yes"
|
---|
42 | else
|
---|
43 | have_ancient_which="no"
|
---|
44 | fi
|
---|
45 | fi
|
---|
46 | if [ "$have_ancient_which" = "yes" ]; then
|
---|
47 | retval=`which $* 2>/dev/null`
|
---|
48 | echo "$retval"
|
---|
49 | test -n "$retval" -a -x "$retval"
|
---|
50 | unset retval
|
---|
51 | else
|
---|
52 | which $* 2> /dev/null
|
---|
53 | fi
|
---|
54 | }
|
---|
55 |
|
---|
56 | OS=`uname -s | sed -e 's/GNU\/Linux/Linux/g' | tr '[:upper:]' '[:lower:]'`
|
---|
57 | case "$OS" in
|
---|
58 | linux)
|
---|
59 | ;;
|
---|
60 | darwin)
|
---|
61 | ;;
|
---|
62 | freebsd)
|
---|
63 | ;;
|
---|
64 | netbsd)
|
---|
65 | ;;
|
---|
66 | sunos)
|
---|
67 | OS='solaris'
|
---|
68 | ;;
|
---|
69 | haiku)
|
---|
70 | ;;
|
---|
71 | *)
|
---|
72 | echo "Cannot determine OS!"
|
---|
73 | exit 1
|
---|
74 | ;;
|
---|
75 | esac
|
---|
76 |
|
---|
77 | #
|
---|
78 | # Defaults
|
---|
79 | #
|
---|
80 | OSE=1
|
---|
81 | ODIR="`pwd`/"
|
---|
82 | ODIR_OVERRIDE=0
|
---|
83 | OUT_BASE_PATH=""
|
---|
84 | OUT_BASE_PATH_OVERRIDE=0
|
---|
85 | SETUP_WINE=
|
---|
86 | ONLY_ADDITIONS=0
|
---|
87 | TARGET_MACHINE=""
|
---|
88 | TARGET_CPU=""
|
---|
89 | WITH_XPCOM=1
|
---|
90 | WITH_PYTHON=1
|
---|
91 | WITH_JAVA=1
|
---|
92 | WITH_VMMRAW=1
|
---|
93 | WITH_LIBIDL=1
|
---|
94 | WITH_QT5=1
|
---|
95 | WITH_SDL=1
|
---|
96 | WITH_SDL_TTF=1
|
---|
97 | WITH_X11=1
|
---|
98 | WITH_ALSA=1
|
---|
99 | WITH_PULSE=1
|
---|
100 | WITH_DBUS=1
|
---|
101 | WITH_DEVMAPPER=1
|
---|
102 | WITH_KMODS=1
|
---|
103 | WITH_OPENGL=1
|
---|
104 | WITH_HARDENING=1
|
---|
105 | WITH_UDPTUNNEL=1
|
---|
106 | WITH_VDE=0
|
---|
107 | WITH_VNC=0
|
---|
108 | WITH_EXTPACK=1
|
---|
109 | WITH_DOCS=1
|
---|
110 | WITH_LIBVPX=1
|
---|
111 | WITH_LIBOGG=0
|
---|
112 | WITH_LIBVORBIS=0
|
---|
113 | WITH_LIBTPMS=1
|
---|
114 | WITH_LIBLZMA=1
|
---|
115 | BUILD_LIBXML2=
|
---|
116 | BUILD_LIBCURL=
|
---|
117 | BUILD_LIBSSL=
|
---|
118 | BUILD_LIBVPX=
|
---|
119 | BUILD_LIBTPMS=
|
---|
120 | if [ "$OS" = "darwin" ]; then # Do not use the /opt/local version of this! We end up using the wrong iconv.h then.
|
---|
121 | BUILD_LIBLZMA=1
|
---|
122 | else
|
---|
123 | BUILD_LIBLZMA=
|
---|
124 | fi
|
---|
125 | PASSIVE_MESA=0
|
---|
126 | CC="gcc"
|
---|
127 | CC32=""
|
---|
128 | CC64=""
|
---|
129 | CXX="g++"
|
---|
130 | CXX32=""
|
---|
131 | CXX64=""
|
---|
132 | YASM="yasm"
|
---|
133 | IASL="iasl"
|
---|
134 | XSLTPROC="xsltproc"
|
---|
135 | INCCRYPTO=""
|
---|
136 | LIBCRYPTO="-lssl -lcrypto"
|
---|
137 | LIBPTHREAD="-lpthread"
|
---|
138 | LIBCAP="-lcap"
|
---|
139 | GSOAP=""
|
---|
140 | GSOAP_IMPORT=""
|
---|
141 | INCX11="/usr/local/include"
|
---|
142 | LIBX11="-L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib -lXext -lX11"
|
---|
143 | LIBXCURSOR="-lXcursor"
|
---|
144 | LIBXMU="-lXmu"
|
---|
145 | LIBXINERAMA="-lXinerama"
|
---|
146 | LIBXRANDR="-lXrandr"
|
---|
147 | MAKESELF="makeself"
|
---|
148 | MESA="-lGL"
|
---|
149 | INCZ=""
|
---|
150 | LIBZ="-lz"
|
---|
151 | INCLZF="/usr/include/liblzf"
|
---|
152 | LIBLZF="-llzf"
|
---|
153 | INCVNCSERVER=""
|
---|
154 | LIBVNCSERVER="-lvncserver"
|
---|
155 | INCDEVMAPPER=""
|
---|
156 | LIBDEVMAPPER="-ldevmapper"
|
---|
157 | CXX_FLAGS=""
|
---|
158 | if [ "$OS" = "freebsd" ]; then
|
---|
159 | INCCURL="-I/usr/local/include"
|
---|
160 | LIBCURL="-L/usr/local/lib -lcurl"
|
---|
161 | INCPULSE="-I/usr/local/include"
|
---|
162 | LIBPULSE="-L/usr/local/lib"
|
---|
163 | INCPNG="-I/usr/local/include"
|
---|
164 | LIBPNG="-L/usr/local/lib -lpng"
|
---|
165 | else
|
---|
166 | INCCURL=""
|
---|
167 | LIBCURL="-lcurl"
|
---|
168 | INCPNG=""
|
---|
169 | LIBPNG="-lpng"
|
---|
170 | fi
|
---|
171 | INCVPX=""
|
---|
172 | LIBVPX="-lvpx"
|
---|
173 | PKGCONFIG="`which_wrapper pkg-config`"
|
---|
174 | PYTHONDIR="/usr /usr/local"
|
---|
175 | QT5DIR="/usr/lib/qt5 /usr/share/qt5 /usr/lib64/qt5 /usr /usr/local"
|
---|
176 | QT5DIR_PKGCONFIG=1
|
---|
177 | QT5MAJ=5
|
---|
178 | QT5MIN=9
|
---|
179 | KBUILDDIR="`cd \`dirname $0\`; pwd`/kBuild"
|
---|
180 | DEVDIR="`cd \`dirname $0\`; pwd`/tools"
|
---|
181 | if [ -d "/lib/modules/`uname -r`/build" ]; then
|
---|
182 | LINUX="/lib/modules/`uname -r`/build"
|
---|
183 | elif [ "`echo /lib/modules/*`" != "/lib/modules/*" ]; then
|
---|
184 | # Get the most recent kernel headers if none match the current kernel.
|
---|
185 | for i in /lib/modules/*; do
|
---|
186 | if [ -r "$i/build" ]; then
|
---|
187 | LINUX="$i/build"
|
---|
188 | fi
|
---|
189 | done
|
---|
190 | fi
|
---|
191 | if [ -z "$LINUX" ]; then
|
---|
192 | LINUX="/usr/src/linux"
|
---|
193 | fi
|
---|
194 | KCHMVIEWER="kchmviewer"
|
---|
195 | LOG="configure.log"
|
---|
196 | CNF="AutoConfig.kmk"
|
---|
197 | ENV="env.sh"
|
---|
198 | BUILD_TYPE="release"
|
---|
199 | # the restricting tool is ar (mri mode).
|
---|
200 | INVALID_CHARS="[^A-Za-z0-9/\\$:._-]"
|
---|
201 |
|
---|
202 | if (cd `dirname $0`; pwd)|grep -q "$INVALID_CHARS"; then
|
---|
203 | echo "Error: VBox base path contains invalid characters!"
|
---|
204 | exit 1
|
---|
205 | fi
|
---|
206 |
|
---|
207 | # Posix /bin/sh isn't supporting echo -n. Use printf instead.
|
---|
208 | ECHO_N="printf"
|
---|
209 |
|
---|
210 |
|
---|
211 | cleanup()
|
---|
212 | {
|
---|
213 | rm -f $ODIR.tmp_src.cc $ODIR.tmp_src.c $ODIR.tmp_out $ODIR.test_execute.log
|
---|
214 | [ "$OS" = "darwin" ] && rm -rf $ODIR.tmp_out.dSYM
|
---|
215 | true
|
---|
216 | }
|
---|
217 |
|
---|
218 | fail()
|
---|
219 | {
|
---|
220 | if [ -z "$nofatal" -o "x$1" != "x" ]; then
|
---|
221 | cleanup
|
---|
222 | rm -f $ENV
|
---|
223 | echo "Check $LOG for details"
|
---|
224 | exit 1
|
---|
225 | fi
|
---|
226 | }
|
---|
227 |
|
---|
228 | log()
|
---|
229 | {
|
---|
230 | echo "$1"
|
---|
231 | echo "$1" >> $LOG
|
---|
232 | }
|
---|
233 |
|
---|
234 | log_success()
|
---|
235 | {
|
---|
236 | if [ -n "$1" ]; then $ECHO_N "$1, "; fi
|
---|
237 | echo "OK."
|
---|
238 | echo "$1" >> $LOG
|
---|
239 | echo >> $LOG
|
---|
240 | echo >> $LOG
|
---|
241 | }
|
---|
242 |
|
---|
243 | log_failure()
|
---|
244 | {
|
---|
245 | echo
|
---|
246 | echo " ** $1!"
|
---|
247 | echo "** $1!" >> $LOG
|
---|
248 | echo >> $LOG
|
---|
249 | }
|
---|
250 |
|
---|
251 | cnf_append()
|
---|
252 | {
|
---|
253 | printf "%-30s := %s\n" "$1" "$2" >> $CNF
|
---|
254 | }
|
---|
255 |
|
---|
256 | strip_l()
|
---|
257 | {
|
---|
258 | echo "$1"|$KBUILD_SED 's|-l\([^ ]\+\)|\1|g; s|^-[^l][^ ]*||g; s| -[^l][^ ]*||g; s|^ ||; s| *$||g'
|
---|
259 | }
|
---|
260 |
|
---|
261 | strip_L()
|
---|
262 | {
|
---|
263 | if [ "$OS" = "darwin" ]; then
|
---|
264 | echo "$1"|$KBUILD_SED 's|-F\([^ ]\+\)|\1|g; s|^-[^F][^ ]*||g; s| -[^F][^ ]*||g; s|^ ||; s| *$||g'
|
---|
265 | else
|
---|
266 | echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|^-[^L][^ ]*||g; s| -[^L][^ ]*||g; s|^ ||; s| *$||g'
|
---|
267 | fi
|
---|
268 | }
|
---|
269 |
|
---|
270 | L_to_PATH()
|
---|
271 | {
|
---|
272 | echo $1 >> $LOG
|
---|
273 | if [ "$OS" = "darwin" ]; then
|
---|
274 | echo "$1"|$KBUILD_SED 's|-F\([^ ]\+\)|\1|g; s|^-[^F][^ ]*||g; s| -[^F][^ ]*||g; s|^ ||; s| *$||g; s| |:|g'
|
---|
275 | else
|
---|
276 | echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|^-[^L][^ ]*||g; s| -[^L][^ ]*||g; s|^ ||; s| *$||g; s| |:|g'
|
---|
277 | fi
|
---|
278 | }
|
---|
279 |
|
---|
280 | strip_I()
|
---|
281 | {
|
---|
282 | echo "$1"|$KBUILD_SED 's|-I\([^ ]\+\)|\1|g; s|^-[^I][^ ]*||g; s| -[^I][^ ]*||g; s|^ ||; s| *$||g'
|
---|
283 | }
|
---|
284 |
|
---|
285 | prefix_I()
|
---|
286 | {
|
---|
287 | echo "$1"|$KBUILD_SED 's|^\/|-I/|g; s| \/| -I/|g'
|
---|
288 | }
|
---|
289 |
|
---|
290 | check_avail()
|
---|
291 | {
|
---|
292 | if [ -z "$1" ]; then
|
---|
293 | log_failure "$2 is empty"
|
---|
294 | fail $3
|
---|
295 | return 1
|
---|
296 | elif which_wrapper $1 > /dev/null; then
|
---|
297 | return 0
|
---|
298 | else
|
---|
299 | log_failure "$1 (variable $2) not found"
|
---|
300 | fail $3
|
---|
301 | return 1
|
---|
302 | fi
|
---|
303 | }
|
---|
304 |
|
---|
305 |
|
---|
306 | # Prepare a test
|
---|
307 | test_header()
|
---|
308 | {
|
---|
309 | echo "***** Checking $1 *****" >> $LOG
|
---|
310 | $ECHO_N "Checking for $1: "
|
---|
311 | }
|
---|
312 |
|
---|
313 |
|
---|
314 | # Compile a test
|
---|
315 | # $1 compile flags/libs
|
---|
316 | # $2 library name
|
---|
317 | # $3 package name
|
---|
318 | # $4 if this argument is 'nofatal', don't abort
|
---|
319 | test_compile()
|
---|
320 | {
|
---|
321 | echo "compiling the following source file:" >> $LOG
|
---|
322 | cat $ODIR.tmp_src.cc >> $LOG
|
---|
323 | echo "using the following command line:" >> $LOG
|
---|
324 | echo "$CXX $CXX_FLAGS -fPIC -g -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc $1" >> $LOG
|
---|
325 | $CXX $CXX_FLAGS -fPIC -g -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc $1 >> $LOG 2>&1
|
---|
326 | if [ $? -ne 0 ]; then
|
---|
327 | if [ -z "$4" ]; then
|
---|
328 | echo
|
---|
329 | echo " $2 not found at $1 or $3 headers not found"
|
---|
330 | echo " Check the file $LOG for detailed error information."
|
---|
331 | fail
|
---|
332 | else
|
---|
333 | echo >> $LOG
|
---|
334 | echo >> $LOG
|
---|
335 | fi
|
---|
336 | return 1
|
---|
337 | fi
|
---|
338 | return 0
|
---|
339 | }
|
---|
340 |
|
---|
341 |
|
---|
342 | # Execute a compiled test binary
|
---|
343 | test_execute()
|
---|
344 | {
|
---|
345 | echo "executing the binary" >> $LOG
|
---|
346 | $ODIR.tmp_out > $ODIR.test_execute.log 2>&1
|
---|
347 | rc=$?
|
---|
348 | cat $ODIR.test_execute.log | tee -a $LOG
|
---|
349 | if [ $rc -ne 0 ]; then
|
---|
350 | fail $1
|
---|
351 | return 1
|
---|
352 | fi
|
---|
353 | echo >> $LOG
|
---|
354 | echo >> $LOG
|
---|
355 | return 0
|
---|
356 | }
|
---|
357 |
|
---|
358 |
|
---|
359 | # Execute a compiled test binary
|
---|
360 | test_execute_path()
|
---|
361 | {
|
---|
362 | ## LD_LIBRARY_PATH to set.
|
---|
363 | local_path="${1}"
|
---|
364 | ## Set this to non-empty to make this test non-fatal.
|
---|
365 | local_nofail="${2}"
|
---|
366 | echo "executing the binary (LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH)" >> $LOG
|
---|
367 | LD_LIBRARY_PATH="${local_path}:$LD_LIBRARY_PATH" $ODIR.tmp_out > $ODIR.test_execute.log 2>&1
|
---|
368 | rc=$?
|
---|
369 | cat $ODIR.test_execute.log | tee -a $LOG
|
---|
370 | if [ $rc -ne 0 ]; then
|
---|
371 | test -z "${local_nofail}" && fail
|
---|
372 | echo >> $LOG
|
---|
373 | echo >> $LOG
|
---|
374 | return 1
|
---|
375 | fi
|
---|
376 | echo >> $LOG
|
---|
377 | echo >> $LOG
|
---|
378 | return 0
|
---|
379 | }
|
---|
380 |
|
---|
381 |
|
---|
382 | #
|
---|
383 | # Check for OS, MACHINE, CPU
|
---|
384 | #
|
---|
385 | check_environment()
|
---|
386 | {
|
---|
387 | test_header environment
|
---|
388 | BUILD_CPU=`uname -m`
|
---|
389 | [ "$OS" = "solaris" ] && BUILD_CPU=`isainfo | cut -f 1 -d ' '`
|
---|
390 | case "$BUILD_CPU" in
|
---|
391 | i[3456789]86|x86|i86pc|BePC)
|
---|
392 | BUILD_MACHINE='x86'
|
---|
393 | LIB='lib'
|
---|
394 | ;;
|
---|
395 | x86_64|amd64)
|
---|
396 | BUILD_MACHINE='amd64'
|
---|
397 | BUILD_CPU='blend'
|
---|
398 | if [ "$OS" != "solaris" ]; then
|
---|
399 | # on AMD64 systems, 64bit libs are usually located in /usr/lib64
|
---|
400 | # see http://www.pathname.com/fhs/pub/fhs-2.3.html#LIB64
|
---|
401 | LIB='lib64'
|
---|
402 | else
|
---|
403 | # Solaris doesn't seem to subscribe to fhs, libs are usually in
|
---|
404 | # a '64' subdirectory of the standard 'lib' dirs while some 64-bit
|
---|
405 | # alternative binaries can be found in 'amd64' subdirs of the 'bin'
|
---|
406 | # ones. So, in order to find the right stuff (esp. sdl-config) we'll
|
---|
407 | # have to make sure the */bin/amd64 dirs are searched before the */bin
|
---|
408 | # ones. (The sed has some sideeffects, but they shouldn't harm us...)
|
---|
409 | echo "64-bit Solaris detected, hacking the PATH" >> $LOG
|
---|
410 | echo "old PATH: $PATH" >> $LOG
|
---|
411 | PATH=`echo ":$PATH:" | sed -e 's,\(:[^:]*/bin\):,\1/amd64:\1:,g' \
|
---|
412 | -e 's/^:*//' -e 's/:*$//g' -e 's/::*/:/g' `
|
---|
413 | export PATH
|
---|
414 | echo "new PATH: $PATH" >> $LOG
|
---|
415 | LIB='lib/64'
|
---|
416 | fi
|
---|
417 | ;;
|
---|
418 | sparc64|sparcv9)
|
---|
419 | BUILD_MACHINE='sparc64'
|
---|
420 | BUILD_CPU='blend'
|
---|
421 | ;;
|
---|
422 | sparc32|sparc|sparcv8|sparcv7|sparcv8e)
|
---|
423 | BUILD_MACHINE='sparc32'
|
---|
424 | BUILD_CPU='blend'
|
---|
425 | ;;
|
---|
426 | *)
|
---|
427 | log_failure "Cannot determine system"
|
---|
428 | exit 1
|
---|
429 | ;;
|
---|
430 | esac
|
---|
431 | [ -z "$TARGET_MACHINE" ] && TARGET_MACHINE=$BUILD_MACHINE
|
---|
432 | [ -z "$TARGET_CPU" ] && TARGET_CPU=$BUILD_CPU
|
---|
433 | DEVDIR_BIN="$DEVDIR/$OS.$BUILD_MACHINE/bin"
|
---|
434 | log_success "Determined build machine: $OS.$BUILD_MACHINE, target machine: $OS.$TARGET_MACHINE"
|
---|
435 |
|
---|
436 | echo "KBUILD_HOST=\"$OS\"" >> $ENV
|
---|
437 | echo "KBUILD_HOST_ARCH=\"$BUILD_MACHINE\"" >> $ENV
|
---|
438 | echo "KBUILD_TARGET=\"$OS\"" >> $ENV
|
---|
439 | echo "KBUILD_TARGET_ARCH=\"$TARGET_MACHINE\"" >> $ENV
|
---|
440 | echo "KBUILD_TARGET_CPU=\"$TARGET_CPU\"" >> $ENV
|
---|
441 | echo "KBUILD_TYPE=\"$BUILD_TYPE\"" >> $ENV
|
---|
442 | echo 'export KBUILD_HOST KBUILD_HOST_ARCH KBUILD_TARGET KBUILD_TARGET_ARCH KBUILD_TARGET_CPU KBUILD_TYPE' >> $ENV
|
---|
443 |
|
---|
444 | # obsolete legacy stuff:
|
---|
445 | echo '' >> $ENV
|
---|
446 | echo "# Legacy - do not use:" >> $ENV
|
---|
447 | echo 'BUILD_PLATFORM="$KBUILD_HOST"' >> $ENV
|
---|
448 | echo 'BUILD_PLATFORM_ARCH="$KBUILD_HOST_ARCH"' >> $ENV
|
---|
449 | echo 'BUILD_TARGET="$KBUILD_TARGET"' >> $ENV
|
---|
450 | echo 'BUILD_TARGET_ARCH="$KBUILD_TARGET_ARCH"' >> $ENV
|
---|
451 | echo 'BUILD_TARGET_CPU="$KBUILD_TARGET_CPU"' >> $ENV
|
---|
452 | echo 'BUILD_TYPE="$KBUILD_TYPE"' >> $ENV
|
---|
453 | echo 'export BUILD_PLATFORM BUILD_PLATFORM_ARCH BUILD_TARGET BUILD_TARGET_ARCH BUILD_TARGET_CPU BUILD_TYPE' >> $ENV
|
---|
454 | echo '' >> $ENV
|
---|
455 | }
|
---|
456 |
|
---|
457 | #
|
---|
458 | # Check for gcc with version >= 3.2.
|
---|
459 | # We depend on a working gcc, if we fail terminate in every case.
|
---|
460 | #
|
---|
461 | check_gcc()
|
---|
462 | {
|
---|
463 | test_header gcc
|
---|
464 | if check_avail "$CC" CC really; then
|
---|
465 | cc_ver=`$CC -dumpfullversion 2>/dev/null`
|
---|
466 | if [ $? -ne 0 ]; then
|
---|
467 | cc_ver=`$CC -dumpversion 2>/dev/null`
|
---|
468 | fi
|
---|
469 | if [ $? -ne 0 ]; then
|
---|
470 | log_failure "cannot execute '$CC -dumpversion'"
|
---|
471 | fail really
|
---|
472 | fi
|
---|
473 | if check_avail "$CXX" CXX really; then
|
---|
474 | cxx_ver=`$CXX -dumpfullversion 2>/dev/null`
|
---|
475 | if [ $? -ne 0 ]; then
|
---|
476 | cxx_ver=`$CXX -dumpversion 2>/dev/null`
|
---|
477 | fi
|
---|
478 | if [ $? -ne 0 ]; then
|
---|
479 | log_failure "cannot execute '$CXX -dumpversion'"
|
---|
480 | fail really
|
---|
481 | fi
|
---|
482 | cc_maj=`echo $cc_ver|cut -d. -f1`
|
---|
483 | cc_min=`echo $cc_ver|cut -d. -f2`
|
---|
484 | if [ "x$cc_ver" != "x$cxx_ver" ]; then
|
---|
485 | log_failure "gcc version $cc_ver does not match g++ version $cxx_ver"
|
---|
486 | fail really
|
---|
487 | elif [ $cc_maj -eq 4 -a $cc_min -eq 0 -a "$OS" = "darwin" ]; then
|
---|
488 | log_success "found version $cc_ver"
|
---|
489 | # gcc-4.0 is allowed for Darwin only
|
---|
490 | elif [ $cc_maj -eq 4 -a $cc_min -eq 2 -a "$OS" = "freebsd" ]; then
|
---|
491 | log_success "found version $cc_ver"
|
---|
492 | # gcc-4.2 is allowed for FreeBSD only
|
---|
493 | elif [ $cc_maj -lt 4 \
|
---|
494 | -o \( $cc_maj -eq 4 -a $cc_min -lt 4 -a "$OS" != "darwin" \) \
|
---|
495 | -o \( $cc_maj -eq 4 -a $cc_min -lt 2 -a "$OS" = "darwin" \) ]; then
|
---|
496 | log_failure "gcc version $cc_maj.$cc_min found, expected gcc 4.x or later"
|
---|
497 | fail really
|
---|
498 | else
|
---|
499 | log_success "found version $cc_ver"
|
---|
500 | fi
|
---|
501 | if [ "$BUILD_MACHINE" = "amd64" ]; then
|
---|
502 | [ -z "$CC32" ] && CC32="$CC -m32"
|
---|
503 | [ -z "$CXX32" ] && CXX32="$CXX -m32"
|
---|
504 | else
|
---|
505 | [ -z "$CC32" ] && CC32="$CC"
|
---|
506 | [ -z "$CXX32" ] && CXX32="$CXX"
|
---|
507 | fi
|
---|
508 | if [ "$BUILD_MACHINE" = "x86" -a "$TARGET_MACHINE" = "amd64" ]; then
|
---|
509 | [ -z "$CC64" ] && CC64="$CC -m64"
|
---|
510 | [ -z "$CXX64" ] && CXX64="$CXX -m64"
|
---|
511 | fi
|
---|
512 | if [ "$TARGET_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 0 ]; then
|
---|
513 | CC32="undefined"
|
---|
514 | CXX32="undefined"
|
---|
515 | fi
|
---|
516 | if [ "$CC" != "gcc" ]; then
|
---|
517 | cnf_append "TOOL_GCC3_CC" "$CC"
|
---|
518 | cnf_append "TOOL_GCC3_AS" "$CC"
|
---|
519 | cnf_append "TOOL_GCC3_LD" "$CC"
|
---|
520 | cnf_append "TOOL_GXX3_CC" "$CC"
|
---|
521 | cnf_append "TOOL_GXX3_AS" "$CC"
|
---|
522 | fi
|
---|
523 | if [ "$CXX" != "g++" ]; then
|
---|
524 | cnf_append "TOOL_GCC3_CXX" "$CXX"
|
---|
525 | cnf_append "TOOL_GXX3_CXX" "$CXX"
|
---|
526 | cnf_append "TOOL_GXX3_LD" "$CXX"
|
---|
527 | fi
|
---|
528 | if [ "$CC32" != "gcc -m32" -a "$CC32" != "undefined" ]; then
|
---|
529 | cnf_append "TOOL_GCC32_CC" "$CC32"
|
---|
530 | cnf_append "TOOL_GCC32_AS" "$CC32"
|
---|
531 | cnf_append "TOOL_GCC32_LD" "$CC32"
|
---|
532 | cnf_append "TOOL_GXX32_CC" "$CC32"
|
---|
533 | cnf_append "TOOL_GXX32_AS" "$CC32"
|
---|
534 | fi
|
---|
535 | if [ "$CXX32" != "g++ -m32" -a "$CXX32" != "undefined" ]; then
|
---|
536 | cnf_append "TOOL_GCC32_CXX" "$CXX32"
|
---|
537 | cnf_append "TOOL_GXX32_CXX" "$CXX32"
|
---|
538 | cnf_append "TOOL_GXX32_LD" "$CXX32"
|
---|
539 | fi
|
---|
540 | # this isn't not necessary, there is not such tool.
|
---|
541 | if [ -n "$CC64" ]; then
|
---|
542 | cnf_append "TOOL_GCC64_CC" "$CC64"
|
---|
543 | cnf_append "TOOL_GCC64_AS" "$CC64"
|
---|
544 | cnf_append "TOOL_GCC64_LD" "$CC64"
|
---|
545 | cnf_append "TOOL_GXX64_CC" "$CC64"
|
---|
546 | cnf_append "TOOL_GXX64_AS" "$CC64"
|
---|
547 | fi
|
---|
548 | if [ -n "$CXX64" ]; then
|
---|
549 | cnf_append "TOOL_GCC64_CXX" "$CXX64"
|
---|
550 | cnf_append "TOOL_GXX64_CXX" "$CXX64"
|
---|
551 | cnf_append "TOOL_GXX64_LD" "$CXX64"
|
---|
552 | fi
|
---|
553 | if [ "$CC" != "gcc" ]; then
|
---|
554 | if [ -n "$CC64" ]; then
|
---|
555 | cnf_append "TOOL_Bs3Gcc64Elf64_CC" "$CC64"
|
---|
556 | else
|
---|
557 | cnf_append "TOOL_Bs3Gcc64Elf64_CC" "$CC"
|
---|
558 | fi
|
---|
559 | if [ -n "$CXX64" ]; then
|
---|
560 | cnf_append "TOOL_Bs3Gcc64Elf64_CXX" "$CXX64"
|
---|
561 | else
|
---|
562 | cnf_append "TOOL_Bs3Gcc64Elf64_CXX" "$CXX"
|
---|
563 | fi
|
---|
564 | fi
|
---|
565 | # Solaris sports a 32-bit gcc/g++.
|
---|
566 | if [ "$OS" = "solaris" -a "$BUILD_MACHINE" = "amd64" ]; then
|
---|
567 | [ "$CC" = "gcc" ] && CC="gcc -m64"
|
---|
568 | [ "$CXX" = "g++" ] && CXX="g++ -m64"
|
---|
569 | fi
|
---|
570 | fi
|
---|
571 | fi
|
---|
572 | }
|
---|
573 |
|
---|
574 |
|
---|
575 | #
|
---|
576 | # Check for the OpenWatcom compiler, needed for compiling the BIOS
|
---|
577 | #
|
---|
578 | # If the system has Open Watcom installed, WATCOM will be set in the
|
---|
579 | # environment. If the user has her/his own Open Watcom install it will be
|
---|
580 | # pointed to by on the command line, which will set the WATCOM variable.
|
---|
581 | # The only exception is detecting OpenWatcom in tools/common/openwatcom.
|
---|
582 | #
|
---|
583 | check_open_watcom()
|
---|
584 | {
|
---|
585 | test_header "Open Watcom"
|
---|
586 |
|
---|
587 | if [ -z "$WATCOM" ]; then
|
---|
588 | WATCOM=`/bin/ls -rd1 $DEVDIR/common/openwatcom/* 2> /dev/null | head -1`
|
---|
589 | if [ -z "$WATCOM" ]; then
|
---|
590 | if [ $OSE -eq 0 -a $OS = "linux" ]; then
|
---|
591 | log_failure "Open Watcom was not found"
|
---|
592 | exit 1
|
---|
593 | fi
|
---|
594 | log_failure "Open Watcom was not found, using alternative BIOS sources"
|
---|
595 | cnf_append "VBOX_WITH_OPEN_WATCOM" ""
|
---|
596 | return 0;
|
---|
597 | fi
|
---|
598 | fi
|
---|
599 |
|
---|
600 | case "$OS" in
|
---|
601 | "darwin") wc_bin="binosx";; # ??
|
---|
602 | "dos") wc_bin="binw";;
|
---|
603 | "freebsd") wc_bin="binfbsd";; # ??
|
---|
604 | "linux") wc_bin="binl";;
|
---|
605 | "netbsd") wc_bin="binnbsd";; # ??
|
---|
606 | "solaris") wc_bin="binsol";; # ??
|
---|
607 | "os2") wc_bin="binp";;
|
---|
608 | "win") wc_bin="binnt";;
|
---|
609 | *) wc_bin="binl";;
|
---|
610 | esac
|
---|
611 |
|
---|
612 | # Check that the tools we use are there.
|
---|
613 | for prog in wasm wcc wlink;
|
---|
614 | do
|
---|
615 | if [ ! -f "$WATCOM/$wc_bin/$prog" ]; then
|
---|
616 | log_failure "$WATCOM/$wc_bin/$prog does not exist or is not a regular file."
|
---|
617 | fail
|
---|
618 | fi
|
---|
619 | done
|
---|
620 |
|
---|
621 | # Use WASM to get the version.
|
---|
622 | wasm_ver=`$WATCOM/$wc_bin/wasm -? 2>&1 | sed -e '1!d' -e 's/Open Watcom Assembler Version *//'`
|
---|
623 | if [ -z "$wasm_ver" ]; then
|
---|
624 | log_failure "$WATCOM/$wc_bin/wasm -? did not produce the expected response"
|
---|
625 | fail
|
---|
626 | fi
|
---|
627 | log_success "found version $wasm_ver"
|
---|
628 | cnf_append "PATH_TOOL_OPENWATCOM" "$WATCOM"
|
---|
629 | cnf_append "VBOX_WITH_OPEN_WATCOM" "1"
|
---|
630 |
|
---|
631 | unset wasm_ver
|
---|
632 | unset wc_wasm
|
---|
633 | unset wc_bin
|
---|
634 | }
|
---|
635 |
|
---|
636 |
|
---|
637 | #
|
---|
638 | # Check for yasm, needed to compile assembler files
|
---|
639 | #
|
---|
640 | check_yasm()
|
---|
641 | {
|
---|
642 | test_header yasm
|
---|
643 | if check_avail "$YASM" YASM; then
|
---|
644 | yasm_ver=`$YASM --version|grep "^yasm"|sed 's+^yasm \(.*\)+\1+'`
|
---|
645 | if [ $? -ne 0 ]; then
|
---|
646 | log_failure "yasm not found"
|
---|
647 | fail
|
---|
648 | else
|
---|
649 | yasm_maj=`echo $yasm_ver|cut -d. -f1`
|
---|
650 | yasm_min=`echo $yasm_ver|cut -d. -f2`
|
---|
651 | yasm_rev=`echo $yasm_ver|cut -d. -f3`
|
---|
652 | yasm_ver_mul=`expr $yasm_maj \* 10000 + $yasm_min \* 100 + $yasm_rev`
|
---|
653 | if [ $yasm_ver_mul -lt 10300 ]; then
|
---|
654 | log_failure "found version $yasm_ver, expected at least 1.3.0"
|
---|
655 | fail
|
---|
656 | else
|
---|
657 | [ "$YASM" != "yasm" ] && cnf_append "PATH_TOOL_YASM" "`dirname $YASM`"
|
---|
658 | log_success "found version $yasm_ver"
|
---|
659 | fi
|
---|
660 | fi
|
---|
661 | fi
|
---|
662 | }
|
---|
663 |
|
---|
664 |
|
---|
665 | #
|
---|
666 | # Check for the iasl ACPI compiler, needed to compile vbox.dsl
|
---|
667 | #
|
---|
668 | check_iasl()
|
---|
669 | {
|
---|
670 | test_header iasl
|
---|
671 | if check_avail "$IASL" IASL; then
|
---|
672 | iasl_ver=`$IASL|grep "ASL.*version"|sed 's+^ASL.*version \([0-9]*\).*+\1+'`
|
---|
673 | if [ $? -ne 0 ]; then
|
---|
674 | log_failure "iasl not found"
|
---|
675 | fail
|
---|
676 | else
|
---|
677 | log_success "found version $iasl_ver"
|
---|
678 | cnf_append "VBOX_IASLCMD" "`which_wrapper $IASL`"
|
---|
679 | fi
|
---|
680 | fi
|
---|
681 | }
|
---|
682 |
|
---|
683 |
|
---|
684 | #
|
---|
685 | # Check for xsltproc, needed by Main
|
---|
686 | #
|
---|
687 | check_xsltproc()
|
---|
688 | {
|
---|
689 | if [ -n "$BUILD_LIBXSLT" ]; then
|
---|
690 | return 0;
|
---|
691 | fi
|
---|
692 | test_header xslt
|
---|
693 | if check_avail "$XSLTPROC" XSLTPROC; then
|
---|
694 | xsltproc_ver=`$XSLTPROC --version`
|
---|
695 | if [ $? -ne 0 ]; then
|
---|
696 | log_failure "xsltproc not found"
|
---|
697 | fail
|
---|
698 | else
|
---|
699 | log_success "found"
|
---|
700 | cnf_append "VBOX_XSLTPROC" "`which_wrapper $XSLTPROC`"
|
---|
701 | fi
|
---|
702 | fi
|
---|
703 | }
|
---|
704 |
|
---|
705 |
|
---|
706 | #
|
---|
707 | # Check for libxml2, needed by the Runtime.
|
---|
708 | # 2.6.24 is known to NOT work, 2.6.26 is known to work (there is no 2.6.25 release)
|
---|
709 | #
|
---|
710 | check_libxml2()
|
---|
711 | {
|
---|
712 | if [ -z "$BUILD_LIBXML2" ]; then
|
---|
713 | test_header libxml2
|
---|
714 | if which_wrapper pkg-config > /dev/null; then
|
---|
715 | libxml2_ver=`pkg-config libxml-2.0 --modversion 2>> $LOG`
|
---|
716 | if [ $? -ne 0 ]; then
|
---|
717 | log_failure "libxml2 not found"
|
---|
718 | fail
|
---|
719 | else
|
---|
720 | FLGXML2=`pkg-config libxml-2.0 --cflags`
|
---|
721 | INCXML2=`strip_I "$FLGXML2"`
|
---|
722 | LIBXML2=`pkg-config libxml-2.0 --libs`
|
---|
723 | cat > $ODIR.tmp_src.cc << EOF
|
---|
724 | #include <cstdio>
|
---|
725 | #include <libxml/xmlversion.h>
|
---|
726 | extern "C" int main(void)
|
---|
727 | {
|
---|
728 | printf("found version %s", LIBXML_DOTTED_VERSION);
|
---|
729 | #if LIBXML_VERSION >= 20626
|
---|
730 | printf(", OK.\n");
|
---|
731 | return 0;
|
---|
732 | #else
|
---|
733 | printf(", expected version 2.6.26 or higher\n");
|
---|
734 | return 1;
|
---|
735 | #endif
|
---|
736 | }
|
---|
737 | EOF
|
---|
738 | [ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
|
---|
739 | if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
|
---|
740 | if test_execute; then
|
---|
741 | cnf_append "SDK_VBoxLibXml2_DEFS" "_REENTRANT" ## @todo get defines from --cflags
|
---|
742 | cnf_append "SDK_VBoxLibXml2_INCS" "$INCXML2"
|
---|
743 | cnf_append "SDK_VBoxLibXml2_LIBS" "`strip_l "$LIBXML2"`"
|
---|
744 | fi
|
---|
745 | fi
|
---|
746 | fi
|
---|
747 | elif which_wrapper xml2-config; then
|
---|
748 | libxml2_ver=`xml2-config --version`
|
---|
749 | if [ $? -ne 0 ]; then
|
---|
750 | log_failure "xml2-config not found"
|
---|
751 | fail
|
---|
752 | else
|
---|
753 | log_success "found version $libxml2_ver"
|
---|
754 | FLGXML2=`xml2-config --cflags`
|
---|
755 | INCXML2=`strip_I "$FLGXML2"`
|
---|
756 | LIBXML2=`xml2-config --libs`
|
---|
757 | cat > $ODIR.tmp_src.cc << EOF
|
---|
758 | #include <cstdio>
|
---|
759 | #include <libxml/xmlversion.h>
|
---|
760 | extern "C" int main(void)
|
---|
761 | {
|
---|
762 | printf("found version %s", LIBXML_DOTTED_VERSION);
|
---|
763 | #if LIBXML_VERSION >= 20626
|
---|
764 | printf(", OK.\n");
|
---|
765 | return 0;
|
---|
766 | #else
|
---|
767 | printf(", expected version 2.6.26 or higher\n");
|
---|
768 | return 1;
|
---|
769 | #endif
|
---|
770 | }
|
---|
771 | EOF
|
---|
772 | [ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
|
---|
773 | if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
|
---|
774 | if test_execute; then
|
---|
775 | cnf_append "SDK_VBoxLibXml2_DEFS" "_REENTRANT" ## @todo get defines from --cflags
|
---|
776 | cnf_append "SDK_VBoxLibXml2_INCS" "$INCXML2"
|
---|
777 | cnf_append "SDK_VBoxLibXml2_LIBS" "`strip_l "$LIBXML2"`"
|
---|
778 | fi
|
---|
779 | fi
|
---|
780 | fi
|
---|
781 | else
|
---|
782 | log_failure "neither pkg-config nor xml2-config found"
|
---|
783 | fail
|
---|
784 | fi
|
---|
785 | fi
|
---|
786 | }
|
---|
787 |
|
---|
788 |
|
---|
789 | #
|
---|
790 | # Check for libIDL, needed by xpcom
|
---|
791 | #
|
---|
792 | check_libidl()
|
---|
793 | {
|
---|
794 | test_header libIDL
|
---|
795 |
|
---|
796 | if which_wrapper libIDL-config-2 > /dev/null; then
|
---|
797 | libidl_ver=`libIDL-config-2 --version`
|
---|
798 | if [ $? -ne 0 ]; then
|
---|
799 | log_failure "libIDL-config-2 not working"
|
---|
800 | fail
|
---|
801 | else
|
---|
802 | log_success "found version $libidl_ver"
|
---|
803 | cnf_append "VBOX_LIBIDL_CONFIG" \
|
---|
804 | "PKG_CONFIG_PATH=`libIDL-config-2 --prefix`/$LIB/pkgconfig `which_wrapper libIDL-config-2`"
|
---|
805 | fi
|
---|
806 | elif check_avail "libIDL-config" libIDL-config; then
|
---|
807 | libidl_ver=`libIDL-config --version`
|
---|
808 | if [ $? -ne 0 ]; then
|
---|
809 | log_failure "libIDL-config not working"
|
---|
810 | fail
|
---|
811 | else
|
---|
812 | log_success "found version $libidl_ver"
|
---|
813 | cnf_append "VBOX_LIBIDL_CONFIG" "`which_wrapper libIDL-config`"
|
---|
814 | fi
|
---|
815 | fi
|
---|
816 | }
|
---|
817 |
|
---|
818 |
|
---|
819 | #
|
---|
820 | # Check for libdevmapper, needed by the VBoxVolInfo
|
---|
821 | #
|
---|
822 | check_libdevmapper()
|
---|
823 | {
|
---|
824 | test_header libdevmapper
|
---|
825 | cat > $ODIR.tmp_src.cc << EOF
|
---|
826 | #include <cstdio>
|
---|
827 | extern "C" {
|
---|
828 | #define private
|
---|
829 | #include <libdevmapper.h>
|
---|
830 | int main()
|
---|
831 | {
|
---|
832 | char version[80];
|
---|
833 |
|
---|
834 | if (!dm_get_library_version(version, sizeof(version)))
|
---|
835 | {
|
---|
836 | printf("dm_get_library_version() failed.\n");
|
---|
837 | return 1;
|
---|
838 | }
|
---|
839 |
|
---|
840 | const char* v=version;
|
---|
841 | unsigned int major = 0, minor = 0, micro = 0;
|
---|
842 |
|
---|
843 | for (; *v !='.' && *v != '\0'; v++) major = major*10 + *v-'0';
|
---|
844 | if (*v == '.') v++;
|
---|
845 | for (; *v !='.' && *v != '\0'; v++) minor = minor*10 + *v-'0';
|
---|
846 | if (*v == '.') v++;
|
---|
847 | for (; *v !='.' && *v != '\0'; v++) micro = micro*10 + *v-'0';
|
---|
848 |
|
---|
849 | printf("found version %s", version);
|
---|
850 | if (major*10000 + minor*100 + micro >= 10200)
|
---|
851 | {
|
---|
852 | printf(", OK.\n");
|
---|
853 | return 0;
|
---|
854 | }
|
---|
855 | else
|
---|
856 | {
|
---|
857 | printf(", expected version 1.02 or higher\n");
|
---|
858 | return 1;
|
---|
859 | }
|
---|
860 | }
|
---|
861 | }
|
---|
862 | EOF
|
---|
863 | if test_compile "$LIBDEVMAPPER $INCDEVMAPPER" libdevmapper libdevmapper; then
|
---|
864 | if test_execute; then
|
---|
865 | cnf_append "VBOX_WITH_DEVMAPPER" "1"
|
---|
866 | fi
|
---|
867 | fi
|
---|
868 | }
|
---|
869 |
|
---|
870 |
|
---|
871 | #
|
---|
872 | # Check for openssl, needed for RDP and S3
|
---|
873 | #
|
---|
874 | check_ssl()
|
---|
875 | {
|
---|
876 | if [ -z "$BUILD_LIBSSL" ]; then
|
---|
877 | test_header ssl
|
---|
878 | cat > $ODIR.tmp_src.cc << EOF
|
---|
879 | #include <cstdio>
|
---|
880 | #include <openssl/opensslv.h>
|
---|
881 | #include <openssl/ssl.h>
|
---|
882 | extern "C" int main(void)
|
---|
883 | {
|
---|
884 | printf("found version %s", OPENSSL_VERSION_TEXT);
|
---|
885 | SSL_library_init();
|
---|
886 | #if OPENSSL_VERSION_NUMBER >= 0x10001000
|
---|
887 | printf(", OK.\n");
|
---|
888 | return 0;
|
---|
889 | #else
|
---|
890 | printf(", expected version 1.0.1 or higher\n");
|
---|
891 | return 1;
|
---|
892 | #endif
|
---|
893 | }
|
---|
894 | EOF
|
---|
895 | if test_compile "$INCCRYPTO $LIBCRYPTO" libcrypto openssl; then
|
---|
896 | if test_execute nofatal; then
|
---|
897 | cnf_append "SDK_VBoxOpenSslStatic_INCS" "`strip_I "$INCCRYPTO"`"
|
---|
898 | cnf_append "SDK_VBoxOpenSslStatic_LIBS" "`strip_l "$LIBCRYPTO"`"
|
---|
899 | cnf_append "SDK_VBoxOpenSslBldProg_LIBS" "`strip_l "$LIBCRYPTO"`"
|
---|
900 | fi
|
---|
901 | fi
|
---|
902 | fi
|
---|
903 | }
|
---|
904 |
|
---|
905 |
|
---|
906 | #
|
---|
907 | # Check for pthread, needed by VBoxSVC, frontends, ...
|
---|
908 | #
|
---|
909 | check_pthread()
|
---|
910 | {
|
---|
911 | test_header pthread
|
---|
912 | cat > $ODIR.tmp_src.cc << EOF
|
---|
913 | #include <cstdio>
|
---|
914 | #include <pthread.h>
|
---|
915 | extern "C" int main(void)
|
---|
916 | {
|
---|
917 | pthread_mutex_t mutex;
|
---|
918 | if (pthread_mutex_init(&mutex, NULL)) {
|
---|
919 | printf("pthread_mutex_init() failed\n");
|
---|
920 | return 1;
|
---|
921 | }
|
---|
922 | if (pthread_mutex_lock(&mutex)) {
|
---|
923 | printf("pthread_mutex_lock() failed\n");
|
---|
924 | return 1;
|
---|
925 | }
|
---|
926 | if (pthread_mutex_unlock(&mutex)) {
|
---|
927 | printf("pthread_mutex_unlock() failed\n");
|
---|
928 | return 1;
|
---|
929 | }
|
---|
930 | printf("found, OK.\n");
|
---|
931 | }
|
---|
932 | EOF
|
---|
933 | if test_compile $LIBPTHREAD pthread pthread; then
|
---|
934 | if test_execute; then
|
---|
935 | cnf_append "LIB_PTHREAD" "`strip_l "$LIBPTHREAD"`"
|
---|
936 | fi
|
---|
937 | fi
|
---|
938 | }
|
---|
939 |
|
---|
940 |
|
---|
941 | #
|
---|
942 | # Check for zlib, needed by VBoxSVC, Runtime, ...
|
---|
943 | #
|
---|
944 | check_z()
|
---|
945 | {
|
---|
946 | test_header zlib
|
---|
947 | cat > $ODIR.tmp_src.cc << EOF
|
---|
948 | #include <cstdio>
|
---|
949 | #include <zlib.h>
|
---|
950 | extern "C" int main(void)
|
---|
951 | {
|
---|
952 | printf("found version %s", ZLIB_VERSION);
|
---|
953 | #if ZLIB_VERNUM >= 0x1210
|
---|
954 | printf(", OK.\n");
|
---|
955 | return 0;
|
---|
956 | #else
|
---|
957 | printf(", expected version 1.2.1 or higher\n");
|
---|
958 | return 1;
|
---|
959 | #endif
|
---|
960 | }
|
---|
961 | EOF
|
---|
962 | [ -n "$INCZ" ] && I_INCZ=`prefix_I "$INCZ"`
|
---|
963 | if test_compile "$LIBZ $I_INCZ" zlib zlib; then
|
---|
964 | if test_execute; then
|
---|
965 | echo "if1of (\$(KBUILD_TARGET),darwin freebsd haiku linux)" >> $CNF
|
---|
966 | cnf_append " SDK_VBoxZlib_LIBS" "`strip_l "$LIBZ"`"
|
---|
967 | cnf_append " SDK_VBoxZlib_INCS" "$INCZ"
|
---|
968 | echo "endif" >> $CNF
|
---|
969 | fi
|
---|
970 | fi
|
---|
971 | }
|
---|
972 |
|
---|
973 |
|
---|
974 | #
|
---|
975 | # Check for liblzf, needed by VBoxSVC, Runtime, ...
|
---|
976 | #
|
---|
977 | check_lzf()
|
---|
978 | {
|
---|
979 | test_header liblzf
|
---|
980 | cat > $ODIR.tmp_src.cc << EOF
|
---|
981 | #include <cstdio>
|
---|
982 | #include <lzf.h>
|
---|
983 | extern "C" int main(void)
|
---|
984 | {
|
---|
985 | printf("found LZF API version %u.%u", LZF_VERSION >> 8, LZF_VERSION & 0xff);
|
---|
986 | #if LZF_VERSION >= 0x0105
|
---|
987 | printf(", OK.\n");
|
---|
988 | return 0;
|
---|
989 | #else
|
---|
990 | printf(", expected version 1.5 or higher\n");
|
---|
991 | return 1;
|
---|
992 | #endif
|
---|
993 | }
|
---|
994 | EOF
|
---|
995 | [ -n "$INCLZF" ] && I_INCLZF=`prefix_I "$INCLZF"`
|
---|
996 | if test_compile "$LIBLZF $I_INCLZF" liblzf liblzf nofatal; then
|
---|
997 | if test_execute; then
|
---|
998 | echo "if1of (\$(KBUILD_TARGET),darwin freebsd haiku linux)" >> $CNF
|
---|
999 | cnf_append " SDK_VBoxLzf_LIBS" "`strip_l "$LIBLZF"`"
|
---|
1000 | cnf_append " SDK_VBoxLzf_INCS" "$INCLZF"
|
---|
1001 | echo "endif" >> $CNF
|
---|
1002 | fi
|
---|
1003 | else
|
---|
1004 | echo "not found -- builing liblzf from in-tree code."
|
---|
1005 | fi
|
---|
1006 | }
|
---|
1007 |
|
---|
1008 |
|
---|
1009 | #
|
---|
1010 | # Check for libpng, needed by kchmviewer
|
---|
1011 | #
|
---|
1012 | check_png()
|
---|
1013 | {
|
---|
1014 | test_header libpng
|
---|
1015 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1016 | #include <cstdio>
|
---|
1017 | #include <png.h>
|
---|
1018 | extern "C" int main(void)
|
---|
1019 | {
|
---|
1020 | printf("found version %s", PNG_LIBPNG_VER_STRING);
|
---|
1021 | #if PNG_LIBPNG_VER >= 10205
|
---|
1022 | printf(", OK.\n");
|
---|
1023 | return 0;
|
---|
1024 | #else
|
---|
1025 | printf(", expected version 1.2.5 or higher\n");
|
---|
1026 | return 1;
|
---|
1027 | #endif
|
---|
1028 | }
|
---|
1029 | EOF
|
---|
1030 | [ -n "$INCPNG" ] && I_INCPNG=`prefix_I "$INCPNG"`
|
---|
1031 | if test_compile "$LIBPNG $I_INCPNG" libpng libpng; then
|
---|
1032 | if test_execute; then
|
---|
1033 | cnf_append "SDK_VBoxLibPng_LIBS" "`strip_l "$LIBPNG"`"
|
---|
1034 | cnf_append "SDK_VBoxLibPng_INCS" "$INCPNG"
|
---|
1035 | fi
|
---|
1036 | fi
|
---|
1037 | }
|
---|
1038 |
|
---|
1039 | #
|
---|
1040 | # Check for libvncserver, needed for VNC in OSE
|
---|
1041 | #
|
---|
1042 | check_vncserver()
|
---|
1043 | {
|
---|
1044 | test_header libvncserver
|
---|
1045 | cat > $ODIR.tmp_src.cc <<EOF
|
---|
1046 | #include <cstdio>
|
---|
1047 | #include <rfb/rfbconfig.h>
|
---|
1048 |
|
---|
1049 | extern "C" int main()
|
---|
1050 | {
|
---|
1051 | const char* v=LIBVNCSERVER_VERSION;
|
---|
1052 | unsigned int major = 0, minor = 0, micro = 0;
|
---|
1053 |
|
---|
1054 | for (; *v !='.' && *v != '\0'; v++) major = major*10 + *v-'0';
|
---|
1055 | if (*v == '.') v++;
|
---|
1056 | for (; *v !='.' && *v != '\0'; v++) minor = minor*10 + *v-'0';
|
---|
1057 | if (*v == '.') v++;
|
---|
1058 | for (; *v !='.' && *v != '\0'; v++) micro = micro*10 + *v-'0';
|
---|
1059 |
|
---|
1060 | printf("found version %s", LIBVNCSERVER_PACKAGE_VERSION);
|
---|
1061 | if (major*10000 + minor*100 + micro >= 900)
|
---|
1062 | {
|
---|
1063 | printf(", OK.\n");
|
---|
1064 | return 0;
|
---|
1065 | }
|
---|
1066 | else
|
---|
1067 | {
|
---|
1068 | printf(", expected version 0.9 or higher\n");
|
---|
1069 | return 1;
|
---|
1070 | }
|
---|
1071 | }
|
---|
1072 | EOF
|
---|
1073 | if test_compile "$LIBVNCSERVER $INCVNCSERVER" libvncserver libvncserver; then
|
---|
1074 | if test_execute; then
|
---|
1075 | cnf_append "VBOX_WITH_EXTPACK_VNC" "1"
|
---|
1076 | fi
|
---|
1077 | fi
|
---|
1078 | }
|
---|
1079 |
|
---|
1080 | #
|
---|
1081 | # Check for libcurl, needed by S3
|
---|
1082 | #
|
---|
1083 | check_curl()
|
---|
1084 | {
|
---|
1085 | if [ -z "$BUILD_LIBCURL" ]; then
|
---|
1086 | test_header libcurl
|
---|
1087 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1088 | #include <cstdio>
|
---|
1089 | #include <curl/curl.h>
|
---|
1090 | extern "C" int main(void)
|
---|
1091 | {
|
---|
1092 | printf("found version %s", LIBCURL_VERSION);
|
---|
1093 | #if 10000*LIBCURL_VERSION_MAJOR + 100*LIBCURL_VERSION_MINOR + LIBCURL_VERSION_PATCH >= 71901
|
---|
1094 | printf(", OK.\n");
|
---|
1095 | return 0;
|
---|
1096 | #else
|
---|
1097 | printf(", expected version 7.19.1 or higher\n");
|
---|
1098 | return 1;
|
---|
1099 | #endif
|
---|
1100 | }
|
---|
1101 | EOF
|
---|
1102 | [ -n "$INCCURL" ] && I_INCCURL=`prefix_I "$INCCURL"`
|
---|
1103 | if test_compile "$LIBCURL $I_INCCURL" libcurl libcurl; then
|
---|
1104 | if test_execute; then
|
---|
1105 | cnf_append "SDK_VBoxLibCurl_LIBS" "`strip_l "$LIBCURL"`"
|
---|
1106 | cnf_append "SDK_VBoxLibCurl_INCS" "$INCCURL"
|
---|
1107 | fi
|
---|
1108 | fi
|
---|
1109 | fi
|
---|
1110 | }
|
---|
1111 |
|
---|
1112 |
|
---|
1113 | #
|
---|
1114 | # Check for pam, needed by VRDPAuth
|
---|
1115 | # Version 79 was introduced in 9/2005, do we support older versions?
|
---|
1116 | # Debian/sarge uses 76
|
---|
1117 | # OpenSUSE comes with 0.99.xxx where they changed the versioning scheme.
|
---|
1118 | #
|
---|
1119 | check_pam()
|
---|
1120 | {
|
---|
1121 | test_header pam
|
---|
1122 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1123 | #include <cstdio>
|
---|
1124 | #include <security/pam_appl.h>
|
---|
1125 | extern "C" int main(void)
|
---|
1126 | {
|
---|
1127 | printf("found version %d", __LIBPAM_VERSION);
|
---|
1128 | if (__LIBPAM_VERSION >= 76)
|
---|
1129 | {
|
---|
1130 | printf(", OK.\n");
|
---|
1131 | return 0;
|
---|
1132 | }
|
---|
1133 | else
|
---|
1134 | {
|
---|
1135 | printf(", expected version 76 or higher\n");
|
---|
1136 | return 1;
|
---|
1137 | }
|
---|
1138 | }
|
---|
1139 | EOF
|
---|
1140 | if test_compile "-lpam" pam pam nofatal; then
|
---|
1141 | if test_execute nofatal; then
|
---|
1142 | return 0;
|
---|
1143 | fi
|
---|
1144 | fi
|
---|
1145 | echo "pam0.x not found"
|
---|
1146 | test_header linux_pam
|
---|
1147 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1148 | #include <cstdio>
|
---|
1149 | #include <security/pam_appl.h>
|
---|
1150 | extern "C" int main(void)
|
---|
1151 | {
|
---|
1152 | printf("found version %d.%d", __LINUX_PAM__, __LINUX_PAM_MINOR__);
|
---|
1153 | if (__LINUX_PAM__ >= 1)
|
---|
1154 | {
|
---|
1155 | printf(", OK.\n");
|
---|
1156 | return 0;
|
---|
1157 | }
|
---|
1158 | else
|
---|
1159 | {
|
---|
1160 | printf(", expected version 1.0 or higher\n");
|
---|
1161 | return 1;
|
---|
1162 | }
|
---|
1163 | }
|
---|
1164 | EOF
|
---|
1165 | if test_compile "-lpam" pam pam; then
|
---|
1166 | test_execute
|
---|
1167 | fi
|
---|
1168 | }
|
---|
1169 |
|
---|
1170 |
|
---|
1171 | #
|
---|
1172 | # Check for the SDL library, needed by VBoxSDL and VirtualBox
|
---|
1173 | # We depend at least on version 1.2.7
|
---|
1174 | #
|
---|
1175 | check_sdl()
|
---|
1176 | {
|
---|
1177 | test_header SDL
|
---|
1178 | if [ "$OS" = "darwin" ]; then
|
---|
1179 | if [ -f "/System/Library/Frameworks/SDL.framework/SDL" ]; then
|
---|
1180 | PATH_SDK_LIBSDL="/System/Library/Frameworks/SDL.framework"
|
---|
1181 | elif [ -f "/Library/Frameworks/SDL.framework/SDL" ]; then
|
---|
1182 | PATH_SDK_LIBSDL="/Library/Frameworks/SDL.framework"
|
---|
1183 | fi
|
---|
1184 | if [ -n "$PATH_SDK_LIBSDL" ]; then
|
---|
1185 | foundsdl=1
|
---|
1186 | INCSDL="$PATH_SDK_LIBSDL/Headers"
|
---|
1187 | FLDSDL="-framework SDL"
|
---|
1188 | else
|
---|
1189 | log_failure "SDL framework not found"
|
---|
1190 | fail
|
---|
1191 | fi
|
---|
1192 | else
|
---|
1193 | if which_wrapper sdl-config > /dev/null; then
|
---|
1194 | FLGSDL=`sdl-config --cflags`
|
---|
1195 | INCSDL=`strip_I "$FLGSDL"`
|
---|
1196 | LIBSDL=`sdl-config --libs`
|
---|
1197 | LIBSDLMAIN="-lSDLmain"
|
---|
1198 | FLDSDL=
|
---|
1199 | foundsdl=1
|
---|
1200 | fi
|
---|
1201 | fi
|
---|
1202 | [ "$OS" = "linux" -o "$OS" = "darwin" -o "$OS" = "solaris" ] && LIBSDLMAIN=""
|
---|
1203 | if [ -n "$foundsdl" ]; then
|
---|
1204 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1205 | #include <cstdio>
|
---|
1206 | #include <SDL.h>
|
---|
1207 | #include <SDL_main.h>
|
---|
1208 | #undef main
|
---|
1209 | extern "C" int main(int argc, char** argv)
|
---|
1210 | {
|
---|
1211 | printf("found version %d.%d.%d",
|
---|
1212 | SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
|
---|
1213 | #if SDL_VERSION_ATLEAST(1,2,7)
|
---|
1214 | printf(", OK.\n");
|
---|
1215 | return 0;
|
---|
1216 | #else
|
---|
1217 | printf(", expected version 1.2.7 or higher\n");
|
---|
1218 | return 1;
|
---|
1219 | #endif
|
---|
1220 | }
|
---|
1221 | EOF
|
---|
1222 | [ -n "$INCSDL" ] && I_INCSDL=`prefix_I "$INCSDL"`
|
---|
1223 | if test_compile "$LIBSDL $LIBSDLMAIN $I_INCSDL $FLDSDL" SDL SDL; then
|
---|
1224 | if test_execute; then
|
---|
1225 | cnf_append "LIB_SDK_LIBSDL_SDL" "`strip_l "$LIBSDL"`"
|
---|
1226 | cnf_append "SDK_LIBSDL_LIBPATH" "`strip_L "$LIBSDL"`"
|
---|
1227 | cnf_append "LIB_SDK_LIBSDL_SDLMAIN" "`strip_l "$LIBSDLMAIN"`"
|
---|
1228 | [ -n "$INCSDL" ] && cnf_append "SDK_LIBSDL_INCS" "$INCSDL"
|
---|
1229 | [ -n "$FLDSDL" ] && cnf_append "SDK_LIBSDL_LDFLAGS" "$FLDSDL"
|
---|
1230 | fi
|
---|
1231 | fi
|
---|
1232 | else
|
---|
1233 | log_failure "SDL not found (can be disabled using --disable-sdl)"
|
---|
1234 | fail
|
---|
1235 | fi
|
---|
1236 | }
|
---|
1237 |
|
---|
1238 |
|
---|
1239 | #
|
---|
1240 | # Check for the SDL_ttf library, needed by VBoxSDL (secure label)
|
---|
1241 | #
|
---|
1242 | check_sdl_ttf()
|
---|
1243 | {
|
---|
1244 | test_header SDL_ttf
|
---|
1245 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1246 | #include <cstdio>
|
---|
1247 | #include <SDL_ttf.h>
|
---|
1248 | #ifndef SDL_TTF_MAJOR_VERSION
|
---|
1249 | #define SDL_TTF_MAJOR_VERSION TTF_MAJOR_VERSION
|
---|
1250 | #define SDL_TTF_MINOR_VERSION TTF_MINOR_VERSION
|
---|
1251 | #define SDL_TTF_PATCHLEVEL TTF_PATCHLEVEL
|
---|
1252 | #endif
|
---|
1253 | extern "C" int main(void)
|
---|
1254 | {
|
---|
1255 | printf("found version %d.%d.%d",
|
---|
1256 | SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL);
|
---|
1257 | #if 10000*SDL_TTF_MAJOR_VERSION + 100*SDL_TTF_MINOR_VERSION + SDL_TTF_PATCHLEVEL >= 20006
|
---|
1258 | printf(", OK.\n");
|
---|
1259 | return 0;
|
---|
1260 | #else
|
---|
1261 | printf(", expected version 2.0.6 or higher\n");
|
---|
1262 | return 1;
|
---|
1263 | #endif
|
---|
1264 | }
|
---|
1265 | EOF
|
---|
1266 | if test_compile "-lSDL_ttf $I_INCSDL" SDL_ttf SDL_ttf nofatal; then
|
---|
1267 | test_execute nofatal || \
|
---|
1268 | cnf_append "VBOX_WITH_SECURELABEL" ""
|
---|
1269 | else
|
---|
1270 | echo "not found -- disabling VBoxSDL secure label."
|
---|
1271 | cnf_append "VBOX_WITH_SECURELABEL" ""
|
---|
1272 | fi
|
---|
1273 | }
|
---|
1274 |
|
---|
1275 |
|
---|
1276 | #
|
---|
1277 | # Check for libasound, needed by the ALSA audio backend
|
---|
1278 | #
|
---|
1279 | check_alsa()
|
---|
1280 | {
|
---|
1281 | test_header ALSA
|
---|
1282 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1283 | #include <cstdio>
|
---|
1284 | #include <alsa/asoundlib.h>
|
---|
1285 | extern "C" int main(void)
|
---|
1286 | {
|
---|
1287 | printf("found version %d.%d.%d",
|
---|
1288 | SND_LIB_MAJOR, SND_LIB_MINOR, SND_LIB_SUBMINOR);
|
---|
1289 | #if 10000*SND_LIB_MAJOR + 100*SND_LIB_MINOR + SND_LIB_SUBMINOR >= 10014
|
---|
1290 | printf(", OK.\n");
|
---|
1291 | return 0;
|
---|
1292 | #else
|
---|
1293 | printf(", expected version 1.0.14 or higher\n");
|
---|
1294 | return 1;
|
---|
1295 | #endif
|
---|
1296 | }
|
---|
1297 | EOF
|
---|
1298 | if test_compile "-lasound" asound asound; then
|
---|
1299 | test_execute
|
---|
1300 | fi
|
---|
1301 | }
|
---|
1302 |
|
---|
1303 |
|
---|
1304 | #
|
---|
1305 | # Check for PulseAudio
|
---|
1306 | #
|
---|
1307 | check_pulse()
|
---|
1308 | {
|
---|
1309 | test_header "PulseAudio"
|
---|
1310 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1311 | #include <cstdio>
|
---|
1312 | #include <pulse/version.h>
|
---|
1313 | extern "C" int main(void)
|
---|
1314 | {
|
---|
1315 | printf("found version %s API version %d", pa_get_headers_version(), PA_API_VERSION);
|
---|
1316 | #if PA_API_VERSION >= 9
|
---|
1317 | printf(", OK.\n");
|
---|
1318 | return 0;
|
---|
1319 | #else
|
---|
1320 | printf(", expected version 0.9.0 (API version 9) or higher\n");
|
---|
1321 | return 1;
|
---|
1322 | #endif
|
---|
1323 | }
|
---|
1324 | EOF
|
---|
1325 | if test_compile "$INCPULSE $LIBPULSE -lpulse" pulse pulse nofatal; then
|
---|
1326 | if test_execute nofatal; then
|
---|
1327 | cnf_append "VBOX_WITH_AUDIO_PULSE" "1"
|
---|
1328 | else
|
---|
1329 | cnf_append "VBOX_WITH_AUDIO_PULSE" ""
|
---|
1330 | fi
|
---|
1331 | else
|
---|
1332 | cnf_append "VBOX_WITH_AUDIO_PULSE" ""
|
---|
1333 | fi
|
---|
1334 | }
|
---|
1335 |
|
---|
1336 |
|
---|
1337 | #
|
---|
1338 | # Check for the X libraries (Xext, X11)
|
---|
1339 | #
|
---|
1340 | check_x()
|
---|
1341 | {
|
---|
1342 | test_header "X libraries"
|
---|
1343 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1344 | #include <cstdio>
|
---|
1345 | #include <X11/Xlib.h>
|
---|
1346 | extern "C" int main(void)
|
---|
1347 | {
|
---|
1348 | Display *dpy;
|
---|
1349 | int scrn_num;
|
---|
1350 | Screen *scrn;
|
---|
1351 | Window win;
|
---|
1352 |
|
---|
1353 | dpy = XOpenDisplay(NULL);
|
---|
1354 | scrn_num = DefaultScreen(dpy);
|
---|
1355 | scrn = ScreenOfDisplay(dpy, scrn_num);
|
---|
1356 | win = XCreateWindow(dpy, RootWindowOfScreen(scrn), 0, 0, 100, 100,
|
---|
1357 | 0, 16, InputOutput, CopyFromParent, 0, NULL);
|
---|
1358 | XDestroyWindow(dpy, win);
|
---|
1359 | XCloseDisplay(dpy);
|
---|
1360 | }
|
---|
1361 | EOF
|
---|
1362 | [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
|
---|
1363 | if test_compile "$LIBX11 $I_INCX11" Xlibs Xlibs; then
|
---|
1364 | log_success "found"
|
---|
1365 | fi
|
---|
1366 | }
|
---|
1367 |
|
---|
1368 |
|
---|
1369 | #
|
---|
1370 | # Check for the Xcursor library, needed by VBoxSDL.
|
---|
1371 | #
|
---|
1372 | check_xcursor()
|
---|
1373 | {
|
---|
1374 | test_header Xcursor
|
---|
1375 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1376 | #include <cstdio>
|
---|
1377 | #include <X11/Xlib.h>
|
---|
1378 | #include <X11/Xcursor/Xcursor.h>
|
---|
1379 | extern "C" int main(void)
|
---|
1380 | {
|
---|
1381 | XcursorImage *cursor = XcursorImageCreate (10, 10);
|
---|
1382 | XcursorImageDestroy(cursor);
|
---|
1383 | return 0;
|
---|
1384 | }
|
---|
1385 | EOF
|
---|
1386 | [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
|
---|
1387 | if test_compile "$LIBX11 $LIBXCURSOR $I_INCX11" Xcursor Xcursor; then
|
---|
1388 | log_success "found"
|
---|
1389 | cnf_append "VBOX_XCURSOR_LIBS" "`strip_l "$LIBXCURSOR"`"
|
---|
1390 | fi
|
---|
1391 | }
|
---|
1392 |
|
---|
1393 |
|
---|
1394 | #
|
---|
1395 | # Check for the Xinerama library, needed by the Qt GUI
|
---|
1396 | #
|
---|
1397 | check_xinerama()
|
---|
1398 | {
|
---|
1399 | test_header Xinerama
|
---|
1400 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1401 | #include <X11/Xlib.h>
|
---|
1402 | #include <X11/extensions/Xinerama.h>
|
---|
1403 | extern "C" int main(void)
|
---|
1404 | {
|
---|
1405 | Display *dpy;
|
---|
1406 | Bool flag;
|
---|
1407 | dpy = XOpenDisplay(NULL);
|
---|
1408 | if (dpy)
|
---|
1409 | {
|
---|
1410 | flag = XineramaIsActive(dpy);
|
---|
1411 | XCloseDisplay(dpy);
|
---|
1412 | }
|
---|
1413 | }
|
---|
1414 | EOF
|
---|
1415 | [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
|
---|
1416 | if test_compile "$LIBX11 $LIBXINERAMA $I_INCX11" Xinerama Xinerama; then
|
---|
1417 | log_success "found"
|
---|
1418 | fi
|
---|
1419 | }
|
---|
1420 |
|
---|
1421 |
|
---|
1422 | #
|
---|
1423 | # Check for the XRandR library, needed by the Qt GUI
|
---|
1424 | #
|
---|
1425 | check_xrandr()
|
---|
1426 | {
|
---|
1427 | test_header Xrandr
|
---|
1428 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1429 | #include <X11/Xlib.h>
|
---|
1430 | #include <X11/extensions/Xrandr.h>
|
---|
1431 | extern "C" int main(void)
|
---|
1432 | {
|
---|
1433 | Display *dpy;
|
---|
1434 | Bool flag;
|
---|
1435 | int major, minor;
|
---|
1436 | dpy = XOpenDisplay(NULL);
|
---|
1437 | if (dpy)
|
---|
1438 | {
|
---|
1439 | flag = XRRQueryVersion(dpy, &major, &minor);
|
---|
1440 | XCloseDisplay(dpy);
|
---|
1441 | }
|
---|
1442 | }
|
---|
1443 | EOF
|
---|
1444 | [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
|
---|
1445 | if test_compile "$LIBX11 $LIBXRANDR $I_INCX11" Xrandr Xrandr; then
|
---|
1446 | log_success "found"
|
---|
1447 | fi
|
---|
1448 | }
|
---|
1449 |
|
---|
1450 |
|
---|
1451 | #
|
---|
1452 | # Check for OpenGL
|
---|
1453 | #
|
---|
1454 | check_opengl()
|
---|
1455 | {
|
---|
1456 | # On darwin this is a on/off decision only
|
---|
1457 | if [ "$OS" = "darwin" ]; then
|
---|
1458 | test_header "OpenGL support"
|
---|
1459 | echo "enabled"
|
---|
1460 | else
|
---|
1461 | check_xmu
|
---|
1462 | check_mesa
|
---|
1463 | fi
|
---|
1464 | }
|
---|
1465 |
|
---|
1466 |
|
---|
1467 | #
|
---|
1468 | # Check for the Xmu library, needed by OpenGL
|
---|
1469 | #
|
---|
1470 | check_xmu()
|
---|
1471 | {
|
---|
1472 | test_header Xmu
|
---|
1473 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1474 | #include <cstdio>
|
---|
1475 | #include <X11/Xatom.h>
|
---|
1476 | #include <X11/Xlib.h>
|
---|
1477 | #include <X11/Xutil.h>
|
---|
1478 | #include <X11/Xmu/StdCmap.h>
|
---|
1479 | extern "C" int main(void)
|
---|
1480 | {
|
---|
1481 | Display *dpy;
|
---|
1482 | int scrn_num;
|
---|
1483 | Screen *scrn;
|
---|
1484 |
|
---|
1485 | dpy = XOpenDisplay(NULL);
|
---|
1486 | if (dpy)
|
---|
1487 | {
|
---|
1488 | scrn_num = DefaultScreen(dpy);
|
---|
1489 | scrn = ScreenOfDisplay(dpy, scrn_num);
|
---|
1490 | Status status = XmuLookupStandardColormap(dpy, RootWindowOfScreen(scrn), 0,
|
---|
1491 | 24, XA_RGB_DEFAULT_MAP, False, True);
|
---|
1492 | printf("Status = %x\n", status);
|
---|
1493 | XCloseDisplay(dpy);
|
---|
1494 | }
|
---|
1495 | return 0;
|
---|
1496 | }
|
---|
1497 | EOF
|
---|
1498 | [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
|
---|
1499 | if test_compile "$LIBX11 $LIBXMU $I_INCX11" Xmu Xmu; then
|
---|
1500 | log_success "found"
|
---|
1501 | cnf_append "VBOX_XMU_LIBS" "`strip_l "$LIBXMU"`"
|
---|
1502 | fi
|
---|
1503 | }
|
---|
1504 |
|
---|
1505 | #
|
---|
1506 | # Check for Mesa, needed by OpenGL
|
---|
1507 | #
|
---|
1508 | check_mesa()
|
---|
1509 | {
|
---|
1510 | test_header "Mesa / GLU"
|
---|
1511 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1512 | #include <cstdio>
|
---|
1513 | #include <X11/Xlib.h>
|
---|
1514 | #include <GL/glx.h>
|
---|
1515 | #include <GL/glu.h>
|
---|
1516 | extern "C" int main(void)
|
---|
1517 | {
|
---|
1518 | Display *dpy;
|
---|
1519 | int major, minor;
|
---|
1520 |
|
---|
1521 | dpy = XOpenDisplay(NULL);
|
---|
1522 | if (dpy)
|
---|
1523 | {
|
---|
1524 | Bool glx_version = glXQueryVersion(dpy, &major, &minor);
|
---|
1525 | XCloseDisplay(dpy);
|
---|
1526 | if (glx_version)
|
---|
1527 | {
|
---|
1528 | printf("found version %u.%u, OK.\n", major, minor);
|
---|
1529 | return 0;
|
---|
1530 | }
|
---|
1531 | }
|
---|
1532 | printf("found (inactive), OK.\n");
|
---|
1533 | return 0;
|
---|
1534 | }
|
---|
1535 | EOF
|
---|
1536 | [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
|
---|
1537 | if test_compile "$LIBX11 $MESA $I_INCX11" Mesa Mesa; then
|
---|
1538 | [ $PASSIVE_MESA -eq 1 ] && unset DISPLAY
|
---|
1539 | test_execute
|
---|
1540 | fi
|
---|
1541 | }
|
---|
1542 |
|
---|
1543 |
|
---|
1544 | #
|
---|
1545 | # Check for the Qt5 library, needed by the VirtualBox frontend
|
---|
1546 | #
|
---|
1547 | # Currently not fatal.
|
---|
1548 | #
|
---|
1549 | check_qt5()
|
---|
1550 | {
|
---|
1551 | foundqt5=
|
---|
1552 | test_header Qt5
|
---|
1553 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1554 | #include <QtGlobal>
|
---|
1555 | extern "C" int main(void)
|
---|
1556 | {
|
---|
1557 | EOF
|
---|
1558 | echo "#if QT_VERSION >= $(($QT5MAJ*65536+$QT5MIN*256))" >> $ODIR.tmp_src.cc
|
---|
1559 | cat >> $ODIR.tmp_src.cc << EOF
|
---|
1560 | return 0;
|
---|
1561 | #else
|
---|
1562 | return 1;
|
---|
1563 | #endif
|
---|
1564 | }
|
---|
1565 | EOF
|
---|
1566 | if [ "$OS" = "darwin" ]; then
|
---|
1567 | # First check if there is the internal version of Qt. If yes nothing else
|
---|
1568 | # has to be done.
|
---|
1569 | QT_INTERNAL=`/bin/ls -rd1 $DEVDIR/$BUILD_TARGET.$BUILD_PLATFORM_ARCH/qt/* 2> /dev/null`
|
---|
1570 | for t in $QT_INTERNAL; do
|
---|
1571 | if [ -f "$t/Frameworks/QtCoreVBox.framework/QtCoreVBox" ]; then
|
---|
1572 | cnf_append "VBOX_WITH_ORACLE_QT" "1"
|
---|
1573 | log_success "use internal version"
|
---|
1574 | return
|
---|
1575 | fi
|
---|
1576 | done
|
---|
1577 | # Now try the user provided directory and some of the standard directories.
|
---|
1578 | QT_TRIES="$QT5DIR /System/Library /Library"
|
---|
1579 | for t in $QT_TRIES; do
|
---|
1580 | if [ -f "$t/Frameworks/QtCore.framework/QtCore" -o -f "$t/clang_64/lib/QtCore.framework/QtCore" ]; then
|
---|
1581 | PATH_SDK_QT5="$t"
|
---|
1582 | foundqt5=1
|
---|
1583 | break
|
---|
1584 | fi
|
---|
1585 | done
|
---|
1586 | # Add the necessary params for building the test application
|
---|
1587 | if [ -n "$PATH_SDK_QT5" ]; then
|
---|
1588 | if [ -f "$t/clang_64/lib/QtCore.framework/QtCore" ]; then
|
---|
1589 | INCQT5=-I$PATH_SDK_QT5/clang_64/lib/QtCore.framework/Headers
|
---|
1590 | LIBQT5=-F$PATH_SDK_QT5/clang_64/lib
|
---|
1591 | SDKQT5=$PATH_SDK_QT5/clang_64
|
---|
1592 | else
|
---|
1593 | INCQT5=-I$PATH_SDK_QT5/Frameworks/QtCore.framework/Headers
|
---|
1594 | LIBQT5=-F$PATH_SDK_QT5/Frameworks
|
---|
1595 | SDKQT5=$PATH_SDK_QT5
|
---|
1596 | fi
|
---|
1597 | FLGQT5="-framework QtCore -std=c++11 -Wl,-rpath,`L_to_PATH "$LIBQT5"`"
|
---|
1598 | else
|
---|
1599 | log_failure "Qt5 framework not found (can be disabled using --disable-qt)"
|
---|
1600 | fail
|
---|
1601 | fi
|
---|
1602 | else # !darwin
|
---|
1603 | if [ $QT5DIR_PKGCONFIG -eq 1 ]; then
|
---|
1604 | # Default is to use pkg-config:
|
---|
1605 | if which_wrapper pkg-config > /dev/null; then
|
---|
1606 | qt5_ver=`pkg-config Qt5Core --modversion 2>> $LOG`
|
---|
1607 | if [ $? -eq 0 ]; then
|
---|
1608 | echo "(Qt5 from pkg-config)" >> $LOG
|
---|
1609 | FLGQT5=`pkg-config Qt5Core --cflags`
|
---|
1610 | # gcc 4.8 is able to compile with C++11 (see also VBOX_GCC_std in Config.kmk)
|
---|
1611 | [ $(($cc_maj * 100 + $cc_min)) -ge 408 ] && FLGQT5="$FLGQT5 -std=c++11"
|
---|
1612 | INCQT5=`strip_I "$FLGQT5"`
|
---|
1613 | LIBDIR5=`pkg-config Qt5Core --variable=libdir`
|
---|
1614 | LIBQT5=`pkg-config Qt5Core Qt5Gui --libs`
|
---|
1615 | LIBQT5="-L$LIBDIR5 $LIBQT5"
|
---|
1616 | TOOLQT5=`pkg-config Qt5Core --variable=prefix`
|
---|
1617 | TOOLQT5BIN=`pkg-config Qt5Core --variable=host_bins`
|
---|
1618 | if test_compile "$LIBQT5 $LIBPTHREAD $FLGQT5" qt5 qt5 nofatal; then
|
---|
1619 | test_execute_path "`L_to_PATH "$LIBQT5"`" nofatal && foundqt5=3 # pkg-config
|
---|
1620 | fi
|
---|
1621 | fi
|
---|
1622 | else
|
---|
1623 | log_failure "pkg-config not found"
|
---|
1624 | fail
|
---|
1625 | fi
|
---|
1626 | fi
|
---|
1627 | if [ -z "$foundqt5" ]; then
|
---|
1628 | # Do it the old way (e.g. user has specified QT5DIR):
|
---|
1629 | for q in $QT5DIR "$DEVDIR/linux.$TARGET_MACHINE"/qt/v5.*; do
|
---|
1630 | echo "(Qt5 from '$q')" >> $LOG
|
---|
1631 | INCQT5="$q/include $q/include/QtCore"
|
---|
1632 | FLGQT5="-DQT_SHARED -std=c++11"
|
---|
1633 | I_INCQT5=`prefix_I "$INCQT5"`
|
---|
1634 | LIBQT5="-L$q/lib -lQt5CoreVBox -lQt5GuiVBox"
|
---|
1635 | TOOLQT5="$q"
|
---|
1636 | if test_compile "$LIBQT5 $LIBPTHREAD $I_INCQT5 $FLGQT5" qt5 qt5 nofatal &&
|
---|
1637 | test_execute_path "`L_to_PATH "$LIBQT5"`" nofatal; then
|
---|
1638 | foundqt5=2 # internal
|
---|
1639 | break;
|
---|
1640 | fi
|
---|
1641 | LIBQT5="-L$q/lib -lQt5Core -lQt5Gui"
|
---|
1642 | if test_compile "$LIBQT5 $LIBPTHREAD $I_INCQT5 $FLGQT5" qt5 qt5 nofatal &&
|
---|
1643 | test_execute_path "`L_to_PATH "$LIBQT5"`" nofatal; then
|
---|
1644 | foundqt5=1 # no pkg-config, Qt directory
|
---|
1645 | break;
|
---|
1646 | fi
|
---|
1647 | done
|
---|
1648 | fi
|
---|
1649 | fi
|
---|
1650 | if [ -n "$foundqt5" ]; then
|
---|
1651 | # We decided which version of Qt to use, now enforce the version requirement:
|
---|
1652 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1653 | #include <cstdio>
|
---|
1654 | #include <QtGlobal>
|
---|
1655 | extern "C" int main(void)
|
---|
1656 | {
|
---|
1657 | printf("found version %s", QT_VERSION_STR);
|
---|
1658 | EOF
|
---|
1659 | echo "#if QT_VERSION >= $(($QT5MAJ*65536+$QT5MIN*256))" >> $ODIR.tmp_src.cc
|
---|
1660 | cat >> $ODIR.tmp_src.cc << EOF
|
---|
1661 | printf(", OK.\n");
|
---|
1662 | return 0;
|
---|
1663 | #else
|
---|
1664 | EOF
|
---|
1665 | echo " printf(\", expected version $QT5MAJ.$QT5MIN or higher\\\\n\");" >> $ODIR.tmp_src.cc
|
---|
1666 | cat >> $ODIR.tmp_src.cc << EOF
|
---|
1667 | return 1;
|
---|
1668 | #endif
|
---|
1669 | }
|
---|
1670 | EOF
|
---|
1671 | [ -n "$INCQT5" ] && I_INCQT5=`prefix_I "$INCQT5"`
|
---|
1672 | if test_compile "$LIBQT5 $LIBPTHREAD $I_INCQT5 $FLGQT5" qt5 qt5 nofatal; then
|
---|
1673 | if test_execute_path "`L_to_PATH "$LIBQT5"`"; then
|
---|
1674 | if [ "$OS" = "darwin" ]; then
|
---|
1675 | # Successful build & run the test application so add the necessary
|
---|
1676 | # params to AutoConfig.kmk:
|
---|
1677 | cnf_append "PATH_SDK_QT5_INC" "`L_to_PATH "$LIBQT5"`"
|
---|
1678 | cnf_append "PATH_SDK_QT5_LIB" "`L_to_PATH "$LIBQT5"`"
|
---|
1679 | cnf_append "PATH_SDK_QT5" "$SDKQT5"
|
---|
1680 | # Check for the moc tool in the Qt directory found & some standard
|
---|
1681 | # directories.
|
---|
1682 | for q in $PATH_SDK_QT5 $PATH_SDK_QT5/clang_64 /usr /Developer/Tools/Qt; do
|
---|
1683 | if which_wrapper "$q/bin/moc" > /dev/null; then
|
---|
1684 | cnf_append "PATH_TOOL_QT5_BIN" "$q/bin"
|
---|
1685 | fi
|
---|
1686 | done
|
---|
1687 | else
|
---|
1688 | # Strip .../QtCore as we add components ourself:
|
---|
1689 | INCQT5=`echo "$INCQT5"|$KBUILD_SED 's|\([^ ]*\)/QtCore|\1|g; s| $||g'`
|
---|
1690 | # store only the first path, remove all other paths
|
---|
1691 | # most likely pkg-config gave us -I/usr/include/qt5 -I/usr/include/qt5/QtCore
|
---|
1692 | INCQT5=`echo "$INCQT5"|$KBUILD_SED 's|\([^ ]*\) .*|\1|'`
|
---|
1693 | cnf_append "VBOX_PATH_QT_LIB" "`strip_L "$LIBQT5"`"
|
---|
1694 | cnf_append "PATH_SDK_QT5_INC" "$INCQT5"
|
---|
1695 | # This is not quite right since the qt libpath does not have to be first...
|
---|
1696 | cnf_append "PATH_SDK_QT5_LIB" '$'"(firstword `strip_L "$LIBQT5"`)"
|
---|
1697 | if [ "$foundqt5" = "2" ]; then
|
---|
1698 | cnf_append "VBOX_WITH_ORACLE_QT" "1"
|
---|
1699 | fi
|
---|
1700 | if [ "$foundqt5" != "3" ]; then
|
---|
1701 | TOOLQT5BIN="$TOOLQT5/bin"
|
---|
1702 | fi
|
---|
1703 | test_header "Qt5 devtools"
|
---|
1704 | # Try it with a suffix, some platforms use that
|
---|
1705 | if which_wrapper "$TOOLQT5BIN/moc-qt5" > /dev/null; then
|
---|
1706 | QT5BINSUFF="-qt5"
|
---|
1707 | else
|
---|
1708 | QT5BINSUFF=""
|
---|
1709 | fi
|
---|
1710 | moc_ver=`$TOOLQT5BIN/moc$QT5BINSUFF -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
|
---|
1711 | if [ $? -ne 0 ]; then
|
---|
1712 | log_failure "moc$QT5BINSUFF not working"
|
---|
1713 | fail
|
---|
1714 | else
|
---|
1715 | log_success "found version $moc_ver"
|
---|
1716 | cnf_append "VBOX_PATH_QT" "$TOOLQT5"
|
---|
1717 | cnf_append "PATH_SDK_QT5" "$TOOLQT5"
|
---|
1718 | cnf_append "PATH_TOOL_QT5_BIN" "$TOOLQT5BIN"
|
---|
1719 | [ -n "$QT5BINSUFF" ] && cnf_append "TOOL_QT5_BIN_SUFF" "$QT5BINSUFF"
|
---|
1720 | fi
|
---|
1721 | fi
|
---|
1722 | fi
|
---|
1723 | else
|
---|
1724 | log_failure "qt5 not working"
|
---|
1725 | fail
|
---|
1726 | fi
|
---|
1727 | else
|
---|
1728 | log_failure "qt5 not found"
|
---|
1729 | fail
|
---|
1730 | fi
|
---|
1731 | }
|
---|
1732 |
|
---|
1733 |
|
---|
1734 | #
|
---|
1735 | # Check for libvpx
|
---|
1736 | #
|
---|
1737 | check_vpx()
|
---|
1738 | {
|
---|
1739 | if [ -z "$BUILD_LIBVPX" ]; then
|
---|
1740 | test_header libvpx
|
---|
1741 | if which_wrapper pkg-config > /dev/null; then
|
---|
1742 | libvpx_ver=`pkg-config vpx --modversion 2>> $LOG`
|
---|
1743 | if [ $? -eq 0 ]; then
|
---|
1744 | FLGVPX=`pkg-config vpx --cflags`
|
---|
1745 | INCVPX=`strip_I "$FLGVPX"`
|
---|
1746 | LIBVPX=`pkg-config vpx --libs`
|
---|
1747 | fi
|
---|
1748 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1749 | #include <cstdio>
|
---|
1750 | #include <vpx/vpx_codec.h>
|
---|
1751 | extern "C" int main(void)
|
---|
1752 | {
|
---|
1753 | int version = vpx_codec_version();
|
---|
1754 | int verMajor = VPX_VERSION_MAJOR(version);
|
---|
1755 | int verMinor = VPX_VERSION_MINOR(version);
|
---|
1756 | int verPatch = VPX_VERSION_PATCH(version);
|
---|
1757 | printf("found version %d.%d.%d", verMajor, verMinor, verPatch);
|
---|
1758 | if ( verMajor == 1 && verMinor >= 0
|
---|
1759 | || verMajor == 0 && verMinor == 9 && verPatch >= 5)
|
---|
1760 | {
|
---|
1761 | printf(", OK.\n");
|
---|
1762 | return 0;
|
---|
1763 | }
|
---|
1764 | else
|
---|
1765 | {
|
---|
1766 | printf(", expected version 0.9.5 or higher\n");
|
---|
1767 | return 1;
|
---|
1768 | }
|
---|
1769 | }
|
---|
1770 | EOF
|
---|
1771 | [ -n "$INCVPX" ] && I_INCVPX=`prefix_I "$INCVPX"`
|
---|
1772 | if test_compile "$LIBVPX $I_INCVPX" vpx vpx; then
|
---|
1773 | if test_execute; then
|
---|
1774 | cnf_append "SDK_VBoxLibVpx_INCS" "$INCVPX"
|
---|
1775 | cnf_append "SDK_VBoxLibVpx_LIBS" "`strip_l "$LIBVPX"`"
|
---|
1776 | fi
|
---|
1777 | fi
|
---|
1778 | fi
|
---|
1779 | fi
|
---|
1780 | }
|
---|
1781 |
|
---|
1782 |
|
---|
1783 | #
|
---|
1784 | # Check for libtpms
|
---|
1785 | #
|
---|
1786 | check_libtpms()
|
---|
1787 | {
|
---|
1788 | if [ -z "$BUILD_LIBTPMS" ]; then
|
---|
1789 | test_header libtpms
|
---|
1790 | if which_wrapper pkg-config > /dev/null; then
|
---|
1791 | libtpms_ver=`pkg-config libtpms --modversion 2>> $LOG`
|
---|
1792 | if [ $? -eq 0 ]; then
|
---|
1793 | FLGTPMS=`pkg-config libtpms --cflags`
|
---|
1794 | INCTPMS=`strip_I "$FLGTPMS"`
|
---|
1795 | LIBTPMS=`pkg-config libtpms --libs`
|
---|
1796 | fi
|
---|
1797 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1798 | #include <cstdio>
|
---|
1799 | #include <libtpms/tpm_library.h>
|
---|
1800 | extern "C" int main(void)
|
---|
1801 | {
|
---|
1802 | TPMLIB_MainInit();
|
---|
1803 | printf("found, OK.\n");
|
---|
1804 | }
|
---|
1805 | EOF
|
---|
1806 | [ -n "$INCTPMS" ] && I_INCTPMS=`prefix_I "$INCTPMS"`
|
---|
1807 | if test_compile "$LIBTPMS $I_INCTPMS" libtpms libtpms nofatal; then
|
---|
1808 | if test_execute; then
|
---|
1809 | cnf_append "SDK_VBoxLibTpms_INCS" "$INCTPMS"
|
---|
1810 | cnf_append "SDK_VBoxLibTpms_LIBS" "`strip_l "$LIBTPMS"`"
|
---|
1811 | fi
|
---|
1812 | else
|
---|
1813 | echo "not found -- building libtpms from in-tree code."
|
---|
1814 | fi
|
---|
1815 | fi
|
---|
1816 | fi
|
---|
1817 | }
|
---|
1818 |
|
---|
1819 |
|
---|
1820 | #
|
---|
1821 | # Check for liblzma
|
---|
1822 | #
|
---|
1823 | check_liblzma()
|
---|
1824 | {
|
---|
1825 | if [ -z "$BUILD_LIBLZMA" ]; then
|
---|
1826 | test_header liblzma
|
---|
1827 | if which_wrapper pkg-config > /dev/null; then
|
---|
1828 | liblzma_ver=`pkg-config liblzma --modversion 2>> $LOG`
|
---|
1829 | if [ $? -eq 0 ]; then
|
---|
1830 | FLGLZMA=`pkg-config liblzma --cflags`
|
---|
1831 | INCLZMA=`strip_I "$FLGLZMA"`
|
---|
1832 | LIBLZMA=`pkg-config liblzma --libs`
|
---|
1833 | fi
|
---|
1834 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1835 | #include <cstdio>
|
---|
1836 | #include <lzma.h>
|
---|
1837 | extern "C" int main(void)
|
---|
1838 | {
|
---|
1839 | lzma_stream strm = LZMA_STREAM_INIT;
|
---|
1840 | uint32_t preset;
|
---|
1841 | lzma_ret ret = lzma_easy_encoder(&strm, preset, LZMA_CHECK_CRC64);
|
---|
1842 | printf("found, OK.\n");
|
---|
1843 | }
|
---|
1844 | EOF
|
---|
1845 | [ -n "$INCLZMA" ] && I_INCLZMA=`prefix_I "$INCLZMA"`
|
---|
1846 | if test_compile "$LIBLZMA $I_INCLZMA" liblzma liblzma nofatal; then
|
---|
1847 | if test_execute; then
|
---|
1848 | cnf_append "SDK_VBoxLibLzma_INCS" "$INCLZMA"
|
---|
1849 | cnf_append "SDK_VBoxLibLzma_LIBS" "`strip_l "$LIBLZMA"`"
|
---|
1850 | fi
|
---|
1851 | else
|
---|
1852 | echo "not found -- building liblzma from in-tree code."
|
---|
1853 | fi
|
---|
1854 | fi
|
---|
1855 | fi
|
---|
1856 | }
|
---|
1857 |
|
---|
1858 |
|
---|
1859 | #
|
---|
1860 | # Check for libvorbis
|
---|
1861 | #
|
---|
1862 | check_libvorbis()
|
---|
1863 | {
|
---|
1864 | test_header libvorbis
|
---|
1865 | if which_wrapper pkg-config > /dev/null; then
|
---|
1866 | libvorbis_ver=`pkg-config vorbis --modversion 2>> $LOG`
|
---|
1867 | if [ $? -eq 0 ]; then
|
---|
1868 | FLGVRB=`pkg-config vorbis --cflags`
|
---|
1869 | INCVRB=`strip_I "$FLGVRB"`
|
---|
1870 | LIBVRB=`pkg-config vorbis --libs`
|
---|
1871 | fi
|
---|
1872 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1873 | #include <cstdio>
|
---|
1874 | #include <vorbis/vorbisenc.h>
|
---|
1875 | extern "C" int main(void)
|
---|
1876 | {
|
---|
1877 | vorbis_info v;
|
---|
1878 | vorbis_info_init(&v);
|
---|
1879 | printf("found, OK.\n");
|
---|
1880 | return 0;
|
---|
1881 | }
|
---|
1882 | EOF
|
---|
1883 | [ -n "$INCVRB" ] && I_INCVRB=`prefix_I "$INCVRB"`
|
---|
1884 | if test_compile "$LIBVRB $I_INCVRB" vorbis vorbis nofatal; then
|
---|
1885 | if test_execute; then
|
---|
1886 | cnf_append "SDK_VBoxLibVorbis_INCS" "$INCVRB"
|
---|
1887 | cnf_append "SDK_VBoxLibVorbis_LIBS" "`strip_l "$LIBVRB"`"
|
---|
1888 | fi
|
---|
1889 | else
|
---|
1890 | echo "not found -- building libvorbis from in-tree code."
|
---|
1891 | fi
|
---|
1892 | fi
|
---|
1893 | }
|
---|
1894 |
|
---|
1895 |
|
---|
1896 | #
|
---|
1897 | # Check for libogg
|
---|
1898 | #
|
---|
1899 | check_libogg()
|
---|
1900 | {
|
---|
1901 | test_header libogg
|
---|
1902 | if which_wrapper pkg-config > /dev/null; then
|
---|
1903 | libogg_ver=`pkg-config ogg --modversion 2>> $LOG`
|
---|
1904 | if [ $? -eq 0 ]; then
|
---|
1905 | FLGOGG=`pkg-config ogg --cflags`
|
---|
1906 | INCOGG=`strip_I "$FLGOGG"`
|
---|
1907 | LIBOGG=`pkg-config ogg --libs`
|
---|
1908 | fi
|
---|
1909 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1910 | #include <cstdio>
|
---|
1911 | #include <ogg/ogg.h>
|
---|
1912 | extern "C" int main(void)
|
---|
1913 | {
|
---|
1914 | oggpack_buffer o;
|
---|
1915 | oggpack_get_buffer(&o);
|
---|
1916 | printf("found, OK.\n");
|
---|
1917 | return 0;
|
---|
1918 | }
|
---|
1919 | EOF
|
---|
1920 | [ -n "$INCOGG" ] && I_INCVRB=`prefix_I "$INCOGG"`
|
---|
1921 | if test_compile "$LIBOGG $I_INCOGG" ogg ogg nofatal; then
|
---|
1922 | if test_execute; then
|
---|
1923 | cnf_append "SDK_VBoxLibOgg_INCS" "$INCOGG"
|
---|
1924 | cnf_append "SDK_VBoxLibOgg_LIBS" "`strip_l "$LIBOGG"`"
|
---|
1925 | fi
|
---|
1926 | else
|
---|
1927 | echo "not found -- building libogg from in-tree code."
|
---|
1928 | fi
|
---|
1929 | fi
|
---|
1930 | }
|
---|
1931 |
|
---|
1932 |
|
---|
1933 | #
|
---|
1934 | # Check whether static libstdc++ is installed. This library is required
|
---|
1935 | # for the Linux guest additions.
|
---|
1936 | #
|
---|
1937 | check_staticlibstdcxx()
|
---|
1938 | {
|
---|
1939 | test_header "static stc++ library"
|
---|
1940 | libstdcxx=`$CXX -print-file-name=libstdc++.a`
|
---|
1941 | cat > $ODIR.tmp_src.cc << EOF
|
---|
1942 | #include <string>
|
---|
1943 |
|
---|
1944 | extern "C" int main(void)
|
---|
1945 | {
|
---|
1946 | std::string s = "test";
|
---|
1947 | return 0;
|
---|
1948 | }
|
---|
1949 | EOF
|
---|
1950 | if test_compile "$libstdcxx" libstdc++ libstdc++; then
|
---|
1951 | log_success "found"
|
---|
1952 | fi
|
---|
1953 | }
|
---|
1954 |
|
---|
1955 |
|
---|
1956 | #
|
---|
1957 | # Check for Linux sources
|
---|
1958 | #
|
---|
1959 | check_linux()
|
---|
1960 | {
|
---|
1961 | test_header "Linux kernel sources"
|
---|
1962 | cat > $ODIR.tmp_src.c << EOF
|
---|
1963 | #include <linux/version.h>
|
---|
1964 | int printf(const char *format, ...);
|
---|
1965 | int main(void)
|
---|
1966 | {
|
---|
1967 | printf("found version %d.%d.%d", LINUX_VERSION_CODE / 65536,
|
---|
1968 | (LINUX_VERSION_CODE % 65536) / 256,
|
---|
1969 | LINUX_VERSION_CODE % 256);
|
---|
1970 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,0)
|
---|
1971 | printf(", OK.\n");
|
---|
1972 | return 0;
|
---|
1973 | #else
|
---|
1974 | printf(", expected version 2.4.0 or higher\n");
|
---|
1975 | return 1;
|
---|
1976 | #endif
|
---|
1977 | }
|
---|
1978 | EOF
|
---|
1979 | echo "compiling the following source file:" >> $LOG
|
---|
1980 | cat $ODIR.tmp_src.c >> $LOG
|
---|
1981 | echo "using the following command line:" >> $LOG
|
---|
1982 | echo "$CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include " \
|
---|
1983 | "-I$LINUX/include/generated/uapi" >> $LOG
|
---|
1984 | $CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include \
|
---|
1985 | -I$LINUX/include/generated/uapi >> $LOG 2>&1
|
---|
1986 | if [ $? -ne 0 ]; then
|
---|
1987 | echo
|
---|
1988 | echo " Linux kernel headers not found at $LINUX"
|
---|
1989 | echo " Check the file $LOG for detailed error information."
|
---|
1990 | fail
|
---|
1991 | else
|
---|
1992 | if test_execute; then
|
---|
1993 | cnf_append "VBOX_LINUX_SRC" "`cd $LINUX ; pwd`"
|
---|
1994 | fi
|
---|
1995 | fi
|
---|
1996 | }
|
---|
1997 |
|
---|
1998 | #
|
---|
1999 | # Check for kchmviewer, needed to display the online help
|
---|
2000 | # (unused as we ship kchmviewer)
|
---|
2001 | #
|
---|
2002 | check_kchmviewer()
|
---|
2003 | {
|
---|
2004 | test_header kchmviewer
|
---|
2005 | if check_avail "$KCHMVIEWER" KCHMVIEWER; then
|
---|
2006 | kchmviewer_ver=`$KCHMVIEWER --version|grep "^KchmViewer:"|sed 's+^KchmViewer: \(.*\)+\1+'`
|
---|
2007 | if [ $? -ne 0 ]; then
|
---|
2008 | log_failure "kchmviewer not working"
|
---|
2009 | fail
|
---|
2010 | else
|
---|
2011 | log_success "found version $kchmviewer_ver"
|
---|
2012 | fi
|
---|
2013 | fi
|
---|
2014 | }
|
---|
2015 |
|
---|
2016 |
|
---|
2017 | #
|
---|
2018 | # Check for the kBuild tools, we don't support GNU make
|
---|
2019 | #
|
---|
2020 | check_kbuild()
|
---|
2021 | {
|
---|
2022 | test_header kBuild
|
---|
2023 | if which_wrapper "$KBUILDDIR/bin/$OS.$BUILD_MACHINE/kmk" > /dev/null; then
|
---|
2024 | KBUILDDIR_BIN="$KBUILDDIR/bin/$OS.$BUILD_MACHINE"
|
---|
2025 |
|
---|
2026 | echo "KBUILD_PATH=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
|
---|
2027 | echo "KBUILD_DEVTOOLS=\"$DEVDIR\"" >> $ENV
|
---|
2028 | echo 'path_kbuild_bin="$KBUILD_PATH/bin/$BUILD_TARGET.$BUILD_PLATFORM_ARCH"' >> $ENV
|
---|
2029 | echo 'path_tools_bin="$KBUILD_DEVTOOLS/$BUILD_TARGET.$BUILD_PLATFORM_ARCH/bin"' >> $ENV
|
---|
2030 |
|
---|
2031 | if [ "$OS" = "solaris" ]; then
|
---|
2032 | # Because of sh being non-default shell in Solaris we need to export PATH again when
|
---|
2033 | # sourcing env.sh. Simply exporting from ./configure does not export PATH correctly.
|
---|
2034 | echo "PATH=\"$ORGPATH\"" >> $ENV
|
---|
2035 | echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
|
---|
2036 | echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_tools_bin\" || PATH=\"\$path_tools_bin:\$PATH\"" >> $ENV
|
---|
2037 | else
|
---|
2038 | echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
|
---|
2039 | echo "echo \"\$PATH\" | grep -q \"\$path_tools_bin\" || PATH=\"\$path_tools_bin:\$PATH\"" >> $ENV
|
---|
2040 | fi
|
---|
2041 | echo "export KBUILD_PATH KBUILD_DEVTOOLS PATH" >> $ENV
|
---|
2042 | echo "unset path_kbuild_bin path_tools_bin" >> $ENV
|
---|
2043 | KBUILD_SED="$KBUILDDIR_BIN/kmk_sed"
|
---|
2044 |
|
---|
2045 | echo '' >> $ENV
|
---|
2046 | echo "# Legacy - do not use:" >> $ENV
|
---|
2047 | echo 'PATH_KBUILD=${KBUILD_PATH}' >> $ENV
|
---|
2048 | echo 'PATH_DEVTOOLS=${KBUILD_DEVTOOLS}' >> $ENV
|
---|
2049 | echo 'export PATH_KBUILD PATH_DEVTOOLS' >> $ENV
|
---|
2050 | echo '' >> $ENV
|
---|
2051 | elif check_avail "kmk" KBUILDDIR really; then
|
---|
2052 | # check for installed kBuild
|
---|
2053 | KBUILD_SED="`which_wrapper kmk_sed`"
|
---|
2054 | else
|
---|
2055 | fail
|
---|
2056 | fi
|
---|
2057 | log_success "found"
|
---|
2058 | }
|
---|
2059 |
|
---|
2060 |
|
---|
2061 | #
|
---|
2062 | # Check for compiler.h
|
---|
2063 | # Some Linux distributions include "compiler.h" in their libc linux
|
---|
2064 | # headers package, some don't. Most don't need it, building might (!)
|
---|
2065 | # not succeed on openSUSE without it.
|
---|
2066 | #
|
---|
2067 | # See http://www.mail-archive.com/qemu-devel%40nongnu.org/msg07980.html
|
---|
2068 | #
|
---|
2069 | check_compiler_h()
|
---|
2070 | {
|
---|
2071 | test_header compiler.h
|
---|
2072 | if test ! -f "/usr/include/linux/compiler.h"; then
|
---|
2073 | log_success "compiler.h not found"
|
---|
2074 | else
|
---|
2075 | cnf_append "VBOX_WITH_LINUX_COMPILER_H" "1"
|
---|
2076 | log_success "compiler.h found"
|
---|
2077 | fi
|
---|
2078 | }
|
---|
2079 |
|
---|
2080 | #
|
---|
2081 | # Check for libcap.
|
---|
2082 | # Required to pass CAP_NET_RAW to our binaries to allow to open SOCK_RAW
|
---|
2083 | # sockets for doing ICMP requests.
|
---|
2084 | #
|
---|
2085 | check_libcap()
|
---|
2086 | {
|
---|
2087 | test_header "libcap library"
|
---|
2088 | cat > $ODIR.tmp_src.cc << EOF
|
---|
2089 | #include <cstdio>
|
---|
2090 | #include <sys/types.h>
|
---|
2091 | #include <linux/types.h>
|
---|
2092 | #include <sys/capability.h>
|
---|
2093 |
|
---|
2094 | extern "C" int main(void)
|
---|
2095 | {
|
---|
2096 | char buf[1024];
|
---|
2097 | cap_t caps = cap_get_proc();
|
---|
2098 | snprintf(buf, sizeof(buf), "Current caps are '%s'\n", cap_to_text(caps, NULL));
|
---|
2099 | return 0;
|
---|
2100 | }
|
---|
2101 | EOF
|
---|
2102 | if test_compile $LIBCAP libcap libcap; then
|
---|
2103 | if test_execute; then
|
---|
2104 | log_success "found"
|
---|
2105 | fi
|
---|
2106 | fi
|
---|
2107 | }
|
---|
2108 |
|
---|
2109 | #
|
---|
2110 | # Check if we are able to build 32-bit applications (needed for the guest additions)
|
---|
2111 | #
|
---|
2112 | check_32bit()
|
---|
2113 | {
|
---|
2114 | test_header "32-bit support"
|
---|
2115 | cat > $ODIR.tmp_src.c << EOF
|
---|
2116 | #include <stdint.h>
|
---|
2117 | int main(void)
|
---|
2118 | {
|
---|
2119 | return 0;
|
---|
2120 | }
|
---|
2121 | EOF
|
---|
2122 | echo "compiling the following source file:" >> $LOG
|
---|
2123 | cat $ODIR.tmp_src.c >> $LOG
|
---|
2124 | echo "using the following command line:" >> $LOG
|
---|
2125 | echo "$CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c" >> $LOG
|
---|
2126 | $CC -m32 -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c >> $LOG 2>&1
|
---|
2127 | if [ $? -ne 0 ]; then
|
---|
2128 | echo
|
---|
2129 | echo " Cannot compile 32-bit applications (missing headers and/or libraries)!"
|
---|
2130 | echo " Check the file $LOG for detailed error information."
|
---|
2131 | fail
|
---|
2132 | else
|
---|
2133 | echo "executing the binary" >> $LOG
|
---|
2134 | $ODIR.tmp_out 2> $ODIR.test_execute.log
|
---|
2135 | rc=$?
|
---|
2136 | cat $ODIR.test_execute.log >> $LOG
|
---|
2137 | if [ $rc -ne 0 ]; then
|
---|
2138 | echo
|
---|
2139 | echo " Cannot execute 32-bit applications! Either enable 32-bit support in the"
|
---|
2140 | echo " kernel configuration or use --disable-vmmraw to disable 32-bit guests."
|
---|
2141 | fail
|
---|
2142 | return 1
|
---|
2143 | fi
|
---|
2144 | fi
|
---|
2145 | log_success ""
|
---|
2146 | }
|
---|
2147 |
|
---|
2148 |
|
---|
2149 | #
|
---|
2150 | # Check for Python
|
---|
2151 | #
|
---|
2152 | check_python()
|
---|
2153 | {
|
---|
2154 | test_header "Python support"
|
---|
2155 |
|
---|
2156 | # On darwin this is a on/off decision only
|
---|
2157 | if [ "$OS" = "darwin" ]; then
|
---|
2158 | echo "enabled"
|
---|
2159 | cnf_append "VBOX_WITH_PYTHON" "1"
|
---|
2160 | return
|
---|
2161 | fi
|
---|
2162 |
|
---|
2163 | cat > $ODIR.tmp_src.cc << EOF
|
---|
2164 | #include <cstdio>
|
---|
2165 | #include <Python.h>
|
---|
2166 | extern "C" int main(void)
|
---|
2167 | {
|
---|
2168 | Py_Initialize();
|
---|
2169 | printf("found version %s", PY_VERSION);
|
---|
2170 | #if PY_VERSION_HEX >= 0x02060000
|
---|
2171 | printf(", OK.\n");
|
---|
2172 | return 0;
|
---|
2173 | #else
|
---|
2174 | printf(", expected version 2.6 or higher\n");
|
---|
2175 | return 1;
|
---|
2176 | #endif
|
---|
2177 | }
|
---|
2178 | EOF
|
---|
2179 | found=
|
---|
2180 | SUPPYTHONLIBS="python2.7 python2.6 python3.1 python3.2 python3.3 python3.4 python3.4m python3.5 python3.5m python3.6 python3.6m python3.7 python3.7m python3.8 python3.9 python3.10 python3.11 python3.12"
|
---|
2181 | for p in $PYTHONDIR; do
|
---|
2182 | for d in $SUPPYTHONLIBS; do
|
---|
2183 | for b in lib/x86_64-linux-gnu lib/i386-linux-gnu lib64 lib/64 lib; do
|
---|
2184 | echo "compiling the following source file:" >> $LOG
|
---|
2185 | cat $ODIR.tmp_src.cc >> $LOG
|
---|
2186 | echo "using the following command line:" >> $LOG
|
---|
2187 | echo "$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so" >> $LOG
|
---|
2188 | $CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so >> $LOG 2>&1
|
---|
2189 | if [ $? -eq 0 ]; then
|
---|
2190 | found=1
|
---|
2191 | break
|
---|
2192 | fi
|
---|
2193 | done
|
---|
2194 | if [ -n "$found" ]; then break; fi
|
---|
2195 | done
|
---|
2196 | if [ -n "$found" ]; then break; fi
|
---|
2197 | done
|
---|
2198 | if [ -n "$found" ]; then
|
---|
2199 | if test_execute; then
|
---|
2200 | cnf_append "VBOX_WITH_PYTHON" "1"
|
---|
2201 | cnf_append "VBOX_PATH_PYTHON_INC" "$p/include/$d"
|
---|
2202 | cnf_append "VBOX_LIB_PYTHON" "$p/$b/lib$d.so"
|
---|
2203 | else
|
---|
2204 | log_failure "Python not working"
|
---|
2205 | fail
|
---|
2206 | fi
|
---|
2207 | else
|
---|
2208 | log_failure "Python not found"
|
---|
2209 | fail
|
---|
2210 | fi
|
---|
2211 | }
|
---|
2212 |
|
---|
2213 |
|
---|
2214 | #
|
---|
2215 | # Check for Java
|
---|
2216 | #
|
---|
2217 | check_java()
|
---|
2218 | {
|
---|
2219 | test_header "Java support"
|
---|
2220 | log_success
|
---|
2221 | }
|
---|
2222 |
|
---|
2223 |
|
---|
2224 | #
|
---|
2225 | # Setup wine
|
---|
2226 | #
|
---|
2227 | setup_wine()
|
---|
2228 | {
|
---|
2229 | test_header "Wine support"
|
---|
2230 | if ! which_wrapper wine > /dev/null; then
|
---|
2231 | echo " wine binary not found"
|
---|
2232 | fail
|
---|
2233 | fi
|
---|
2234 | if ! which_wrapper wine > /dev/null; then
|
---|
2235 | echo " wine not found"
|
---|
2236 | fail
|
---|
2237 | fi
|
---|
2238 | wine_version="`wine --version`"
|
---|
2239 | case "`expr "$wine_version" : 'wine-\([0-9.]*\)' '>' 1.1.43`" in
|
---|
2240 | "0")
|
---|
2241 | if ! which_wrapper wineprefixcreate > /dev/null; then
|
---|
2242 | echo " wineprefixcreate not found"
|
---|
2243 | fail
|
---|
2244 | fi
|
---|
2245 | ;;
|
---|
2246 | *) eval "wineprefixcreate() { true ; }" ;; # now created automatically
|
---|
2247 | esac
|
---|
2248 | export WINEPREFIX="${ODIR}wine.$BUILD_MACHINE"
|
---|
2249 | echo "WINEPREFIX=\"${ODIR}wine.$BUILD_MACHINE\"" >> $ENV
|
---|
2250 | echo "export WINEPREFIX" >> $ENV
|
---|
2251 | rm -rf $WINEPREFIX
|
---|
2252 | mkdir -p $WINEPREFIX
|
---|
2253 | touch $WINEPREFIX/.no_prelaunch_window_flag
|
---|
2254 | if ! wineprefixcreate -q > /dev/null 2>&1; then
|
---|
2255 | echo " wineprefixcreate failed"
|
---|
2256 | fail
|
---|
2257 | fi
|
---|
2258 | tmp=.tmp.wine.reg
|
---|
2259 | rm -f $tmp
|
---|
2260 | echo 'REGEDIT4' > $tmp
|
---|
2261 | echo '' >> $tmp
|
---|
2262 | echo '[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment]' >> $tmp
|
---|
2263 | echo "\"PATH\"=\"c:\\\\\\\\windows\\\\\\\\system32;c:\\\\\\\\windows;z:$DEVDIR/win.x86/vcc/v8/bin/Microsoft.VC80.CRT;z:$DEVDIR/win.x86/HTML_Help_Workshop/v1.3\"" >> $tmp
|
---|
2264 | echo '' >> $tmp
|
---|
2265 | echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhc.exe\DllOverrides]' >> $tmp
|
---|
2266 | echo '"itss"="native"' >> $tmp
|
---|
2267 | echo '' >> $tmp
|
---|
2268 | echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhw.exe\DllOverrides]' >> $tmp
|
---|
2269 | echo '"itss"="native"' >> $tmp
|
---|
2270 | echo '' >> $tmp
|
---|
2271 | if ! wine regedit $tmp > /dev/null 2>&1; then
|
---|
2272 | rm -f $tmp
|
---|
2273 | echo " failed to load registry changes (path)."
|
---|
2274 | fail
|
---|
2275 | fi
|
---|
2276 | rm -f $tmp
|
---|
2277 | log_success "found"
|
---|
2278 | }
|
---|
2279 |
|
---|
2280 |
|
---|
2281 | #
|
---|
2282 | # Check for gSOAP.
|
---|
2283 | #
|
---|
2284 | check_gsoap()
|
---|
2285 | {
|
---|
2286 | test_header "GSOAP compiler"
|
---|
2287 | if [ -z "$GSOAP" -a -z "$GSOAP_IMPORT" ]; then
|
---|
2288 | if which_wrapper pkg-config > /dev/null; then
|
---|
2289 | GSOAP_CXX_LIBS=`pkg-config gsoapssl++ --libs 2>> $LOG`
|
---|
2290 | if [ $? -eq 0 ]; then
|
---|
2291 | GSOAP=`pkg-config gsoapssl++ --variable=exec_prefix`
|
---|
2292 | GSOAP_IMPORT="$GSOAP/share/gsoap/import"
|
---|
2293 | if [ ! -d "$GSOAP_IMPORT" -a -d "$GSOAP/include/gsoap" ]; then
|
---|
2294 | GSOAP_IMPORT="$GSOAP/include/gsoap"
|
---|
2295 | fi
|
---|
2296 | cnf_append "VBOX_GSOAP_INSTALLED" "1"
|
---|
2297 | cnf_append "VBOX_PATH_GSOAP" "$GSOAP"
|
---|
2298 | cnf_append "VBOX_PATH_GSOAP_IMPORT" "$GSOAP_IMPORT"
|
---|
2299 | if [ -f "$GSOAP/share/gsoap/stdsoap2.cpp" ]; then
|
---|
2300 | cnf_append "VBOX_GSOAP_CXX_SOURCES" "$GSOAP/share/gsoap/stdsoap2.cpp"
|
---|
2301 | else
|
---|
2302 | cnf_append "VBOX_GSOAP_CXX_SOURCES" ""
|
---|
2303 | fi
|
---|
2304 | cnf_append "VBOX_GSOAP_CXX_LIBS" "`strip_l "$GSOAP_CXX_LIBS"`"
|
---|
2305 | gsoap_version=`pkg-config gsoapssl++ --modversion`
|
---|
2306 | log_success "found version $gsoap_version"
|
---|
2307 | return
|
---|
2308 | fi
|
---|
2309 | fi
|
---|
2310 | if [ -d "$DEVDIR/common/gsoap" ]; then
|
---|
2311 | GSOAP_DIR=`ls -d1 "$DEVDIR"/common/gsoap/v* 2>/dev/null | tail -1`
|
---|
2312 | if [ -n "$GSOAP_DIR" -a -d "$GSOAP_DIR" ]; then
|
---|
2313 | gsoap_version=`echo "$GSOAP_DIR" | sed -ne 's/^.*\/v\([1-9][0-9.]*\).*$/\1/p'`
|
---|
2314 | log_success "found gSOAP tool version $gsoap_version"
|
---|
2315 | # No need to configure anything, the build system knows what to do.
|
---|
2316 | return
|
---|
2317 | fi
|
---|
2318 | fi
|
---|
2319 | fi
|
---|
2320 | if [ -z "$GSOAP" ]; then
|
---|
2321 | GSOAP="/usr"
|
---|
2322 | fi
|
---|
2323 | if which_wrapper "$GSOAP/bin/soapcpp2" > /dev/null; then
|
---|
2324 | if which_wrapper "$GSOAP/bin/wsdl2h" > /dev/null; then
|
---|
2325 | if [ -f "$GSOAP/include/stdsoap2.h" ]; then
|
---|
2326 | # TODO: Check for libgsoap++.a/so
|
---|
2327 |
|
---|
2328 | if [ -z "$GSOAP_IMPORT" ]; then
|
---|
2329 | GSOAP_IMPORT="$GSOAP/share/gsoap/import"
|
---|
2330 | if [ ! -d "$GSOAP_IMPORT" -a -d "$GSOAP/include/gsoap" ]; then
|
---|
2331 | GSOAP_IMPORT="$GSOAP/include/gsoap"
|
---|
2332 | fi
|
---|
2333 | fi
|
---|
2334 | if [ -f "$GSOAP_IMPORT/stlvector.h" ]; then
|
---|
2335 | cnf_append "VBOX_GSOAP_INSTALLED" "1"
|
---|
2336 | cnf_append "VBOX_PATH_GSOAP" "$GSOAP"
|
---|
2337 | cnf_append "VBOX_PATH_GSOAP_IMPORT" "$GSOAP_IMPORT"
|
---|
2338 | if [ -f "$GSOAP/share/gsoap/stdsoap2.cpp" ]; then
|
---|
2339 | cnf_append "VBOX_GSOAP_CXX_SOURCES" "$GSOAP/share/gsoap/stdsoap2.cpp"
|
---|
2340 | else
|
---|
2341 | cnf_append "VBOX_GSOAP_CXX_SOURCES" ""
|
---|
2342 | fi
|
---|
2343 | cnf_append "VBOX_GSOAP_CXX_LIBS" "libgsoapssl++"
|
---|
2344 | log_success "found"
|
---|
2345 | else
|
---|
2346 | log_failure "stlvector.h not found -- disabling webservice"
|
---|
2347 | cnf_append "VBOX_WITH_WEBSERVICES" ""
|
---|
2348 | fi
|
---|
2349 | else
|
---|
2350 | log_failure "stdsoap2.h not found -- disabling webservice"
|
---|
2351 | cnf_append "VBOX_WITH_WEBSERVICES" ""
|
---|
2352 | fi
|
---|
2353 | else
|
---|
2354 | log_failure "wsdl2h not found -- disabling webservice"
|
---|
2355 | cnf_append "VBOX_WITH_WEBSERVICES" ""
|
---|
2356 | fi
|
---|
2357 | else
|
---|
2358 | log_failure "soapcpp2 not found -- disabling webservice"
|
---|
2359 | cnf_append "VBOX_WITH_WEBSERVICES" ""
|
---|
2360 | fi
|
---|
2361 | }
|
---|
2362 |
|
---|
2363 |
|
---|
2364 | #
|
---|
2365 | # Determines the Darwin version.
|
---|
2366 | #
|
---|
2367 | check_darwinversion()
|
---|
2368 | {
|
---|
2369 | test_header "Darwin version"
|
---|
2370 | darwin_ver=`uname -r`
|
---|
2371 | case "$darwin_ver" in
|
---|
2372 | 20\.*)
|
---|
2373 | darwin_ver="11.0" # Big Sur
|
---|
2374 | ;;
|
---|
2375 | 19\.*)
|
---|
2376 | darwin_ver="10.15" # Catalina
|
---|
2377 | ;;
|
---|
2378 | 18\.*)
|
---|
2379 | darwin_ver="10.14" # Mojave
|
---|
2380 | ;;
|
---|
2381 | 17\.*)
|
---|
2382 | darwin_ver="10.13" # High Sierra
|
---|
2383 | ;;
|
---|
2384 | 16\.*)
|
---|
2385 | darwin_ver="10.12" # Sierra
|
---|
2386 | ;;
|
---|
2387 | 15\.*)
|
---|
2388 | darwin_ver="10.11" # El Capitan
|
---|
2389 | ;;
|
---|
2390 | 14\.*)
|
---|
2391 | darwin_ver="10.10" # Yosemite
|
---|
2392 | ;;
|
---|
2393 | 13\.*)
|
---|
2394 | darwin_ver="10.9" # Mavericks
|
---|
2395 | ;;
|
---|
2396 | *)
|
---|
2397 | echo " failed to determine Darwin version. (uname -r: $darwin_ver)"
|
---|
2398 | fail
|
---|
2399 | darwin_ver="unknown"
|
---|
2400 | ;;
|
---|
2401 | esac
|
---|
2402 |
|
---|
2403 | log_success "found version $darwin_ver"
|
---|
2404 | }
|
---|
2405 |
|
---|
2406 | #
|
---|
2407 | # Check Xcode path
|
---|
2408 | #
|
---|
2409 | check_xcode_path()
|
---|
2410 | {
|
---|
2411 | # Check if WITH_XCODE_DIR is set.
|
---|
2412 | if [ -z "$WITH_XCODE_DIR" ]; then
|
---|
2413 | if [ -d "/Library/Developer/CommandLineTools" -a -f "/Library/Developer/CommandLineTools/usr/bin/clang" ]; then
|
---|
2414 | return 1
|
---|
2415 | else
|
---|
2416 | echo "Please specify --with-xcode-dir option."
|
---|
2417 | return 0
|
---|
2418 | fi
|
---|
2419 | fi
|
---|
2420 |
|
---|
2421 | # Check if specified path exists and is a directory containing Xcode.
|
---|
2422 | if [ -d "$1" -a -f "$1/Contents/Developer/usr/bin/xcodebuild" ]; then
|
---|
2423 | return 1
|
---|
2424 | else
|
---|
2425 | echo "Xcode path [$1] not found."
|
---|
2426 | return 0
|
---|
2427 | fi
|
---|
2428 | }
|
---|
2429 |
|
---|
2430 | check_xcode()
|
---|
2431 | {
|
---|
2432 | test_header "Xcode and SDK"
|
---|
2433 | check_xcode_path "$WITH_XCODE_DIR"
|
---|
2434 | [ $? -eq 1 ] || fail
|
---|
2435 |
|
---|
2436 | # Pick the oldest SDK offered by Xcode, to get maximum compatibility
|
---|
2437 | if [ -z "$WITH_XCODE_DIR" ]; then
|
---|
2438 | devel_subdir="/Library/Developer/CommandLineTools"
|
---|
2439 | sdk_subdir="$devel_subdir/SDKs"
|
---|
2440 | else
|
---|
2441 | devel_subdir="$WITH_XCODE_DIR/Contents/Developer"
|
---|
2442 | sdk_subdir="$devel_subdir/Platforms/MacOSX.platform/Developer/SDKs"
|
---|
2443 | fi
|
---|
2444 | sdk_tries="$sdk_subdir"/MacOSX10.?.sdk" $sdk_subdir"/MacOSX10.??.sdk" $sdk_subdir"/MacOSX.sdk
|
---|
2445 | for t in $sdk_tries; do
|
---|
2446 | if [ -f "$t/SDKSettings.plist" ]; then
|
---|
2447 | sdk="$t"
|
---|
2448 | sdk_ver=`defaults read "$t/SDKSettings.plist" Version`
|
---|
2449 | break
|
---|
2450 | fi
|
---|
2451 | done
|
---|
2452 | if [ -z "$sdk" ]; then
|
---|
2453 | echo " failed to determine SDK directory. ($sdk_subdir/MacOSX*.sdk/SDKSettings.plist should exist)"
|
---|
2454 | fail
|
---|
2455 | fi
|
---|
2456 | xcode_ver=`$devel_subdir/usr/bin/clang --version | sed -n 's/^.*version \([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\).*$/\1/p'`
|
---|
2457 | if [ $? -ne 0 -o -z "$xcode_ver" ]; then
|
---|
2458 | echo " failed to determine Xcode version."
|
---|
2459 | fail
|
---|
2460 | fi
|
---|
2461 |
|
---|
2462 | if [ -z "$WITH_XCODE_DIR" ]; then
|
---|
2463 | cnf_append "VBOX_WITH_EVEN_NEWER_XCODE" "1"
|
---|
2464 | else
|
---|
2465 | cnf_append "VBOX_WITH_MACOSX_COMPILERS_FROM_DEVEL" "1"
|
---|
2466 | cnf_append "PATH_TOOL_VBoxXcode62" "$devel_subdir"
|
---|
2467 | cnf_append "VBOX_PATH_MACOSX_DEVEL_ROOT" "$devel_subdir"
|
---|
2468 | fi
|
---|
2469 | cnf_append "VBOX_PATH_MACOSX_SDK" "$sdk"
|
---|
2470 | if [ -n "$sdk_ver" ]; then
|
---|
2471 | cnf_append "VBOX_DEF_MACOSX_VERSION_MIN" "$sdk_ver"
|
---|
2472 | cnf_append "VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6" "1"
|
---|
2473 | fi
|
---|
2474 |
|
---|
2475 | log_success "found version $xcode_ver (SDK: $sdk)"
|
---|
2476 | }
|
---|
2477 |
|
---|
2478 |
|
---|
2479 | check_makeself()
|
---|
2480 | {
|
---|
2481 | test_header "makeself"
|
---|
2482 | if check_avail "$MAKESELF" makeself; then
|
---|
2483 | makeself_ver=`$MAKESELF --version|grep version|sed 's+^Makeself.*version \([0-9\.]*\).*+\1+'`
|
---|
2484 | if [ $? -ne 0 ]; then
|
---|
2485 | log_failure "makeself not working"
|
---|
2486 | fail
|
---|
2487 | else
|
---|
2488 | log_success "found version $makeself_ver"
|
---|
2489 | cnf_append "VBOX_MAKESELF" "`which_wrapper $MAKESELF`"
|
---|
2490 | fi
|
---|
2491 | fi
|
---|
2492 | }
|
---|
2493 |
|
---|
2494 |
|
---|
2495 | #
|
---|
2496 | # Show help
|
---|
2497 | #
|
---|
2498 | show_help()
|
---|
2499 | {
|
---|
2500 | cat << EOF
|
---|
2501 | Usage: ./configure [OPTIONS]...
|
---|
2502 |
|
---|
2503 | Configuration:
|
---|
2504 | -h, --help display this help and exit
|
---|
2505 | --nofatal don't abort on errors
|
---|
2506 | EOF
|
---|
2507 | [ $WITH_XPCOM -eq 1 ] && echo " --disable-xpcom disable XPCOM and related stuff"
|
---|
2508 | [ $WITH_PYTHON -eq 1 ] && echo " --disable-python disable python bindings"
|
---|
2509 | [ $WITH_JAVA -eq 1 ] && echo " --disable-java disable java bindings"
|
---|
2510 | [ $WITH_VMMRAW -eq 1 ] && echo " --disable-vmmraw disable VMM raw mode (VT-x/AMD-V mandatory!)"
|
---|
2511 | [ $WITH_SDL_TTF -eq 1 ] && echo " --disable-sdl-ttf disable SDL_ttf detection"
|
---|
2512 | [ $WITH_QT5 -eq 1 ] && echo " --disable-qt disable Qt detection"
|
---|
2513 | [ $WITH_ALSA -eq 1 ] && echo " --disable-alsa disable the ALSA sound backend"
|
---|
2514 | [ $WITH_PULSE -eq 1 ] && echo " --disable-pulse disable the PulseAudio backend"
|
---|
2515 | [ $WITH_DBUS -eq 1 ] && echo " --disable-dbus don't use DBus and hal for hardware detection"
|
---|
2516 | [ $WITH_KMODS -eq 1 ] && echo " --disable-kmods don't build Linux kernel modules (host and guest)"
|
---|
2517 | [ $WITH_OPENGL -eq 1 ] && echo " --disable-opengl disable OpenGL support (2D & 3D)"
|
---|
2518 | [ $WITH_QT5 -eq 0 ] && echo " --enable-qt5 enable Qt5 detection"
|
---|
2519 | [ $OSE -eq 1 ] && echo " --enable-vnc enable the VNC server"
|
---|
2520 | [ $OSE -eq 0 ] && echo " --disable-extpack don't build the extpack"
|
---|
2521 | [ $WITH_DOCS -eq 1 ] && echo " --disable-docs don't build the documentation"
|
---|
2522 | [ $WITH_LIBVPX -eq 1 ] && echo " --disable-libvpx don't use libvpx for video capturing"
|
---|
2523 | [ $WITH_LIBVORBIS -eq 0 ] && echo " --enable-libvorbis enable system libvorbis"
|
---|
2524 | [ $WITH_LIBOGG -eq 0 ] && echo " --enable-libogg enable system libogg"
|
---|
2525 | [ $WITH_LIBTPMS -eq 1 ] && echo " --disable-libtpms don't use libtpms for TPM emulation"
|
---|
2526 | [ $WITH_LIBLZMA -eq 1 ] && echo " --disable-liblzma don't use liblzma"
|
---|
2527 | [ "$OS" = "linux" -o "$OS" = "freebsd" ] && echo " --enable-vde enable VDE networking"
|
---|
2528 | cat << EOF
|
---|
2529 | --disable-udptunnel disable UDP tunnel networking
|
---|
2530 | --disable-devmapper disable device mapper library access
|
---|
2531 | --disable-hardening don't be strict about /dev/vboxdrv access
|
---|
2532 | --build-libxml2 build libxml2 from sources
|
---|
2533 | --build-libssl build openssl from sources
|
---|
2534 | --build-libtpms build libtpms from sources
|
---|
2535 | --build-liblzma build liblzma from sources
|
---|
2536 | EOF
|
---|
2537 | [ $OSE -eq 0 ] && cat << EOF
|
---|
2538 | --build-libcurl build libcurl from sources
|
---|
2539 | --build-libvpx build libvpx from sources
|
---|
2540 | EOF
|
---|
2541 | [ "$OS" != "darwin" ] && echo " --setup-wine setup a Wine directory and register the hhc hack"
|
---|
2542 | cat << EOF
|
---|
2543 | --only-additions only build the Guest Additions
|
---|
2544 |
|
---|
2545 | Paths:
|
---|
2546 | --with-gcc=PATH location of the gcc compiler [$CC]
|
---|
2547 | --with-g++=PATH location of the g++ compiler [$CXX]
|
---|
2548 | --with-kbuild=DIR kbuild directory [$KBUILDDIR]
|
---|
2549 | --with-iasl=PATH location of the iasl compiler [$IASL]
|
---|
2550 | --with-yasm=PATH location of the iasl compiler [$YASM]
|
---|
2551 | --with-makeself=PATH location of makeself [$MAKESELF]
|
---|
2552 | EOF
|
---|
2553 | [ "$OS" = "darwin" ] && echo " --with-xcode-dir=DIR custom path to Xcode root directory; it is assumed that Xcode"
|
---|
2554 | [ "$OS" = "darwin" ] && echo " contains OS X 10.6 SDK (required for Mountain Lion and newer hosts"
|
---|
2555 | [ "$OS" = "darwin" ] && echo " only, ignored for the rest)"
|
---|
2556 | [ "$OS" = "linux" ] && echo " --with-linux=DIR Linux kernel source directory [$LINUX]"
|
---|
2557 | [ $WITH_QT5 -eq 1 ] && echo " --with-qt-dir=DIR directory for Qt headers/libraries [pkgconfig]"
|
---|
2558 | cat << EOF
|
---|
2559 | --with-gsoap-dir=PATH directory for gSOAP compiler/headers/libraries
|
---|
2560 | (soapcpp2 and wsdl2h, soapstd2.h, libgsoap++.a/so)
|
---|
2561 | --with-gsoap-import=PATH directory for gSOAP import files (stlvector.h)
|
---|
2562 | --with-openssl-dir=DIR directory for OpenSSL headers/libraries
|
---|
2563 | --with-ow-dir=DIR directory where Open Watcom can be found [$WATCOM]
|
---|
2564 | --out-base-dir=DIR directory where configuration and build output
|
---|
2565 | should go, in subdirectory out
|
---|
2566 |
|
---|
2567 | Build type:
|
---|
2568 | -d, --build-debug build with debugging symbols and assertions
|
---|
2569 | --build-profile build with profiling support
|
---|
2570 | --build-headless build headless (without any GUI frontend)
|
---|
2571 | EOF
|
---|
2572 | exit 0
|
---|
2573 | }
|
---|
2574 |
|
---|
2575 |
|
---|
2576 | #
|
---|
2577 | # The body.
|
---|
2578 | #
|
---|
2579 |
|
---|
2580 | # test if we are OSE
|
---|
2581 | if [ $OSE -eq 1 -a -r "`cd \`dirname $0\`; pwd`/src/VBox/RDP/server/server.cpp" ]; then
|
---|
2582 | OSE=0
|
---|
2583 | # Set this as a reminder to print a log message once we know the path of the
|
---|
2584 | # log file
|
---|
2585 | NOT_OSE=1
|
---|
2586 | fi
|
---|
2587 |
|
---|
2588 | # Change OS specific defaults; must be before all other stuff
|
---|
2589 | if [ "$OS" = "darwin" ]; then
|
---|
2590 | WITH_SDL=0
|
---|
2591 | WITH_SDL_TTF=0
|
---|
2592 | WITH_X11=0
|
---|
2593 | WITH_ALSA=0
|
---|
2594 | WITH_PULSE=0
|
---|
2595 | WITH_DBUS=0
|
---|
2596 | WITH_KMODS=0
|
---|
2597 | BUILD_LIBXML2=1
|
---|
2598 | BUILD_LIBSSL=1
|
---|
2599 | BUILD_LIBVPX=1
|
---|
2600 | [ $OSE -eq 1 ] || BUILD_LIBCURL=1
|
---|
2601 | [ $OSE -eq 1 ] && WITH_LIBVPX=0
|
---|
2602 | [ $OSE -eq 1 ] && WITH_LIBOGG=0
|
---|
2603 | [ $OSE -eq 1 ] && WITH_LIBVORBIS=0
|
---|
2604 | WITH_XCODE_DIR=""
|
---|
2605 | elif [ "$OS" = "haiku" ]; then
|
---|
2606 | #WITH_SDL=0
|
---|
2607 | WITH_SDL_TTF=0
|
---|
2608 | WITH_X11=0
|
---|
2609 | WITH_ALSA=0
|
---|
2610 | WITH_PULSE=0
|
---|
2611 | WITH_DBUS=0
|
---|
2612 | WITH_KMODS=0
|
---|
2613 | WITH_LIBIDL=0
|
---|
2614 | WITH_XPCOM=0
|
---|
2615 | BUILD_LIBXSLT=1
|
---|
2616 | BUILD_LIBXML2=1
|
---|
2617 | WITH_LIBVPX=0
|
---|
2618 | WITH_LIBOGG=0
|
---|
2619 | WITH_LIBVORBIS=0
|
---|
2620 | # but the script wants something
|
---|
2621 | LIBPTHREAD="-lroot"
|
---|
2622 | #[ $OSE -eq 1 ] || BUILD_LIBCURL=1
|
---|
2623 | [ $OSE -eq 1 ] || BUILD_LIBSSL=1
|
---|
2624 | elif [ "$OS" = "solaris" ]; then
|
---|
2625 | [ $OSE -eq 1 ] && WITH_LIBVPX=0
|
---|
2626 | [ $OSE -eq 1 ] && WITH_LIBOGG=0
|
---|
2627 | [ $OSE -eq 1 ] && WITH_LIBVORBIS=0
|
---|
2628 | fi
|
---|
2629 |
|
---|
2630 | # scan command line options
|
---|
2631 | for option in "$@"; do
|
---|
2632 | case "$option" in
|
---|
2633 | --help|-help|-h)
|
---|
2634 | show_help
|
---|
2635 | ;;
|
---|
2636 | --nofatal)
|
---|
2637 | nofatal=1
|
---|
2638 | ;;
|
---|
2639 | --env-only)
|
---|
2640 | ENV_ONLY=1
|
---|
2641 | ;;
|
---|
2642 | --with-gcc=*)
|
---|
2643 | CC=`echo $option | cut -d'=' -f2`
|
---|
2644 | ;;
|
---|
2645 | --with-g++=*)
|
---|
2646 | CXX=`echo $option | cut -d'=' -f2`
|
---|
2647 | ;;
|
---|
2648 | --with-kbuild=*)
|
---|
2649 | KBUILDDIR=`echo $option | cut -d'=' -f2`
|
---|
2650 | if echo $KBUILDDIR|grep -q "$INVALID_CHARS"; then
|
---|
2651 | echo "Error: KBUILDDIR contains invalid characters!"
|
---|
2652 | exit 1
|
---|
2653 | fi
|
---|
2654 | ;;
|
---|
2655 | --with-qt-dir=*)
|
---|
2656 | [ $WITH_QT5 -eq 1 ] && QT5DIR=`echo $option | cut -d'=' -f2`
|
---|
2657 | [ $WITH_QT5 -eq 1 ] && QT5DIR_PKGCONFIG=0
|
---|
2658 | ;;
|
---|
2659 | --with-qt5-minor=*)
|
---|
2660 | QT5MIN=`echo $option | cut -d'=' -f2`
|
---|
2661 | ;;
|
---|
2662 | --with-qt5-major=*)
|
---|
2663 | QT5MAJ=`echo $option | cut -d'=' -f2`
|
---|
2664 | ;;
|
---|
2665 | --with-openssl-dir=*)
|
---|
2666 | OPENSSLDIR=`echo $option | cut -d'=' -f2`
|
---|
2667 | INCCRYPTO="-I${OPENSSLDIR}/include"
|
---|
2668 | LIBCRYPTO="${OPENSSLDIR}/lib/libssl.a ${OPENSSLDIR}/lib/libcrypto.a"
|
---|
2669 | # On Darwin (at least for macports) static OpenSSL also needs zlib.
|
---|
2670 | [ "$OS" = "darwin" ] && LIBCRYPTO="$LIBCRYPTO ${OPENSSLDIR}/lib/libz.a"
|
---|
2671 | # On Linux static OpenSSL typically needs a few additional libraries.
|
---|
2672 | [ "$OS" = "linux" ] && LIBCRYPTO="-ldl $LIBPTHREAD -lm"
|
---|
2673 | ;;
|
---|
2674 | --with-ow-dir=*)
|
---|
2675 | WATCOM=`echo $option | cut -d'=' -f2`
|
---|
2676 | ;;
|
---|
2677 | --with-gsoap-dir=*)
|
---|
2678 | GSOAP=`echo $option | cut -d'=' -f2`
|
---|
2679 | ;;
|
---|
2680 | --with-gsoap-import=*)
|
---|
2681 | GSOAP_IMPORT=`echo $option | cut -d'=' -f2`
|
---|
2682 | ;;
|
---|
2683 | --with-iasl=*)
|
---|
2684 | IASL=`echo $option | cut -d'=' -f2`
|
---|
2685 | ;;
|
---|
2686 | --with-yasm=*)
|
---|
2687 | YASM=`echo $option | cut -d'=' -f2`
|
---|
2688 | ;;
|
---|
2689 | --with-xcode-dir=*)
|
---|
2690 | WITH_XCODE_DIR=`echo $option | cut -d'=' -f2`
|
---|
2691 | ;;
|
---|
2692 | --with-linux=*)
|
---|
2693 | LINUX=`echo $option | cut -d'=' -f2`
|
---|
2694 | ;;
|
---|
2695 | --with-makeself=*)
|
---|
2696 | MAKESELF=`echo $option | cut -d'=' -f2`
|
---|
2697 | ;;
|
---|
2698 | --target-arch=*)
|
---|
2699 | TARGET_MACHINE=`echo $option | cut -d'=' -f2`
|
---|
2700 | ;;
|
---|
2701 | --disable-xpcom)
|
---|
2702 | [ $WITH_XPCOM -eq 1 ] && WITH_XPCOM=0
|
---|
2703 | ;;
|
---|
2704 | --disable-python)
|
---|
2705 | [ $WITH_PYTHON -eq 1 ] && WITH_PYTHON=0
|
---|
2706 | ;;
|
---|
2707 | --disable-java)
|
---|
2708 | [ $WITH_JAVA -eq 1 ] && WITH_JAVA=0
|
---|
2709 | ;;
|
---|
2710 | --disable-vmmraw)
|
---|
2711 | [ $WITH_VMMRAW -eq 1 ] && WITH_VMMRAW=0
|
---|
2712 | ;;
|
---|
2713 | --disable-sdl-ttf)
|
---|
2714 | [ $WITH_SDL_TTF -eq 1 ] && WITH_SDL_TTF=0
|
---|
2715 | ;;
|
---|
2716 | --disable-qt)
|
---|
2717 | [ $WITH_QT5 -eq 1 ] && WITH_QT5=0
|
---|
2718 | ;;
|
---|
2719 | --enable-qt5)
|
---|
2720 | [ $WITH_QT5 -eq 0 ] && WITH_QT5=1
|
---|
2721 | ;;
|
---|
2722 | --passive-mesa)
|
---|
2723 | PASSIVE_MESA=1
|
---|
2724 | ;;
|
---|
2725 | --disable-alsa)
|
---|
2726 | [ $WITH_ALSA -eq 1 ] && WITH_ALSA=0
|
---|
2727 | ;;
|
---|
2728 | --disable-pulse)
|
---|
2729 | [ $WITH_PULSE -eq 1 ] && WITH_PULSE=0
|
---|
2730 | ;;
|
---|
2731 | --enable-pulse)
|
---|
2732 | WITH_PULSE=2
|
---|
2733 | ;;
|
---|
2734 | --disable-dbus)
|
---|
2735 | [ $WITH_DBUS -eq 1 ] && WITH_DBUS=0
|
---|
2736 | ;;
|
---|
2737 | --disable-kmods)
|
---|
2738 | [ $WITH_KMODS -eq 1 ] && WITH_KMODS=0
|
---|
2739 | ;;
|
---|
2740 | --disable-opengl)
|
---|
2741 | [ $WITH_OPENGL -eq 1 ] && WITH_OPENGL=0
|
---|
2742 | ;;
|
---|
2743 | --enable-webservice)
|
---|
2744 | ;;
|
---|
2745 | --enable-vnc)
|
---|
2746 | WITH_VNC=1
|
---|
2747 | ;;
|
---|
2748 | --disable-hardening)
|
---|
2749 | WITH_HARDENING=0
|
---|
2750 | ;;
|
---|
2751 | --disable-extpack)
|
---|
2752 | WITH_EXTPACK=0
|
---|
2753 | ;;
|
---|
2754 | --disable-docs)
|
---|
2755 | WITH_DOCS=0
|
---|
2756 | ;;
|
---|
2757 | --enable-hardening)
|
---|
2758 | WITH_HARDENING=2
|
---|
2759 | ;;
|
---|
2760 | --disable-udptunnel)
|
---|
2761 | WITH_UDPTUNNEL=0
|
---|
2762 | ;;
|
---|
2763 | --enable-vde)
|
---|
2764 | WITH_VDE=1
|
---|
2765 | ;;
|
---|
2766 | --disable-devmapper)
|
---|
2767 | WITH_DEVMAPPER=0
|
---|
2768 | ;;
|
---|
2769 | --disable-libvpx)
|
---|
2770 | WITH_LIBVPX=0
|
---|
2771 | ;;
|
---|
2772 | --disable-libtpms)
|
---|
2773 | WITH_LIBTPMS=0
|
---|
2774 | ;;
|
---|
2775 | --disable-liblzma)
|
---|
2776 | WITH_LIBLZMA=0
|
---|
2777 | ;;
|
---|
2778 | --enable-libogg)
|
---|
2779 | WITH_LIBOGG=1
|
---|
2780 | ;;
|
---|
2781 | --enable-libvorbis)
|
---|
2782 | WITH_LIBVORBIS=1
|
---|
2783 | ;;
|
---|
2784 | --disable-sdl)
|
---|
2785 | WITH_SDL=0
|
---|
2786 | ;;
|
---|
2787 | --build-debug|-d)
|
---|
2788 | BUILD_TYPE=debug
|
---|
2789 | ;;
|
---|
2790 | --build-profile)
|
---|
2791 | BUILD_TYPE=profile
|
---|
2792 | ;;
|
---|
2793 | --build-libxml2)
|
---|
2794 | BUILD_LIBXML2=1
|
---|
2795 | ;;
|
---|
2796 | --build-libssl)
|
---|
2797 | BUILD_LIBSSL=1
|
---|
2798 | ;;
|
---|
2799 | --build-libcurl)
|
---|
2800 | BUILD_LIBCURL=1
|
---|
2801 | ;;
|
---|
2802 | --build-libvpx)
|
---|
2803 | BUILD_LIBVPX=1
|
---|
2804 | ;;
|
---|
2805 | --build-libtpms)
|
---|
2806 | BUILD_LIBTPMS=1
|
---|
2807 | ;;
|
---|
2808 | --build-liblzma)
|
---|
2809 | BUILD_LIBLZMA=1
|
---|
2810 | ;;
|
---|
2811 | --build-headless)
|
---|
2812 | HEADLESS=1
|
---|
2813 | WITH_SDL=0
|
---|
2814 | WITH_SDL_TTF=0
|
---|
2815 | WITH_X11=0
|
---|
2816 | WITH_OPENGL=0
|
---|
2817 | WITH_QT5=0
|
---|
2818 | ;;
|
---|
2819 | --ose)
|
---|
2820 | OSE=2
|
---|
2821 | ;;
|
---|
2822 | --odir=*)
|
---|
2823 | ODIR="`echo $option | cut -d'=' -f2`/"
|
---|
2824 | ODIR_OVERRIDE=1
|
---|
2825 | ;;
|
---|
2826 | --out-base-dir=*)
|
---|
2827 | out_base_dir="`echo $option | cut -d'=' -f2`/"
|
---|
2828 | if [ -d $out_base_dir ]; then
|
---|
2829 | saved_pwd="$PWD"
|
---|
2830 | cd $out_base_dir
|
---|
2831 | OUT_BASE_PATH="`pwd`"
|
---|
2832 | cd $saved_pwd
|
---|
2833 | OUT_BASE_PATH_OVERRIDE=1
|
---|
2834 | if [ $ODIR_OVERRIDE -eq 0 ]; then
|
---|
2835 | # This variable has not *yet* been overridden. That can still happen.
|
---|
2836 | ODIR=$OUT_BASE_PATH/
|
---|
2837 | ODIR_OVERRIDE=1
|
---|
2838 | fi
|
---|
2839 | else
|
---|
2840 | echo "Error: invalid folder \"$out_base_dir\" in option \"$option\""
|
---|
2841 | exit 1
|
---|
2842 | fi
|
---|
2843 | ;;
|
---|
2844 | --setup-wine)
|
---|
2845 | [ "$OS" != "darwin" ] && SETUP_WINE=1
|
---|
2846 | ;;
|
---|
2847 | --only-additions)
|
---|
2848 | ONLY_ADDITIONS=1
|
---|
2849 | ;;
|
---|
2850 | *)
|
---|
2851 | echo
|
---|
2852 | echo "Unrecognized option \"$option\""
|
---|
2853 | echo
|
---|
2854 | show_help
|
---|
2855 | ;;
|
---|
2856 | esac
|
---|
2857 | done
|
---|
2858 |
|
---|
2859 | LOG="$ODIR$LOG"
|
---|
2860 | ENV="$ODIR$ENV"
|
---|
2861 | CNF="$ODIR$CNF"
|
---|
2862 |
|
---|
2863 | # initialize output files
|
---|
2864 | cat > $LOG << EOF
|
---|
2865 | # Log file generated by
|
---|
2866 | #
|
---|
2867 | # '$0 $*'
|
---|
2868 | #
|
---|
2869 |
|
---|
2870 | EOF
|
---|
2871 | cat > $CNF << EOF
|
---|
2872 | # -*- Makefile -*-
|
---|
2873 | #
|
---|
2874 | # automatically generated by
|
---|
2875 | #
|
---|
2876 | # '$0 $*'
|
---|
2877 | #
|
---|
2878 | # It will be completely overwritten if configure is executed again.
|
---|
2879 | #
|
---|
2880 |
|
---|
2881 | EOF
|
---|
2882 | cat > $ENV << EOF
|
---|
2883 | #!/bin/bash
|
---|
2884 | #
|
---|
2885 | # automatically generated by
|
---|
2886 | #
|
---|
2887 | # '$0 $*'
|
---|
2888 | #
|
---|
2889 | # It will be completely overwritten if configure is executed again.
|
---|
2890 | # Make sure you source this file once before you start to build VBox.
|
---|
2891 | #
|
---|
2892 |
|
---|
2893 | EOF
|
---|
2894 |
|
---|
2895 | # Print log warning about OSE if necessary
|
---|
2896 | if [ -n "$NOT_OSE" ]; then
|
---|
2897 | echo "Found RDP server, assuming VBOX_OSE = FALSE" >> $LOG
|
---|
2898 | echo >> $LOG
|
---|
2899 | fi
|
---|
2900 |
|
---|
2901 |
|
---|
2902 | if [ "$BUILD_TYPE" = "debug" ]; then
|
---|
2903 | echo "Creating DEBUG build!" >> $LOG
|
---|
2904 | elif [ "$BUILD_TYPE" = "profile" ]; then
|
---|
2905 | echo "Creating PROFILE build!" >> $LOG
|
---|
2906 | fi
|
---|
2907 |
|
---|
2908 | # first determine our environment
|
---|
2909 | check_environment
|
---|
2910 | check_kbuild
|
---|
2911 |
|
---|
2912 | [ -n "$ENV_ONLY" ] && exit 0
|
---|
2913 |
|
---|
2914 | # append the tools directory to the default search path
|
---|
2915 | echo "$PATH" | grep -q "$DEVDIR_BIN" || PATH="$PATH:$DEVDIR_BIN"
|
---|
2916 | export PATH
|
---|
2917 |
|
---|
2918 | # if we will be writing to a different out directory then set this up now
|
---|
2919 | if [ $ODIR_OVERRIDE -eq 1 ]; then
|
---|
2920 | echo "AUTOCFG=$CNF" >> $ENV
|
---|
2921 | echo "export AUTOCFG" >> $ENV
|
---|
2922 | fi
|
---|
2923 | if [ $OUT_BASE_PATH_OVERRIDE -eq 1 ]; then
|
---|
2924 | echo "PATH_OUT_BASE=$OUT_BASE_PATH" >> $ENV
|
---|
2925 | echo "export PATH_OUT_BASE" >> $ENV
|
---|
2926 | fi
|
---|
2927 |
|
---|
2928 | # don't bother people with -Werror
|
---|
2929 | cnf_append "VBOX_GCC_WERR" "\$(NO_SUCH_VARIABLE)"
|
---|
2930 |
|
---|
2931 | # some things are not available in for OSE
|
---|
2932 | if [ $OSE -ge 1 ]; then
|
---|
2933 | cnf_append "VBOX_OSE" "1"
|
---|
2934 | cnf_append "VBOX_WITH_VALIDATIONKIT" ""
|
---|
2935 | cnf_append "VBOX_WITH_WIN32_ADDITIONS" ""
|
---|
2936 |
|
---|
2937 | if [ "$OS" = "linux" ]; then
|
---|
2938 | cnf_append "VBOX_WITH_LINUX_ADDITIONS" "1"
|
---|
2939 | else
|
---|
2940 | cnf_append "VBOX_WITH_LINUX_ADDITIONS" ""
|
---|
2941 | fi
|
---|
2942 | echo >> $CNF
|
---|
2943 | fi
|
---|
2944 |
|
---|
2945 | # extpack
|
---|
2946 | if [ $ONLY_ADDITIONS -eq 1 ]; then
|
---|
2947 | cnf_append "VBOX_WITH_EXTPACK_PUEL_BUILD" ""
|
---|
2948 | elif [ $OSE -eq 0 ]; then
|
---|
2949 | if [ $WITH_EXTPACK -eq 1 ]; then
|
---|
2950 | BUILD_LIBSSL=1
|
---|
2951 | else
|
---|
2952 | cnf_append "VBOX_WITH_EXTPACK_PUEL_BUILD" ""
|
---|
2953 | fi
|
---|
2954 | fi
|
---|
2955 |
|
---|
2956 | # headless
|
---|
2957 | if [ -n "$HEADLESS" ]; then
|
---|
2958 | cnf_append "VBOX_HEADLESS" "1"
|
---|
2959 | fi
|
---|
2960 |
|
---|
2961 | # emit disable directives corresponding to any --disable-xxx options.
|
---|
2962 | if [ $WITH_OPENGL -eq 0 ]; then
|
---|
2963 | cnf_append "VBOX_WITH_VMSVGA3D" ""
|
---|
2964 | cnf_append "VBOX_WITH_3D_ACCELERATION" ""
|
---|
2965 | cnf_append "VBOX_WITH_VIDEOHWACCEL" ""
|
---|
2966 | cnf_append "VBOX_GUI_USE_QGL" ""
|
---|
2967 | fi
|
---|
2968 | [ $WITH_XPCOM -eq 0 ] && cnf_append "VBOX_WITH_MAIN" ""
|
---|
2969 | [ $WITH_QT5 -eq 0 ] && cnf_append "VBOX_WITH_QTGUI" ""
|
---|
2970 | [ $WITH_SDL_TTF -eq 0 ] && cnf_append "VBOX_WITH_SECURELABEL" ""
|
---|
2971 | [ $WITH_PYTHON -eq 0 ] && cnf_append "VBOX_WITH_PYTHON" ""
|
---|
2972 | [ $WITH_JAVA -eq 0 ] && cnf_append "VBOX_WITH_JXPCOM" ""
|
---|
2973 | [ $WITH_JAVA -eq 0 ] && cnf_append "VBOX_WITH_JWS" ""
|
---|
2974 | [ $WITH_HARDENING -eq 0 ] && cnf_append "VBOX_WITHOUT_HARDENING" "1"
|
---|
2975 | [ $WITH_HARDENING -eq 2 ] && cnf_append "VBOX_WITH_HARDENING" "2"
|
---|
2976 | [ $WITH_VMMRAW -eq 0 ] && cnf_append "VBOX_WITH_RAW_MODE" ""
|
---|
2977 | [ $WITH_LIBTPMS -eq 0 ] && cnf_append "VBOX_WITH_LIBTPMS" ""
|
---|
2978 | [ $WITH_LIBLZMA -eq 0 ] && cnf_append "VBOX_WITH_LIBLZMA" ""
|
---|
2979 | if [ $WITH_LIBVPX -eq 0 ]; then
|
---|
2980 | cnf_append "VBOX_WITH_LIBVPX" ""
|
---|
2981 | cnf_append "VBOX_WITH_RECORDING" ""
|
---|
2982 | fi
|
---|
2983 | if [ $WITH_LIBOGG -eq 0 -o $WITH_LIBVORBIS -eq 0 ]; then
|
---|
2984 | cnf_append "VBOX_WITH_LIBOGG" ""
|
---|
2985 | cnf_append "VBOX_WITH_LIBVORBIS" ""
|
---|
2986 | cnf_append "VBOX_WITH_AUDIO_RECORDING" ""
|
---|
2987 | fi
|
---|
2988 |
|
---|
2989 | # Darwin-specific
|
---|
2990 | [ "$OS" = "darwin" ] && check_darwinversion
|
---|
2991 | # the tools
|
---|
2992 | [ "$OS" != "darwin" ] && check_gcc
|
---|
2993 | [ "$OS" = "darwin" ] && check_xcode
|
---|
2994 | if [ $ONLY_ADDITIONS -eq 0 ]; then
|
---|
2995 | check_open_watcom
|
---|
2996 | [ "$OS" != "darwin" ] && check_iasl
|
---|
2997 | [ $OSE -ge 1 ] && check_yasm
|
---|
2998 | [ "$OS" != "darwin" ] && check_xsltproc
|
---|
2999 | fi
|
---|
3000 |
|
---|
3001 | # the libraries
|
---|
3002 | if [ $ONLY_ADDITIONS -eq 0 ]; then
|
---|
3003 | [ "$OS" != "darwin" ] && check_pthread
|
---|
3004 | check_libxml2
|
---|
3005 | [ $WITH_LIBIDL -eq 1 ] && check_libidl
|
---|
3006 | check_z
|
---|
3007 | check_lzf
|
---|
3008 | check_ssl
|
---|
3009 | check_curl
|
---|
3010 | [ $WITH_LIBVPX -eq 1 ] && check_vpx
|
---|
3011 | [ $WITH_LIBOGG -eq 1 ] && check_libogg
|
---|
3012 | [ $WITH_LIBVORBIS -eq 1 ] && check_libvorbis
|
---|
3013 | [ $WITH_LIBTPMS -eq 1 ] && check_libtpms
|
---|
3014 | [ $WITH_LIBLZMA -eq 1 ] && check_liblzma
|
---|
3015 | [ "$OS" != "darwin" ] && check_png
|
---|
3016 | [ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam
|
---|
3017 | if [ $WITH_SDL -eq 1 ]; then
|
---|
3018 | check_sdl
|
---|
3019 | else
|
---|
3020 | cnf_append "VBOX_WITH_VBOXSDL" ""
|
---|
3021 | fi
|
---|
3022 | [ $WITH_SDL_TTF -eq 1 -a $OSE -eq 0 ] && check_sdl_ttf
|
---|
3023 | [ $WITH_X11 -eq 1 ] && check_x
|
---|
3024 | # TODO check for xcomposite-dev (X11/extensions/Xcomposite.h, additions only)
|
---|
3025 | # TODO check for libxdamange-dev (X11/extensions/Xdamage.h, additions only)
|
---|
3026 | [ $WITH_X11 -eq 1 ] && check_xcursor
|
---|
3027 | [ $WITH_X11 -eq 1 ] && check_xinerama
|
---|
3028 | [ $WITH_X11 -eq 1 ] && check_xrandr
|
---|
3029 | [ $WITH_OPENGL -eq 1 ] && check_opengl
|
---|
3030 | [ $WITH_QT5 -eq 1 ] && check_qt5
|
---|
3031 | [ $WITH_PYTHON -eq 1 ] && check_python
|
---|
3032 | [ $WITH_JAVA -eq 1 ] && check_java
|
---|
3033 |
|
---|
3034 | # PulseAudio
|
---|
3035 | if [ $WITH_PULSE -eq 1 ]; then
|
---|
3036 | check_pulse
|
---|
3037 | elif [ $WITH_PULSE -eq 0 ]; then # Force disabling PulseAudio.
|
---|
3038 | cnf_append "VBOX_WITH_AUDIO_PULSE" ""
|
---|
3039 | elif [ $WITH_PULSE -eq 2 ]; then # --enable-pulse was passed, force PulseAudio.
|
---|
3040 | cnf_append "VBOX_WITH_AUDIO_PULSE" "1"
|
---|
3041 | fi
|
---|
3042 | fi
|
---|
3043 |
|
---|
3044 | # Linux-specific
|
---|
3045 | if [ "$OS" = "linux" ]; then
|
---|
3046 | # don't check for the static libstdc++ in the PUEL version as we build the
|
---|
3047 | # additions at a dedicated box
|
---|
3048 | [ $OSE -ge 1 ] && check_staticlibstdcxx
|
---|
3049 | if [ $WITH_KMODS -eq 1 ]; then
|
---|
3050 | check_linux
|
---|
3051 | else
|
---|
3052 | cnf_append "VBOX_LINUX_SRC" ""
|
---|
3053 | cnf_append "VBOX_WITHOUT_LINUX_TEST_BUILDS" "1"
|
---|
3054 | fi
|
---|
3055 | if [ $ONLY_ADDITIONS -eq 0 ]; then
|
---|
3056 | if [ $WITH_ALSA -eq 1 ]; then
|
---|
3057 | check_alsa
|
---|
3058 | else
|
---|
3059 | cnf_append "VBOX_WITH_AUDIO_ALSA" ""
|
---|
3060 | fi
|
---|
3061 | if [ $WITH_DBUS -eq 0 ]; then
|
---|
3062 | cnf_append "VBOX_WITH_DBUS" ""
|
---|
3063 | fi
|
---|
3064 | if [ $WITH_DEVMAPPER -eq 1 ]; then
|
---|
3065 | check_libdevmapper
|
---|
3066 | else
|
---|
3067 | cnf_append "VBOX_WITH_DEVMAPPER" ""
|
---|
3068 | fi
|
---|
3069 | check_libcap
|
---|
3070 | fi
|
---|
3071 | check_compiler_h
|
---|
3072 | [ $ONLY_ADDITIONS -eq 0 -a "$BUILD_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 1 ] && check_32bit
|
---|
3073 | # tools/common/makeself*
|
---|
3074 | [ $OSE -ge 1 ] && check_makeself
|
---|
3075 | fi
|
---|
3076 |
|
---|
3077 | [ -n "$SETUP_WINE" ] && setup_wine
|
---|
3078 |
|
---|
3079 | if [ $ONLY_ADDITIONS -eq 0 ]; then
|
---|
3080 | check_gsoap
|
---|
3081 | else
|
---|
3082 | cnf_append "VBOX_WITH_WEBSERVICES" ""
|
---|
3083 | fi
|
---|
3084 |
|
---|
3085 | # UDPTUNNEL
|
---|
3086 | if [ $ONLY_ADDITIONS -eq 0 -a $WITH_UDPTUNNEL -eq 0 ]; then
|
---|
3087 | cnf_append "VBOX_WITH_UDPTUNNEL" ""
|
---|
3088 | fi
|
---|
3089 |
|
---|
3090 | # VDE
|
---|
3091 | if [ $ONLY_ADDITIONS -eq 0 -a "$OS" = "linux" -o "$OS" = "freebsd" ]; then
|
---|
3092 | if [ $WITH_VDE -eq 1 ]; then
|
---|
3093 | cnf_append "VBOX_WITH_VDE" "1"
|
---|
3094 | fi
|
---|
3095 | fi
|
---|
3096 |
|
---|
3097 | # DOCS
|
---|
3098 | if [ $ONLY_ADDITIONS -eq 1 -o $WITH_DOCS -eq 0 ]; then
|
---|
3099 | cnf_append "VBOX_WITH_DOCS" ""
|
---|
3100 | cnf_append "VBOX_WITH_DOCS_PACKING" ""
|
---|
3101 | fi
|
---|
3102 |
|
---|
3103 | # VNC server support
|
---|
3104 | if [ $ONLY_ADDITIONS -eq 0 -a $OSE -ge 1 ]; then
|
---|
3105 | if [ $WITH_VNC = 1 ]; then
|
---|
3106 | check_vncserver
|
---|
3107 | else
|
---|
3108 | cnf_append "VBOX_WITH_EXTPACK_VNC" ""
|
---|
3109 | fi
|
---|
3110 | fi
|
---|
3111 |
|
---|
3112 | if [ $ONLY_ADDITIONS -eq 1 ]; then
|
---|
3113 | cnf_append "VBOX_ONLY_ADDITIONS" "1"
|
---|
3114 | fi
|
---|
3115 |
|
---|
3116 | # success!
|
---|
3117 | echo
|
---|
3118 | echo "Successfully generated '$CNF' and '$ENV'."
|
---|
3119 | echo "Source '$ENV' once before you start to build VBox:"
|
---|
3120 | echo ""
|
---|
3121 | echo " source $ENV"
|
---|
3122 | echo " kmk"
|
---|
3123 | echo ""
|
---|
3124 | if [ "$OS" = "linux" ]; then
|
---|
3125 | if [ $OUT_BASE_PATH_OVERRIDE -eq 1 ]; then
|
---|
3126 | out_base_dir=$OUT_BASE_PATH
|
---|
3127 | else
|
---|
3128 | out_base_dir=.
|
---|
3129 | fi
|
---|
3130 | echo "To compile the kernel modules, do:"
|
---|
3131 | echo ""
|
---|
3132 | echo " cd $out_base_dir/out/$OS.$TARGET_MACHINE/$BUILD_TYPE/bin/src"
|
---|
3133 | echo " make"
|
---|
3134 | echo ""
|
---|
3135 | fi
|
---|
3136 | if [ $ONLY_ADDITIONS -eq 1 ]; then
|
---|
3137 | echo ""
|
---|
3138 | echo " Tree configured to build only the Guest Additions"
|
---|
3139 | echo ""
|
---|
3140 | elif [ $WITH_HARDENING -gt 0 ]; then
|
---|
3141 | echo ""
|
---|
3142 | echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
|
---|
3143 | echo " Hardening is enabled which means that the VBox binaries will not run from"
|
---|
3144 | echo " the binary directory. The binaries have to be installed suid root and some"
|
---|
3145 | echo " more prerequisites have to be fulfilled which is normally done by installing"
|
---|
3146 | echo " the final package. For development, the hardening feature can be disabled"
|
---|
3147 | echo " by specifying the --disable-hardening parameter. Please never disable that"
|
---|
3148 | echo " feature for the final distribution!"
|
---|
3149 | echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
|
---|
3150 | echo ""
|
---|
3151 | else
|
---|
3152 | echo ""
|
---|
3153 | echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
|
---|
3154 | echo " Hardening is disabled. Please do NOT build packages for distribution with"
|
---|
3155 | echo " disabled hardening!"
|
---|
3156 | echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
|
---|
3157 | echo ""
|
---|
3158 | fi
|
---|
3159 | echo "Enjoy!"
|
---|
3160 | cleanup
|
---|