1*ebfedea0SLionel Sambucdnl Id 2*ebfedea0SLionel Sambucdnl 3*ebfedea0SLionel SambucAC_DEFUN([AC_HAVE_PRAGMA_WEAK], [ 4*ebfedea0SLionel Sambucif test "${enable_shared}" = "yes"; then 5*ebfedea0SLionel SambucAC_MSG_CHECKING(for pragma weak) 6*ebfedea0SLionel SambucAC_CACHE_VAL(ac_have_pragma_weak, [ 7*ebfedea0SLionel Sambucac_have_pragma_weak=no 8*ebfedea0SLionel Sambuccat > conftest_foo.$ac_ext <<'EOF' 9*ebfedea0SLionel Sambuc[#]line __oline__ "configure" 10*ebfedea0SLionel Sambuc#include "confdefs.h" 11*ebfedea0SLionel Sambuc#pragma weak foo = _foo 12*ebfedea0SLionel Sambucint _foo = 17; 13*ebfedea0SLionel SambucEOF 14*ebfedea0SLionel Sambuccat > conftest_bar.$ac_ext <<'EOF' 15*ebfedea0SLionel Sambuc[#]line __oline__ "configure" 16*ebfedea0SLionel Sambuc#include "confdefs.h" 17*ebfedea0SLionel Sambucextern int foo; 18*ebfedea0SLionel Sambuc 19*ebfedea0SLionel Sambucint t(void) { 20*ebfedea0SLionel Sambuc return foo; 21*ebfedea0SLionel Sambuc} 22*ebfedea0SLionel Sambuc 23*ebfedea0SLionel Sambucint main(int argc, char **argv) { 24*ebfedea0SLionel Sambuc return t(); 25*ebfedea0SLionel Sambuc} 26*ebfedea0SLionel SambucEOF 27*ebfedea0SLionel Sambucif AC_TRY_EVAL('CC -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest_foo.$ac_ext conftest_bar.$ac_ext 1>&AC_FD_CC'); then 28*ebfedea0SLionel Sambucac_have_pragma_weak=yes 29*ebfedea0SLionel Sambucfi 30*ebfedea0SLionel Sambucrm -rf conftest* 31*ebfedea0SLionel Sambuc]) 32*ebfedea0SLionel Sambucif test "$ac_have_pragma_weak" = "yes"; then 33*ebfedea0SLionel Sambuc AC_DEFINE(HAVE_PRAGMA_WEAK, 1, [Define this if your compiler supports \`#pragma weak.'])dnl 34*ebfedea0SLionel Sambucfi 35*ebfedea0SLionel SambucAC_MSG_RESULT($ac_have_pragma_weak) 36*ebfedea0SLionel Sambucfi 37*ebfedea0SLionel Sambuc]) 38