~ubuntu-branches/ubuntu/lucid/gco/lucid

« back to all changes in this revision

Viewing changes to macros/need-declaration.m4

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hocevar (Debian packages)
  • Date: 2006-08-31 12:35:42 UTC
  • mfrom: (3.1.2 edgy)
  • Revision ID: james.westby@ubuntu.com-20060831123542-mc4q70vmhci7jkx7
Tags: 0.5.0-6
Update package to the last python policy, courtesy of Pierre Habouzit
(Closes: #380807).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl See whether we need a declaration for a function.
2
 
dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
3
 
AC_DEFUN(GCC_NEED_DECLARATION,
4
 
[AC_MSG_CHECKING([whether $1 must be declared])
5
 
AC_CACHE_VAL(gcc_cv_decl_needed_$1,
6
 
[AC_TRY_COMPILE([
7
 
#include <stdio.h>
8
 
#ifdef HAVE_STRING_H
9
 
#include <string.h>
10
 
#else
11
 
#ifdef HAVE_STRINGS_H
12
 
#include <strings.h>
13
 
#endif
14
 
#endif
15
 
#ifdef HAVE_STDLIB_H
16
 
#include <stdlib.h>
17
 
#endif
18
 
#ifdef HAVE_UNISTD_H
19
 
#include <unistd.h>
20
 
#endif
21
 
$2],
22
 
[char *(*pfn) = (char *(*)) $1],
23
 
eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")])
24
 
if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then
25
 
  AC_MSG_RESULT(yes)
26
 
  gcc_need_declarations="$gcc_need_declarations $1"
27
 
  gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
28
 
  AC_DEFINE_UNQUOTED($gcc_tr_decl)
29
 
else
30
 
  AC_MSG_RESULT(no)
31
 
fi
32
 
])dnl
33
 
 
34
 
dnl Check multiple functions to see whether each needs a declaration.
35
 
dnl GCC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
36
 
AC_DEFUN(GCC_NEED_DECLARATIONS,
37
 
[for ac_func in $1
38
 
do
39
 
GCC_NEED_DECLARATION($ac_func, $2)
40
 
done
41
 
]
42
 
)