1 | #!/bin/bash
|
---|
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 InnoTek Systemberatung GmbH
|
---|
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 | # If you received this file as part of a commercial VirtualBox
|
---|
17 | # distribution, then only the terms of your commercial VirtualBox
|
---|
18 | # license agreement apply instead of the previous paragraph.
|
---|
19 | #
|
---|
20 |
|
---|
21 | LC_ALL=C
|
---|
22 | export LC_ALL
|
---|
23 |
|
---|
24 | #
|
---|
25 | # Default positions
|
---|
26 | #
|
---|
27 | OSE=1
|
---|
28 | XPCOM=1
|
---|
29 | CC="gcc"
|
---|
30 | CXX="g++"
|
---|
31 | BCC="bcc"
|
---|
32 | YASM="yasm"
|
---|
33 | IASL="iasl"
|
---|
34 | AS86="as86"
|
---|
35 | XSLTPROC="xsltproc"
|
---|
36 | GENISOIMAGE="genisoimage"
|
---|
37 | MKISOFS="mkisofs"
|
---|
38 | INCXALAN=""
|
---|
39 | LIBXALAN="-lxalan-c"
|
---|
40 | INCXERCES=""
|
---|
41 | LIBXERCES="-lxerces-c"
|
---|
42 | LIBUUID="-luuid"
|
---|
43 | INCSDL="/usr/include/SDL"
|
---|
44 | LIBSDL="-lSDL"
|
---|
45 | LIBSDLMAIN="-lSDLmain"
|
---|
46 | LIBCRYPTO="-lcrypto"
|
---|
47 | LIBPTHREAD="-lpthread"
|
---|
48 | LIBX11="-L/usr/X11R6/lib -lXext -lX11"
|
---|
49 | LIBXCURSOR="-lXcursor"
|
---|
50 | INCZ=""
|
---|
51 | LIBZ="-lz"
|
---|
52 | INCPNG=""
|
---|
53 | LIBPNG="-lpng"
|
---|
54 | QTDIR="/usr/qt/3 /usr/lib/qt3 /usr/share/qt3"
|
---|
55 | KBUILDDIR="`cd $(dirname $0); pwd`/kBuild"
|
---|
56 | DEVDIR="`cd $(dirname $0); pwd`/tools"
|
---|
57 | if [ -d /lib/modules/`uname -r`/build ]; then
|
---|
58 | LINUX="/lib/modules/`uname -r`/build"
|
---|
59 | else
|
---|
60 | LINUX="/usr/src/linux"
|
---|
61 | fi
|
---|
62 | KCHMVIEWER="kchmviewer"
|
---|
63 | LOG="configure.log"
|
---|
64 | CNF="AutoConfig.kmk"
|
---|
65 | ENV="env.sh"
|
---|
66 | BUILD_TYPE="release"
|
---|
67 | # the restricting tool is ar (mri mode).
|
---|
68 | INVALID_CHARS="[^A-Za-z0-9/\\$:._-]"
|
---|
69 |
|
---|
70 | if (cd $(dirname $0); pwd)|grep -q "$INVALID_CHARS"; then
|
---|
71 | echo "Error: VBox base path contains invalid characters!"
|
---|
72 | exit 1
|
---|
73 | fi
|
---|
74 |
|
---|
75 | function cleanup()
|
---|
76 | {
|
---|
77 | rm -f .tmp_src.cc .tmp_src.c .tmp_out .test_execute.log
|
---|
78 | }
|
---|
79 |
|
---|
80 | function fail()
|
---|
81 | {
|
---|
82 | if [ -z "$nofatal" -o "x$1" != "x" ]; then
|
---|
83 | cleanup
|
---|
84 | rm -f $ENV
|
---|
85 | exit 1
|
---|
86 | fi
|
---|
87 | }
|
---|
88 |
|
---|
89 | function log_success()
|
---|
90 | {
|
---|
91 | if [ -n "$1" ]; then echo -n "$1, "; fi
|
---|
92 | echo "OK."
|
---|
93 | echo -e "$1\n\n" >> $LOG
|
---|
94 | }
|
---|
95 |
|
---|
96 | function log_failure()
|
---|
97 | {
|
---|
98 | echo -e "\n ** $1!"
|
---|
99 | echo -e "** $1!\n" >> $LOG
|
---|
100 | }
|
---|
101 |
|
---|
102 | function cnf_append()
|
---|
103 | {
|
---|
104 | printf "%-26s := %s\n" "$1" "$2" >> $CNF
|
---|
105 | }
|
---|
106 |
|
---|
107 | # Wrapper for ancient /usr/bin/which on darwin that always returns 0
|
---|
108 | function which_wrapper()
|
---|
109 | {
|
---|
110 | if [ -z "$have_ancient_which" ]; then
|
---|
111 | if which /bin/___cErTaINly_a_nOn_eXisTing_fIle___ 2> /dev/null > /dev/null; then
|
---|
112 | have_ancient_which="yes"
|
---|
113 | else
|
---|
114 | have_ancient_which="no"
|
---|
115 | fi
|
---|
116 | fi
|
---|
117 | if [ "$have_ancient_which" = "yes" ]; then
|
---|
118 | local retval=`which $* 2>/dev/null`
|
---|
119 | echo "$retval"
|
---|
120 | test -n "$retval" -a -e "$retval"
|
---|
121 | else
|
---|
122 | which $* 2> /dev/null
|
---|
123 | fi
|
---|
124 | }
|
---|
125 |
|
---|
126 | function check_avail()
|
---|
127 | {
|
---|
128 | if [ -z "$1" ]; then
|
---|
129 | log_failure "$2 is empty"
|
---|
130 | fail $3
|
---|
131 | return 1
|
---|
132 | elif which_wrapper $1 > /dev/null; then
|
---|
133 | return 0
|
---|
134 | else
|
---|
135 | log_failure "$1 (variable $2) not found"
|
---|
136 | fail $3
|
---|
137 | return 1
|
---|
138 | fi
|
---|
139 | }
|
---|
140 |
|
---|
141 | # Prepare a test
|
---|
142 | function test_header()
|
---|
143 | {
|
---|
144 | echo "***** Checking $1 *****" >> $LOG
|
---|
145 | echo -n "Checking for $1: "
|
---|
146 | }
|
---|
147 |
|
---|
148 | # Compile a test
|
---|
149 | function test_compile()
|
---|
150 | {
|
---|
151 | echo "compiling the following source file:" >> $LOG
|
---|
152 | cat .tmp_src.cc >> $LOG
|
---|
153 | echo "using the following command line:" >> $LOG
|
---|
154 | echo "$CXX -O -Wall -o .tmp_out .tmp_src.cc \"$1\"" >> $LOG
|
---|
155 | $CXX -O -Wall -o .tmp_out .tmp_src.cc $1 >> $LOG 2>&1
|
---|
156 | if (($?!=0)); then
|
---|
157 | if [ -z "$4" ]; then
|
---|
158 | echo -e "\n $2 not found at $1 or $3 headers not found"
|
---|
159 | echo " Check the file $LOG for detailed error information."
|
---|
160 | fail
|
---|
161 | else
|
---|
162 | echo "not found."
|
---|
163 | echo -e "\n" >> $LOG
|
---|
164 | fi
|
---|
165 | return 1
|
---|
166 | fi
|
---|
167 | return 0
|
---|
168 | }
|
---|
169 |
|
---|
170 | # Execute a compiled test binary
|
---|
171 | function test_execute()
|
---|
172 | {
|
---|
173 | echo "executing the binary" >> $LOG
|
---|
174 | ./.tmp_out > .test_execute.log
|
---|
175 | rc=$?
|
---|
176 | cat .test_execute.log | tee -a $LOG
|
---|
177 | if (($rc!=0)); then
|
---|
178 | fail $1
|
---|
179 | return 1
|
---|
180 | fi
|
---|
181 | echo -e "\n\n" >> $LOG
|
---|
182 | return 0
|
---|
183 | }
|
---|
184 |
|
---|
185 | #
|
---|
186 | # Check for OS, MACHINE, CPU
|
---|
187 | #
|
---|
188 | function check_environment()
|
---|
189 | {
|
---|
190 | test_header environment
|
---|
191 | CPU=`uname -m`
|
---|
192 | case "$CPU" in
|
---|
193 | i[3456789]86|x86)
|
---|
194 | MACHINE='x86'
|
---|
195 | ;;
|
---|
196 | x86_64|amd64)
|
---|
197 | MACHINE='amd64'
|
---|
198 | CPU='k8'
|
---|
199 |
|
---|
200 | echo ""
|
---|
201 | echo ""
|
---|
202 | echo "Warning! Support for AMD64 host systems is work in progress."
|
---|
203 | echo " Don't expect it to work or even to build at the moment."
|
---|
204 | echo ""
|
---|
205 | echo ""
|
---|
206 | ;;
|
---|
207 | *)
|
---|
208 | log_failure "Cannot determine system"
|
---|
209 | exit 1
|
---|
210 | ;;
|
---|
211 | esac
|
---|
212 | OS=`uname -s | sed -e 's/GNU\/Linux/Linux/g' | tr 'A-Z' 'a-z'`
|
---|
213 | case "$OS" in
|
---|
214 | linux)
|
---|
215 | ;;
|
---|
216 | darwin)
|
---|
217 | ;;
|
---|
218 | *)
|
---|
219 | log_failure "Cannot determine OS"
|
---|
220 | exit 1
|
---|
221 | ;;
|
---|
222 | esac
|
---|
223 | DEVDIR_BIN="$DEVDIR/$OS.$MACHINE/bin"
|
---|
224 | KBUILDDIR_BIN="$KBUILDDIR/bin/$OS.$MACHINE"
|
---|
225 | log_success "Determined $OS.$MACHINE"
|
---|
226 |
|
---|
227 | # Automatically disable XPCOM on darwin.
|
---|
228 | if [ "$OS" = "darwin" -a $XPCOM -eq 1 ]; then
|
---|
229 | XPCOM=0
|
---|
230 | echo "Disabling checks for XPCOM related components."
|
---|
231 | fi
|
---|
232 | }
|
---|
233 |
|
---|
234 | #
|
---|
235 | # Check for gcc with version >= 3.2.
|
---|
236 | # We depend on a working gcc, if we fail terminate in every case.
|
---|
237 | #
|
---|
238 | function check_gcc()
|
---|
239 | {
|
---|
240 | test_header gcc
|
---|
241 | if check_avail "$CC" CC really; then
|
---|
242 | cc_ver=`$CC -dumpversion`
|
---|
243 | if check_avail "$CXX" CXX really; then
|
---|
244 | cxx_ver=`$CXX -dumpversion`
|
---|
245 | cc_maj=`echo $cc_ver|cut -d. -f1`
|
---|
246 | cc_min=`echo $cc_ver|cut -d. -f2`
|
---|
247 | if [ "x$cc_ver" != "x$cxx_ver" ]; then
|
---|
248 | log_failure "gcc version $cc_ver does not match g++ version $cxx_ver"
|
---|
249 | fail really
|
---|
250 | elif (($cc_maj>3)); then
|
---|
251 | log_success "found version $cc_ver, using precompiled objects for recompiler"
|
---|
252 | cnf_append "VBOX_USING_GCC4" "1"
|
---|
253 | elif (($cc_maj<3 || $cc_min<2)); then
|
---|
254 | log_failure "gcc version $cc_ver found, expected at least gcc version 3.2"
|
---|
255 | fail really
|
---|
256 | else
|
---|
257 | log_success "found version $cc_ver"
|
---|
258 | fi
|
---|
259 | if [ "$CC" != "gcc" ]; then
|
---|
260 | cnf_append "TOOL_GCC3_CC" "$CC"
|
---|
261 | cnf_append "TOOL_GCC3_AS" "$CC"
|
---|
262 | fi
|
---|
263 | if [ "$CXX" != "g++" ]; then
|
---|
264 | cnf_append "TOOL_GCC3_CXX" "$CXX"
|
---|
265 | cnf_append "TOOL_GCC3_LD" "$CXX"
|
---|
266 | fi
|
---|
267 | fi
|
---|
268 | fi
|
---|
269 | }
|
---|
270 |
|
---|
271 | #
|
---|
272 | # Check for the bcc compiler, needed for compiling the BIOS
|
---|
273 | #
|
---|
274 | function check_bcc()
|
---|
275 | {
|
---|
276 | test_header bcc
|
---|
277 | if check_avail "$BCC" BCC; then
|
---|
278 | bcc_ver=`$BCC -v 2>&1|grep version|sed 's+^bcc: version \(.*\)+\1+'`
|
---|
279 | if (($?!=0)); then
|
---|
280 | log_failure "not found"
|
---|
281 | fail
|
---|
282 | else
|
---|
283 | echo "compiling the following source file:" >> $LOG
|
---|
284 | echo '
|
---|
285 | int foo(a)
|
---|
286 | int a;
|
---|
287 | {
|
---|
288 | return 0;
|
---|
289 | }
|
---|
290 | ' > .tmp_src.c
|
---|
291 | cat .tmp_src.c >> $LOG
|
---|
292 | local bcc_path=`which_wrapper $BCC`
|
---|
293 | local bcc_dir="`dirname $bcc_path`/"
|
---|
294 | echo "using the following command line:" >> $LOG
|
---|
295 | echo "$BCC -B $bcc_dir -C-c -3 -S -o .tmp_out .tmp_src.c" >> $LOG
|
---|
296 | $BCC -B $bcc_dir -C-c -3 -S -o .tmp_out .tmp_src.c >> $LOG 2>&1
|
---|
297 | if (($?!=0)); then
|
---|
298 | log_failure "not found"
|
---|
299 | fail
|
---|
300 | else
|
---|
301 | log_success "found version $bcc_ver"
|
---|
302 | cnf_append "VBOX_BCC" "$bcc_path -B $bcc_dir"
|
---|
303 | fi
|
---|
304 | fi
|
---|
305 | fi
|
---|
306 | }
|
---|
307 |
|
---|
308 | #
|
---|
309 | # Check for the as86 assembler, needed for compiling the BIOS
|
---|
310 | #
|
---|
311 | function check_as86()
|
---|
312 | {
|
---|
313 | test_header as86
|
---|
314 | if check_avail "$AS86" AS86; then
|
---|
315 | as86_ver=`$AS86 -v 2>&1|grep version|sed 's+^as86 version: \(.*\)+\1+'`
|
---|
316 | if (($?!=0)); then
|
---|
317 | log_failure "not found"
|
---|
318 | fail
|
---|
319 | else
|
---|
320 | log_success "found version $as86_ver"
|
---|
321 | cnf_append "VBOX_AS86" "`which_wrapper $AS86`"
|
---|
322 | fi
|
---|
323 | fi
|
---|
324 | }
|
---|
325 |
|
---|
326 | #
|
---|
327 | # Check for yasm, needed to compile assembler files
|
---|
328 | #
|
---|
329 | function check_yasm()
|
---|
330 | {
|
---|
331 | test_header yasm
|
---|
332 | if check_avail "$YASM" YASM; then
|
---|
333 | yasm_ver=`$YASM --version|grep "^yasm"|sed 's+^yasm \(.*\)+\1+'`
|
---|
334 | if (($?!=0)); then
|
---|
335 | log_failure "not found"
|
---|
336 | fail
|
---|
337 | else
|
---|
338 | yasm_maj=`echo $yasm_ver|cut -d. -f1`
|
---|
339 | yasm_min=`echo $yasm_ver|cut -d. -f2`
|
---|
340 | yasm_rev=`echo $yasm_ver|cut -d. -f3`
|
---|
341 | yasm_ver_mul=$(($yasm_maj*10000+$yasm_min*100+$yasm_rev))
|
---|
342 | if (($yasm_ver_mul<501)); then
|
---|
343 | log_failure "found version $yasm_ver, expected at least 0.5.1"
|
---|
344 | fail
|
---|
345 | else
|
---|
346 | log_success "found version $yasm_ver"
|
---|
347 | fi
|
---|
348 | fi
|
---|
349 | fi
|
---|
350 | }
|
---|
351 |
|
---|
352 | #
|
---|
353 | # Check for the iasl ACPI compiler, needed to compile vbox.dsl
|
---|
354 | #
|
---|
355 | function check_iasl()
|
---|
356 | {
|
---|
357 | test_header iasl
|
---|
358 | if check_avail "$IASL" IASL; then
|
---|
359 | iasl_ver=`$IASL|grep version|sed 's+^ASL.*version \([0-9]*\).*+\1+'`
|
---|
360 | if (($?!=0)); then
|
---|
361 | log_failure "not found"
|
---|
362 | fail
|
---|
363 | else
|
---|
364 | log_success "found version $iasl_ver"
|
---|
365 | cnf_append "VBOX_IASLCMD" "`which_wrapper $IASL`"
|
---|
366 | fi
|
---|
367 | fi
|
---|
368 | }
|
---|
369 |
|
---|
370 | #
|
---|
371 | # Check for xsltproc, needed by Main
|
---|
372 | #
|
---|
373 | function check_xsltproc()
|
---|
374 | {
|
---|
375 | test_header xslt
|
---|
376 | if check_avail "$XSLTPROC" XSLTPROC; then
|
---|
377 | xsltproc_ver=`$XSLTPROC --version`
|
---|
378 | if (($?!=0)); then
|
---|
379 | log_failure "not found"
|
---|
380 | fail
|
---|
381 | else
|
---|
382 | log_success "found"
|
---|
383 | cnf_append "VBOX_XSLTPROC" "`which_wrapper $XSLTPROC`"
|
---|
384 | fi
|
---|
385 | fi
|
---|
386 | }
|
---|
387 |
|
---|
388 | #
|
---|
389 | # Check for mkisofs, needed to build the CDROM image containing the additions
|
---|
390 | #
|
---|
391 | function check_mkisofs()
|
---|
392 | {
|
---|
393 | test_header mkisofs
|
---|
394 | if which_wrapper $GENISOIMAGE > /dev/null; then
|
---|
395 | mkisofs_ver=`$GENISOIMAGE --version`
|
---|
396 | if (($?!=0)); then
|
---|
397 | log_failure "not found"
|
---|
398 | fail
|
---|
399 | else
|
---|
400 | log_success "found $mkisofs_ver"
|
---|
401 | cnf_append "VBOX_MKISOFS" "`which_wrapper $GENISOIMAGE`"
|
---|
402 | fi
|
---|
403 | elif check_avail "$MKISOFS" MKISOFS; then
|
---|
404 | mkisofs_ver=`$MKISOFS --version`
|
---|
405 | if (($?!=0)); then
|
---|
406 | log_failure "not found"
|
---|
407 | fail
|
---|
408 | else
|
---|
409 | log_success "found $mkisofs_ver"
|
---|
410 | cnf_append "VBOX_MKISOFS" "`which_wrapper $MKISOFS`"
|
---|
411 | fi
|
---|
412 | fi
|
---|
413 | }
|
---|
414 |
|
---|
415 | #
|
---|
416 | # Check for xalan, needed by VBoxXML
|
---|
417 | #
|
---|
418 | function check_xalan()
|
---|
419 | {
|
---|
420 | test_header xalan
|
---|
421 | echo '
|
---|
422 | #include <cstdio>
|
---|
423 | #include <xalanc/Include/XalanVersion.hpp>
|
---|
424 | extern "C" int main(void)
|
---|
425 | {
|
---|
426 | printf("found version %d.%d.%d",
|
---|
427 | XALAN_VERSION_MAJOR, XALAN_VERSION_MINOR, XALAN_VERSION_REVISION);
|
---|
428 | #if _XALAN_VERSION >= 10800
|
---|
429 | printf(", OK.\n");
|
---|
430 | return 0;
|
---|
431 | #else
|
---|
432 | printf(", expected version 1.8.0 or higher\n");
|
---|
433 | return 1;
|
---|
434 | #endif
|
---|
435 | }
|
---|
436 | ' > .tmp_src.cc
|
---|
437 | if test_compile "$LIBXALAN ${INCXALAN:+-I$INCXALAN}" xalan xalanc; then
|
---|
438 | if test_execute; then
|
---|
439 | cnf_append "SDK_VBOX_XALAN_LIBS" `echo $LIBXALAN|sed 's+-l++'`
|
---|
440 | cnf_append "SDK_VBOX_XALAN_INCS" "$INCXALAN"
|
---|
441 | fi
|
---|
442 | fi
|
---|
443 | }
|
---|
444 |
|
---|
445 | #
|
---|
446 | # Check for xerces, needed by VBoxXML
|
---|
447 | #
|
---|
448 | function check_xerces()
|
---|
449 | {
|
---|
450 | test_header xerces
|
---|
451 | echo '
|
---|
452 | #include <cstdio>
|
---|
453 | #include <xercesc/util/XercesVersion.hpp>
|
---|
454 | extern "C" int main(void)
|
---|
455 | {
|
---|
456 | printf("found version %d.%d.%d",
|
---|
457 | XERCES_VERSION_MAJOR, XERCES_VERSION_MINOR, XERCES_VERSION_REVISION);
|
---|
458 | #if _XERCES_VERSION >= 20500
|
---|
459 | printf(", OK.\n");
|
---|
460 | return 0;
|
---|
461 | #else
|
---|
462 | printf(", expected version 2.5.0 or higher");
|
---|
463 | return 1;
|
---|
464 | #endif
|
---|
465 | }
|
---|
466 | ' > .tmp_src.cc
|
---|
467 | if test_compile "$LIBXERCES ${INCXERCES:+-I$INCXERCES}" xerces xercesc; then
|
---|
468 | if test_execute; then
|
---|
469 | cnf_append "SDK_VBOX_XERCES_LIBS" `echo $LIBXERCES|sed 's+-l++'`
|
---|
470 | cnf_append "SDK_VBOX_XERCES_INCS" "$INCXERCES"
|
---|
471 | fi
|
---|
472 | fi
|
---|
473 | }
|
---|
474 |
|
---|
475 | #
|
---|
476 | # Check for libIDL, needed by xpcom
|
---|
477 | #
|
---|
478 | check_libidl()
|
---|
479 | {
|
---|
480 | test_header libIDL
|
---|
481 |
|
---|
482 | if which_wrapper libIDL-config-2 > /dev/null; then
|
---|
483 | libidl_ver=`libIDL-config-2 --version`
|
---|
484 | if (($?!=0)); then
|
---|
485 | log_failure "not found"
|
---|
486 | fail
|
---|
487 | else
|
---|
488 | log_success "found version $libidl_ver"
|
---|
489 | cnf_append "VBOX_LIBIDL_CONFIG" \
|
---|
490 | "PKG_CONFIG_PATH=`libIDL-config-2 --prefix`/lib/pkgconfig `which_wrapper libIDL-config-2`"
|
---|
491 | fi
|
---|
492 | elif check_avail "libIDL-config" libIDL-config; then
|
---|
493 | libidl_ver=`libIDL-config --version`
|
---|
494 | if (($?!=0)); then
|
---|
495 | log_failure "not found"
|
---|
496 | fail
|
---|
497 | else
|
---|
498 | log_success "found version $libidl_ver"
|
---|
499 | cnf_append "VBOX_LIBIDL_CONFIG" `which_wrapper libIDL-config`
|
---|
500 | fi
|
---|
501 | fi
|
---|
502 | }
|
---|
503 |
|
---|
504 | #
|
---|
505 | # Check for uuid, needed by Runtime, VBoxSVC, VBoxSDL, and VBoxBFE
|
---|
506 | #
|
---|
507 | function check_uuid()
|
---|
508 | {
|
---|
509 | test_header uuid
|
---|
510 | echo '
|
---|
511 | #include <cstdio>
|
---|
512 | #include <uuid/uuid.h>
|
---|
513 | extern "C" int main(void)
|
---|
514 | {
|
---|
515 | uuid_t uu;
|
---|
516 | uuid_clear(uu);
|
---|
517 | if (uuid_is_null(uu)) {
|
---|
518 | printf("found, OK.\n");
|
---|
519 | return 0;
|
---|
520 | } else {
|
---|
521 | printf("uuid found but does not work\n");
|
---|
522 | return 1;
|
---|
523 | }
|
---|
524 | }
|
---|
525 | ' > .tmp_src.cc
|
---|
526 | if test_compile $LIBUUID uuid uuid; then
|
---|
527 | if test_execute; then
|
---|
528 | cnf_append "LIB_UUID" `echo $LIBUUID|sed 's+-l++'`
|
---|
529 | fi
|
---|
530 | fi
|
---|
531 | }
|
---|
532 |
|
---|
533 | #
|
---|
534 | # Check for openssl, needed for RDP
|
---|
535 | #
|
---|
536 | function check_ssl()
|
---|
537 | {
|
---|
538 | test_header ssl
|
---|
539 | echo '
|
---|
540 | #include <cstdio>
|
---|
541 | #include <openssl/opensslv.h>
|
---|
542 | extern "C" int main(void)
|
---|
543 | {
|
---|
544 | printf("found version %s", OPENSSL_VERSION_TEXT);
|
---|
545 | #if OPENSSL_VERSION_NUMBER >= 0x0090700
|
---|
546 | printf(", OK.\n");
|
---|
547 | return 0;
|
---|
548 | #else
|
---|
549 | printf(", expected version 0.9.7 or higher\n");
|
---|
550 | return 1;
|
---|
551 | #endif
|
---|
552 | }
|
---|
553 | ' > .tmp_src.cc
|
---|
554 | if test_compile $LIBCRYPTO libcrypto openssl; then
|
---|
555 | if test_execute nofatal; then
|
---|
556 | cnf_append "SDK_VBOX_OPENSSL_INCS" ""
|
---|
557 | cnf_append "SDK_VBOX_OPENSSL_LIBS" `echo $LIBCRYPTO|sed 's+-l++'`
|
---|
558 | fi
|
---|
559 | fi
|
---|
560 | }
|
---|
561 |
|
---|
562 | #
|
---|
563 | # Check for pthread, needed by VBoxSVC, frontends, ...
|
---|
564 | #
|
---|
565 | function check_pthread()
|
---|
566 | {
|
---|
567 | test_header pthread
|
---|
568 | echo '
|
---|
569 | #include <cstdio>
|
---|
570 | #include <pthread.h>
|
---|
571 | extern "C" int main(void)
|
---|
572 | {
|
---|
573 | pthread_mutex_t mutex;
|
---|
574 | if (pthread_mutex_init(&mutex, NULL)) {
|
---|
575 | printf("pthread_mutex_init() failed\n");
|
---|
576 | return 1;
|
---|
577 | }
|
---|
578 | if (pthread_mutex_lock(&mutex)) {
|
---|
579 | printf("pthread_mutex_lock() failed\n");
|
---|
580 | return 1;
|
---|
581 | }
|
---|
582 | if (pthread_mutex_unlock(&mutex)) {
|
---|
583 | printf("pthread_mutex_unlock() failed\n");
|
---|
584 | return 1;
|
---|
585 | }
|
---|
586 | printf("found, OK.\n");
|
---|
587 | }
|
---|
588 | ' > .tmp_src.cc
|
---|
589 | if test_compile $LIBPTHREAD pthread pthread; then
|
---|
590 | if test_execute; then
|
---|
591 | cnf_append "LIB_PTHREAD" `echo $LIBPTHREAD|sed 's+-l++'`
|
---|
592 | fi
|
---|
593 | fi
|
---|
594 | }
|
---|
595 |
|
---|
596 | #
|
---|
597 | # Check for zlib, needed by VBoxSVC, Runtime, ...
|
---|
598 | #
|
---|
599 | function check_z()
|
---|
600 | {
|
---|
601 | test_header zlib
|
---|
602 | echo '
|
---|
603 | #include <cstdio>
|
---|
604 | #include <zlib.h>
|
---|
605 | extern "C" int main(void)
|
---|
606 | {
|
---|
607 | printf("found version %s", ZLIB_VERSION);
|
---|
608 | #if ZLIB_VERNUM >= 0x1210
|
---|
609 | printf(", OK.\n");
|
---|
610 | return 0;
|
---|
611 | #else
|
---|
612 | printf(", expected version 1.2.1 or higher\n");
|
---|
613 | return 1;
|
---|
614 | #endif
|
---|
615 | }
|
---|
616 | ' > .tmp_src.cc
|
---|
617 | if test_compile "$LIBZ ${INCZ:+-I$INCZ}" zlib zlib; then
|
---|
618 | if test_execute; then
|
---|
619 | cnf_append "SDK_VBOX_ZLIB_LIBS" `echo $LIBZ|sed 's+-l++'`
|
---|
620 | cnf_append "SDK_VBOX_ZLIB_INCS" "$INCZ"
|
---|
621 | fi
|
---|
622 | fi
|
---|
623 | }
|
---|
624 |
|
---|
625 | #
|
---|
626 | # Check for libpng, needed by kchmviewer
|
---|
627 | #
|
---|
628 | function check_png()
|
---|
629 | {
|
---|
630 | test_header libpng
|
---|
631 | echo '
|
---|
632 | #include <cstdio>
|
---|
633 | #include <png.h>
|
---|
634 | extern "C" int main(void)
|
---|
635 | {
|
---|
636 | printf("found version %s", PNG_LIBPNG_VER_STRING);
|
---|
637 | #if PNG_LIBPNG_VER >= 10205
|
---|
638 | printf(", OK.\n");
|
---|
639 | return 0;
|
---|
640 | #else
|
---|
641 | printf(", expected version 1.2.5 or higher\n");
|
---|
642 | return 1;
|
---|
643 | #endif
|
---|
644 | }
|
---|
645 | ' > .tmp_src.cc
|
---|
646 | if test_compile "$LIBPNG ${INCPNG:+-I$INCPNG}" libpng libpng nofatal; then
|
---|
647 | if test_execute nofatal; then
|
---|
648 | cnf_append "SDK_VBOX_LIBPNG_LIBS" `echo $LIBPNG|sed 's+-l++'`
|
---|
649 | cnf_append "SDK_VBOX_LIBPNG_INCS" "$INCPNG"
|
---|
650 | fi
|
---|
651 | fi
|
---|
652 | }
|
---|
653 |
|
---|
654 | #
|
---|
655 | # Check for pam, needed by VRDPAuth
|
---|
656 | # Version 79 was introduced in 9/2005, do we support older versions?
|
---|
657 | # Debian/sarge uses 76
|
---|
658 | # OpenSUSE comes with 0.99.xxx where they changed the versioning scheme.
|
---|
659 | #
|
---|
660 | function check_pam()
|
---|
661 | {
|
---|
662 | test_header pam
|
---|
663 | echo '
|
---|
664 | #include <cstdio>
|
---|
665 | #include <security/pam_appl.h>
|
---|
666 | extern "C" int main(void)
|
---|
667 | {
|
---|
668 | printf("found version %d", __LIBPAM_VERSION);
|
---|
669 | if (__LIBPAM_VERSION >= 76)
|
---|
670 | {
|
---|
671 | printf(", OK.\n");
|
---|
672 | return 0;
|
---|
673 | }
|
---|
674 | else
|
---|
675 | {
|
---|
676 | printf(", expected version 76 or higher\n");
|
---|
677 | return 1;
|
---|
678 | }
|
---|
679 | }
|
---|
680 | ' > .tmp_src.cc
|
---|
681 | if test_compile "-lpam" pam pam nofatal; then
|
---|
682 | if test_execute nofatal; then
|
---|
683 | return 0;
|
---|
684 | fi
|
---|
685 | fi
|
---|
686 | test_header linux_pam
|
---|
687 | echo '
|
---|
688 | #include <cstdio>
|
---|
689 | #include <security/pam_appl.h>
|
---|
690 | extern "C" int main(void)
|
---|
691 | {
|
---|
692 | printf("found version %d.%d", __LINUX_PAM__, __LINUX_PAM_MINOR__);
|
---|
693 | if (__LINUX_PAM__ >= 1)
|
---|
694 | {
|
---|
695 | printf(", OK.\n");
|
---|
696 | return 0;
|
---|
697 | }
|
---|
698 | else
|
---|
699 | {
|
---|
700 | printf(", expected version 1.0 or higher\n");
|
---|
701 | return 1;
|
---|
702 | }
|
---|
703 | }
|
---|
704 | ' > .tmp_src.cc
|
---|
705 | if test_compile "-lpam" pam pam; then
|
---|
706 | test_execute
|
---|
707 | fi
|
---|
708 | }
|
---|
709 |
|
---|
710 | #
|
---|
711 | # Check for the SDL library, needed by VBoxSDL and VirtualBox
|
---|
712 | # We depend at least on version 1.2.7
|
---|
713 | #
|
---|
714 | function check_sdl()
|
---|
715 | {
|
---|
716 | test_header SDL
|
---|
717 | echo '
|
---|
718 | #include <cstdio>
|
---|
719 | #include <SDL/SDL.h>
|
---|
720 | #include <SDL/SDL_main.h>
|
---|
721 | extern "C" int main(void)
|
---|
722 | {
|
---|
723 | printf("found version %d.%d.%d",
|
---|
724 | SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
|
---|
725 | #if SDL_VERSION_ATLEAST(1,2,7)
|
---|
726 | printf(", OK.\n");
|
---|
727 | return 0;
|
---|
728 | #else
|
---|
729 | printf(", expected version 1.2.7 or higher\n");
|
---|
730 | return 1;
|
---|
731 | #endif
|
---|
732 | }
|
---|
733 | ' > .tmp_src.cc
|
---|
734 | if test_compile "$LIBSDL $LIBSDLMAIN ${INCSDL:+-I$INCSDL}" SDL SDL; then
|
---|
735 | if test_execute; then
|
---|
736 | cnf_append "LIB_SDK_LIBSDL_SDL" `echo $LIBSDL|sed 's+-l++'`
|
---|
737 | cnf_append "LIB_SDK_LIBSDL_SDLMAIN" `echo $LIBSDLMAIN|sed 's+-l++'`
|
---|
738 | [ -n "$INCSDL" ] && cnf_append "SDK_LIBSDL_INCS" "$INCSDL"
|
---|
739 | fi
|
---|
740 | fi
|
---|
741 | }
|
---|
742 |
|
---|
743 | #
|
---|
744 | # Check for the SDL_ttf library, needed by VBoxSDL (secure label)
|
---|
745 | #
|
---|
746 | function check_sdl_ttf()
|
---|
747 | {
|
---|
748 | test_header SDL_ttf
|
---|
749 | echo '
|
---|
750 | #include <cstdio>
|
---|
751 | #include <SDL/SDL_ttf.h>
|
---|
752 | #ifndef SDL_TTF_MAJOR_VERSION
|
---|
753 | #define SDL_TTF_MAJOR_VERSION TTF_MAJOR_VERSION
|
---|
754 | #define SDL_TTF_MINOR_VERSION TTF_MINOR_VERSION
|
---|
755 | #define SDL_TTF_PATCHLEVEL TTF_PATCHLEVEL
|
---|
756 | #endif
|
---|
757 | extern "C" int main(void)
|
---|
758 | {
|
---|
759 | printf("found version %d.%d.%d",
|
---|
760 | SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL);
|
---|
761 | #if 10000*SDL_TTF_MAJOR_VERSION + 100*SDL_TTF_MINOR_VERSION + SDL_TTF_PATCHLEVEL >= 20006
|
---|
762 | printf(", OK.\n");
|
---|
763 | return 0;
|
---|
764 | #else
|
---|
765 | printf(", expected version 2.0.6 or higher\n");
|
---|
766 | return 1;
|
---|
767 | #endif
|
---|
768 | }
|
---|
769 | ' > .tmp_src.cc
|
---|
770 | if test_compile "-lSDL_ttf" SDL_ttf SDL_ttf; then
|
---|
771 | test_execute
|
---|
772 | fi
|
---|
773 | }
|
---|
774 |
|
---|
775 | #
|
---|
776 | # Check for libasound, needed by the ALSA audio backend
|
---|
777 | #
|
---|
778 | function check_alsa()
|
---|
779 | {
|
---|
780 | test_header ALSA
|
---|
781 | echo '
|
---|
782 | #include <alsa/asoundlib.h>
|
---|
783 | extern "C" int main(void)
|
---|
784 | {
|
---|
785 | printf("found version %d.%d.%d",
|
---|
786 | SND_LIB_MAJOR, SND_LIB_MINOR, SND_LIB_SUBMINOR);
|
---|
787 | #if 10000*SND_LIB_MAJOR + 100*SND_LIB_MINOR + SND_LIB_SUBMINOR >= 10008
|
---|
788 | printf(", OK.\n");
|
---|
789 | return 0;
|
---|
790 | #else
|
---|
791 | printf(", expected version 1.0.8 or higher\n");
|
---|
792 | return 1;
|
---|
793 | #endif
|
---|
794 | }
|
---|
795 | ' > .tmp_src.cc
|
---|
796 | if test_compile "-lasound" asound asound; then
|
---|
797 | test_execute
|
---|
798 | fi
|
---|
799 | }
|
---|
800 |
|
---|
801 | #
|
---|
802 | # Check for the Xcursor library, needed by VBoxSDL and VBoxBFE
|
---|
803 | #
|
---|
804 | function check_xcursor()
|
---|
805 | {
|
---|
806 | test_header Xcursor
|
---|
807 | echo '
|
---|
808 | #include <cstdio>
|
---|
809 | #include <X11/Xlib.h>
|
---|
810 | #include <X11/Xcursor/Xcursor.h>
|
---|
811 | extern "C" int main(void)
|
---|
812 | {
|
---|
813 | XcursorImage *cursor = XcursorImageCreate (10, 10);
|
---|
814 | XcursorImageDestroy(cursor);
|
---|
815 | return 0;
|
---|
816 | }
|
---|
817 | ' > .tmp_src.cc
|
---|
818 | if test_compile "$LIBX11 $LIBXCURSOR" Xcursor Xcursor; then
|
---|
819 | log_success "found"
|
---|
820 | cnf_append "LIB_XCURSOR" `echo $LIBXCURSOR|sed 's+-l++'`
|
---|
821 | fi
|
---|
822 | }
|
---|
823 |
|
---|
824 | #
|
---|
825 | # Check for the X libraries (Xext, X11)
|
---|
826 | #
|
---|
827 | function check_x()
|
---|
828 | {
|
---|
829 | test_header "X libraries"
|
---|
830 | echo '
|
---|
831 | #include <cstdio>
|
---|
832 | #include <X11/Xlib.h>
|
---|
833 | extern "C" int main(void)
|
---|
834 | {
|
---|
835 | Display *dpy;
|
---|
836 | int scrn_num;
|
---|
837 | Screen *scrn;
|
---|
838 | Window win;
|
---|
839 |
|
---|
840 | dpy = XOpenDisplay(NULL);
|
---|
841 | scrn_num = DefaultScreen(dpy);
|
---|
842 | scrn = ScreenOfDisplay(dpy, scrn_num);
|
---|
843 | win = XCreateWindow(dpy, RootWindowOfScreen(scrn), 0, 0, 100, 100,
|
---|
844 | 0, 16, InputOutput, CopyFromParent, 0, NULL);
|
---|
845 | XDestroyWindow(dpy, win);
|
---|
846 | }
|
---|
847 | ' > .tmp_src.cc
|
---|
848 | if test_compile "$LIBX11" Xlibs Xlibs; then
|
---|
849 | log_success "found"
|
---|
850 | fi
|
---|
851 | }
|
---|
852 |
|
---|
853 | #
|
---|
854 | # Check for the QT library, needed by VirtualBox
|
---|
855 | #
|
---|
856 | function check_qt()
|
---|
857 | {
|
---|
858 | test_header Qt
|
---|
859 | echo '
|
---|
860 | #include <cstdio>
|
---|
861 | #include <qglobal.h>
|
---|
862 | extern "C" int main(void)
|
---|
863 | {
|
---|
864 | printf("found version %s", QT_VERSION_STR);
|
---|
865 | #if QT_VERSION >= 0x030305
|
---|
866 | printf(", OK.\n");
|
---|
867 | return 0;
|
---|
868 | #elif QT_VERSION >= 0x030300
|
---|
869 | printf("\n ** WARNING: QT < 3.3.5 has known problems!\n");
|
---|
870 | #else
|
---|
871 | printf(", expected version 3.3.0 or higher\n");
|
---|
872 | return 1;
|
---|
873 | #endif
|
---|
874 | }
|
---|
875 | ' > .tmp_src.cc
|
---|
876 | found_qt=0
|
---|
877 | for q in $QTDIR; do
|
---|
878 | echo "compiling the following source file:" >> $LOG
|
---|
879 | cat .tmp_src.cc >> $LOG
|
---|
880 | echo "using the following command line:" >> $LOG
|
---|
881 | echo "$CXX -O -Wall -o .tmp_out .tmp_src.cc -I$q/include -L$q/lib -lqt-mt" >> $LOG
|
---|
882 | $CXX -O -Wall -o .tmp_out .tmp_src.cc -I$q/include -L$q/lib -lqt-mt >> $LOG 2>&1
|
---|
883 | if (($?==0)); then
|
---|
884 | if test_execute; then
|
---|
885 | cnf_append "QTDIR" `cd $q ; pwd`
|
---|
886 | found_qt=1
|
---|
887 | break
|
---|
888 | fi
|
---|
889 | fi
|
---|
890 | done
|
---|
891 | if (($found_qt!=1)); then
|
---|
892 | echo -e "\n Qt not found at \"$QTDIR\" or Qt headers not found"
|
---|
893 | echo " Check the file $LOG for detailed error information."
|
---|
894 | fail
|
---|
895 | return 1
|
---|
896 | fi
|
---|
897 | test_header "Qt devtools"
|
---|
898 | if check_avail "$q/bin/moc" QTDIR/bin; then
|
---|
899 | moc_ver=`$q/bin/moc 2>&1 -v|sed 's+^.*(Qt \(.*\))+\1+'`
|
---|
900 | if (($?!=0)); then
|
---|
901 | log_failure "not found"
|
---|
902 | fail
|
---|
903 | else
|
---|
904 | log_success "found version $moc_ver"
|
---|
905 | fi
|
---|
906 | fi
|
---|
907 | }
|
---|
908 |
|
---|
909 | #
|
---|
910 | # Check for Linux sources
|
---|
911 | #
|
---|
912 | function check_linux()
|
---|
913 | {
|
---|
914 | test_header "Linux kernel sources"
|
---|
915 | echo '
|
---|
916 | #include <linux/version.h>
|
---|
917 | int printf(const char *format, ...);
|
---|
918 | int main(void)
|
---|
919 | {
|
---|
920 | printf("found version %d.%d.%d", LINUX_VERSION_CODE / 65536,
|
---|
921 | (LINUX_VERSION_CODE % 65536) / 256,
|
---|
922 | LINUX_VERSION_CODE % 256);
|
---|
923 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,0)
|
---|
924 | printf(", OK.\n");
|
---|
925 | return 0;
|
---|
926 | #else
|
---|
927 | printf(", expected version 2.4.0 or higher\n");
|
---|
928 | return 1;
|
---|
929 | #endif
|
---|
930 | }
|
---|
931 | ' > .tmp_src.c
|
---|
932 | echo "compiling the following source file:" >> $LOG
|
---|
933 | cat .tmp_src.c >> $LOG
|
---|
934 | echo "using the following command line:" >> $LOG
|
---|
935 | echo "$CC -O -Wall -o .tmp_out .tmp_src.c -nostdinc -I$LINUX/include" >> $LOG
|
---|
936 | $CC -O -Wall -o .tmp_out .tmp_src.c -nostdinc -I$LINUX/include >> $LOG 2>&1
|
---|
937 | if (($?!=0)); then
|
---|
938 | echo -e "\n Linux kernel headers not found at $LINUX"
|
---|
939 | echo " Check the file $LOG for detailed error information."
|
---|
940 | fail
|
---|
941 | else
|
---|
942 | if test_execute; then
|
---|
943 | cnf_append "VBOX_LINUX_SRC" `cd $LINUX ; pwd`
|
---|
944 | fi
|
---|
945 | fi
|
---|
946 | }
|
---|
947 |
|
---|
948 | #
|
---|
949 | # Check for kchmviewer, needed to display the online help
|
---|
950 | #
|
---|
951 | function check_kchmviewer()
|
---|
952 | {
|
---|
953 | test_header kchmviewer
|
---|
954 | if check_avail "$KCHMVIEWER" KCHMVIEWER; then
|
---|
955 | kchmviewer_ver=`$KCHMVIEWER --version|grep "^KchmViewer:"|sed 's+^KchmViewer: \(.*\)+\1+'`
|
---|
956 | if (($?!=0)); then
|
---|
957 | log_failure "not found"
|
---|
958 | fail
|
---|
959 | else
|
---|
960 | log_success "found version $kchmviewer_ver"
|
---|
961 | fi
|
---|
962 | fi
|
---|
963 | }
|
---|
964 |
|
---|
965 | #
|
---|
966 | # Check for the kBuild tools, we don't support GNU make
|
---|
967 | #
|
---|
968 | function check_kbuild()
|
---|
969 | {
|
---|
970 | test_header kBuild
|
---|
971 | if check_avail "$KBUILDDIR_BIN/kmk" KBUILDDIR really; then
|
---|
972 | log_success "found"
|
---|
973 | echo "export BUILD_PLATFORM=\"$OS\"" >> $ENV
|
---|
974 | echo "export BUILD_PLATFORM_ARCH=\"$MACHINE\"" >> $ENV
|
---|
975 | echo "export BUILD_TARGET=\"$OS\"" >> $ENV
|
---|
976 | echo "export BUILD_TARGET_ARCH=\"$MACHINE\"" >> $ENV
|
---|
977 | echo "export BUILD_TARGET_CPU=\"$CPU\"" >> $ENV
|
---|
978 | echo "export BUILD_TYPE=\"$BUILD_TYPE\"" >> $ENV
|
---|
979 | echo "export PATH_KBUILD=\"`cd $KBUILDDIR ; pwd`\"" >> $ENV
|
---|
980 | echo "export PATH_DEVTOOLS=\"$DEVDIR\"" >> $ENV
|
---|
981 | echo "path_kbuild_bin=\"\$PATH_KBUILD/bin/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"" >> $ENV
|
---|
982 | echo "path_dev_bin=\"\$PATH_DEVTOOLS/\$BUILD_TARGET.\$BUILD_PLATFORM_ARCH\"/bin" >> $ENV
|
---|
983 | echo "echo \"\$PATH\" | grep -q \"\$path_kbuild_bin\" || PATH=\"\$path_kbuild_bin:\$PATH\"" >> $ENV
|
---|
984 | echo "echo \"\$PATH\" | grep -q \"\$path_dev_bin\" || PATH=\"\$path_dev_bin:\$PATH\"" >> $ENV
|
---|
985 | echo "export PATH" >> $ENV
|
---|
986 | echo "unset path_kbuild_bin path_dev_bin" >> $ENV
|
---|
987 | fi
|
---|
988 | }
|
---|
989 |
|
---|
990 |
|
---|
991 | #
|
---|
992 | # Check for compiler.h
|
---|
993 | # Some Linux distributions include "compiler.h" in their libc linux
|
---|
994 | # headers package, some don't. Most don't need it, building might (!)
|
---|
995 | # not succeed on openSUSE without it.
|
---|
996 | #
|
---|
997 | # See http://www.mail-archive.com/qemu-devel%40nongnu.org/msg07980.html
|
---|
998 | #
|
---|
999 | function check_compiler_h
|
---|
1000 | {
|
---|
1001 | test_header compiler.h
|
---|
1002 | if ! test -f "/usr/include/linux/compiler.h"; then
|
---|
1003 | cnf_append "VBOX_WITHOUT_LINUX_COMPILER_H" "1"
|
---|
1004 | log_success "compiler.h not found"
|
---|
1005 | else
|
---|
1006 | log_success "compiler.h found"
|
---|
1007 | fi
|
---|
1008 | }
|
---|
1009 |
|
---|
1010 |
|
---|
1011 | #
|
---|
1012 | # Show help
|
---|
1013 | #
|
---|
1014 | function show_help()
|
---|
1015 | {
|
---|
1016 | cat << EOF
|
---|
1017 | Usage: ./configure [OPTIONS]...
|
---|
1018 |
|
---|
1019 | Configuration:
|
---|
1020 | -h, --help display this help and exit
|
---|
1021 | --nofatal don't abort on errors
|
---|
1022 | --disable-xpcom disable XPCOM and related stuff
|
---|
1023 |
|
---|
1024 | Paths:
|
---|
1025 | --with-gcc=PATH position of the gcc compiler [$CC]
|
---|
1026 | --with-g++=PATH position of the g++ compiler [$CXX]
|
---|
1027 | --with-kbuild=DIR kbuild directory [$KBUILDDIR]
|
---|
1028 | --with-iasl=PATH the position of the iasl compiler [$IASL]
|
---|
1029 | --with-linux=DIR Linux kernel source directory [$LINUX]
|
---|
1030 | --with-mkisofs=PATH position of mkisofs [$MKISOFS]
|
---|
1031 | --with-qt-dir=DIR directory for QT headers/libraries [$QTDIR]
|
---|
1032 | --with-xalan=LIB position of the xalan library [$LIBXALAN]
|
---|
1033 | --with-xerces=LIB position of the xerces library [$LIBXERCES]
|
---|
1034 |
|
---|
1035 | Build type:
|
---|
1036 | -d, --build-debug build with debugging symbols and assertions
|
---|
1037 | EOF
|
---|
1038 | exit 0
|
---|
1039 | }
|
---|
1040 |
|
---|
1041 |
|
---|
1042 | #
|
---|
1043 | # The body.
|
---|
1044 | #
|
---|
1045 |
|
---|
1046 | # scan command line options
|
---|
1047 | for option; do
|
---|
1048 | case "$option" in
|
---|
1049 | --help|-help|-h)
|
---|
1050 | show_help
|
---|
1051 | ;;
|
---|
1052 | --nofatal)
|
---|
1053 | nofatal=1
|
---|
1054 | ;;
|
---|
1055 | --with-gcc=*)
|
---|
1056 | CC=`echo $option | cut -d'=' -f2`
|
---|
1057 | ;;
|
---|
1058 | --with-g++=*)
|
---|
1059 | CXX=`echo $option | cut -d'=' -f2`
|
---|
1060 | ;;
|
---|
1061 | --with-kbuild=*)
|
---|
1062 | KBUILDDIR=`echo $option | cut -d'=' -f2`
|
---|
1063 | if echo $KBUILDDIR|grep -q "$INVALID_CHARS"; then
|
---|
1064 | echo "Error: KBUILDDIR contains invalid characters!"
|
---|
1065 | exit 1
|
---|
1066 | fi
|
---|
1067 | ;;
|
---|
1068 | --with-qt-dir=*)
|
---|
1069 | QTDIR=`echo $option | cut -d'=' -f2`
|
---|
1070 | ;;
|
---|
1071 | --with-iasl=*)
|
---|
1072 | IASL=`echo $option | cut -d'=' -f2`
|
---|
1073 | ;;
|
---|
1074 | --with-linux=*)
|
---|
1075 | LINUX=`echo $option | cut -d'=' -f2`
|
---|
1076 | ;;
|
---|
1077 | --with-mkisofs=*)
|
---|
1078 | MKISOFS=`echo $option | cut -d'=' -f2`
|
---|
1079 | ;;
|
---|
1080 | --with-xalan=*)
|
---|
1081 | LIBXALAN=`echo $option | cut -d'=' -f2`
|
---|
1082 | ;;
|
---|
1083 | --with-xerces=*)
|
---|
1084 | LIBXERCES=`echo $option | cut -d'=' -f2`
|
---|
1085 | ;;
|
---|
1086 | --disable-xpcom)
|
---|
1087 | XPCOM=0
|
---|
1088 | ;;
|
---|
1089 | --disable-qt)
|
---|
1090 | WITH_QT=0
|
---|
1091 | ;;
|
---|
1092 | --build-debug|-d)
|
---|
1093 | BUILD_TYPE=debug
|
---|
1094 | ;;
|
---|
1095 | --ose)
|
---|
1096 | OSE=2
|
---|
1097 | ;;
|
---|
1098 | --odir=*)
|
---|
1099 | ODIR=`echo $option | cut -d'=' -f2`
|
---|
1100 | ;;
|
---|
1101 | *)
|
---|
1102 | echo
|
---|
1103 | echo "Unrecognized option \"$option\""
|
---|
1104 | echo
|
---|
1105 | show_help
|
---|
1106 | ;;
|
---|
1107 | esac
|
---|
1108 | done
|
---|
1109 |
|
---|
1110 | LOG="${ODIR:+$ODIR/}$LOG"
|
---|
1111 | ENV="${ODIR:+$ODIR/}$ENV"
|
---|
1112 | CNF="${ODIR:+$ODIR/}$CNF"
|
---|
1113 |
|
---|
1114 | # initialize output files
|
---|
1115 | cat > $LOG << EOF
|
---|
1116 | # Log file generated by
|
---|
1117 | #
|
---|
1118 | # '$0 $*'
|
---|
1119 | #
|
---|
1120 |
|
---|
1121 | EOF
|
---|
1122 | cat > $CNF << EOF
|
---|
1123 | # -*- Makefile -*-
|
---|
1124 | #
|
---|
1125 | # automatically generated by
|
---|
1126 | #
|
---|
1127 | # '$0 $*'
|
---|
1128 | #
|
---|
1129 | # It will be completely overwritten if configure is executed again.
|
---|
1130 | #
|
---|
1131 |
|
---|
1132 | EOF
|
---|
1133 | cat > $ENV << EOF
|
---|
1134 | #!/bin/bash
|
---|
1135 | #
|
---|
1136 | # automatically generated by
|
---|
1137 | #
|
---|
1138 | # '$0 $*'
|
---|
1139 | #
|
---|
1140 | # It will be completely overwritten if configure is executed again.
|
---|
1141 | # Make sure you source this file once before you start to build VBox.
|
---|
1142 | #
|
---|
1143 |
|
---|
1144 | EOF
|
---|
1145 |
|
---|
1146 | # test if we are OSE
|
---|
1147 | if (($OSE==1)) && [ -d "`cd $(dirname $0); pwd`/src/VBox/Devices/USB" ]; then
|
---|
1148 | echo "Found USB devices, assuming VBOX_OSE = FALSE" >> $LOG
|
---|
1149 | echo >> $LOG
|
---|
1150 | OSE=0
|
---|
1151 | fi
|
---|
1152 |
|
---|
1153 | # first determine our environment
|
---|
1154 | check_environment
|
---|
1155 | check_kbuild
|
---|
1156 |
|
---|
1157 | # some things are not available in for OSE
|
---|
1158 | if (($OSE)); then
|
---|
1159 | cnf_append "VBOX_OSE" "1"
|
---|
1160 | cnf_append "VBOX_WITH_TESTSUITE" ""
|
---|
1161 | cnf_append "VBOX_WITH_WIN32_ADDITIONS" ""
|
---|
1162 |
|
---|
1163 | if [ "$OS" = "linux" ]; then
|
---|
1164 | cnf_append "VBOX_WITH_LINUX_ADDITIONS" "1"
|
---|
1165 | else
|
---|
1166 | cnf_append "VBOX_WITH_LINUX_ADDITIONS" ""
|
---|
1167 | fi
|
---|
1168 | echo >> $CNF
|
---|
1169 | fi
|
---|
1170 |
|
---|
1171 | # append the tools directory to the default search path
|
---|
1172 | echo "$PATH" | grep -q "$DEVDIR_BIN" || PATH="$PATH:$DEVDIR_BIN"
|
---|
1173 |
|
---|
1174 | # append some extra paths
|
---|
1175 | PATH="$PATH:/opt/gnome/bin"
|
---|
1176 |
|
---|
1177 | # the tools
|
---|
1178 | check_gcc
|
---|
1179 | [ "$OS" != "darwin" ] && check_as86
|
---|
1180 | [ "$OS" != "darwin" ] && check_bcc
|
---|
1181 | [ "$OS" != "darwin" ] && check_iasl
|
---|
1182 | # don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs
|
---|
1183 | # [ "$OS" != "darwin" ] && check_yasm
|
---|
1184 | [ "$OS" != "darwin" ] && check_xsltproc
|
---|
1185 | (($OSE==0)) && check_mkisofs
|
---|
1186 |
|
---|
1187 | # the libraries
|
---|
1188 | (($XPCOM==1)) && check_xalan
|
---|
1189 | (($XPCOM==1)) && check_xerces
|
---|
1190 | (($XPCOM==1)) && check_libidl
|
---|
1191 | [ "$OS" != "darwin" ] && check_uuid
|
---|
1192 | (($OSE==0)) && check_ssl
|
---|
1193 | [ "$OS" != "darwin" ] && check_pthread
|
---|
1194 | [ "$OS" != "darwin" ] && check_z
|
---|
1195 | (($OSE==0)) && check_png
|
---|
1196 | (($OSE==0)) && check_pam
|
---|
1197 | [ "$OS" != "darwin" ] && check_sdl
|
---|
1198 | (($OSE==0)) && check_sdl_ttf
|
---|
1199 | [ "$OS" != "darwin" ] && check_alsa
|
---|
1200 | [ "$OS" != "darwin" ] && check_x
|
---|
1201 | [ "$OS" != "darwin" ] && check_xcursor
|
---|
1202 | (($XPCOM==1)) && check_qt
|
---|
1203 |
|
---|
1204 | # Linux-specific
|
---|
1205 | [ "$OS" = "linux" ] && check_linux
|
---|
1206 | [ "$OS" = "linux" ] && check_compiler_h
|
---|
1207 |
|
---|
1208 | # success!
|
---|
1209 | echo
|
---|
1210 | echo "Successfully generated '$CNF' and '$ENV'."
|
---|
1211 | echo "Source '$ENV' once before you start to build VBox:"
|
---|
1212 | echo
|
---|
1213 | echo " source $ENV"
|
---|
1214 | echo " kmk"
|
---|
1215 | echo
|
---|
1216 | echo "Enjoy!"
|
---|
1217 | cleanup
|
---|