/[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.128 by edhill, Mon Sep 5 13:39:28 2005 UTC revision 1.132 by cnh, Fri Sep 16 00:50:49 2005 UTC
# Line 671  EOF Line 671  EOF
671      RET_C=$?      RET_C=$?
672      cat <<EOF > genmake_tc_2.$FS      cat <<EOF > genmake_tc_2.$FS
673        program hello        program hello
674        Real*8 wtime        REAL*8 wtime
675        external cloc        external cloc
676        call cloc(wtime)        call cloc(wtime)
677        print *," HELLO WORLD", wtime        print *," HELLO WORLD", wtime
# Line 689  EOF Line 689  EOF
689  }  }
690    
691    
692    check_HAVE_SETRLSTK()  {
693        get_fortran_c_namemangling
694        cat <<EOF > genmake_tc_1.c
695    $FC_NAMEMANGLE
696    #include <sys/time.h>
697    #include <sys/resource.h>
698    #include <unistd.h>
699    void FC_NAMEMANGLE(setrlstk) ()
700    {
701        struct rlimit rls;
702        rls.rlim_cur = RLIM_INFINITY;
703        rls.rlim_max = RLIM_INFINITY;
704        setrlimit(RLIMIT_STACK, &rls);
705        return;
706    }
707    EOF
708        make genmake_tc_1.o >> genmake_warnings 2>&1
709        RET_C=$?
710        cat <<EOF > genmake_tc_2.$FS
711          program hello
712          external setrlstk
713          call setrlstk()
714          end
715    EOF
716        $FC $FFLAGS -o genmake_tc genmake_tc_2.$FS genmake_tc_1.o >> genmake_warnings 2>&1
717        RET_F=$?
718        test -x ./genmake_tc  &&  ./genmake_tc >> genmake_warnings 2>&1
719        RETVAL=$?
720        if test "x$RETVAL" = x0 ; then
721            HAVE_SETRLSTK=t
722            DEFINES="$DEFINES -DHAVE_SETRLSTK"
723        fi
724        rm -f genmake_tc*
725    }
726    
727    
728  check_HAVE_STAT()  {  check_HAVE_STAT()  {
729      get_fortran_c_namemangling      get_fortran_c_namemangling
730      cat <<EOF > genmake_tc_1.c      cat <<EOF > genmake_tc_1.c
# Line 838  NOOPTFLAGS= Line 874  NOOPTFLAGS=
874  MPI=  MPI=
875  MPIPATH=  MPIPATH=
876  TS=  TS=
877    HAVE_TEST_L=
878    
879  # DEFINES checked by test compilation or command-line  # DEFINES checked by test compilation or command-line
880  HAVE_SYSTEM=  HAVE_SYSTEM=
881  HAVE_FDATE=  HAVE_FDATE=
882  FC_NAMEMANGLE=  FC_NAMEMANGLE=
883  HAVE_CLOC=  HAVE_CLOC=
884    HAVE_SETRLSTK=
885  HAVE_STAT=  HAVE_STAT=
886  HAVE_NETCDF=  HAVE_NETCDF=
887  HAVE_ETIME=  HAVE_ETIME=
# Line 1301  Error: The command "ln -s" failed -- ple Line 1339  Error: The command "ln -s" failed -- ple
1339  EOF  EOF
1340      exit 1      exit 1
1341  fi  fi
1342    test -L genmake_tlink > /dev/null 2>&1
1343    RETVAL=$?
1344    if test "x$RETVAL" = x0 ; then
1345        HAVE_TEST_L=t
1346    fi
1347  rm -f genmake_test_ln genmake_tlink  rm -f genmake_test_ln genmake_tlink
1348    
1349  #  Check for broken *.F/*.f handling and fix if possible  #  Check for broken *.F/*.f handling and fix if possible
# Line 1338  rm -f genmake_tcomp* Line 1381  rm -f genmake_tcomp*
1381  printf "  Do we have the fdate() command using $FC...  "  printf "  Do we have the fdate() command using $FC...  "
1382  cat > genmake_tcomp.$FS <<EOF  cat > genmake_tcomp.$FS <<EOF
1383        program hello        program hello
1384        CHARACTER(128) string        CHARACTER*(128) string
1385        string = ' '        string = ' '
1386        call fdate( string )        call fdate( string )
1387        print *, string        print *, string
# Line 1387  else Line 1430  else
1430  fi  fi
1431  rm -f genmake_t*  rm -f genmake_t*
1432    
1433    printf "  Can we unlimit the stack size using $FC...  "
1434    check_HAVE_SETRLSTK
1435    if test "x$HAVE_SETRLSTK" != x ; then
1436        echo "yes"
1437    else
1438        echo "no"
1439    fi
1440    rm -f genmake_t*
1441    
1442  printf "  Can we use stat() through C calls...  "  printf "  Can we use stat() through C calls...  "
1443  check_HAVE_STAT  check_HAVE_STAT
1444  if test "x$HAVE_STAT" != x ; then  if test "x$HAVE_STAT" != x ; then
# Line 1874  for d in $alldirs ; do Line 1926  for d in $alldirs ; do
1926      for sf in $sfiles ; do      for sf in $sfiles ; do
1927          if test ! -r ".links.tmp/$sf" ; then          if test ! -r ".links.tmp/$sf" ; then
1928              if test -f "$d/$sf" ; then              if test -f "$d/$sf" ; then
1929                    ignore_f=f
1930                  case $d/$sf in                  case $d/$sf in
1931                    ./$PACKAGES_DOT_H)                    ./$PACKAGES_DOT_H)
1932                          ;;                          ;;
# Line 1884  for d in $alldirs ; do Line 1937  for d in $alldirs ; do
1937                    ./BUILD_INFO.h)                    ./BUILD_INFO.h)
1938                          ;;                          ;;
1939                    *)                    *)
1940                          touch .links.tmp/$sf                          #  For the local directory *ONLY*,
1941                          deplist="$deplist $sf"                          #  ignore all soft-links
1942                            if test "x$HAVE_TEST_L" = xt -a "x$d" = x. -a -L $sf ; then
1943                                ignore_f=t
1944                            else
1945                                touch .links.tmp/$sf
1946                                deplist="$deplist $sf"
1947                            fi
1948                          ;;                          ;;
1949                  esac                  esac
1950                  extn=`echo $sf | $AWK -F. '{print $NF}'`                  if test "x$ignore_f" = xf ; then
1951                  case $extn in                      extn=`echo $sf | $AWK -F. '{print $NF}'`
1952                      F)                      case $extn in
1953                          echo    " \\"  >> srclist.inc                          F)
1954                          printf " $sf" >> srclist.inc                              echo    " \\"  >> srclist.inc
1955                          ;;                              printf " $sf" >> srclist.inc
1956                      F90)                              ;;
1957                          echo    " \\"  >> f90srclist.inc                          F90)
1958                          printf " $sf" >> f90srclist.inc                              echo    " \\"  >> f90srclist.inc
1959                          ;;                              printf " $sf" >> f90srclist.inc
1960                      c)                              ;;
1961                          echo    " \\"  >> csrclist.inc                          c)
1962                          printf " $sf" >> csrclist.inc                              echo    " \\"  >> csrclist.inc
1963                          ;;                              printf " $sf" >> csrclist.inc
1964                      h)                              ;;
1965                          echo    " \\"  >> hlist.inc                          h)
1966                          printf " $sf" >> hlist.inc                              echo    " \\"  >> hlist.inc
1967                          ;;                              printf " $sf" >> hlist.inc
1968                      flow)                              ;;
1969                          echo    " \\"  >> ad_flow_files.inc                          flow)
1970                          printf " $sf" >> ad_flow_files.inc                              echo    " \\"  >> ad_flow_files.inc
1971                          ;;                              printf " $sf" >> ad_flow_files.inc
1972                  esac                              ;;
1973                        esac
1974                    fi
1975              fi              fi
1976          fi          fi
1977      done      done
# Line 2061  depend: Line 2122  depend:
2122          \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE)          \$(TOOLSDIR)/f90mkdepend >> \$(MAKEFILE)
2123          -rm -f makedepend.out          -rm -f makedepend.out
2124    
2125    lib: libmitgcmuv.a
2126    
2127    libmitgcmuv.a: \$(OBJFILES)
2128            ar rcv libmitgcmuv.a \$(OBJFILES)
2129    
2130  links: \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) \$(SPECIAL_FILES)  links: \$(SRCFILES) \$(CSRCFILES) \$(HEADERFILES) \$(F90SRCFILES) \$(SPECIAL_FILES)
2131    
2132  small_f: \$(F77FILES) \$(F90FILES)  small_f: \$(F77FILES) \$(F90FILES)

Legend:
Removed from v.1.128  
changed lines
  Added in v.1.132

  ViewVC Help
Powered by ViewVC 1.1.22