File: ax_include_strcasecmp.m4

package info (click to toggle)
autoconf-archive 20160916-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 7,960 kB
  • sloc: sh: 694; python: 62; makefile: 49
file content (55 lines) | stat: -rw-r--r-- 1,904 bytes parent folder | download | duplicates (3)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# ===========================================================================
#   http://www.gnu.org/software/autoconf-archive/ax_include_strcasecmp.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_INCLUDE_STRCASECMP
#
# DESCRIPTION
#
#   This macro tries to find a header for strcasecmp() in strings.h, then
#   string.h, and AC_DEFINEs AX_STRCASECMP_HEADER to the value it found. Use
#   it in your source like so:
#
#     #ifdef AX_STRCASECMP_HEADER
#     #include AX_STRCASECMP_HEADER
#     #endif
#
# LICENSE
#
#   Copyright (c) 2012 Leo Davis <ldavis@speechfxinc.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 1

AC_DEFUN([AX_INCLUDE_STRCASECMP],
[
AC_CACHE_CHECK([for strcasecmp header file], [ax_cv_include_strcasecmp_found], [
        ax_cv_include_strcasecmp_found=no
        AC_TRY_LINK(
                [ #include <strings.h> ],
                [ strcasecmp("foo", "bar"); ],
                [ax_cv_include_strcasecmp_found='<strings.h>'],
                [ax_cv_include_strcasecmp_found=no])

        if test x"$ax_cv_include_strcasecmp_found" = "xno"
        then
        AC_TRY_LINK(
                [ #include <string.h> ],
                [ strcasecmp("foo", "bar"); ],
                [ax_cv_include_strcasecmp_found='<string.h>'],
                [ax_cv_include_strcasecmp_found=no])
        fi
])
        if test x"$ax_cv_include_strcasecmp_found" != "xno"
        then
            AC_DEFINE_UNQUOTED([AX_STRCASECMP_HEADER], [$ax_cv_include_strcasecmp_found],
                                                       [Defined to <strings.h> or <string.h> if strcasecmp is found])

        fi
]) dnl AX_INCLUDE_STRCASECMP