VirtualBox

source: vbox/trunk/configure@ 99496

Last change on this file since 99496 was 99496, checked in by vboxsync, 14 months ago

configure, xpcom/python: Handle versions up to Python 3.12, and remove the useless handling of the 'm' suffix after 3.8 when it became the only existing variant.

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

© 2023 Oracle
ContactPrivacy policyTerms of Use