
* configure.ac: Improve configure output. * m4/oln-with-lib.m4: Always set oln_have_* variable. --- ChangeLog | 8 +++ configure.ac | 137 +++++++++++++++++++++++++++++++--------------------- m4/oln-with-lib.m4 | 5 +- 3 files changed, 92 insertions(+), 58 deletions(-) diff --git a/ChangeLog b/ChangeLog index e892e68..a79da84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-08-12 Guillaume Lazzara <z@lrde.epita.fr> + + Improve configure output. + + * configure.ac: Improve configure output. + + * m4/oln-with-lib.m4: Always set oln_have_* variable. + 2010-08-10 Guillaume Lazzara <z@lrde.epita.fr> Handle Boost dependency. diff --git a/configure.ac b/configure.ac index aee1acc..108b827 100644 --- a/configure.ac +++ b/configure.ac @@ -241,9 +241,12 @@ AM_CONDITIONAL([HAVE_BOOST_TUPLE], [test "x$oln_have_boost_tuple" = xyes]) ## CFITSIO library. ## ## ---------------- ## -AC_MSG_RESULT([]) -AC_MSG_RESULT([* libcfitsio]) -AC_MSG_RESULT([------------]) +if test "x$with_cfitsio" != xno; then + AC_MSG_RESULT([]) + AC_MSG_RESULT([* libcfitsio]) + AC_MSG_RESULT([------------]) +fi + OLN_WITH_LIB([CFITSIO], [fitsio.h], [cfitsio]) @@ -264,80 +267,102 @@ AC_ARG_WITH([magickxx], [with_magickxx=$withval], [with_magickxx='yes']) -if test "x$with_magickxx" != 'xyes'; then - DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-magickxx=$with_magickxx " -fi - -oln_have_magickxx='no' +oln_have_magickxx=no MAGICKXX_CFLAGS="" MAGICKXX_LIBS="" MAGICKXX_PKG="" -if test "x$with_magickxx" = 'xyes'; then - AC_MSG_RESULT([]) - AC_MSG_RESULT([* libMagick++]) - AC_MSG_RESULT([---------------]) + +if test "x$with_magickxx" != xno; then + AC_MSG_RESULT([]) + AC_MSG_RESULT([* libMagick++]) + AC_MSG_RESULT([---------------]) + PKG_CHECK_MODULES(MAGICKXX,[ImageMagick++], oln_have_magickxx=yes, oln_have_magickxx=no) AC_MSG_RESULT([]) -fi -if test "$oln_have_magickxx" = 'yes'; then - AC_DEFINE([HAVE_MAGICKXX], 1, [Define to 1 if we can use libMagick++]) - # Use standard variable names. - MAGICKXX_CPPFLAGS="$MAGICKXX_CFLAGS" - MAGICKXX_LDFLAGS="$MAGICKXX_LIBS" - AC_SUBST(MAGICKXX_CPPFLAGS) - AC_SUBST(MAGICKXX_LDFLAGS) + if test "$oln_have_magickxx" = yes; then + AC_DEFINE([HAVE_MAGICKXX], 1, [Define to 1 if we can use libMagick++]) + # Use standard variable names. + MAGICKXX_CPPFLAGS="$MAGICKXX_CFLAGS" + MAGICKXX_LDFLAGS="$MAGICKXX_LIBS" + AC_SUBST(MAGICKXX_CPPFLAGS) + AC_SUBST(MAGICKXX_LDFLAGS) + fi fi -AM_CONDITIONAL(HAVE_MAGICKXX, test "x$oln_have_magickxx" = 'xyes') +AM_CONDITIONAL(HAVE_MAGICKXX, test "x$oln_have_magickxx" = xyes) #------------------------------------------------------------ -## ------------- ## -## TIFF library. ## -## ------------- ## +## --- ## +## Qt. ## +## --- ## -AC_MSG_RESULT([]) -AC_MSG_RESULT([* libtiff]) -AC_MSG_RESULT([---------]) -OLN_WITH_LIB([TIFF], [tiff.h], [tiff]) +oln_have_qt=no + +if test "x$with_qt" != xno; then + AC_MSG_RESULT([]) + AC_MSG_RESULT([* Qt]) + AC_MSG_RESULT([----]) + + AT_WITH_QT([+xml], [], [], + AC_MSG_WARN([Qt dependent programs will be disabled.])) + + if test "x$QT_VERSION_MAJOR" != x; then + AT_REQUIRE_QT_VERSION([4], AC_MSG_WARN([Your Qt version is too old! Qt dependent programs will be disabled.]), + AC_DEFINE([HAVE_QT], 1, + [Define to 1 if we can use Qt]) oln_have_qt=yes) + if test "x$QT_VERSION_MAJOR" = x4; then + oln_have_qt=yes + fi + fi +fi + +AM_CONDITIONAL([HAVE_QT], [test "x$oln_have_qt" = xyes]) -# Grassroots DiCoM (GDCM). -AC_MSG_RESULT([]) -AC_MSG_RESULT([* libgdcm]) -AC_MSG_RESULT([---------]) -OLN_WITH_LIB([GDCM], [gdcm-2.0/gdcmReader.h], [gdcmCommon], [gdcm], [GDCM], - [-lgdcmDICT -lgdcmDSED -lgdcmIOD -lgdcmMSFF -lgdcmexpat -lgdcmjpeg12 -lgdcmjpeg16 -lgdcmjpeg8 -lgdcmopenjpeg -lgdcmuuid -lgdcmzlib]) ## ---------- ## ## Tesseract. ## ## ---------- ## -AC_MSG_RESULT([]) -AC_MSG_RESULT([* Tesseract]) -AC_MSG_RESULT([-----------]) -OLN_WITH_LIB([TESSERACT], [tesseract/baseapi.h], [tesseract_full], [tesseract], - [TESSERACT]) +if test "x$with_tesseract" != xno; then + AC_MSG_RESULT([]) + AC_MSG_RESULT([* Tesseract]) + AC_MSG_RESULT([-----------]) +fi -## --- ## -## Qt. ## -## --- ## +OLN_WITH_LIB([TESSERACT], [tesseract/baseapi.h], [tesseract_full], + [tesseract], [TESSERACT]) -AC_MSG_RESULT([]) -AC_MSG_RESULT([* Qt]) -AC_MSG_RESULT([----]) - -oln_have_qt='no' -AT_WITH_QT([+xml], [], [], - AC_MSG_WARN([Qt dependent programs will be disabled.])) - -if test "x$QT_VERSION_MAJOR" != "x"; then - AT_REQUIRE_QT_VERSION([4], AC_MSG_WARN([Your Qt version is too old! Qt dependent programs will be disabled.]), - AC_DEFINE([HAVE_QT], 1, - [Define to 1 if we can use Qt])) - oln_have_qt='yes' + +## ------------- ## +## TIFF library. ## +## ------------- ## + +if test "x$with_tiff" != xno; then + AC_MSG_RESULT([]) + AC_MSG_RESULT([* libtiff]) + AC_MSG_RESULT([---------]) +fi + +OLN_WITH_LIB([TIFF], [tiff.h], [tiff]) + + +## -------------------------------- ## +## GDCM library (Grassroots DiCom). ## +## -------------------------------- ## + +if test "x$with_gdcm" != xno; then + AC_MSG_RESULT([]) + AC_MSG_RESULT([* libgdcm]) + AC_MSG_RESULT([---------]) fi -AM_CONDITIONAL([HAVE_QT], [test "x$QT_VERSION_MAJOR" == "x4"]) + +OLN_WITH_LIB([GDCM], [gdcm-2.0/gdcmReader.h], [gdcmCommon], [gdcm], + [GDCM], + [-lgdcmDICT -lgdcmDSED -lgdcmIOD -lgdcmMSFF -lgdcmexpat -lgdcmjpeg12 -lgdcmjpeg16 -lgdcmjpeg8 -lgdcmopenjpeg -lgdcmuuid -lgdcmzlib]) + + AC_MSG_RESULT([]) diff --git a/m4/oln-with-lib.m4 b/m4/oln-with-lib.m4 index 4f939cb..8bfee3e 100644 --- a/m4/oln-with-lib.m4 +++ b/m4/oln-with-lib.m4 @@ -1,6 +1,7 @@ # -*- Autoconf -*- -# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory +# (LRDE) # # This file is part of Olena. # @@ -73,6 +74,7 @@ AC_DEFUN([_OLN_WITH_LIB], [use $1 (DIR = prefix for $1 installation)])]) $5_CPPFLAGS='' $5_LDFLAGS='' + oln_have_$4=no if test "x$with_$4" != xno; then if test -n "$with_$4"; then $5_CPPFLAGS="-I${with_$4}/include" @@ -82,7 +84,6 @@ AC_DEFUN([_OLN_WITH_LIB], oln_save_LDFLAGS=$LDFLAGS CPPFLAGS="$CPPFLAGS $$5_CPPFLAGS" LDFLAGS="$LDFLAGS $$5_LDFLAGS" - oln_have_$4=no AC_CHECK_HEADER([$2], [AC_CHECK_LIB([$3], [main], -- 1.5.6.5