Changeset 767 for trunk/zoo-project


Ignore:
Timestamp:
Jun 9, 2016, 2:21:26 PM (3 years ago)
Author:
djay
Message:

Fix issue with headers located in extern C. Define java.library.path at runtime to search for libZOO.so from the Java zoo-api.

Location:
trunk/zoo-project/zoo-kernel
Files:
7 edited

Legend:

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

    r753 r767  
    587587        then
    588588                JAVA_LDFLAGS="-framework JavaVM"
    589                 JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/"
     589                for i in `ls /Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/`; do
     590                    JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/$i/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/"
     591                done
    590592        else
    591593                if test -d "$JDKHOME/jre/lib/i386";
     
    594596                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
    595597                else
    596                         JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/server/ -ljvm -lpthread"
    597                         JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
     598                        if test -d "$JDKHOME/jre/lib/amd64"; then
     599                           JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/server/ -ljvm -lpthread"
     600                           JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
     601                        else
     602                           JAVA_LDFLAGS="-L$JDKHOME/jre/lib/server/ -ljvm -lpthread"
     603                           JAVA_CPPFLAGS="-I$JDKHOME/include/ -I$JDKHOME/include/darwin"
     604                        fi
    598605                fi
    599606        fi
    600607
     608        AC_LANG([C++])
     609        echo $JAVA_CPPFLAGS
    601610        # Check headers file (second time we check that in fact)
    602611        CPPFLAGS_SAVE="$CPPFLAGS"
     
    604613        AC_CHECK_HEADERS([jni.h],
    605614                         [], [AC_MSG_ERROR([could not find jni.h file])])
    606 
     615        CPPFLAGS="$CPPFLAGS_SAVE"
    607616        # Ensure we can link against libjava
    608617        LIBS_SAVE="$LIBS"
  • trunk/zoo-project/zoo-kernel/request_parser.h

    r640 r767  
    3131#include "ulinet.h"
    3232
     33#include <libxml/parser.h>
     34#include <libxml/xpath.h>
     35
    3336#ifdef __cplusplus
    3437extern "C" {
    3538#endif
    36 #include <libxml/parser.h>
    37 #include <libxml/xpath.h>
    3839
    3940  xmlXPathObjectPtr extractFromDoc (xmlDocPtr, const char *);
  • trunk/zoo-project/zoo-kernel/response_print.h

    r676 r767  
    9292#include <openssl/buffer.h>
    9393
     94#include <libxml/parser.h>
     95#include <libxml/xpath.h>
     96
    9497#ifdef __cplusplus
    9598extern "C" {
    9699#endif
    97 #include <libxml/parser.h>
    98 #include <libxml/xpath.h>
    99 
    100100  /**
    101101   * Maximum number of XML namespaces
  • trunk/zoo-project/zoo-kernel/server_internal.h

    r680 r767  
    3838extern   int conf_read(const char*,maps*);
    3939
     40#include <libxml/parser.h>
     41#include <libxml/xpath.h>
     42
    4043#ifdef __cplusplus
    4144extern "C" {
    4245#endif
    43 #include <libxml/parser.h>
    44 #include <libxml/xpath.h>
    4546
    4647  char *get_uuid(); 
  • trunk/zoo-project/zoo-kernel/service.h

    r757 r767  
    112112#ifndef WIN32
    113113#include <ctype.h>
    114 #ifndef bool
    115 #define bool int
    116 #endif
    117 #ifndef true
    118   /**
    119    * Local true definition
    120    */
    121 #define true 1
    122   /**
    123    * Local false definition
    124    */
    125 #define false 0
    126 #endif
     114#include <stdbool.h>
    127115#endif
    128116
  • trunk/zoo-project/zoo-kernel/service_internal_java.c

    r765 r767  
    4040  maps* inputs=*real_inputs;
    4141  maps* outputs=*real_outputs;
    42   char ntmp[1024];
    43   getcwd(ntmp,1024);
     42  map* cwdMap=getMapFromMaps(*main_conf,"lenv","cwd");
     43  char *ntmp=NULL;
     44  if(cwdMap!=NULL)
     45    ntmp=zStrdup(cwdMap->value);
    4446  map* tmp=getMap(request,"metapath");
    4547  char *classpath;
     
    8082  }
    8183  sprintf(oclasspath,"-Djava.class.path=%s",classpath);
    82 
    8384#ifdef DEBUG
    8485  fprintf(stderr,"CLASSPATH=%s\n",classpath);
    8586  fprintf(stderr,"(%s)\n",oclasspath);
    8687#endif
     88#ifndef USE_JDB
     89  int njdb=0;
     90#else
     91  int njdb=2;
     92#endif
    8793#ifndef WIN32
    88   int nb=1;
     94  int nb=3+njdb;
    8995#endif
    9096  int nbc0=0;
     
    125131  options[0].optionString = oclasspath;
    126132  options[0].extraInfo=NULL;
     133  options[1].optionString = "-server";
     134  options[1].extraInfo=NULL;
     135  char tmp1[100];
     136  sprintf(tmp1,"-Djava.library.path=%s",cwdMap->value);
     137  fprintf(stderr,"%s\n",tmp1);
     138  options[2].optionString = tmp1;
     139  options[2].extraInfo=NULL;
     140#ifdef USE_JDB
     141  options[3].optionString = "-Xdebug";
     142  options[3].extraInfo=NULL;
     143  options[4].optionString = "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7896";
     144  options[4].extraInfo=NULL;
     145#endif
    127146#ifdef WIN32
    128147  start=2;
    129148  options[1].optionString = "-Xmx512m";
    130149#else
    131   start=1;
     150  start=3+njdb;
    132151#endif
    133152  for(i=0;i<nbc0;i++){
     
    164183  tmp=getMap(s->content,"serviceProvider");
    165184#ifdef JAVA7
    166   cls = env->FindClass(tmp->value);
    167   cls_gr = env->NewGlobalRef(cls);
     185  cls = (*env).FindClass(tmp->value);
    168186#else
    169187  cls = (*env)->FindClass(env,tmp->value);
    170   cls_gr = (*env)->NewGlobalRef(env, cls);
    171188#endif
    172189  if( cls == NULL ) {
     
    183200    fprintf(stderr,"%s loaded\n",tmp->value);
    184201  }
     202#endif
     203#ifdef JAVA7
     204  cls_gr = (*env)NewGlobalRef(cls);
     205#else
     206  cls_gr = (*env)->NewGlobalRef(env, cls);
    185207#endif
    186208
     
    246268      displayStack(env,*main_conf);
    247269#ifdef JAVA7
     270      (*env).ExceptionDescribe();
    248271      (*jvm).DestroyJavaVM();
    249272#else
     
    324347  if(strncasecmp(m->value,"minus",5)==0)
    325348    sprintf(res,"-XX:-%s",m->name);
    326   else if(strncasecmp(m->value,"plus",5)==0)
     349  else if(strncasecmp(m->value,"plus",4)==0)
    327350    sprintf(res,"-XX:+%s",m->name);
    328351  else
     
    393416              jbyteArray tmpData=(*env).NewByteArray(atoi(sizeV->value));
    394417              (*env).SetByteArrayRegion(tmpData,0,atoi(sizeV->value),(const jbyte *)tmp1->value);
    395               (*env).CallObjectMethod(scObject1, put_mid, (*env).NewStringUTF(tmp1->name), tmpData);
     418              (*env).CallObjectMethod(env,scObject1, put_mid, (*env).NewStringUTF(env,tmp1->name), tmpData);
    396419#else
    397420              jbyteArray tmpData=(*env)->NewByteArray(env,atoi(sizeV->value));
    398               (*env)->SetByteArrayRegion(env,tmpData,0,atoi(sizeV->value),tmp1->value);
     421              (*env)->SetByteArrayRegion(env,tmpData,0,atoi(sizeV->value),(jbyte*) tmp1->value);
    399422              (*env)->CallObjectMethod(env,scObject1, put_mid, (*env)->NewStringUTF(env,tmp1->name), tmpData);
    400423#endif
  • trunk/zoo-project/zoo-kernel/zoo_service_loader.c

    r765 r767  
    3434#include "cgic.h"
    3535
    36 extern "C"
    37 {
    3836#include <libxml/tree.h>
    3937#include <libxml/xmlmemory.h>
     
    4139#include <libxml/xpath.h>
    4240#include <libxml/xpathInternals.h>
    43 }
    4441
    4542#include "ulinet.h"
     
    17221719#ifndef WIN32
    17231720          setenv (mapcs->name, mapcs->value, 1);
    1724 #else
    17251721#ifdef DEBUG
    17261722          fprintf (stderr, "[ZOO: setenv (%s=%s)]\n", mapcs->name,
    17271723                   mapcs->value);
    17281724#endif
     1725#else
    17291726          if (mapcs->value[strlen (mapcs->value) - 2] == '\r')
    17301727            {
     
    17461743            }
    17471744#else
    1748 
    1749 
    17501745          SetEnvironmentVariable (mapcs->name, mapcs->value);
    17511746#endif
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