Changeset 3


Ignore:
Timestamp:
Apr 20, 2010, 12:19:28 PM (10 years ago)
Author:
david
Message:

-modification du check de la lib js qui pour les systemes debian like

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-kernel/configure.ac

    r1 r3  
    169169# Shouldn't we get python here rather than python2.6 :) ??
    170170PY_LIB=`$PYTHONCONFIG --libs | sed -e 's/^.*\(python2\..\)$/\1/'`
    171 echo $PY_LIB
    172171AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
    173172
     
    321320
    322321AC_ARG_WITH([js],
    323         [AS_HELP_STRING([--with-js=PATH], [specify an alternative directory for spidermonkey installation or --with-js=no to disabled js support])],
     322        [AS_HELP_STRING([--with-js=PATH], [specify --with-js to enabled js support or --with-js=path-to-js js support is disabled by default ])],
    324323        [JSHOME="$withval"], [JSHOME=""])
    325 if test "$JSHOME" != "no";
     324
     325JS_ENABLED=""
     326JS_FILE=""
     327
     328
     329if test "$JSHOME" = "yes"
    326330then
    327         JS_ENABLED="-DUSE_JS"
     331        JS_ENABLED="-DUSE_JS"
    328332        JS_FILE="service_internal_js.o"
    329333
    330         #if test "x$JSHOME" = "x"; then
    331         #       # JS was not specified, so search within the current path
    332 #               # AC_PATH_PROG([JSCONFIG], [js-config])
    333 #       
    334 #               # If we couldn't find js-config, display a warning
    335 #               if test "x$JSHOME" = "x"; then
    336 #                       AC_MSG_ERROR([could not find js-config from libpython within the current path. You may need to try re-running configure with a --with-js parameter.])
    337 #               fi
    338 #       else
    339 #               # JS was specified; display a message to the user
    340 #               if test "x$JSHOME" = "xyes"; then
    341 #                       AC_MSG_ERROR([you must specify a parameter to --with-js, e.g. --with-js=/path/to/js])
    342 #               else
    343 #                       if test -f $JSHOME; then
    344 #                       AC_MSG_RESULT([Using user-specified js-config file: $JSCONFIG])
    345 #                       else
    346 #                               AC_MSG_ERROR([the user-specified js-config file $JSCONFIG does not exist])
    347 #                       fi     
    348 #               fi
    349 #       fi
    350 
    351 
    352         # Extract the linker and include flags
    353         JS_CPPFLAGS="-I$JSHOME/include"
    354         JS_LDFLAGS="-L$JSHOME/lib -ljs -lm"
    355         # Check headers file
     334        #on teste si on est sous debian like
     335        if test -f "/usr/bin/dpkg"
     336        then
     337                if test -n "`dpkg -l | grep libmozjs-dev`"
     338                then
     339                        JS_CPPFLAGS="-I/usr/include/mozjs/"
     340                        JS_LDFLAGS="-L/usr/lib -lmozjs -lm"
     341                        JS_LIB="mozjs"
     342                else
     343                        AC_MSG_ERROR([You must install libmozjs-dev or specify your custom install of libjs])
     344                fi
     345        else
     346                JS_LIB="js"
     347        fi
     348       
     349
    356350        CPPFLAGS_SAVE="$CPPFLAGS"
    357         CPPFLAGS="$JS_CPPFLAGS"
    358         #AC_CHECK_HEADERS([jsapi.h],
    359         #                [], [AC_MSG_ERROR([could not find headers include related to libjs])])
    360 
    361         # Ensure we can link against libjs
    362         LIBS_SAVE="$LIBS"
    363         LIBS="$JS_LDFLAGS"
    364        
    365         AC_CHECK_LIB([js], [JS_CallFunctionName], [], [AC_MSG_ERROR([could not find libjs])], [])
    366 
    367         AC_SUBST([JS_CPPFLAGS])
    368         AC_SUBST([JS_LDFLAGS])
    369 
    370 else
    371         JS_ENABLED=""
    372         JS_FILE=""
    373 fi
    374 
     351        CPPFLAGS="$JS_CPPFLAGS"
     352        #AC_CHECK_HEADERS([jsapi.h],
     353        #                [], [AC_MSG_ERROR([could not find headers include related to libjs])])
     354
     355        # Ensure we can link against libjs
     356        LIBS_SAVE="$LIBS"
     357        LIBS="$JS_LDFLAGS"
     358
     359        AC_CHECK_LIB([$JS_LIB], [JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], [])
     360
     361        AC_SUBST([JS_CPPFLAGS])
     362        AC_SUBST([JS_LDFLAGS])
     363
     364
     365else if test  "$JSHOME" != ""
     366        then
     367                JS_ENABLED="-DUSE_JS"
     368                JS_FILE="service_internal_js.o"
     369                JS_CPPFLAGS="-I$JSHOME/include"
     370                JS_LDFLAGS="-L$JSHOME/lib -ljs -lm"
     371                JS_LIB="js"
     372
     373                CPPFLAGS_SAVE="$CPPFLAGS"
     374                CPPFLAGS="$JS_CPPFLAGS"
     375                #AC_CHECK_HEADERS([jsapi.h],
     376                #                [], [AC_MSG_ERROR([could not find headers include related to libjs])])
     377
     378                # Ensure we can link against libjs
     379                LIBS_SAVE="$LIBS"
     380                LIBS="$JS_LDFLAGS"
     381
     382                AC_CHECK_LIB([$JS_LIB], [JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], [])
     383
     384                AC_SUBST([JS_CPPFLAGS])
     385                AC_SUBST([JS_LDFLAGS])
     386        fi
     387fi
    375388AC_SUBST([JS_ENABLED])
    376389AC_SUBST([JS_FILE])
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png