VirtualBox

source: vbox/trunk/configure@ 109180

Last change on this file since 109180 was 109098, checked in by vboxsync, 9 days ago

configure: Detect arm64 environment, ticketref:22397

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette