Tcl Source Code

View Ticket
Login
2020-06-24
14:47 Pending ticket [9080d6a871]: Build fix for tcl on macOS on Apple Silicon plus 5 other changes artifact: cce1e1eac7 user: jan.nijtmans
13:05
Fix [9080d6a871]: Build fix for tcl on macOS on Apple Silicon check-in: e99147d792 user: jan.nijtmans tags: core-8-5-branch
05:50 New ticket [9080d6a871] Build fix for tcl on macOS on Apple Silicon. artifact: acfd6c1ed3 user: jeremyhu

Ticket UUID: 9080d6a8719acefd900daf3e8105d27ad7780b5a
Title: Build fix for tcl on macOS on Apple Silicon
Type: Bug Version: 8.5.19
Submitter: jeremyhu Created on: 2020-06-24 05:50:57
Subsystem: - New Builtin Commands Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Pending Last Modified: 2020-06-24 14:47:37
Resolution: Fixed Closed By: nobody
    Closed on:
Description:
Implicit functions are errors on darwin/arm64, so the following changes are needed to tcl's configure scripts (in addition to the changes in https://core.tcl-lang.org/tclconfig/tktview/eb3db1c7655f5bdc9e8c511d1fbe0ca8fed70c00) to build correctly on darwin/arm64:


diff --git a/vendor/tcl8.5.19/unix/configure.in b/vendor/tcl8.5.19/unix/configure.in
index e4255b6df..af2a26a14 100755
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -453,6 +453,7 @@ fi
 AC_CACHE_CHECK([for a putenv() that copies the buffer], tcl_cv_putenv_copy, [
     AC_TRY_RUN([
 	#include <stdlib.h>
+	#include <string.h>
 	#define OURVAR "havecopy=yes"
 	int main (int argc, char *argv[])
 	{
diff --git a/vendor/tcl8.5.19/unix/tcl.m4 b/vendor/tcl8.5.19/unix/tcl.m4
index a7faae550..f482460ce 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -2587,6 +2587,7 @@ AC_DEFUN([SC_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=" ";
@@ -2864,7 +2865,10 @@ AC_DEFUN([SC_TCL_CHECK_BROKEN_FUNC],[
     AC_CHECK_FUNC($1, tcl_ok=1, tcl_ok=0)
     if test ["$tcl_ok"] = 1; then
 	AC_CACHE_CHECK([proper ]$1[ implementation], [tcl_cv_]$1[_unbroken],
-	    AC_TRY_RUN([[int main() {]$2[}]],[tcl_cv_]$1[_unbroken]=ok,
+	    AC_TRY_RUN([[
+#include <stdlib.h>
+#include <string.h>
+int main() {]$2[}]],[tcl_cv_]$1[_unbroken]=ok,
 		[tcl_cv_]$1[_unbroken]=broken,[tcl_cv_]$1[_unbroken]=unknown))
 	if test ["$tcl_cv_]$1[_unbroken"] = "ok"; then
 	    tcl_ok=1
User Comments: jan.nijtmans added on 2020-06-24 14:47:37:

Merged to core-8-5-branch. Tomorrow (After Travis gives current build results) I'll continue merging the same thing up to the other branches (core-8-6-branch, core-8-branch and trunk)

Thanks for the report and the patch!