80 |
|
|
81 |
} |
} |
82 |
|
|
|
parse_options() { |
|
|
|
|
|
ac_prev= |
|
|
for ac_option in "${OPTIONS[@]}" ; do |
|
|
|
|
|
# echo "ac_option = :$ac_option:" |
|
|
|
|
|
# If the previous option needs an argument, assign it. |
|
|
if test -n "$ac_prev"; then |
|
|
eval "$ac_prev=\$ac_option" |
|
|
ac_prev= |
|
|
continue |
|
|
fi |
|
|
|
|
|
ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` |
|
|
|
|
|
case $ac_option in |
|
|
|
|
|
-help | --help | -h | --h) |
|
|
usage ;; |
|
|
|
|
|
-nooptfile | --nooptfile) |
|
|
OPTFILE="NONE" ;; |
|
|
-optfile | --optfile | -of | --of) |
|
|
ac_prev=optfile ;; |
|
|
-optfile=* | --optfile=* | -of=* | --of=*) |
|
|
OPTFILE=$ac_optarg ;; |
|
|
|
|
|
-pdepend | --pdepend) |
|
|
ac_prev=pdepend ;; |
|
|
-pdepend=* | --pdepend=*) |
|
|
PDEPEND=$ac_optarg ;; |
|
|
|
|
|
-pdefault | --pdefault) |
|
|
ac_prev=pdefault ;; |
|
|
-pdefault=* | --pdefault=*) |
|
|
PDEFAULT=$ac_optarg ;; |
|
|
|
|
|
-makefile | -ma) |
|
|
ac_prev=makefile ;; |
|
|
--makefile=* | -ma=*) |
|
|
MAKEFILE=$ac_optarg ;; |
|
|
|
|
|
-platform | --platform | -pl | --pl) |
|
|
ac_prev=platform ;; |
|
|
-platform=* | --platform=* | -pl=* | --pl=*) |
|
|
PLATFORM=$ac_optarg ;; |
|
|
|
|
|
-rootdir | --rootdir | -rd | --rd) |
|
|
ac_prev=rootdir ;; |
|
|
-rootdir=* | --rootdir=* | -rd=* | --rd=*) |
|
|
ROOTDIR=$ac_optarg ;; |
|
|
|
|
|
-mods | --mods | -mo | --mo) |
|
|
ac_prev=mods ;; |
|
|
-mods=* | --mods=* | -mo=* | --mo=*) |
|
|
MODS=$ac_optarg ;; |
|
|
|
|
|
-disable | --disable) |
|
|
ac_prev=disable ;; |
|
|
-disable=* | --disable=*) |
|
|
DISABLE=$ac_optarg ;; |
|
|
|
|
|
-enable | --enable) |
|
|
ac_prev=enable ;; |
|
|
-enable=* | --enable=*) |
|
|
ENABLE=$ac_optarg ;; |
|
|
|
|
|
-noopt | --noopt) |
|
|
ac_prev=noopt ;; |
|
|
-noopt=* | --noopt=*) |
|
|
NOOPT=$ac_optarg ;; |
|
|
|
|
|
# -cpp | --cpp) |
|
|
# ac_prev=cpp ;; |
|
|
# -cpp=* | --cpp=*) |
|
|
# CPP=$ac_optarg ;; |
|
|
|
|
|
-fortran | --fortran | -fc | --fc) |
|
|
ac_prev=fc ;; |
|
|
-fc=* | --fc=*) |
|
|
FC=$ac_optarg ;; |
|
|
|
|
|
-ieee | --ieee) |
|
|
IEEE=1 ;; |
|
|
-noieee | --noieee) |
|
|
IEEE=0 ;; |
|
|
|
|
|
-mpi | --mpi) |
|
|
MPI=1 ;; |
|
|
-nompi | --nompi) |
|
|
MPI=0 ;; |
|
|
|
|
|
-jam | --jam) |
|
|
JAM=1 ;; |
|
|
-nojam | --nojam) |
|
|
JAM=0 ;; |
|
|
|
|
|
-*) |
|
|
echo "Error: unrecognized option: "$ac_option |
|
|
usage |
|
|
;; |
|
|
|
|
|
*) |
|
|
echo "Error: unrecognized argument: "$ac_option |
|
|
usage |
|
|
;; |
|
|
|
|
|
esac |
|
|
|
|
|
done |
|
|
} |
|
|
|
|
83 |
# Parse the package dependency information |
# Parse the package dependency information |
84 |
get_pdepend_list() { |
get_pdepend_list() { |
85 |
|
|
142 |
exit 1 |
exit 1 |
143 |
} |
} |
144 |
|
|
|
# Dump all important state |
|
|
dump_state() { |
|
|
fname=$1 |
|
|
echo " " > $fname |
|
|
RETVAL=$? |
|
|
if test "x${RETVAL}" = x ; then |
|
|
echo "Error: cannot write to $fname" |
|
|
exit 1 |
|
|
fi |
|
|
echo "makefile "$makefile > $fname |
|
|
} |
|
|
|
|
|
|
|
145 |
#eh3 # This is the generic configuration. |
#eh3 # This is the generic configuration. |
146 |
#eh3 set LN = ( 'ln -s' ) |
#eh3 set LN = ( 'ln -s' ) |
147 |
#eh3 set CPP = ( '/lib/cpp -P' ) |
#eh3 set CPP = ( '/lib/cpp -P' ) |
162 |
#eh3 if (! $?NOOPTFLAGS ) set NOOPTFLAGS = ( ) |
#eh3 if (! $?NOOPTFLAGS ) set NOOPTFLAGS = ( ) |
163 |
|
|
164 |
# Set defaults here |
# Set defaults here |
165 |
|
COMMANDL="$0 $@" |
166 |
|
|
167 |
PLATFORM= |
PLATFORM= |
168 |
LN= |
LN= |
169 |
S64= |
S64= |
176 |
MAKEFILE= |
MAKEFILE= |
177 |
MAKEDEPEND= |
MAKEDEPEND= |
178 |
PDEPEND= |
PDEPEND= |
179 |
|
DUMPSTATE=f |
180 |
PDEFAULT= |
PDEFAULT= |
181 |
OPTFILE= |
OPTFILE= |
182 |
INCLUDES="-I." |
INCLUDES="-I." |
202 |
THISDATE=`date` |
THISDATE=`date` |
203 |
MACHINE=`uname -a` |
MACHINE=`uname -a` |
204 |
|
|
205 |
|
# The following state can be set directly by command-line switches |
206 |
|
gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE NOOPT" |
207 |
|
gm_s2="FC IEEE MPI JAM DUMPSTATE" |
208 |
|
|
209 |
|
# The following state is not directly set by command-line switches |
210 |
|
gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPEND PDEPEND PDEFAULT INCLUDES FFLAGS FOPTIM " |
211 |
|
gm_s4="CFLAGS KFLAGS1 KFLAGS2 LIBS KPPFILES NOOPTFILES NOOPTFLAGS" |
212 |
|
gm_s5="TOOLSDIR SOURCEDIRS INCLUDEDIRS PWD MAKE THISHOSTNAME THISDATE MACHINE" |
213 |
|
|
214 |
|
gm_state="COMMANDL $gm_s1 $gm_s2 $gm_s3 $gm_s4 $gm_s5" |
215 |
|
|
216 |
|
|
217 |
echo |
echo |
218 |
echo "=== Processing options files and arguments ===" |
echo "=== Processing options files and arguments ===" |
219 |
gm_local="./gm_local" |
gm_local="./gm_local" |
333 |
-nojam | --nojam) |
-nojam | --nojam) |
334 |
JAM=0 ;; |
JAM=0 ;; |
335 |
|
|
336 |
|
-ds | --ds) |
337 |
|
DUMPSTATE=t ;; |
338 |
|
|
339 |
-*) |
-*) |
340 |
echo "Error: unrecognized option: "$ac_option |
echo "Error: unrecognized option: "$ac_option |
341 |
usage |
usage |
368 |
echo "--please check that variable syntax is bash-compatible" |
echo "--please check that variable syntax is bash-compatible" |
369 |
exit 1 |
exit 1 |
370 |
fi |
fi |
371 |
|
if test "x$DUMPSTATE" != xf ; then |
372 |
|
cp -f $OPTFILE "gm_optfile" |
373 |
|
fi |
374 |
else |
else |
375 |
echo "Error: can't read OPTFILE=\"$OPTFILE\"" |
echo "Error: can't read OPTFILE=\"$OPTFILE\"" |
376 |
exit 1 |
exit 1 |
1015 |
printf "\n\n# DO NOT DELETE\n" >> $MAKEFILE |
printf "\n\n# DO NOT DELETE\n" >> $MAKEFILE |
1016 |
|
|
1017 |
printf "\n=== Done ===\n" |
printf "\n=== Done ===\n" |
1018 |
|
|
1019 |
|
|
1020 |
|
# Write the "state" for future records |
1021 |
|
if test "x$DUMPSTATE" != xf ; then |
1022 |
|
echo -n "" > gm_state |
1023 |
|
for i in $gm_state ; do |
1024 |
|
t1="t2=\$$i" |
1025 |
|
eval $t1 |
1026 |
|
echo "$i='$t2'" >> gm_state |
1027 |
|
done |
1028 |
|
fi |