1 |
# getline.m4 serial 12 |
# getline.m4 serial 13 |
2 |
|
|
3 |
dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 Free Software |
dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 Free Software |
4 |
dnl Foundation, Inc. |
dnl Foundation, Inc. |
13 |
dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems |
dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems |
14 |
dnl have a function by that name in -linet that doesn't have anything |
dnl have a function by that name in -linet that doesn't have anything |
15 |
dnl to do with the function we need. |
dnl to do with the function we need. |
16 |
AC_DEFUN([AM_FUNC_GETLINE], |
AC_DEFUN([gl_FUNC_GETLINE], |
17 |
[ |
[ |
18 |
AC_LIBSOURCES([getline.c, getline.h]) |
AC_LIBSOURCES([getline.c, getline.h]) |
19 |
|
|
20 |
dnl Persuade glibc <stdio.h> to declare getline() and getdelim(). |
dnl Persuade glibc <stdio.h> to declare getline(). |
21 |
AC_REQUIRE([AC_GNU_SOURCE]) |
AC_REQUIRE([AC_GNU_SOURCE]) |
22 |
|
|
23 |
am_getline_needs_run_time_check=no |
AC_CHECK_DECLS([getline]) |
24 |
|
|
25 |
|
gl_getline_needs_run_time_check=no |
26 |
AC_CHECK_FUNC(getline, |
AC_CHECK_FUNC(getline, |
27 |
dnl Found it in some library. Verify that it works. |
dnl Found it in some library. Verify that it works. |
28 |
am_getline_needs_run_time_check=yes, |
gl_getline_needs_run_time_check=yes, |
29 |
am_cv_func_working_getline=no) |
am_cv_func_working_getline=no) |
30 |
if test $am_getline_needs_run_time_check = yes; then |
if test $gl_getline_needs_run_time_check = yes; then |
31 |
AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline, |
AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline, |
32 |
[echo fooN |tr -d '\012'|tr N '\012' > conftest.data |
[echo fooN |tr -d '\012'|tr N '\012' > conftest.data |
33 |
AC_TRY_RUN([ |
AC_TRY_RUN([ |
59 |
[Define to a replacement function name for getline().]) |
[Define to a replacement function name for getline().]) |
60 |
AC_LIBOBJ(getline) |
AC_LIBOBJ(getline) |
61 |
|
|
|
# Avoid multiple inclusions of getndelim2.o into LIBOBJS. |
|
|
# This hack won't be needed after gnulib requires Autoconf 2.58 or later. |
|
|
case " $LIB@&t@OBJS " in |
|
|
*" getndelim2.$ac_objext "* ) ;; |
|
|
*) AC_LIBOBJ(getndelim2);; |
|
|
esac |
|
|
|
|
62 |
gl_PREREQ_GETLINE |
gl_PREREQ_GETLINE |
|
gl_PREREQ_GETNDELIM2 |
|
63 |
fi |
fi |
64 |
]) |
]) |
65 |
|
|
66 |
# Prerequisites of lib/getline.c. |
# Prerequisites of lib/getline.c. |
67 |
AC_DEFUN([gl_PREREQ_GETLINE], |
AC_DEFUN([gl_PREREQ_GETLINE], |
68 |
[ |
[ |
69 |
AC_CHECK_FUNCS(getdelim) |
gl_FUNC_GETDELIM |
70 |
]) |
]) |