diff --git a/com.ibm.wala.cast.test/harness-src/c/Makefile.configuration b/com.ibm.wala.cast.test/harness-src/c/Makefile.configuration index d17251fe9..5f99ac62a 100644 --- a/com.ibm.wala.cast.test/harness-src/c/Makefile.configuration +++ b/com.ibm.wala.cast.test/harness-src/c/Makefile.configuration @@ -1 +1,4 @@ -CAST_TEST_BIN = /home/vagrant/WALA/com.ibm.wala.cast.test/target/classes/ +SCRIPT_NAME := $(realpath $(lastword $(MAKEFILE_LIST))) +C_DIR := $(dir $(SCRIPTINAME)) +CAST_TEST_DIR := $(realpath $(C_DIR)../..)/ +CAST_TEST_BIN := $(CAST_TEST_DIR)target/classes/ diff --git a/com.ibm.wala.cast.test/harness-src/c/cbuild.sh b/com.ibm.wala.cast.test/harness-src/c/cbuild.sh deleted file mode 100644 index fce2f7136..000000000 --- a/com.ibm.wala.cast.test/harness-src/c/cbuild.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -SCRIPT_NAME=`realpath $0` -C_DIR=`dirname $SCRIPT_NAME` -CAST_TEST_DIR=`realpath $C_DIR/../..` - -pushd $CAST_TEST_DIR/harness-src/c - -cat > $CAST_TEST_DIR/harness-src/c/Makefile.configuration < compile - bash + make - ${basedir}/harness-src/c/cbuild.sh + default + main + ${basedir}/harness-src/c exec diff --git a/com.ibm.wala.cast/pom.xml b/com.ibm.wala.cast/pom.xml index 696539d4b..edae15159 100644 --- a/com.ibm.wala.cast/pom.xml +++ b/com.ibm.wala.cast/pom.xml @@ -23,6 +23,7 @@ ${basedir}/source/c/cbuild.sh + ${basedir}/source/c exec diff --git a/com.ibm.wala.cast/source/c/.cvsignore b/com.ibm.wala.cast/source/c/.cvsignore index fca313ff1..7a72a8bb8 100644 --- a/com.ibm.wala.cast/source/c/.cvsignore +++ b/com.ibm.wala.cast/source/c/.cvsignore @@ -1,3 +1,2 @@ -Makefile.configuration CAstWrapper.lib CAstWrapper.exp diff --git a/com.ibm.wala.cast/source/c/Makefile.configuration b/com.ibm.wala.cast/source/c/Makefile.configuration index b8c7327a1..5e15390d9 100644 --- a/com.ibm.wala.cast/source/c/Makefile.configuration +++ b/com.ibm.wala.cast/source/c/Makefile.configuration @@ -1,5 +1,10 @@ -JAVA_SDK = /usr/lib/jvm/jdk1.8.0_111/ -DOMO_AST_BIN = /home/vagrant/WALA/com.ibm.wala.cast/target/classes/ -JAVAH_CLASS_PATH = :/home/vagrant/WALA/com.ibm.wala.cast/target/classes/ -TRACE = -JNI_MD_DIR = linux +# configuration of installed Java SDK +JRE_DIR := $(shell java -XshowSettings:properties -version 2>&1 | sed -n 's/^ *java\.home = \(.*\)/\1/p')/ +JAVA_SDK := $(realpath $(JRE_DIR)..)/ +JNI_MD_DIR := $(notdir $(patsubst %/,%,$(dir $(wildcard $(JAVA_SDK)include/*/jni_md.h)))) + +# configuration of WALA build tree +CAST_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))../..)/ +DOMO_AST_BIN := $(CAST_DIR)target/classes/ +JAVAH_CLASS_PATH := :$(CAST_DIR)target/classes/ +TRACE := diff --git a/com.ibm.wala.cast/source/c/Makefile.configuration.mine b/com.ibm.wala.cast/source/c/Makefile.configuration.mine deleted file mode 100644 index ca4041fe9..000000000 --- a/com.ibm.wala.cast/source/c/Makefile.configuration.mine +++ /dev/null @@ -1,18 +0,0 @@ -# -# global configuration. adjust for your system. -# - -# The root of the java SDK to use (must end in /) -JAVA_SDK = /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/ - -# Path .class files of the com.ibm.domo.ast Java code (must end in /) -DOMO_AST_BIN = /Users/dolby/git/WALA/com.ibm.wala.cast/bin/ - -# Extra stuff needed in the classpath of javah (must start with path separator) -JAVAH_CLASS_PATH = - -# enable debugging flags -TRACE = - -# low-level JNI path -JNI_MD_DIR = darwin \ No newline at end of file diff --git a/com.ibm.wala.cast/source/c/Makefile.configuration.sample b/com.ibm.wala.cast/source/c/Makefile.configuration.sample deleted file mode 100644 index e77bf9a96..000000000 --- a/com.ibm.wala.cast/source/c/Makefile.configuration.sample +++ /dev/null @@ -1,15 +0,0 @@ -# -# global configuration. adjust for your system. -# - -# The root of the java SDK to use (must end in /) -JAVA_SDK = /System/Library/Frameworks/JavaVM.framework/Home/ - -# Path .class files of the com.ibm.domo.ast Java code (must end in /) -DOMO_AST_BIN = /com.ibm.wala.cast/bin/ - -# Extra stuff needed in the classpath of javah (must start with path separator) -JAVAH_CLASS_PATH = :/com.ibm.wala.cast/bin/ - -# enable debugging flags -TRACE = diff --git a/com.ibm.wala.cast/source/c/cbuild.sh b/com.ibm.wala.cast/source/c/cbuild.sh index fd6a5f7f0..f8bef900a 100644 --- a/com.ibm.wala.cast/source/c/cbuild.sh +++ b/com.ibm.wala.cast/source/c/cbuild.sh @@ -1,37 +1,5 @@ #!/bin/bash -SCRIPT=`realpath $0` -C_DIR=`dirname $SCRIPT` -CAST_DIR=`realpath $C_DIR/../..` - -pushd $CAST_DIR/source/c - -cat > /tmp/JrePath.java < $CAST_DIR/source/c/Makefile.configuration <