Author: mladen.turk(a)jboss.com
Date: 2008-04-21 07:55:33 -0400 (Mon, 21 Apr 2008)
New Revision: 1552
Added:
trunk/srclib/iconv/
trunk/srclib/iconv/NMAKEmakefile
trunk/srclib/iconv/include/
trunk/srclib/iconv/include/iconv.hw
trunk/srclib/iconv/lib/
trunk/srclib/iconv/lib/config.hw
trunk/srclib/iconv/libcharset/
trunk/srclib/iconv/libcharset/include/
trunk/srclib/iconv/libcharset/include/libcharset.hw
trunk/srclib/iconv/libcharset/include/localcharset.hw
Log:
Add windows builds for libiconv
Added: trunk/srclib/iconv/NMAKEmakefile
===================================================================
--- trunk/srclib/iconv/NMAKEmakefile (rev 0)
+++ trunk/srclib/iconv/NMAKEmakefile 2008-04-21 11:55:33 UTC (rev 1552)
@@ -0,0 +1,117 @@
+# Copyright 2001-2007 The Apache Software Foundation or its licensors, as
+# applicable.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ====================================================================
+#
+# NMAKEmakefile Master LIBICONV makefile.
+# Usage:
+# DLL=1 Build DLL version
+# DEBUG=1 Build DEBUG version of LIBICONV
+#
+# Originally contributed by Mladen Turk <mturk redhat.com>
+#
+# ====================================================================
+#
+
+!IF !DEFINED(ICONV_DECLARE_STATIC) || "$(ICONV_DECLARE_STATIC)" ==
""
+TARGET=DLL
+CFLAGS = -DICONV_DECLARE_EXPORT -DHAVE_CONFIG_H -DNO_XMALLOC -DBUILDING_DLL
+PROJECT = libiconv-1
+!ELSE
+TARGET=LIB
+CFLAGS = -DICONV_DECLARE_STATIC -DHAVE_CONFIG_H -DNO_XMALLOC
+PROJECT = iconv-1
+!ENDIF
+
+VMAJOR = 1
+VMINOR = 12
+VPATCH = 0
+VSTRING= "$(VMAJOR).$(VMINOR).$(VPATCH)"
+
+!IF !DEFINED(SRCDIR) || "$(SRCDIR)" == ""
+SRCDIR = .
+!ENDIF
+
+!include <..\..\NMAKEcommon.inc>
+
+INCLUDES = -I$(SRCDIR)\include -I$(SRCDIR)\lib -I$(SRCDIR)\libcharset\include
+PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src
+OBJECTS = \
+ $(WORKDIR)\localcharset.obj \
+ $(WORKDIR)\relocatable.obj \
+ $(WORKDIR)\iconv.obj
+
+HEADERS = \
+ $(SRCDIR)\include\iconv.h \
+ $(SRCDIR)\lib\config.h \
+ $(SRCDIR)\libcharset\include\libcharset.h \
+ $(SRCDIR)\libcharset\include\localcharset.h
+
+!IF "$(TARGET)" == "DLL"
+BUILDBIN = $(WORKDIR)\$(PROJECT).dll
+BUILDPDB = $(WORKDIR)\$(PROJECT).pdb
+BUILDRES = $(WORKDIR)\$(PROJECT).res
+BUILDMFT = $(BUILDBIN).manifest
+!ELSE
+BUILDBIN = $(WORKDIR)\$(PROJECT).lib
+!ENDIF
+
+all : $(BUILDINS) $(WORKDIR) $(HEADERS) $(BUILDBIN)
+
+$(WORKDIR) :
+ @$(MAKEWORKDIR)
+
+.SUFFIXES : .hw
+
+{$(SRCDIR)\lib}.hw{$(SRCDIR)\lib}.h:
+ @copy /Y $< $@ >NUL
+
+{$(SRCDIR)\include}.hw{$(SRCDIR)\include}.h:
+ @copy /Y $< $@ >NUL
+
+{$(SRCDIR)\libcharset}.hw{$(SRCDIR)\libcharset}.h:
+ @copy /Y $< $@ >NUL
+
+{$(SRCDIR)\libcharset\include}.hw{$(SRCDIR)\libcharset\include}.h:
+ @copy /Y $< $@ >NUL
+
+{$(SRCDIR)\lib}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+{$(SRCDIR)\libcharset\lib}.c{$(WORKDIR)}.obj:
+ $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $<
+
+
+$(OBJECTS): $(SRCDIR)\include\*.h $(SRCDIR)\libcharset\include\*.h
+
+!IF "$(TARGET)" == "DLL"
+$(BUILDRES): $(SRCDIR)\windows\libiconv.rc $(HEADERS) $(SRCDIR)\include\*.h
+ $(RC) $(RCFLAGS) /i "$(SRCDIR)\include" /d PACKAGE_VERSION_MAJOR=$(VMAJOR) /d
PACKAGE_VERSION_MINOR=$(VMINOR) /d PACKAGE_VERSION_SUBMINOR=$(VPATCH) /d
PACKAGE_VERSION_STRING=$(VSTRING) /fo $(BUILDRES) $(SRCDIR)\windows\libiconv.rc
+$(BUILDBIN): $(WORKDIR) $(HEADERS) $(OBJECTS) $(BUILDRES)
+ $(LINK) $(LFLAGS) $(OBJECTS) $(BUILDRES) $(LIBS) /pdb:$(BUILDPDB) /out:$(BUILDBIN)
+ IF EXIST $(BUILDMFT) \
+ mt -nologo -manifest $(BUILDMFT) -outputresource:$(BUILDBIN);2
+!ELSE
+$(BUILDBIN): $(WORKDIR) $(OBJECTS)
+ $(LINK) $(LFLAGS) $(OBJECTS) /out:$(BUILDBIN)
+!ENDIF
+
+clean:
+ @$(CLEANTARGET)
+
+install: $(BUILDINS) $(WORKDIR) $(HEADERS) $(BUILDBIN)
+ @xcopy "$(SRCDIR)\include\iconv.h" "$(BUILDINC)" /Y /Q
+ @xcopy "$(WORKDIR)\*.lib" "$(BUILDLIB)" /Y /Q
+ @xcopy "$(WORKDIR)\*.dll" "$(BUILDOUT)" /Y /Q 2>NUL
Property changes on: trunk/srclib/iconv/NMAKEmakefile
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/srclib/iconv/include/iconv.hw
===================================================================
--- trunk/srclib/iconv/include/iconv.hw (rev 0)
+++ trunk/srclib/iconv/include/iconv.hw 2008-04-21 11:55:33 UTC (rev 1552)
@@ -0,0 +1,211 @@
+/* Copyright (C) 1999-2003, 2005-2006 Free Software Foundation, Inc.
+ This file is part of the GNU LIBICONV Library.
+
+ The GNU LIBICONV Library is free software; you can redistribute it
+ and/or modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ The GNU LIBICONV 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU LIBICONV Library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation, Inc., 51 Franklin Street,
+ Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* When installed, this file is called "iconv.h". */
+
+#ifndef _LIBICONV_H
+#define _LIBICONV_H
+
+#define _LIBICONV_VERSION 0x010B /* version number: (major<<8) + minor */
+
+#if defined(ICONV_DECLARE_STATIC)
+#define ICONV_DECLARE(type) type
+#define ICONV_DECLARE_DATA
+#elif defined(ICONV_DECLARE_EXPORT)
+#define ICONV_DECLARE(type) __declspec(dllexport) type
+#define ICONV_DECLARE_DATA __declspec(dllexport)
+#else
+#define ICONV_DECLARE(type) __declspec(dllimport) type
+#define ICONV_DECLARE_DATA __declspec(dllimport)
+#endif
+
+
+ICONV_DECLARE_DATA int _libiconv_version; /* Likewise */
+
+/* We would like to #include any system header file which could define
+ iconv_t, 1. in order to eliminate the risk that the user gets compilation
+ errors because some other system header file includes /usr/include/iconv.h
+ which defines iconv_t or declares iconv after this file, 2. when compiling
+ for LIBICONV_PLUG, we need the proper iconv_t type in order to produce
+ binary compatible code.
+ But gcc's #include_next is not portable. Thus, once libiconv's iconv.h
+ has been installed in /usr/local/include, there is no way any more to
+ include the original /usr/include/iconv.h. We simply have to get away
+ without it.
+ Ad 1. The risk that a system header file does
+ #include "iconv.h" or #include_next "iconv.h"
+ is small. They all do #include <iconv.h>.
+ Ad 2. The iconv_t type is a pointer type in all cases I have seen. (It
+ has to be a scalar type because (iconv_t)(-1) is a possible return value
+ from iconv_open().) */
+
+/* Define iconv_t ourselves. */
+#undef iconv_t
+#define iconv_t libiconv_t
+typedef void* iconv_t;
+
+/* Get size_t declaration.
+ Get wchar_t declaration if it exists. */
+#include <stddef.h>
+
+/* Get errno declaration and values. */
+#include <errno.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Allocates descriptor for code conversion from encoding `fromcode' to
+ encoding `tocode'. */
+#ifndef LIBICONV_PLUG
+#define iconv_open libiconv_open
+#endif
+ICONV_DECLARE(iconv_t) iconv_open (const char* tocode, const char* fromcode);
+
+/* Converts, using conversion descriptor `cd', at most `*inbytesleft' bytes
+ starting at `*inbuf', writing at most `*outbytesleft' bytes starting at
+ `*outbuf'.
+ Decrements `*inbytesleft' and increments `*inbuf' by the same amount.
+ Decrements `*outbytesleft' and increments `*outbuf' by the same amount. */
+#ifndef LIBICONV_PLUG
+#define iconv libiconv
+#endif
+ICONV_DECLARE(size_t) iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char*
* outbuf, size_t *outbytesleft);
+
+/* Frees resources allocated for conversion descriptor `cd'. */
+#ifndef LIBICONV_PLUG
+#define iconv_close libiconv_close
+#endif
+ICONV_DECLARE(int) iconv_close (iconv_t cd);
+
+
+#ifndef LIBICONV_PLUG
+
+/* Nonstandard extensions. */
+
+/* Control of attributes. */
+#define iconvctl libiconvctl
+ICONV_DECLARE(int) iconvctl (iconv_t cd, int request, void* argument);
+
+/* Hook performed after every successful conversion of a Unicode character. */
+typedef void (*iconv_unicode_char_hook) (unsigned int uc, void* data);
+/* Hook performed after every successful conversion of a wide character. */
+typedef void (*iconv_wide_char_hook) (wchar_t wc, void* data);
+/* Set of hooks. */
+struct iconv_hooks {
+ iconv_unicode_char_hook uc_hook;
+ iconv_wide_char_hook wc_hook;
+ void* data;
+};
+
+/* Fallback function. Invoked when a small number of bytes could not be
+ converted to a Unicode character. This function should process all
+ bytes from inbuf and may produce replacement Unicode characters by calling
+ the write_replacement callback repeatedly. */
+typedef void (*iconv_unicode_mb_to_uc_fallback)
+ (const char* inbuf, size_t inbufsize,
+ void (*write_replacement) (const unsigned int *buf, size_t buflen,
+ void* callback_arg),
+ void* callback_arg,
+ void* data);
+/* Fallback function. Invoked when a Unicode character could not be converted
+ to the target encoding. This function should process the character and
+ may produce replacement bytes (in the target encoding) by calling the
+ write_replacement callback repeatedly. */
+typedef void (*iconv_unicode_uc_to_mb_fallback)
+ (unsigned int code,
+ void (*write_replacement) (const char *buf, size_t buflen,
+ void* callback_arg),
+ void* callback_arg,
+ void* data);
+#if 1
+/* Fallback function. Invoked when a number of bytes could not be converted to
+ a wide character. This function should process all bytes from inbuf and may
+ produce replacement wide characters by calling the write_replacement
+ callback repeatedly. */
+typedef void (*iconv_wchar_mb_to_wc_fallback)
+ (const char* inbuf, size_t inbufsize,
+ void (*write_replacement) (const wchar_t *buf, size_t buflen,
+ void* callback_arg),
+ void* callback_arg,
+ void* data);
+/* Fallback function. Invoked when a wide character could not be converted to
+ the target encoding. This function should process the character and may
+ produce replacement bytes (in the target encoding) by calling the
+ write_replacement callback repeatedly. */
+typedef void (*iconv_wchar_wc_to_mb_fallback)
+ (wchar_t code,
+ void (*write_replacement) (const char *buf, size_t buflen,
+ void* callback_arg),
+ void* callback_arg,
+ void* data);
+#else
+/* If the wchar_t type does not exist, these two fallback functions are never
+ invoked. Their argument list therefore does not matter. */
+typedef void (*iconv_wchar_mb_to_wc_fallback) ();
+typedef void (*iconv_wchar_wc_to_mb_fallback) ();
+#endif
+/* Set of fallbacks. */
+struct iconv_fallbacks {
+ iconv_unicode_mb_to_uc_fallback mb_to_uc_fallback;
+ iconv_unicode_uc_to_mb_fallback uc_to_mb_fallback;
+ iconv_wchar_mb_to_wc_fallback mb_to_wc_fallback;
+ iconv_wchar_wc_to_mb_fallback wc_to_mb_fallback;
+ void* data;
+};
+
+/* Requests for iconvctl. */
+#define ICONV_TRIVIALP 0 /* int *argument */
+#define ICONV_GET_TRANSLITERATE 1 /* int *argument */
+#define ICONV_SET_TRANSLITERATE 2 /* const int *argument */
+#define ICONV_GET_DISCARD_ILSEQ 3 /* int *argument */
+#define ICONV_SET_DISCARD_ILSEQ 4 /* const int *argument */
+#define ICONV_SET_HOOKS 5 /* const struct iconv_hooks *argument */
+#define ICONV_SET_FALLBACKS 6 /* const struct iconv_fallbacks *argument */
+
+/* Listing of locale independent encodings. */
+#define iconvlist libiconvlist
+ICONV_DECLARE(void) iconvlist (int (*do_one) (unsigned int namescount,
+ const char * const * names,
+ void* data),
+ void* data);
+
+/* Canonicalize an encoding name.
+ The result is either a canonical encoding name, or name itself. */
+ICONV_DECLARE(const char *) iconv_canonicalize (const char * name);
+
+/* Support for relocatable packages. */
+
+/* Sets the original and the current installation prefix of the package.
+ Relocation simply replaces a pathname starting with the original prefix
+ by the corresponding pathname with the current prefix instead. Both
+ prefixes should be directory names without trailing slash (i.e. use ""
+ instead of "/"). */
+ICONV_DECLARE(void) libiconv_set_relocation_prefix (const char *orig_prefix,
+ const char *curr_prefix);
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _LIBICONV_H */
Property changes on: trunk/srclib/iconv/include/iconv.hw
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/srclib/iconv/lib/config.hw
===================================================================
--- trunk/srclib/iconv/lib/config.hw (rev 0)
+++ trunk/srclib/iconv/lib/config.hw 2008-04-21 11:55:33 UTC (rev 1552)
@@ -0,0 +1,70 @@
+/* Copyright (C) 1999-2003, 2005, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU LIBICONV Library.
+
+ The GNU LIBICONV Library is free software; you can redistribute it
+ and/or modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ The GNU LIBICONV 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU LIBICONV Library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation, Inc., 51 Franklin Street,
+ Fifth Floor, Boston, MA 02110-1301, USA. */
+
+
+/* Define to 1 to enable a few rarely used encodings. */
+#define ENABLE_EXTRA 1
+
+/* Define to 1 if the package shall run at any location in the filesystem. */
+#define ENABLE_RELOCATABLE 1
+
+/* Define to a type if <wchar.h> does not define. */
+#undef mbstate_t
+
+/* Define if you have <iconv.h>, the iconv_t type, and the
+ iconv_open, iconv, iconv_close functions. */
+#undef HAVE_ICONV
+/* Define as const if the declaration of iconv() needs const. */
+#define ICONV_CONST const
+
+/* Define to 1 if you have the getc_unlocked() function. */
+#undef HAVE_GETC_UNLOCKED
+
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
+
+/* Define if you have the mbrtowc() function. */
+#undef HAVE_MBRTOWC
+
+/* Define to 1 if you have the setlocale() function. */
+#define HAVE_SETLOCALE 1
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 or 0, depending whether the compiler supports simple visibility
+ declarations. */
+#undef HAVE_VISIBILITY
+
+/* Define if you have the wcrtomb() function. */
+#undef HAVE_WCRTOMB
+
+/* Define if the machine's byte ordering is little endian. */
+#define WORDS_LITTLEENDIAN 1
+
+/* Define to the value of ${prefix}, as a string. */
+#undef INSTALLPREFIX
+
+#define LIBDIR "."
+#define set_relocation_prefix libcharset_set_relocation_prefix
Property changes on: trunk/srclib/iconv/lib/config.hw
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/srclib/iconv/libcharset/include/libcharset.hw
===================================================================
--- trunk/srclib/iconv/libcharset/include/libcharset.hw (rev 0)
+++ trunk/srclib/iconv/libcharset/include/libcharset.hw 2008-04-21 11:55:33 UTC (rev
1552)
@@ -0,0 +1,57 @@
+/* Copyright (C) 2003 Free Software Foundation, Inc.
+ This file is part of the GNU CHARSET Library.
+
+ The GNU CHARSET Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU CHARSET 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with the GNU CHARSET Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 51 Franklin Street,
+ Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#ifndef _LIBCHARSET_H
+#define _LIBCHARSET_H
+
+#if defined(ICONV_DECLARE_STATIC)
+#define ICONV_DECLARE(type) type
+#define ICONV_DECLARE_DATA
+#elif defined(ICONV_DECLARE_EXPORT)
+#define ICONV_DECLARE(type) __declspec(dllexport) type
+#define ICONV_DECLARE_DATA __declspec(dllexport)
+#else
+#define ICONV_DECLARE(type) __declspec(dllimport) type
+#define AICONV_DECLARE_DATA __declspec(dllimport)
+#endif
+
+#include <localcharset.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Support for relocatable packages. */
+
+/* Sets the original and the current installation prefix of the package.
+ Relocation simply replaces a pathname starting with the original prefix
+ by the corresponding pathname with the current prefix instead. Both
+ prefixes should be directory names without trailing slash (i.e. use ""
+ instead of "/"). */
+ICONV_DECLARE(void) libcharset_set_relocation_prefix (const char *orig_prefix,
+ const char *curr_prefix);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _LIBCHARSET_H */
Property changes on: trunk/srclib/iconv/libcharset/include/libcharset.hw
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/srclib/iconv/libcharset/include/localcharset.hw
===================================================================
--- trunk/srclib/iconv/libcharset/include/localcharset.hw (rev 0)
+++ trunk/srclib/iconv/libcharset/include/localcharset.hw 2008-04-21 11:55:33 UTC (rev
1552)
@@ -0,0 +1,52 @@
+/* Determine a canonical name for the current locale's character encoding.
+ Copyright (C) 2000-2003 Free Software Foundation, Inc.
+ This file is part of the GNU CHARSET Library.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library 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. */
+
+#ifndef _LOCALCHARSET_H
+#define _LOCALCHARSET_H
+
+#if defined(ICONV_DECLARE_STATIC)
+#define ICONV_DECLARE(type) type
+#define ICONV_DECLARE_DATA
+#elif defined(ICONV_DECLARE_EXPORT)
+#define ICONV_DECLARE(type) __declspec(dllexport) type
+#define ICONV_DECLARE_DATA __declspec(dllexport)
+#else
+#define ICONV_DECLARE(type) __declspec(dllimport) type
+#define AICONV_DECLARE_DATA __declspec(dllimport)
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Determine the current locale's character encoding, and canonicalize it
+ into one of the canonical names listed in config.charset.
+ The result must not be freed; it is statically allocated.
+ If the canonical name cannot be determined, the result is a non-canonical
+ name. */
+ICONV_DECLARE(const char *) locale_charset (void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _LOCALCHARSET_H */
Property changes on: trunk/srclib/iconv/libcharset/include/localcharset.hw
___________________________________________________________________
Name: svn:eol-style
+ native