groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff-commit] groff ./ChangeLog ./Makefile.in ./Makefile.sub ...


From: Werner LEMBERG
Subject: [Groff-commit] groff ./ChangeLog ./Makefile.in ./Makefile.sub ...
Date: Tue, 10 Jan 2006 09:43:43 +0000

CVSROOT:        /cvsroot/groff
Module name:    groff
Branch:         
Changes by:     Werner LEMBERG <address@hidden> 06/01/10 09:43:43

Modified files:
        .              : ChangeLog Makefile.in Makefile.sub aclocal.m4 
                         configure configure.ac 
        src/include    : config.hin relocate.h 
        src/libs/libgroff: Makefile.sub 
        src/preproc/preconv: preconv.cpp 
Added files:
        m4             : glibc21.m4 
        src/include    : localcharset.h 
        src/libs/libgroff: config.charset localcharset.c ref-add.sin 
                           ref-del.sin 

Log message:
        Work around unportability of nl_langinfo(CODESET).
        
        * m4/glibc21.m4: New file, from gnulib.
        * Makefile.sub (M4MACROS): Add m4/glibc21.m4.
        * configure.ac: Also test for stddef.h, and invoke jm_GLIBC21.
        * Makefile.in (HOST, GLIBC21): New variables.
        (MDEFINES): Pass them to subdirectories.
        * src/include/relocate.h (relocatep): Define with C linkage.
        * src/include/localcharset.h: New file, from gnulib.
        * src/libs/libgroff/localcharset.c: New file, from gnulib with a
        modification for relocate().
        * src/libs/libgroff/config.charset: New file, from gnulib.
        * src/libs/libgroff/ref-add.sin: New file, from gnulib.
        * src/libs/libgroff/ref-del.sin: New file, from gnulib.
        * src/libs/libgroff/Makefile.sub (EXTRA_CFLAGS): Also define LIBDIR.
        (OBJS): Add localcharset.o.
        (CSRCS): Add localcharset.c.
        (all): Add dependencies to charset.alias, ref-add.sed, ref-del.sed.
        (charset.alias): New rule.
        (PACKAGE): New variable.
        (ref-add.sed, ref-del.sed): New rules.
        (MKINSTALLDIRS): New variable.
        (install_data): Depend on install_charset_data.
        (install_charset_data): New rule for creating or updating
        charset.alias.
        (uninstall_sub): Depend on uninstall_charset_data.
        (uninstall_charset_data): New rule for uninstalling or updating
        charset.alias.
        * src/preproc/preconv/preconv.cpp: Include localcharset.h instead
        of <langinfo.h>.
        (main): Initialize default_encoding from locale_charset() instead of
        nl_langinfo(CODESET).
        
        * aclocal.m4, configure, src/include/config.hin: Regenerated.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/groff/ChangeLog.diff?tr1=1.881&tr2=1.882&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/groff/groff/Makefile.in.diff?tr1=1.91&tr2=1.92&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/groff/groff/Makefile.sub.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/groff/groff/aclocal.m4.diff?tr1=1.54&tr2=1.55&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/groff/groff/configure.diff?tr1=1.74&tr2=1.75&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/groff/groff/configure.ac.diff?tr1=1.38&tr2=1.39&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/groff/groff/m4/glibc21.m4?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/groff/src/include/config.hin.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/groff/groff/src/include/localcharset.h?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/groff/src/include/relocate.h.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/groff/groff/src/libs/libgroff/Makefile.sub.diff?tr1=1.24&tr2=1.25&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/groff/groff/src/libs/libgroff/config.charset?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/groff/src/libs/libgroff/localcharset.c?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/groff/src/libs/libgroff/ref-add.sin?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/groff/src/libs/libgroff/ref-del.sin?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/groff/src/preproc/preconv/preconv.cpp.diff?tr1=1.8&tr2=1.9&r1=text&r2=text

