* tests/tests-recursive.mk: Include
build-aux/extra-recursive-targets.mk.
(EXTRA_RECURSIVE_TARGETS): Add tests-recursive.
Remove redundant parts.
---
milena/ChangeLog | 9 ++++++++
milena/tests/tests-recursive.mk | 42 +-------------------------------------
2 files changed, 11 insertions(+), 40 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index ebc6fcc..8f0da1c 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,14 @@
2009-06-08 Roland Levillain <roland(a)lrde.epita.fr>
+ Factor tests/tests-recursive.mk.
+
+ * tests/tests-recursive.mk: Include
+ build-aux/extra-recursive-targets.mk.
+ (EXTRA_RECURSIVE_TARGETS): Add tests-recursive.
+ Remove redundant parts.
+
+2009-06-08 Roland Levillain <roland(a)lrde.epita.fr>
+
Rename Make target `regen-dist' as `regen'.
* Makefile.am, doc/Makefile.am (regen-dist): Rename target as...
diff --git a/milena/tests/tests-recursive.mk b/milena/tests/tests-recursive.mk
index 800ef6d..5816d7c 100644
--- a/milena/tests/tests-recursive.mk
+++ b/milena/tests/tests-recursive.mk
@@ -1,52 +1,14 @@
# tests-recursive.mk -*- Automake -*-
# Compile tests recursively, but don't run them.
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
+include $(top_srcdir)/build-aux/extra-recursive-targets.mk
# Sometimes, we just want to check whether tests compile, without
# actually running them. Hence this `tests' target, which does half
# the job of the `check' target.
-
+EXTRA_RECURSIVE_TARGETS += tests-recursive
.PHONY: tests-am tests-recursive tests
# ``Halved'' version of check-am.
tests-am: $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
-# FIXME: Copied from a generated Makefile.in (rule `$(RECURSIVE_TARGETS)').
-# (Automake does not allow us to interact with the code it generates in
-# Makefile.in.) We might want to propose this as a patch to the Automake
-# project.
-tests-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
tests: tests-recursive
--
1.6.1.2
* build-aux/extra-recursive-targets.mk: New.
---
ChangeLog | 6 ++++
build-aux/extra-recursive-targets.mk | 46 ++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+), 0 deletions(-)
create mode 100644 build-aux/extra-recursive-targets.mk
diff --git a/ChangeLog b/ChangeLog
index ab8d657..4c8240a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2009-06-08 Roland Levillain <roland(a)lrde.epita.fr>
+ Introduce an Automake helper to factor extra recursive targets.
+
+ * build-aux/extra-recursive-targets.mk: New.
+
+2009-06-08 Roland Levillain <roland(a)lrde.epita.fr>
+
* configure.ac: Configure scribo/tests/unit_test/Makefile.
2009-06-08 Roland Levillain <roland(a)lrde.epita.fr>
diff --git a/build-aux/extra-recursive-targets.mk b/build-aux/extra-recursive-targets.mk
new file mode 100644
index 0000000..7c1ef1e
--- /dev/null
+++ b/build-aux/extra-recursive-targets.mk
@@ -0,0 +1,46 @@
+# extra-recursive-targets.mk -*- Automake -*-
+# Factor the installation of additional recursive targets.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+EXTRA_RECURSIVE_TARGETS =
+
+# Copied from a generated Makefile.in (rule `$(RECURSIVE_TARGETS)').
+# (Automake does not allow us to interact with the code it generates
+# in Makefile.in.) We might want to propose this as a patch to the
+# Automake project.
+$(EXTRA_RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+.PHONY: $(EXTRA_RECURSIVE_TARGETS)
--
1.6.1.2
#180: algebra::vec's != operators cannot be used.
---------------------+------------------------------------------------------
Reporter: lazzara | Owner: Olena Team
Type: defect | Status: new
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Keywords: |
---------------------+------------------------------------------------------
The following example does not compile.
test.cc:
{{{
# include <mln/algebra/vec.hh>
int main()
{
using namespace mln::algebra;
vec<3, float> a, b;
bool c = (a != b);
}
}}}
g++ -I. test.cc
{{{
test.cc: In function 'int main()':
test.cc:6: error: cannot convert 'mln::algebra::vec<3u, bool>' to 'bool'
in initialization
./mln/core/routine/ops.hh: In function 'typename mln::trait::op::neq<L,
R>::ret mln::operator!=(const mln::Object<E>&, const mln::Object<O2>&)
[with O1 = mln::algebra::vec<3u, float>, O2 = mln::algebra::vec<3u,
float>]':
test.cc:6: instantiated from here
./mln/core/routine/ops.hh:528: error: conversion from 'bool' to non-scalar
type 'mln::algebra::vec<3u, bool>' requested
}}}
Note that if '(a != b)' is replaced by '(a == b)' or '!(a == b)', this
example compiles.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/180>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
---
swilena/ChangeLog | 4 ++++
swilena/python/image2d-misc.py | 13 ++++++++++++-
2 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/swilena/ChangeLog b/swilena/ChangeLog
index 912b495..878fe63 100644
--- a/swilena/ChangeLog
+++ b/swilena/ChangeLog
@@ -1,5 +1,9 @@
2009-06-08 Roland Levillain <roland(a)lrde.epita.fr>
+ * python/image2d-misc.py: Have this test pass with SWIG < 1.3.39.
+
+2009-06-08 Roland Levillain <roland(a)lrde.epita.fr>
+
New Swilena module: config.
* config.i: New.
diff --git a/swilena/python/image2d-misc.py b/swilena/python/image2d-misc.py
index 737b39b..a7933d1 100644
--- a/swilena/python/image2d-misc.py
+++ b/swilena/python/image2d-misc.py
@@ -22,13 +22,24 @@ from swilena import *
ima = image2d_int.image2d_int(3, 3)
image2d_int.fill(ima, 42)
+# FIXME: Help version of SWIG older than 1.3.39. For instance, SWIG
+# 1.3.36 does not generate code smart enough to detect that the output
+# of `ima.domain()' should be a wrapped `box2d'. Help it.
+#
+# We should get rid of this when SWIG 1.3.39 (or greater) is
+# widespread.
+if config.have_swig(0x010339):
+ domain = ima.domain()
+else:
+ domain = box2d(3, 3)
+
# FIXME: Eventually we'd like to be able to write this:
#
# for p in ima.domain():
# print "ima(" + str(p) + ") = " + ima(p)
#
# as it is generic and way closer to what we do in C++.
-for p in ima.domain():
+for p in domain:
# FIXME: Handling POD types (like int) as value types is not
# transparent: ima(p) returns a pointer to int wrapped in a SWIG
# object, and cannot be easily converted to a Python integer
--
1.6.2.4
* config.i: New.
* python/Makefile.am (pyexec_LTLIBRARIES): Add _config.la.
(nodist__config_la_SOURCES, _config_la_LIBADD): New.
(CLEANFILES): Add $(nodist__config_la_SOURCES), config.py,
config.pyc and config.pyo.
(nodist_python_PYTHON): Add config.py.
* python/swilena.py: Import config.
---
swilena/ChangeLog | 12 ++++++++++++
swilena/config.i | 31 +++++++++++++++++++++++++++++++
swilena/python/Makefile.am | 10 ++++++++++
swilena/python/swilena.py | 2 ++
4 files changed, 55 insertions(+), 0 deletions(-)
create mode 100644 swilena/config.i
diff --git a/swilena/ChangeLog b/swilena/ChangeLog
index c2de3c5..912b495 100644
--- a/swilena/ChangeLog
+++ b/swilena/ChangeLog
@@ -1,5 +1,17 @@
2009-06-08 Roland Levillain <roland(a)lrde.epita.fr>
+ New Swilena module: config.
+
+ * config.i: New.
+ * python/Makefile.am (pyexec_LTLIBRARIES): Add _config.la.
+ (nodist__config_la_SOURCES, _config_la_LIBADD): New.
+ (CLEANFILES): Add $(nodist__config_la_SOURCES), config.py,
+ config.pyc and config.pyo.
+ (nodist_python_PYTHON): Add config.py.
+ * python/swilena.py: Import config.
+
+2009-06-08 Roland Levillain <roland(a)lrde.epita.fr>
+
Fix Swilena's copyright headers.
* box.ixx,
diff --git a/swilena/config.i b/swilena/config.i
new file mode 100644
index 0000000..a3bf3fe
--- /dev/null
+++ b/swilena/config.i
@@ -0,0 +1,31 @@
+// -*- C++ -*-
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+
+/// \file config.i
+/// \brief Swilena configuration.
+
+%module config
+
+%inline %{
+/// Are we using SWIG \a version or greater?
+bool
+have_swig(int version)
+{
+ return SWIGVERSION >= version;
+}
+%}
diff --git a/swilena/python/Makefile.am b/swilena/python/Makefile.am
index ad41c3c..eb49d04 100644
--- a/swilena/python/Makefile.am
+++ b/swilena/python/Makefile.am
@@ -47,6 +47,16 @@ python_PYTHON += data.py
nodist_python_PYTHON =
pyexec_LTLIBRARIES =
+## config.
+pyexec_LTLIBRARIES += _config.la
+nodist__config_la_SOURCES = config-wrap.cc
+_config_la_LIBADD = $(AM_LIBADD)
+CLEANFILES += $(nodist__config_la_SOURCES) config.py config.py[co]
+## Include the dependency files. Copied from Automake's generated
+## case for C++.
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_config-wrap.Pcc@am__quote@
+nodist_python_PYTHON += config.py
+
## point2d.
pyexec_LTLIBRARIES += _point2d.la
nodist__point2d_la_SOURCES = point2d-wrap.cc
diff --git a/swilena/python/swilena.py b/swilena/python/swilena.py
index 1c7f3e1..ce093b5 100644
--- a/swilena/python/swilena.py
+++ b/swilena/python/swilena.py
@@ -22,6 +22,8 @@
import ltihooks
+import config
+
from box2d import *
from point2d import *
from dpoint2d import *
--
1.6.2.4