+2001-03-11 Bruno Haible <haible@clisp.cons.org>
+
+ * configure.in: Use AM_FUNC_GETLINE instead of
+ AC_REPLACE_FUNCS(getline). Needed for HP-UX 10.
+
2001-03-11 Bruno Haible <haible@clisp.cons.org>
* configure.in: Pass 'need-ngettext' to AM_GNU_GETTEXT.
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.13)
-AC_REVISION($Revision: 1.17 $)
+AC_REVISION($Revision: 1.18 $)
AC_INIT(src/msgfmt.c)
AM_INIT_AUTOMAKE(gettext, 0.10.36)
RELEASE_DATE=2001-03-09 dnl in "date +%Y-%m-%d" format
AC_FUNC_ALLOCA
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([getcwd mblen memcpy strchr strerror uname])
-AC_REPLACE_FUNCS([getline memmove memset stpcpy stpncpy strcspn \
+AC_REPLACE_FUNCS([memmove memset stpcpy stpncpy strcspn \
strncasecmp strstr strtoul vasprintf])
-if test $ac_cv_func_getline != yes; then
+AM_FUNC_GETLINE
+if test $am_cv_func_working_getline != yes; then
AC_CHECK_FUNCS(getdelim)
fi
+2001-03-11 Bruno Haible <haible@clisp.cons.org>
+
+ * getline.m4: New file, from fileutils-4.0.41 with modifications.
+ * Makefile.am (EXTRA_DIST): Add it.
+
2001-03-11 Bruno Haible <haible@clisp.cons.org>
* gettext.m4 (AM_WITH_NLS): Accept a second argument 'need-ngettext'.
# find . -type f -name '*.m4' -printf '%f\n'|sort |fmt |tr '\012' @ \
# |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012'
EXTRA_DIST = README \
-c-bs-a.m4 codeset.m4 gettext.m4 iconv.m4 inttypes_h.m4 isc-posix.m4 \
-lcmessage.m4 libtool.m4 progtest.m4 setlocale.m4 signed.m4 uintmax_t.m4 \
-ulonglong.m4
+c-bs-a.m4 codeset.m4 getline.m4 gettext.m4 iconv.m4 inttypes_h.m4 \
+isc-posix.m4 lcmessage.m4 libtool.m4 progtest.m4 setlocale.m4 signed.m4 \
+uintmax_t.m4 ulonglong.m4
--- /dev/null
+#serial 4
+
+dnl See if there's a working, system-supplied version of the getline function.
+dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
+dnl have a function by that name in -linet that doesn't have anything
+dnl to do with the function we need.
+AC_DEFUN([AM_FUNC_GETLINE],
+[dnl
+ am_getline_needs_run_time_check=no
+ AC_CHECK_FUNC(getline,
+ dnl Found it in some library. Verify that it works.
+ am_getline_needs_run_time_check=yes,
+ am_cv_func_working_getline=no)
+ if test $am_getline_needs_run_time_check = yes; then
+ AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
+ [echo fooN |tr -d '\012'|tr N '\012' > conftest.data
+ AC_TRY_RUN([
+# include <stdio.h>
+# include <sys/types.h>
+# include <string.h>
+ int main ()
+ { /* Based on a test program from Karl Heuer. */
+ char *line = NULL;
+ size_t siz = 0;
+ int len;
+ FILE *in = fopen ("./conftest.data", "r");
+ if (!in)
+ return 1;
+ len = getline (&line, &siz, in);
+ exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
+ }
+ ], am_cv_func_working_getline=yes dnl The library version works.
+ , am_cv_func_working_getline=no dnl The library version does NOT work.
+ , am_cv_func_working_getline=no dnl We're cross compiling.
+ )])
+ fi
+
+ if test $am_cv_func_working_getline = no; then
+ LIBOBJS="$LIBOBJS getline.${ac_objext}"
+ AC_SUBST(LIBOBJS)
+ fi
+])