This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] update CY_WITH_NLS macro in intl/aclocal.m4


The CY_WITH_NLS macro in intl/aclocal.m4 is based on a very old version
of AM_WITH_NLS that has several problems.  I've merged in the changes
from serial 003 to serial 107 of AM_WITH_NLS.  Here is the patch:


  2001-01-01  Fred Fish  <fnf@be.com>

	* aclocal.m4 (CY_WITH_NLS): Update from serial 3 to serial 107
	using AM_WITH_NLS serial 107 from various released GNU packages.

Index: aclocal.m4
===================================================================
RCS file: /cvs/src/src/intl/aclocal.m4,v
retrieving revision 1.1.1.1
diff -c -p -r1.1.1.1 aclocal.m4
*** aclocal.m4	1999/05/03 07:29:05	1.1.1.1
--- aclocal.m4	2001/01/02 06:44:52
*************** AC_SUBST(INSTALL_SCRIPT)dnl
*** 48,60 ****
  # Macro to add for using GNU gettext.
  # Ulrich Drepper <drepper@cygnus.com>, 1995.
  #
! # This file file be copied and used freely without restrictions.  It can
  # be used in projects which are not available under the GNU Public License
  # but which still want to provide support for the GNU gettext functionality.
  # Please note that the actual code is *not* freely available.
  
