Ralf Wildenhues wrote on 2006-03-03: > the test is fine, but the build fails later: > > | xlc -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" > -DLIBDIR=\"/usr/local/lib\" -I. -I../../dummy-0/lib -I.. -D_THREAD_SAFE > -g -c ../../dummy-0/lib/poll.c > | "../../dummy-0/lib/poll.c", line 54.1: 1506-343 (S) Redeclaration of > rpl_poll differs from previous declaration on line 119 of > "/usr/include/sys/poll.h". > | "../../dummy-0/lib/poll.c", line 54.1: 1506-381 (I) The type "void*" of > parameter 1 in the prototype declaration is not compatible with the > corresponding parameter type "struct pollfd*" in the nonprototype declaration. > > because /usr/include/poll.h exists and thus the replacement header is > not added (earlier in gl_FUNC_POLL). The patch below adds it anyway in > case we deem poll() inacceptable.
Thanks. I agree with you that AIX should be treated like MacOS X here. (The bug on MacOS X led to very strange behaviour of GNU clisp on MacOS X when stdin was redirected from a pipe; similar brokenness would likely happen on AIX.) With your patch in, the variable POLL_H is modified 37 lines after it has already been AC_SUBSTed. To keep the macro maintainable, I rearrange it a bit. Bruno 2006-04-23 Bruno Haible <[EMAIL PROTECTED]> * poll.m4 (gl_FUNC_POLL): Rearrange code, so that POLL_H gets assigned exactly once. *** poll.m4.bak 2006-04-24 01:46:18.000000000 +0200 --- poll.m4 2006-04-24 01:57:49.000000000 +0200 *************** *** 8,19 **** [ AC_CHECK_HEADERS(poll.h) if test "$ac_cv_header_poll_h" = no; then ! POLL_H=poll.h else - POLL_H= - fi - AC_SUBST([POLL_H]) - AC_CHECK_FUNC(poll, [# Check whether poll() works on special files (like /dev/null) and # and ttys (like /dev/tty). On MacOS X 10.4.0 and AIX 5.3, it doesn't. --- 8,15 ---- [ AC_CHECK_HEADERS(poll.h) if test "$ac_cv_header_poll_h" = no; then ! gl_cv_func_poll=no else AC_CHECK_FUNC(poll, [# Check whether poll() works on special files (like /dev/null) and # and ttys (like /dev/tty). On MacOS X 10.4.0 and AIX 5.3, it doesn't. *************** *** 53,70 **** This is MacOSX or AIX #endif ], [gl_cv_func_poll=no], [gl_cv_func_poll=yes])])]) if test $gl_cv_func_poll = yes; then AC_DEFINE([HAVE_POLL], 1, [Define to 1 if you have the 'poll' function and it works.]) ! fi ! ! if test $gl_cv_func_poll = no; then ! POLL_H=poll.h # Avoid differing declaration from a system header. AC_LIBOBJ(poll) AC_DEFINE(poll, rpl_poll, [Define to poll if the replacement function should be used.]) gl_PREREQ_POLL fi ]) # Prerequisites of lib/poll.c. --- 49,67 ---- This is MacOSX or AIX #endif ], [gl_cv_func_poll=no], [gl_cv_func_poll=yes])])]) + fi if test $gl_cv_func_poll = yes; then + POLL_H= AC_DEFINE([HAVE_POLL], 1, [Define to 1 if you have the 'poll' function and it works.]) ! else ! POLL_H=poll.h AC_LIBOBJ(poll) AC_DEFINE(poll, rpl_poll, [Define to poll if the replacement function should be used.]) gl_PREREQ_POLL fi + AC_SUBST([POLL_H]) ]) # Prerequisites of lib/poll.c.