VirtualBox

source: vbox/trunk/configure@ 11805

Last change on this file since 11805 was 11735, checked in by vboxsync, 16 years ago

configure: detect python

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