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

Comparing trunk/OOPSE-4/ac-tools/OOPSE.m4 (file contents):
Revision 3385 by gezelter, Mon Feb 11 23:05:00 2008 UTC vs.
Revision 3386 by gezelter, Fri Apr 25 15:08:33 2008 UTC

# Line 355 | Line 355 | if test "$ac_test_CFLAGS" != "set"; then
355    case "${host_cpu}-${host_os}" in
356  
357    *linux*) if test "$CC" = icc; then
358 <                    CFLAGS="-O"
358 >                    CFLAGS="-O2"
359                  fi;;
360    sparc-solaris2*) if test "$CC" = cc; then
361                      CFLAGS="-O -dalign"
# Line 386 | Line 386 | if test "$ac_test_CFLAGS" != "set"; then
386                  echo "*******************************************************"
387          fi;;
388     *darwin*)
389 <        if test "$CC" = xlc -o "$CC" = cc; then
389 >        if test "$CC" = xlc; then
390                  CFLAGS="-qthreaded -O -qtune=auto -qarch=auto -qunroll=auto -qaltivec"
391          fi
392          if test "$CC" = icc; then
393 <                CFLAGS="-O3 -ip -no-prec-div -mdynamic-no-pic"
393 >                CFLAGS="-O2"
394 >        fi
395 >        if test $ac_cv_prog_really_gcc = yes; then
396 >                CFLAGS="-Os"
397          fi;;
398    esac
399  
400    # use default flags for gcc on all systems
401 <  if test $ac_cv_prog_really_gcc = yes; then
402 <     CFLAGS="-O6 -fomit-frame-pointer -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align"
400 <  fi
401 <
402 <  # test for gcc-specific flags:
403 <  if test $ac_cv_prog_really_gcc = yes; then
404 <    # -malign-double for x86 systems
405 <    ACX_CHECK_CC_FLAGS(-malign-double,align_double, CFLAGS="$CFLAGS -malign-double")
406 <    # -fstrict-aliasing for gcc-2.95+
407 <    ACX_CHECK_CC_FLAGS(-fstrict-aliasing,fstrict_aliasing, CFLAGS="$CFLAGS -fstrict-aliasing")
408 <  fi
409 <
410 <  CPU_FLAGS=""
411 <  if test $ac_cv_prog_really_gcc = yes; then
412 <          dnl try to guess correct CPU flags, at least for linux
413 <          case "${host_cpu}" in
414 <          i586*)  ACX_CHECK_CC_FLAGS(-mcpu=pentium,cpu_pentium,
415 <                        [CPU_FLAGS=-mcpu=pentium],
416 <                        [ACX_CHECK_CC_FLAGS(-mpentium,pentium,
417 <                                [CPU_FLAGS=-mpentium])])
418 <                  ;;
419 <          i686*)  ACX_CHECK_CC_FLAGS(-mcpu=pentiumpro,cpu_pentiumpro,
420 <                        [CPU_FLAGS=-mcpu=pentiumpro],
421 <                        [ACX_CHECK_CC_FLAGS(-mpentiumpro,pentiumpro,
422 <                                [CPU_FLAGS=-mpentiumpro])])
423 <                  ;;
424 <          powerpc*)
425 <                cputype=`(grep cpu /proc/cpuinfo | head -1 | cut -d: -f2 | sed 's/ //g') 2> /dev/null`
426 <                is60x=`echo $cputype | egrep "^60[0-9]e?$"`
427 <                if test -n "$is60x"; then
428 <                        ACX_CHECK_CC_FLAGS(-mcpu=$cputype,m_cpu_60x,
429 <                                CPU_FLAGS=-mcpu=$cputype)
430 <                elif test "$cputype" = 750; then
431 <                        ACX_PROG_GCC_VERSION(2,95,
432 <                                ACX_CHECK_CC_FLAGS(-mcpu=750,m_cpu_750,
433 <                                        CPU_FLAGS=-mcpu=750))
434 <                fi
435 <                if test -z "$CPU_FLAGS"; then
436 <                        ACX_CHECK_CC_FLAGS(-mcpu=powerpc,m_cpu_powerpc,
437 <                                CPU_FLAGS=-mcpu=powerpc)
438 <                fi
439 <                if test -z "$CPU_FLAGS"; then
440 <                        ACX_CHECK_CC_FLAGS(-mpowerpc,m_powerpc,
441 <                                CPU_FLAGS=-mpowerpc)
442 <                fi
443 <          esac
401 >  if test $ac_cv_prog_really_gcc = yes -a -z "$CFLAGS"; then
402 >     CFLAGS="-O2"
403    fi
404  
446  if test -n "$CPU_FLAGS"; then
447        CFLAGS="$CFLAGS $CPU_FLAGS"
448  fi
449
405    if test -z "$CFLAGS"; then
406          echo ""
407          echo "********************************************************"
408          echo "* WARNING: Don't know the best CFLAGS for this system  *"
409          echo "* Use  make CFLAGS=..., or edit the top level Makefile *"
410 <        echo "* (otherwise, a default of CFLAGS=-O3 will be used)    *"
410 >        echo "* (otherwise, a default of CFLAGS=-O will be used)     *"
411          echo "********************************************************"
412          echo ""
413 <        CFLAGS="-O3"
413 >        CFLAGS="-O"
414    fi
415  
416    ACX_CHECK_CC_FLAGS(${CFLAGS}, guessed_cflags, , [
# Line 486 | Line 441 | if test "$ac_test_CXXFLAGS" != "set"; then
441    case "${host_cpu}-${host_os}" in
442  
443    *linux*) if test "$CXX" = icc -o "$CXX" = icpc; then
444 <                    CXXFLAGS="-O"
444 >                    CXXFLAGS="-O2"
445                  fi;;
446    sparc-solaris2*) if test "$CXX" = CC; then
447                      CXXFLAGS="-features=extensions -O -dalign"
# Line 512 | Line 467 | if test "$ac_test_CXXFLAGS" != "set"; then
467                  CXXFLAGS="-qthreaded -O -qtune=auto -qarch=auto -qunroll=auto -qaltivec"
468          fi
469          if test "$CXX" = icpc; then
470 <                CXXFLAGS="-O3 -ip -no-prec-div -mdynamic-no-pic"
470 >                CXXFLAGS="-O2"
471 >        fi
472 >        if test $ac_cv_prog_really_gxx = yes; then
473 >                CXXFLAGS="-Os"
474          fi;;
475    esac
476  
477    # use default flags for gcc on all systems
478 <  if test $ac_cv_prog_really_gxx = yes; then
479 <     CXXFLAGS="-O6 -fomit-frame-pointer -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align"
522 <  fi
523 <
524 <  # test for gcc-specific flags:
525 <  if test $ac_cv_prog_really_gxx = yes; then
526 <    # -malign-double for x86 systems
527 <    ACX_CHECK_CXX_FLAGS(-malign-double,align_double, CXXFLAGS="$CXXFLAGS -malign-double")
528 <    # -fstrict-aliasing for gcc-2.95+
529 <    ACX_CHECK_CXX_FLAGS(-fstrict-aliasing,fstrict_aliasing, CXXFLAGS="$CXXFLAGS -fstrict-aliasing")
530 <  fi
531 <
532 <  CPU_FLAGS=""
533 <  if test $ac_cv_prog_really_gxx = yes; then
534 <          dnl try to guess correct CPU flags, at least for linux
535 <          case "${host_cpu}" in
536 <          i586*)  ACX_CHECK_CXX_FLAGS(-mcpu=pentium,cpu_pentium,
537 <                        [CPU_FLAGS=-mcpu=pentium],
538 <                        [ACX_CHECK_CXX_FLAGS(-mpentium,pentium,
539 <                                [CPU_FLAGS=-mpentium])])
540 <                  ;;
541 <          i686*)  ACX_CHECK_CXX_FLAGS(-mcpu=pentiumpro,cpu_pentiumpro,
542 <                        [CPU_FLAGS=-mcpu=pentiumpro],
543 <                        [ACX_CHECK_CXX_FLAGS(-mpentiumpro,pentiumpro,
544 <                                [CPU_FLAGS=-mpentiumpro])])
545 <                  ;;
546 <          powerpc*)
547 <                cputype=`(grep cpu /proc/cpuinfo | head -1 | cut -d: -f2 | sed 's/ //g') 2> /dev/null`
548 <                is60x=`echo $cputype | egrep "^60[0-9]e?$"`
549 <                if test -n "$is60x"; then
550 <                        ACX_CHECK_CXX_FLAGS(-mcpu=$cputype,m_cpu_60x,
551 <                                CPU_FLAGS=-mcpu=$cputype)
552 <                elif test "$cputype" = 750; then
553 <                        ACX_PROG_GXX_VERSION(2,95,
554 <                                ACX_CHECK_CXX_FLAGS(-mcpu=750,m_cpu_750,
555 <                                        CPU_FLAGS=-mcpu=750))
556 <                fi
557 <                if test -z "$CPU_FLAGS"; then
558 <                        ACX_CHECK_CXX_FLAGS(-mcpu=powerpc,m_cpu_powerpc,
559 <                                CPU_FLAGS=-mcpu=powerpc)
560 <                fi
561 <                if test -z "$CPU_FLAGS"; then
562 <                        ACX_CHECK_CXX_FLAGS(-mpowerpc,m_powerpc,
563 <                                CPU_FLAGS=-mpowerpc)
564 <                fi
565 <          esac
478 >  if test $ac_cv_prog_really_gxx = yes -a -z "$CXXFLAGS"; then
479 >     CXXFLAGS="-O2"
480    fi
481  
568  if test -n "$CPU_FLAGS"; then
569        CXXFLAGS="$CXXFLAGS $CPU_FLAGS"
570  fi
571
482    if test -z "$CXXFLAGS"; then
483          echo ""
484          echo "**********************************************************"
485          echo "* WARNING: Don't know the best CXXFLAGS for this system  *"
486          echo "* Use  make CXXFLAGS=..., or edit the top level Makefile *"
487 <        echo "* (otherwise, a default of CXXFLAGS=-O3 will be used)    *"
487 >        echo "* (otherwise, a default of CXXFLAGS=-O will be used)     *"
488          echo "**********************************************************"
489          echo ""
490 <        CXXFLAGS="-O3"
490 >        CXXFLAGS="-O"
491    fi
492  
493    ACX_CHECK_CXX_FLAGS(${CXXFLAGS}, guessed_cxxflags, , [
# Line 599 | Line 509 | AC_REQUIRE([AC_CANONICAL_HOST])
509   AC_REQUIRE([AC_PROG_FC])
510   AC_REQUIRE([AC_CANONICAL_HOST])
511  
512 +
513   # Try to determine "good" native compiler flags if none specified on command
514   # line
515  
# Line 607 | Line 518 | if test "$ac_test_FFLAGS" != "set"; then
518    case "${host_cpu}-${host_os}" in
519  
520    *linux*) if test "$FC" = ifc -o "$FC" = ifort; then
521 <                    FCFLAGS="-O3 -ip -no-prec-div"
521 >                    FCFLAGS="-O2"
522                  fi;;
523     rs6000*-aix*)  if test "$FC" = xlf90 -o "$FC" = f90 -o "$FC" = xlf95; then
524                      FCFLAGS="-O3 -qarch=pwrx -qtune=pwrx -qansialias -w"
# Line 630 | Line 541 | if test "$ac_test_FFLAGS" != "set"; then
541                  FCFLAGS="-qthreaded -O -qtune=auto -qarch=auto -qunroll=auto"
542          fi
543          if test "$FC" = ifort; then
544 <                FCFLAGS="-O3 -ip -no-prec-dev -mdynamic-no-pic"
544 >                FCFLAGS="-O2"
545 >        fi
546 >        if test "$FC" = gfortran; then
547 >                FCFLAGS="-Os"
548          fi;;
549    esac
550  
637  if test -n "$CPU_FLAGS"; then
638        FCFLAGS="$FCFLAGS $CPU_FLAGS"
639  fi
640
551    if test -z "$FCFLAGS"; then
552          echo ""
553          echo "*********************************************************"
554          echo "* WARNING: Don't know the best FCFLAGS for this system  *"
555          echo "* Use  make FCFLAGS=..., or edit the top level Makefile *"
556 <        echo "* (otherwise, a default of FCFLAGS=-O3 will be used)    *"
556 >        echo "* (otherwise, a default of FCFLAGS=-O will be used)     *"
557          echo "*********************************************************"
558          echo ""
559 <        FCFLAGS="-O3"
559 >        FCFLAGS="-O"
560    fi
561  
562    ACX_CHECK_FC_FLAGS(${FCFLAGS}, guessed_f90flags, , [

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines