Changeset 14048 for trunk


Ignore:
Timestamp:
06/03/12 20:17:12 (12 years ago)
Author:
tbretz
Message:
Added check for google's v8 JavaScript engine
Location:
trunk/FACT++
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/configure

    r14035 r14048  
    624624HAS_GUI_FALSE
    625625HAS_GUI_TRUE
     626HAS_V8_FALSE
     627HAS_V8_TRUE
    626628HAS_DBUS_FALSE
    627629HAS_DBUS_TRUE
     
    958960with_boost_regex
    959961with_boost_thread
     962with_v8
     963with_v8_include
     964with_v8_libdir
    960965with_qt4
    961966with_qt4_dir
     
    17271732                          to specify a certain library for the linker e.g.
    17281733                          --with-boost-thread=boost_thread-gcc-mt
     1734  --with-v8=DIR root directory of v8 installation
     1735  --with-v8-include=DIR        specify exact include dir for v8 headers (e.g. v8.h)
     1736  --with-v8-libdir=DIR        specify exact library dir for v8 library (e.g. libv8)
     1737  --without-v8        disables v8 usage completely
    17291738  --without-qt4           Disable qt4, i.e. disable gui support.
    17301739  --with-qt4-dir          where the root of Qt 4 is installed
     
    2029420303#AX_CHECK_GLUT
    2029520304
    20296 # Check for the fits header and zstream support from MARS
    20297 #AC_CHECK_FILE(gui/RawEventsViewer/izstream.h,
    20298 #               HAVE_IZSTREAM_H=yes, HAVE_IZSTREAM_H=no)
    20299 #AC_CHECK_FILE(gui/RawEventsViewer/fits.h,
    20300 #               HAVE_FITS_H=yes, HAVE_FITS_H=no)
    20301 
    2030220305# Needed to compile FACT++
    2030320306
     
    2267522678#   ]
    2267622679#)
     22680
     22681######################################################################
     22682# v8 / JavaScript
     22683######################################################################
     22684
     22685
     22686
     22687
     22688# Check whether --with-v8 was given.
     22689if test "${with_v8+set}" = set; then :
     22690  withval=$with_v8; with_v8=$withval
     22691if test "${with_v8}" != yes; then
     22692        v8_include="$withval/include"
     22693        v8_libdir="$withval/lib"
     22694fi
     22695
     22696fi
     22697
     22698
     22699
     22700# Check whether --with-v8-include was given.
     22701if test "${with_v8_include+set}" = set; then :
     22702  withval=$with_v8_include; v8_include="$withval"
     22703fi
     22704
     22705
     22706
     22707# Check whether --with-v8-libdir was given.
     22708if test "${with_v8_libdir+set}" = set; then :
     22709  withval=$with_v8_libdir; v8_libdir="$withval"
     22710fi
     22711
     22712
     22713if test "${with_v8}" != no ; then
     22714        OLD_LIBS=$LIBS
     22715        OLD_LDFLAGS=$LDFLAGS
     22716        OLD_CFLAGS=$CFLAGS
     22717        OLD_CPPFLAGS=$CPPFLAGS
     22718
     22719        if test "${v8_libdir}" ; then
     22720                LDFLAGS="$LDFLAGS -L${v8_libdir}"
     22721        fi
     22722        if test "${v8_include}" ; then
     22723                CPPFLAGS="$CPPFLAGS -I${v8_include}"
     22724                CFLAGS="$CFLAGS -I${v8_include}"
     22725        fi
     22726
     22727        ac_fn_cxx_check_header_mongrel "$LINENO" "v8.h" "ac_cv_header_v8_h" "$ac_includes_default"
     22728if test "x$ac_cv_header_v8_h" = xyes; then :
     22729
     22730else
     22731  no_good=yes
     22732fi
     22733
     22734
     22735
     22736        ac_ext=cpp
     22737ac_cpp='$CXXCPP $CPPFLAGS'
     22738ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     22739ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     22740ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
     22741
     22742
     22743
     22744
     22745
     22746
     22747
     22748   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for v8::HandleScope handle_scope in -lv8" >&5
     22749$as_echo_n "checking for v8::HandleScope handle_scope in -lv8... " >&6; }
     22750if ${ac_cv_lib_v8_v8__HandleScope_handle_scope+:} false; then :
     22751  $as_echo_n "(cached) " >&6
     22752else
     22753
     22754        ac_check_lib_save_LIBS=$LIBS
     22755        LIBS="-lv8  $LIBS"
     22756        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     22757/* end confdefs.h.  */
     22758#include <v8.h>
     22759int
     22760main ()
     22761{
     22762v8::HandleScope handle_scope
     22763  ;
     22764  return 0;
     22765}
     22766_ACEOF
     22767if ac_fn_cxx_try_link "$LINENO"; then :
     22768  ac_cv_lib_v8_v8__HandleScope_handle_scope=yes
     22769else
     22770  ac_cv_lib_v8_v8__HandleScope_handle_scope=no
     22771fi
     22772rm -f core conftest.err conftest.$ac_objext \
     22773    conftest$ac_exeext conftest.$ac_ext
     22774        LIBS=$ac_check_lib_save_LIBS
     22775fi
     22776{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_v8_v8__HandleScope_handle_scope" >&5
     22777$as_echo "$ac_cv_lib_v8_v8__HandleScope_handle_scope" >&6; }
     22778        if test $ac_cv_lib_v8_v8__HandleScope_handle_scope = yes; then :
     22779
     22780
     22781                        cat >>confdefs.h <<_ACEOF
     22782#define HAVE_LIBV8 1
     22783_ACEOF
     22784
     22785                        LIBS="-lv8 $LIBS"
     22786
     22787
     22788else
     22789  no_good=yes
     22790fi
     22791
     22792
     22793
     22794        ac_ext=cpp
     22795ac_cpp='$CXXCPP $CPPFLAGS'
     22796ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     22797ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     22798ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
     22799
     22800
     22801        if test "$no_good" = yes; then
     22802                HAVE_V8=no
     22803
     22804                LIBS=$OLD_LIBS
     22805                LDFLAGS=$OLD_LDFLAGS
     22806                CPPFLAGS=$OLD_CPPFLAGS
     22807                CFLAGS=$OLD_CFLAGS
     22808        else
     22809                HAVE_V8=yes
     22810
     22811                $as_echo "#define HAVE_PKG_v8 1" >>confdefs.h
     22812
     22813        fi
     22814
     22815fi
     22816
     22817
    2267722818
    2267822819######################################################################
     
    2385924000
    2386024001                cat > conftest.$ac_ext <<EOF
    23861 #line 23861 "configure"
     24002#line 24002 "configure"
    2386224003#include "confdefs.h"
    2386324004#include <qglobal.h>
     
    2497025111fi
    2497125112
    24972 #AM_CONDITIONAL(HAS_IZSTREAM_H,[test "$HAVE_IZSTREAM_H" = yes])
    24973 #AM_CONDITIONAL(HAS_FITS_H,    [test "$HAVE_FITS_H" = yes])
    2497425113 if test "$HAVE_GL" = yes; then
    2497525114  HAS_GL_TRUE=
     
    2502825167fi
    2502925168
     25169 if test "$HAVE_V8" = yes; then
     25170  HAS_V8_TRUE=
     25171  HAS_V8_FALSE='#'
     25172else
     25173  HAS_V8_TRUE='#'
     25174  HAS_V8_FALSE=
     25175fi
     25176
    2503025177
    2503125178 if test "$QT4_VERSION" -a "$HAVE_GL" = yes -a "$HAVE_GLU" = yes -a "$HAVE_QGL" = yes -a "$HAVE_ROOT_QT" = yes ; then
     
    2508725234
    2508825235fi
    25089 
    25090 #AM_COND_IF(HAS_FITS_H, [
    25091 #   AM_COND_IF(HAS_IZSTREAM_H, [
    25092 #   ])
    25093 #],)
    25094 
     25236if test "$HAVE_V8" = yes; then
     25237  $as_echo "#define HAVE_V8 1" >>confdefs.h
     25238
     25239fi
    2509525240
    2509625241##########################################################################
     
    2544525590if test -z "${HAS_DBUS_TRUE}" && test -z "${HAS_DBUS_FALSE}"; then
    2544625591  as_fn_error $? "conditional \"HAS_DBUS\" was never defined.
     25592Usually this means the macro was only invoked conditionally." "$LINENO" 5
     25593fi
     25594if test -z "${HAS_V8_TRUE}" && test -z "${HAS_V8_FALSE}"; then
     25595  as_fn_error $? "conditional \"HAS_V8\" was never defined.
    2544725596Usually this means the macro was only invoked conditionally." "$LINENO" 5
    2544825597fi
     
    2793728086{ $as_echo "$as_me:${as_lineno-$LINENO}:  nova                   / libnova.so         found: $HAVE_NOVA" >&5
    2793828087$as_echo "$as_me:  nova                   / libnova.so         found: $HAVE_NOVA" >&6;}
    27939 #AC_MSG_NOTICE([ gui/RawEventsViewer/izstream.h              found: $HAVE_IZSTREAM_H])
    27940 #AC_MSG_NOTICE([ gui/RawEventsViewer/fits.h                  found: $HAVE_FITS_H])
     28088{ $as_echo "$as_me:${as_lineno-$LINENO}:  v8                     / 'v8.h' / libv8.so  found: $HAVE_V8" >&5
     28089$as_echo "$as_me:  v8                     / 'v8.h' / libv8.so  found: $HAVE_V8" >&6;}
    2794128090{ $as_echo "$as_me:${as_lineno-$LINENO}:  GL                     / GL/gl.h            found: $HAVE_GL" >&5
    2794228091$as_echo "$as_me:  GL                     / GL/gl.h            found: $HAVE_GL" >&6;}
     
    2820628355$as_echo "$as_me: WARNING:  libnova missing - smartfact will be compiles without astronomy support!" >&2;}
    2820728356fi
     28357if test "$HAVE_V8" = yes; then
     28358  :
     28359else
     28360  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  libv8 missing - JavaScript support will be disabled!" >&5
     28361$as_echo "$as_me: WARNING:  libv8 missing - JavaScript support will be disabled!" >&2;}
     28362fi
    2820828363if test "$HAVE_DBUS" = yes; then
    2820928364  :
  • trunk/FACT++/configure.ac

    r14035 r14048  
    283283#   ]
    284284#)
     285
     286######################################################################
     287# v8 / JavaScript
     288######################################################################
     289
     290AC_CHECK_CLASS(v8, [v8::HandleScope handle_scope], v8, v8.h,
     291        HAVE_V8=yes, HAVE_V8=no)
    285292
    286293######################################################################
     
    384391AM_CONDITIONAL(HAS_SOPRANO,   [test "$HAVE_SOPRANO" = yes])
    385392AM_CONDITIONAL(HAS_DBUS,      [test "$HAVE_DBUS" = yes])
     393AM_CONDITIONAL(HAS_V8,        [test "$HAVE_V8" = yes])
    386394
    387395AM_CONDITIONAL(HAS_GUI,       [test "$QT4_VERSION" -a "$HAVE_GL" = yes -a "$HAVE_GLU" = yes -a "$HAVE_QGL" = yes -a "$HAVE_ROOT_QT" = yes ])
     
    397405AM_COND_IF(HAS_DBUS, [AC_DEFINE(HAVE_DBUS)], )
    398406AM_COND_IF(HAS_SQL,  [AC_DEFINE(HAVE_SQL)],  )
     407AM_COND_IF(HAS_V8,   [AC_DEFINE(HAVE_V8)],   )
    399408
    400409##########################################################################
     
    457466AC_MSG_NOTICE([ zlib                   / 'zlib.h'           found: $HAVE_ZLIB])
    458467AC_MSG_NOTICE([ nova                   / libnova.so         found: $HAVE_NOVA])
     468AC_MSG_NOTICE([ v8                     / 'v8.h' / libv8.so  found: $HAVE_V8])
    459469AC_MSG_NOTICE([ GL                     / GL/gl.h            found: $HAVE_GL])
    460470AC_MSG_NOTICE([ GLU                    / GL/glu.h           found: $HAVE_GLU])
     
    575585AM_COND_IF(HAS_SQL,,     AC_MSG_WARN([ database support globally disabled!]))
    576586AM_COND_IF(HAS_NOVA,,    AC_MSG_WARN([ libnova missing - smartfact will be compiles without astronomy support!]))
     587AM_COND_IF(HAS_V8,,      AC_MSG_WARN([ libv8 missing - JavaScript support will be disabled!]))
    577588AM_COND_IF(HAS_DBUS,,    AC_MSG_WARN([ DBus libraries missing - skypeclient will not be compiled!]))
    578589AM_COND_IF(HAS_SOPRANO,, AC_MSG_WARN([ Soprano libraries missing - tngweather will not be compiled!]))
Note: See TracChangeset for help on using the changeset viewer.