public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [MELT] Separation between build and install
@ 2011-06-27 12:51 Alexandre Lissy
  2011-06-27 13:01 ` [PATCH] MELT: Separate build and install steps Alexandre Lissy
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Lissy @ 2011-06-27 12:51 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-melt-french

Hello,

While packaging GCC MELT as a plugin for Mandriva, I noticed that we
could do a slight improvement to the current build script to ease a bit
packaging, by adding a clear separation between the building steps and
installation steps. This allows to "cleanly" exploit the build script in
both %build and %install sections of the RPM spec file. Separation is
handled by adding two new switches, -b and -i which respectively enables
the build process and installation process. Both are of course mutually
exclusive, and it is expected that installation process is ran using the
same command line arguments as building (just changing -b to -i).

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] MELT: Separate build and install steps
  2011-06-27 12:51 [MELT] Separation between build and install Alexandre Lissy
@ 2011-06-27 13:01 ` Alexandre Lissy
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Lissy @ 2011-06-27 13:01 UTC (permalink / raw)
  To: gcc-patches; +Cc: gcc-melt-french, Alexandre Lissy

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(-)

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-27 12:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-27 12:51 [MELT] Separation between build and install Alexandre Lissy
2011-06-27 13:01 ` [PATCH] MELT: Separate build and install steps Alexandre Lissy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).