2005-11-01 03:19:30 +08:00
|
|
|
#!/bin/sh
|
2007-02-15 06:20:52 +08:00
|
|
|
#
|
2017-04-15 21:17:10 +08:00
|
|
|
# Copyright by The HDF Group.
|
2005-11-01 03:19:30 +08:00
|
|
|
# Copyright by the Board of Trustees of the University of Illinois.
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# This file is part of HDF5. The full HDF5 copyright notice, including
|
|
|
|
# terms governing use, modification, and redistribution, is contained in
|
2017-04-15 21:17:10 +08:00
|
|
|
# the COPYING file, which can be found at the root of the source code
|
|
|
|
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
|
|
|
|
# If you do not have access to either file, you may request a copy from
|
|
|
|
# help@hdfgroup.org.
|
2007-02-15 06:20:52 +08:00
|
|
|
#
|
2005-11-01 03:19:30 +08:00
|
|
|
# Fix configure file so that it can launch configure testing executable
|
|
|
|
# via the proper launching command, e.g., yod. (Thus the name yodconfigure
|
|
|
|
# is used.)
|
|
|
|
#
|
|
|
|
# Author: Albert Cheng
|
|
|
|
|
2007-01-26 23:24:19 +08:00
|
|
|
if [ "$1" = -f ]; then
|
|
|
|
FORCEMODE=yes
|
|
|
|
echo turn FORCEMODE to $FORCEMODE
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
2005-11-01 03:19:30 +08:00
|
|
|
if [ $# -ne 1 ]; then
|
2007-01-26 23:24:19 +08:00
|
|
|
echo "Usage: $0 [-f] <configure file>"
|
|
|
|
echo " -f apply the change even if it has been applied already."
|
2005-11-01 03:19:30 +08:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
confile=$1
|
|
|
|
|
|
|
|
if [ ! -w $confile ]; then
|
|
|
|
echo "$0: $confile is not writable"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2007-01-26 23:24:19 +08:00
|
|
|
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
|
|
|
|
|
2005-11-01 03:19:30 +08:00
|
|
|
# Insert the ACTRY function after the 1st line which is the #!/bin/sh.
|
|
|
|
# Change all "eval $ac_try" commands to call ACTRY.
|
2007-01-26 23:24:19 +08:00
|
|
|
# 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.
|
2005-11-01 03:19:30 +08:00
|
|
|
#
|
|
|
|
ed - $confile <<'EOF'
|
|
|
|
1a
|
|
|
|
# ===inserted by yodconfigure ====
|
|
|
|
# ACTRY will figure out when it is approprirate to run the command by the
|
|
|
|
# $RUNSERIAL launcher (e.g., yod -sz 1) and when to just run it as is.
|
|
|
|
# So far, ./a.out and ./conftest are names of real executable that should
|
|
|
|
# be run by $RUNSERIAL.
|
|
|
|
#
|
|
|
|
# (uncomment the echo line if you want to see what is going on.)
|
|
|
|
ACTRY()
|
|
|
|
{
|
|
|
|
#echo ACTRY: args are: $* > /dev/tty
|
|
|
|
if [ "$1" = ./a.out -o "$1" = ./conftest ]; then
|
|
|
|
# echo $RUNSERIAL $* > /dev/tty
|
|
|
|
$RUNSERIAL $*
|
|
|
|
else
|
|
|
|
$*
|
|
|
|
fi
|
|
|
|
}
|
2007-01-26 23:24:19 +08:00
|
|
|
# === end of ACTRY inserted by yodconfigure ====
|
2005-11-01 03:19:30 +08:00
|
|
|
.
|
2007-01-26 23:24:19 +08:00
|
|
|
g/eval $ac_try/s/eval/eval ACTRY/
|
2007-01-25 18:23:31 +08:00
|
|
|
g/eval "$ac_try"/s/eval/eval ACTRY/
|
2005-11-01 03:19:30 +08:00
|
|
|
w
|
|
|
|
q
|
|
|
|
EOF
|