VirtualBox

source: vbox/trunk/configure@ 16160

Last change on this file since 16160 was 16144, checked in by vboxsync, 16 years ago

configure: disable webservice stuff properly

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
File size: 53.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-2007 Sun Microsystems, Inc.
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 as published by the Free Software Foundation,
12# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
13# distribution. VirtualBox OSE is distributed in the hope that it will
14# 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
46
47#
48# Defaults
49#
50OSE=1
51ODIR="`pwd`/"
52SETUP_WINE=
53TARGET_MACHINE=""
54TARGET_CPU=""
55WITH_XPCOM=1
56WITH_PYTHON=1
57WITH_LIBIDL=1
58WITH_GSOAP=0
59WITH_QT3=1
60WITH_QT4=1
61WITH_SDL=1
62WITH_SDL_TTF=1
63WITH_X11=1
64WITH_ALSA=1
65WITH_PULSE=1
66WITH_DBUS=1
67WITH_KMODS=1
68WITH_HARDENING=1
69CC="gcc"
70CC32=""
71CC64=""
72CXX="g++"
73CXX32=""
74CXX64=""
75BCC="bcc"
76YASM="yasm"
77IASL="iasl"
78AS86="as86"
79XSLTPROC="xsltproc"
80GENISOIMAGE="genisoimage"
81MKISOFS="mkisofs"
82BUILD_LIBXML2=
83BUILD_LIBXSLT=
84LIBCRYPTO="-lcrypto"
85LIBPTHREAD="-lpthread"
86LIBCAP="-lcap"
87GSOAP=""
88LIBX11="-L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib -lXext -lX11"
89INCX11="/usr/local/include"
90LIBXCURSOR="-lXcursor"
91INCZ=""
92LIBZ="-lz"
93INCPNG=""
94LIBPNG="-lpng"
95PKGCONFIG="`which_wrapper pkg-config`"
96PYTHONDIR="/usr /usr/local"
97QT3DIR="/usr/qt/3 /usr/lib/qt3 /usr/lib/qt-3.3 /usr/share/qt3"
98QT3DIR="$QT3DIR /usr/lib64/qt-3.3 /usr/X11R6 /usr/lib/qt"
99QT4DIR="/usr/lib/qt4 /usr/share/qt4 /usr/lib64/qt4 /usr"
100QT4DIR_PKGCONFIG=1
101QT4UIC3DIR="/usr/bin"
102KBUILDDIR="`cd \`dirname $0\`; pwd`/kBuild"
103DEVDIR="`cd \`dirname $0\`; pwd`/tools"
104if [ -d "/lib/modules/`uname -r`/build" ]; then
105 LINUX="/lib/modules/`uname -r`/build"
106else
107 LINUX="/usr/src/linux"
108fi
109KCHMVIEWER="kchmviewer"
110LOG="configure.log"
111CNF="AutoConfig.kmk"
112ENV="env.sh"
113BUILD_TYPE="release"
114# the restricting tool is ar (mri mode).
115INVALID_CHARS="[^A-Za-z0-9/\\$:._-]"
116
117if (cd `dirname $0`; pwd)|grep -q "$INVALID_CHARS"; then
118 echo "Error: VBox base path contains invalid characters!"
119 exit 1
120fi
121
122# darwin /bin/sh has a builtin echo that doesn't grok -n. gotta love it.
123if [ "`uname`" = "Darwin" ]; then
124 ECHO_N="/bin/echo -n"
125else
126 ECHO_N="echo -n"
127fi
128
129
130cleanup()
131{
132 rm -f .tmp_src.cc .tmp_src.c .tmp_out .test_execute.log
133}
134
135fail()
136{
137 if [ -z "$nofatal" -o "x$1" != "x" ]; then
138 cleanup
139 rm -f $ENV
140 exit 1
141 fi
142}
143
144log()
145{
146 echo "$1"
147 echo "$1" >> $LOG
148}
149
150log_success()
151{
152 if [ -n "$1" ]; then $ECHO_N "$1, "; fi
153 echo "OK."
154 echo "$1" >> $LOG
155 echo >> $LOG
156 echo >> $LOG
157}
158
159log_failure()
160{
161 echo
162 echo " ** $1!"
163 echo "** $1!" >> $LOG
164 echo >> $LOG
165}
166
167cnf_append()
168{
169 printf "%-30s := %s\n" "$1" "$2" >> $CNF
170}
171
172strip_l()
173{
174 echo "$1"|$KBUILD_SED 's|-l\([^ ]\+\)|\1|g; s|^-[^l][^ ]*||g; s| -[^l][^ ]*||g; s|^ ||; s| *$||g'
175}
176
177strip_L()
178{
179 echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|^-[^L][^ ]*||g; s| -[^L][^ ]*||g; s|^ ||; s| *$||g'
180}
181
182strip_I()
183{
184 echo "$1"|$KBUILD_SED 's|-I\([^ ]\+\)|\1|g; s|^-[^I][^ ]*||g; s| -[^I][^ ]*||g; s|^ ||; s| *$||g'
185}
186
187prefix_I()
188{
189 echo "$1"|$KBUILD_SED 's|^\/|-I/|g; s| \/| -I/|g'
190}
191
192check_avail()
193{
194 if [ -z "$1" ]; then
195 log_failure "$2 is empty"
196 fail $3
197 return 1
198 elif which_wrapper $1 > /dev/null; then
199 return 0
200 else
201 log_failure "$1 (variable $2) not found"
202 fail $3
203 return 1
204 fi
205}
206
207
208# Prepare a test
209test_header()
210{
211 echo "***** Checking $1 *****" >> $LOG
212 $ECHO_N "Checking for $1: "
213}
214
215
216# Compile a test
217test_compile()
218{
219 echo "compiling the following source file:" >> $LOG
220 cat .tmp_src.cc >> $LOG
221 echo "using the following command line:" >> $LOG
222 echo "$CXX -O -Wall -o .tmp_out .tmp_src.cc \"$1\"" >> $LOG
223 $CXX -O -Wall -o .tmp_out .tmp_src.cc $1 >> $LOG 2>&1
224 if [ $? -ne 0 ]; then
225 if [ -z "$4" ]; then
226 echo
227 echo " $2 not found at $1 or $3 headers not found"
228 echo " Check the file $LOG for detailed error information."
229 fail
230 else
231 echo "not found."
232 echo >> $LOG
233 echo >> $LOG
234 fi
235 return 1
236 fi
237 return 0
238}
239
240
241# Execute a compiled test binary
242test_execute()
243{
244 echo "executing the binary" >> $LOG
245 ./.tmp_out > .test_execute.log
246 rc=$?
247 cat .test_execute.log | tee -a $LOG
248 if [ $rc -ne 0 ]; then
249 fail $1
250 return 1
251 fi
252 echo >> $LOG
253 echo >> $LOG
254 return 0
255}
256
257
258# Execute a compiled test binary
259test_execute_path()
260{
261 echo "executing the binary (LD_LIBRARY_PATH=$1)" >> $LOG
262 LD_LIBRARY_PATH=$1 ./.tmp_out > .test_execute.log
263 rc=$?
264 cat .test_execute.log | tee -a $LOG
265 if [ $rc -ne 0 ]; then
266 fail
267 return 1
268 fi
269 echo >> $LOG
270 echo >> $LOG
271 return 0
272}
273
274
275#
276# Check for OS, MACHINE, CPU
277#
278check_environment()
279{
280 test_header environment
281 OS=`uname -s | sed -e 's/GNU\/Linux/Linux/g' | tr [:upper:] [:lower:]`
282 case "$OS" in
283 linux)
284 ;;
285 darwin)
286 ;;
287 freebsd)
288 ;;
289 sunos)
290 OS='solaris'
291 ;;
292 *)
293 log_failure "Cannot determine OS"
294 exit 1
295 ;;
296 esac
297 BUILD_CPU=`uname -m`
298 [ "$OS" = "solaris" ] && BUILD_CPU=`isainfo | cut -f 1 -d ' '`
299 case "$BUILD_CPU" in
300 i[3456789]86|x86|i86pc)
301 BUILD_MACHINE='x86'
302 LIB='lib'
303 ;;
304 x86_64|amd64)
305 BUILD_MACHINE='amd64'
306 BUILD_CPU='k8'
307 if [ "$OS" != "solaris" ]; then
308 # on AMD64 systems, 64bit libs are usually located in /usr/lib64
309 # see http://www.pathname.com/fhs/pub/fhs-2.3.html#LIB64
310 LIB='lib64'
311 else
312 # Solaris doesn't seem to subscribe to fhs, libs are usually in
313 # a '64' subdirectory of the standard 'lib' dirs while some 64-bit
314 # alternative binaries can be found in 'amd64' subdirs of the 'bin'
315 # ones. So, in order to find the right stuff (esp. sdl-config) we'll
316 # have to make sure the */bin/amd64 dirs are searched before the */bin
317 # ones. (The sed has some sideeffects, but they shouldn't harm us...)
318 echo "64-bit Solaris detected, hacking the PATH" >> $LOG
319 echo "old PATH: $PATH" >> $LOG
320 PATH=`echo ":$PATH:" | sed -e 's,\(:[^:]*/bin\):,\1/amd64:\1:,g' \
321 -e 's/^:*//' -e 's/:*$//g' -e 's/::*/:/g' `
322 export PATH
323 echo "new PATH: $PATH" >> $LOG
324 LIB='lib/64'
325 fi
326 ;;
327 *)
328 log_failure "Cannot determine system"
329 exit 1
330 ;;
331 esac
332 [ -z "$TARGET_MACHINE" ] && TARGET_MACHINE=$BUILD_MACHINE
333 [ -z "$TARGET_CPU" ] && TARGET_CPU=$BUILD_CPU
334 DEVDIR_BIN="$DEVDIR/$OS.$BUILD_MACHINE/bin"
335 log_success "Determined build machine: $OS.$BUILD_MACHINE, target machine: $OS.$TARGET_MACHINE"
336
337 echo "export BUILD_PLATFORM=\"$OS\"" >> $ENV
338 echo "export BUILD_PLATFORM_ARCH=\"$BUILD_MACHINE\"" >> $ENV
339 echo "export BUILD_TARGET=\"$OS\"" >> $ENV
340 echo "export BUILD_TARGET_ARCH=\"$TARGET_MACHINE\"" >> $ENV
341 echo "export BUILD_TARGET_CPU=\"$TARGET_CPU\"" >> $ENV
342 echo "export BUILD_TYPE=\"$BUILD_TYPE\"" >> $ENV
343}
344
345#
346# Check for gcc with version >= 3.2.
347# We depend on a working gcc, if we fail terminate in every case.
348#
349check_gcc()
350{
351 test_header gcc
352 if check_avail "$CC" CC really; then
353 cc_ver=`$CC -dumpversion` 2>/dev/null
354 if [ $? -ne 0 ]; then
355 log_failure "cannot execute '$CC -dumpversion'"
356 fail really
357 fi
358 if check_avail "$CXX" CXX really; then
359 cxx_ver=`$CXX -dumpversion` 2>/dev/null
360 if [ $? -ne 0 ]; then
361 log_failure "cannot execute '$CXX -dumpversion'"
362 fail really
363 fi
364 cc_maj=`echo $cc_ver|cut -d. -f1`
365 cc_min=`echo $cc_ver|cut -d. -f2`
366 if [ "x$cc_ver" != "x$cxx_ver" ]; then
367 log_failure "gcc version $cc_ver does not match g++ version $cxx_ver"
368 fail really
369 elif [ $cc_maj -eq 4 -a $cc_min -eq 0 -a "OS" = "darwin" ]; then
370 log_success "found version $cc_ver"
371 # gcc-4.0 is allowed for Darwin only
372 elif [ $cc_maj -lt 3 \
373 -o \( $cc_maj -eq 3 -a $cc_min -lt 2 \) \
374 -o \( $cc_maj -eq 4 -a $cc_min -lt 1 -a "$OS" != "darwin" \) \
375 -o \( $cc_maj -eq 4 -a $cc_min -gt 3 \) \
376 -o $cc_maj -gt 4 ]; then
377 log_failure "gcc version $cc_ver found, expected gcc 3.x with x>1 or gcc 4.x with 0<x<4"
378 fail really
379 else
380 log_success "found version $cc_ver"
381 fi
382 if [ "$BUILD_MACHINE" = "amd64" ]; then
383 [ -z "$CC32" ] && CC32="$CC -m32"
384 [ -z "$CXX32" ] && CXX32="$CXX -m32"
385 else
386 [ -z "$CC32" ] && CC32="$CC"
387 [ -z "$CXX32" ] && CXX32="$CXX"
388 fi
389 if [ "$BUILD_MACHINE" = "x86" -a "$TARGET_MACHINE" = "amd64" ]; then
390 [ -z "$CC64" ] && CC64="$CC -m64"
391 [ -z "$CXX64" ] && CXX64="$CXX -m64"
392 fi
393 if [ "$CC" != "gcc" ]; then
394 cnf_append "TOOL_GCC3_CC" "$CC"
395 cnf_append "TOOL_GCC3_AS" "$CC"
396 cnf_append "TOOL_GCC3_LD" "$CC"
397 cnf_append "TOOL_GXX3_CC" "$CC"
398 cnf_append "TOOL_GXX3_AS" "$CC"
399 fi
400 if [ "$CXX" != "g++" ]; then
401 cnf_append "TOOL_GCC3_CXX" "$CXX"
402 cnf_append "TOOL_GXX3_CXX" "$CXX"
403 cnf_append "TOOL_GXX3_LD" "$CXX"
404 fi
405 if [ "$CC32" != "gcc -m32" ]; then
406 cnf_append "TOOL_GCC32_CC" "$CC32"
407 cnf_append "TOOL_GCC32_AS" "$CC32"
408 cnf_append "TOOL_GCC32_LD" "$CC32"
409 cnf_append "TOOL_GXX32_CC" "$CC32"
410 cnf_append "TOOL_GXX32_AS" "$CC32"
411 fi
412 if [ "$CXX32" != "g++ -m32" ]; then
413 cnf_append "TOOL_GCC32_CXX" "$CXX32"
414 cnf_append "TOOL_GXX32_CXX" "$CXX32"
415 cnf_append "TOOL_GXX32_LD" "$CXX32"
416 fi
417 # this isn't not necessary, there is not such tool.
418 if [ -n "$CC64" ]; then
419 cnf_append "TOOL_GCC64_CC" "$CC64"
420 cnf_append "TOOL_GCC64_AS" "$CC64"
421 cnf_append "TOOL_GCC64_LD" "$CC64"
422 cnf_append "TOOL_GXX64_CC" "$CC64"
423 cnf_append "TOOL_GXX64_AS" "$CC64"
424 fi
425 if [ -n "$CXX64" ]; then
426 cnf_append "TOOL_GCC64_CXX" "$CXX64"
427 cnf_append "TOOL_GXX64_CXX" "$CXX64"
428 cnf_append "TOOL_GXX64_LD" "$CXX64"
429 fi
430 # Solaris sports a 32-bit gcc/g++.
431 if [ "$OS" = "solaris" -a "$BUILD_MACHINE" = "amd64" ]; then
432 [ "$CC" = "gcc" ] && CC="gcc -m64"
433 [ "$CXX" = "g++" ] && CXX="g++ -m64"
434 fi
435 fi
436 fi
437}
438
439
440#
441# Check for the bcc compiler, needed for compiling the BIOS
442#
443check_bcc()
444{
445 test_header bcc
446 if check_avail "$BCC" BCC; then
447 bcc_ver=`$BCC -v 2>&1|grep version|sed 's+^bcc: version \(.*\)+\1+'`
448 if [ $? -ne 0 ]; then
449 log_failure "not found"
450 fail
451 else
452 echo "compiling the following source file:" >> $LOG
453 cat > .tmp_src.c << EOF
454int foo(a)
455 int a;
456{
457 return 0;
458}
459EOF
460 cat .tmp_src.c >> $LOG
461 bcc_path=`which_wrapper $BCC`
462 bcc_dir="`dirname $bcc_path`/"
463 echo "using the following command line:" >> $LOG
464 echo "$BCC -B $bcc_dir -C-c -3 -S -o .tmp_out .tmp_src.c" >> $LOG
465 $BCC -B $bcc_dir -C-c -3 -S -o .tmp_out .tmp_src.c >> $LOG 2>&1
466 if [ $? -ne 0 ]; then
467 log_failure "not found"
468 fail
469 else
470 log_success "found version $bcc_ver"
471 cnf_append "VBOX_BCC" "$bcc_path -B $bcc_dir"
472 fi
473 unset bcc_path
474 unset bcc_dir
475 fi
476 fi
477}
478
479
480#
481# Check for the as86 assembler, needed for compiling the BIOS
482#
483check_as86()
484{
485 test_header as86
486 if check_avail "$AS86" AS86; then
487 as86_ver=`$AS86 -v 2>&1|grep version|sed 's+^as86 version: \(.*\)+\1+'`
488 if [ $? -ne 0 ]; then
489 log_failure "not found"
490 fail
491 else
492 log_success "found version $as86_ver"
493 cnf_append "VBOX_AS86" "`which_wrapper $AS86`"
494 fi
495 fi
496}
497
498
499#
500# Check for yasm, needed to compile assembler files
501#
502check_yasm()
503{
504 test_header yasm
505 if check_avail "$YASM" YASM; then
506 yasm_ver=`$YASM --version|grep "^yasm"|sed 's+^yasm \(.*\)+\1+'`
507 if [ $? -ne 0 ]; then
508 log_failure "not found"
509 fail
510 else
511 yasm_maj=`echo $yasm_ver|cut -d. -f1`
512 yasm_min=`echo $yasm_ver|cut -d. -f2`
513 yasm_rev=`echo $yasm_ver|cut -d. -f3`
514 yasm_ver_mul=`expr $yasm_maj \* 10000 + $yasm_min \* 100 + $yasm_rev`
515 if [ $yasm_ver_mul -lt 501 ]; then
516 log_failure "found version $yasm_ver, expected at least 0.5.1"
517 fail
518 else
519 log_success "found version $yasm_ver"
520 fi
521 fi
522 fi
523}
524
525
526#
527# Check for the iasl ACPI compiler, needed to compile vbox.dsl
528#
529check_iasl()
530{
531 test_header iasl
532 if check_avail "$IASL" IASL; then
533 iasl_ver=`$IASL|grep version|sed 's+^ASL.*version \([0-9]*\).*+\1+'`
534 if [ $? -ne 0 ]; then
535 log_failure "not found"
536 fail
537 else
538 log_success "found version $iasl_ver"
539 cnf_append "VBOX_IASLCMD" "`which_wrapper $IASL`"
540 fi
541 fi
542}
543
544
545#
546# Check for xsltproc, needed by Main
547#
548check_xsltproc()
549{
550 test_header xslt
551 if check_avail "$XSLTPROC" XSLTPROC; then
552 xsltproc_ver=`$XSLTPROC --version`
553 if [ $? -ne 0 ]; then
554 log_failure "not found"
555 fail
556 else
557 log_success "found"
558 cnf_append "VBOX_XSLTPROC" "`which_wrapper $XSLTPROC`"
559 fi
560 fi
561}
562
563
564#
565# Check for mkisofs, needed to build the CDROM image containing the additions
566#
567check_mkisofs()
568{
569 test_header mkisofs
570 if which_wrapper $GENISOIMAGE > /dev/null; then
571 mkisofs_ver=`$GENISOIMAGE --version`
572 if [ $? -ne 0 ]; then
573 log_failure "not found"
574 fail
575 else
576 log_success "found $mkisofs_ver"
577 cnf_append "VBOX_MKISOFS" "`which_wrapper $GENISOIMAGE`"
578 fi
579 elif check_avail "$MKISOFS" MKISOFS; then
580 mkisofs_ver=`$MKISOFS --version`
581 if [ $? -ne 0 ]; then
582 log_failure "not found"
583 fail
584 else
585 log_success "found $mkisofs_ver"
586 cnf_append "VBOX_MKISOFS" "`which_wrapper $MKISOFS`"
587 fi
588 fi
589}
590
591
592#
593# Check for libxml2, needed by VBoxSettings
594# 2.6.24 is known to NOT work, 2.6.26 is known to work (there is no 2.6.25 release)
595#
596check_libxml2()
597{
598 if [ -z "$BUILD_LIBXML2" ]; then
599 test_header libxml2
600 if which_wrapper pkg-config > /dev/null; then
601 libxml2_ver=`pkg-config libxml-2.0 --modversion 2>> $LOG`
602 if [ $? -ne 0 ]; then
603 log_failure "not found"
604 fail
605 else
606 FLGXML2=`pkg-config libxml-2.0 --cflags`
607 INCXML2=`strip_I "$FLGXML2"`
608 LIBXML2=`pkg-config libxml-2.0 --libs`
609 cat > .tmp_src.cc << EOF
610#include <cstdio>
611#include <libxml/xmlversion.h>
612extern "C" int main(void)
613{
614 printf("found version %s", LIBXML_DOTTED_VERSION);
615#if LIBXML_VERSION >= 20626
616 printf(", OK.\n");
617 return 0;
618#else
619 printf(", expected version 2.6.26 or higher\n");
620 return 1;
621#endif
622}
623EOF
624 [ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
625 if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
626 if test_execute; then
627 cnf_append "SDK_VBOX_LIBXML2_INCS" "$INCXML2"
628 cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
629 fi
630 fi
631 fi
632 elif which_wrapper xml2-config; then
633 libxml2_ver=`xml2-config --version`
634 if [ $? -ne 0 ]; then
635 log_failure "not found"
636 fail
637 else
638 log_success "found version $libxml2_ver"
639 FLGXML2=`xml2-config --cflags`
640 INCXML2=`strip_I "$FLGXML2"`
641 LIBXML2=`xml2-config --libs`
642 cat > .tmp_src.cc << EOF
643#include <cstdio>
644#include <libxml/xmlversion.h>
645extern "C" int main(void)
646{
647 printf("found version %s", LIBXML_DOTTED_VERSION);
648#if LIBXML_VERSION >= 20626
649 printf(", OK.\n");
650 return 0;
651#else
652 printf(", expected version 2.6.26 or higher\n");
653 return 1;
654#endif
655}
656EOF
657 [ -n "$INCXML2" ] && I_INCXML2=`prefix_I "$INCXML2"`
658 if test_compile "$LIBXML2 $LIBPTHREAD $I_INCXML2" xml2 xml2; then
659 if test_execute; then
660 cnf_append "SDK_VBOX_LIBXML2_INCS" "$INCXML2"
661 cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
662 fi
663 fi
664 fi
665 else
666 log_failure "neither pkg-config nor xml2-config found"
667 fail
668 fi
669 fi
670}
671
672
673#
674# Check for libxslt, needed by VBoxSettings. For now we depend on 1.1.17.
675# This library is available on Ubuntu Edgy which fulfils the minimal libxml2
676# requirement (2.6.26).
677#
678check_libxslt()
679{
680 if [ -z "$BUILD_LIBXSLT" ]; then
681 test_header libxslt
682 if which_wrapper pkg-config > /dev/null; then
683 libxslt_ver=`pkg-config libxslt --modversion 2>> $LOG`
684 if [ $? -ne 0 ]; then
685 log_failure "not found"
686 fail
687 else
688 FLGXSLT=`pkg-config libxslt --cflags`
689 INCXSLT=`strip_I "$FLGXSLT"`
690 LIBXSLT=`pkg-config libxslt --libs`
691 cat > .tmp_src.cc << EOF
692#include <cstdio>
693#include <libxslt/xsltconfig.h>
694extern "C" int main(void)
695{
696 printf("found version %s", LIBXSLT_DOTTED_VERSION);
697#if LIBXSLT_VERSION >= 10117
698 printf(", OK.\n");
699 return 0;
700#else
701 printf(", expected version 1.1.17 or higher\n");
702 return 1;
703#endif
704}
705EOF
706 [ -n "$INCXSLT" ] && I_INCXSLT=`prefix_I "$INCXSLT"`
707 if test_compile "$LIBXSLT $LIBPTHREAD $I_INCXSLT" xslt xslt; then
708 if test_execute; then
709 cnf_append "SDK_VBOX_LIBXSLT_INCS" "$INCXSLT"
710 cnf_append "SDK_VBOX_LIBXSLT_LIBS" "`strip_l "$LIBXSLT"`"
711 fi
712 fi
713 fi
714 elif which_wrapper xslt-config; then
715 libxslt_ver=`xslt-config --version`
716 if [ $? -ne 0 ]; then
717 log_failure "not found"
718 fail
719 else
720 log_success "found version $libxslt_ver"
721 FLGXSLT=`xslt-config --cflags`
722 INCXSLT=`strip_I "$FLGXSLT"`
723 LIBXSLT=`xslt-config --libs`
724 cat > .tmp_src.cc << EOF
725#include <cstdio>
726#include <libxslt/xsltconfig.h>
727extern "C" int main(void)
728{
729 printf("found version %s", LIBXSLT_DOTTED_VERSION);
730#if LIBXSLT_VERSION >= 10117
731 printf(", OK.\n");
732 return 0;
733#else
734 printf(", expected version 1.1.17 or higher\n");
735 return 1;
736#endif
737}
738EOF
739 [ -n "$INCXSLT" ] && I_INCXSLT=`prefix_I "$INCXSLT"`
740 if test_compile "$LIBXSLT $LIBPTHREAD $I_INCXSLT" xslt xslt; then
741 if test_execute; then
742 cnf_append "SDK_VBOX_LIBXSLT_INCS" "$INCXSLT"
743 cnf_append "SDK_VBOX_LIBXSLT_LIBS" "`strip_l "$LIBXSLT"`"
744 fi
745 fi
746 fi
747 else
748 log_failure "neither pkg-config nor xslt-config found"
749 fail
750 fi
751 fi
752}
753
754
755#
756# Check for libIDL, needed by xpcom
757#
758check_libidl()
759{
760 test_header libIDL
761
762 if which_wrapper libIDL-config-2 > /dev/null; then
763 libidl_ver=`libIDL-config-2 --version`
764 if [ $? -ne 0 ]; then
765 log_failure "not found"
766 fail
767 else
768 log_success "found version $libidl_ver"
769 cnf_append "VBOX_LIBIDL_CONFIG" \
770 "PKG_CONFIG_PATH=`libIDL-config-2 --prefix`/$LIB/pkgconfig `which_wrapper libIDL-config-2`"
771 fi
772 elif check_avail "libIDL-config" libIDL-config; then
773 libidl_ver=`libIDL-config --version`
774 if [ $? -ne 0 ]; then
775 log_failure "not found"
776 fail
777 else
778 log_success "found version $libidl_ver"
779 cnf_append "VBOX_LIBIDL_CONFIG" "`which_wrapper libIDL-config`"
780 fi
781 fi
782}
783
784
785#
786# Check for openssl, needed for RDP
787#
788check_ssl()
789{
790 test_header ssl
791 cat > .tmp_src.cc << EOF
792#include <cstdio>
793#include <openssl/opensslv.h>
794extern "C" int main(void)
795{
796 printf("found version %s", OPENSSL_VERSION_TEXT);
797#if OPENSSL_VERSION_NUMBER >= 0x0090700
798 printf(", OK.\n");
799 return 0;
800#else
801 printf(", expected version 0.9.7 or higher\n");
802 return 1;
803#endif
804}
805EOF
806 if test_compile $LIBCRYPTO libcrypto openssl; then
807 if test_execute nofatal; then
808 cnf_append "SDK_VBOX_OPENSSL_INCS" ""
809 cnf_append "SDK_VBOX_OPENSSL_LIBS" "`strip_l "$LIBCRYPTO"`"
810 fi
811 fi
812}
813
814
815#
816# Check for pthread, needed by VBoxSVC, frontends, ...
817#
818check_pthread()
819{
820 test_header pthread
821 cat > .tmp_src.cc << EOF
822#include <cstdio>
823#include <pthread.h>
824extern "C" int main(void)
825{
826 pthread_mutex_t mutex;
827 if (pthread_mutex_init(&mutex, NULL)) {
828 printf("pthread_mutex_init() failed\n");
829 return 1;
830 }
831 if (pthread_mutex_lock(&mutex)) {
832 printf("pthread_mutex_lock() failed\n");
833 return 1;
834 }
835 if (pthread_mutex_unlock(&mutex)) {
836 printf("pthread_mutex_unlock() failed\n");
837 return 1;
838 }
839 printf("found, OK.\n");
840}
841EOF
842 if test_compile $LIBPTHREAD pthread pthread; then
843 if test_execute; then
844 cnf_append "LIB_PTHREAD" "`strip_l "$LIBPTHREAD"`"
845 fi
846 fi
847}
848
849
850#
851# Check for zlib, needed by VBoxSVC, Runtime, ...
852#
853check_z()
854{
855 test_header zlib
856 cat > .tmp_src.cc << EOF
857#include <cstdio>
858#include <zlib.h>
859extern "C" int main(void)
860{
861 printf("found version %s", ZLIB_VERSION);
862#if ZLIB_VERNUM >= 0x1210
863 printf(", OK.\n");
864 return 0;
865#else
866 printf(", expected version 1.2.1 or higher\n");
867 return 1;
868#endif
869}
870EOF
871 [ -n "$INCZ" ] && I_INCZ=`prefix_I "$INCZ"`
872 if test_compile "$LIBZ $I_INCZ" zlib zlib; then
873 if test_execute; then
874 cnf_append "SDK_VBOX_ZLIB_LIBS" "`strip_l "$LIBZ"`"
875 cnf_append "SDK_VBOX_ZLIB_INCS" "$INCZ"
876 fi
877 fi
878}
879
880
881#
882# Check for libpng, needed by kchmviewer
883#
884check_png()
885{
886 test_header libpng
887 cat > .tmp_src.cc << EOF
888#include <cstdio>
889#include <png.h>
890extern "C" int main(void)
891{
892 printf("found version %s", PNG_LIBPNG_VER_STRING);
893#if PNG_LIBPNG_VER >= 10205
894 printf(", OK.\n");
895 return 0;
896#else
897 printf(", expected version 1.2.5 or higher\n");
898 return 1;
899#endif
900}
901EOF
902 [ -n "$INCPNG" ] && I_INCPNG=`prefix_I "$INCPNG"`
903# if test_compile "$LIBPNG $I_INCPNG" libpng libpng nofatal; then
904 if test_compile "$LIBPNG $I_INCPNG" libpng libpng; then
905# if test_execute nofatal; then
906 if test_execute; then
907 cnf_append "SDK_VBOX_LIBPNG_LIBS" "`strip_l "$LIBPNG"`"
908 cnf_append "SDK_VBOX_LIBPNG_INCS" "$INCPNG"
909 fi
910 fi
911}
912
913
914#
915# Check for pam, needed by VRDPAuth
916# Version 79 was introduced in 9/2005, do we support older versions?
917# Debian/sarge uses 76
918# OpenSUSE comes with 0.99.xxx where they changed the versioning scheme.
919#
920check_pam()
921{
922 test_header pam
923 cat > .tmp_src.cc << EOF
924#include <cstdio>
925#include <security/pam_appl.h>
926extern "C" int main(void)
927{
928 printf("found version %d", __LIBPAM_VERSION);
929 if (__LIBPAM_VERSION >= 76)
930 {
931 printf(", OK.\n");
932 return 0;
933 }
934 else
935 {
936 printf(", expected version 76 or higher\n");
937 return 1;
938 }
939}
940EOF
941 if test_compile "-lpam" pam pam nofatal; then
942 if test_execute nofatal; then
943 return 0;
944 fi
945 fi
946 test_header linux_pam
947 cat > .tmp_src.cc << EOF
948#include <cstdio>
949#include <security/pam_appl.h>
950extern "C" int main(void)
951{
952 printf("found version %d.%d", __LINUX_PAM__, __LINUX_PAM_MINOR__);
953 if (__LINUX_PAM__ >= 1)
954 {
955 printf(", OK.\n");
956 return 0;
957 }
958 else
959 {
960 printf(", expected version 1.0 or higher\n");
961 return 1;
962 }
963}
964EOF
965 if test_compile "-lpam" pam pam; then
966 test_execute
967 fi
968}
969
970
971#
972# Check for the SDL library, needed by VBoxSDL and VirtualBox
973# We depend at least on version 1.2.7
974#
975check_sdl()
976{
977 test_header SDL
978 if [ "$OS" = "darwin" ]; then
979 if [ -f "/System/Library/Frameworks/SDL.framework/SDL" ]; then
980 PATH_SDK_LIBSDL="/System/Library/Frameworks/SDL.framework"
981 elif [ -f "/Library/Frameworks/SDL.framework/SDL" ]; then
982 PATH_SDK_LIBSDL="/Library/Frameworks/SDL.framework"
983 fi
984 if [ -n "$PATH_SDK_LIBSDL" ]; then
985 foundsdl=1
986 INCSDL="$PATH_SDK_LIBSDL/Headers"
987 FLDSDL="-framework SDL"
988 else
989 log_failure "SDL framework not found"
990 fail
991 fi
992 else
993 if which_wrapper sdl-config > /dev/null; then
994 FLGSDL=`sdl-config --cflags`
995 INCSDL=`strip_I "$FLGSDL"`
996 LIBSDL=`sdl-config --libs`
997 LIBSDLMAIN="-lSDLmain"
998 FLDSDL=
999 foundsdl=1
1000 fi
1001 fi
1002 [ "$OS" = "linux" -o "$OS" = "darwin" -o "$OS" = "solaris" ] && LIBSDLMAIN=""
1003 if [ -n "$foundsdl" ]; then
1004 cat > .tmp_src.cc << EOF
1005#include <cstdio>
1006#include <SDL.h>
1007#include <SDL_main.h>
1008#undef main
1009extern "C" int main(int argc, char** argv)
1010{
1011 printf("found version %d.%d.%d",
1012 SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
1013#if SDL_VERSION_ATLEAST(1,2,7)
1014 printf(", OK.\n");
1015 return 0;
1016#else
1017 printf(", expected version 1.2.7 or higher\n");
1018 return 1;
1019#endif
1020}
1021EOF
1022 [ -n "$INCSDL" ] && I_INCSDL=`prefix_I "$INCSDL"`
1023 if test_compile "$LIBSDL $LIBSDLMAIN $I_INCSDL $FLDSDL" SDL SDL; then
1024 if test_execute; then
1025 cnf_append "LIB_SDK_LIBSDL_SDL" "`strip_l "$LIBSDL"`"
1026 cnf_append "SDK_LIBSDL_LIBPATH" "`strip_L "$LIBSDL"`"
1027 cnf_append "LIB_SDK_LIBSDL_SDLMAIN" "`strip_l "$LIBSDLMAIN"`"
1028 [ -n "$INCSDL" ] && cnf_append "SDK_LIBSDL_INCS" "$INCSDL"
1029 [ -n "$FLDSDL" ] && cnf_append "SDK_LIBSDL_LDFLAGS" "$FLDSDL"
1030 fi
1031 fi
1032 else
1033 log_failure "not found"
1034 fail
1035 fi
1036}
1037
1038
1039#
1040# Check for the SDL_ttf library, needed by VBoxSDL (secure label)
1041#
1042check_sdl_ttf()
1043{
1044 test_header SDL_ttf
1045 cat > .tmp_src.cc << EOF
1046#include <cstdio>
1047#include <SDL_ttf.h>
1048#ifndef SDL_TTF_MAJOR_VERSION
1049#define SDL_TTF_MAJOR_VERSION TTF_MAJOR_VERSION
1050#define SDL_TTF_MINOR_VERSION TTF_MINOR_VERSION
1051#define SDL_TTF_PATCHLEVEL TTF_PATCHLEVEL
1052#endif
1053extern "C" int main(void)
1054{
1055 printf("found version %d.%d.%d",
1056 SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL);
1057#if 10000*SDL_TTF_MAJOR_VERSION + 100*SDL_TTF_MINOR_VERSION + SDL_TTF_PATCHLEVEL >= 20006
1058 printf(", OK.\n");
1059 return 0;
1060#else
1061 printf(", expected version 2.0.6 or higher\n");
1062 return 1;
1063#endif
1064}
1065EOF
1066 if test_compile "-lSDL_ttf $I_INCSDL" SDL_ttf SDL_ttf nofatal; then
1067 if ! test_execute nofatal; then
1068 cnf_append "VBOX_WITH_SECURELABEL" ""
1069 fi
1070 else
1071 cnf_append "VBOX_WITH_SECURELABEL" ""
1072 fi
1073}
1074
1075
1076#
1077# Check for libasound, needed by the ALSA audio backend
1078#
1079check_alsa()
1080{
1081 test_header ALSA
1082 cat > .tmp_src.cc << EOF
1083#include <cstdio>
1084#include <alsa/asoundlib.h>
1085extern "C" int main(void)
1086{
1087 printf("found version %d.%d.%d",
1088 SND_LIB_MAJOR, SND_LIB_MINOR, SND_LIB_SUBMINOR);
1089#if 10000*SND_LIB_MAJOR + 100*SND_LIB_MINOR + SND_LIB_SUBMINOR >= 10006
1090 printf(", OK.\n");
1091 return 0;
1092#else
1093 printf(", expected version 1.0.6 or higher\n");
1094 return 1;
1095#endif
1096}
1097EOF
1098 if test_compile "-lasound" asound asound; then
1099 test_execute
1100 fi
1101}
1102
1103
1104#
1105# Check for PulseAudio
1106#
1107check_pulse()
1108{
1109 test_header "PulseAudio"
1110 cat > .tmp_src.cc << EOF
1111#include <cstdio>
1112#include <pulse/version.h>
1113extern "C" int main(void)
1114{
1115 printf("found version %s API version %d", pa_get_headers_version(), PA_API_VERSION);
1116#if PA_API_VERSION >= 9
1117 printf(", OK.\n");
1118 return 0;
1119#else
1120 printf(", expected version 0.9.0 (API version 9) or higher\n");
1121 return 1;
1122#endif
1123}
1124EOF
1125 if test_compile "-lpulse" pulse pulse; then
1126 test_execute
1127 fi
1128}
1129
1130
1131#
1132# Check for the Xcursor library, needed by VBoxSDL and VBoxBFE
1133#
1134check_xcursor()
1135{
1136 test_header Xcursor
1137 cat > .tmp_src.cc << EOF
1138#include <cstdio>
1139#include <X11/Xlib.h>
1140#include <X11/Xcursor/Xcursor.h>
1141extern "C" int main(void)
1142{
1143 XcursorImage *cursor = XcursorImageCreate (10, 10);
1144 XcursorImageDestroy(cursor);
1145 return 0;
1146}
1147EOF
1148 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1149 if test_compile "$LIBX11 $LIBXCURSOR $I_INCX11" Xcursor Xcursor; then
1150 log_success "found"
1151 cnf_append "VBOX_XCURSOR_LIBS" "`strip_l "$LIBXCURSOR"`"
1152 fi
1153}
1154
1155
1156#
1157# Check for the X libraries (Xext, X11)
1158#
1159check_x()
1160{
1161 test_header "X libraries"
1162 cat > .tmp_src.cc << EOF
1163#include <cstdio>
1164#include <X11/Xlib.h>
1165extern "C" int main(void)
1166{
1167 Display *dpy;
1168 int scrn_num;
1169 Screen *scrn;
1170 Window win;
1171
1172 dpy = XOpenDisplay(NULL);
1173 scrn_num = DefaultScreen(dpy);
1174 scrn = ScreenOfDisplay(dpy, scrn_num);
1175 win = XCreateWindow(dpy, RootWindowOfScreen(scrn), 0, 0, 100, 100,
1176 0, 16, InputOutput, CopyFromParent, 0, NULL);
1177 XDestroyWindow(dpy, win);
1178}
1179EOF
1180 [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
1181 if test_compile "$LIBX11 $I_INCX11" Xlibs Xlibs; then
1182 log_success "found"
1183 fi
1184}
1185
1186
1187#
1188# Check for the Qt3 library, needed by VirtualBox
1189#
1190check_qt3()
1191{
1192 test_header Qt3
1193 cat > .tmp_src.cc << EOF
1194#include <cstdio>
1195#include <qglobal.h>
1196extern "C" int main(void)
1197{
1198 printf("found version %s", QT_VERSION_STR);
1199#if QT_VERSION >= 0x030305
1200 printf(", OK.\n");
1201 return 0;
1202#elif QT_VERSION >= 0x030300
1203 printf("\n ** WARNING: QT < 3.3.5 has known problems!\n");
1204#else
1205 printf(", expected version 3.3.0 or higher\n");
1206 return 1;
1207#endif
1208}
1209EOF
1210 found_qt=0
1211 libs="lib"
1212 [ "$LIB" = "lib64" ] && libs="$libs lib64"
1213 for q in $QT3DIR; do
1214 for l in $libs; do
1215 echo "compiling the following source file:" >> $LOG
1216 cat .tmp_src.cc >> $LOG
1217 echo "using the following command line:" >> $LOG
1218 echo "$CXX -O -Wall -o .tmp_out .tmp_src.cc -I$q/include -L$q/$l -lqt-mt $LIBPTHREAD" >> $LOG
1219 $CXX -O -Wall -o .tmp_out .tmp_src.cc -I$q/include -L$q/$l -lqt-mt $LIBPTHREAD >> $LOG 2>&1
1220 if [ $? -eq 0 ]; then
1221 if test_execute; then
1222 cnf_append "PATH_SDK_QT3" "`cd $q ; pwd`"
1223 found_qt=1
1224 break
1225 fi
1226 fi
1227 done
1228 if [ $found_qt -eq 1 ]; then
1229 break
1230 fi
1231 done
1232 if [ $found_qt -ne 1 ]; then
1233 echo
1234 echo " Qt3 not found at \"$QT3DIR\" or Qt3 headers not found"
1235 echo " Check the file $LOG for detailed error information."
1236 fail
1237 return 1
1238 fi
1239 test_header "Qt3 devtools"
1240 if check_avail "$q/bin/moc" QT3DIR/bin; then
1241 moc_ver=`$q/bin/moc 2>&1 -v|sed 's+^.*(Qt \(.*\))+\1+'`
1242 if [ $? -ne 0 ]; then
1243 log_failure "not found"
1244 fail
1245 else
1246 log_success "found version $moc_ver"
1247 # cnf_append "VBOX_PATH_QT3" "$q" - later/never?
1248 cnf_append "PATH_SDK_QT3" "$q"
1249 cnf_append "PATH_SDK_QT3_LIB" "$q/$l"
1250 cnf_append "PATH_SDK_QT3_INC" "$q/include"
1251 cnf_append "PATH_TOOL_QT3_BIN" "$q/bin"
1252 fi
1253 fi
1254}
1255
1256
1257#
1258# Check for the Qt4 library, needed by VirtualBox4
1259#
1260# Currently not fatal.
1261#
1262check_qt4()
1263{
1264 foundqt4=
1265 test_header Qt4
1266 if [ "$OS" = "darwin" ]; then
1267 if [ -f "/System/Library/Frameworks/QtCore.framework/QtCore" ]; then
1268 PATH_SDK_QT4="/System/Library/Framework/QtCore.framework"
1269 elif [ -f "/Library/Frameworks/QtCore.framework/QtCore" ]; then
1270 PATH_SDK_QT4="/Library/Frameworks/QtCore.framework"
1271 fi
1272 if [ -n "$PATH_SDK_QT4" ]; then
1273 foundqt4=1
1274 INCQT4="$PATH_SDK_QT4/Headers"
1275 LIBQT4=
1276 FLGQT4="-framework QtCore"
1277 else
1278 log_failure "Qt4 framework not found (can be disable using --disable-qt4)"
1279 fail
1280 fi
1281 else
1282 if [ $QT4DIR_PKGCONFIG -eq 1 ]; then
1283 # default is to use pkg-config
1284 if which_wrapper pkg-config > /dev/null; then
1285 # this braindead path is necessary for mdv2008.1
1286 qt4_ver=`\
1287 PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
1288 pkg-config QtCore --modversion 2>> $LOG`
1289 if [ $? -ne 0 ]; then
1290 log_failure "not found"
1291 fail
1292 else
1293 FLGQT4=`\
1294 PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
1295 pkg-config QtCore --cflags`
1296 INCQT4=`strip_I "$FLGQT4"`
1297 LIBQT4=`\
1298 PKG_CONFIG_PATH=/usr/lib/qt4/lib/pkgconfig \
1299 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
1300 pkg-config QtCore --libs`
1301 foundqt4=1
1302 fi
1303 else
1304 log_failure "pkg-config not found"
1305 fail
1306 fi
1307 else
1308 # do it the old way (e.g. user has specified QT4DIR)
1309 cat > .tmp_src.cc << EOF
1310#include <cstdio>
1311#include <QtGlobal>
1312extern "C" int main(void)
1313{
1314 printf("found version %s", QT_VERSION_STR);
1315#if QT_VERSION >= 0x040300
1316 printf(", OK.\n");
1317 return 0;
1318#else
1319 printf(", expected version 4.3.0 or higher\n");
1320 return 1;
1321#endif
1322}
1323EOF
1324 for q in $QT4DIR; do
1325 INCQT4="$q/include $q/include/QtCore"
1326 FLGQT4="-DQT_SHARED"
1327 I_INCQT4=`prefix_I "$INCQT4"`
1328 LIBQT4="-L$q/lib -lVBoxQtCore"
1329 if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
1330 foundqt4=2
1331 break;
1332 fi
1333 LIBQT4="-L$q/lib -lQtCore"
1334 if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
1335 foundqt4=1
1336 break;
1337 fi
1338 done
1339 fi
1340 fi
1341 if [ -n "$foundqt4" ]; then
1342 cat > .tmp_src.cc << EOF
1343#include <cstdio>
1344#include <QtGlobal>
1345extern "C" int main(void)
1346{
1347 printf("found version %s", QT_VERSION_STR);
1348#if QT_VERSION >= 0x040300
1349 printf(", OK.\n");
1350 return 0;
1351#else
1352 printf(", expected version 4.3.0 or higher\n");
1353 return 1;
1354#endif
1355}
1356EOF
1357 [ -n "$INCQT4" ] && I_INCQT4=`prefix_I "$INCQT4"`
1358 if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal; then
1359 if test_execute_path "`strip_L "$LIBQT4"`"; then
1360 if [ "$OS" != "darwin" ]; then
1361 # strip .../QtCore as we add components ourself
1362 INCQT4=`echo "$INCQT4"|$KBUILD_SED 's|\([^ ]*\)/QtCore|\1|g; s| $||g'`
1363 # store only the first path, remove all other pathes
1364 # most likely pkg-config gave us -I/usr/include/qt4 -I/usr/include/qt4/QtCore
1365 INCQT4=`echo "$INCQT4"|$KBUILD_SED 's|\([^ ]*\) .*|\1|'`
1366 cnf_append "VBOX_PATH_QT4_LIB" "`strip_L "$LIBQT4"`"
1367 cnf_append "SDK_QT4_LIBPATH" "`strip_L "$LIBQT4"`"
1368 cnf_append "PATH_SDK_QT4_INC" "$INCQT4"
1369 # this is not quite right since the qt libpath does not have to be first...
1370 cnf_append "PATH_SDK_QT4_LIB" '$'"(firstword `strip_L "$LIBQT4"`)"
1371 if [ "$foundqt4" = "2" ]; then
1372 cnf_append "VBOX_WITH_QT4_SUN" "1"
1373 fi
1374 test_header "Qt4 devtools"
1375 for q in $QT4DIR; do
1376 if which_wrapper "$q/bin/moc" > /dev/null; then
1377 moc_ver=`$q/bin/moc -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
1378 if [ $? -ne 0 ]; then
1379 log_failure "not found"
1380 fail
1381 else
1382 log_success "found version $moc_ver"
1383 cnf_append "VBOX_PATH_QT4" "$q"
1384 cnf_append "PATH_SDK_QT4" "$q"
1385 cnf_append "PATH_TOOL_QT4" "$q"
1386 cnf_append "PATH_TOOL_QT4_BIN" "$q/bin"
1387 return
1388 fi
1389 fi
1390 done
1391 fi
1392 fi
1393 else
1394 log_failure "not found"
1395 fail
1396 fi
1397 else
1398 log_failure "not found"
1399 fail
1400 fi
1401}
1402
1403
1404#
1405# Check whether static libstdc++ is installed
1406#
1407check_staticlibstdcxx()
1408{
1409 test_header "static stc++ library"
1410 libstdcxx=`$CXX -print-file-name=libstdc++.a`
1411 cat > .tmp_src.cc << EOF
1412#include <string>
1413
1414extern "C" int main(void)
1415{
1416 std::string s = "test";
1417 return 0;
1418}
1419EOF
1420 if test_compile "$libstdcxx" libstdc++ libstdc++; then
1421 log_success "found"
1422 fi
1423}
1424
1425
1426#
1427# Check for Linux sources
1428#
1429check_linux()
1430{
1431 test_header "Linux kernel sources"
1432 cat > .tmp_src.c << EOF
1433#include <linux/version.h>
1434int printf(const char *format, ...);
1435int main(void)
1436{
1437 printf("found version %d.%d.%d", LINUX_VERSION_CODE / 65536,
1438 (LINUX_VERSION_CODE % 65536) / 256,
1439 LINUX_VERSION_CODE % 256);
1440#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,0)
1441 printf(", OK.\n");
1442 return 0;
1443#else
1444 printf(", expected version 2.4.0 or higher\n");
1445 return 1;
1446#endif
1447}
1448EOF
1449 echo "compiling the following source file:" >> $LOG
1450 cat .tmp_src.c >> $LOG
1451 echo "using the following command line:" >> $LOG
1452 echo "$CC -O -Wall -o .tmp_out .tmp_src.c -nostdinc -I$LINUX/include" >> $LOG
1453 $CC -O -Wall -o .tmp_out .tmp_src.c -nostdinc -I$LINUX/include >> $LOG 2>&1
1454 if [ $? -ne 0 ]; then
1455 echo
1456 echo " Linux kernel headers not found at $LINUX"
1457 echo " Check the file $LOG for detailed error information."
1458 fail
1459 else
1460 if test_execute; then
1461 cnf_append "VBOX_LINUX_SRC" "`cd $LINUX ; pwd`"
1462 fi
1463 fi
1464}
1465
1466
1467#
1468# Check for kchmviewer, needed to display the online help
1469# (unused as we ship kchmviewer)
1470#
1471check_kchmviewer()
1472{
1473 test_header kchmviewer
1474 if check_avail "$KCHMVIEWER" KCHMVIEWER; then
1475 kchmviewer_ver=`$KCHMVIEWER --version|grep "^KchmViewer:"|sed 's+^KchmViewer: \(.*\)+\1+'`
1476 if [ $? -ne 0 ]; then
1477 log_failure "not found"
1478 fail
1479 else
1480 log_success "found version $kchmviewer_ver"
1481 fi
1482 fi
1483}
1484
1485
1486#
1487# Check for the kBuild tools, we don't support GNU make
1488#
1489check_kbuild()
1490{
1491 test_header kBuild
1492 if which_wrapper "$KBUILDDIR/bin/$OS.$BUILD_MACHINE/kmk" > /dev/null; then
1493 KBUILDDIR_BIN="$KBUILDDIR/bin/$OS.$BUILD_MACHINE"
1494 echo "export PATH_KBUILD=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
1495 echo "export PATH_DEVTOOLS=\"$DEVDIR\"" >> $ENV
1496 echo "path_kbuild_bin=\"\$PATH_KBUILD/bin/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"" >> $ENV
1497 echo "export PATH_KBUILD_BIN=\"\$path_kbuild_bin\"" >> $ENV
1498 echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV
1499 if [ "$OS" = "solaris" ]; then
1500 # Because of sh being non-default shell in Solaris we need to export PATH again when
1501 # sourcing env.sh. Simply exporting from ./configure does not export PATH correctly.
1502 echo "PATH=\"$ORGPATH\"" >> $ENV
1503 echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1504 echo "echo \"\$PATH\" | /usr/sfw/bin/ggrep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1505 else
1506 echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
1507 echo "echo \"\$PATH\" | grep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
1508 fi
1509 echo "export PATH" >> $ENV
1510 echo "unset path_kbuild_bin path_dev_bin" >> $ENV
1511 KBUILD_SED="$KBUILDDIR_BIN/kmk_sed"
1512 elif check_avail "kmk" KBUILDDIR really; then
1513 # check for installed kBuild
1514 KBUILD_SED="`which_wrapper kmk_sed`"
1515 else
1516 fail
1517 fi
1518 log_success "found"
1519}
1520
1521
1522#
1523# Check for compiler.h
1524# Some Linux distributions include "compiler.h" in their libc linux
1525# headers package, some don't. Most don't need it, building might (!)
1526# not succeed on openSUSE without it.
1527#
1528# See http://www.mail-archive.com/qemu-devel%40nongnu.org/msg07980.html
1529#
1530check_compiler_h()
1531{
1532 test_header compiler.h
1533 if ! test -f "/usr/include/linux/compiler.h"; then
1534 cnf_append "VBOX_WITHOUT_LINUX_COMPILER_H" "1"
1535 log_success "compiler.h not found"
1536 else
1537 log_success "compiler.h found"
1538 fi
1539}
1540
1541#
1542# Check for libcap.
1543# Required to pass CAP_NET_RAW to our binaries to allow to open SOCK_RAW
1544# sockets for doing ICMP requests.
1545#
1546check_libcap()
1547{
1548 test_header "libcap library"
1549 cat > .tmp_src.cc << EOF
1550#include <cstdio>
1551#include <sys/capability.h>
1552
1553extern "C" int main(void)
1554{
1555 char buf[1024];
1556 cap_t caps = cap_get_proc();
1557 snprintf(buf, sizeof(buf), "Current caps are '%s'\n", cap_to_text(caps, NULL));
1558 return 0;
1559}
1560EOF
1561 if test_compile $LIBCAP libcap libcap; then
1562 if test_execute; then
1563 log_success "found"
1564 fi
1565 fi
1566}
1567
1568#
1569# Check if we are able to build 32-bit applications (needed for the guest additions)
1570#
1571check_32bit()
1572{
1573 test_header "32-bit support"
1574 cat > .tmp_src.c << EOF
1575#include <stdint.h>
1576int main(void)
1577{
1578 return 0;
1579}
1580EOF
1581 echo "compiling the following source file:" >> $LOG
1582 cat .tmp_src.c >> $LOG
1583 echo "using the following command line:" >> $LOG
1584 echo "$CC -m32 -O -Wall -o .tmp_out .tmp_src.c" >> $LOG
1585 $CC -m32 -O -Wall -o .tmp_out .tmp_src.c >> $LOG 2>&1
1586 if [ $? -ne 0 ]; then
1587 echo
1588 echo " Cannot compile 32-bit applications (missing headers and/or libraries)!"
1589 echo " Check the file $LOG for detailed error information."
1590 fail
1591 fi
1592 log_success ""
1593}
1594
1595
1596#
1597# Check for Python
1598#
1599check_python()
1600{
1601 test_header "python support"
1602 cat > .tmp_src.cc << EOF
1603#include <cstdio>
1604#include <Python.h>
1605extern "C" int main(void)
1606{
1607 Py_Initialize();
1608 printf("found version %s", PY_VERSION);
1609#if PY_VERSION_HEX >= 0x02030000
1610 printf(", OK.\n");
1611 return 0;
1612#else
1613 printf(", expected version 2.3 or higher\n");
1614 return 1;
1615#endif
1616}
1617EOF
1618 found=
1619 for p in $PYTHONDIR; do
1620 for d in python2.6 python2.5 python2.4 python2.3; do
1621 for b in lib64 lib/64 lib; do
1622 echo "compiling the following source file:" >> $LOG
1623 cat .tmp_src.cc >> $LOG
1624 echo "using the following command line:" >> $LOG
1625 echo "$CXX -O -Wall -o .tmp_out .tmp_src.cc -I$p/include/$d $p/$b/lib$d.so" >> $LOG
1626 $CXX -O -Wall -o .tmp_out .tmp_src.cc -I$p/include/$d $p/$b/lib$d.so >> $LOG 2>&1
1627 if [ $? -eq 0 ]; then
1628 found=1
1629 break
1630 fi
1631 done
1632 if [ -n "$found" ]; then break; fi
1633 done
1634 if [ -n "$found" ]; then break; fi
1635 done
1636 if [ -n "$found" ]; then
1637 if test_execute; then
1638 cnf_append "VBOX_WITH_PYTHON" "1"
1639 cnf_append "VBOX_PATH_PYTHON_INC" "$p/include/$d"
1640 cnf_append "VBOX_LIB_PYTHON" "$p/$b/lib$d.so"
1641 else
1642 log_failure "not found"
1643 fail
1644 fi
1645 else
1646 log_failure "not found"
1647 fail
1648 fi
1649}
1650
1651
1652#
1653# Setup wine
1654#
1655setup_wine()
1656{
1657 test_header "Wine support"
1658 if ! which_wrapper wine > /dev/null; then
1659 echo " wine binary not found"
1660 fail
1661 fi
1662 if ! which_wrapper wineprefixcreate > /dev/null; then
1663 echo " wineprefixcreate not found"
1664 fail
1665 fi
1666 export WINEPREFIX="${ODIR}wine.$BUILD_MACHINE"
1667 echo "export WINEPREFIX=\"${ODIR}wine.$BUILD_MACHINE\"" >> $ENV
1668 rm -rf $WINEPREFIX
1669 mkdir -p $WINEPREFIX
1670 touch $WINEPREFIX/.no_prelaunch_window_flag
1671 if ! wineprefixcreate -q > /dev/null 2>&1; then
1672 echo " wineprefixcreate failed"
1673 fail
1674 fi
1675 tmp=.tmp.wine.reg
1676 rm -f $tmp
1677 echo 'REGEDIT4' > $tmp
1678 echo '' >> $tmp
1679 echo '[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment]' >> $tmp
1680 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
1681 echo '' >> $tmp
1682 echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhc.exe\DllOverrides]' >> $tmp
1683 echo '"itss"="native"' >> $tmp
1684 echo '' >> $tmp
1685 echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhw.exe\DllOverrides]' >> $tmp
1686 echo '"itss"="native"' >> $tmp
1687 echo '' >> $tmp
1688 if ! wine regedit $tmp > /dev/null 2>&1; then
1689 rm -f $tmp
1690 echo " failed to load registry changes (path)."
1691 fail
1692 fi
1693 rm -f $tmp
1694 log_success "found"
1695}
1696
1697#
1698#
1699#
1700check_gsoap()
1701{
1702 test_header "GSOAP compiler"
1703 if [ -z "$GSOAP" ]; then
1704 GSOAP="/usr/bin"
1705 fi
1706 if which_wrapper "$GSOAP/soapcpp2" > /dev/null; then
1707 if which_wrapper "$GSOAP/wsdl2h" > /dev/null; then
1708 cnf_append "VBOX_GSOAP_INSTALLED" "1"
1709 cnf_append "VBOX_PATH_GSOAP" "$GSOAP"
1710 log_success "found"
1711 else
1712 log_failure "wsdl2h not found -- disabling webservice"
1713 cnf_append "VBOX_WITH_WEBSERVICES" ""
1714 fi
1715 else
1716 log_failure "soapcpp2 not found -- disabling webservice"
1717 cnf_append "VBOX_WITH_WEBSERVICES" ""
1718 fi
1719}
1720
1721
1722#
1723# Determines the Darwin version.
1724# @todo This should really check the Xcode/SDK version.
1725#
1726check_darwinversion()
1727{
1728 test_header "Darwin version"
1729 darwin_ver=`uname -r`
1730 case "$darwin_ver" in
1731 9\.*)
1732 darwin_ver="10.5"
1733 #cnf_append "VBOX_TARGET_MAC_OS_X_VERSION_10_5" "1"
1734 ;;
1735 8\.*)
1736 darwin_ver="10.4"
1737 ;;
1738 *)
1739 echo " failed to determin darwin version. (uname -r: $darwin_ver)"
1740 fail
1741 darwin_ver="unknown"
1742 ;;
1743 esac
1744 log_success "found version $darwin_ver"
1745}
1746
1747
1748#
1749# Checks that i386-elf-gcc-3.4.6, i386-elf-gcc-3.4.3, i386-elf-gcc-3.4 or i386-elf-gcc
1750# is around to prevent confusion when the build fails in src/recompiler.
1751# Note. Keep the which order in sync with the $(which ) in src/recompiler/Makefile.kmk.
1752#
1753check_i386elfgcc()
1754{
1755 test_header "i386-elf-gcc"
1756 i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4.6`
1757 test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4.3`
1758 test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc-3.4`
1759 test -z "$i386_elf_gcc" && i386_elf_gcc=`which_wrapper i386-elf-gcc`
1760 if test -z "$i386_elf_gcc"; then
1761 echo " failed to find i386-elf-gcc"
1762 fail
1763 fi
1764 log_success "found $i386_elf_gcc"
1765}
1766
1767
1768#
1769# Show help
1770#
1771show_help()
1772{
1773 cat << EOF
1774Usage: ./configure [OPTIONS]...
1775
1776Configuration:
1777 -h, --help display this help and exit
1778 --nofatal don't abort on errors
1779 --disable-xpcom disable XPCOM and related stuff
1780 --disable-python disable python bindings
1781 --disable-sdl-ttf disable SDL_ttf detection
1782 --disable-alsa disable the ALSA sound backend
1783 --disable-pulse disable the PulseAudio backend
1784 --disable-dbus don't use DBus and hal for hardware detection
1785 --disable-kmods don't build Linux kernel modules (host and guest)
1786 --disable-hardening don't be strict about /dev/vboxdrv access
1787 --enable-webservice enable the webservice stuff
1788 --build-libxml2 build libxml2 from sources
1789 --build-libxslt build libxslt from sources
1790 --setup-wine setup a Wine directory and register the hhc hack
1791
1792Paths:
1793 --with-gcc=PATH location of the gcc compiler [$CC]
1794 --with-g++=PATH location of the g++ compiler [$CXX]
1795 --with-kbuild=DIR kbuild directory [$KBUILDDIR]
1796 --with-iasl=PATH location of the iasl compiler [$IASL]
1797 --with-linux=DIR Linux kernel source directory [$LINUX]
1798 --with-mkisofs=PATH location of mkisofs [$MKISOFS]
1799 --with-qt-dir=DIR directory for Qt3 headers/libraries [$QT3DIR]
1800 --with-qt4-dir=DIR directory for Qt4 headers/libraries [pkgconfig]
1801 --with-gsoap-dir=PATH directory for SOAP compiler (soapcpp2 and wsdl2h)
1802
1803Build type:
1804 -d, --build-debug build with debugging symbols and assertions
1805 --build-profile build with profiling support
1806 --build-headless build headless (without any X11 frontend)
1807EOF
1808 exit 0
1809}
1810
1811
1812#
1813# The body.
1814#
1815
1816# scan command line options
1817for option in $*; do
1818 case "$option" in
1819 --help|-help|-h)
1820 show_help
1821 ;;
1822 --nofatal)
1823 nofatal=1
1824 ;;
1825 --env-only)
1826 ENV_ONLY=1
1827 ;;
1828 --with-gcc=*)
1829 CC=`echo $option | cut -d'=' -f2`
1830 ;;
1831 --with-g++=*)
1832 CXX=`echo $option | cut -d'=' -f2`
1833 ;;
1834 --with-kbuild=*)
1835 KBUILDDIR=`echo $option | cut -d'=' -f2`
1836 if echo $KBUILDDIR|grep -q "$INVALID_CHARS"; then
1837 echo "Error: KBUILDDIR contains invalid characters!"
1838 exit 1
1839 fi
1840 ;;
1841 --with-qt-dir=*)
1842 QT3DIR=`echo $option | cut -d'=' -f2`
1843 ;;
1844 --with-qt4-dir=*)
1845 QT4DIR=`echo $option | cut -d'=' -f2`
1846 QT4DIR_PKGCONFIG=0
1847 ;;
1848 --with-gsoap-dir=*)
1849 GSOAP=`echo $option | cut -d'=' -f2`
1850 ;;
1851 --with-iasl=*)
1852 IASL=`echo $option | cut -d'=' -f2`
1853 ;;
1854 --with-linux=*)
1855 LINUX=`echo $option | cut -d'=' -f2`
1856 ;;
1857 --with-mkisofs=*)
1858 MKISOFS=`echo $option | cut -d'=' -f2`
1859 ;;
1860 --disable-xpcom)
1861 WITH_XPCOM=0
1862 ;;
1863 --disable-python)
1864 WITH_PYTHON=0
1865 ;;
1866 --disable-sdl-ttf)
1867 WITH_SDL_TTF=0
1868 ;;
1869 --disable-qt)
1870 WITH_QT3=0
1871 WITH_QT4=0
1872 ;;
1873 --disable-qt3)
1874 WITH_QT3=0
1875 ;;
1876 --disable-qt4)
1877 WITH_QT4=0
1878 ;;
1879 --disable-alsa)
1880 WITH_ALSA=0
1881 ;;
1882 --disable-pulse)
1883 WITH_PULSE=0
1884 ;;
1885 --disable-dbus)
1886 WITH_DBUS=0
1887 ;;
1888 --disable-kmods)
1889 WITH_KMODS=0
1890 ;;
1891 --disable-hardening)
1892 WITH_HARDENING=0
1893 ;;
1894 --enable-hardening)
1895 WITH_HARDENING=2
1896 ;;
1897 --enable-webservice)
1898 WITH_GSOAP=1
1899 ;;
1900 --build-debug|-d)
1901 BUILD_TYPE=debug
1902 ;;
1903 --build-profile)
1904 BUILD_TYPE=profile
1905 ;;
1906 --build-libxml2)
1907 BUILD_LIBXML2=1
1908 ;;
1909 --build-libxslt)
1910 BUILD_LIBXSLT=1
1911 ;;
1912 --build-headless)
1913 HEADLESS=1
1914 WITH_SDL=0
1915 WITH_SDL_TTF=0
1916 WITH_X11=0
1917 WITH_QT3=0
1918 WITH_QT4=0
1919 ;;
1920 --ose)
1921 OSE=2
1922 ;;
1923 --odir=*)
1924 ODIR="`echo $option | cut -d'=' -f2`/"
1925 ;;
1926 --setup-wine)
1927 SETUP_WINE=1
1928 ;;
1929 *)
1930 echo
1931 echo "Unrecognized option \"$option\""
1932 echo
1933 show_help
1934 ;;
1935 esac
1936done
1937
1938LOG="$ODIR$LOG"
1939ENV="$ODIR$ENV"
1940CNF="$ODIR$CNF"
1941
1942# initialize output files
1943cat > $LOG << EOF
1944# Log file generated by
1945#
1946# '$0 $*'
1947#
1948
1949EOF
1950cat > $CNF << EOF
1951# -*- Makefile -*-
1952#
1953# automatically generated by
1954#
1955# '$0 $*'
1956#
1957# It will be completely overwritten if configure is executed again.
1958#
1959
1960EOF
1961cat > $ENV << EOF
1962#!/bin/bash
1963#
1964# automatically generated by
1965#
1966# '$0 $*'
1967#
1968# It will be completely overwritten if configure is executed again.
1969# Make sure you source this file once before you start to build VBox.
1970#
1971
1972EOF
1973
1974# test if we are OSE
1975if [ $OSE -eq 1 -a -d "`cd \`dirname $0\`; pwd`/src/VBox/Devices/USB" ]; then
1976 echo "Found USB devices, assuming VBOX_OSE = FALSE" >> $LOG
1977 echo >> $LOG
1978 OSE=0
1979fi
1980
1981if [ "$BUILD_TYPE" = "debug" ]; then
1982 echo "Creating DEBUG build!" >> $LOG
1983elif [ "$BUILD_TYPE" = "profile" ]; then
1984 echo "Creating PROFILE build!" >> $LOG
1985fi
1986
1987# first determine our environment
1988check_environment
1989check_kbuild
1990
1991[ -n "$ENV_ONLY" ] && exit 0
1992
1993# append the tools directory to the default search path
1994echo "$PATH" | grep -q "$DEVDIR_BIN" || PATH="$PATH:$DEVDIR_BIN"
1995export PATH
1996
1997# some things are not available in for OSE
1998if [ $OSE -ge 1 ]; then
1999 cnf_append "VBOX_OSE" "1"
2000 cnf_append "VBOX_WITH_TESTSUITE" ""
2001 cnf_append "VBOX_WITH_WIN32_ADDITIONS" ""
2002
2003 if [ "$OS" = "linux" ]; then
2004 cnf_append "VBOX_WITH_LINUX_ADDITIONS" "1"
2005 else
2006 cnf_append "VBOX_WITH_LINUX_ADDITIONS" ""
2007 fi
2008 echo >> $CNF
2009fi
2010
2011# headless
2012if [ -n "$HEADLESS" ]; then
2013 cnf_append "VBOX_HEADLESS" "1"
2014fi
2015
2016if [ "$OS" = "darwin" ]; then
2017 # On Darwin we want to build against Qt4 only. WITH_QT4 is enabled by
2018 # default so disable Qt3. --disable-qt disables both Qt3 and Qt4 GUI now,
2019 # --disable-qt4 disables only the Qt4 GUI (which is not appropriate for
2020 # Darwin as we disable the Qt3 here anyway.
2021 # (Qt3 builds for Intel Macs are usually not threaded or for X11. And they
2022 # don't contain our patches, which means the result isn't really usable.)
2023 WITH_QT3=0
2024 BUILD_LIBXSLT=1
2025 BUILD_LIBXML2=1
2026fi
2027
2028if [ "$OS" = "freebsd" ]; then
2029 # Qt3 will be gone before the FreeBSD port is completed, so just drop it.
2030 WITH_QT3=0
2031fi
2032
2033# emit disable directives corresponding to any --disable-xxx options.
2034[ $WITH_XPCOM -eq 0 ] && cnf_append "VBOX_WITH_MAIN" ""
2035[ $WITH_QT3 -eq 0 ] && cnf_append "VBOX_WITH_QTGUI" ""
2036[ $WITH_QT4 -eq 0 ] && cnf_append "VBOX_WITH_QT4GUI" ""
2037[ $WITH_SDL_TTF -eq 0 ] && cnf_append "VBOX_WITH_SECURELABEL" ""
2038[ $WITH_HARDENING -eq 0 ] && cnf_append "VBOX_WITHOUT_HARDENING" "1"
2039[ $WITH_HARDENING -eq 2 ] && cnf_append "VBOX_WITH_HARDENING" "2"
2040
2041# the tools
2042check_gcc
2043[ "$OS" != "darwin" ] && check_as86
2044[ "$OS" != "darwin" ] && check_bcc
2045[ "$OS" != "darwin" ] && check_iasl
2046# don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs
2047# [ "$OS" != "darwin" ] && check_yasm
2048[ "$OS" != "darwin" ] && check_xsltproc
2049[ $OSE -eq 0 -a "$OS" != "darwin" ] && check_mkisofs
2050
2051# the libraries
2052[ "$OS" != "darwin" ] && check_pthread
2053[ $WITH_XPCOM -eq 1 ] && check_libxml2
2054[ $WITH_XPCOM -eq 1 ] && check_libxslt
2055[ $WITH_LIBIDL -eq 1 ] && check_libidl
2056# build openssl on Darwin in every case
2057[ "$OS" != "darwin" -a $OSE -eq 0 ] && check_ssl
2058[ "$OS" != "darwin" ] && check_z
2059[ "$OS" != "darwin" -a "$OS" != "freebsd" ] && check_png
2060[ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam
2061[ $WITH_SDL -eq 1 ] && check_sdl
2062[ $WITH_SDL_TTF -eq 1 -a $OSE -eq 0 ] && check_sdl_ttf
2063[ $WITH_X11 -eq 1 ] && check_x
2064# TODO check for Xmu (X11/Xmu/StdCmap.h)
2065# TODO check for mesa-common-dev (GL/glx.h)
2066# TODO check for libglu1-mesa-dev (GL/glu.h)
2067[ $WITH_X11 -eq 1 ] && check_xcursor
2068[ $WITH_QT3 -eq 1 ] && check_qt3
2069[ $WITH_QT4 -eq 1 ] && check_qt4
2070[ $WITH_PYTHON -eq 1 -a "$OS" != "darwin" ] && check_python
2071
2072# Linux-specific
2073if [ "$OS" = "linux" ]; then
2074 check_staticlibstdcxx
2075 if [ $WITH_KMODS -eq 1 ]; then
2076 check_linux
2077 else
2078 cnf_append "VBOX_LINUX_SRC" ""
2079 cnf_append "VBOX_WITH_VBOXDRV" ""
2080 cnf_append "VBOX_WITH_ADDITION_DRIVERS" ""
2081 fi
2082 if [ $WITH_ALSA -eq 1 ]; then
2083 check_alsa
2084 else
2085 cnf_append "VBOX_WITH_ALSA" ""
2086 fi
2087 if [ $WITH_PULSE -eq 1 ]; then
2088 check_pulse
2089 else
2090 cnf_append "VBOX_WITH_PULSE" ""
2091 fi
2092 if [ $WITH_DBUS -eq 0 ]; then
2093 cnf_append "VBOX_WITH_DBUS" ""
2094 fi
2095 check_libcap
2096 check_compiler_h
2097 [ "$BUILD_MACHINE" = "amd64" ] && check_32bit
2098fi
2099
2100[ -n "$SETUP_WINE" ] && setup_wine
2101
2102if [ $WITH_GSOAP -eq 1 ]; then
2103 check_gsoap
2104else
2105 cnf_append "VBOX_WITH_WEBSERVICES" ""
2106fi
2107
2108# Darwin-specific
2109if [ "$OS" = "darwin" ]; then
2110 check_darwinversion
2111 check_i386elfgcc
2112fi
2113
2114# success!
2115echo
2116echo "Successfully generated '$CNF' and '$ENV'."
2117echo "Source '$ENV' once before you start to build VBox:"
2118echo ""
2119echo " source $ENV"
2120echo " kmk"
2121echo ""
2122if [ "$OS" = "linux" ]; then
2123 echo "To compile the kernel module, do:"
2124 echo ""
2125 echo " cd ./out/$OS.$TARGET_MACHINE/$BUILD_TYPE/bin/src/vboxdrv"
2126 echo " make"
2127 echo ""
2128fi
2129if [ $WITH_HARDENING -gt 0 ]; then
2130 echo ""
2131 echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2132 echo " Hardening is enabled which means that the VBox binaries will not run from"
2133 echo " the binary directory. The binaries have to be installed suid root and some"
2134 echo " more prerequisites have to be fulfilled which is normally done by installing"
2135 echo " the final package. For development, the hardening feature can be disabled"
2136 echo " by specifying the --disable-hardening parameter. Please never disable that"
2137 echo " feature for the final distribution!"
2138 echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2139 echo ""
2140else
2141 echo ""
2142 echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2143 echo " Hardening is disabled. Please do NOT build packages for distribution with"
2144 echo " disabled hardening!"
2145 echo " +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++ WARNING +++"
2146 echo ""
2147fi
2148echo "Enjoy!"
2149cleanup
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