From 6aa268b592bbf006228ba9b33a4cf9047106f7c2 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 9 Mar 2011 16:02:43 +0100 Subject: Second round of build system improvements --- configure | 76 ++++++++++++++++++++++++++++++++++++++---------------------- configure.ac | 47 +++++++++++++++++++++---------------- 2 files changed, 75 insertions(+), 48 deletions(-) diff --git a/configure b/configure index fb8ab1d3..5b937c8b 100755 --- a/configure +++ b/configure @@ -816,6 +816,7 @@ enable_png enable_tiff with_libtiff enable_cairo +enable_gdk_pixbuf ' ac_precious_vars='build_alias host_alias @@ -1469,6 +1470,7 @@ Optional Features: --disable-png Disable the use of libPNG --disable-tiff Disable the use of libTIFF --disable-cairo Disable the use of Cairo + --disable-gdk-pixbuf Disable the use of gtk-pixbuf Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -6399,14 +6401,32 @@ fi # Put the nasty error message in config.log where it belongs echo "$GSL_PKG_ERRORS" >&5 + as_fn_error $? "Package requirements (gsl) were not met: - as_fn_error $? "GSL is required" "$LINENO" 5 +$GSL_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GSL_CFLAGS +and GSL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. - as_fn_error $? "GSL is required" "$LINENO" 5 +Alternatively, you may set the environment variables GSL_CFLAGS +and GSL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } else GSL_CFLAGS=$pkg_cv_GSL_CFLAGS @@ -6415,7 +6435,6 @@ else $as_echo "yes" >&6; } fi - fi @@ -6511,6 +6530,7 @@ $as_echo "#define HAVE_CL_CL_H 1" >>confdefs.h fi + # Check whether --enable-gtk was given. if test "${enable_gtk+set}" = set; then : enableval=$enable_gtk; @@ -6929,32 +6949,14 @@ fi # Put the nasty error message in config.log where it belongs echo "$libPNG_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (libpng >= 1.2.0) were not met: -$libPNG_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables libPNG_CFLAGS -and libPNG_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 + have_libpng=false elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. -Alternatively, you may set the environment variables libPNG_CFLAGS -and libPNG_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } + have_libpng=false else libPNG_CFLAGS=$pkg_cv_libPNG_CFLAGS @@ -6965,7 +6967,7 @@ $as_echo "yes" >&6; } $as_echo "#define HAVE_LIBPNG 1" >>confdefs.h - have_libpng=true + have_libpng=true fi @@ -6986,6 +6988,8 @@ fi if test "x$enable_tiff" != "xno"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } # Check whether --with-libtiff was given. if test "${with_libtiff+set}" = set; then : @@ -6999,8 +7003,6 @@ else fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } $as_echo "#define HAVE_TIFF 1" >>confdefs.h @@ -7129,6 +7131,17 @@ $as_echo "no" >&6; } fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use GDK-pixbuf" >&5 +$as_echo_n "checking whether to use GDK-pixbuf... " >&6; } +# Check whether --enable-gdk-pixbuf was given. +if test "${enable_gdk_pixbuf+set}" = set; then : + enableval=$enable_gdk_pixbuf; +fi + +if test "x$enable_gdk_pixbuf" != "xno"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GDK_pixbuf" >&5 @@ -7280,7 +7293,7 @@ $as_echo "yes" >&6; } $as_echo "#define HAVE_GDK_PIXBUF 1" >>confdefs.h - have_gdk_pixbuf=true + have_gdk_pixbuf=true fi @@ -7381,7 +7394,7 @@ $as_echo "yes" >&6; } $as_echo "#define HAVE_GDK_PIXBUF 1" >>confdefs.h - have_gdk_pixbuf=true + have_gdk_pixbuf=true fi @@ -7391,6 +7404,13 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } +fi + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi diff --git a/configure.ac b/configure.ac index 0eb4d3ae..5369d6fc 100644 --- a/configure.ac +++ b/configure.ac @@ -31,14 +31,11 @@ AC_ARG_WITH(hdf5, AC_ARG_WITH(gsl, -[AS_HELP_STRING([--with-gsl], [specify location of GSL (instead of using pkg-config)])], +[AS_HELP_STRING([--with-gsl], + [specify location of GSL (instead of using pkg-config)])], [GSL_CFLAGS="-I$withval/include" GSL_LIBS="-L$withval/lib -lgsl -lgslcblas -lm"], -[PKG_CHECK_MODULES([GSL], [gsl], [], - [ - AC_ERROR([GSL is required]) - ]) -]) +[PKG_CHECK_MODULES([GSL], [gsl])]) AC_ARG_ENABLE(gsl-fudge, AS_HELP_STRING([--enable-gsl-fudge], @@ -96,6 +93,7 @@ AS_IF([test "x$cl_cl_h" == "xtrue"], AC_DEFINE([HAVE_CL_CL_H], [1], [Define to 1 if CL/cl.h should be used]) ]) + AC_ARG_ENABLE(gtk, AS_HELP_STRING([--disable-gtk], [Disable GTK+/GLib])) have_gtk=false AC_MSG_CHECKING([whether to use GTK]) @@ -136,9 +134,11 @@ AS_IF([test "x$enable_png" != "xno"], AC_MSG_RESULT([yes]) PKG_CHECK_MODULES([libPNG], [libpng >= 1.2.0], [ - AC_DEFINE([HAVE_LIBPNG], [1], [Define to 1 if libPNG is available]) - have_libpng=true - ], []) + AC_DEFINE([HAVE_LIBPNG], [1], [Define to 1 if libPNG is available]) + have_libpng=true + ], [ + have_libpng=false + ]) ],[ AC_MSG_RESULT([no]) ]) @@ -149,6 +149,7 @@ AC_ARG_ENABLE([tiff], AS_HELP_STRING([--disable-tiff], [Disable the use of libTIFF])) AS_IF([test "x$enable_tiff" != "xno"], [ + AC_MSG_RESULT([yes]) AC_ARG_WITH(libtiff, [AS_HELP_STRING([--with-libtiff], [specify location of libTIFF library])], [ @@ -157,10 +158,8 @@ AS_IF([test "x$enable_tiff" != "xno"], ], [ LIBTIFF_LIBS="-ltiff" ]) - AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_TIFF], [1], [Define to 1 if libTIFF is available]) -], -[ +], [ AC_MSG_RESULT([no]) ]) @@ -176,20 +175,28 @@ AS_IF([test "x$enable_cairo" != "xno"], have_cairo=true AC_DEFINE([HAVE_CAIRO], [1], [Define to 1 if Cairo is available]) ], []) -], -[ +], [ AC_MSG_RESULT([no]) ]) -PKG_CHECK_MODULES([GDK_pixbuf], [gdk-pixbuf], [], +AC_MSG_CHECKING([whether to use GDK-pixbuf]) +AC_ARG_ENABLE([gdk-pixbuf], AS_HELP_STRING([--disable-gdk-pixbuf], + [Disable the use of gtk-pixbuf])) +AS_IF([test "x$enable_gdk_pixbuf" != "xno"], [ - PKG_CHECK_MODULES([GDK_pixbuf_2], [gdk-pixbuf-2.0], + AC_MSG_RESULT([yes]) + PKG_CHECK_MODULES([GDK_pixbuf], [gdk-pixbuf], [], [ - AC_DEFINE([HAVE_GDK_PIXBUF], [1], - [Define to 1 if gdk-pixbuf is available]) - have_gdk_pixbuf=true - ], []) + PKG_CHECK_MODULES([GDK_pixbuf_2], [gdk-pixbuf-2.0], + [ + AC_DEFINE([HAVE_GDK_PIXBUF], [1], + [Define to 1 if gdk-pixbuf is available]) + have_gdk_pixbuf=true + ], []) + ]) +], [ + AC_MSG_RESULT([no]) ]) -- cgit v1.2.3