Patches:
Index: groff/ChangeLog
diff -u groff/ChangeLog:1.881 groff/ChangeLog:1.882
--- groff/ChangeLog:1.881       Tue Jan 10 06:36:00 2006
+++ groff/ChangeLog     Tue Jan 10 09:43:43 2006
@@ -1,3 +1,40 @@
+2006-01-10  Bruno Haible  <address@hidden>
+
+       Work around unportability of nl_langinfo(CODESET).
+
+       * m4/glibc21.m4: New file, from gnulib.
+       * Makefile.sub (M4MACROS): Add m4/glibc21.m4.
+       * configure.ac: Also test for stddef.h, and invoke jm_GLIBC21.
+       * Makefile.in (HOST, GLIBC21): New variables.
+       (MDEFINES): Pass them to subdirectories.
+       * src/include/relocate.h (relocatep): Define with C linkage.
+       * src/include/localcharset.h: New file, from gnulib.
+       * src/libs/libgroff/localcharset.c: New file, from gnulib with a
+       modification for relocate().
+       * src/libs/libgroff/config.charset: New file, from gnulib.
+       * src/libs/libgroff/ref-add.sin: New file, from gnulib.
+       * src/libs/libgroff/ref-del.sin: New file, from gnulib.
+       * src/libs/libgroff/Makefile.sub (EXTRA_CFLAGS): Also define LIBDIR.
+       (OBJS): Add localcharset.o.
+       (CSRCS): Add localcharset.c.
+       (all): Add dependencies to charset.alias, ref-add.sed, ref-del.sed.
+       (charset.alias): New rule.
+       (PACKAGE): New variable.
+       (ref-add.sed, ref-del.sed): New rules.
+       (MKINSTALLDIRS): New variable.
+       (install_data): Depend on install_charset_data.
+       (install_charset_data): New rule for creating or updating
+       charset.alias.
+       (uninstall_sub): Depend on uninstall_charset_data.
+       (uninstall_charset_data): New rule for uninstalling or updating
+       charset.alias.
+       * src/preproc/preconv/preconv.cpp: Include localcharset.h instead
+       of <langinfo.h>.
+       (main): Initialize default_encoding from locale_charset() instead of
+       nl_langinfo(CODESET).
+
+       * aclocal.m4, configure, src/include/config.hin: Regenerated.
+
 2006-01-10  Werner LEMBERG  <address@hidden>
 
        * src/preproc/preconv/preconv.cpp (conversion_iconv): Use
Index: groff/Makefile.in
diff -u groff/Makefile.in:1.91 groff/Makefile.in:1.92
--- groff/Makefile.in:1.91      Tue Jan  3 23:57:03 2006
+++ groff/Makefile.in   Tue Jan 10 09:43:43 2006
@@ -25,6 +25,12 @@
 address@hidden@
 address@hidden@
 
+# `HOST' is the canonical host specification,
+#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
address@hidden@
+
 # `RT_SEP' is the operating system's native PATH SEPARATOR CHAR, which
 # is to be used in runtime PATHs compiled into groff executables.
 address@hidden@
@@ -34,6 +40,10 @@
 # particularly in some Microsoft environments, it may differ.
 address@hidden@
 
+# `GLIBC21' is yes if the host operating system uses GNU libc 2.1 or newer,
+# otherwise no.
address@hidden@
+
 version=`cat $(top_srcdir)/VERSION`
 # No additional number if revision is zero.
 revision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' $(top_srcdir)/REVISION`
@@ -253,26 +263,30 @@
 # DEFINES should include the following:
 #
 # -DWORDS_BIGENDIAN            if your target platform is big-endian
+# -DIS_EBCDIC_HOST             if the host's encoding is EBCDIC
 #
-# -DHAVE_MMAP                  if you have mmap() and <sys/mman.h>
-# -DARRAY_DELETE_NEEDS_SIZE    if your C++ doesn't understand `delete []'
-# -DSYS_SIGLIST_DECLARED       if you have sys_siglist[]
+# -DHAVE_DECL_SYS_SIGLIST      if you have sys_siglist[]
 # -DWCOREFLAG=0200             if the 0200 bit of the status returned by
 #                              wait() indicates whether a core image was
 #                              produced for a process that was terminated
 #                              by a signal
 #
+# -DHAVE_DIRECT_H              if you have <direct.h>
 # -DHAVE_DIRENT_H              if you have <dirent.h>
+# -DHAVE_CC_INTTYPES_H         if you have a C++ <inttypes.h>
+# -DHAVE_PROCESS_H             if you have <process.h>
 # -DHAVE_LIMITS_H              if you have <limits.h>
 # -DHAVE_CC_LIMITS_H           if you have a C++ <limits.h>
 # -DHAVE_MATH_H                        if you have <math.h>
 # -DHAVE_CC_OSFCN_H            if you have a C++ <osfcn.h>
-# -DHAVE_CC_INTTYPES_H         if you have a C++ <inttypes.h>
+# -DHAVE_STDDEF_H              if you have <stddef.h>
 # -DHAVE_STDLIB_H              if you have <stdlib.h>
 # -DHAVE_STRING_H              if you have <string.h>
 # -DHAVE_STRINGS_H             if you have <strings.h>
 # -DHAVE_SYS_DIR_H             if you have <sys/dir.h>
