changeset 328:51bb530a100c

2003-12-7 Brian Masney <masneyb@gftp.org> * configure.in acinclude.m4 lib/misc.c - added AC_INTL_PRINTF macro. If the printf family of functions supports %'ld, then HAVE_INTL_PRINTF will be defined. The appropriate version of insert_commas() can be used.
author masneyb
date Sun, 07 Dec 2003 17:25:13 +0000
parents 98487556a058
children df4c91bf4adf
files ChangeLog acinclude.m4 configure.in lib/misc.c
diffstat 4 files changed, 41 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Dec 05 00:22:06 2003 +0000
+++ b/ChangeLog	Sun Dec 07 17:25:13 2003 +0000
@@ -1,3 +1,9 @@
+2003-12-7 Brian Masney <masneyb@gftp.org>
+	* configure.in acinclude.m4 lib/misc.c - added AC_INTL_PRINTF macro.
+	If the printf family of functions supports %'ld, then HAVE_INTL_PRINTF
+	will be defined. The appropriate version of insert_commas() can be
+	used.
+
 2003-12-4 Brian Masney <masneyb@gftp.org>
 	* src/gftp.in - check for the bin_dir for the binary location
 
@@ -1801,7 +1807,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.178 2003/12/05 00:21:14 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.179 2003/12/07 17:25:13 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/acinclude.m4	Fri Dec 05 00:22:06 2003 +0000
+++ b/acinclude.m4	Sun Dec 07 17:25:13 2003 +0000
@@ -116,8 +116,8 @@
 
 # serial 1
 
-# This function is derived from
-# http://savannah.gnu.org/cgi-bin/viewcvs/gcc/gcc/libjava/configure.in?rev=1.142.2.7&content-type=text/vnd.viewcvs-markup
+dnl This function is derived from
+dnl http://savannah.gnu.org/cgi-bin/viewcvs/gcc/gcc/libjava/configure.in?rev=1.142.2.7&content-type=text/vnd.viewcvs-markup
 
 AC_DEFUN(AC_TYPE_SOCKLEN_T,
   [AC_MSG_CHECKING([for socklen_t in sys/socket.h])
@@ -129,3 +129,28 @@
       AC_MSG_RESULT(no)])
   ])
 
+# serial 1
+
+dnl This macro checks to see if the printf family of functions supports the
+dnl %'ld format.
+
+dnl Brian Masney <masneyb@gftp.org>
+
+dnl 
+AC_DEFUN(AC_INTL_PRINTF,
+  [AC_MSG_CHECKING([whether the printf family of functions supports %'ld])
+   AC_TRY_RUN([#include <stdio.h>
+               #include <string.h>
+
+               int main(void) {
+                 char buf[20];
+                 sprintf (buf, "%'ld", (long) 1);
+                 if (strchr ('1', buf) == NULL)
+                   return (1);
+                 return (0);
+               }],
+    [AC_DEFINE(HAVE_INTL_PRINTF,1,Define if printf supports %'ld)
+     AC_MSG_RESULT(yes)],
+    [AC_MSG_RESULT(no)])
+  ])
+
--- a/configure.in	Fri Dec 05 00:22:06 2003 +0000
+++ b/configure.in	Sun Dec 07 17:25:13 2003 +0000
@@ -41,6 +41,7 @@
 AM_C_PROTOTYPES
 AC_C_CONST
 AC_C_INLINE
+AC_INTL_PRINTF
 
 AM_MAINTAINER_MODE
 
@@ -283,4 +284,4 @@
 AC_CHECK_PROG(DB2HTML, db2html, true, false)
 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
 
-AC_OUTPUT(Makefile docs/Makefile docs/sample.gftp/Makefile lib/Makefile src/gftp src/Makefile src/gtk/Makefile src/text/Makefile gftp.spec intl/Makefile po/Makefile.in )
+AC_OUTPUT(Makefile docs/Makefile docs/sample.gftp/Makefile lib/Makefile src/gftp src/Makefile src/gtk/Makefile src/text/Makefile gftp.spec intl/Makefile po/Makefile.in)
--- a/lib/misc.c	Fri Dec 05 00:22:06 2003 +0000
+++ b/lib/misc.c	Sun Dec 07 17:25:13 2003 +0000
@@ -22,7 +22,7 @@
 #include "gftp.h"
 #include "options.h"
 
-#ifdef _GNU_SOURCE
+#ifdef HAVE_INTL_PRINTF
 
 char *
 insert_commas (off_t number, char *dest_str, size_t dest_len)
@@ -359,6 +359,10 @@
   printf ("#define HAVE_GETTEXT\n");
 #endif
 
+#ifdef HAVE_INTL_PRINTF
+  printf ("#define HAVE_INTL_PRINTF\n");
+#endif
+
   printf ("glib version: %d.%d.%d\n", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION,
           GLIB_MICRO_VERSION);