From 18ff02c2f0dff12904dbd2dc4d6c40ef3ad4a6d2 Mon Sep 17 00:00:00 2001 From: Peter Verthez Date: Sat, 21 Dec 2002 19:05:49 +0000 Subject: [PATCH] Converted to separate package. Changed license to LGPL (instead of public domain). --- utf8/.cvsignore | 5 +++ utf8/AUTHORS | 0 utf8/ChangeLog | 4 ++ utf8/NEWS | 0 utf8/acinclude.m4 | 52 +++++++++++++++++++++++++ utf8/configure.in | 92 +++++++++++++++++++++++++++++++++++++++++++++ utf8/utf8-convert.c | 17 +++++++-- utf8/utf8-locale.c | 17 +++++++-- utf8/utf8.c | 17 +++++++-- utf8/utf8tools.h | 17 +++++++-- 10 files changed, 209 insertions(+), 12 deletions(-) create mode 100644 utf8/AUTHORS create mode 100644 utf8/ChangeLog create mode 100644 utf8/NEWS create mode 100644 utf8/acinclude.m4 create mode 100644 utf8/configure.in diff --git a/utf8/.cvsignore b/utf8/.cvsignore index 70845e0..77d059e 100644 --- a/utf8/.cvsignore +++ b/utf8/.cvsignore @@ -1 +1,6 @@ +aclocal.m4 +configure +config.h.in Makefile.in +stamp-h.in +README diff --git a/utf8/AUTHORS b/utf8/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/utf8/ChangeLog b/utf8/ChangeLog new file mode 100644 index 0000000..23d8cff --- /dev/null +++ b/utf8/ChangeLog @@ -0,0 +1,4 @@ +2002-12-21 Peter Verthez + + * libutf8 is now separate package (changed license to LGPL). + diff --git a/utf8/NEWS b/utf8/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/utf8/acinclude.m4 b/utf8/acinclude.m4 new file mode 100644 index 0000000..c23e485 --- /dev/null +++ b/utf8/acinclude.m4 @@ -0,0 +1,52 @@ +dnl $Id$ +dnl $Name$ + +dnl From codeset.m4 (in libcharset): +#serial 2 + +dnl From Bruno Haible. + +AC_DEFUN(jm_LANGINFO_CODESET, +[ + AC_CHECK_HEADERS(langinfo.h) + AC_CHECK_FUNCS(nl_langinfo) + + AC_CACHE_CHECK([for nl_langinfo and CODESET], jm_cv_langinfo_codeset, + [AC_TRY_LINK([#include ], + [char* cs = nl_langinfo(CODESET);], + jm_cv_langinfo_codeset=yes, + jm_cv_langinfo_codeset=no) + ]) + if test $jm_cv_langinfo_codeset = yes; then + AC_DEFINE(HAVE_LANGINFO_CODESET, 1, + [Define if you have and nl_langinfo(CODESET).]) + fi +]) + +dnl From glibc21.m4 (in libcharset): +#serial 2 + +# Test for the GNU C Library, version 2.1 or newer. +# From Bruno Haible. + +AC_DEFUN(jm_GLIBC21, + [ + AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, + ac_cv_gnu_library_2_1, + [AC_EGREP_CPP([Lucky GNU user], + [ +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif + ], + ac_cv_gnu_library_2_1=yes, + ac_cv_gnu_library_2_1=no) + ] + ) + AC_SUBST(GLIBC21) + GLIBC21="$ac_cv_gnu_library_2_1" + ] +) diff --git a/utf8/configure.in b/utf8/configure.in new file mode 100644 index 0000000..9967fe0 --- /dev/null +++ b/utf8/configure.in @@ -0,0 +1,92 @@ +# Process this file with autoconf to produce a configure script. +# $Id$ +# $Name$ +AC_INIT(utf8.c) + +dnl ============================================================= +dnl Global variables +NAME=libutf8tools +AC_SUBST(NAME) + +VERSION=0.1 +AC_SUBST(VERSION) + +LIBVERSION=0:1 +AC_SUBST(LIBVERSION) + +SHELL=/bin/sh +AC_SUBST(SHELL) + +dnl ============================================================= +AM_INIT_AUTOMAKE(${NAME},${VERSION}) +AM_CONFIG_HEADER(config.h) + +AC_CANONICAL_HOST + +EXTRA_CFLAGS="" + +AC_ARG_ENABLE(debug, +[ --enable-debug Compilation flags to allow debugging [default=yes]], + if test $enableval == "yes" + then + EXTRA_CFLAGS="-g $EXTRA_CFLAGS" + fi, + EXTRA_CFLAGS="-g $EXTRA_CFLAGS" +) + +AC_SUBST(EXTRA_CFLAGS) + +dnl ============================================================= +dnl Checks for programs. +AC_PROG_CC +AM_PROG_LIBTOOL +AC_PROG_AWK +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_RANLIB + +dnl ============================================================= +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_INLINE +AC_TYPE_SIZE_T +AC_CHECK_SIZEOF(void *, 4) + + +dnl ========================================================== +dnl Checks for library functions. +AC_CHECK_HEADERS(stddef.h stdlib.h string.h) +AC_CHECK_FUNCS(setlocale vsnprintf vsprintf) +jm_LANGINFO_CODESET +jm_GLIBC21 + +dnl ========================================================== +dnl My local stuff + +AM_ICONV +if test "$am_cv_func_iconv" != yes; then + AC_MSG_ERROR([ +******************************************************************************* +You need 'iconv' (with features comparable to what is in glibc 2.2) to use this +library, consider installing GNU libiconv or use --with-libiconv-prefix to +point to an existing installation of that library (see README) +******************************************************************************* + ]) +fi + +AC_MSG_CHECKING(for location of iconv) +if test "$am_cv_lib_iconv" = yes; then + AC_MSG_RESULT(libiconv) +else + AC_MSG_RESULT(libc) + LCS_SUBDIRS=libcharset + LCS_INCLUDES='-I $(srcdir)/libcharset' + LCS_LIBADD=libcharset/libcharset.la + AC_SUBST(LCS_SUBDIRS) + AC_SUBST(LCS_INCLUDES) + AC_SUBST(LCS_LIBADD) +fi + +AC_OUTPUT(Makefile + libcharset/Makefile) diff --git a/utf8/utf8-convert.c b/utf8/utf8-convert.c index c7094b5..9dbfaf5 100644 --- a/utf8/utf8-convert.c +++ b/utf8/utf8-convert.c @@ -1,9 +1,20 @@ /* Encoding utility from UTF-8 to another charset and vice versa Copyright (C) 2001, 2002 Peter Verthez - Permission granted to do anything with this file that you want, as long - as the above copyright is retained in all copies. - THERE IS NO WARRANTY - USE AT YOUR OWN RISK + The UTF8 tools library is free software; you can redistribute it + and/or modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The Gedcom parser 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the Gedcom parser library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ /* $Id$ */ diff --git a/utf8/utf8-locale.c b/utf8/utf8-locale.c index bcfb17e..697ea1a 100644 --- a/utf8/utf8-locale.c +++ b/utf8/utf8-locale.c @@ -1,9 +1,20 @@ /* Encoding utility from UTF-8 to locale and vice versa Copyright (C) 2001, 2002 Peter Verthez - Permission granted to do anything with this file that you want, as long - as the above copyright is retained in all copies. - THERE IS NO WARRANTY - USE AT YOUR OWN RISK + The UTF8 tools library is free software; you can redistribute it + and/or modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The Gedcom parser 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the Gedcom parser library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ /* $Id$ */ diff --git a/utf8/utf8.c b/utf8/utf8.c index ae7cc4a..e3809b9 100644 --- a/utf8/utf8.c +++ b/utf8/utf8.c @@ -1,9 +1,20 @@ /* Utility functions for UTF-8 Copyright (C) 2001, 2002 Peter Verthez - Permission granted to do anything with this file that you want, as long - as the above copyright is retained in all copies. - THERE IS NO WARRANTY - USE AT YOUR OWN RISK + The UTF8 tools library is free software; you can redistribute it + and/or modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The Gedcom parser 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the Gedcom parser library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ /* $Id$ */ diff --git a/utf8/utf8tools.h b/utf8/utf8tools.h index 3cfb1c1..f7e25ae 100644 --- a/utf8/utf8tools.h +++ b/utf8/utf8tools.h @@ -1,9 +1,20 @@ /* Header file for UTF-8 functions Copyright (C) 2001, 2002 Peter Verthez - Permission granted to do anything with this file that you want, as long - as the above copyright is retained in all copies. - THERE IS NO WARRANTY - USE AT YOUR OWN RISK + The UTF8 tools library is free software; you can redistribute it + and/or modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The Gedcom parser 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the Gedcom parser library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ /* $Id$ */ -- 2.30.2