summaryrefslogtreecommitdiffstats
path: root/bin/yodconfigure
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2007-01-26 15:24:19 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2007-01-26 15:24:19 (GMT)
commit5c6e54bea27304377f60f817716dcc3b8dbe5a80 (patch)
treedb4cba998cd95d34eab33fff296590459464483b /bin/yodconfigure
parent3fdcb8b3d9bb69243903b4d2ae4a67cdc5bdd544 (diff)
downloadhdf5-5c6e54bea27304377f60f817716dcc3b8dbe5a80.zip
hdf5-5c6e54bea27304377f60f817716dcc3b8dbe5a80.tar.gz
hdf5-5c6e54bea27304377f60f817716dcc3b8dbe5a80.tar.bz2
[svn-r13204] Purpose:
Improvement. Description: Added the forcemode option. (was in hdf4 for months.) auto-configure have changed the ac_try syntax from 'eval $ac_try' to 'eval "$ac_try"'. Add a new global-substitute to support that too. Platforms Tested: Kagiso only since it is just a shell script simple change.
Diffstat (limited to 'bin/yodconfigure')
-rwxr-xr-xbin/yodconfigure21
1 files changed, 20 insertions, 1 deletions
diff --git a/bin/yodconfigure b/bin/yodconfigure
index e449f62..039d01c 100755
--- a/bin/yodconfigure
+++ b/bin/yodconfigure
@@ -18,8 +18,15 @@
#
# Author: Albert Cheng
+if [ "$1" = -f ]; then
+ FORCEMODE=yes
+ echo turn FORCEMODE to $FORCEMODE
+ shift
+fi
+
if [ $# -ne 1 ]; then
- echo "Usage: $0 <configure file>"
+ echo "Usage: $0 [-f] <configure file>"
+ echo " -f apply the change even if it has been applied already."
exit 1
fi
confile=$1
@@ -29,8 +36,18 @@ if [ ! -w $confile ]; then
exit 1
fi
+ACTRY_NAME="ACTRY()"
+if grep ^"$ACTRY_NAME"$ $confile >/dev/null 2>&1 && [ "$FORCEMODE" != yes ]; then
+ echo "$0: $confile is already yodconfigure ready. Use -f to force yodconfigure again."
+ exit 1
+fi
+
# Insert the ACTRY function after the 1st line which is the #!/bin/sh.
# Change all "eval $ac_try" commands to call ACTRY.
+# auto-configure have changed the ac_try syntax from 'eval $ac_try' to
+# 'eval "$ac_try"'. Thus requiring two very similar global-substitute.
+# The single quotes around EOF tell shell NOT to expand or do substitution in
+# the body of ed input.
#
ed - $confile <<'EOF'
1a
@@ -51,7 +68,9 @@ else
$*
fi
}
+# === end of ACTRY inserted by yodconfigure ====
.
+g/eval $ac_try/s/eval/eval ACTRY/
g/eval "$ac_try"/s/eval/eval ACTRY/
w
q