ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/ac-tools/aclocal.m4
(Generate patch)

Comparing trunk/OOPSE/ac-tools/aclocal.m4 (file contents):
Revision 826 by gezelter, Mon Oct 27 23:00:59 2003 UTC vs.
Revision 942 by gezelter, Wed Jan 14 15:49:26 2004 UTC

# Line 7 | Line 7 | cat >conftest.f <<EOF
7   rm -f conftest*
8   # Intel ifc compiler generates files by the name of work.pc and work.pcl (!)
9   rm -f work*
10 < cat >conftest.f <<EOF
10 > cat >conftest.f90 <<EOF
11          module conftest
12          integer n
13          parameter (n=1)
# Line 16 | Line 16 | if $F90 -c conftest.f > conftest.out 2>&1 ; then
16   # SGI and absoft compilers generates module name in upper case!
17   testname="conftest"
18   modcase="lower"
19 < if $F90 -c conftest.f > conftest.out 2>&1 ; then
19 > if $F90 -c conftest.f90 > conftest.out 2>&1 ; then
20      MOD=`ls conftest* | grep -v conftest.f | grep -v conftest.o`
21      MOD=`echo "$MOD" | sed -e 's/conftest\.//g'`
22      if test -z "$MOD" ; then
# Line 58 | Line 58 | madedir=0
58   # a file, it must contain a the name of a file ending in .pc .  Ugh!
59   # Use the module made above
60   AC_MSG_CHECKING(for module directory path flag)
61 < madedir=0
62 < if test ! -d conf ; then mkdir conf ; madedir=1; fi
63 < cp $testname.$MOD conf
64 < rm -f conftest* CONFTEST*
65 < cat >conftest1.f <<EOF
61 > rm -f conftest*
62 > # Intel ifc compiler generates files by the name of work.pc and work.pcl (!)
63 > rm -f work*
64 > cat >conftest.f90 <<EOF
65 >        module conftest
66 >        integer n
67 >        parameter (n=1)
68 >        end module conftest
69 > EOF
70 > # SGI and absoft compilers generates module name in upper case!
71 > testname="conftest"
72 > if $F90 -c conftest.f90 > conftest.out 2>&1 ; then
73 >   mod=`ls CONFTEST* 2>/dev/null | grep -v CONFTEST.f | grep -v CONFTEST.o`
74 >   mod=`echo "$mod" | sed -e 's/CONFTEST\.//g'`
75 >   if test -n "$mod" ; then
76 >      testname="CONFTEST"
77 >   fi
78 >   madedir=0
79 >   if test ! -d conf ; then mkdir conf ; madedir=1; fi
80 >   cp $testname.$MOD conf
81 >   rm -f conftest* CONFTEST*
82 >   cat >conftest1.f90 <<EOF
83          program main
84          use conftest
85          print *, n
86          end
87   EOF
88 < F90_WORK_FILES_ARG=""
89 < F90MODINCSPEC=""
90 < if $F90 -c -Iconf conftest1.f > conftest.out 2>&1 ; then
91 <    MODDIRFLAG="-I"
92 <    F90MODINCSPEC="-I<dir>"
93 <    AC_MSG_RESULT(-I)
94 < elif $F90 -c -Mconf conftest1.f >> conftest.out 2>&1 ; then
95 <    MODDIRFLAG="-M"
96 <    F90MODINCSPEC="-M<dir>"
97 <    AC_MSG_RESULT(-M)
98 < elif $F90 -c -pconf conftest1.f >> conftest.out 2>&1 ; then
99 <    MODDIRFLAG="-p"
100 <    F90MODINCSPEC="-p<dir>"
101 <    AC_MSG_RESULT(-p)
102 < elif test -s work.pc ; then
103 <     cp work.pc conf/mpimod.pc
104 <     echo "mpimod.pc" > conf/mpimod.pcl
105 <     echo "`pwd`/conf/mpimod.pc" >> conf/mpimod.pcl
106 <     if $F90 -c -cl,conf/mpimod.pcl conftest1.f >>conftest.out 2>&1 ; then
107 <         MODDIRFLAG='-cl,mpimod.pcl'
108 <         AC_MSG_RESULT([-cl,filename where filename contains a list of files and
109 < directories])
110 <         F90_WORK_FILES_ARG="-cl,mpimod.pcl"
111 <         F90MODINCSPEC="-cl,<dir>/<file>mod.pcl"
112 <         AC_SUBST(F90_WORK_FILES_ARG)
113 <     else
114 <         # The version of the Intel compiler that I have refuses to let
115 <         # you put the "work catalog" list anywhere but the current directory.
99 <         # For example, you cannot in
88 >   F90_WORK_FILES_ARG=""
89 >   F90MODINCSPEC=""
90 >   if $F90 -c -Iconf conftest1.f90 > conftest.out 2>&1 ; then
91 >       MODDIRFLAG="-I"
92 >       F90MODINCSPEC="-I<dir>"
93 >       AC_MSG_RESULT(-I)
94 >   elif $F90 -c -Mconf conftest1.f90 >> conftest.out 2>&1 ; then
95 >       MODDIRFLAG="-M"
96 >       F90MODINCSPEC="-M<dir>"
97 >       AC_MSG_RESULT(-M)
98 >   elif $F90 -c -pconf conftest1.f90 >> conftest.out 2>&1 ; then
99 >       MODDIRFLAG="-p"
100 >       F90MODINCSPEC="-p<dir>"
101 >       AC_MSG_RESULT(-p)
102 >   elif test -s work.pc ; then
103 >        cp work.pc conf/mpimod.pc
104 >        echo "mpimod.pc" > conf/mpimod.pcl
105 >        echo "`pwd`/conf/mpimod.pc" >> conf/mpimod.pcl
106 >        if $F90 -c -cl,conf/mpimod.pcl conftest1.f >>conftest.out 2>&1 ; then
107 >            MODDIRFLAG='-cl,mpimod.pcl'
108 >            AC_MSG_RESULT([-cl,filename where filename contains a list of files and directories])
109 >            F90_WORK_FILES_ARG="-cl,mpimod.pcl"
110 >            F90MODINCSPEC="-cl,<dir>/<file>mod.pcl"
111 >            AC_SUBST(F90_WORK_FILES_ARG)
112 >        else
113 >            # The version of the Intel compiler that I have refuses to let
114 >            # you put the "work catalog" list anywhere but the current
115 >            # directory. For example, you cannot in
116           :
117 <     fi
118 < fi
119 < if test -z "MODDIRFLAG" ; then
120 <    AC_MSG_RESULT(unknown)
117 >        fi
118 >   fi
119 >   if test -z "MODDIRFLAG" ; then
120 >       AC_MSG_RESULT(unknown)
121 >   fi
122 >   AC_SUBST(MODDIRFLAG)
123 >   AC_SUBST(F90MODINCSPEC)
124 >   rm -f conftest* conf/conftest* conf/CONFTEST* CONFTEST* conf/mpimod*
125 >   if test $madedir = 1 ; then rmdir conf ; fi
126   fi
106 AC_SUBST(MODDIRFLAG)
107 AC_SUBST(F90MODINCSPEC)
108 rm -f conftest* conf/conftest* conf/CONFTEST* CONFTEST* conf/mpimod*
109 if test $madedir = 1 ; then rmdir conf ; fi
127  
128   ])
129  
# Line 154 | Line 171 | call MPI_Init(ierr)
171      AC_SUBST(MPIMODLIBNAME)
172    else
173      AC_MSG_RESULT(no)
174 <    AC_MSG_ERROR([Couldn't locate MPI F90 Modules])
174 >    AC_MSG_WARN([Couldn't locate MPI F90 Modules])
175    fi
176  
177   ])
# Line 282 | Line 299 | AC_DEFUN(ACX_CHECK_CC_FLAGS,
299   ])
300   dnl
301  
302 +
303   AC_DEFUN(ACX_CHECK_CC_FLAGS,
304   [
305   AC_REQUIRE([AC_PROG_CC])
# Line 362 | Line 380 | cat > conftest.c <<EOF
380   [
381   dnl The semicolon after "yes" below is to pacify NeXT's syntax-checking cpp.
382   cat > conftest.c <<EOF
383 < #ifdef __GNUC__
383 > #ifdef __GNUC__ && !defined (__INTEL_COMPILER)
384   #  if (__GNUC__ > $1) || (__GNUC__ == $1 && __GNUC_MINOR__ >= $2)
385       yes;
386   #  endif
# Line 383 | Line 401 | fi
401   fi
402   ])
403  
404 + AC_DEFUN(ACX_PROG_GXX_VERSION,
405 + [
406 + AC_REQUIRE([AC_PROG_CXX])
407 + AC_CACHE_CHECK(whether we are using g++ $1.$2 or later, ac_cv_prog_gxx_$1_$2,
408 + [
409 + dnl The semicolon after "yes" below is to pacify NeXT's syntax-checking cpp.
410 + cat > conftest.cpp <<EOF
411 + #ifdef __GNUC__ && !defined (__INTEL_COMPILER)
412 + #  if (__GNUC__ > $1) || (__GNUC__ == $1 && __GNUC_MINOR__ >= $2)
413 +     yes;
414 + #  endif
415 + #endif
416 + EOF
417 + if AC_TRY_COMMAND(${CXX-c++} -E conftest.cpp) | egrep yes >/dev/null 2>&1; then
418 +  ac_cv_prog_gxx_$1_$2=yes
419 + else
420 +  ac_cv_prog_gxx_$1_$2=no
421 + fi
422 + ])
423 + if test "$ac_cv_prog_gxx_$1_$2" = yes; then
424 +        :
425 +        $3
426 + else
427 +        :
428 +        $4
429 + fi
430 + ])
431  
432 + AC_DEFUN(ACX_PROG_REALLY_GCC,
433 + [
434 + AC_REQUIRE([AC_PROG_CC])
435 + AC_CACHE_CHECK(whether we are *really* using gcc, ac_cv_prog_really_gcc,
436 + [
437 + dnl The semicolon after "yes" below is to pacify NeXT's syntax-checking cpp.
438 + cat > conftest.c <<EOF
439 + #ifdef __GNUC__
440 +  #ifndef __INTEL_COMPILER
441 +     yes;
442 +  #endif
443 + #endif
444 + EOF
445 + if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then
446 +  ac_cv_prog_really_gcc=yes
447 + else
448 +  ac_cv_prog_really_gcc=no
449 + fi
450 + ])
451 + if test "$ac_cv_prog_really_gcc" = yes; then
452 +        :
453 +        $1
454 + else
455 +        :
456 +        $2
457 + fi
458 + ])
459 +
460 + AC_DEFUN(ACX_PROG_REALLY_GXX,
461 + [
462 + AC_REQUIRE([AC_PROG_CXX])
463 + AC_CACHE_CHECK(whether we are *really* using g++, ac_cv_prog_really_gxx,
464 + [
465 + dnl The semicolon after "yes" below is to pacify NeXT's syntax-checking cpp.
466 + cat > conftest.cpp <<EOF
467 + #ifdef __GNUC__
468 +  #ifndef __INTEL_COMPILER
469 +     yes;
470 +  #endif
471 + #endif
472 + EOF
473 + if AC_TRY_COMMAND(${CXX-c++} -E conftest.cpp) | egrep yes >/dev/null 2>&1; then
474 +  ac_cv_prog_really_gxx=yes
475 + else
476 +  ac_cv_prog_really_gxx=no
477 + fi
478 + ])
479 + if test "$ac_cv_prog_really_gxx" = yes; then
480 +        :
481 +        $1
482 + else
483 +        :
484 +        $2
485 + fi
486 + ])
487 +
488 +
489   AC_DEFUN(ACX_PROG_CC_MAXOPT,
490   [
491   AC_REQUIRE([AC_PROG_CC])
492   AC_REQUIRE([AC_CANONICAL_HOST])
493  
494 + ACX_PROG_REALLY_GCC
495 +
496   # Try to determine "good" native compiler flags if none specified on command
497   # line
498   if test "$ac_test_CFLAGS" != "set"; then
# Line 442 | Line 546 | if test "$ac_test_CFLAGS" != "set"; then
546    esac
547  
548    # use default flags for gcc on all systems
549 <  if test $ac_cv_prog_gcc = yes; then
549 >  if test $ac_cv_prog_really_gcc = yes; then
550       CFLAGS="-O6 -fomit-frame-pointer -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -pedantic"
551    fi
552  
553    # test for gcc-specific flags:
554 <  if test $ac_cv_prog_gcc = yes; then
554 >  if test $ac_cv_prog_really_gcc = yes; then
555      # -malign-double for x86 systems
556      ACX_CHECK_CC_FLAGS(-malign-double,align_double, CFLAGS="$CFLAGS -malign-double")
557      # -fstrict-aliasing for gcc-2.95+
# Line 455 | Line 559 | if test "$ac_test_CFLAGS" != "set"; then
559    fi
560  
561    CPU_FLAGS=""
562 <  if test "$GCC" = "yes"; then
562 >  if test $ac_cv_prog_really_gcc = yes; then
563            dnl try to guess correct CPU flags, at least for linux
564            case "${host_cpu}" in
565            i586*)  ACX_CHECK_CC_FLAGS(-mcpu=pentium,cpu_pentium,
# Line 524 | Line 628 | AC_REQUIRE([AC_CANONICAL_HOST])
628   AC_REQUIRE([AC_PROG_CXX])
629   AC_REQUIRE([AC_CANONICAL_HOST])
630  
631 + ACX_PROG_REALLY_GXX
632 +
633   # Try to determine "good" native compiler flags if none specified on command
634   # line
635   if test "$ac_test_CXXFLAGS" != "set"; then
# Line 568 | Line 674 | if test "$ac_test_CXXFLAGS" != "set"; then
674    esac
675  
676    # use default flags for gcc on all systems
677 <  if test $ac_cv_prog_gcc = yes; then
677 >  if test $ac_cv_prog_really_gxx = yes; then
678       CXXFLAGS="-O6 -fomit-frame-pointer -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -pedantic"
679    fi
680  
681    # test for gcc-specific flags:
682 <  if test $ac_cv_prog_gcc = yes; then
682 >  if test $ac_cv_prog_really_gxx = yes; then
683      # -malign-double for x86 systems
684      ACX_CHECK_CXX_FLAGS(-malign-double,align_double, CXXFLAGS="$CXXFLAGS -malign-double")
685      # -fstrict-aliasing for gcc-2.95+
# Line 581 | Line 687 | if test "$ac_test_CXXFLAGS" != "set"; then
687    fi
688  
689    CPU_FLAGS=""
690 <  if test "$GCC" = "yes"; then
690 >  if test $ac_cv_prog_really_gxx = yes; then
691            dnl try to guess correct CPU flags, at least for linux
692            case "${host_cpu}" in
693 <          i586*)  ACX_CHECK_CC_FLAGS(-mcpu=pentium,cpu_pentium,
693 >          i586*)  ACX_CHECK_CXX_FLAGS(-mcpu=pentium,cpu_pentium,
694                          [CPU_FLAGS=-mcpu=pentium],
695                          [ACX_CHECK_CXX_FLAGS(-mpentium,pentium,
696                                  [CPU_FLAGS=-mpentium])])
# Line 601 | Line 707 | if test "$ac_test_CXXFLAGS" != "set"; then
707                          ACX_CHECK_CXX_FLAGS(-mcpu=$cputype,m_cpu_60x,
708                                  CPU_FLAGS=-mcpu=$cputype)
709                  elif test "$cputype" = 750; then
710 <                        ACX_PROG_GCC_VERSION(2,95,
710 >                        ACX_PROG_GXX_VERSION(2,95,
711                                  ACX_CHECK_CXX_FLAGS(-mcpu=750,m_cpu_750,
712                                          CPU_FLAGS=-mcpu=750))
713                  fi
# Line 653 | Line 759 | if test x"$F90FLAGS" == x ; then
759   # Try to determine "good" native compiler flags if none specified on command
760   # line
761  
762 < if test x"$F90FLAGS" == x ; then
762 > if test x"$F90FLAGS" = x ; then
763    F90FLAGS=""
764    case "${host_cpu}-${host_os}" in
765  
766 <  *linux*) if test "$F90" = ifc; then
766 >  *linux*) if test "$F90" = ifc -o "$F90" = ifort; then
767                      F90FLAGS="-O"
768                  fi;;
769     rs6000*-aix*)  if test "$F90" = xlf90 -o "$F90" = f90; then
# Line 732 | Line 838 | if test "$ac_test_PREPFLAG" != "set"; then
838    PREPFLAG=""
839    case "${host_cpu}-${host_os}" in
840  
841 <  *linux*) if test "$F90" = ifc; then
841 >  *linux*) if test "$F90" = ifc -o "$F90" = ifort; then
842                      PREPFLAG="-fpp1 "
843                  fi;;
844    *aix*)  if test "$F90" = xlf90 -o "$F90" = f90; then
# Line 745 | Line 851 | if test "$ac_test_PREPFLAG" != "set"; then
851    esac
852  
853    if test -z "$PREPFLAG"; then
854 <        echo ""
749 <        echo "**********************************************************"
750 <        echo "* WARNING: Don't know the best PREPFLAG for this system  *"
751 <        echo "* Use  make PREPFLAG=..., or edit the top level Makefile *"
752 <        echo "* (otherwise, an empty PREPFLAG will be used)            *"
753 <        echo "**********************************************************"
754 <        echo ""
854 >        AC_MSG_WARN("Using empty PREPFLAG")
855          PREPFLAG=""
856    fi
857  
# Line 773 | Line 873 | if test "$ac_test_PREPFLAG" != "set"; then
873    ac_ext=$ac_save_ext
874    AC_LANG_RESTORE()
875  
776
876    if test "$prepflagworks" = 1; then
877      AC_MSG_RESULT(yes)
878      AC_SUBST(PREPFLAG)
# Line 797 | Line 896 | if test "$ac_test_PREPDEFFLAG" != "set"; then
896    PREPDEFFLAG=""
897    case "${host_cpu}-${host_os}" in
898  
899 <  *linux*) if test "$F90" = ifc; then
899 >  *linux*) if test "$F90" = ifc -o "$F90" = ifort; then
900                      PREPDEFFLAG=" "
901                  fi;;
902    *aix*)  if test "$F90" = xlf90 -o "$F90" = f90; then
# Line 810 | Line 909 | if test "$ac_test_PREPDEFFLAG" != "set"; then
909    esac
910  
911    if test -z "$PREPDEFFLAG"; then
912 <        echo ""
814 <        echo "*************************************************************"
815 <        echo "* WARNING: Don't know the best PREPDEFFLAG for this system  *"
816 <        echo "* Use  make PREPDEFFLAG=..., or edit the top level Makefile *"
817 <        echo "* (otherwise, an empty PREPDEFFLAG will be used)            *"
818 <        echo "*************************************************************"
819 <        echo ""
912 >        AC_MSG_WARN("Using empty PREPDEFFLAG")
913          PREPDEFFLAG=" "
914    fi
915  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines