File: etr_string_strcasecmp.m4

package info (click to toggle)
autoconf-archive 20060312-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,180 kB
  • ctags: 13
  • sloc: sh: 455; makefile: 44
file content (37 lines) | stat: -rw-r--r-- 1,201 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
dnl @synopsis ETR_STRING_STRCASECMP
dnl
dnl This macro tries to find strcasecmp() in string.h.
dnl
dnl Use this macro in conjunction with ETR_STRINGS_STRCASECMP in your
dnl configure.in like so:
dnl
dnl     ETR_STRING_STRCASECMP
dnl     if test x"$ac_cv_string_strcasecmp" = "xno" ; then
dnl         ETR_STRINGS_STRCASECMP
dnl     fi
dnl
dnl This will cause either HAVE_STRING_STRCASECMP or
dnl HAVE_STRINGS_STRCASECMP to be defined in config.h, which will tell
dnl your code what header to include to get strcasecmp()'s prototype.
dnl
dnl @category C
dnl @author Warren Young <warren@etr-usa.com>
dnl @version 2001-05-25
dnl @license AllPermissive

AC_DEFUN([ETR_STRING_STRCASECMP],
[
AC_CACHE_CHECK([for strcasecmp() in string.h], ac_cv_string_strcasecmp, [
        AC_TRY_LINK(
                [ #include <string.h> ],
                [ strcasecmp("foo", "bar"); ],
                ac_cv_string_strcasecmp=yes,
                ac_cv_string_strcasecmp=no)
])

        if test x"$ac_cv_string_strcasecmp" = "xyes"
        then
                AC_DEFINE(HAVE_STRING_STRCASECMP, 1,
                        [ Define if your system has strcasecmp() in string.h ])
        fi
]) dnl ETR_STRING_STRCASECMP