Patchwork MELT: Separate build and install steps

login
register
mail settings
Submitter Alexandre Lissy
Date June 27, 2011, 12:39 p.m.
Message ID <1309178351-24842-2-git-send-email-alissy@mandriva.com>
Download mbox | patch
Permalink /patch/102154/
State New
Headers show

Comments

Alexandre Lissy - June 27, 2011, 12:39 p.m.
In order to ease a bit packaging, this commit add two switches to the
current build infrastructure of "GCC MELT as plugin":
 - "-b" which runs the script to build GCC MELT
 - "-i" which runs the script to install GCC MELT
Both are mutually exclusive.
---
 ChangeLog.MELT               |    4 ++++
 contrib/build-melt-plugin.sh |   32 +++++++++++++++++++++++++-------
 2 files changed, 29 insertions(+), 7 deletions(-)

Patch

diff --git a/ChangeLog.MELT b/ChangeLog.MELT
index d00a4e1..2b88e00 100644
--- a/ChangeLog.MELT
+++ b/ChangeLog.MELT
@@ -1,3 +1,7 @@ 
+2011-06-27  Alexandre Lissy <alissy@mandriva.com>
+
+	* contrib/build-melt-plugin.sh: Adding -b and -i switches to separate
+	  build from install.
 
 2011-06-27  Basile Starynkevitch  <basile@starynkevitch.net>
 
diff --git a/contrib/build-melt-plugin.sh b/contrib/build-melt-plugin.sh
index 5ee8c3b..0119742 100644
--- a/contrib/build-melt-plugin.sh
+++ b/contrib/build-melt-plugin.sh
@@ -41,6 +41,8 @@  usage() {
     echo " -B buildpath  # sets the GCC build path, e.g. -B /tmp/gcc-build" 
     echo " -M meltpath   # sets the GCC-MELT source subtree, e.g. /usr/src/gcc-melt/gcc" 
     echo " -Y your/gt-melt-runtime.h  # force the gengtype generated gt-melt-runtime.h" 
+    echo " -b  # building MELT"
+    echo " -i  # installing MELT"
     echo "$progname is for building MELT as a plugin, not a branch."
     echo "run $progname -h to get help" >&2
     exit 1
@@ -86,6 +88,8 @@  set_default_variables() {
     gcc_target=""
     gcc_plugin_directory=""
     quiet=""
+    install=""
+    build=""
     timestamp_file=build-gccmelt-timestamp
     gtypelist_file=buildmelt-gtype-input.list
 }
@@ -121,10 +125,20 @@  verbose_sleep() {
 ################ parsing the shell program argument
 parse_args() {
     progname=$0
-    while getopts "hqs:S:B:Y:M:C:" opt ; do
+    while getopts "hqbis:S:B:Y:M:C:" opt ; do
 	case $opt in
 	    h) usage;;
 	    q) quiet=1;;
+            b) 
+		    echo build-melt-plugin: entering build mode
+		    build=1;
+		    install=""
+		;;
+            i) 
+		    echo build-melt-plugin: entering install mode
+		    build="";
+		    install=1
+		;;
 	    s) 
 		verbose_echo Evaluating $OPTARG;
 		eval "$OPTARG"
@@ -450,12 +464,16 @@  verbose_sleep
 #
 # here we go!
 sanity_checks_gcc_info
-get_gty_melt_header
-build_melt_run_headers
-build_melt_dot_so
-bootstrap_melt
-make_melt_documentation
-install_melt
+if [ ! -z "$build" ]; then
+	get_gty_melt_header
+	build_melt_run_headers
+	build_melt_dot_so
+	bootstrap_melt
+	make_melt_documentation
+fi
+if [ ! -z "$install" ]; then
+	install_melt
+fi
 
 verbose_echo MELT plugin building terminated
 if [ ! -z "$quiet" ]; then