+# -DHAVE_SYS_STAT_H            if you have <sys/stat.h>
 # -DHAVE_SYS_TIME_H            if you have <sys/time.h>
+# -DHAVE_SYS_TYPES_H           if you have <sys/types.h>
 # -DHAVE_UNISTD_H              if you have <unistd.h>
 #
 # -DHAVE_FMOD                  if you have fmod()
@@ -307,7 +321,7 @@
 # -DNEED_DECLARATION_SNPRINTF  if your C++ <stdio.h> doesn't declare
 #                              snprintf()
 # -DNEED_DECLARATION_SRAND     if your C++ <stdlib.h> doesn't declare srand()
-# -DNEED_DECLARATION_STRCASECMP if your C++ <string.h> doesn't declare
+# -DNEED_DECLARATION_STRCASECMP        if your C++ <string.h> doesn't declare
 #                              strcasecmp()
 # -DNEED_DECLARATION_STRNCASECMP
 #                              if your C++ <string.h> doesn't declare
@@ -317,20 +331,26 @@
 # -DNEED_DECLARATION_VSNPRINTF if your C++ <stdio.h> doesn't declare
 #                              vsnprintf()
 #
-# -DRET_TYPE_SRAND_IS_VOID     if srand() returns void not int
+# -DHAVE_STRUCT_EXCEPTION      if <math.h> defines struct exception
 # -DHAVE_SYS_NERR              if you have sysnerr in <errno.h> or <stdio.h>
 # -DHAVE_SYS_ERRLIST           if you have sys_errlist in <errno.h> or
 #                              <stdio.h>
-# -DTRADITIONAL_CPP            if your C++ compiler uses a traditional
-#                              (Reiser) preprocessor
+# -DICONV_CONST=const          if declaration of iconv() needs const
 # -DLONG_FOR_TIME_T            if localtime() takes a long * not a time_t *
-# -DHAVE_STRUCT_EXCEPTION      if <math.h> defines struct exception
 # -DRETSIGTYPE=int             if signal handlers return int not void  
-# -DICONV_CONST=const          if declaration of iconv() needs const
-# -DIS_EBCDIC_HOST             if the host's encoding is EBCDIC
+# -DRET_TYPE_SRAND_IS_VOID     if srand() returns void not int
+#
+# -Duintmax_t=<value>          define to `unsigned long' or `unsigned long
+#                              long' if <inttypes.h> does not exist
+#
+# -DTRADITIONAL_CPP            if your C++ compiler uses a traditional
+#                              (Reiser) preprocessor
+# -DARRAY_DELETE_NEEDS_SIZE    if your C++ doesn't understand `delete []'
+#
 # -DPAGE=A4                    if the the printer's page size is A4
 # -DGHOSTSCRIPT=gs             the name (and directory if required) of the
 #                              ghostscript program
+#
 address@hidden@
 
 # Include
@@ -420,6 +440,8 @@
   "ETAGSCCFLAG=$(ETAGSCCFLAG)" \
   "ETAGSFLAGS=$(ETAGSFLAGS)" \
   "EXEEXT=$(EXEEXT)" \
+  "GLIBC21=$(GLIBC21)" \
+  "HOST=$(HOST)" \
   "INSTALL_DATA=$(INSTALL_DATA)" \
   "INSTALL_INFO=$(INSTALL_INFO)" \
   "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
Index: groff/Makefile.sub
diff -u groff/Makefile.sub:1.12 groff/Makefile.sub:1.13
--- groff/Makefile.sub:1.12     Tue Jan  3 23:57:03 2006
+++ groff/Makefile.sub  Tue Jan 10 09:43:43 2006
@@ -14,7 +14,7 @@
 
 M4MACROS = \
   $(srcdir)/m4/groff.m4 \
-  $(srcdir)/m4/codeset.m4 \
+  $(srcdir)/m4/codeset.m4 $(srcdir)/m4/glibc21.m4 \
   $(srcdir)/m4/iconv.m4 \
   $(srcdir)/m4/lib-link.m4 $(srcdir)/m4/lib-ld.m4 $(srcdir)/m4/lib-prefix.m4
 
