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