100 |
CPP="cpp -traditional -P" |
CPP="cpp -traditional -P" |
101 |
fi |
fi |
102 |
|
|
103 |
# makedepend is not always available |
# The "original" makedepend is part of the Imake system that is |
104 |
|
# most often distributed with XFree86 or with an XFree86 source |
105 |
|
# package. As a result, many machines (eg. generic Linux) do not |
106 |
|
# have a system-default "makedepend" available. For those |
107 |
|
# systems, we have two fall-back options: |
108 |
|
# |
109 |
|
# 1) a makedepend implementation shipped with the cyrus-imapd |
110 |
|
# package: ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/ |
111 |
|
# |
112 |
|
# 2) a known-buggy xmakedpend shell script |
113 |
|
# |
114 |
|
# So the choices are, in order: |
115 |
|
# |
116 |
|
# 1) use the user-specified program |
117 |
|
# 2) use a system-wide default |
118 |
|
# 3) locally build and use the cyrus implementation |
119 |
|
# 4) fall back to the buggy local xmakedpend script |
120 |
|
# |
121 |
if test "x${MAKEDEPEND}" = x ; then |
if test "x${MAKEDEPEND}" = x ; then |
122 |
which makedepend >& /dev/null |
which makedepend >& /dev/null |
123 |
RETVAL=$? |
RETVAL=$? |
124 |
if test "x${RETVAL}" = x1 ; then |
if test ! "x${RETVAL}" = x0 ; then |
125 |
echo " makedepend was not found. Using xmakedpend instead." |
echo " a system-default makedepend was not found." |
126 |
MAKEDEPEND='$(TOOLSDIR)/xmakedepend' |
|
127 |
|
# Try to build the cyrus impl |
128 |
|
rm -f ./genmake_cy_md |
129 |
|
( |
130 |
|
cd $ROOTDIR/tools/cyrus-imapd-makedepend \ |
131 |
|
&& ./configure > /dev/null 2>&1 \ |
132 |
|
&& make > /dev/null 2>&1 \ |
133 |
|
&& ./makedepend ifparser.c > /dev/null 2>&1 \ |
134 |
|
&& echo "true" |
135 |
|
) > ./genmake_cy_md |
136 |
|
grep true ./genmake_cy_md > /dev/null 2>&1 |
137 |
|
RETVAL=$? |
138 |
|
if test "x$RETVAL" = x0 ; then |
139 |
|
MAKEDEPEND='$(TOOLSDIR)/cyrus-imapd-makedepend/makedepend' |
140 |
|
else |
141 |
|
MAKEDEPEND='$(TOOLSDIR)/xmakedepend' |
142 |
|
fi |
143 |
|
rm -f ./genmake_cy_md |
144 |
fi |
fi |
145 |
fi |
fi |
146 |
|
|
179 |
echo " "$p_FC |
echo " "$p_FC |
180 |
if test "x$FC" = x ; then |
if test "x$FC" = x ; then |
181 |
FC=`echo $p_FC | $AWK '{print $1}'` |
FC=`echo $p_FC | $AWK '{print $1}'` |
182 |
|
echo " Setting FORTRAN compiler to: "$FC |
183 |
fi |
fi |
184 |
fi |
fi |
185 |
|
|
186 |
for i in $p_FC ; do |
if test "x$OPTFILE" = x ; then |
187 |
p_OF=$ROOTDIR"/tools/build_options/"$PLATFORM"_"$i |
OPTFILE=$ROOTDIR"/tools/build_options/"$PLATFORM"_"$FC |
188 |
if test -r $p_OF ; then |
if test ! -r $OPTFILE ; then |
189 |
OPTFILE=$p_OF |
echo " I looked for the file "$OPTFILE" but did not find it" |
190 |
echo " The options file: $p_OF" |
fi |
191 |
echo " appears to match so we'll use it." |
fi |
192 |
break |
# echo " The options file: $p_OF" |
193 |
fi |
# echo " appears to match so we'll use it." |
194 |
done |
# for i in $p_FC ; do |
195 |
|
#p_OF=$ROOTDIR"/tools/build_options/"$PLATFORM"_"$i |
196 |
|
#if test -r $p_OF ; then |
197 |
|
# OPTFILE=$p_OF |
198 |
|
# echo " The options file: $p_OF" |
199 |
|
# echo " appears to match so we'll use it." |
200 |
|
# break |
201 |
|
#fi |
202 |
|
# done |
203 |
if test "x$OPTFILE" = x ; then |
if test "x$OPTFILE" = x ; then |
204 |
cat 1>&2 <<EOF |
cat 1>&2 <<EOF |
205 |
|
|
296 |
--makefile=NAME | -mf=NAME |
--makefile=NAME | -mf=NAME |
297 |
Call the makefile "NAME". The default is "Makefile". |
Call the makefile "NAME". The default is "Makefile". |
298 |
|
|
299 |
|
-makedepend NAME | -md NAME |
300 |
|
--makedepend=NAME | -md=NAME |
301 |
|
Use "NAME" for the MAKEDEPEND program. |
302 |
|
|
303 |
-rootdir NAME | --rootdir NAME | -rd NAME | --rd NAME |
-rootdir NAME | --rootdir NAME | -rd NAME | --rd NAME |
304 |
-rootdir=NAME | --rootdir=NAME | -rd=NAME | --rd=NAME |
-rootdir=NAME | --rootdir=NAME | -rd=NAME | --rd=NAME |
305 |
Specify the location of the MITgcm ROOTDIR as "NAME". |
Specify the location of the MITgcm ROOTDIR as "NAME". |
341 |
*only* works if it is supported by the OPTFILE that |
*only* works if it is supported by the OPTFILE that |
342 |
is being used. |
is being used. |
343 |
|
|
344 |
|
-mpi | --mpi |
345 |
|
Include MPI header files and link to MPI libraries |
346 |
|
-mpi=PATH | --mpi=PATH |
347 |
|
Include MPI header files and link to MPI libraries using MPI_ROOT |
348 |
|
set to PATH. i.e. Include files from $PATH/include, link to libraries |
349 |
|
from $PATH/lib and use binaries from $PATH/bin. |
350 |
|
|
351 |
While it is most often a single word, the "NAME" variables specified |
While it is most often a single word, the "NAME" variables specified |
352 |
above can in many cases be a space-delimited string such as: |
above can in many cases be a space-delimited string such as: |
353 |
|
|
512 |
if test "x$RET_COMPILE" = x0 -a "x$RETVAL" = x0 ; then |
if test "x$RET_COMPILE" = x0 -a "x$RETVAL" = x0 ; then |
513 |
HAVE_NETCDF=t |
HAVE_NETCDF=t |
514 |
else |
else |
515 |
cat genmake_tnc.log >> genmake_warnings |
# try again with "-lnetcdf" added to the libs |
516 |
|
$CPP genmake_tnc.F > genmake_tnc.f \ |
517 |
|
&& $FC $FFLAGS $FOPTIM -o genmake_tnc genmake_tnc.f \ |
518 |
|
$LIBS -lnetcdf >> genmake_tnc_2.log 2>&1 |
519 |
|
RET_COMPILE=$? |
520 |
|
test -x ./genmake_tnc && ./genmake_tnc >> genmake_tnc.log 2>&1 |
521 |
|
RETVAL=$? |
522 |
|
if test "x$RET_COMPILE" = x0 -a "x$RETVAL" = x0 ; then |
523 |
|
LIBS="$LIBS -lnetcdf" |
524 |
|
HAVE_NETCDF=t |
525 |
|
else |
526 |
|
cat genmake_tnc.log >> genmake_warnings |
527 |
|
fi |
528 |
fi |
fi |
529 |
rm -f genmake_tnc* |
rm -f genmake_tnc* |
530 |
} |
} |
531 |
|
|
532 |
|
|
533 |
|
|
534 |
|
############################################################################### |
535 |
|
# Sequential part of script starts here |
536 |
|
############################################################################### |
537 |
|
|
538 |
# Set defaults here |
# Set defaults here |
539 |
COMMANDL="$0 $@" |
COMMANDL="$0 $@" |
540 |
|
|
545 |
FC= |
FC= |
546 |
CPP= |
CPP= |
547 |
LINK= |
LINK= |
|
# DEFINES="-DWORDLENGTH=4" |
|
548 |
DEFINES= |
DEFINES= |
549 |
PACKAGES= |
PACKAGES= |
550 |
ENABLE= |
ENABLE= |
561 |
CFLAGS= |
CFLAGS= |
562 |
KFLAGS1= |
KFLAGS1= |
563 |
KFLAGS2= |
KFLAGS2= |
564 |
|
#LDADD= |
565 |
LIBS= |
LIBS= |
566 |
KPPFILES= |
KPPFILES= |
567 |
NOOPTFILES= |
NOOPTFILES= |
568 |
NOOPTFLAGS= |
NOOPTFLAGS= |
569 |
|
MPI= |
570 |
|
MPIPATH= |
571 |
|
|
572 |
# DEFINES checked by test compilation |
# DEFINES checked by test compilation |
573 |
HAVE_SYSTEM= |
HAVE_SYSTEM= |
715 |
-make=* | --make=* | -m=* | --m=*) |
-make=* | --make=* | -m=* | --m=*) |
716 |
MAKE=$ac_optarg ;; |
MAKE=$ac_optarg ;; |
717 |
|
|
718 |
|
-makedepend | --makedepend | -md | --md) |
719 |
|
ac_prev=MAKEDEPEND ;; |
720 |
|
-makedepend=* | --makedepend=* | -md=* | --md=*) |
721 |
|
MAKEDEPEND=$ac_optarg ;; |
722 |
|
|
723 |
-makefile | --makefile | -ma | --ma) |
-makefile | --makefile | -ma | --ma) |
724 |
ac_prev=MAKEFILE ;; |
ac_prev=MAKEFILE ;; |
725 |
-makefile=* | --makefile=* | -ma=* | --ma=*) |
-makefile=* | --makefile=* | -ma=* | --ma=*) |
771 |
IEEE=true ;; |
IEEE=true ;; |
772 |
-noieee | --noieee) |
-noieee | --noieee) |
773 |
IEEE= ;; |
IEEE= ;; |
774 |
|
|
775 |
|
-mpi | --mpi) |
776 |
|
MPI=true ;; |
777 |
|
-mpi=* | --mpi=*) |
778 |
|
MPIPATH=$ac_optarg |
779 |
|
MPI=true ;; |
780 |
|
|
781 |
# -jam | --jam) |
# -jam | --jam) |
782 |
# JAM=1 ;; |
# JAM=1 ;; |
969 |
fi |
fi |
970 |
rm -f genmake_test_ln genmake_tlink |
rm -f genmake_test_ln genmake_tlink |
971 |
|
|
972 |
|
if test ! "x$MPI" = x ; then |
973 |
|
echo " Turning on MPI cpp macros" |
974 |
|
DEFINES="$DEFINES -DALLOW_USE_MPI -DALWAYS_USE_MPI" |
975 |
|
fi |
976 |
|
|
977 |
printf "\n=== Checking system libraries ===\n" |
printf "\n=== Checking system libraries ===\n" |
978 |
echo -n " Do we have the system() command using $FC... " |
echo -n " Do we have the system() command using $FC... " |
1070 |
TOOLSDIR="$ROOTDIR/tools" |
TOOLSDIR="$ROOTDIR/tools" |
1071 |
fi |
fi |
1072 |
if test ! -d ${TOOLSDIR} ; then |
if test ! -d ${TOOLSDIR} ; then |
1073 |
echo "Error: the specified $TOOLSDIR (\"$TOOLSDIR\") does not exist!" |
echo "Error: the specified TOOLSDIR (\"$TOOLSDIR\") does not exist!" |
1074 |
exit 1 |
exit 1 |
1075 |
fi |
fi |
1076 |
if test "x$S64" = x ; then |
if test "x$S64" = x ; then |
1306 |
cat make_mnc.errors 1>&2 |
cat make_mnc.errors 1>&2 |
1307 |
exit 1 |
exit 1 |
1308 |
fi |
fi |
1309 |
if test -a "x$HAVE_NETCDF" != xt ; then |
if test "x$HAVE_NETCDF" != xt ; then |
1310 |
cat <<EOF |
cat <<EOF |
1311 |
|
|
1312 |
WARNING: the "mnc" package has been enabled but tests failed to |
WARNING: the "mnc" package has been enabled but tests failed to |
1590 |
# Fortran compiler |
# Fortran compiler |
1591 |
F90C = ${F90C} |
F90C = ${F90C} |
1592 |
# Link editor |
# Link editor |
1593 |
LINK = ${LINK} |
LINK = ${LINK} ${LDADD} |
1594 |
|
|
1595 |
# Defines for CPP |
# Defines for CPP |
1596 |
DEFINES = ${DEFINES} |
DEFINES = ${DEFINES} |