Index: groff/aclocal.m4
diff -u groff/aclocal.m4:1.54 groff/aclocal.m4:1.55
--- groff/aclocal.m4:1.54       Tue Jan  3 23:57:03 2006
+++ groff/aclocal.m4    Tue Jan 10 09:43:43 2006
@@ -12,6 +12,7 @@
 # PARTICULAR PURPOSE.
 
 m4_include([m4/codeset.m4])
+m4_include([m4/glibc21.m4])
 m4_include([m4/groff.m4])
 m4_include([m4/iconv.m4])
 m4_include([m4/lib-ld.m4])
Index: groff/configure
diff -u groff/configure:1.74 groff/configure:1.75
--- groff/configure:1.74        Tue Jan  3 23:57:03 2006
+++ groff/configure     Tue Jan 10 09:43:43 2006
@@ -540,7 +540,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME 
PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix 
program_transform_name bindir sbindir libexecdir datadir sysconfdir 
sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir 
build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS 
LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX TTYDEVDIRS 
OTHERDEVDIRS CPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS XDEVDIRS XPROGDIRS 
XLIBDIRS appresdir LPR LP LPQ PSPRINT DVIPRINT PERLPATH YACC MAKEINFO RANLIB 
ac_ct_RANLIB INSTALL_INFO INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S 
SH_SCRIPT_SED_CMD GREP EGREP LIBC LIBM build build_cpu build_vendor build_os 
host host_cpu host_vendor host_os LIBICONV LTLIBICONV LIBOBJS 
BROKEN_SPOOLER_FLAGS PAGE g sys_tmac_prefix tmac_wrap GROFF_PATH_SEPARATOR 
ALT_GHOSTSCRIPT_PROGS GHOSTSCRIPT ac_ct_GHOSTSCRIPT pnmcut pnmcrop pnmtopng 
psselect pnmtops make_html make_install_html ALT_AWK_PROGS AWK ac_ct_AWK 
make_pdfdoc make_install_pdfdoc pnmtops_nosetpage LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME 
PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix 
program_transform_name bindir sbindir libexecdir datadir sysconfdir 
sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir 
build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS 
LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX TTYDEVDIRS 
OTHERDEVDIRS CPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS XDEVDIRS XPROGDIRS 
XLIBDIRS appresdir LPR LP LPQ PSPRINT DVIPRINT PERLPATH YACC MAKEINFO RANLIB 
ac_ct_RANLIB INSTALL_INFO INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S 
SH_SCRIPT_SED_CMD GREP EGREP LIBC LIBM build build_cpu build_vendor build_os 
host host_cpu host_vendor host_os LIBICONV LTLIBICONV LIBOBJS 
BROKEN_SPOOLER_FLAGS PAGE g sys_tmac_prefix tmac_wrap GROFF_PATH_SEPARATOR 
ALT_GHOSTSCRIPT_PROGS GHOSTSCRIPT ac_ct_GHOSTSCRIPT pnmcut pnmcrop pnmtopng 
psselect pnmtops make_html make_install_html ALT_AWK_PROGS AWK ac_ct_AWK 
make_pdfdoc make_install_pdfdoc pnmtops_nosetpage GLIBC21 LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -6296,7 +6296,8 @@
 
 
 
-for ac_header in stdlib.h unistd.h dirent.h limits.h sys/dir.h \
+
+for ac_header in stddef.h stdlib.h unistd.h dirent.h limits.h sys/dir.h \
                   string.h strings.h math.h sys/time.h direct.h process.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -11721,6 +11722,44 @@
    fi
 
 
+    echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 
or newer" >&5
+echo $ECHO_N "checking whether we are using the GNU C Library 2.1 or newer... 
$ECHO_C" >&6
+if test "${ac_cv_gnu_library_2_1+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
+  Lucky GNU user
+ #endif
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Lucky GNU user" >/dev/null 2>&1; then
+  ac_cv_gnu_library_2_1=yes
+else
+  ac_cv_gnu_library_2_1=no
+fi
+rm -f conftest*
+
+
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5
+echo "${ECHO_T}$ac_cv_gnu_library_2_1" >&6
+
+    GLIBC21="$ac_cv_gnu_library_2_1"
+
+
+
           ac_config_files="$ac_config_files stamp-h"
 
                               ac_config_files="$ac_config_files Makefile 
doc/Makefile src/utils/xtotroff/Makefile"
@@ -12406,6 +12445,7 @@
 s,@make_pdfdoc@,$make_pdfdoc,;t t
 s,@make_install_pdfdoc@,$make_install_pdfdoc,;t t
 s,@pnmtops_nosetpage@,$pnmtops_nosetpage,;t t
