(jm_FUNC_GLIBC_UNLOCKED_IO): Quote first arg of AC_DEFUN.
[gnulib.git] / m4 / jm-glibc-io.m4n
1 #serial 6 -*- autoconf -*-
2
3 dnl From Jim Meyering.
4 dnl
5 dnl See if the glibc *_unlocked I/O macros are available.
6 dnl Use only those *_unlocked macros that are declared.
7 dnl
8
9 AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
10   [
11     # Kludge (not executed) to make autoheader do the right thing.
12     if test a = b; then
13       AC_CHECK_DECLS([@comma_separated@])
14       AC_CHECK_FUNCS(@space_separated@)
15     fi
16
17     io_functions='@space_separated@'
18
19     for jm_io_func in $io_functions; do
20       # Check for the existence of each function only if it is declared.
21       # Otherwise, we'd get the Solaris5.5.1 functions that are not
22       # declared, and that have been removed from Solaris5.6.  The resulting
23       # 5.5.1 binaries would not run on 5.6 due to shared library differences.
24       AC_CHECK_DECLS([$jm_io_func],
25                      jm_declared=yes,
26                      jm_declared=no,
27                      [#include <stdio.h>])
28       if test $jm_declared = yes; then
29         AC_CHECK_FUNCS($jm_io_func)
30       fi
31     done
32   ]
33 )