From c23fe2cf768f41f7a55aefcb4f510999aebe7b18 Mon Sep 17 00:00:00 2001 From: Andreas Huggel Date: Sat, 20 Oct 2007 23:57:10 +0000 Subject: [PATCH] Changes to compile on MinGW. --- config/config.mk.in | 2 +- test/xmpparser-test.sh | 5 +++-- xmpsdk/include/XMP_Environment.h | 16 ++++++++++++++++ xmpsdk/src/Makefile | 2 +- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/config/config.mk.in b/config/config.mk.in index e6164a60..ec50b71e 100644 --- a/config/config.mk.in +++ b/config/config.mk.in @@ -94,7 +94,7 @@ ENABLE_XMP = @ENABLE_XMP@ ifdef ENABLE_XMP XMPSDK_LIBRARY = xmpsdk XMPSDK_DIR = $(top_srcdir)/xmpsdk - XMPSDK_CPPFLAGS = -DUNIX_ENV -I$(XMPSDK_DIR)/include + XMPSDK_CPPFLAGS = -I$(XMPSDK_DIR)/include XMPSDK_LDFLAGS = -L$(XMPSDK_DIR)/src XMPSDK_LIBS = -l$(XMPSDK_LIBRARY) else diff --git a/test/xmpparser-test.sh b/test/xmpparser-test.sh index 59f64e7f..9b086c5f 100755 --- a/test/xmpparser-test.sh +++ b/test/xmpparser-test.sh @@ -65,10 +65,11 @@ $exiv2 -v -px exiv2-empty.jpg # ---------------------------------------------------------------------- # Evaluate results -diff -q $diffargs $results $good +cat $results | tr -d '\r' > $results-stripped +diff -q $diffargs $results-stripped $good rc=$? if [ $rc -eq 0 ] ; then echo "All testcases passed." else - diff $diffargs $results $good + diff $diffargs $results-stripped $good fi diff --git a/xmpsdk/include/XMP_Environment.h b/xmpsdk/include/XMP_Environment.h index f25676ea..39c75283 100644 --- a/xmpsdk/include/XMP_Environment.h +++ b/xmpsdk/include/XMP_Environment.h @@ -34,6 +34,22 @@ /* requires these to be defined without values, they are only used here to define XMP-specific */ /* macros with 0 or 1 values. */ +/* 20-Oct-07, ahu: Determine the platform, set the above defines accordingly. */ +#define _FILE_OFFSET_BITS 64 +#if defined __CYGWIN32__ && !defined __CYGWIN__ + /* For backwards compatibility with Cygwin b19 and + earlier, we define __CYGWIN__ here, so that + we can rely on checking just for that macro. */ +# define __CYGWIN__ __CYGWIN32__ +#endif +#if defined WIN32 && !defined __CYGWIN__ +# define WIN_ENV 1 +#elif 0 +/* Todo: How to determine MAC_ENV ? */ +#else +# define UNIX_ENV 1 +#endif + /* ! Tempting though it might be to have a standard macro for big or little endian, there seems */ /* ! to be no decent way to do that on our own in UNIX. Forcing it on the client isn't acceptable. */ diff --git a/xmpsdk/src/Makefile b/xmpsdk/src/Makefile index 18e77cb7..dd4a0564 100644 --- a/xmpsdk/src/Makefile +++ b/xmpsdk/src/Makefile @@ -85,7 +85,7 @@ SHELL = /bin/sh .PRECIOUS: %.cpp # For a debug build, replace -DNDEBUG=1 with -DDEBUG=1 -D_DEBUG=1 -CPPFLAGS += -I../include -funsigned-char -DUNIX_ENV=1 -DXMP_IMPL=1 -DXMP_ClientBuild=0 -D_FILE_OFFSET_BITS=64 -DHAVE_EXPAT_CONFIG_H=1 -DXML_STATIC=1 -DNDEBUG=1 $(EXPAT_CPPFLAGS) +CPPFLAGS += -I../include -funsigned-char -DNDEBUG=1 $(EXPAT_CPPFLAGS) LDFLAGS += $(EXPAT_LDFLAGS) LIBS += $(EXPAT_LIBS)