~ubuntu-branches/ubuntu/maverick/texinfo/maverick

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2005-10-28 15:10:30 UTC
  • mto: (2.1.1 dapper) (3.1.4 hardy)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20051028151030-9nsf2s2k2z3fktjt
Tags: upstream-4.8
ImportĀ upstreamĀ versionĀ 4.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: acinclude.m4,v 1.1 1999/07/07 20:07:24 karl Exp $
2
 
# Source file used by aclocal in generating aclocal.m4.
3
 
 
4
 
#serial 3
5
 
 
6
 
AC_DEFUN(jm_CHECK_DECLARATION,
7
 
[
8
 
  AC_REQUIRE([AC_HEADER_STDC])dnl
9
 
  test -z "$ac_cv_header_memory_h" && AC_CHECK_HEADERS(memory.h)
10
 
  test -z "$ac_cv_header_string_h" && AC_CHECK_HEADERS(string.h)
11
 
  test -z "$ac_cv_header_strings_h" && AC_CHECK_HEADERS(strings.h)
12
 
  test -z "$ac_cv_header_stdlib_h" && AC_CHECK_HEADERS(stdlib.h)
13
 
  test -z "$ac_cv_header_unistd_h" && AC_CHECK_HEADERS(unistd.h)
14
 
  AC_MSG_CHECKING([whether $1 is declared])
15
 
  AC_CACHE_VAL(jm_cv_func_decl_$1,
16
 
    [AC_TRY_COMPILE($2,
17
 
      [
18
 
#ifndef $1
19
 
char *(*pfn) = (char *(*)) $1
20
 
#endif
21
 
      ],
22
 
      eval "jm_cv_func_decl_$1=yes",
23
 
      eval "jm_cv_func_decl_$1=no")])
24
 
 
25
 
  if eval "test \"`echo '$jm_cv_func_decl_'$1`\" = yes"; then
26
 
    AC_MSG_RESULT(yes)
27
 
    ifelse([$3], , :, [$3])
28
 
  else
29
 
    AC_MSG_RESULT(no)
30
 
    ifelse([$4], , , [$4
31
 
])dnl
32
 
  fi
33
 
])dnl
34
 
 
35
 
dnl jm_CHECK_DECLARATIONS(INCLUDES, FUNCTION... [, ACTION-IF-DECLARED
36
 
dnl                       [, ACTION-IF-NOT-DECLARED]])
37
 
AC_DEFUN(jm_CHECK_DECLARATIONS,
38
 
[
39
 
  for jm_func in $2
40
 
  do
41
 
    jm_CHECK_DECLARATION($jm_func, $1,
42
 
    [
43
 
      jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
44
 
      AC_DEFINE_UNQUOTED($jm_tr_func) $3], $4)dnl
45
 
  done
46
 
])
47
 
 
48
 
#serial 1
49
 
# this is check-decl.m4 in sh-utils 1.16k/m4/check-decl.m4
50
 
# with a different function list.
51
 
 
52
 
dnl This is just a wrapper function to encapsulate this kludge.
53
 
dnl Putting it in a separate file like this helps share it between
54
 
dnl different packages.
55
 
AC_DEFUN(txi_CHECK_DECLS,
56
 
[
57
 
  headers='
58
 
#include <stdio.h>
59
 
#ifdef HAVE_STRING_H
60
 
# if !STDC_HEADERS && HAVE_MEMORY_H
61
 
#  include <memory.h>
62
 
# endif
63
 
# include <string.h>
64
 
#else
65
 
# ifdef HAVE_STRINGS_H
66
 
#  include <strings.h>
67
 
# endif
68
 
#endif
69
 
#ifdef HAVE_STDLIB_H
70
 
# include <stdlib.h>
71
 
#endif
72
 
#ifdef HAVE_UNISTD_H
73
 
# include <unistd.h>
74
 
#endif
75
 
'
76
 
 
77
 
  if test x = y; then
78
 
    dnl This code is deliberately never run via ./configure.
79
 
    dnl FIXME: this is a gross hack to make autoheader put entries
80
 
    dnl for each of these symbols in the config.h.in.
81
 
    dnl Otherwise, I'd have to update acconfig.h every time I change
82
 
    dnl this list of functions.
83
 
    AC_DEFINE(HAVE_DECL_STRERROR, 1, [Define if this function is declared.])
84
 
    AC_DEFINE(HAVE_DECL_STRCASECMP, 1, [Define if this function is declared.])
85
 
    AC_DEFINE(HAVE_DECL_STRNCASECMP, 1, [Define if this function is declared.])
86
 
    AC_DEFINE(HAVE_DECL_STRCOLL, 1, [Define if this function is declared.])
87
 
  fi
88
 
 
89
 
  jm_CHECK_DECLARATIONS($headers, strerror strcasecmp strncasecmp strcoll)
90
 
])