VirtualBox

source: vbox/trunk/configure@ 60563

Last change on this file since 60563 was 60563, checked in by vboxsync, 9 years ago

configure: log more verbose when testing different Qt5 locations

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

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