~ubuntu-branches/ubuntu/precise/virtualbox/precise-updates

« back to all changes in this revision

Viewing changes to .pc/33-link-static-libgsoap.patch/configure

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-07-04 13:02:31 UTC
  • mfrom: (3.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110704130231-l843es6wqhx614n7
Tags: 4.0.10-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Add the Modaliases control field manually for maximum backportability.

Show diffs side-by-side

added added

removed removed

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