https://github.com/macports/macports-base/commit/aeda00dfd7aa26fa4b78ac30d76ea64cdf0a4408

diff --git a/vendor/thread2.7.3/configure b/vendor/thread2.7.3/configure
index 621bf8cd1..e8e4a7b1c 100755
--- a/vendor/thread2.7.3/configure
+++ b/vendor/thread2.7.3/configure
@@ -4003,6 +4003,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ctype.h>
+#include <stdlib.h>
 #if ((' ' & 0x0FF) == 0x020)
 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
diff --git a/vendor/thread2.7.3/tclconfig/tcl.m4 b/vendor/thread2.7.3/tclconfig/tcl.m4
index f679256fd..328508f31 100644
--- a/vendor/thread2.7.3/tclconfig/tcl.m4
+++ b/vendor/thread2.7.3/tclconfig/tcl.m4
@@ -2584,6 +2584,7 @@ AC_DEFUN([TEA_BUGGY_STRTOD], [
     if test "$tcl_strtod" = 1; then
 	AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[
 	    AC_TRY_RUN([
+		#include <stdlib.h>
 		extern double strtod();
 		int main() {
 		    char *infString="Inf", *nanString="NaN", *spaceString=" ";
