]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - crypto/heimdal/cf/have-pragma-weak.m4
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / crypto / heimdal / cf / have-pragma-weak.m4
1 dnl $Id: have-pragma-weak.m4 15435 2005-06-16 19:45:52Z lha $
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;
18
19 int t(void) {
20   return foo;
21 }
22
23 int main(int argc, char **argv) {
24   return t();
25 }
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
29 fi
30 rm -rf conftest*
31 ])
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
34 fi
35 AC_MSG_RESULT($ac_have_pragma_weak)
36 fi
37 ])