Print

Print


Commit in SimDist/scripts on MAIN
slic.sh.in+31-51.2 -> 1.3
improved slic run script using ant's method of directory resolution; should now run okay without reconfigure

SimDist/scripts
slic.sh.in 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- slic.sh.in	25 Oct 2005 23:17:46 -0000	1.2
+++ slic.sh.in	1 Dec 2005 19:59:51 -0000	1.3
@@ -3,12 +3,38 @@
 #
 # Portable run script for SLIC.
 #
+# Directory resolution is taken from Apache Ant -> src/script/ant.
+#
 
-# bootstrap a few directory locations
-SLIC_BASE=@slic_base_dir@
-XERCES_LIB_DIR=@xerces_base_dir@/lib
+# name of script
+PRG="$0"
 
-# add Xerces runtime dep 
+# directory of script 
+progname=`basename "$0"`
+
+# resolve relative symlinks
+while [ -h "$PRG" ] ; do
+  ls=`ls -ld "$PRG"`
+  link=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$link" : '/.*' > /dev/null; then
+    PRG="$link"
+  else
+    PRG=`dirname "$PRG"`"/$link"
+  fi
+done
+
+# sim dir is one back from scripts
+SIM_HOME=`dirname "$PRG"`/..
+
+# make it fully qualified
+SIM_HOME=`cd "$SIM_HOME" && pwd`
+
+# slic base
+SLIC_BASE=${SIM_HOME}/packages/slic/@slic_version@ 
+
+# xerces lib 
+XERCES_LIB_DIR=${SIM_HOME}/packages/xerces/@xerces_version@/lib
 export @os_shared_libs_var@=$XERCES_LIB_DIR:$@os_shared_libs_var@
 
-${SLIC_BASE}/bin/@g4system@/slic $@
+# run slic with CL args
+echo ${SLIC_BASE}/bin/@g4system@/slic $@
CVSspam 0.2.8