File libical-0.48-tml.patch of Package mingw-libical

diff --git a/autogen.sh b/autogen.sh
index ef41bbe..8f14fd9 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -37,11 +37,6 @@ test $TEST_TYPE $FILE || {
 	exit 1
 }
 
-if test -z "$*"; then
-	echo "I am going to run ./configure with no arguments - if you wish "
-        echo "to pass any to it, please specify them on the $0 command line."
-fi
-
 case $CC in
 *xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
 esac
@@ -55,7 +50,3 @@ automake -a $am_opt
 autoconf
 cd $ORIGDIR
 
-$srcdir/configure "$@"
-
-echo 
-echo "Now type 'make' to compile $PROJECT."
diff --git a/src/libical/Makefile.am b/src/libical/Makefile.am
index 8696986..f10316b 100644
--- a/src/libical/Makefile.am
+++ b/src/libical/Makefile.am
@@ -51,7 +51,7 @@ INCLUDES =				\
 	-I$(top_builddir)/src/libical	\
 	-I$(srcdir)
 
-libical_la_LDFLAGS = -version-info 48:0:48
+libical_la_LDFLAGS = -version-info 48:0:48 -no-undefined
 
 if OS_WIN32
 libical_la_LDFLAGS += -no-undefined
@@ -105,7 +105,6 @@ libical_la_SOURCES =		\
 	pvl.h			\
 	sspm.c			\
 	sspm.h			\
-	libicals_w32_vsnprintf_replacement.c \
 	icallangbind.h		\
 	icallangbind.c 		\
 	caldate.c 		\
diff --git a/src/libical/icaltz-util.c b/src/libical/icaltz-util.c
index 4c19213..cee9391 100644
--- a/src/libical/icaltz-util.c
+++ b/src/libical/icaltz-util.c
@@ -20,11 +20,6 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <string.h>
-
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
 #endif
@@ -32,67 +27,22 @@
 #if defined(sun) && defined(__SVR4)
 #include <sys/types.h>
 #include <sys/byteorder.h>
-#else
-# ifdef HAVE_BYTESWAP_H
+#elif defined(_WIN32)
+#  define BIG_ENDIAN 'B'
+#  define LITTLE_ENDIAN 'l'
+#  define BYTE_ORDER LITTLE_ENDIAN
+#  define bswap32(val) ((((val) & 0x000000ffU) << 24) | (((val) & 0x0000ff00U) <<  8) | (((val) & 0x00ff0000U) >>  8) | (((val) & 0xff000000U) >> 24))
+#elif defined(__linux__)
 #  include <byteswap.h>
-# endif
-# ifdef HAVE_ENDIAN_H
 #  include <endian.h>
-# else
-# ifdef HAVE_SYS_ENDIAN_H
-#  include <sys/endian.h>
-#  ifdef bswap32
-#   define bswap_32 bswap32
-#  else
-#   define bswap_32 swap32
-#  endif
-# endif
-# endif
-#endif
-
-#ifdef _MSC_VER
-#if !defined(HAVE_BYTESWAP_H) && !defined(HAVE_SYS_ENDIAN_H) && !defined(HAVE_ENDIAN_H)
-#define bswap_16(x) (((x) << 8) & 0xff00) | (((x) >> 8 ) & 0xff)
-#define bswap_32(x) (((x) << 24) & 0xff000000)  \
-                    | (((x) << 8) & 0xff0000)   \
-                    | (((x) >> 8) & 0xff00)     \
-                    | (((x) >> 24) & 0xff )
-#define bswap_64(x) ((((x) & 0xff00000000000000ull) >> 56) \
-                    | (((x) & 0x00ff000000000000ull) >> 40) \
-                    | (((x) & 0x0000ff0000000000ull) >> 24) \
-                    | (((x) & 0x000000ff00000000ull) >> 8) \
-                    | (((x) & 0x00000000ff000000ull) << 8) \
-                    | (((x) & 0x0000000000ff0000ull) << 24) \
-                    | (((x) & 0x000000000000ff00ull) << 40) \
-                    | (((x) & 0x00000000000000ffull) << 56))
-#endif
-#include <io.h>
-#endif
-
-#if defined(__APPLE__)
-#define bswap_16(x) (((x) << 8) & 0xff00) | (((x) >> 8 ) & 0xff)
-#define bswap_32 __builtin_bswap32
-#define bswap_64 __builtin_bswap64
-#endif
-
-#ifndef PATH_MAX
-#define PATH_MAX 512
-#endif
-
-#ifndef F_OK
-#define F_OK 0
-#endif
-
-#ifndef R_OK
-#define R_OK 4
+#else
+#  include<sys/endian.h>
 #endif
 
 #include <limits.h>
 #include <time.h>
 #include <stdlib.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 #include <libical/icalerror.h>
 #include <icaltz-util.h>
 
@@ -151,7 +101,11 @@ decode (const void *ptr)
     if ((BYTE_ORDER == BIG_ENDIAN) && sizeof (int) == 4)
         return *(const int *) ptr;
     else if (BYTE_ORDER == LITTLE_ENDIAN && sizeof (int) == 4)
+#ifdef __linux__
         return bswap_32 (*(const int *) ptr);
+#else
+         return bswap32 (*(const unsigned *) ptr);
+#endif
 #endif
 	else
 	{
diff --git a/src/libicalcap/Makefile.am b/src/libicalcap/Makefile.am
index 022e58a..ea9a44b 100644
--- a/src/libicalcap/Makefile.am
+++ b/src/libicalcap/Makefile.am
@@ -34,7 +34,7 @@ INCLUDES =			\
 	-I$(srcdir)		\
 	-DWITH_RR $(RRCAP_CFLAGS)
 
-libicalcap_evolution_la_LDFLAGS = $(RRCAP_LIBS) -version-info 48:0:48
+libicalcap_evolution_la_LDFLAGS = $(RRCAP_LIBS) -version-info 48:0:48 -no-undefined
 
 
 libicalcap_evolution_la_SOURCES =		\
diff --git a/src/libicalss/Makefile.am b/src/libicalss/Makefile.am
index bb0bc3d..5daab9a 100644
--- a/src/libicalss/Makefile.am
+++ b/src/libicalss/Makefile.am
@@ -63,7 +63,7 @@ INCLUDES =			\
 	-I$(top_builddir)/src/libical	\
 	$(BDB_INCLUDE)
 
-libicalss_la_LDFLAGS = -version-info 48:0:48
+libicalss_la_LDFLAGS = -version-info 48:0:48 -no-undefined
 
 if OS_WIN32
 libicalss_la_LDFLAGS += -no-undefined
diff --git a/src/libicalvcal/Makefile.am b/src/libicalvcal/Makefile.am
index 8177d3a..dd79349 100644
--- a/src/libicalvcal/Makefile.am
+++ b/src/libicalvcal/Makefile.am
@@ -11,7 +11,7 @@ INCLUDES =				\
 	-I$(top_builddir)/src/libical	\
 	-I$(top_srcdir)/src/libicalss
 
-libicalvcal_la_LDFLAGS = -version-info 48:0:48
+libicalvcal_la_LDFLAGS = -version-info 48:0:48 -no-undefined
 
 if OS_WIN32
 libicalvcal_la_LDFLAGS += -no-undefined