/[MITgcm]/MITgcm/tools/genmake2
ViewVC logotype

Diff of /MITgcm/tools/genmake2

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.31 by edhill, Wed Nov 12 21:14:57 2003 UTC revision 1.36 by edhill, Fri Nov 14 02:48:18 2003 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/sh
2  #  #
3  # $Header$  # $Header$
4  #  #
# Line 104  find_possible_configs()  { Line 104  find_possible_configs()  {
104          CPP="cpp -traditional -P"          CPP="cpp -traditional -P"
105      fi      fi
106    
107        # makedepend is not always available
108        if test "x${MAKEDEPEND}" = x ; then
109          which makedepend >& /dev/null
110          RETVAL=$?
111          if test "x${RETVAL}" = x1 ; then
112             echo "    makedepend was not found. Using xmakedpend instead."
113             MAKEDEPEND='$(TOOLSDIR)/xmakedepend'
114          fi
115        fi
116    
117      # look for possible fortran compilers      # look for possible fortran compilers
118      tmp="$MITGCM_FC $FC efc g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95"      tmp="$MITGCM_FC $FC efc g77 f77 pgf77 pgf95 ifc f90 f95 mpif77 mpf77 mpxlf95"
119      p_FC=      p_FC=
# Line 206  get_pdepend_list()  { Line 216  get_pdepend_list()  {
216      cat $1 | sed -e 's/#.*$//g' \      cat $1 | sed -e 's/#.*$//g' \
217          | $AWK 'BEGIN{nn=0;} (NF>0){ for(i=2;i<=NF;i++){nn++; print "PNAME["nn"]="$1"\nDNAME["nn"]="$i} }' \          | $AWK 'BEGIN{nn=0;} (NF>0){ for(i=2;i<=NF;i++){nn++; print "PNAME["nn"]="$1"\nDNAME["nn"]="$i} }' \
218          > ./.pd_tmp          > ./.pd_tmp
219      source ./.pd_tmp      . ./.pd_tmp
220      rm -f ./.pd_tmp      rm -f ./.pd_tmp
221    
222      echo -n "PNAME = "${}      echo -n "PNAME = "${}
# Line 338  EOF Line 348  EOF
348      fi      fi
349    
350      FC_NAMEMANGLE="#define FC_NAMEMANGLE(X)  $nmangle"      FC_NAMEMANGLE="#define FC_NAMEMANGLE(X)  $nmangle"
351    
352        #  cleanup the testing files
353        rm -f genmake_tcomp.* genmake_test.*
354  }  }
355    
356  #  Set defaults here  #  Set defaults here
# Line 437  echo "===  Processing options files and Line 450  echo "===  Processing options files and
450  gm_local="genmake_local"  gm_local="genmake_local"
451  for i in . $MODS ; do  for i in . $MODS ; do
452      if test -r $i/$gm_local ; then      if test -r $i/$gm_local ; then
453          source $i/$gm_local          . $i/$gm_local
454          break          break
455      fi      fi
456  done  done
457  echo -n "  getting local config information:  "  echo -n "  getting local config information:  "
458  if test -e $gm_local ; then  if test -e $gm_local ; then
459      echo "using $gm_local"      echo "using $gm_local"
460      source $gm_local      . $gm_local
461      # echo "DISABLE=$DISABLE"      # echo "DISABLE=$DISABLE"
462      # echo "ENABLE=$ENABLE"      # echo "ENABLE=$ENABLE"
463  else  else
# Line 648  fi Line 661  fi
661  if test "x$OPTFILE" != xNONE ; then  if test "x$OPTFILE" != xNONE ; then
662      if test -f "$OPTFILE" -a -r "$OPTFILE" ; then      if test -f "$OPTFILE" -a -r "$OPTFILE" ; then
663          echo "    using OPTFILE=\"$OPTFILE\""          echo "    using OPTFILE=\"$OPTFILE\""
664          source "$OPTFILE"          . "$OPTFILE"
665          RETVAL=$?          RETVAL=$?
666          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
667              echo -n "Error: failed to source OPTFILE \"$OPTFILE\""              echo -n "Error: failed to source OPTFILE \"$OPTFILE\""
# Line 675  fi Line 688  fi
688  if test "x${AD_OPTFILE}" != xNONE ; then  if test "x${AD_OPTFILE}" != xNONE ; then
689      if test -f "$AD_OPTFILE" -a -r "$AD_OPTFILE" ; then      if test -f "$AD_OPTFILE" -a -r "$AD_OPTFILE" ; then
690          echo "    using AD_OPTFILE=\"$AD_OPTFILE\""          echo "    using AD_OPTFILE=\"$AD_OPTFILE\""
691          source "$AD_OPTFILE"          . "$AD_OPTFILE"
692          RETVAL=$?          RETVAL=$?
693          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
694              echo -n "Error: failed to source AD_OPTFILE \"$AD_OPTFILE\""              echo -n "Error: failed to source AD_OPTFILE \"$AD_OPTFILE\""
# Line 691  if test "x${AD_OPTFILE}" != xNONE ; then Line 704  if test "x${AD_OPTFILE}" != xNONE ; then
704      fi      fi
705  fi  fi
706    
707  #  Check that FC, LINK, CPP, and S64 are defined.  If not, complain  #  Check that FC, LINK, CPP, S64, and LN are defined.  If not,
708  #  and abort!  #  complain and abort!
709  if test "x$FC" = x ; then  if test "x$FC" = x ; then
710      cat <<EOF 1>&2      cat <<EOF 1>&2
711    
# Line 728  fi Line 741  fi
741  if test "x$MAKEDEPEND" = x ; then  if test "x$MAKEDEPEND" = x ; then
742      MAKEDEPEND=makedepend      MAKEDEPEND=makedepend
743  fi  fi
744    if test "x$LN" = x ; then
745        LN="ln -s"
746    fi
747    echo "test" > genmake_test_ln
748    $LN genmake_test_ln genmake_tlink
749    RETVAL=$?
750    if test "x$RETVAL" != x0 ; then
751        cat <<EOF 1>&2
752    
753    Error: The command "ln -s" failed -- please specify a working soft-link
754      command in the optfile.
755    
756    EOF
757        exit 1
758    fi
759    rm -f genmake_test_ln genmake_tlink
760    
761  printf "\n===  Checking system libraries  ===\n"  printf "\n===  Checking system libraries  ===\n"
762  echo -n "  Do we have the system() command using $FC...  "  echo -n "  Do we have the system() command using $FC...  "
# Line 836  EXECUTABLE=${EXECUTABLE:-mitgcmuv} Line 864  EXECUTABLE=${EXECUTABLE:-mitgcmuv}
864  #  they appear as regular source code  #  they appear as regular source code
865  if test -r $ROOTDIR"/eesupp/src/Makefile" ; then  if test -r $ROOTDIR"/eesupp/src/Makefile" ; then
866      echo "  Making source files in eesupp from templates"      echo "  Making source files in eesupp from templates"
867      $MAKE -C $ROOTDIR"/eesupp/src/" > make_eesupp.errors 2>&1      ( cd $ROOTDIR"/eesupp/src/" && $MAKE ) > make_eesupp.errors 2>&1
868      RETVAL=$?      RETVAL=$?
869      if test "x${RETVAL}" = x0 ; then      if test "x${RETVAL}" = x0 ; then
870          rm -f make_eesupp.errors          rm -f make_eesupp.errors
# Line 873  if test ! "x${RETVAL}" = x0 ; then Line 901  if test ! "x${RETVAL}" = x0 ; then
901      echo "Error: unable to parse package dependencies -- please check PDEPEND=\"$PDEPEND\""      echo "Error: unable to parse package dependencies -- please check PDEPEND=\"$PDEPEND\""
902      exit 1      exit 1
903  fi  fi
904  source ./.pd_tmp  . ./.pd_tmp
905  rm -f ./.pd_tmp  rm -f ./.pd_tmp
906    
907  #  Search for default packages.  Note that a "$ROOTDIR/pkg/pkg_groups"  #  Search for default packages.  Note that a "$ROOTDIR/pkg/pkg_groups"

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.36

  ViewVC Help
Powered by ViewVC 1.1.22