more linking hacks
This commit is contained in:
parent
8c8f352325
commit
d8f6bf2a26
|
@ -20,7 +20,7 @@ $(C_GENERATED)/smoke.o: $(TEST_JNI_BRIDGE_HEADER) smoke.cpp
|
|||
$(CC) $(ALL_FLAGS) -o $@ -c smoke.cpp
|
||||
|
||||
$(CAST_TEST_BIN)$(LIBPREFIX)xlator_test.$(DLLEXT): $(C_GENERATED)/smoke.o
|
||||
$(CC) $(CC_LDFLAGS) -Wl,-rpath -Wl,$(DOMO_AST_BIN) $(DOMO_AST_BIN)/$(LIBPREFIX)cast.$(DLLEXT) $^ -o $@
|
||||
$(CC) $(CC_LDFLAGS) -Wl,-rpath -Wl,$(DOMO_AST_BIN) $(DOMO_AST_BIN)$(LIBPREFIX)cast.$(DLLEXT) $^ -o $@
|
||||
|
||||
main: $(CAST_TEST_BIN)/smoke_main
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "launch.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char buf[ strlen(argv[1]) + 1 ];
|
||||
|
|
|
@ -59,5 +59,5 @@ endif
|
|||
|
||||
CC_LD_PATHS = -L$(JAVA_SDK)jre/lib/amd64/server -Wl,-rpath -Wl,$(JAVA_SDK)jre/lib/amd64/server -L$(JAVA_SDK)jre/lib/x86_64/server -Wl,-rpath -Wl,$(JAVA_SDK)jre/lib/x86_64/server -L$(JAVA_SDK)jre/lib/x64/server -Wl,-rpath -Wl,$(JAVA_SDK)jre/lib/x64/server -L$(JAVA_SDK)jre/lib/server -Wl,-rpath -Wl,$(JAVA_SDK)jre/lib/server -L$(JAVA_SDK)jre/lib -Wl,-rpath -Wl,$(JAVA_SDK)jre/lib -ljvm
|
||||
|
||||
CC_LDFLAGS += CC_LD_PATHS
|
||||
CC_LDFLAGS += $(CC_LD_PATHS)
|
||||
|
||||
|
|
|
@ -3,15 +3,7 @@
|
|||
|
||||
#include "jni.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern JNIEnv *launch(char *);
|
||||
extern void kill();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
#include <jni.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include "Exceptions.h"
|
||||
#include "CAstWrapper.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
JavaVM *javaVM;
|
||||
|
||||
JNIEnv *launch(char *classpath) {
|
||||
|
@ -34,7 +30,7 @@ JNIEnv *launch(char *classpath) {
|
|||
long flag = JNI_CreateJavaVM(&javaVM, (void**)
|
||||
&jniEnv, &vmArgs);
|
||||
if (flag == JNI_ERR) {
|
||||
cout << "Error creating VM. Exiting...\n";
|
||||
fprintf(stderr, "Error creating VM. Exiting...\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -44,5 +40,3 @@ JNIEnv *launch(char *classpath) {
|
|||
void kill() {
|
||||
javaVM->DestroyJavaVM();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue