Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Implement GRAMINE
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 26 Sep 2006 08:21:29 +0000 (08:21 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 26 Sep 2006 08:21:29 +0000 (08:21 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2814 48e7efb5-ca39-0410-a469-dd3cf9ba447f

Makefile.am
configure.ac
src/Makefile.am

index fd58ba8..2f656ab 100644 (file)
@@ -1,14 +1,20 @@
-SUBDIRS= include src tools testsuite examples doc
-DISTCLEANFILES =  *~  
-
-ACLOCAL = aclocal-1.9 -I acmacro
-AUTOMAKE_OPTIONS = gnu
+# GRAMINE_CUT_BEGIN
+SG_SUBDIRS= tools testsuite examples doc
 
-EXTRA_DIST = bootstrap COPYING INSTALL NEWS README README.IEEE TODO AUTHORS ChangeLog \
+SG_EXTRA_DIST = bootstrap COPYING INSTALL NEWS README README.IEEE TODO AUTHORS ChangeLog \
        acmacro/aci.m4 \
        tools/graspe-slave.in \
        tools/MSG_visualization \
           tools/MSG_visualization/colorize.pl
+# GRAMINE_CUT_END
+
+SUBDIRS= include src $(SG_SUBDIRS)
+EXTRA_DIST=$(SG_EXTRA_DIST)
+
+DISTCLEANFILES =  *~  
+
+ACLOCAL = aclocal-1.9 -I acmacro
+AUTOMAKE_OPTIONS = gnu
 
 SOURCE_FILES = $(shell find . -name "*.[ch]")
 TAGS: $(SOURCE_FILES)
@@ -16,7 +22,25 @@ TAGS: $(SOURCE_FILES)
 
 tags: TAGS
 
-
+gramine:
+       rm -rf gramine-@VERSION@
+       @echo "# Setup sources..."
+       for n in `find include src -name '*.[chl]'`; do \
+         mkdir -p gramine-@VERSION@/`dirname $$n`; \
+         cp $$n gramine-@VERSION@/`dirname $$n`; \
+       done
+       @echo "# Copy sources to be generated by configury"
+       cp src/ucontext_stack.h.in src/gras_config.h.in gramine-@VERSION@/src
+       @echo "# Remove sources being part of the testsuite"
+       rm gramine-@VERSION@/src/*_unit.c
+       @echo "# Adapt the configury mechanism to the gramine context"
+       mkdir gramine-@VERSION@/acmacro
+       for n in configure Makefile.in src/Makefile.in include/Makefile.in ; do \
+         sed  -e '/^# GRAMINE_CUT_BEGIN/,/^# GRAMINE_CUT_END/d' \
+              -e 's/gramine_mode=no/gramine_mode=yes/' $$n > gramine-@VERSION@/$$n; \
+       done
+       chmod +x gramine-@VERSION@/configure
+         
 
 if MAINTAINER_MODE
 ##
index d05da40..14c91b4 100644 (file)
@@ -198,6 +198,16 @@ AC_SUBST([GRAS_DEP])
 ## (must be placed after any compilation tests since our overprotective flags
 ##  let some tests fail)
 
+# Check whether we are doing a regular build or a GRAMINE (minimal) one
+# Next line is modified by sed when building gramine source tree
+gramine_mode=no
+if test x$gramine_mode = xyes
+then
+  USE_MAINTAINER_MODE=no
+fi
+AM_CONDITIONAL(GRAMINE_MODE,test x$gramine_mode != xno)
+
+
 AM_MAINTAINER_MODE
 if test x$USE_MAINTAINER_MODE = xyes 
 then
@@ -223,6 +233,7 @@ AC_CHECK_PROG(BASH, bash, `which bash`, /bin/sh)
 WARNING="This file is generated, do not edit"
 AC_SUBST(WARNING)
 
+
 # Can we rebuild the parsers?
 # We really want flex and refuse other lex. So, the parser is portable and
 # does not induce extra lib dependency
@@ -270,6 +281,8 @@ AC_CONFIG_FILES([
   src/ucontext_stack.h
 ])
 
+# GRAMINE_CUT_BEGIN
+
 # Testsuite
 
 AC_CONFIG_FILES([  
@@ -346,6 +359,7 @@ AC_CONFIG_FILES([
 #    examples/gras/alnem/Makefile     examples/gras/alnem/test_sg
 
 
+# GRAMINE_CUT_END
 
 AC_OUTPUT
 
index 68941cc..707aeee 100644 (file)
@@ -104,7 +104,6 @@ VERSION_INFO= -version-info 0:0:0
 #   using this trick is ready for a "stable" release (say, in Debian).
 
 lib_LTLIBRARIES= libsimgrid.la libgras.la
-noinst_PROGRAMS=testall
 
 COMMON_SRC=\
   \
@@ -189,6 +188,8 @@ AMOK_SRC= \
   amok/Bandwidth/bandwidth.c amok/Bandwidth/saturate.c \
   amok/PeerManagement/peermanagement.c
 
+if GRAMINE_MODE
+else 
 ###
 ### Testing infrastructure
 ###
@@ -202,6 +203,7 @@ AMOK_SRC= \
 
 # Suites and tests run in the given order.
 
+noinst_PROGRAMS=testall
 TEST_CFILES=xbt/cunit.c  xbt/ex.c          \
             xbt/dynar.c xbt/dict.c xbt/set.c xbt/swag.c \
             xbt/config.c
@@ -218,7 +220,7 @@ testall_SOURCES= $(TEST_UNITS) simgrid_units_main.c
 testall_LDADD=libgras.la
 TESTS=testall
 
-EXTRA_DIST+=$(testall_SOURCES)
+EXTRA_DIST+=$t(estall_SOURCES)
 
 if MAINTAINER_MODE
 cunit_unit.c: xbt/cunit.c
@@ -290,6 +292,7 @@ $(top_srcdir)/include/xbt/graphxml.h xbt/graphxml.l: $(top_srcdir)/src/xbt/graph
        @exit 1
 endif
 endif
+endif
 
 ###
 ### Declare the library content