Include <ucred.h> if we have getpeerucred()
[heimdal.git] / cf / have-pragma-weak.m4
blobcd892bd0e003eec8e64aa8da9778432db94f0e75
1 dnl $Id$
2 dnl
3 AC_DEFUN([AC_HAVE_PRAGMA_WEAK], [
4 if test "${enable_shared}" = "yes"; then
5 AC_MSG_CHECKING(for pragma weak)
6 AC_CACHE_VAL(ac_have_pragma_weak, [
7 ac_have_pragma_weak=no
8 cat > conftest_foo.$ac_ext <<'EOF'
9 [#]line __oline__ "configure"
10 #include "confdefs.h"
11 #pragma weak foo = _foo
12 int _foo = 17;
13 EOF
14 cat > conftest_bar.$ac_ext <<'EOF'
15 [#]line __oline__ "configure"
16 #include "confdefs.h"
17 extern int foo;
19 int t(void) {
20   return foo;
23 int main(int argc, char **argv) {
24   return t();
26 EOF
27 if AC_TRY_EVAL('CC -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest_foo.$ac_ext conftest_bar.$ac_ext 1>&AC_FD_CC'); then
28 ac_have_pragma_weak=yes
30 rm -rf conftest*
32 if test "$ac_have_pragma_weak" = "yes"; then
33         AC_DEFINE(HAVE_PRAGMA_WEAK, 1, [Define this if your compiler supports \`#pragma weak.'])dnl
35 AC_MSG_RESULT($ac_have_pragma_weak)