--- MITgcm/tools/genmake2 2004/01/15 19:19:59 1.62 +++ MITgcm/tools/genmake2 2004/02/16 16:24:41 1.65 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/genmake2,v 1.62 2004/01/15 19:19:59 edhill Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/genmake2,v 1.65 2004/02/16 16:24:41 cnh Exp $ # # Makefile generator for MITgcm UV codes # created by cnh 03/98 @@ -834,12 +834,21 @@ if test "x$LINK" = x ; then LINK=$FC fi -if test "x$CPP" = x ; then - CPP="cpp" -fi if test "x$MAKE" = x ; then MAKE="make" fi +if test "x$CPP" = x ; then + CPP=cpp +fi +#EH3 === UGLY === +# The following an ugly little hack to check for $CPP in /lib/ and it +# should eventually be replaced with a more general function that +# searches a combo of the user's path and a list of "usual suspects" +# to find the correct location for binaries such as $CPP. +for i in " " "/lib/" ; do + echo "#define A a" | $i$CPP > test_cpp 2>&1 && CPP=$i$CPP +done +#EH3 === UGLY === echo "#define A a" | $CPP > test_cpp 2>&1 RETVAL=$? if test "x$RETVAL" != x0 ; then @@ -973,7 +982,7 @@ TOOLSDIR="$ROOTDIR/tools" fi if test ! -d ${TOOLSDIR} ; then - echo "Error: the specified $TOOLSDIR (\"$TOOLSDIR\") does not exist!" + echo "Error: the specified TOOLSDIR (\"$TOOLSDIR\") does not exist!" exit 1 fi if test "x$S64" = x ; then @@ -1209,7 +1218,7 @@ cat make_mnc.errors 1>&2 exit 1 fi - if test -a "x$HAVE_NETCDF" != xt ; then + if test "x$HAVE_NETCDF" != xt ; then cat <