comparison configure.ac @ 14605:28e53daab1f8

Cleanup on autoconf warnings * acinclude.m4 (OCTAVE_CONFIGURE_WARNING, OCTAVE_CONFIGURE_WARNING_SUMMARY): New macros * configure.ac: Use these new macros. Remove copy-pasted code.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Mon, 07 May 2012 08:52:17 -0400
parents 4dc85c4f151b
children c2ca3b71cd7c 4e9dc46d4125 82429f3c1005
comparison
equal deleted inserted replaced
14604:de72463862c4 14605:28e53daab1f8
191 AC_ARG_ENABLE(docs, 191 AC_ARG_ENABLE(docs,
192 [AS_HELP_STRING([--enable-docs], [build documentation (default is yes)])], 192 [AS_HELP_STRING([--enable-docs], [build documentation (default is yes)])],
193 [if test "$enableval" = no; then 193 [if test "$enableval" = no; then
194 DOCDIR= 194 DOCDIR=
195 warn_docs="building documentation disabled; make dist will fail" 195 warn_docs="building documentation disabled; make dist will fail"
196 AC_MSG_WARN([$warn_docs]) 196 OCTAVE_CONFIGURE_WARNING([warn_docs])
197 fi], []) 197 fi], [])
198 AC_SUBST(DOCDIR) 198 AC_SUBST(DOCDIR)
199 199
200 ### If possible, use a 64-bit integer type for array dimensions and indexing. 200 ### If possible, use a 64-bit integer type for array dimensions and indexing.
201 201
215 elif test $ac_cv_sizeof_long -eq 8; then 215 elif test $ac_cv_sizeof_long -eq 8; then
216 OCTAVE_IDX_TYPE=long 216 OCTAVE_IDX_TYPE=long
217 AC_DEFINE(IDX_TYPE_LONG, 1, [Define to 1 if octave index type is long]) 217 AC_DEFINE(IDX_TYPE_LONG, 1, [Define to 1 if octave index type is long])
218 else 218 else
219 warn_64_bit="no suitable type found for octave_idx_type so disabling 64-bit features" 219 warn_64_bit="no suitable type found for octave_idx_type so disabling 64-bit features"
220 AC_MSG_WARN([$warn_64_bit]) 220 OCTAVE_CONFIGURE_WARNING([warn_64_bit])
221 USE_64_BIT_IDX_T=false 221 USE_64_BIT_IDX_T=false
222 fi 222 fi
223 else 223 else
224 warn_64_bit="pointers are not 64-bits wide so disabling 64-bit features" 224 warn_64_bit="pointers are not 64-bits wide so disabling 64-bit features"
225 AC_MSG_WARN([$warn_64_bit]) 225 OCTAVE_CONFIGURE_WARNING([warn_64_bit])
226 USE_64_BIT_IDX_T=false 226 USE_64_BIT_IDX_T=false
227 fi 227 fi
228 fi 228 fi
229 AC_SUBST(OCTAVE_IDX_TYPE) 229 AC_SUBST(OCTAVE_IDX_TYPE)
230 AC_DEFINE_UNQUOTED(OCTAVE_IDX_TYPE, $OCTAVE_IDX_TYPE, 230 AC_DEFINE_UNQUOTED(OCTAVE_IDX_TYPE, $OCTAVE_IDX_TYPE,
284 gcc_version=`$CC -v 2>&1 | grep "^.*gcc version" | \ 284 gcc_version=`$CC -v 2>&1 | grep "^.*gcc version" | \
285 sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//'` 285 sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//'`
286 case "$gcc_version" in 286 case "$gcc_version" in
287 [12].*) 287 [12].*)
288 warn_gcc_version="gcc version $gcc_version is likely to cause problems" 288 warn_gcc_version="gcc version $gcc_version is likely to cause problems"
289 AC_MSG_WARN([$warn_gcc_version]) 289 OCTAVE_CONFIGURE_WARNING([warn_gcc_version])
290 ;; 290 ;;
291 esac 291 esac
292 292
293 CC_VERSION= 293 CC_VERSION=
294 if test -n "$gcc_version"; then 294 if test -n "$gcc_version"; then
832 # --------------------------------------------------------------------- 832 # ---------------------------------------------------------------------
833 833
834 ## libraries needed for native graphics renderer 834 ## libraries needed for native graphics renderer
835 835
836 warn_freetype="" 836 warn_freetype=""
837 native_graphics=true
837 838
838 check_opengl=false 839 check_opengl=false
839 AC_ARG_WITH([opengl], 840 AC_ARG_WITH([opengl],
840 [AS_HELP_STRING([--without-opengl], [don't use OpenGL libraries, disable native graphics])], 841 [AS_HELP_STRING([--without-opengl], [don't use OpenGL libraries, disable native graphics])],
841 [if test "x$withval" = xno; then 842 [if test "x$withval" = xno; then
842 warn_opengl="--without-opengl specified. Native graphics will be disabled." 843 warn_opengl="--without-opengl specified. Native graphics will be disabled."
843 AC_MSG_WARN([$warn_opengl]) 844 OCTAVE_CONFIGURE_WARNING([warn_opengl])
845 native_graphics=false
844 else 846 else
845 check_opengl=true 847 check_opengl=true
846 fi], 848 fi],
847 [check_opengl=true]) 849 [check_opengl=true])
848 850
854 GRAPHICS_CFLAGS= 856 GRAPHICS_CFLAGS=
855 857
856 if test -z "$OPENGL_LIBS"; then 858 if test -z "$OPENGL_LIBS"; then
857 if $check_opengl; then 859 if $check_opengl; then
858 warn_fltk_opengl="OpenGL libs (GL and GLU) not found. Native graphics will be disabled." 860 warn_fltk_opengl="OpenGL libs (GL and GLU) not found. Native graphics will be disabled."
861 OCTAVE_CONFIGURE_WARNING([warn_fltk_opengl])
862 native_graphics=false
859 fi 863 fi
860 fi 864 fi
861 865
862 if test -n "$OPENGL_LIBS"; then 866 if test -n "$OPENGL_LIBS"; then
863 AC_DEFINE(HAVE_OPENGL, 1, [Define if OpenGL is available]) 867 AC_DEFINE(HAVE_OPENGL, 1, [Define if OpenGL is available])
865 ## freetype 2 869 ## freetype 2
866 870
867 AC_CHECK_FT2([9.0.3], [AC_DEFINE(HAVE_FREETYPE, 1, [Define to 1 if you have Freetype library.]) 871 AC_CHECK_FT2([9.0.3], [AC_DEFINE(HAVE_FREETYPE, 1, [Define to 1 if you have Freetype library.])
868 XTRA_CXXFLAGS="$XTRA_CXXFLAGS $FT2_CFLAGS"], 872 XTRA_CXXFLAGS="$XTRA_CXXFLAGS $FT2_CFLAGS"],
869 [warn_freetype="FreeType library not found. Native graphics will be disabled."]) 873 [warn_freetype="FreeType library not found. Native graphics will be disabled."])
874
875 if test -n "$warn_freetype"; then
876 OCTAVE_CONFIGURE_WARNING([warn_freetype])
877 native_graphics=false
878 fi
870 879
871 ## fontconfig library 880 ## fontconfig library
872 881
873 warn_fontconfig="" 882 warn_fontconfig=""
874 if test -z "$warn_freetype"; then 883 if test -z "$warn_freetype"; then
879 AC_DEFINE(HAVE_FONTCONFIG, 1, [Define to 1 if fontconfig is present])], [ 888 AC_DEFINE(HAVE_FONTCONFIG, 1, [Define to 1 if fontconfig is present])], [
880 have_fontconfig=no 889 have_fontconfig=no
881 warn_fontconfig="Fontconfig library not found. Native graphics will be disabled."]) 890 warn_fontconfig="Fontconfig library not found. Native graphics will be disabled."])
882 fi 891 fi
883 892
893 if test -n "$warn_fontconfig"; then
894 OCTAVE_CONFIGURE_WARNING([warn_fontconfig])
895 native_graphics=false
896 fi
897
884 ## fltk (www.fltk.org) 898 ## fltk (www.fltk.org)
885 899
886 AC_ARG_WITH([fltk-prefix], [ 900 AC_ARG_WITH([fltk-prefix], [
887 AS_HELP_STRING([--with-fltk-prefix=PFX], 901 AS_HELP_STRING([--with-fltk-prefix=PFX],
888 [Prefix where FLTK is installed (optional)])], [ 902 [Prefix where FLTK is installed (optional)])], [
914 warn_fltk_config="" 928 warn_fltk_config=""
915 warn_fltk_opengl="" 929 warn_fltk_opengl=""
916 930
917 if test "$FLTK_CONFIG" = "no" ; then 931 if test "$FLTK_CONFIG" = "no" ; then
918 warn_fltk_config="FLTK config script not found. Native graphics will be disabled." 932 warn_fltk_config="FLTK config script not found. Native graphics will be disabled."
933 OCTAVE_CONFIGURE_WARNING([warn_fltk_config])
934 native_graphics=false
919 else 935 else
920 FLTK_CFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --cflags`" 936 FLTK_CFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --cflags`"
921 FLTK_LDFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --ldflags`" 937 FLTK_LDFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --ldflags`"
922 938
923 case "$canonical_host_type" in 939 case "$canonical_host_type" in
940 ]) 956 ])
941 957
942 if test -z "$warn_fltk_opengl"; then 958 if test -z "$warn_fltk_opengl"; then
943 GRAPHICS_CFLAGS="$FLTK_CFLAGS" 959 GRAPHICS_CFLAGS="$FLTK_CFLAGS"
944 GRAPHICS_LIBS="$FLTK_LDFLAGS" 960 GRAPHICS_LIBS="$FLTK_LDFLAGS"
961 else
962 OCTAVE_CONFIGURE_WARNING([warn_fltk_opengl])
963 native_graphics=false
945 fi 964 fi
946 CFLAGS="$save_CFLAGS" 965 CFLAGS="$save_CFLAGS"
947 fi 966 fi
948 fi 967 fi
949 968
1904 ### unless it was already disabled previously. 1923 ### unless it was already disabled previously.
1905 1924
1906 if test -n "$DOCDIR" && test -n "$warn_gnuplot"; then 1925 if test -n "$DOCDIR" && test -n "$warn_gnuplot"; then
1907 DOCDIR= 1926 DOCDIR=
1908 warn_docs="building documentation disabled because gnuplot was not found; make dist will fail" 1927 warn_docs="building documentation disabled because gnuplot was not found; make dist will fail"
1909 AC_MSG_WARN([$warn_docs]) 1928 OCTAVE_CONFIGURE_WARNING([warn_docs])
1910 fi 1929 fi
1911 AM_CONDITIONAL([AMCOND_BUILD_DOCS], [test -n "$DOCDIR"]) 1930 AM_CONDITIONAL([AMCOND_BUILD_DOCS], [test -n "$DOCDIR"])
1912 1931
1913 ### Even though we include config.h, we need to have the preprocessor 1932 ### Even though we include config.h, we need to have the preprocessor
1914 ### defines available in a variable for the testif feature of the 1933 ### defines available in a variable for the testif feature of the
2255 64-bit array dims and indexing: $USE_64_BIT_IDX_T 2274 64-bit array dims and indexing: $USE_64_BIT_IDX_T
2256 ]) 2275 ])
2257 2276
2258 warn_msg_printed=false 2277 warn_msg_printed=false
2259 2278
2279 OCTAVE_CONFIGURE_WARNING_SUMMARY
2280
2260 if $ENABLE_DYNAMIC_LINKING; then 2281 if $ENABLE_DYNAMIC_LINKING; then
2261 if $SHARED_LIBS; then 2282 if $SHARED_LIBS; then
2262 true 2283 true
2263 else 2284 else
2264 AC_MSG_WARN([You used --enable-dl but not --enable-shared.]) 2285 AC_MSG_WARN([You used --enable-dl but not --enable-shared.])
2265 AC_MSG_WARN([Are you sure that is what you want to do?]) 2286 AC_MSG_WARN([Are you sure that is what you want to do?])
2266 warn_msg_printed=true 2287 warn_msg_printed=true
2267 fi 2288 fi
2268 fi
2269
2270 if test -n "$gxx_only"; then
2271 AC_MSG_WARN([$gxx_only])
2272 warn_msg_printed=true
2273 fi
2274
2275 if test -n "$warn_gcc_version"; then
2276 AC_MSG_WARN([$warn_gcc_version])
2277 warn_msg_printed=true
2278 fi
2279
2280 if test -n "$warn_gcc_only"; then
2281 AC_MSG_WARN([$warn_gcc_only])
2282 warn_msg_printed=true
2283 fi
2284
2285 if test -n "$warn_readline"; then
2286 AC_MSG_WARN([$warn_readline])
2287 warn_msg_printed=true
2288 fi
2289
2290 if test -n "$warn_termlibs"; then
2291 AC_MSG_WARN([$warn_termlibs])
2292 warn_msg_printed=true
2293 fi
2294
2295 if test -n "$warn_gperf"; then
2296 AC_MSG_WARN([$warn_gperf])
2297 warn_msg_printed=true
2298 fi
2299
2300 if test -n "$warn_flex"; then
2301 AC_MSG_WARN([$warn_flex])
2302 warn_msg_printed=true
2303 fi
2304
2305 if test -n "$warn_bison"; then
2306 AC_MSG_WARN([$warn_bison])
2307 warn_msg_printed=true
2308 fi
2309
2310 if test -n "$warn_less"; then
2311 AC_MSG_WARN([$warn_less])
2312 warn_msg_printed=true
2313 fi
2314
2315 if test -n "$warn_umfpack"; then
2316 AC_MSG_WARN([$warn_umfpack])
2317 warn_msg_printed=true
2318 fi
2319
2320 if test -n "$warn_qrupdate"; then
2321 AC_MSG_WARN([$warn_qrupdate])
2322 warn_msg_printed=true
2323 fi
2324
2325 if test -n "$warn_amd"; then
2326 AC_MSG_WARN([$warn_amd])
2327 warn_msg_printed=true
2328 fi
2329
2330 if test -n "$warn_colamd"; then
2331 AC_MSG_WARN([$warn_colamd])
2332 warn_msg_printed=true
2333 fi
2334
2335 if test -n "$warn_ccolamd"; then
2336 AC_MSG_WARN([$warn_ccolamd])
2337 warn_msg_printed=true
2338 fi
2339
2340 if test -n "$warn_cholmod"; then
2341 AC_MSG_WARN([$warn_cholmod])
2342 warn_msg_printed=true
2343 fi
2344
2345 if test -n "$warn_cxsparse"; then
2346 AC_MSG_WARN([$warn_cxsparse])
2347 warn_msg_printed=true
2348 fi
2349
2350 if test -n "$warn_curl"; then
2351 AC_MSG_WARN([$warn_curl])
2352 warn_msg_printed=true
2353 fi
2354
2355 if test -n "$warn_fftw"; then
2356 AC_MSG_WARN([$warn_fftw])
2357 warn_msg_printed=true
2358 fi
2359
2360 if test -n "$warn_glpk"; then
2361 AC_MSG_WARN([$warn_glpk])
2362 warn_msg_printed=true
2363 fi
2364
2365 if test -n "$warn_magick"; then
2366 AC_MSG_WARN([$warn_magick])
2367 warn_msg_printed=true
2368 fi
2369
2370 if test -n "$warn_hdf5"; then
2371 AC_MSG_WARN([$warn_hdf5])
2372 warn_msg_printed=true
2373 fi
2374
2375 if test -n "$warn_regex"; then
2376 AC_MSG_WARN([$warn_regex])
2377 warn_msg_printed=true
2378 fi
2379
2380 if test -n "$warn_pcre"; then
2381 AC_MSG_WARN([$warn_pcre])
2382 warn_msg_printed=true
2383 fi
2384
2385 if test -n "$warn_qhull"; then
2386 AC_MSG_WARN([$warn_qhull])
2387 warn_msg_printed=true
2388 fi
2389
2390 if test -n "$warn_zlib"; then
2391 AC_MSG_WARN([$warn_zlib])
2392 warn_msg_printed=true
2393 fi
2394
2395 if test -n "$warn_ghostscript"; then
2396 AC_MSG_WARN([$warn_ghostscript])
2397 warn_msg_printed=true
2398 fi
2399
2400 if test -n "$warn_texi2dvi"; then
2401 AC_MSG_WARN([$warn_texi2dvi])
2402 warn_msg_printed=true
2403 fi
2404
2405 if test -n "$warn_texi2pdf"; then
2406 AC_MSG_WARN([$warn_texi2pdf])
2407 warn_msg_printed=true
2408 fi
2409
2410 if test -n "$warn_docs"; then
2411 AC_MSG_WARN([$warn_docs])
2412 warn_msg_printed=true
2413 fi
2414
2415 if test -n "$warn_64_bit"; then
2416 AC_MSG_WARN([$warn_64_bit])
2417 warn_msg_printed=true
2418 fi 2289 fi
2419 2290
2420 if $USE_64_BIT_IDX_T; then 2291 if $USE_64_BIT_IDX_T; then
2421 AC_MSG_WARN([]) 2292 AC_MSG_WARN([])
2422 AC_MSG_WARN([You used the EXPERIMENTAL --enable-64 option.]) 2293 AC_MSG_WARN([You used the EXPERIMENTAL --enable-64 option.])
2442 AC_MSG_WARN([This option enables experimental SMP multithreding]) 2313 AC_MSG_WARN([This option enables experimental SMP multithreding])
2443 AC_MSG_WARN([code that has had very little testing. There is no]) 2314 AC_MSG_WARN([code that has had very little testing. There is no])
2444 AC_MSG_WARN([certainity that the results returned by Octave with]) 2315 AC_MSG_WARN([certainity that the results returned by Octave with])
2445 AC_MSG_WARN([this option enabled will be correct.]) 2316 AC_MSG_WARN([this option enabled will be correct.])
2446 AC_MSG_WARN([]) 2317 AC_MSG_WARN([])
2447 warn_msg_printed=true
2448 fi
2449
2450 native_graphics=true
2451 if test -n "$warn_opengl"; then
2452 AC_MSG_WARN([$warn_opengl])
2453 native_graphics=false
2454 warn_msg_printed=true
2455 fi
2456
2457 if test -n "$warn_freetype"; then
2458 AC_MSG_WARN([$warn_freetype])
2459 native_graphics=false
2460 warn_msg_printed=true
2461 fi
2462
2463 if test -n "$warn_fontconfig"; then
2464 AC_MSG_WARN([$warn_fontconfig])
2465 native_graphics=false
2466 warn_msg_printed=true
2467 fi
2468
2469 if test -n "$warn_fltk_config"; then
2470 AC_MSG_WARN([$warn_fltk_config])
2471 native_graphics=false
2472 warn_msg_printed=true
2473 fi
2474
2475 if test -n "$warn_fltk_opengl"; then
2476 AC_MSG_WARN([$warn_fltk_opengl])
2477 native_graphics=false
2478 warn_msg_printed=true 2318 warn_msg_printed=true
2479 fi 2319 fi
2480 2320
2481 if $native_graphics; then 2321 if $native_graphics; then
2482 true; 2322 true;