! # serial 3
  
  AC_DEFUN(CY_WITH_NLS,
    [AC_MSG_CHECKING([whether NLS is requested])
      dnl Default is enabled NLS
--- 48,62 ----
  # Macro to add for using GNU gettext.
  # Ulrich Drepper <drepper@cygnus.com>, 1995.
  #
! # This file can be copied and used freely without restrictions.  It can
  # be used in projects which are not available under the GNU Public License
  # but which still want to provide support for the GNU gettext functionality.
  # Please note that the actual code is *not* freely available.
  
! # serial 107
  
+ AC_PREREQ(2.13)               dnl Minimum Autoconf version required.
+ 
  AC_DEFUN(CY_WITH_NLS,
    [AC_MSG_CHECKING([whether NLS is requested])
      dnl Default is enabled NLS
*************** AC_DEFUN(CY_WITH_NLS,
*** 68,74 ****
  
      dnl If we use NLS figure out what method
      if test "$USE_NLS" = "yes"; then
!       AC_DEFINE(ENABLE_NLS)
        AC_MSG_CHECKING([whether included gettext is requested])
        AC_ARG_WITH(included-gettext,
          [  --with-included-gettext use the GNU gettext library included here],
--- 70,76 ----
  
      dnl If we use NLS figure out what method
      if test "$USE_NLS" = "yes"; then
!       AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested.])
        AC_MSG_CHECKING([whether included gettext is requested])
        AC_ARG_WITH(included-gettext,
          [  --with-included-gettext use the GNU gettext library included here],
*************** AC_DEFUN(CY_WITH_NLS,
*** 93,108 ****
  
  	   if test "$gt_cv_func_gettext_libc" != "yes"; then
  	     AC_CHECK_LIB(intl, bindtextdomain,
! 	       [AC_CACHE_CHECK([for gettext in libintl],
! 		 gt_cv_func_gettext_libintl,
! 		 [AC_TRY_LINK([], [return (int) gettext ("")],
! 		 gt_cv_func_gettext_libintl=yes,
! 		 gt_cv_func_gettext_libintl=no)])])
  	   fi
  
  	   if test "$gt_cv_func_gettext_libc" = "yes" \
! 	      || test "$gt_cv_func_gettext_libintl" = "yes"; then
! 	      AC_DEFINE(HAVE_GETTEXT)
  	      AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
  		[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
  	      if test "$MSGFMT" != "no"; then
--- 95,107 ----
  
  	   if test "$gt_cv_func_gettext_libc" != "yes"; then
  	     AC_CHECK_LIB(intl, bindtextdomain,
! 	       [AC_CHECK_LIB(intl, gettext)])
  	   fi
  
  	   if test "$gt_cv_func_gettext_libc" = "yes" \
! 	      || test "$ac_cv_lib_intl_gettext" = "yes"; then
! 	      AC_DEFINE(HAVE_GETTEXT, 1,
! 	  [Define to 1 if you have gettext and don't want to use GNU gettext.])
  	      AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
  		[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
  	      if test "$MSGFMT" != "no"; then
*************** AC_DEFUN(CY_WITH_NLS,
*** 159,165 ****
  	  : ;
  	else
  	  AC_MSG_RESULT(
! 	    [found xgettext programs is not GNU xgettext; ignore it])
  	  XGETTEXT=":"
  	fi
        fi
--- 158,164 ----
  	  : ;
  	else
  	  AC_MSG_RESULT(
! 	    [found xgettext program is not GNU xgettext; ignore it])
  	  XGETTEXT=":"
  	fi
        fi
*************** AC_DEFUN(CY_WITH_NLS,
*** 171,176 ****
--- 170,184 ----
        nls_cv_header_intl=libintl.h
        nls_cv_header_libgt=libgettext.h
      fi
+     if test -z "$nls_cv_header_intl"; then
+       # Clean out junk possibly left behind by a previous configuration.
+       rm -f intl/libintl.h
+     fi
+     AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
+     AC_OUTPUT_COMMANDS(
+      [case "$CONFIG_FILES" in *po/Makefile.in*)
+         sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
+       esac])
  
      # If this is used in GNU gettext we have to set USE_NLS to `yes'
      # because some of the sources are only built for this goal.
*************** AC_DEFUN(CY_GNU_GETTEXT,
*** 215,229 ****
     AC_REQUIRE([AC_FUNC_MMAP])dnl
  
     AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
! unistd.h values.h sys/param.h])
     AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
! __argz_count __argz_stringify __argz_next])
  
     if test "${ac_cv_func_stpcpy+set}" != "set"; then
       AC_CHECK_FUNCS(stpcpy)
     fi
     if test "${ac_cv_func_stpcpy}" = "yes"; then
!      AC_DEFINE(HAVE_STPCPY)
     fi
  
     AM_LC_MESSAGES
--- 223,237 ----
     AC_REQUIRE([AC_FUNC_MMAP])dnl
  
     AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
! unistd.h sys/param.h])
     AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
! strdup __argz_count __argz_stringify __argz_next])
  
     if test "${ac_cv_func_stpcpy+set}" != "set"; then
       AC_CHECK_FUNCS(stpcpy)
     fi
     if test "${ac_cv_func_stpcpy}" = "yes"; then
!      AC_DEFINE(HAVE_STPCPY, 1, [Define to 1 if you have the stpcpy function.])
     fi
  
     AM_LC_MESSAGES
*************** __argz_count __argz_stringify __argz_nex
*** 302,316 ****
     dnl exists in srcdir.
     if test -d $srcdir/po; then
        test -d po || mkdir po
!       if test "x$srcdir" != "x."; then
! 	 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
! 	    posrcprefix="$srcdir/"
! 	 else
! 	    posrcprefix="../$srcdir/"
! 	 fi
!       else
! 	 posrcprefix="../"
!       fi
        rm -f po/POTFILES
        sed -e "/^#/d" -e "/^\$/d" -e "s,.*,	$posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
  	 < $srcdir/po/POTFILES.in > po/POTFILES
--- 310,325 ----
     dnl exists in srcdir.
     if test -d $srcdir/po; then
        test -d po || mkdir po
!       changequote(, )dnl
!       case "$srcdir" in
!       .) 
!         posrcprefix="../" ;;
!       /* | [A-Za-z]:*)
!         posrcprefix="$srcdir/" ;;
!       *)
!         posrcprefix="../$srcdir/" ;;
!       esac
!       changequote([, ])dnl
        rm -f po/POTFILES
        sed -e "/^#/d" -e "/^\$/d" -e "s,.*,	$posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
  	 < $srcdir/po/POTFILES.in > po/POTFILES

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]