Commit 25206896 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Merge branch 'exp/scribo-z' into next

Conflicts:
	milena/mln/io/magick/load.hh
	milena/mln/io/magick/save.hh
	milena/tests/io/magick/save.cc
	scribo/src/Makefile.am
parents eecd7d1c 53a57b1d
2010-08-12 Guillaume Lazzara <z@lrde.epita.fr>
* build-aux/build_unit_test.sh: Handle composed dependency names
in cond_tests_* files.
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.
* configure.ac: Add tests.
* m4/boost.m4: New.
2010-08-10 Guillaume Lazzara <z@lrde.epita.fr>
* Makefile.am: Fix call to build_unit_test.sh.
2010-08-10 Guillaume Lazzara <z@lrde.epita.fr>
* build-aux/build_unit_test.sh: Add more comments.
2010-08-11 Guillaume Lazzara <z@lrde.epita.fr>
Handle libgdcmCommon's dependencies.
* configure.ac: Pass more libraries to OLN_WITH_LIB when searching
for libgdcmCommon.
2010-08-11 Guillaume Lazzara <z@lrde.epita.fr>
* configure.ac: Display a summary of the configuration when the
build directory is ready.
2010-08-11 Guillaume Lazzara <z@lrde.epita.fr>
* configure.ac: Set oln_with_* variables correctly.
2010-08-11 Guillaume Lazzara <z@lrde.epita.fr>
* configure.ac: Require Qt 4.x minimum to enable the use of Qt.
2010-08-11 Guillaume Lazzara <z@lrde.epita.fr>
* m4/autotroll.m4: Fix an invalid generation of configure with
autoconf 2.61.
2010-08-10 Guillaume Lazzara <z@lrde.epita.fr>
* bootstrap: Update calls to build_unit_test.sh.
2010-08-10 Guillaume Lazzara <z@lrde.epita.fr>
* build-aux/build_unit_test.sh: Add support for conditional
unit-tests.
2010-08-03 Guillaume Lazzara <z@lrde.epita.fr>
* configure.ac: Improve configure's outputs for external library
checks.
2010-08-03 Guillaume Lazzara <z@lrde.epita.fr>
Handle libMagick++ dependency with pkg-config.
* configure.ac: Use PKG_* macros to find Magick++ path and
libraries.
* m4/pkg.m4: New macros to use pkg-config.
2010-07-01 Guillaume Lazzara <z@lrde.epita.fr>
* m4/autotroll.m4: Fix invalid configuration when Qt is missing.
2010-06-25 Guillaume Lazzara <z@lrde.epita.fr>
* configure.ac: Set HAVE_QT correctly.
2010-06-15 Guillaume Lazzara <z@lrde.epita.fr>
* configure.ac: Configure scribo/demo.
2010-06-03 Guillaume Lazzara <z@lrde.epita.fr>
* configure.ac: Configure several directories in scribo/.
2010-07-01 Guillaume Lazzara <z@lrde.epita.fr>
* m4/autotroll.m4: Fix invalid configuration when Qt is missing.
2010-06-03 Guillaume Lazzara <z@lrde.epita.fr>
* configure.ac: Check for Qt library using AutoTroll.
2010-05-25 Guillaume Lazzara <z@lrde.epita.fr>
* configure.ac: Do not configure scribo/src/multi_scale anymore.
2010-02-16 Guillaume Lazzara <z@lrde.epita.fr>
* configure.ac: Configure scribo/tests/binarization.
2010-02-16 Guillaume Lazzara <z@lrde.epita.fr>
* configure.ac: Configure scribo/demo/review.
2009-12-15 Guillaume Lazzara <z@lrde.epita.fr>
* configure.ac: Configure scribo/tests/core.
2010-07-13 Roland Levillain <roland@lrde.epita.fr>
* AUTHORS: Update.
......
......@@ -114,7 +114,9 @@ dist-hook:
$(top_srcdir)/build-aux/build_unit_test.sh \
$(distdir)/milena/mln \
$(distdir)/milena/tests/unit_test \
$(top_srcdir)/milena/tests/unit_test/disabled_tests && \
$(top_srcdir)/milena/tests/unit_test/disabled_tests \
mln \
&& \
( \
cd $(distdir); \
set -evx; \
......
......@@ -217,13 +217,14 @@ if $regen_p; then
fi
# Generate unit test files.
run . ./build-aux/build_unit_test.sh `pwd`/milena/mln milena/tests/unit_test milena/tests/unit_test/disabled_tests
run . ./build-aux/build_unit_test.sh `pwd`/milena/mln milena/tests/unit_test milena/tests/unit_test/disabled_tests mln
# Generate unit test files for Scribo.
run . scribo/tests/unit_test/build_unit_test.sh \
scribo \
scribo/tests/unit_test \
scribo/tests/unit_test/disabled_tests
run . ./build-aux/build_unit_test.sh \
scribo/scribo \
scribo/tests/unit_test \
scribo/tests/unit_test/disabled_tests \
scribo
# Install the GNU Build System.
autoreconf -f -v -i
# Makerules.
# This file is part of AutoTroll.
# Copyright (C) 2006, 2007, 2009, 2010 Benoit Sigoure.
#
# AutoTroll is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
#
# In addition, as a special exception, the copyright holders of AutoTroll
# give you unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the macros of
# AutoTroll. You need not follow the terms of the GNU General Public License
# when using or distributing such scripts, even though portions of the text of
# AutoTroll appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes AutoTroll.
#
# This special exception to the GPL applies to versions of AutoTroll
# released by the copyright holders of AutoTroll. Note that people who make
# modified versions of AutoTroll are not obligated to grant this special
# exception for their modified versions; it is their choice whether to do so.
# The GNU General Public License gives permission to release a modified version
# without this exception; this exception also makes it possible to release a
# modified version which carries forward this exception.
# ------------- #
# DOCUMENTATION #
# ------------- #
# See autotroll.m4 :)
SUFFIXES = .moc.cpp .moc.cc .moc.cxx .moc.C .h .hh .hpp \
.ui .ui.h .ui.hh .ui.hpp \
.qrc .qrc.cpp .qrc.cc .qrc.cxx .qrc.C
# --- #
# MOC #
# --- #
.hpp.moc.cpp:
$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
.hh.moc.cpp:
$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
.h.moc.cpp:
$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
.hpp.moc.cc:
$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
.hh.moc.cc:
$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
.h.moc.cc:
$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
.hpp.moc.cxx:
$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
.hh.moc.cxx:
$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
.h.moc.cxx:
$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
.hpp.moc.C:
$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
.hh.moc.C:
$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
.h.moc.C:
$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
# --- #
# UIC #
# --- #
.ui.ui.hpp:
$(UIC) $< -o $@
.ui.ui.hh:
$(UIC) $< -o $@
.ui.ui.h:
$(UIC) $< -o $@
# --- #
# RCC #
# --- #
.qrc.qrc.cpp:
$(RCC) -name `echo "$<" | sed 's|^.*/\(.*\)\.qrc$$|\1|'` $< -o $@
.qrc.qrc.cc:
$(RCC) -name `echo "$<" | sed 's|^.*/\(.*\)\.qrc$$|\1|'` $< -o $@
.qrc.qrc.cxx:
$(RCC) -name `echo "$<" | sed 's|^.*/\(.*\)\.qrc$$|\1|'` $< -o $@
.qrc.qrc.C:
$(RCC) -name `echo "$<" | sed 's|^.*/\(.*\)\.qrc$$|\1|'` $< -o $@
DISTCLEANFILES = $(BUILT_SOURCES)
#! /bin/sh
# Copyright (C) 2007, 2009 EPITA Research and Development Laboratory
# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
# (LRDE)
#
# This file is part of Olena.
......@@ -17,6 +17,33 @@
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
## Build a list of unit tests.
##
## Conditional tests (external dependencies) can be handled
## automaticaly. For each dependency, a file named
## "cond_tests_{DEPS}" must contain the list of files which need the
## dependency. If a test needs more than one dependency, several
## dependency names can be used in the file name.
##
## Ex: cond_tests_qt_tesseract
##
## All the tests listed in this file will need both qt and tesseract
## to be compiled.
##
## "cond_tests_*" files must be created in the directory where
## unit-test.mk is generated (usually the unit-tests directory).
##
## NOTES
## -----
## * Don't forget to add "cond_tests_*" files in the COND_TESTS
## variable in the right Makefile.am.
##
## * ALWAYS end "cond_tests_*" files with a new line!
##
## * If the dependency has a composed name use '-' to concatenate the words.
## (e.g., boost_tuple -> cond_tests_boost-tuple)
##
## FIXME: Don't use `echo -n', as echo's options are not portable.
##
## http://www.gnu.org/software/autoconf/manual/html_node/Limitations-of-Builtins.html#Limitations-of-Builtins
......@@ -25,44 +52,38 @@
## would be to only emit lines ended with newlines.
ECHO_N=printf
# Use the C locale to have a deterministic sort.
export LC_ALL=C
test $# -eq 3 || { echo "Usage: $0 <scanned dir> <output_dir> <disabled_tests>" && exit 1; }
scanned_dir=$1
output_dir=$2
disabled_tests=$3
add_targets()
{
HEADERS_="$1"
output_dir="$2"
output="$3"
IFDEF="$4"
## FIXME: We do not include these directories
##
## mln/io/dicom
## mln/io/fits
## mln/io/magick
## mln/io/tiff
##
## because they contain files depending on optional (external)
## libraries. We should test them conditionally.
HEADERS=$(find $scanned_dir -type f -name "*.hh" \
| sort \
| sed -e 's/.*\/mln\/\(.*\)/mln\/\1/g' | sed 's/\.\.\/\.\.\///g' \
| comm -23 - "$disabled_tests")
if ! (test -z "$IFDEF"); then
echo "# Starting a conditional unit test list." >> "$output"
else
echo "# Starting non-conditional unit test list." >> "$output"
fi
output="$output_dir/unit-tests.mk"
# Start conditions if necessary
rm -f "$output"
rm -f mln_*.cc
# Construct a list of conditions in reverse order to write valid
# endif further.
IFDEF_TMP=""
for i in $IFDEF; do
echo "if HAVE_$i" >>"$output"
IFDEF_TMP="$i $IFDEF_TMP"
done
IFDEF="$IFDEF_TMP"
# Build unit-tests.mk.
echo "## Generated by $0, do not modify." >"$output"
echo >>"$output"
$ECHO_N "check_PROGRAMS = " >>"$output"
$ECHO_N "check_PROGRAMS += " >>"$output"
for i in $HEADERS; do
FILE_CC=`echo $i | sed 's/[/.]/_/g' | sed 's/_hh/\.cc/g'`
for i in $HEADERS_; do
FILE_CC=`echo $i | sed 's/[/.]/_/g' | sed 's/_hh/\.cc/g'`
# Build .cc.
cat > $output_dir/$FILE_CC << EOF
cat > $output_dir/$FILE_CC << EOF
// Unit test for $i.
// Generated by $0, do not modify.
......@@ -77,16 +98,116 @@ int main()
EOF
# Build unit-tests.mk.
TARGET=`echo "${FILE_CC}" | sed 's/\.cc//'`
echo " \\" >>"$output"
$ECHO_N "${TARGET}" >>"$output"
TARGET=`echo "${FILE_CC}" | sed 's/\.cc//'`
echo " \\" >>"$output"
$ECHO_N "${TARGET}" >>"$output"
done
# Build "$output".
echo "" >>"$output"
echo "" >>"$output"
for i in $HEADERS_; do
FILE_CC=`echo $i | sed 's/[/.]/_/g' | sed 's/_hh/\.cc/g'`
NAME=`echo $FILE_CC | sed 's/\.cc//g'`
# Write specific flags if there are dependencies.
if ! (test -z "$IFDEF"); then
cppflags="${NAME}_CPPFLAGS="
ldflags="${NAME}_LDFLAGS="
for i in $IFDEF; do
cppflags="${cppflags} \${${i}_CPPFLAGS} "
ldflags="${ldflags} \${${i}_LDFLAGS} "
done
echo "$cppflags \${AM_CPPFLAGS}" >>"$output"
echo "$ldflags \${AM_LDFLAGS}" >>"$output"
fi
echo "${NAME}_SOURCES = $FILE_CC" >>"$output"
done
# End conditions if necessary
for i in $IFDEF; do
echo "endif HAVE_$i" >>"$output"
done
echo "" >>"$output"
}
# Use the C locale to have a deterministic sort.
export LC_ALL=C
test $# -eq 4 || { echo "Usage: $0 <scanned dir> <output_dir> <disabled_tests> <base include dir>" && exit 1; }
scanned_dir=$1
output_dir=$2
disabled_tests=$3
base_inc_dir=$4
# Create a list of tests to be disabled or considered as conditional.
ignored_list="$output_dir/ignored_list.tmp"
cat "$disabled_tests" > $ignored_list
COND_TESTS=$(find $output_dir -type f -name "cond_tests_*" | sort)
for f in $COND_TESTS; do
cat "$f" >> "$ignored_list"
done
cat "$ignored_list" | sort > "$ignored_list.tmp"
mv -f "$ignored_list.tmp" "$ignored_list"
# Build "$output".
echo "" >>"$output"
HEADERS=$(find $scanned_dir -type f -name "*.hh" \
| sort \
| sed -e "s/.*\/${base_inc_dir}\/\(.*\)/${base_inc_dir}\/\1/g" \
| sed 's/\.\.\/\.\.\///g' \
| comm -23 - "$ignored_list")
output="$output_dir/unit-tests.mk"
# Cleanup previously generated data.
rm -f "$output"
rm -f ${base_inc_dir}_*.cc
# Build unit-tests.mk.
echo "## Generated by $0, do not modify." > "$output"
echo >>"$output"
echo "check_PROGRAMS =" >>"$output"
echo "" >>"$output"
for i in $HEADERS; do
FILE_CC=`echo $i | sed 's/[/.]/_/g' | sed 's/_hh/\.cc/g'`
NAME=`echo $FILE_CC | sed 's/\.cc//g'`
echo "${NAME}_SOURCES = $FILE_CC" >>"$output"
#-----------------------------------
# Insert lists of conditional tests.
#-----------------------------------
for f in $COND_TESTS; do
# Generate the list of conditions.
fpostfix="`echo \"$f\" | sed -e 's/.*\/cond_tests_//g'`_"
i=1
COND_LIST=""
while true; do
name=`echo $fpostfix | cut -s -d '_' -f $i \
| tr "[:lower:]" "[:upper:]" \
| sed -e 's/-/_/g'`
i=$(($i+1))
if (test -z "$name"); then
break;
fi
COND_LIST="${COND_LIST} $name"
done
COND_HEADERS=$(cat $f)
# Writing conditional targets
add_targets "$COND_HEADERS" "$output_dir" "$output" "$COND_LIST"
done
#-------------------------------------
# Insert list of non-conditional tests
#-------------------------------------
add_targets "$HEADERS" "$output_dir" "$output" ""
# Remove temporary files
rm -f "$ignored_list"
\ No newline at end of file
......@@ -191,30 +191,185 @@ AM_CONDITIONAL([DARWIN], [echo "$host_os" | grep '^darwin'])
## External libraries. ##
## -------------------- ##
# Prepare calls to pkg-config
PKG_PROG_PKG_CONFIG
AC_MSG_RESULT([])
AC_MSG_RESULT([])
AC_MSG_RESULT([Checking external libraries])
AC_MSG_RESULT([-------------------------------------------------------------------------------])
### Support for FreeImagePlus has been disabled for Olena 1.0.
## OLN_WITH_LIB([FreeImagePlus], [FreeImagePlus.h], [freeimageplus])
# CFITSIO library.
## ----- ##
## Boost ##
## ----- ##
oln_have_boost_preprocessor=no
oln_have_boost_tuple=no
if test "x$with_boost" != xno; then
AC_MSG_RESULT([])
AC_MSG_RESULT([* Boost])
AC_MSG_RESULT([-------])
# Preprocessor
BOOST_FIND_HEADER([boost/preprocessor/repetition/repeat.hpp],
oln_have_boost_preprocessor="no",
oln_have_boost_preprocessor="yes")
if test "x$oln_have_boost_preprocessor" = xyes; then
AC_DEFINE([HAVE_BOOST_PREPROCESSOR], 1, [Define to 1 if we can use Boost Preprocessor.])
fi
# Tuple
BOOST_FIND_HEADER([boost/tuple/tuple.hpp],
oln_have_boost_tuple=no,
oln_have_boost_tuple=yes)
if test "x$oln_have_boost_tuple" = xyes; then
AC_DEFINE([HAVE_BOOST_TUPLE], 1, [Define to 1 if we can use Boost Tuple.])
fi
fi
AM_CONDITIONAL([HAVE_BOOST_PREPROCESSOR],
[test "x$oln_have_boost_preprocessor" = xyes])
AM_CONDITIONAL([HAVE_BOOST_TUPLE], [test "x$oln_have_boost_tuple" = xyes])
## ---------------- ##
## CFITSIO library. ##
## ---------------- ##
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])
# Magick++.
# FIXME: We should handle Magick++ using pkgconfig (and/or
# Magick++-config?) instead of OLN_WITH_LIB. See how other projects
# handle this.
OLN_WITH_LIB([Magick++], [Magick++.h], [Magick++], [magickxx], [MAGICKXX])
# TIFF library.
OLN_WITH_LIB([TIFF], [tiff.h], [tiff])
#------------------------------------------------------------
## --------- ##
## Magick++. ##
## --------- ##
# FIXME: We should handle Magick++ both with Magick++-config and
# pkg-config? instead of OLN_WITH_LIB. See how other projects handle
# this.
#OLN_WITH_LIB([Magick++], [Magick++.h], [Magick++], [magickxx], [MAGICKXX])
AC_ARG_WITH([magickxx],
[AC_HELP_STRING([--with-magickxx],
[enable magickxx support (default)])],
[with_magickxx=$withval],
[with_magickxx='yes'])
oln_have_magickxx=no
MAGICKXX_CFLAGS=""
MAGICKXX_LIBS=""
MAGICKXX_PKG=""
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([])
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
# Grassroots DiCoM (GDCM).
OLN_WITH_LIB([GDCM], [gdcm-2.0/gdcmReader.h], [gdcmCommon], [gdcm], [GDCM],
[-lgdcmzlib])
AM_CONDITIONAL(HAVE_MAGICKXX, test "x$oln_have_magickxx" = xyes)
#------------------------------------------------------------
## --- ##
## Qt. ##
## --- ##
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])