The test for samba_cv_HAVE_GETTIMEOFDAY_TZ uses AC_TRY_RUN, but AC_TRY_LINK (or the new spelling, AC_LINK_IFELSE) would be sufficient and more friendly to cross-compilers. Jon Masters made a patch for this (and something else) at http://lists.samba.org/archive/samba-technical/2004-October/037724.html
Fixed in rev 22821.