Changeset 46


Ignore:
Timestamp:
Dec 2, 2010, 10:03:56 AM (9 years ago)
Author:
david
Message:

bug fix on java support compilation

File:
1 edited

Legend:

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

    r29 r46  
    269269
    270270AC_ARG_WITH([java],
    271         [AS_HELP_STRING([--with-java=PATH], [specify an alternative directory for java installation or --with-java=no to disabled java support])],
    272         [JDKHOME="$withval"], [JDKHOME=""])
    273 
    274 
    275 if test "$JDKHOME" != "no";
    276 then
    277         JAVA_ENABLED="-DUSE_JAVA"
     271        [AS_HELP_STRING([--with-java=PATH], [To enabled java support, specify a JDK_HOME,  disabled by default])],
     272        [JDKHOME="$withval"; JAVA_ENABLED="-DUSE_JAVA"], [JAVA_ENABLED=""])
     273
     274if test -z "$JAVA_ENABLED"
     275then
     276        JAVA_FILE=""
     277else
    278278        JAVA_FILE="service_internal_java.o"
    279279        if test "x$JDKHOME" = "x";
    280280        then
    281                 # JAVA was not specified, so search within the current path
    282                 #AC_PATH_PROG([JAVACONFIG], [java])
    283 
    284                 # If we couldn't find java-config, display a warning
    285                 if test "x$JDKHOME" = "x";
    286                 then
    287                         AC_MSG_ERROR([could not find java installation path within the current path. You may need to try re-running configure with a --with-java parameter.])
    288                 fi
    289         else
    290                 # JAVA was specified; display a message to the user
    291                 if test "x$JDKHOME" = "xyes";
    292                 then
    293                         AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java])
    294                 else
    295                         if test -f $JDKHOME/include/jni.h;
    296                         then
    297                                 AC_MSG_RESULT([Using specific java install dir : $JDKHOME])
    298                         else
    299                                 AC_MSG_ERROR([the specific java install dir $DKHOME does not exist])
    300                         fi     
    301                 fi
     281                AC_MSG_ERROR([could not find java installation path within the current path. You may need to try re-running configure with a --with-java parameter.])
     282        fi      # JAVA was specified; display a message to the user
     283        if test "x$JDKHOME" = "xyes";
     284        then
     285                AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java])
    302286        fi
    303287        # Extract the linker and include flags
     
    326310        AC_SUBST([JAVA_CPPFLAGS])
    327311        AC_SUBST([JAVA_LDFLAGS])
    328 else
    329         JAVA_ENABLED=""
    330         JAVA_FILE=""
    331312fi
    332313
     
    343324
    344325AC_ARG_WITH([js],
    345         [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 ])],
    346         [JSHOME="$withval"], [JSHOME=""])
    347 
    348 JS_ENABLED=""
    349 JS_FILE=""
    350 
    351 
    352 if test "$JSHOME" = "yes"
    353 then
    354         JS_ENABLED="-DUSE_JS"
    355         JS_FILE="service_internal_js.o"
    356 
    357         #on teste si on est sous debian like
    358         if test -f "/usr/bin/dpkg"
    359         then
    360                 if test -n "`dpkg -l | grep libmozjs-dev`"
     326        [AS_HELP_STRING([--with-js=PATH], [specify --with-js=path-to-js to enabled js support, specify --with-js on linux debian like, js support is disabled by default ])],
     327        [JSHOME="$withval";JS_ENABLED="-DUSE_JS"], [JS_ENABLED=""])
     328
     329if test -z "$JS_ENABLED"
     330then
     331        JS_FILE=""
     332else
     333        if test "$JSHOME" = "yes"
     334        then
     335                JS_FILE="service_internal_js.o"
     336
     337                #on teste si on est sous debian like
     338                if test -f "/usr/bin/dpkg"
    361339                then
    362                         JS_CPPFLAGS="-I/usr/include/mozjs/"
    363                         JS_LDFLAGS="-L/usr/lib -lmozjs -lm"
    364                         JS_LIB="mozjs"
     340                        if test -n "`dpkg -l | grep libmozjs-dev`"
     341                        then
     342                                JS_CPPFLAGS="-I/usr/include/mozjs/"
     343                                JS_LDFLAGS="-L/usr/lib -lmozjs -lm"
     344                                JS_LIB="mozjs"
     345                        else
     346                                AC_MSG_ERROR([You must install libmozjs-dev or specify your custom install of libjs])
     347                        fi
    365348                else
    366                         AC_MSG_ERROR([You must install libmozjs-dev or specify your custom install of libjs])
     349                        AC_MSG_ERROR([You must specify your custom install of libjs])
    367350                fi
    368351        else
    369                 JS_LIB="js"
    370         fi
    371        
    372         CPPFLAGS_SAVE="$CPPFLAGS"
    373         CPPFLAGS="$JS_CPPFLAGS"
    374         #AC_CHECK_HEADERS([jsapi.h],
    375         #                [], [AC_MSG_ERROR([could not find headers include related to libjs])])
    376 
    377         # Ensure we can link against libjs
    378         LIBS_SAVE="$LIBS"
    379         LIBS="$JS_LDFLAGS"
    380 
    381         AC_CHECK_LIB([$JS_LIB], [JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], [])
    382 
    383         AC_SUBST([JS_CPPFLAGS])
    384         AC_SUBST([JS_LDFLAGS])
    385 
    386 
    387 else if test  "$JSHOME" != ""
    388         then
    389                 JS_ENABLED="-DUSE_JS"
    390                 JS_FILE="service_internal_js.o"
    391352                JS_CPPFLAGS="-I$JSHOME/include/js"
    392353                JS_LDFLAGS="-L$JSHOME/lib -ljs -lm"
    393354                JS_LIB="js"
    394355
    395                 CPPFLAGS_SAVE="$CPPFLAGS"
    396                 CPPFLAGS="$JS_CPPFLAGS"
    397                 #AC_CHECK_HEADERS([jsapi.h],
    398                 #                [], [AC_MSG_ERROR([could not find headers include related to libjs])])
    399 
    400                 # Ensure we can link against libjs
    401                 LIBS_SAVE="$LIBS"
    402                 LIBS="$JS_LDFLAGS"
    403 
    404                 AC_CHECK_LIB([$JS_LIB], [JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], [])
    405 
    406                 AC_SUBST([JS_CPPFLAGS])
    407                 AC_SUBST([JS_LDFLAGS])
    408         fi
    409 fi
     356        fi
     357
     358        CPPFLAGS_SAVE="$CPPFLAGS"
     359        CPPFLAGS="$JS_CPPFLAGS"
     360
     361
     362        #AC_CHECK_HEADERS([jsapi.h],
     363        #                [], [AC_MSG_ERROR([could not find headers include related to libjs])])
     364
     365       
     366        LIBS_SAVE="$LIBS"
     367        LIBS="$JS_LDFLAGS"
     368
     369        AC_CHECK_LIB([$JS_LIB], [JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], [])
     370                       
     371        AC_SUBST([JS_CPPFLAGS])
     372        AC_SUBST([JS_LDFLAGS])
     373fi
     374
    410375AC_SUBST([JS_ENABLED])
    411376AC_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