VirtualBox

Changeset 11735 in vbox for trunk/configure


Ignore:
Timestamp:
Aug 28, 2008 6:17:38 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
35481
Message:

configure: detect python

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure

    r11454 r11735  
    3333TARGET_CPU=""
    3434WITH_XPCOM=1
     35WITH_PYTHON=1
    3536WITH_LIBIDL=1
    3637WITH_QT3=1
     
    6768INCPNG=""
    6869LIBPNG="-lpng"
    69 QT3DIR="/usr/qt/3 /usr/lib/qt3 /usr/lib/qt-3.3 /usr/share/qt3 /usr/lib64/qt-3.3 /usr/X11R6 /usr/lib/qt"
     70PYTHONDIR="/usr /usr/local"
     71QT3DIR="/usr/qt/3 /usr/lib/qt3 /usr/lib/qt-3.3 /usr/share/qt3"
     72QT3DIR="$QT3DIR /usr/lib64/qt-3.3 /usr/X11R6 /usr/lib/qt"
    7073QT4DIR="/usr/lib/qt4 /usr/share/qt4 /usr/lib64/qt4 /usr"
    7174QT4DIR_PKGCONFIG=1
     
    181184}
    182185
     186
    183187check_avail()
    184188{
     
    196200}
    197201
     202
    198203# Prepare a test
    199204test_header()
     
    202207  $ECHO_N "Checking for $1: "
    203208}
     209
    204210
    205211# Compile a test
     
    227233}
    228234
     235
    229236# Execute a compiled test binary
    230237test_execute()
     
    243250}
    244251
     252
    245253# Execute a compiled test binary
    246254test_execute_path()
     
    258266  return 0
    259267}
     268
    260269
    261270#
     
    455464}
    456465
     466
    457467#
    458468# Check for the bcc compiler, needed for compiling the BIOS
     
    494504}
    495505
     506
    496507#
    497508# Check for the as86 assembler, needed for compiling the BIOS
     
    511522  fi
    512523}
     524
    513525
    514526#
     
    538550}
    539551
     552
    540553#
    541554# Check for the iasl ACPI compiler, needed to compile vbox.dsl
     
    556569}
    557570
     571
    558572#
    559573# Check for xsltproc, needed by Main
     
    574588}
    575589
     590
    576591#
    577592# Check for mkisofs, needed to build the CDROM image containing the additions
     
    600615  fi
    601616}
     617
    602618
    603619#
     
    681697}
    682698
     699
    683700#
    684701# Check for libxslt, needed by VBoxSettings. For now we depend on 1.1.17.
     
    762779}
    763780
     781
    764782#
    765783# Check for libIDL, needed by xpcom
     
    791809}
    792810
     811
    793812#
    794813# Check for openssl, needed for RDP
     
    819838  fi
    820839}
     840
    821841
    822842#
     
    854874}
    855875
     876
    856877#
    857878# Check for zlib, needed by VBoxSVC, Runtime, ...
     
    884905}
    885906
     907
    886908#
    887909# Check for libpng, needed by kchmviewer
     
    915937  fi
    916938}
     939
    917940
    918941#
     
    10401063}
    10411064
     1065
    10421066#
    10431067# Check for the SDL_ttf library, needed by VBoxSDL (secure label)
     
    10761100}
    10771101
     1102
    10781103#
    10791104# Check for libasound, needed by the ALSA audio backend
     
    11031128}
    11041129
     1130
    11051131#
    11061132# Check for PulseAudio
     
    11291155}
    11301156
     1157
    11311158#
    11321159# Check for the Xcursor library, needed by VBoxSDL and VBoxBFE
     
    11531180}
    11541181
     1182
    11551183#
    11561184# Check for the X libraries (Xext, X11)
     
    11821210  fi
    11831211}
     1212
    11841213
    11851214#
     
    12471276}
    12481277
     1278
    12491279#
    12501280# Check for the Qt4 library, needed by VirtualBox4
     
    12541284check_qt4()
    12551285{
     1286  foundqt4=
    12561287  test_header Qt4
    12571288  if [ "$OS" = "darwin" ]; then
     
    14111442}
    14121443
     1444
    14131445#
    14141446# Check for Linux sources
     
    14511483}
    14521484
     1485
    14531486#
    14541487# Check for kchmviewer, needed to display the online help
     1488# (unused as we ship kchmviewer)
    14551489#
    14561490check_kchmviewer()
     
    14671501  fi
    14681502}
     1503
    14691504
    14701505#
     
    15511586}
    15521587
     1588
     1589#
     1590# Check for Python
     1591#
     1592check_python()
     1593{
     1594  test_header "python support"
     1595  cat > .tmp_src.cc << EOF
     1596#include <cstdio>
     1597#include <Python.h>
     1598extern "C" int main(void)
     1599{
     1600  Py_Initialize();
     1601  printf("found version %s", PY_VERSION);
     1602#if PY_VERSION_HEX >= 0x02030000
     1603  printf(", OK.\n");
     1604  return 0;
     1605#else
     1606  printf(", expected version 2.3 or higher\n");
     1607  return 1;
     1608#endif
     1609}
     1610EOF
     1611  found=
     1612  for p in $PYTHONDIR; do
     1613    for d in python2.5 python2.4 python2.3; do
     1614      for b in lib64 lib; do
     1615        echo "compiling the following source file:" >> $LOG
     1616        cat .tmp_src.cc >> $LOG
     1617        echo "using the following command line:" >> $LOG
     1618        echo "$CXX -O -Wall -o .tmp_out .tmp_src.cc -I$p/include/$d $p/$b/lib$d.so" >> $LOG
     1619        $CXX -O -Wall -o .tmp_out .tmp_src.cc -I$p/include/$d $p/$b/lib$d.so >> $LOG 2>&1
     1620        if [ $? -eq 0 ]; then
     1621          found=1
     1622          break
     1623        fi
     1624      done
     1625      if [ -n "$found" ]; then break; fi
     1626    done
     1627    if [ -n "$found" ]; then break; fi
     1628  done
     1629  if [ -n "$found" ]; then
     1630    if test_execute; then
     1631      cnf_append "VBOX_WITH_PYTHON"     "1"
     1632      cnf_append "VBOX_PATH_PYTHON_INC" "$p/include/$d"
     1633      cnf_append "VBOX_LIB_PYTHON"      "$p/$b/lib$d.so"
     1634    else
     1635      log_failure "not found"
     1636      fail
     1637    fi
     1638  else
     1639    log_failure "not found"
     1640    fail
     1641  fi
     1642}
     1643
     1644
    15531645#
    15541646# Setup wine
     
    16551747  --nofatal                don't abort on errors
    16561748  --disable-xpcom          disable XPCOM and related stuff
     1749  --disable-python         disable python bindings
    16571750  --disable-sdl-ttf        disable SDL_ttf detection
    16581751  --disable-alsa           disable the ALSA sound backend
     
    17331826    --disable-xpcom)
    17341827      WITH_XPCOM=0
     1828      ;;
     1829    --disable-python)
     1830      WITH_PYTHON=0
    17351831      ;;
    17361832    --disable-sdl-ttf)
     
    19142010[ $WITH_SDL -eq 1 ]    && check_sdl
    19152011[ $WITH_SDL_TTF -eq 1 -a $OSE -eq 0 ] && check_sdl_ttf
    1916 [ $WITH_X11 -eq 1    ] && check_x
    1917 [ $WITH_X11 -eq 1    ] && check_xcursor
    1918 [ $WITH_QT3 -eq 1    ] && check_qt3
    1919 [ $WITH_QT4 -eq 1    ] && check_qt4
     2012[ $WITH_X11    -eq 1 ] && check_x
     2013[ $WITH_X11    -eq 1 ] && check_xcursor
     2014[ $WITH_QT3    -eq 1 ] && check_qt3
     2015[ $WITH_QT4    -eq 1 ] && check_qt4
     2016[ $WITH_PYTHON -eq 1 ] && check_python
    19202017
    19212018# Linux-specific
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