VirtualBox

source: vbox/trunk/configure@ 12822

Last change on this file since 12822 was 12190, checked in by vboxsync, 16 years ago

configure: Set PATH_TOOL_QT4_BIN (since kBuild r176x). Set PATH_SDK_QT3* and PATH_TOOL_QT3_BIN.

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