[Simulator] Specified the run-time path and provided 64-bit support
authorG S Senthil Kumar <senthil.gs@samsung.com>
Wed, 6 Apr 2016 07:12:35 +0000 (12:42 +0530)
committerUze Choi <uzchoi@samsung.com>
Mon, 11 Apr 2016 06:40:28 +0000 (06:40 +0000)
for eclipse plugins.

1. Added support to use eclipse plugins on 64-bit linux machines.
   Created seperate folder under /libs in plugins for
   32-bit and 64-bit libraries.
   Updated the MANIFEST file to load the libraries
   corresponding to the underlying architecture.
2. Specified the run-time path to help the loader to find the
   dependent libraries of oc in resource/src/SConscript
   for simulator to avoid the need to set the LD_LIBRARY_PATH
   to run the plugins.
3. Moved the code to load the simulator libraries
   from plugins to Java SDK.

Change-Id: Ia9b9e8542c4e82c18768dcc25c9ae727614ff7bf
Signed-off-by: G S Senthil Kumar <senthil.gs@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/7631
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
(cherry picked from commit 315181862e61115c82470920fdf4ff9d0e07f447)
Reviewed-on: https://gerrit.iotivity.org/gerrit/7673

resource/src/SConscript
service/simulator/java/eclipse-plugin/ClientControllerPlugin/META-INF/MANIFEST.MF
service/simulator/java/eclipse-plugin/ClientControllerPlugin/src/oic/simulator/clientcontroller/Activator.java
service/simulator/java/eclipse-plugin/ServiceProviderPlugin/META-INF/MANIFEST.MF
service/simulator/java/eclipse-plugin/ServiceProviderPlugin/src/oic/simulator/serviceprovider/Activator.java
service/simulator/java/sdk/src/org/oic/simulator/SimulatorManager.java

index aa7a975..aaa14f5 100644 (file)
@@ -63,6 +63,9 @@ if target_os == 'android':
 if target_os == 'tizen':
        oclib_env.AppendUnique(CPPDEFINES = ['__TIZEN__'])
 
+if target_os in ['linux'] and env.get('SIMULATOR', False):
+    oclib_env.Append( RPATH = env.Literal('\\$$ORIGIN'))
+
 ######################################################################
 # Source files and Targets
 ######################################################################
index 6822dfb..58a5e8a 100644 (file)
@@ -8,6 +8,19 @@ Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Bundle-ActivationPolicy: lazy
-Bundle-NativeCode: libs/libSimulatorManager.so
+Bundle-NativeCode: libs/linux-x86/liboc_logger.so;
+ libs/linux-x86/liboctbstack.so;
+ libs/linux-x86/libSimulatorManager.so;
+ libs/linux-x86/liboc.so; 
+ libs/linux-x86/libRamlParser.so;
+ osname=linux;
+ processor=x86,
+ libs/linux-x86_64/liboc_logger.so;
+ libs/linux-x86_64/liboctbstack.so;
+ libs/linux-x86_64/libSimulatorManager.so;
+ libs/linux-x86_64/liboc.so; 
+ libs/linux-x86_64/libRamlParser.so;
+ osname=linux;
+ processor=x86-64
 Bundle-ClassPath: libs/Simulator.jar,
  .
index c23f76b..61667c8 100644 (file)
@@ -40,10 +40,6 @@ public class Activator extends AbstractUIPlugin {
 
     private static ImageManager    imageManager;
 
-    static {
-        System.loadLibrary("SimulatorManager");
-    }
-
     public Activator() {
     }
 
index 08798e4..b45b6d9 100644 (file)
@@ -8,6 +8,19 @@ Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Bundle-ActivationPolicy: lazy
-Bundle-NativeCode: libs/libSimulatorManager.so
+Bundle-NativeCode: libs/linux-x86/liboc_logger.so;
+ libs/linux-x86/liboctbstack.so;
+ libs/linux-x86/libSimulatorManager.so;
+ libs/linux-x86/liboc.so; 
+ libs/linux-x86/libRamlParser.so;
+ osname=linux;
+ processor=x86,
+ libs/linux-x86_64/liboc_logger.so;
+ libs/linux-x86_64/liboctbstack.so;
+ libs/linux-x86_64/libSimulatorManager.so;
+ libs/linux-x86_64/liboc.so; 
+ libs/linux-x86_64/libRamlParser.so;
+ osname=linux;
+ processor=x86-64
 Bundle-ClassPath: libs/Simulator.jar,
  .
index 1293a9b..e49f523 100644 (file)
@@ -40,10 +40,6 @@ public class Activator extends AbstractUIPlugin {
 
     private static ImageManager    imageManager;
 
-    static {
-        System.loadLibrary("SimulatorManager");
-    }
-
     public Activator() {
     }
 
index 7293654..a1d93d7 100644 (file)
@@ -27,6 +27,14 @@ import org.oic.simulator.server.SimulatorResource;
  */
 public class SimulatorManager {
 
+    static {
+        System.loadLibrary("oc_logger");
+        System.loadLibrary("octbstack");
+        System.loadLibrary("oc");
+        System.loadLibrary("RamlParser");
+        System.loadLibrary("SimulatorManager");
+    }
+
     /**
      * API for creating a resource from a RAML configuration file.
      *