VirtualBox

Changeset 3163 in vbox


Ignore:
Timestamp:
Jun 19, 2007 8:33:57 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
22092
Message:

fixed some issues with FreeBSD, thanks Jason Spiro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure

    r3032 r3163  
    1 #!/bin/bash
     1#!/bin/sh
    22# The purpose of this script is to check for all external tools, headers, and
    33# libraries VBox OSE depends on.
     
    4444INCXERCES=""
    4545LIBXERCES="-lxerces-c"
    46 INCSDL="/usr/include/SDL"
    47 LIBSDL="-lSDL"
    48 LIBSDLMAIN="-lSDLmain"
    4946LIBCRYPTO="-lcrypto"
    5047LIBPTHREAD="-lpthread"
     
    5855LIBPATHHAL=""
    5956LIBHAL="-lhal -ldbus-1"
    60 QTDIR="/usr/qt/3 /usr/lib/qt3 /usr/lib/qt-3.3 /usr/share/qt3 /usr/lib64/qt-3.3"
     57QTDIR="/usr/qt/3 /usr/lib/qt3 /usr/lib/qt-3.3 /usr/share/qt3 /usr/lib64/qt-3.3 /usr/X11R6"
    6158KBUILDDIR="`cd $(dirname $0); pwd`/kBuild"
    6259DEVDIR="`cd $(dirname $0); pwd`/tools"
    63 if [ -d /lib/modules/`uname -r`/build ]; then
     60if [ -d "/lib/modules/`uname -r`/build" ]; then
    6461 LINUX="/lib/modules/`uname -r`/build"
    6562else
     
    7471INVALID_CHARS="[^A-Za-z0-9/\\$:._-]"
    7572
    76 if (cd $(dirname $0); pwd)|grep -q "$INVALID_CHARS"; then
     73if (cd `dirname $0`; pwd)|grep -q "$INVALID_CHARS"; then
    7774  echo "Error: VBox base path contains invalid characters!"
    7875  exit 1
    7976fi
    8077
    81 function cleanup()
     78cleanup()
    8279{
    8380  rm -f .tmp_src.cc .tmp_src.c .tmp_out .test_execute.log
    8481}
    8582
    86 function fail()
     83fail()
    8784{
    8885  if [ -z "$nofatal" -o "x$1" != "x" ]; then
     
    9390}
    9491
    95 function log_success()
     92log_success()
    9693{
    9794  if [ -n "$1" ]; then echo -n "$1, "; fi
     
    10097}
    10198
    102 function log_failure()
     99log_failure()
    103100{
    104101  echo -e "\n  ** $1!"
     
    106103}
    107104
    108 function cnf_append()
     105cnf_append()
    109106{
    110107  printf "%-30s := %s\n" "$1" "$2" >> $CNF
    111108}
    112109
    113 function strip_l()
    114 {
    115   echo "$1"|sed 's|-l\([^ ]\+\)|\1|g'
    116 }
    117 
    118 function strip_L()
    119 {
    120   echo "$1"|sed 's|-L\([^ ]\+\)|\1|g'
     110strip_l()
     111{
     112  echo "$1"|sed 's|-l\([^ ]\+\)|\1|g; s|-[^l]\([^ ]\+\)||g; s|^ ||; s| *$||g'
     113}
     114
     115strip_L()
     116{
     117  echo "$1"|sed 's|-L\([^ ]\+\)|\1|g; s|-[^L]\([^ ]\+\)||g; s|^ ||; s| *$||g'
     118}
     119
     120strip_I()
     121{
     122  echo "$1"|sed 's|-I\([^ ]\+\)|\1|g; s|-[^I]\([^ ]\+\)||g; s|^ ||; s| *$||g'
    121123}
    122124
    123125# Wrapper for ancient /usr/bin/which on darwin that always returns 0
    124 function which_wrapper()
     126which_wrapper()
    125127{
    126128  if [ -z "$have_ancient_which" ]; then
     
    140142}
    141143
    142 function check_avail()
     144check_avail()
    143145{
    144146   if [ -z "$1" ]; then
     
    156158
    157159# Prepare a test
    158 function test_header()
     160test_header()
    159161{
    160162  echo "***** Checking $1 *****" >> $LOG
     
    163165
    164166# Compile a test
    165 function test_compile()
     167test_compile()
    166168{
    167169  echo "compiling the following source file:" >> $LOG
     
    170172  echo "$CXX -O -Wall -o .tmp_out .tmp_src.cc \"$1\"" >> $LOG
    171173  $CXX -O -Wall -o .tmp_out .tmp_src.cc $1 >> $LOG 2>&1
    172   if (($?!=0)); then
     174  if [ $? -ne 0 ]; then
    173175    if [ -z "$4" ]; then
    174176      echo -e "\n  $2 not found at $1 or $3 headers not found"
     
    185187
    186188# Execute a compiled test binary
    187 function test_execute()
     189test_execute()
    188190{
    189191  echo "executing the binary" >> $LOG
     
    191193  rc=$?
    192194  cat .test_execute.log | tee -a $LOG
    193   if (($rc!=0)); then
     195  if [ $rc -ne 0 ]; then
    194196    fail $1
    195197    return 1
     
    202204# Check for OS, MACHINE, CPU
    203205#
    204 function check_environment()
     206check_environment()
    205207{
    206208  test_header environment
     
    251253# We depend on a working gcc, if we fail terminate in every case.
    252254#
    253 function check_gcc()
     255check_gcc()
    254256{
    255257  test_header gcc
     
    263265        log_failure "gcc version $cc_ver does not match g++ version $cxx_ver"
    264266        fail really
    265       elif (($cc_maj>3)); then
     267      elif [ $cc_maj -gt 3 ]; then
    266268        log_success "found version $cc_ver"
    267       elif (($cc_maj<3 || $cc_min<2)); then
     269      elif [ $cc_maj -lt 3 -o $cc_min -lt 2 ]; then
    268270        log_failure "gcc version $cc_ver found, expected at least gcc version 3.2"
    269271        fail really
     
    290292# Check for the bcc compiler, needed for compiling the BIOS
    291293#
    292 function check_bcc()
     294check_bcc()
    293295{
    294296  test_header bcc
    295297  if check_avail "$BCC" BCC; then
    296298    bcc_ver=`$BCC -v 2>&1|grep version|sed 's+^bcc: version \(.*\)+\1+'`
    297     if (($?!=0)); then
     299    if [ $? -ne 0 ]; then
    298300      log_failure "not found"
    299301      fail
    300302    else
    301303      echo "compiling the following source file:" >> $LOG
    302       echo '
     304      cat > .tmp_src.c << EOF
    303305int foo(a)
    304306  int a;
     
    306308  return 0;
    307309}
    308 ' > .tmp_src.c
     310EOF
    309311      cat .tmp_src.c >> $LOG
    310312      local bcc_path=`which_wrapper $BCC`
     
    313315      echo "$BCC -B $bcc_dir -C-c -3 -S -o .tmp_out .tmp_src.c" >> $LOG
    314316      $BCC -B $bcc_dir -C-c -3 -S -o .tmp_out .tmp_src.c >> $LOG 2>&1
    315       if (($?!=0)); then
     317      if [ $? -ne 0 ]; then
    316318        log_failure "not found"
    317319        fail
     
    327329# Check for the as86 assembler, needed for compiling the BIOS
    328330#
    329 function check_as86()
     331check_as86()
    330332{
    331333  test_header as86
    332334  if check_avail "$AS86" AS86; then
    333335    as86_ver=`$AS86 -v 2>&1|grep version|sed 's+^as86 version: \(.*\)+\1+'`
    334     if (($?!=0)); then
     336    if [ $? -ne 0 ]; then
    335337      log_failure "not found"
    336338      fail
     
    345347# Check for yasm, needed to compile assembler files
    346348#
    347 function check_yasm()
     349check_yasm()
    348350{
    349351  test_header yasm
    350352  if check_avail "$YASM" YASM; then
    351353    yasm_ver=`$YASM --version|grep "^yasm"|sed 's+^yasm \(.*\)+\1+'`
    352     if (($?!=0)); then
     354    if [ $? -ne 0 ]; then
    353355      log_failure "not found"
    354356      fail
     
    358360      yasm_rev=`echo $yasm_ver|cut -d. -f3`
    359361      yasm_ver_mul=$(($yasm_maj*10000+$yasm_min*100+$yasm_rev))
    360       if (($yasm_ver_mul<501)); then
     362      if [ $yasm_ver_mul -lt 501 ]; then
    361363        log_failure "found version $yasm_ver, expected at least 0.5.1"
    362364        fail
     
    371373# Check for the iasl ACPI compiler, needed to compile vbox.dsl
    372374#
    373 function check_iasl()
     375check_iasl()
    374376{
    375377  test_header iasl
    376378  if check_avail "$IASL" IASL; then
    377379    iasl_ver=`$IASL|grep version|sed 's+^ASL.*version \([0-9]*\).*+\1+'`
    378     if (($?!=0)); then
     380    if [ $? -ne 0 ]; then
    379381      log_failure "not found"
    380382      fail
     
    389391# Check for xsltproc, needed by Main
    390392#
    391 function check_xsltproc()
     393check_xsltproc()
    392394{
    393395  test_header xslt
    394396  if check_avail "$XSLTPROC" XSLTPROC; then
    395397    xsltproc_ver=`$XSLTPROC --version`
    396     if (($?!=0)); then
     398    if [ $? -ne 0 ]; then
    397399      log_failure "not found"
    398400      fail
     
    407409# Check for mkisofs, needed to build the CDROM image containing the additions
    408410#
    409 function check_mkisofs()
     411check_mkisofs()
    410412{
    411413  test_header mkisofs
    412414  if which_wrapper $GENISOIMAGE > /dev/null; then
    413415    mkisofs_ver=`$GENISOIMAGE --version`
    414     if (($?!=0)); then
     416    if [ $? -ne 0 ]; then
    415417      log_failure "not found"
    416418      fail
     
    421423  elif check_avail "$MKISOFS" MKISOFS; then
    422424    mkisofs_ver=`$MKISOFS --version`
    423     if (($?!=0)); then
     425    if [ $? -ne 0 ]; then
    424426      log_failure "not found"
    425427      fail
     
    434436# Check for xalan, needed by VBoxXML
    435437#
    436 function check_xalan()
     438check_xalan()
    437439{
    438440  if [ -n "$LIBXALAN" ]; then
    439441    test_header xalan
    440     echo '
     442    cat > .tmp_src.cc << EOF
    441443#include <cstdio>
    442444#include <xalanc/Include/XalanVersion.hpp>
     
    453455#endif
    454456}
    455 ' > .tmp_src.cc
     457EOF
    456458    if test_compile "$LIBXALAN $LIBPTHREAD ${INCXALAN:+-I$INCXALAN}" xalan xalanc; then
    457459      if test_execute; then
    458         cnf_append "SDK_VBOX_XALAN_LIBS" "`strip_l $LIBXALAN`"
     460        cnf_append "SDK_VBOX_XALAN_LIBS" "`strip_l "$LIBXALAN"`"
    459461        cnf_append "SDK_VBOX_XALAN_INCS" "$INCXALAN"
    460462      fi
     
    469471# Check for xerces, needed by VBoxXML
    470472#
    471 function check_xerces()
     473check_xerces()
    472474{
    473475  if [ -n "$LIBXERCES" ]; then
    474476    test_header xerces
    475     echo '
     477    cat > .tmp_src.cc << EOF
    476478#include <cstdio>
    477479#include <xercesc/util/XercesVersion.hpp>
     
    488490#endif
    489491}
    490 ' > .tmp_src.cc
     492EOF
    491493    if test_compile "$LIBXERCES $LIBPTHREAD ${INCXERCES:+-I$INCXERCES}" xerces xercesc; then
    492494      if test_execute; then
    493         cnf_append "SDK_VBOX_XERCES_LIBS" "`strip_l $LIBXERCES`"
     495        cnf_append "SDK_VBOX_XERCES_LIBS" "`strip_l "$LIBXERCES"`"
    494496        cnf_append "SDK_VBOX_XERCES_INCS" "$INCXERCES"
    495497      fi
     
    510512  if which_wrapper libIDL-config-2 > /dev/null; then
    511513    libidl_ver=`libIDL-config-2 --version`
    512     if (($?!=0)); then
     514    if [ $? -ne 0 ]; then
    513515      log_failure "not found"
    514516      fail
     
    520522  elif check_avail "libIDL-config" libIDL-config; then
    521523    libidl_ver=`libIDL-config --version`
    522     if (($?!=0)); then
     524    if [ $? -ne 0 ]; then
    523525      log_failure "not found"
    524526      fail
     
    533535# Check for openssl, needed for RDP
    534536#
    535 function check_ssl()
     537check_ssl()
    536538{
    537539  test_header ssl
    538   echo '
     540  cat > .tmp_src.cc << EOF
    539541#include <cstdio>
    540542#include <openssl/opensslv.h>
     
    550552#endif
    551553}
    552 ' > .tmp_src.cc
     554EOF
    553555  if test_compile $LIBCRYPTO libcrypto openssl; then
    554556    if test_execute nofatal; then
    555557      cnf_append "SDK_VBOX_OPENSSL_INCS" ""
    556       cnf_append "SDK_VBOX_OPENSSL_LIBS" "`strip_l $LIBCRYPTO`"
     558      cnf_append "SDK_VBOX_OPENSSL_LIBS" "`strip_l "$LIBCRYPTO"`"
    557559    fi
    558560  fi
     
    562564# Check for pthread, needed by VBoxSVC, frontends, ...
    563565#
    564 function check_pthread()
     566check_pthread()
    565567{
    566568  test_header pthread
    567   echo '
     569  cat > .tmp_src.cc << EOF
    568570#include <cstdio>
    569571#include <pthread.h>
     
    585587  printf("found, OK.\n");
    586588}
    587 ' > .tmp_src.cc
     589EOF
    588590  if test_compile $LIBPTHREAD pthread pthread; then
    589591    if test_execute; then
    590       cnf_append "LIB_PTHREAD" "`strip_l $LIBPTHREAD`"
     592      cnf_append "LIB_PTHREAD" "`strip_l "$LIBPTHREAD"`"
    591593    fi
    592594  fi
     
    596598# Check for zlib, needed by VBoxSVC, Runtime, ...
    597599#
    598 function check_z()
     600check_z()
    599601{
    600602  test_header zlib
    601   echo '
     603  cat > .tmp_src.cc << EOF
    602604#include <cstdio>
    603605#include <zlib.h>
     
    613615#endif
    614616}
    615 ' > .tmp_src.cc
     617EOF
    616618  if test_compile "$LIBZ ${INCZ:+-I$INCZ}" zlib zlib; then
    617619    if test_execute; then
    618       cnf_append "SDK_VBOX_ZLIB_LIBS" "`strip_l $LIBZ`"
     620      cnf_append "SDK_VBOX_ZLIB_LIBS" "`strip_l "$LIBZ"`"
    619621      cnf_append "SDK_VBOX_ZLIB_INCS" "$INCZ"
    620622    fi
     
    625627# Check for libpng, needed by kchmviewer
    626628#
    627 function check_png()
     629check_png()
    628630{
    629631  test_header libpng
    630   echo '
     632  cat > .tmp_src.cc << EOF
    631633#include <cstdio>
    632634#include <png.h>
     
    642644#endif
    643645}
    644 ' > .tmp_src.cc
    645   if test_compile "$LIBPNG ${INCPNG:+-I$INCPNG}" libpng libpng nofatal; then
    646     if test_execute nofatal; then
    647       cnf_append "SDK_VBOX_LIBPNG_LIBS" "`strip_l $LIBPNG`"
     646EOF
     647#  if test_compile "$LIBPNG ${INCPNG:+-I$INCPNG}" libpng libpng nofatal; then
     648  if test_compile "$LIBPNG ${INCPNG:+-I$INCPNG}" libpng libpng; then
     649#    if test_execute nofatal; then
     650    if test_execute; then
     651      cnf_append "SDK_VBOX_LIBPNG_LIBS" "`strip_l "$LIBPNG"`"
    648652      cnf_append "SDK_VBOX_LIBPNG_INCS" "$INCPNG"
    649653    fi
     
    657661# OpenSUSE comes with 0.99.xxx where they changed the versioning scheme.
    658662#
    659 function check_pam()
     663check_pam()
    660664{
    661665  test_header pam
    662   echo '
     666  cat > .tmp_src.cc << EOF
    663667#include <cstdio>
    664668#include <security/pam_appl.h>
     
    677681  }
    678682}
    679 ' > .tmp_src.cc
     683EOF
    680684  if test_compile "-lpam" pam pam nofatal; then
    681685    if test_execute nofatal; then
     
    684688  fi
    685689  test_header linux_pam
    686   echo '
     690  cat > .tmp_src.cc << EOF
    687691#include <cstdio>
    688692#include <security/pam_appl.h>
     
    701705  }
    702706}
    703 ' > .tmp_src.cc
     707EOF
    704708  if test_compile "-lpam" pam pam; then
    705709    test_execute
     
    707711}
    708712
     713
    709714#
    710715# Check for the SDL library, needed by VBoxSDL and VirtualBox
    711716# We depend at least on version 1.2.7
    712717#
    713 function check_sdl()
     718check_sdl()
    714719{
    715720  test_header SDL
    716   echo '
     721  if which_wrapper sdl-config > /dev/null; then
     722    FLGSDL=`sdl-config --cflags`
     723    INCSDL=`strip_I "$FLGSDL"`
     724    LIBSDL=`sdl-config --libs`
     725    LIBSDLMAIN="-lSDLmain"
     726    cat > .tmp_src.cc << EOF
    717727#include <cstdio>
    718728#include <SDL/SDL.h>
     
    730740#endif
    731741}
    732 ' > .tmp_src.cc
    733   if test_compile "$LIBSDL $LIBSDLMAIN ${INCSDL:+-I$INCSDL}" SDL SDL; then
    734     if test_execute; then
    735       cnf_append "LIB_SDK_LIBSDL_SDL"     "`strip_l $LIBSDL`"
    736       cnf_append "LIB_SDK_LIBSDL_SDLMAIN" "`strip_l $LIBSDLMAIN`"
    737       [ -n "$INCSDL" ] && cnf_append "SDK_LIBSDL_INCS" "$INCSDL"
    738     fi
     742EOF
     743    if test_compile "$LIBSDL $LIBSDLMAIN ${INCSDL:+-I$INCSDL}" SDL SDL; then
     744      if test_execute; then
     745        cnf_append "LIB_SDK_LIBSDL_SDL"     "`strip_l "$LIBSDL"`"
     746        cnf_append "SDK_LIBSDL_LIBPATH"     "`strip_L "$LIBSDL"`"
     747        cnf_append "LIB_SDK_LIBSDL_SDLMAIN" "`strip_l "$LIBSDLMAIN"`"
     748        [ -n "$INCSDL" ] && cnf_append "SDK_LIBSDL_INCS" "$INCSDL"
     749      fi
     750    fi
     751  else
     752    log_failure "not found"
    739753  fi
    740754}
     
    743757# Check for the SDL_ttf library, needed by VBoxSDL (secure label)
    744758#
    745 function check_sdl_ttf()
     759check_sdl_ttf()
    746760{
    747761  test_header SDL_ttf
    748   echo '
     762  cat > .tmp_src.cc << EOF
    749763#include <cstdio>
    750764#include <SDL/SDL_ttf.h>
     
    766780#endif
    767781}
    768 ' > .tmp_src.cc
     782EOF
    769783  if test_compile "-lSDL_ttf" SDL_ttf SDL_ttf; then
    770784    test_execute
     
    775789# Check for libasound, needed by the ALSA audio backend
    776790#
    777 function check_alsa()
     791check_alsa()
    778792{
    779793  test_header ALSA
    780   echo '
     794  cat > .tmp_src.cc << EOF
    781795#include <alsa/asoundlib.h>
    782796extern "C" int main(void)
     
    792806#endif
    793807}
    794 ' > .tmp_src.cc
     808EOF
    795809  if test_compile "-lasound" asound asound; then
    796810    test_execute
     
    801815# Check for the Xcursor library, needed by VBoxSDL and VBoxBFE
    802816#
    803 function check_xcursor()
     817check_xcursor()
    804818{
    805819  test_header Xcursor
    806   echo '
     820  cat > .tmp_src.cc << EOF
    807821#include <cstdio>
    808822#include <X11/Xlib.h>
     
    814828  return 0;
    815829}
    816 ' > .tmp_src.cc
     830EOF
    817831  if test_compile "$LIBX11 $LIBXCURSOR" Xcursor Xcursor; then
    818832    log_success "found"
    819     cnf_append "LIB_XCURSOR" "`strip_l $LIBXCURSOR`"
     833    cnf_append "LIB_XCURSOR" "`strip_l "$LIBXCURSOR"`"
    820834  fi
    821835}
     
    824838# Check for the X libraries (Xext, X11)
    825839#
    826 function check_x()
     840check_x()
    827841{
    828842  test_header "X libraries"
    829   echo '
     843  cat > .tmp_src.cc << EOF
    830844#include <cstdio>
    831845#include <X11/Xlib.h>
     
    844858  XDestroyWindow(dpy, win);
    845859}
    846 ' > .tmp_src.cc
     860EOF
    847861  if test_compile "$LIBX11" Xlibs Xlibs; then
    848862    log_success "found"
     
    853867# Check for the QT library, needed by VirtualBox
    854868#
    855 function check_qt()
     869check_qt()
    856870{
    857871  test_header Qt
    858   echo '
     872  cat > .tmp_src.cc << EOF
    859873#include <cstdio>
    860874#include <qglobal.h>
     
    872886#endif
    873887}
    874 ' > .tmp_src.cc
     888EOF
    875889  found_qt=0
    876890  libs="lib"
     
    884898   
    885899      $CXX -O -Wall -o .tmp_out .tmp_src.cc -I$q/include -L$q/$l -lqt-mt >> $LOG 2>&1
    886       if (($?==0)); then
     900      if [ $? -eq 0 ]; then
    887901        if test_execute; then
    888902          cnf_append "QTDIR" "`cd $q ; pwd`"
     
    892906      fi
    893907    done
    894     if (($found_qt==1)); then
     908    if [ $found_qt -eq 1 ]; then
    895909      break
    896910    fi
    897911  done
    898   if (($found_qt!=1)); then
     912  if [ $found_qt -ne 1 ]; then
    899913    echo -e "\n  Qt not found at \"$QTDIR\" or Qt headers not found"
    900914    echo      "  Check the file $LOG for detailed error information."
     
    905919  if check_avail "$q/bin/moc" QTDIR/bin; then
    906920    moc_ver=`$q/bin/moc 2>&1 -v|sed 's+^.*(Qt \(.*\))+\1+'`
    907     if (($?!=0)); then
     921    if [ $? -ne 0 ]; then
    908922      log_failure "not found"
    909923      fail
     
    917931# Check for Linux sources
    918932#
    919 function check_linux()
     933check_linux()
    920934{
    921935  test_header "Linux kernel sources"
    922   echo '
     936  cat > .tmp_src.c << EOF
    923937#include <linux/version.h>
    924938int printf(const char *format, ...);
     
    936950#endif
    937951}
    938 ' > .tmp_src.c
     952EOF
    939953  echo "compiling the following source file:" >> $LOG
    940954  cat .tmp_src.c >> $LOG
     
    942956  echo "$CC -O -Wall -o .tmp_out .tmp_src.c -nostdinc -I$LINUX/include" >> $LOG
    943957  $CC -O -Wall -o .tmp_out .tmp_src.c -nostdinc -I$LINUX/include >> $LOG 2>&1
    944   if (($?!=0)); then
     958  if [ $? -ne 0 ]; then
    945959    echo -e "\n  Linux kernel headers not found at $LINUX"
    946960    echo      "  Check the file $LOG for detailed error information."
     
    956970# Check for kchmviewer, needed to display the online help
    957971#
    958 function check_kchmviewer()
     972check_kchmviewer()
    959973{
    960974  test_header kchmviewer
    961975  if check_avail "$KCHMVIEWER" KCHMVIEWER; then
    962976    kchmviewer_ver=`$KCHMVIEWER --version|grep "^KchmViewer:"|sed 's+^KchmViewer: \(.*\)+\1+'`
    963     if (($?!=0)); then
     977    if [ $? -ne 0 ]; then
    964978      log_failure "not found"
    965979      fail
     
    973987# Check for the kBuild tools, we don't support GNU make
    974988#
    975 function check_kbuild()
     989check_kbuild()
    976990{
    977991  test_header kBuild
     
    10051019# See http://www.mail-archive.com/qemu-devel%40nongnu.org/msg07980.html
    10061020#
    1007 function check_compiler_h
     1021check_compiler_h()
    10081022{
    10091023  test_header compiler.h
     
    10201034# Check for the libhal library for obtaining hardware information on Linux
    10211035#
    1022 function check_libhal()
     1036check_libhal()
    10231037{
    10241038  test_header libhal
     
    10321046    LIBHAL=$pc_libhal
    10331047  fi
    1034   echo '
     1048  cat > .tmp_src.cc << EOF
    10351049#include <cstdio>
    10361050#include <libhal.h>
     
    10461060  return 0;
    10471061}
    1048 ' > .tmp_src.cc
     1062EOF
    10491063  if test_compile "$CFLAGSHAL $LIBPATHHAL $LIBHAL" libhal libhal; then
    10501064    log_success "found version $pc_verhal"
    10511065    cnf_append "LIB_HAL_CFLAGS"   "$CFLAGSHAL"
    1052     cnf_append "LIB_HAL_LIBS"     "`strip_l $LIBHAL`"
    1053     cnf_append "LIB_HAL_LIBPATH"  "`strip_L $LIBPATHHAL`"
     1066    cnf_append "LIB_HAL_LIBS"     "`strip_l "$LIBHAL"`"
     1067    cnf_append "LIB_HAL_LIBPATH"  "`strip_L "$LIBPATHHAL"`"
    10541068    cnf_append "VBOX_WITH_LIBHAL" "1"
    10551069  fi
     
    10601074# Show help
    10611075#
    1062 function show_help()
     1076show_help()
    10631077{
    10641078  cat << EOF
     
    12141228
    12151229# test if we are OSE
    1216 if (($OSE==1)) && [ -d "`cd $(dirname $0); pwd`/src/VBox/Devices/USB" ]; then
     1230if [ $OSE -eq 1 -a -d "`cd $(dirname $0); pwd`/src/VBox/Devices/USB" ]; then
    12171231  echo "Found USB devices, assuming VBOX_OSE = FALSE" >> $LOG
    12181232  echo >> $LOG
     
    12251239
    12261240# some things are not available in for OSE
    1227 if (($OSE)); then
     1241if [ $OSE -ge 1 ]; then
    12281242  cnf_append "VBOX_OSE" "1"
    12291243  cnf_append "VBOX_WITH_TESTSUITE" ""
     
    12391253
    12401254# emit disable directives corresponding to any --disable-xxx options.
    1241 (($WITH_XPCOM==0))   && cnf_append "VBOX_WITH_MAIN" ""
    1242 (($WITH_QT==0))      && cnf_append "VBOX_WITH_QTGUI" ""
    1243 (($WITH_SDL_TTF==0)) && cnf_append "VBOX_WITH_SECURELABEL" ""
     1255[ $WITH_XPCOM -eq 0 ]   && cnf_append "VBOX_WITH_MAIN" ""
     1256[ $WITH_QT -eq 0 ]      && cnf_append "VBOX_WITH_QTGUI" ""
     1257[ $WITH_SDL_TTF -eq 0 ] && cnf_append "VBOX_WITH_SECURELABEL" ""
    12441258
    12451259# append the tools directory to the default search path
     
    12511265# the tools
    12521266check_gcc
    1253 [ "$OS" != "darwin" ] && check_as86
    1254 [ "$OS" != "darwin" ] && check_bcc
    1255 [ "$OS" != "darwin" ] && check_iasl
     1267[ "$OS" != "darwin"  ] && check_as86
     1268[ "$OS" != "darwin"  ] && check_bcc
     1269[ "$OS" != "darwin"  ] && check_iasl
    12561270# don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs
    12571271# [ "$OS" != "darwin" ] && check_yasm
    1258 [ "$OS" != "darwin" ] && check_xsltproc
    1259 (($OSE==0)) && check_mkisofs
     1272[ "$OS" != "darwin"  ] && check_xsltproc
     1273[ $OSE -eq 0 ]        && check_mkisofs
    12601274
    12611275# the libraries
    1262 [ "$OS" != "darwin" ] && check_pthread
    1263 (($WITH_XPCOM==1))    && check_xalan
    1264 (($WITH_XPCOM==1))    && check_xerces
    1265 (($WITH_LIBIDL==1))   && check_libidl
    1266 (($OSE==0))           && check_ssl
    1267 [ "$OS" != "darwin" ] && check_z
    1268 (($OSE==0)) && check_png
    1269 (($OSE==0)) && [ "$OS" = "linux" ] && check_pam
    1270 [ "$OS" != "darwin" ] && check_sdl
    1271 (($WITH_SDL_TTF==1)) && (($OSE==0)) && check_sdl_ttf
    1272 [ "$OS" != "darwin" ] && check_alsa
    1273 [ "$OS" != "darwin" ] && check_x
    1274 [ "$OS" != "darwin" ] && check_xcursor
    1275 (($WITH_QT==1))       && check_qt
     1276[ "$OS" != "darwin"  ] && check_pthread
     1277[ $WITH_XPCOM  -eq 1 ] && check_xalan
     1278[ $WITH_XPCOM  -eq 1 ] && check_xerces
     1279[ $WITH_LIBIDL -eq 1 ] && check_libidl
     1280[ $OSE -eq 0 ]         && check_ssl
     1281[ "$OS" != "darwin"  ] && check_z
     1282[ $OSE -eq 0 ]         && check_png
     1283[ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam
     1284[ "$OS" != "darwin"  ] && check_sdl
     1285[ $WITH_SDL_TTF -eq 1 -a $OSE -eq 0 ] && check_sdl_ttf
     1286[ "$OS" != "darwin"  ] && check_x
     1287[ "$OS" != "darwin"  ] && check_xcursor
     1288[ $WITH_QT -eq 1     ] && check_qt
    12761289
    12771290# Linux-specific
    1278 [ "$OS" = "linux" ] && check_linux
    1279 [ "$OS" = "linux" ] && check_compiler_h
    1280 [ "$OS" = "linux" -a "$WITH_HAL" = "1" ] && check_libhal
     1291if [ "$OS" = "linux" ]; then
     1292  check_linux
     1293  check_alsa
     1294  check_compiler_h
     1295  [ "$WITH_HAL" = "1" ] && check_libhal
     1296fi
    12811297
    12821298# success!
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette