diff --git a/libopenraw.changes b/libopenraw.changes
index d0349c2..6d27c98 100644
--- a/libopenraw.changes
+++ b/libopenraw.changes
@@ -1,3 +1,10 @@
+-------------------------------------------------------------------
+Thu May 10 01:47:04 UTC 2012 - crrodriguez@opensuse.org
+
+- Run make check
+- Do not use gcc -ansi flag
+- Ensure all C files include "config.h"
+
-------------------------------------------------------------------
Fri Feb 24 17:21:51 UTC 2012 - crrodriguez@opensuse.org
diff --git a/libopenraw.spec b/libopenraw.spec
index 34c8303..32f7e86 100644
--- a/libopenraw.spec
+++ b/libopenraw.spec
@@ -28,6 +28,7 @@ Source0: http://libopenraw.freedesktop.org/download/%{name}-%{version}.ta
Source99: baselibs.conf
# PATCH-FIX-UPSTREAM libopenraw-orf-thumbnail.patch bnc699678 glin@suse.com - Decompress otf files
Patch2: libopenraw-orf-thumbnail.patch
+Patch3: openraw-noansiflag.patch
BuildRequires: boost-devel >= 1.33.1
BuildRequires: gcc-c++
BuildRequires: libjpeg-devel
@@ -71,7 +72,7 @@ libopenraw is a library that aim at decoding digital camera RAW files.
%prep
%setup -q
%patch2 -p1
-
+%patch3
%build
autoreconf -fiv
export CXXFLAGS="%optflags -fvisibility-inlines-hidden"
@@ -82,6 +83,9 @@ export CXXFLAGS="%optflags -fvisibility-inlines-hidden"
%makeinstall
find %{buildroot} -type f -name "*.la" -delete -print
+%check
+make check
+
%post -n libopenraw1 -p /sbin/ldconfig
%postun -n libopenraw1 -p /sbin/ldconfig
diff --git a/openraw-noansiflag.patch b/openraw-noansiflag.patch
new file mode 100644
index 0000000..b72e15d
--- /dev/null
+++ b/openraw-noansiflag.patch
@@ -0,0 +1,146 @@
+--- configure.in.orig
++++ configure.in
+@@ -62,12 +62,13 @@ pkgconfigdir='${libdir}/pkgconfig'
+ AC_SUBST(pkgconfigdir)
+
+ dnl Checks for programs.
+-AC_PROG_CC
++AC_PROG_CC_STDC
++AC_USE_SYSTEM_EXTENSIONS
++AC_SYS_LARGEFILE
+ AC_PROG_CPP
+ AC_PROG_CXX
+ AC_PROG_INSTALL
+-AC_PROG_LIBTOOL
+-
++LT_INIT([disable-static pic-only])
+
+ dnl Requirements
+ EXEMPI_REQUIRED=1.99.5
+@@ -166,16 +167,13 @@ AM_CONDITIONAL(BUILD_GNOME_SUPPORT, test
+ AX_CFLAGS_GCC_OPTION([-Wextra])
+ AX_CXXFLAGS_GCC_OPTION([-Wextra])
+
+-CXXFLAGS="$CXXFLAGS -ansi -pedantic -g -Wall -Wshadow"
+-CFLAGS="$CFLAGS -pedantic -g -Wall"
++CXXFLAGS="$CXXFLAGS -g -Wall -Wshadow"
++CFLAGS="$CFLAGS -g -Wall"
+
+
+-SHAVE_INIT
+
+ AC_OUTPUT([
+ Makefile
+-shave
+-shave-libtool
+ include/Makefile
+ include/libopenraw/Makefile
+ include/libopenraw++/Makefile
+--- lib/Makefile.am.orig
++++ lib/Makefile.am
+@@ -1,5 +1,5 @@
+
+-INCLUDES = -I$(top_srcdir)/include
++AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include
+
+ SUBDIRS = io capi
+
+@@ -40,7 +40,7 @@ noinst_HEADERS = or_debug.h \
+
+ lib_LTLIBRARIES = libopenraw.la
+
+-libopenraw_la_LDFLAGS = \
++libopenraw_la_LDFLAGS = -no-undefined \
+ -version-info @LIBOPENRAW_VERSION_INFO@
+
+ # -export-symbols $(srcdir)/libopenraw.sym
+--- tools/ordiag.cpp.orig
++++ tools/ordiag.cpp
+@@ -19,6 +19,7 @@
+ * .
+ */
+
++#include "config.h"
+
+ #include
+ #include
+--- gnome/gdkpixbuf.c.orig
++++ gnome/gdkpixbuf.c
+@@ -20,6 +20,8 @@
+
+ /** @brief gdkpixbuf support */
+
++#include "config.h"
++
+ #include
+ #include
+ #include
+--- gnome/pixbuf-loader.c.orig
++++ gnome/pixbuf-loader.c
+@@ -21,6 +21,8 @@
+
+ /** @brief gdkpixbuf loader for RAW files */
+
++#include "config.h"
++
+ #include
+
+ #include
+--- lib/io/Makefile.am.orig
++++ lib/io/Makefile.am
+@@ -1,5 +1,5 @@
+
+-INCLUDES = -I$(top_srcdir)/include -I$(srcdir)/..
++AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include -I$(srcdir)/..
+
+ TESTS = teststream
+
+--- lib/capi/Makefile.am.orig
++++ lib/capi/Makefile.am
+@@ -1,7 +1,7 @@
+
+
+
+-INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/lib
++AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include -I$(top_srcdir)/lib
+
+ noinst_LTLIBRARIES = libopenrawc.la
+
+--- test/Makefile.am.orig
++++ test/Makefile.am
+@@ -4,7 +4,7 @@ TESTS_ENVIRONMENT =
+
+ OPENRAW_LIB = $(top_builddir)/lib/libopenraw.la
+
+-INCLUDES = \
++AM_CPPFLAGS = -include $(top_builddir)/config.h \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/lib
+
+--- testsuite/Makefile.am.orig
++++ testsuite/Makefile.am
+@@ -4,10 +4,10 @@ TESTS_ENVIRONMENT =
+
+ OPENRAW_LIB = $(top_builddir)/lib/libopenraw.la
+
+-INCLUDES = \
++AM_CFLAGS = @LIBXML_CFLAGS@ @CURL_CFLAGS@
++AM_CPPFLAGS = -include $(top_builddir)/config.h \
+ -I$(top_srcdir)/include \
+- -I$(top_srcdir)/lib \
+- @LIBXML_CFLAGS@ @CURL_CFLAGS@
++ -I$(top_srcdir)/lib
+
+ noinst_PROGRAMS = testsuite
+ noinst_HEADERS = testsuitetags.h
+--- gnome/Makefile.am.orig
++++ gnome/Makefile.am
+@@ -29,7 +29,7 @@ libopenrawgnome_la_LIBADD = ../lib/libop
+ libopenrawgnome_la_SOURCES = gdkpixbuf.c
+
+
+-libopenraw_pixbuf_la_LDFLAGS = -no-undefined -module -avoid-version
++libopenraw_pixbuf_la_LDFLAGS = -no-undefined -export-dynamic -shared -module -avoid-version
+ libopenraw_pixbuf_la_LIBADD = ../lib/libopenraw.la \
+ $(LIBGLIB_LIBS) \
+ $(LIBGDKPIXBUF_LIBS)