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