changeset 2686:5da62ff54752

Merge
author henryjen
date Thu, 17 Aug 2017 12:25:03 -0700
parents 97bae9fd4fff 48588f772237
children c3c319ed215a
files
diffstat 2 files changed, 34 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/common/bin/idea.sh	Thu Aug 17 12:17:39 2017 -0700
+++ b/common/bin/idea.sh	Thu Aug 17 12:25:03 2017 -0700
@@ -25,7 +25,7 @@
 # Shell script for generating an IDEA project from a given list of modules
 
 usage() {
-      echo "usage: $0 [-h|--help] [-v|--verbose] [-o|--output <path>] [modules]+" 
+      echo "usage: $0 [-h|--help] [-v|--verbose] [-o|--output <path>] [modules]+"
       exit 1
 }
 
@@ -70,8 +70,10 @@
 IDEA_TEMPLATE="$IDEA_MAKE/template"
 IML_TEMPLATE="$IDEA_TEMPLATE/jdk.iml"
 ANT_TEMPLATE="$IDEA_TEMPLATE/ant.xml"
+RUN_JEXTRACT_TEMPLATE="$IDEA_TEMPLATE/runConfigurations/jextract.xml"
 IDEA_IML="$IDEA_OUTPUT/jdk.iml"
 IDEA_ANT="$IDEA_OUTPUT/ant.xml"
+IDEA_RUN_JEXTRACT="$IDEA_OUTPUT/runConfigurations/jextract.xml"
 
 if [ "$VERBOSE" = "true" ] ; then
   echo "output dir: $IDEA_OUTPUT"
@@ -125,7 +127,7 @@
 while IFS= read -r line
 do
   if echo "$line" | egrep "^ .* <sourceFolder.*####" > /dev/null ; then
-    if [ "$SOURCE_FOLDERS_DONE" = "false" ] ; then 
+    if [ "$SOURCE_FOLDERS_DONE" = "false" ] ; then
       SOURCE_FOLDERS_DONE="true"
       for root in $MODULE_ROOTS; do
          addSourceFolder $root
@@ -133,7 +135,7 @@
     fi
   elif echo "$line" | egrep "^ .* <excludeFolder.*####" > /dev/null ; then
     ul="`echo "$line" | sed -e s@"\(.*/\)####\(.*\)"@"\1$RELATIVE_BUILD_DIR\2"@`"
-    printf "%s\n" "$ul" >> $IDEA_IML 
+    printf "%s\n" "$ul" >> $IDEA_IML
   else
     printf "%s\n" "$line" >> $IDEA_IML
   fi
@@ -163,6 +165,22 @@
   printf "%s\n" "$mn" >> $IDEA_ANT
 }
 
+LD_PATH="<env name=\"LD_LIBRARY_PATH\" value=\"####\" />"
+
+addClangLib() {
+  CLANG_LIB=`echo $LIBCLANG_LDFLAGS | sed 's/^-L//g'`
+  mn="`echo "$LD_PATH" | sed -e s@"\(.*\)####\(.*\)"@"\1$CLANG_LIB\2"@`"
+  printf "%s\n" "$mn" >> $IDEA_RUN_JEXTRACT
+}
+
+ALTERNATE_JRE="    <option name=\"ALTERNATIVE_JRE_PATH\" value=\"####/images/jdk\" />"
+
+addAltJreDir() {
+  DIR=`dirname $SPEC`
+  mn="`echo "$ALTERNATE_JRE" | sed -e s@"\(.*\)####\(.*\)"@"\1$DIR\2"@`"
+  printf "%s\n" "$mn" >> $IDEA_RUN_JEXTRACT
+}
+
 ### Generate ant.xml
 
 rm -f $IDEA_ANT
@@ -179,6 +197,18 @@
   fi
 done < "$ANT_TEMPLATE"
 
+rm -f $IDEA_RUN_JEXTRACT
+while IFS= read -r line
+do
+  if echo "$line" | egrep "^ .* <env name=\"LD_LIBRARY_PATH\"" > /dev/null ; then
+    addClangLib
+  elif echo "$line" | egrep "^ .*<option name=\"ALTERNATIVE_JRE_PATH\"" > /dev/null ; then
+    addAltJreDir
+  else
+    printf "%s\n" "$line" >> $IDEA_RUN_JEXTRACT
+  fi
+done < "$RUN_JEXTRACT_TEMPLATE"
+
 ### Compile the custom Logger
 
 CLASSES=$IDEA_OUTPUT/classes
--- a/make/idea/idea.gmk	Thu Aug 17 12:17:39 2017 -0700
+++ b/make/idea/idea.gmk	Thu Aug 17 12:25:03 2017 -0700
@@ -36,5 +36,6 @@
 	$(ECHO) "CYGPATH=\"$(CYGPATH)\"" >> $(OUT)
 	$(ECHO) "SPEC=\"$(SPEC)\"" >> $(OUT)
 	$(ECHO) "JT_HOME=\"$(JT_HOME)\"" >> $(OUT)
+	$(ECHO) "LIBCLANG_LDFLAGS=\"$(LIBCLANG_LDFLAGS)\"" >> $(OUT)
 
 endif