Merge pull request #203 from liblit/fix-native-build-Makefile-configuration-churn

Fix native build `Makefile.configuration` churn
This commit is contained in:
Julian Dolby 2017-07-15 21:10:00 -04:00 committed by GitHub
commit ecf05f6bd8
9 changed files with 27 additions and 93 deletions

View File

@ -1 +1,6 @@
CAST_TEST_BIN = /home/vagrant/WALA/com.ibm.wala.cast.test/target/classes/
# -*- makefile -*-
SCRIPT_NAME := $(realpath $(lastword $(MAKEFILE_LIST)))
C_DIR := $(dir $(SCRIPTINAME))
CAST_TEST_DIR := $(realpath $(C_DIR)../..)/
CAST_TEST_BIN := $(CAST_TEST_DIR)target/classes/

View File

@ -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 <<EOF
CAST_TEST_BIN = $CAST_TEST_DIR/target/classes/
EOF
make
make main
popd

View File

@ -19,10 +19,12 @@
<execution>
<phase>compile</phase>
<configuration>
<executable>bash</executable>
<executable>make</executable>
<arguments>
<argument>${basedir}/harness-src/c/cbuild.sh</argument>
<argument>default</argument>
<argument>main</argument>
</arguments>
<workingDirectory>${basedir}/harness-src/c</workingDirectory>
</configuration>
<goals>
<goal>exec</goal>

View File

@ -23,6 +23,7 @@
<arguments>
<argument>${basedir}/source/c/cbuild.sh</argument>
</arguments>
<workingDirectory>${basedir}/source/c</workingDirectory>
</configuration>
<goals>
<goal>exec</goal>

View File

@ -1,3 +1,2 @@
Makefile.configuration
CAstWrapper.lib
CAstWrapper.exp

View File

@ -1,5 +1,12 @@
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
# -*- makefile -*-
# 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 :=

View File

@ -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

View File

@ -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 = <Workspace>/com.ibm.wala.cast/bin/
# Extra stuff needed in the classpath of javah (must start with path separator)
JAVAH_CLASS_PATH = :<Workspace>/com.ibm.wala.cast/bin/
# enable debugging flags
TRACE =

38
com.ibm.wala.cast/source/c/cbuild.sh Normal file → Executable file
View File

@ -1,36 +1,4 @@
#!/bin/bash
SCRIPT=`realpath $0`
C_DIR=`dirname $SCRIPT`
CAST_DIR=`realpath $C_DIR/../..`
pushd $CAST_DIR/source/c
cat > /tmp/JrePath.java <<EOF
class JrePath {
public static void main(String[] args) {
System.out.println(System.getProperty("java.home"));
}
}
EOF
pushd /tmp
javac JrePath.java
JRE_DIR=`java JrePath`
JDK_DIR=`realpath $JRE_DIR/..`
popd
JNI_MD_H=`ls $JDK_DIR/include/*/jni_md.h`
JNI_MD_PATH=`dirname $JNI_MD_H`
JNI_MD_DIR=`basename $JNI_MD_PATH`
cat > $CAST_DIR/source/c/Makefile.configuration <<EOF
JAVA_SDK = $JDK_DIR/
DOMO_AST_BIN = $CAST_DIR/target/classes/
JAVAH_CLASS_PATH = :$CAST_DIR/target/classes/
TRACE =
JNI_MD_DIR = $JNI_MD_DIR
EOF
#!/bin/bash -eu
if (uname | grep -i "cygwin"); then
# This should be the default for most of cases;
@ -43,4 +11,6 @@ else
make
fi
popd
# Local variables:
# eval: (smie-config-local '((8 :after "else" 2) (8 :elem basic 2)))
# End: