Don't require -lm everywhere
[platform/upstream/automake.git] / m4 / AM_FUNC_FNMATCH.m4
1 ## --------------------------- ##
2 ## Check for a working fnmatch ##
3 ## --------------------------- ##
4
5 # serial 1
6
7 # @defmac AC_FUNC_FNMATCH
8 # @maindex FUNC_FNMATCH
9 # @ovindex LIBOBJS
10 # If the @code{fnmatch} function is not available, or does not work
11 # correctly (like the one on SunOS 5.4), add @samp{fnmatch.o} to output
12 # variable @code{LIBOBJS}.
13 # @end defmac
14
15 AC_DEFUN(AM_FUNC_FNMATCH,
16 [AC_MSG_CHECKING(for working fnmatch)
17 AC_CACHE_VAL(am_cv_func_fnmatch,
18 # Some versions of Solaris or SCO have broken fnmatch() functions!
19 # So we run a test program.  If we're cross-compiling, take no chance.
20 AC_TRY_RUN([main() { exit (fnmatch ("a*", "abc", 0) != 0); }],
21 am_cv_func_fnmatch=yes, am_cv_func_fnmatch=no, am_cv_func_fnmatch=no))
22 test $am_cv_func_fnmatch = yes || LIBOBJS="$LIBOBJS fnmatch.o"
23 AC_MSG_RESULT($am_cv_func_fnmatch)
24 ])