[Rivet-svn] r2707 - in trunk: . bin

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Oct 7 11:33:24 BST 2010


Author: buckley
Date: Thu Oct  7 11:33:24 2010
New Revision: 2707

Log:
Adding a --with-root flag to rivet-buildplugin to add root-config --libs flags to the plugin build command.

Modified:
   trunk/ChangeLog
   trunk/bin/rivet-buildplugin

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	Tue Oct  5 18:03:57 2010	(r2706)
+++ trunk/ChangeLog	Thu Oct  7 11:33:24 2010	(r2707)
@@ -1,3 +1,8 @@
+2010-10-07  Andy Buckley  <andy at insectnation.org>
+
+	* Adding a --with-root flag to rivet-buildplugin to add
+	root-config --libs flags to the plugin build command.
+
 2010-09-24  Andy Buckley  <andy at insectnation.org>
 
 	* Releasing as Rivet 1.3.0.

Modified: trunk/bin/rivet-buildplugin
==============================================================================
--- trunk/bin/rivet-buildplugin	Tue Oct  5 18:03:57 2010	(r2706)
+++ trunk/bin/rivet-buildplugin	Thu Oct  7 11:33:24 2010	(r2707)
@@ -11,6 +11,7 @@
     echo
     echo "Options:"
     echo "  -h | --help: display this help message"
+    echo "  --with-root: add ROOT link options (requires root-config on system)"
     test -n "$tmp"
     exit $?
 fi
@@ -31,6 +32,13 @@
     CXX=g++
 fi
 
+## Link against ROOT if requested
+with_root=$(echo $* | egrep -- '--\<with-root\>')
+# echo $with_root
+tmp=${@//--with-root/}
+set $tmp
+
+
 ## Get and check the library name
 libname=$1
 match=$(basename "$libname" | egrep '^Rivet.*\.so')
@@ -41,13 +49,18 @@
 
 ## Get the source files (and more flags)
 shift
-sources="$@"
+sources_and_flags="$@"
+if [[ -n $with_root ]]; then
+    root_flags=$(root-config --libs 2> /dev/null)
+    # echo $root_flags
+    sources_and_flags="$root_flags $sources_and_flags"
+fi
 
 ## Get Rivet include flags
 RIVETCONFIG=$(PATH="`dirname $0`:$PATH:." which rivet-config)
 cppflags=$($RIVETCONFIG --cppflags)
 
 ## Build
-cmd="$CXX -o \"$libname\" $shared_flags $cppflags $sources"
+cmd="$CXX -o \"$libname\" $shared_flags $cppflags $sources_and_flags"
 echo $cmd
 eval $cmd


More information about the Rivet-svn mailing list