comparison configure.ac @ 15338:dc39c1d84c5b

build: Use caching on more intermediate results to speed up configure. * configure.ac (CURLOPT_DIRLISTONLY, Magick::ColorRGB, OpenGL in FLTK): Use AC_CACHE_CHECK in code to cache intermediate results. * acinclude.m4 (OCTAVE_CHECK_LIB_TERMLIB): Switch TERM_LIB search algorithm to use AC_SERCH_LIBS which caches results.
author Rik <rik@octave.org>
date Sun, 09 Sep 2012 12:31:19 -0700
parents 719ffb2f35a6
children 95504932d422
comparison
equal deleted inserted replaced
15337:3f43e9d6d86e 15338:dc39c1d84c5b
838 LIBS="$Z_LDFLAGS $Z_LIBS $LIBS" 838 LIBS="$Z_LDFLAGS $Z_LIBS $LIBS"
839 OCTAVE_CHECK_LIB(curl, cURL, 839 OCTAVE_CHECK_LIB(curl, cURL,
840 [cURL library not found. The ftp objects, urlread and urlwrite functions will be disabled.], 840 [cURL library not found. The ftp objects, urlread and urlwrite functions will be disabled.],
841 [curl/curl.h], [curl_easy_escape]) 841 [curl/curl.h], [curl_easy_escape])
842 if test -z "$warn_curl"; then 842 if test -z "$warn_curl"; then
843 AC_MSG_CHECKING([for CURLOPT_DIRLISTONLY in curl/curl.h]) 843 ## Additional check on cURL library that was found
844 AC_COMPILE_IFELSE( 844 AC_CACHE_CHECK([for CURLOPT_DIRLISTONLY in curl/curl.h],
845 [AC_LANG_PROGRAM([[ 845 [octave_cv_header_define_curlopt_dirlistonly],
846 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
846 #include <curl/curl.h> 847 #include <curl/curl.h>
847 ]], [[ 848 ]], [[
848 curl_easy_setopt ((CURL*)NULL, CURLOPT_DIRLISTONLY, 0); 849 curl_easy_setopt ((CURL*)NULL, CURLOPT_DIRLISTONLY, 0);
849 ]])], 850 ]])],
850 [AC_MSG_RESULT(yes)], 851 [octave_cv_header_define_curlopt_dirlistonly=no],
851 [AC_MSG_RESULT(no) 852 [octave_cv_header_define_curlopt_dirlistonly=yes])
852 AC_DEFINE(CURLOPT_DIRLISTONLY, CURLOPT_FTPLISTONLY, 853 ])
853 [Define to the legacy option name if using an older version of cURL.])] 854 if test $octave_cv_header_define_curlopt_dirlistonly = "yes"; then
854 ) 855 AC_DEFINE(CURLOPT_DIRLISTONLY, CURLOPT_FTPLISTONLY,
856 [Define to the legacy option name if using an older version of cURL.])]
857 fi
855 fi 858 fi
856 LIBS="$save_LIBS" 859 LIBS="$save_LIBS"
857 CPPFLAGS="$save_CPPFLAGS" 860 CPPFLAGS="$save_CPPFLAGS"
858 861
859 ### Check for either of Graphics/ImageMagick++ libraries 862 ### Check for either of Graphics/ImageMagick++ libraries
884 save_CPPFLAGS="$CPPFLAGS" 887 save_CPPFLAGS="$CPPFLAGS"
885 save_LIBS="$LIBS" 888 save_LIBS="$LIBS"
886 CPPFLAGS="$MAGICK_CPPFLAGS $CPPFLAGS" 889 CPPFLAGS="$MAGICK_CPPFLAGS $CPPFLAGS"
887 LIBS="$MAGICK_LDFLAGS $MAGICK_LIBS $LIBS" 890 LIBS="$MAGICK_LDFLAGS $MAGICK_LIBS $LIBS"
888 AC_LANG_PUSH(C++) 891 AC_LANG_PUSH(C++)
889 AC_CHECK_HEADER([Magick++.h], [ 892 AC_CHECK_HEADER([Magick++.h], [
890 AC_MSG_CHECKING([for Magick::ColorRGB in Magick++.h]) 893 AC_CACHE_CHECK([for Magick::ColorRGB in Magick++.h],
891 AC_PREPROC_IFELSE( 894 [octave_cv_func_magick_colorrgb],
892 [AC_LANG_SOURCE([[ 895 [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
893 #include <Magick++.h> 896 #include <Magick++.h>
894 ]], [[ 897 ]], [[
895 Magick::ColorRGB c; 898 Magick::ColorRGB c;
896 ]])], 899 ]])],
897 [AC_MSG_RESULT([yes]) 900 octave_cv_func_magick_colorrgb=yes,
898 warn_magick=], 901 octave_cv_func_magick_colorrgb=no)
899 [AC_MSG_RESULT([no])] 902 ])
900 ) 903 if test $octave_cv_func_magick_colorrgb = yes; then
901 ]) 904 warn_magick=
905 fi
906 ])
902 AC_LANG_POP(C++) 907 AC_LANG_POP(C++)
903 CPPFLAGS="$save_CPPFLAGS" 908 CPPFLAGS="$save_CPPFLAGS"
904 LIBS="$save_LIBS" 909 LIBS="$save_LIBS"
905 ]) 910 ])
906 911
948 AC_SUBST(CARBON_LIBS) 953 AC_SUBST(CARBON_LIBS)
949 fi 954 fi
950 955
951 ### Check for list of libraries needed for native graphics renderer. 956 ### Check for list of libraries needed for native graphics renderer.
952 957
958 native_graphics=true
953 warn_freetype="" 959 warn_freetype=""
954 native_graphics=true
955 960
956 check_opengl=false 961 check_opengl=false
957 AC_ARG_WITH([opengl], 962 AC_ARG_WITH([opengl],
958 [AS_HELP_STRING([--without-opengl], 963 [AS_HELP_STRING([--without-opengl],
959 [don't use OpenGL libraries, disable native graphics])], 964 [don't use OpenGL libraries, disable native graphics])],
960 [if test "x$withval" = xno; then 965 [if test "x$withval" = xno; then
966 native_graphics=false
961 warn_opengl="--without-opengl specified. Native graphics will be disabled." 967 warn_opengl="--without-opengl specified. Native graphics will be disabled."
962 OCTAVE_CONFIGURE_WARNING([warn_opengl]) 968 OCTAVE_CONFIGURE_WARNING([warn_opengl])
963 native_graphics=false
964 else 969 else
965 check_opengl=true 970 check_opengl=true
966 fi], 971 fi],
967 [check_opengl=true]) 972 [check_opengl=true])
968 973
974 GRAPHICS_LIBS= 979 GRAPHICS_LIBS=
975 GRAPHICS_CFLAGS= 980 GRAPHICS_CFLAGS=
976 981
977 if test -z "$OPENGL_LIBS"; then 982 if test -z "$OPENGL_LIBS"; then
978 if $check_opengl; then 983 if $check_opengl; then
984 native_graphics=false
979 warn_fltk_opengl="OpenGL libs (GL and GLU) not found. Native graphics will be disabled." 985 warn_fltk_opengl="OpenGL libs (GL and GLU) not found. Native graphics will be disabled."
980 OCTAVE_CONFIGURE_WARNING([warn_fltk_opengl]) 986 OCTAVE_CONFIGURE_WARNING([warn_fltk_opengl])
981 native_graphics=false
982 fi 987 fi
983 fi 988 fi
984 989
985 if test -n "$OPENGL_LIBS"; then 990 if test -n "$OPENGL_LIBS"; then
986 AC_DEFINE(HAVE_OPENGL, 1, [Define to 1 if OpenGL is available.]) 991 AC_DEFINE(HAVE_OPENGL, 1, [Define to 1 if OpenGL is available.])
1009 [have_fontconfig=no 1014 [have_fontconfig=no
1010 warn_fontconfig="Fontconfig library not found. Native graphics will be disabled."]) 1015 warn_fontconfig="Fontconfig library not found. Native graphics will be disabled."])
1011 fi 1016 fi
1012 1017
1013 if test -n "$warn_fontconfig"; then 1018 if test -n "$warn_fontconfig"; then
1019 native_graphics=false
1014 OCTAVE_CONFIGURE_WARNING([warn_fontconfig]) 1020 OCTAVE_CONFIGURE_WARNING([warn_fontconfig])
1015 native_graphics=false
1016 fi 1021 fi
1017 1022
1018 ## Check for FLTK (www.fltk.org) library 1023 ## Check for FLTK (www.fltk.org) library
1019 1024
1020 AC_ARG_WITH([fltk-prefix], [ 1025 AC_ARG_WITH([fltk-prefix], [
1047 1052
1048 warn_fltk_config="" 1053 warn_fltk_config=""
1049 warn_fltk_opengl="" 1054 warn_fltk_opengl=""
1050 1055
1051 if test "$FLTK_CONFIG" = "no" ; then 1056 if test "$FLTK_CONFIG" = "no" ; then
1057 native_graphics=false
1052 warn_fltk_config="FLTK config script not found. Native graphics will be disabled." 1058 warn_fltk_config="FLTK config script not found. Native graphics will be disabled."
1053 OCTAVE_CONFIGURE_WARNING([warn_fltk_config]) 1059 OCTAVE_CONFIGURE_WARNING([warn_fltk_config])
1054 native_graphics=false
1055 else 1060 else
1056 FLTK_CFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --cflags`" 1061 FLTK_CFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --cflags`"
1057 FLTK_LDFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --ldflags`" 1062 FLTK_LDFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --ldflags`"
1058 1063
1059 case "$canonical_host_type" in 1064 case "$canonical_host_type" in
1060 *-*-mingw*) 1065 *-*-mingw*)
1061 FLTK_LDFLAGS="`echo $FLTK_LDFLAGS | sed -e 's/-mwindows//g'`" 1066 FLTK_LDFLAGS="`echo $FLTK_LDFLAGS | sed -e 's/-mwindows//g'`"
1062 ;; 1067 ;;
1063 esac 1068 esac
1064 1069
1065 AC_MSG_CHECKING([for OpenGL support in FLTK]) 1070 AC_CACHE_CHECK([for OpenGL support in FLTK],
1066 save_CFLAGS="$CFLAGS" 1071 [octave_cv_fltk_opengl_support],
1067 CFLAGS="$CFLAGS $FLTK_CFLAGS" 1072 [save_CFLAGS="$CFLAGS"
1068 AC_COMPILE_IFELSE( 1073 CFLAGS="$CFLAGS $FLTK_CFLAGS"
1069 [AC_LANG_PROGRAM([[#include <FL/gl.h>]], [[int nothing = 0;]])], 1074 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1070 [AC_MSG_RESULT([no]) 1075 #include <FL/gl.h>
1071 warn_fltk_opengl="FLTK does not have OpenGL support. Native graphics will be disabled."], 1076 ]], [[
1072 [AC_MSG_RESULT([yes]) 1077 int nothing = 0;
1073 AC_DEFINE(HAVE_FLTK, 1, [Define to 1 if FLTK is available.])]) 1078 ]])],
1074 1079 octave_cv_fltk_opengl_support=no,
1080 octave_cv_fltk_opengl_support=yes)
1081 CFLAGS="$save_CFLAGS"
1082 ])
1083 if test $octave_cv_fltk_opengl_support = no; then
1084 warn_fltk_opengl="FLTK does not have OpenGL support. Native graphics will be disabled."
1085 else
1086 AC_DEFINE(HAVE_FLTK, 1, [Define to 1 if FLTK is available.])
1087 fi
1088
1075 if test -z "$warn_fltk_opengl"; then 1089 if test -z "$warn_fltk_opengl"; then
1076 GRAPHICS_CFLAGS="$FLTK_CFLAGS" 1090 GRAPHICS_CFLAGS="$FLTK_CFLAGS"
1077 GRAPHICS_LIBS="$FLTK_LDFLAGS" 1091 GRAPHICS_LIBS="$FLTK_LDFLAGS"
1078 else 1092 else
1093 native_graphics=false
1079 OCTAVE_CONFIGURE_WARNING([warn_fltk_opengl]) 1094 OCTAVE_CONFIGURE_WARNING([warn_fltk_opengl])
1080 native_graphics=false
1081 fi 1095 fi
1082 CFLAGS="$save_CFLAGS"
1083 fi 1096 fi
1084 fi 1097 fi
1085 1098
1086 AC_SUBST(GRAPHICS_CFLAGS) 1099 AC_SUBST(GRAPHICS_CFLAGS)
1087 AC_SUBST(GRAPHICS_LIBS) 1100 AC_SUBST(GRAPHICS_LIBS)