summaryrefslogtreecommitdiff
path: root/lib/make/CCTK_Functions.sh
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-07-21 12:25:02 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-07-21 12:25:02 +0000
commit003f061973eacadb509d9910a333e00be0c16635 (patch)
tree4bd59f6b10eb4509b6e54af568f535011626cb09 /lib/make/CCTK_Functions.sh
parentebeaa68430da4417c6de5113b7c17a63a3baf0f9 (diff)
I've re-done the MPI stuff to make it more flexible. It is now easy to add other
extra packages, e.g. PVM, without having to rerun autoconf. Basically 'configure' now looks in a directory called 'extras', and for every subdirectory of that is checks for the presence of an executable file call 'setup.sh' which can do configuration stuff. 'setup.sh' should put extra definitions in a file called 'cctk_extradefs.h' and extra make stuff in 'make.extra.defn'. To help this process there is a function CCTK_WriteLine which takes two arguments, the name of the file, and what to write. E.g. CCTK_WriteLine cctk_extradefs.h "#define MPI" and CCTK_WriteLine make.extra.defn 'LIBS += $(MPI_LIBS)' with the usual shell expansions happening. To help search for files and things there is function CCTK_Search which takes four arguments - the name of a variable - a list of names - a filename - an (optional) basename E.g. CCTK_Search MPI_DEVICE "ch_shmem ch_p4 globus" lib $MPICH_DIR/build would look for directories called ch_shmem or ch_p4 or globus containing a file or directory called 'lib' and all this would be done in the directory $MPICH_DIR/build. On return from the function the value of MPI_DEVICE would be ch_shmem, ch_p4, globus, or empty depending on which one was found first. So, to add an optional extra package: - add a directory with its name under lib/make/extras - in this directory add an executable shell file called setup.sh - in this file check if the extra thing is enabled, check for any configuration things and add them to cctk_extradefs.h or make.extra.defn as necessary. Note you will need to do a cvs update -d to get the new directories I've just added. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@752 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make/CCTK_Functions.sh')
-rw-r--r--lib/make/CCTK_Functions.sh66
1 files changed, 66 insertions, 0 deletions
diff --git a/lib/make/CCTK_Functions.sh b/lib/make/CCTK_Functions.sh
new file mode 100644
index 00000000..ad500fb5
--- /dev/null
+++ b/lib/make/CCTK_Functions.sh
@@ -0,0 +1,66 @@
+#! /bin/sh
+# /*@@
+# @file CCTK_Functions.sh
+# @date Wed Jul 21 11:16:06 1999
+# @author Tom Goodale
+# @desc
+#
+# @enddesc
+# @version $Header$
+#
+# @@*/
+
+
+# /*@@
+# @routine CCTK_Search
+# @date Wed Jul 21 11:16:35 1999
+# @author Tom Goodale
+# @desc
+# Used to search for something in various directories
+# @enddesc
+# @calls
+# @calledby
+# @history
+#
+# @endhistory
+#
+#@@*/
+
+function CCTK_Search()
+{
+ eval $1=""
+ if test -z $4 ; then
+ cctk_basedir=""
+ else
+ cctk_basedir="$4/"
+ fi
+ for cctk_place in $2
+ do
+ echo $ac_n "Looking in $cctk_place""...$ac_c" #1>&6
+ if test -r "$cctk_basedir$cctk_place/$3" ; then
+ echo "$ac_t""...Found" #1>&6
+ eval $1="$cctk_place"
+ break
+ fi
+ if test -d "$cctk_basedir$cctk_place/$3" ; then
+ echo "$ac_t""...Found" #1>&6
+ eval $1="$cctk_place"
+ break
+ fi
+ echo "$ac_t""No" #1>&6
+ done
+
+ return
+}
+
+function CCTK_CreateFile
+{
+ echo $2 > $1
+ return
+}
+
+function CCTK_WriteLine
+{
+ echo $2 >> $1
+ return
+}