comparison configure.in @ 7063:58102cc15ddf

[project @ 2007-10-24 20:35:19 by jwe]
author jwe
date Wed, 24 Oct 2007 20:35:20 +0000
parents 005c785b8d81
children 88417316c1b0
comparison
equal deleted inserted replaced
7062:1eb94c1da37d 7063:58102cc15ddf
27 27
28 EXTERN_CFLAGS="$CFLAGS" 28 EXTERN_CFLAGS="$CFLAGS"
29 EXTERN_CXXFLAGS="$CXXFLAGS" 29 EXTERN_CXXFLAGS="$CXXFLAGS"
30 30
31 AC_INIT 31 AC_INIT
32 AC_REVISION($Revision: 1.586 $) 32 AC_REVISION($Revision: 1.587 $)
33 AC_PREREQ(2.57) 33 AC_PREREQ(2.57)
34 AC_CONFIG_SRCDIR([src/octave.cc]) 34 AC_CONFIG_SRCDIR([src/octave.cc])
35 AC_CONFIG_HEADER(config.h) 35 AC_CONFIG_HEADER(config.h)
36 36
37 OCTAVE_HOST_TYPE 37 OCTAVE_HOST_TYPE
117 ### Make configure args available for other uses. 117 ### Make configure args available for other uses.
118 118
119 config_opts=$ac_configure_args 119 config_opts=$ac_configure_args
120 AC_SUBST(config_opts) 120 AC_SUBST(config_opts)
121 121
122 ### Allow the user to force us to use f2c.
123
124 AC_ARG_WITH(f2c,
125 [AS_HELP_STRING([--with-f2c],
126 [use f2c even if Fortran compiler is available])],
127 [if test "$withval" = no; then use_f2c=false; else use_f2c=true; fi],
128 use_f2c=false)
129
130 ### Allow the user to force us to use f77.
131
132 AC_ARG_WITH(f77,
133 [AS_HELP_STRING([--with-f77], [use f77 to compile Fortran subroutines])],
134 [if test "$withval" = no; then use_f77=false; else use_f77=true; fi],
135 use_f77=false)
136
137 ### Make sure only one of the above options for Fortran compilers was
138 ### specified (multiple "no" or --without-FOO options are ok).
139
140 OCTAVE_CHECK_EXCLUSIVE_WITH_OPTIONS(f77, f2c,
141 [warn_f2c_and_f77="--with-f2c and --with-f77 both specified! Using f77..."
142 AC_MSG_WARN($warn_f2c_and_f77)
143 use_f2c=false])
144
145 ### Make it possible to have Octave's array and matrix classes do bounds 122 ### Make it possible to have Octave's array and matrix classes do bounds
146 ### checking on element references. This slows some operations down a 123 ### checking on element references. This slows some operations down a
147 ### bit, so it is turned off by default. 124 ### bit, so it is turned off by default.
148 125
149 BOUNDS_CHECKING=false 126 BOUNDS_CHECKING=false
659 636
660 OCTAVE_IEEE754_DATA_FORMAT 637 OCTAVE_IEEE754_DATA_FORMAT
661 638
662 # ---------------------------------------------------------------------- 639 # ----------------------------------------------------------------------
663 640
664 ### We need these before trying to find libf2c.
665
666 OCTAVE_PROG_AR 641 OCTAVE_PROG_AR
667 642
668 AC_PROG_RANLIB 643 AC_PROG_RANLIB
669 644
670 ### If we haven't been forced to use a particular Fortran compiler, 645 ## Default FFLAGS is -O.
671 ### try to find one using any one of several common Un*x Fortran
672 ### compiler names using the AC_PROG_F77 macro.
673 ###
674 ### The configure options --with-f77 or --with-f2c
675 ### force f77 or f2c to be used. It is also possible to use
676 ### these options to specify the name of the compiler. For example,
677 ### `--with-f77=g77' says that we are using g77 as the Fortran compiler.
678
679 if $use_f77; then
680 if test "$with_f77" = yes; then
681 F77=f77
682 else
683 F77="$with_f77"
684 fi
685 AC_MSG_NOTICE([defining F77 to be $F77])
686 elif $use_f2c; then
687 F77=
688 if test "$with_f2c" = yes; then
689 F2C=f2c
690 else
691 F2C="$with_f2c"
692 fi
693 AC_MSG_NOTICE([defining F2C to be $F2C])
694 fi
695
696 if test "x$FFLAGS" = x; then 646 if test "x$FFLAGS" = x; then
697 FFLAGS="-O" # override -g -O default by AC_PROG_F77 647 FFLAGS="-O"
698 fi 648 fi
699 649
700 # the F77 variable, if set, overrides AC_PROG_F77 automatically 650 ## the F77 variable, if set, overrides AC_PROG_F77 automatically
701 AC_PROG_F77 651 AC_PROG_F77
702 652 AC_F77_LIBRARY_LDFLAGS
703 have_fortran_compiler=false 653 AC_F77_DUMMY_MAIN
704 have_f2c=false 654 AC_F77_WRAPPERS
705 655
706 F77_TOLOWER=true 656 F77_TOLOWER=true
707 F77_APPEND_UNDERSCORE=true 657 F77_APPEND_UNDERSCORE=true
708 F77_APPEND_EXTRA_UNDERSCORE=true 658 F77_APPEND_EXTRA_UNDERSCORE=true
709 if $use_f2c; then 659
710 have_f2c=true 660 case "$ac_cv_f77_mangling" in
711 else 661 "upper case") F77_TOLOWER=false ;;
712 if test -n "$F77"; then 662 esac
713 AC_F77_LIBRARY_LDFLAGS 663 case "$ac_cv_f77_mangling" in
714 AC_F77_DUMMY_MAIN 664 "no underscore") F77_APPEND_UNDERSCORE=false ;;
715 AC_F77_WRAPPERS 665 esac
716 case "$ac_cv_f77_mangling" in 666 case "$ac_cv_f77_mangling" in
717 "upper case") F77_TOLOWER=false ;; 667 "no extra underscore") F77_APPEND_EXTRA_UNDERSCORE=false ;;
718 esac 668 esac
719 case "$ac_cv_f77_mangling" in 669
720 "no underscore") F77_APPEND_UNDERSCORE=false ;; 670 case "$canonical_host_type" in
721 esac 671 i[[3456789]]86-*-*)
722 case "$ac_cv_f77_mangling" in 672 if test "$ac_cv_f77_compiler_gnu" = yes; then
723 "no extra underscore") F77_APPEND_EXTRA_UNDERSCORE=false ;; 673 OCTAVE_F77_FLAG(-mieee-fp)
724 esac 674 ### OCTAVE_F77_FLAG(-ffloat-store)
725 675 fi
726 case "$canonical_host_type" in 676 ;;
727 i[[3456789]]86-*-*) 677 alpha*-*-*)
728 if test "$ac_cv_f77_compiler_gnu" = yes; then 678 if test "$ac_cv_f77_compiler_gnu" = yes; then
729 OCTAVE_F77_FLAG(-mieee-fp) 679 OCTAVE_F77_FLAG(-mieee)
730 ### OCTAVE_F77_FLAG(-ffloat-store) 680 else
731 fi 681 OCTAVE_F77_FLAG(-ieee)
732 ;; 682 OCTAVE_F77_FLAG(-fpe1)
733 alpha*-*-*) 683 fi
734 if test "$ac_cv_f77_compiler_gnu" = yes; then 684 ;;
735 OCTAVE_F77_FLAG(-mieee) 685 powerpc-apple-machten*)
736 else 686 FFLAGS=
737 OCTAVE_F77_FLAG(-ieee) 687 ;;
738 OCTAVE_F77_FLAG(-fpe1) 688 esac
739 fi 689
740 ;; 690 if test -n "$FFLAGS"; then
741 powerpc-apple-machten*) 691 AC_MSG_NOTICE([defining FFLAGS to be $FFLAGS])
742 FFLAGS= 692 fi
743 ;; 693
744 esac
745 if test -n "$FFLAGS"; then
746 AC_MSG_NOTICE([defining FFLAGS to be $FFLAGS])
747 fi
748 have_fortran_compiler=true
749 else
750 AC_CHECK_PROG(F2C, f2c, f2c, [])
751 AC_ARG_VAR(F2C, [Fortran to C translator command])
752 AC_ARG_VAR(F2CFLAGS, [Fortran to C translator flags])
753 if test -n "$F2C"; then
754 have_f2c=true
755 fi
756 fi
757 fi
758 AC_SUBST(F77_TOLOWER) 694 AC_SUBST(F77_TOLOWER)
759 AC_SUBST(F77_APPEND_UNDERSCORE) 695 AC_SUBST(F77_APPEND_UNDERSCORE)
760 AC_SUBST(F77_APPEND_EXTRA_UNDERSCORE) 696 AC_SUBST(F77_APPEND_EXTRA_UNDERSCORE)
761 697
762 f77_rules_frag=/dev/null 698 if test -z "$F77"; then
763 if $have_fortran_compiler; then
764 f77_rules_frag=Makefrag.f77
765 cat << \EOF > $f77_rules_frag
766
767 %.c : %.f
768
769 %.o : %.f
770 $(FC) -c $(ALL_FFLAGS) -o $@ $<
771
772 pic/%.o : %.f
773 $(FC) -c $(FPICFLAG) $(ALL_FFLAGS) $< -o $@
774
775 EOF
776 elif $have_f2c; then
777 AC_DEFINE(HAVE_F2C, 1, [Define if we are using f2c.])
778
779 ### FIXME -- these shouldn't be fixed names, eh?
780
781 oct_conflib=libconflib.a
782 oct_obj_ext=o
783
784 CONFLIB_ARG=
785 if (eval "$ac_compile") 2>&AS_MESSAGE_LOG_FD; then
786 $AR $ARFLAGS $oct_conflib conftest.$oct_obj_ext 1>&AS_MESSAGE_LOG_FD()
787 if test -n "$RANLIB"; then
788 $RANLIB $oct_conflib 1>&AS_MESSAGE_LOG_FD()
789 fi
790 CONFLIB_ARG="-L. -lconflib"
791 fi
792 rm -f conftest*
793 case "$canonical_host_type" in
794 *-*-msdosmsvc)
795 CONFLIB_ARG="-MD"
796 ;;
797 esac
798 XLIBS="$LIBS"
799 LIBS="-lf2c $LIBS $CONFLIB_ARG"
800 AC_LINK_IFELSE([AC_LANG_CALL([int MAIN__ () { return 1; }], [f_open])],
801 [F2CLIBS=-lf2c], [F2CLIBS=])
802 LIBS="$XLIBS"
803 rm -f $oct_conflib
804
805 if test -z "$F2CLIBS"; then
806 AC_CHECK_LIB(F77, d_sin, F2CLIBS=-lF77, FLIBS=)
807 if test -n "$F2CLIBS"; then
808 AC_CHECK_LIB(I77, f_rew, F2CLIBS="$F2CLIBS -lI77", F2CLIBS=, -lF77)
809 fi
810 fi
811
812 if test -z "$F2CLIBS"; then
813 warn_f2c_no_lib="I found f2c but not libf2c.a, or libF77.a and libI77.a"
814 AC_MSG_WARN($warn_f2c_no_lib)
815 fi
816 f77_rules_frag=Makefrag.f77
817 cat << \EOF > $f77_rules_frag
818
819 %.c : %.f
820 $(F2C) $(F2CFLAGS) < $< > $(@F)
821
822 %.o : %.f
823
824 EOF
825 else
826 AC_MSG_WARN([in order to build octave, you must have a compatible]) 699 AC_MSG_WARN([in order to build octave, you must have a compatible])
827 AC_MSG_WARN([Fortran compiler or f2c installed and in your path.]) 700 AC_MSG_WARN([Fortran compiler or wrapper script for f2c that functions])
701 AC_MSG_WARN([as a Fortran compiler installed and in your path.])
828 AC_MSG_ERROR([See the file INSTALL for more information.]) 702 AC_MSG_ERROR([See the file INSTALL for more information.])
829 fi 703 fi
830 704
831 XTRA_CRUFT_SH_LDFLAGS= 705 XTRA_CRUFT_SH_LDFLAGS=
832 case "$canonical_host_type" in 706 case "$canonical_host_type" in
880 print *, retval 754 print *, retval
881 endif 755 endif
882 end 756 end
883 EOF 757 EOF
884 XLIBS="$LIBS" 758 XLIBS="$LIBS"
885 if $have_fortran_compiler; then 759 LIBS="$BLAS_LIBS $FLIBS $LIBS"
886 LIBS="$BLAS_LIBS $FLIBS $LIBS" 760 AC_LANG_PUSH(Fortran 77)
887 AC_LANG_PUSH(Fortran 77) 761 (eval "$ac_compile"; eval "$ac_link") 2>&AS_MESSAGE_LOG_FD
888 (eval "$ac_compile"; eval "$ac_link") 2>&AS_MESSAGE_LOG_FD 762 AC_LANG_POP(Fortran 77)
889 AC_LANG_POP(Fortran 77)
890 elif $have_f2c; then
891 LIBS="$BLAS_LIBS $F2CLIBS $LIBS"
892 AC_LANG_PUSH(C)
893 octave_xlate="$F2C $F2CFLAGS < conftest.f > conftest.c"
894 (eval "$octave_xlate")
895 (eval "$ac_compile"; eval "$ac_link") 2>&AS_MESSAGE_LOG_FD
896 AC_LANG_POP(C)
897 fi
898 LIBS="$XLIBS" 763 LIBS="$XLIBS"
899 case "`./conftest$ac_exeext`" in 764 case "`./conftest$ac_exeext`" in
900 *succeeded*) 765 *succeeded*)
901 AC_MSG_RESULT(yes) 766 AC_MSG_RESULT(yes)
902 ;; 767 ;;
2055 FORT="$F2C $F2CFLAGS" 1920 FORT="$F2C $F2CFLAGS"
2056 else 1921 else
2057 FORT="$F77 $FFLAGS" 1922 FORT="$F77 $FFLAGS"
2058 fi 1923 fi
2059 1924
2060 if $have_fortran_compiler; then
2061 true
2062 elif $have_f2c; then
2063 FLIBS="$F2CLIBS"
2064 fi
2065
2066 AC_MSG_NOTICE([ 1925 AC_MSG_NOTICE([
2067 1926
2068 Octave is now configured for $canonical_host_type 1927 Octave is now configured for $canonical_host_type
2069 1928
2070 Source directory: $srcdir 1929 Source directory: $srcdir
2109 AC_MSG_WARN([Are you sure that is what you want to do?]) 1968 AC_MSG_WARN([Are you sure that is what you want to do?])
2110 warn_msg_printed=true 1969 warn_msg_printed=true
2111 fi 1970 fi
2112 fi 1971 fi
2113 1972
2114 if test -n "$warn_f2c_and_f77"; then
2115 AC_MSG_WARN($warn_f2c_and_f77)
2116 warn_msg_printed=true
2117 fi
2118
2119 if test -n "$gxx_only"; then 1973 if test -n "$gxx_only"; then
2120 AC_MSG_WARN($gxx_only) 1974 AC_MSG_WARN($gxx_only)
2121 warn_msg_printed=true 1975 warn_msg_printed=true
2122 fi 1976 fi
2123 1977
2126 warn_msg_printed=true 1980 warn_msg_printed=true
2127 fi 1981 fi
2128 1982
2129 if test -n "$warn_gcc_only"; then 1983 if test -n "$warn_gcc_only"; then
2130 AC_MSG_WARN($warn_gcc_only) 1984 AC_MSG_WARN($warn_gcc_only)
2131 warn_msg_printed=true
2132 fi
2133
2134 if test -n "$warn_f2c_no_lib"; then
2135 AC_MSG_WARN($warn_f2c_no_lib)
2136 warn_msg_printed=true 1985 warn_msg_printed=true
2137 fi 1986 fi
2138 1987
2139 if test -n "$warn_readline"; then 1988 if test -n "$warn_readline"; then
2140 AC_MSG_WARN($warn_readline) 1989 AC_MSG_WARN($warn_readline)