+s,@GLIBC21@,$GLIBC21,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF
 
Index: groff/configure.ac
diff -u groff/configure.ac:1.38 groff/configure.ac:1.39
--- groff/configure.ac:1.38     Tue Jan  3 23:57:03 2006
+++ groff/configure.ac  Tue Jan 10 09:43:43 2006
@@ -1,5 +1,5 @@
 # Autoconf configuration file for groff.
-# Copyright (C) 1989-1995, 2001, 2002, 2003, 2004, 2005
+# Copyright (C) 1989-1995, 2001, 2002, 2003, 2004, 2005, 2006
 # Free Software Foundation, Inc.
 #
 # This file is part of groff.
@@ -51,7 +51,7 @@
 AC_SUBST([SH_SCRIPT_SED_CMD])
 
 # checks for headers
-AC_CHECK_HEADERS([stdlib.h unistd.h dirent.h limits.h sys/dir.h \
+AC_CHECK_HEADERS([stddef.h stdlib.h unistd.h dirent.h limits.h sys/dir.h \
                   string.h strings.h math.h sys/time.h direct.h process.h])
 GROFF_ISC_SYSV3
 GROFF_POSIX
@@ -121,6 +121,7 @@
 GROFF_HTML_PROGRAMS
 GROFF_PDFDOC_PROGRAMS
 GROFF_PNMTOPS_NOSETPAGE
+jm_GLIBC21
 
 AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
 AC_CONFIG_FILES([Makefile doc/Makefile src/utils/xtotroff/Makefile])
Index: groff/src/include/config.hin
diff -u groff/src/include/config.hin:1.14 groff/src/include/config.hin:1.15
--- groff/src/include/config.hin:1.14   Tue Jan  3 23:57:03 2006
+++ groff/src/include/config.hin        Tue Jan 10 09:43:43 2006
@@ -79,6 +79,9 @@
 /* Define to 1 if you have the `snprintf' function. */
 #undef HAVE_SNPRINTF
 
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
Index: groff/src/include/relocate.h
diff -u groff/src/include/relocate.h:1.2 groff/src/include/relocate.h:1.3
--- groff/src/include/relocate.h:1.2    Thu May 26 21:01:59 2005
+++ groff/src/include/relocate.h        Tue Jan 10 09:43:43 2006
@@ -1,6 +1,5 @@
-// -*- C++ -*-
 /* Provide relocation for macro and font files.
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006 Free Software Foundation, Inc.
 
    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
@@ -17,11 +16,22 @@
    Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
    USA.  */
 
+#ifdef __cplusplus
 extern char *curr_prefix;
 extern size_t curr_prefix_len;
 
 void set_current_prefix ();
 char *xdirname (char *s);
 char *searchpath (const char *name, const char *pathp);
+#endif
+
+/* This function has C linkage.  */
+extern
+#ifdef __cplusplus
+"C"
+#endif
 char *relocatep (const char *path);
+
+#ifdef __cplusplus
 char *relocate (const char *path);
+#endif
Index: groff/src/libs/libgroff/Makefile.sub
diff -u groff/src/libs/libgroff/Makefile.sub:1.24 
groff/src/libs/libgroff/Makefile.sub:1.25
--- groff/src/libs/libgroff/Makefile.sub:1.24   Thu Jun 23 11:33:00 2005
+++ groff/src/libs/libgroff/Makefile.sub        Tue Jan 10 09:43:43 2006
@@ -1,5 +1,5 @@
 LIB=groff
-EXTRA_CFLAGS=-D__GETOPT_PREFIX=groff_
+EXTRA_CFLAGS=-D__GETOPT_PREFIX=groff_ -DLIBDIR=\"$(libdir)\"
 OBJS=\
   assert.$(OBJEXT) \
   change_lf.$(OBJEXT) \
@@ -24,6 +24,7 @@
   itoa.$(OBJEXT) \
   lf.$(OBJEXT) \
   lineno.$(OBJEXT) \
+  localcharset.$(OBJEXT) \
   macropath.$(OBJEXT) \
   matherr.$(OBJEXT) \
   maxfilename.$(OBJEXT) \
@@ -97,6 +98,7 @@
   $(srcdir)/getopt1.c \
   $(srcdir)/iftoa.c \
   $(srcdir)/itoa.c \
+  $(srcdir)/localcharset.c \
   $(srcdir)/matherr.c \
   $(srcdir)/progname.c \
   $(srcdir)/putenv.c \
@@ -124,3 +126,63 @@
 snprintf.$(OBJEXT): $(srcdir)/../snprintf/snprintf.c
        $(CC) -c $(CDEFINES) $(CFLAGS) $(CPPFLAGS) \
          $(srcdir)/../snprintf/snprintf.c
+
+# Data for localcharset.c.  Taken from libiconv/libcharset.
+
+all: charset.alias ref-add.sed ref-del.sed
+
+charset.alias: $(srcdir)/config.charset
+       $(SHELL) $(srcdir)/config.charset '$(HOST)' > t-$@
+       mv t-$@ $@
+
+PACKAGE=groff
+
+ref-add.sed : $(srcdir)/ref-add.sin
+       sed -e '/^#/d' \
+           -e 's/@''PACKAGE''@/$(PACKAGE)/g' $(srcdir)/ref-add.sin > t-$@
+       mv t-$@ $@
+
+ref-del.sed : $(srcdir)/ref-del.sin
+       sed -e '/^#/d' \
+           -e 's/@''PACKAGE''@/$(PACKAGE)/g' $(srcdir)/ref-del.sin > t-$@
+       mv t-$@ $@
+
+MKINSTALLDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs
+
+install_data: install_charset_data
+install_charset_data:
+       test $(GLIBC21) != no || $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
+       if test -f $(DESTDIR)$(libdir)/charset.alias; then \
+         sed -f ref-add.sed $(DESTDIR)$(libdir)/charset.alias \
+             > $(DESTDIR)$(libdir)/t-charset.alias; \
+         $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias \
+                         $(DESTDIR)$(libdir)/charset.alias; \
+         rm -f $(DESTDIR)$(libdir)/t-charset.alias; \
+       else \
+         if test $(GLIBC21) = no; then \
+           sed -f ref-add.sed charset.alias \
+               > $(DESTDIR)$(libdir)/t-charset.alias; \
+           $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias \
+                           $(DESTDIR)$(libdir)/charset.alias; \
+           rm -f $(DESTDIR)$(libdir)/t-charset.alias; \
+         fi; \
+       fi
+
+uninstall_sub: uninstall_charset_data
+uninstall_charset_data:
+       if test -f $(DESTDIR)$(libdir)/charset.alias; then \
+         sed -f ref-del.sed $(DESTDIR)$(libdir)/charset.alias \
+             > $(DESTDIR)$(libdir)/t-charset.alias; \
+         if grep '^# Packages using this file: $$' \
+                 $(DESTDIR)$(libdir)/t-charset.alias > /dev/null; then \
+           rm -f $(DESTDIR)$(libdir)/charset.alias; \
+         else \
+           $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias \
+                           $(DESTDIR)$(libdir)/charset.alias; \
+         fi; \
+         rm -f $(DESTDIR)$(libdir)/t-charset.alias; \
+       fi
+
+clean: clean_charset
+clean_charset:
+       rm -f charset.alias ref-add.sed ref-del.sed
Index: groff/src/preproc/preconv/preconv.cpp
diff -u groff/src/preproc/preconv/preconv.cpp:1.8 
groff/src/preproc/preconv/preconv.cpp:1.9
--- groff/src/preproc/preconv/preconv.cpp:1.8   Tue Jan 10 06:36:00 2006
+++ groff/src/preproc/preconv/preconv.cpp       Tue Jan 10 09:43:43 2006
@@ -26,15 +26,12 @@
 #include <errno.h>
 #include "errarg.h"
 #include "error.h"
+#include "localcharset.h"
 #include "nonposix.h"
 #include "stringclass.h"
 
 #include <locale.h>
 
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-
 #if HAVE_ICONV
 # include <iconv.h>
 # ifdef WORDS_BIGENDIAN
@@ -1104,18 +1101,11 @@
   // getopt() is called since the usage message shows the default
   // encoding.
   setlocale(LC_ALL, "");
-#if HAVE_LANGINFO_CODESET
   char *locale = setlocale(LC_CTYPE, NULL);
   if (!locale || !strcmp(locale, "C") || !strcmp(locale, "POSIX"))
     default_encoding = "latin1";
-  else {
-    default_encoding = nl_langinfo(CODESET);
-    if (!default_encoding)
-      default_encoding = "latin1";
-  }
-#else
-  default_encoding = "latin1";
-#endif /* HAVE_LANGINFO_CODESET */
+  else
+    default_encoding = locale_charset();
 
   program_name = argv[0];
   int opt;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]