1 # Code swiped wholesale from the GCC project, see
2 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12100
4 # This file can go away once autoconf 2.58 is out and being used -
5 # it's reported that this is fixed in the autoconf cvs already.
7 # AC_LANG_FUNC_LINK_TRY(C)(FUNCTION)
8 # ----------------------------------
9 # Don't include <ctype.h> because on OSF/1 3.0 it includes
10 # <sys/types.h> which includes <sys/select.h> which contains a
11 # prototype for select. Similarly for bzero.
13 # A similar problem afflicts HP/UX, but it also hits <sys/time.h>
15 # This test used to merely assign f=$1 in main(), but that was
16 # optimized away by HP unbundled cc A.05.36 for ia64 under +O3,
17 # presumably on the basis that there's no need to do that store if the
18 # program is about to exit. Conversely, the AIX linker optimizes an
19 # unused external declaration that initializes f=$1. So this test
20 # program has both an external initialization of f, and a use of f in
21 # main that affects the exit status.
23 m4_define([AC_LANG_FUNC_LINK_TRY(C)],
25 [/* System header to define __stub macros and hopefully few prototypes,
26 which can conflict with char $1 (); below.
27 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
28 <limits.h> exists even on freestanding compilers. Under hpux,
29 including <limits.h> includes <sys/time.h> and causes problems
30 checking for functions defined therein. */
31 #if defined (__STDC__) && !defined (_HPUX_SOURCE)
36 /* Override any gcc2 internal prototype to avoid an error. */
41 /* We use char because int might match the return type of a gcc2
42 builtin and then its argument prototype would still apply. */
44 /* The GNU C library defines this for functions which it implements
45 to always fail with ENOSYS. Some functions are actually named
46 something starting with __ and the normal name is an alias. */
47 #if defined (__stub_$1) || defined (__stub___$1)
55 ], [return f != $1;])])