aboutsummaryrefslogtreecommitdiffstats
path: root/macros/need-declaration.m4
blob: d5b7bc66d50188e0fdf70b147250dcc482eb6447 (plain) (blame)
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
dnl See whether we need a declaration for a function.
dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
AC_DEFUN(GCC_NEED_DECLARATION,
[AC_MSG_CHECKING([whether $1 must be declared])
AC_CACHE_VAL(gcc_cv_decl_needed_$1,
[AC_TRY_COMPILE([
#include <stdio.h>
#ifdef HAVE_STRING_H
#include <string.h>
#else
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
$2],
[char *(*pfn) = (char *(*)) $1],
eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")])
if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then
  AC_MSG_RESULT(yes)
  gcc_need_declarations="$gcc_need_declarations $1"
  gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  AC_DEFINE_UNQUOTED($gcc_tr_decl)
else
  AC_MSG_RESULT(no)
fi
])dnl

dnl Check multiple functions to see whether each needs a declaration.
dnl GCC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
AC_DEFUN(GCC_NEED_DECLARATIONS,
[for ac_func in $1
do
GCC_NEED_DECLARATION($ac_func, $2)
done
]
)
a190b80b4f576eba4d33c3ad5e'>bump PORTREVISION for my previous commit.ume2005-06-121-1/+1 * chase location change of fpwutils.mk during upgradingume2005-06-121-2/+2 * Reset MAINTAINER to ports@.nork2004-12-231-1/+1 * SIZEify (maintainer timeout)trevor2004-03-311-0/+1 * Fix build with a SelF-eXtracting archive in CD-ROM.nork2004-03-041-4/+6 * Utilize PORTDOCS and DOCSDIR.nork2004-03-042-5/+5 * Bump PORTREVISION on all ports that depend on gettext to aid with upgrading.marcus2004-02-041-0/+1 * utilize SITE_PERLijliao2003-10-241-1/+1 * - Update to 1.1taoka2003-09-094-10/+21 * Update MASTER_SITES.nork2003-06-211-1/+1 * Use EXTRACT_DEPENDS on japanese/freepwing rather than use BUILD_DEPENDS.nork2003-04-051-1/+1 * Clear moonlight beckons.ade2003-03-072-1/+1 * Support the original dictionary EIJIRO included in a book sold by ALC Inc.taoka2002-09-151-3/+18