Tcl Source Code

Artifact [89fc55e82c]
Login

Artifact 89fc55e82c9d55da60a5d8d621ea911b5f654a25:

Attachment "tcl.diff" to ticket [1073524fff] added by gniibe 2004-11-26 10:27:01.
Index: unix/configure.in
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/configure.in,v
retrieving revision 1.122
diff -u -3 -p -r1.122 configure.in
--- unix/configure.in	19 Nov 2004 14:48:33 -0000	1.122
+++ unix/configure.in	26 Nov 2004 03:13:48 -0000
@@ -217,17 +217,21 @@ AC_CHECK_FUNC(memmove, , [
 #--------------------------------------------------------------------
 
 AC_MSG_CHECKING([proper strstr implementation])
-AC_TRY_RUN([
-extern int strstr();
-int main()
-{
-    exit(strstr("\0test", "test") ? 1 : 0);
-}
-], tcl_ok=yes, tcl_ok=no, tcl_ok=no)
-if test $tcl_ok = yes; then
-    AC_MSG_RESULT(yes)
-else
-    AC_MSG_RESULT([broken, using substitute])
+AC_CACHE_VAL(tcl_cv_proper_strstr,
+    AC_TRY_RUN([
+        extern int strstr();
+	int main()
+	{
+	    exit(strstr("\0test", "test") ? 1 : 0);
+	}
+    ],
+    tcl_cv_proper_strstr=yes,
+    tcl_cv_proper_strstr=no,
+    tcl_cv_proper_strstr=no)
+)
+AC_MSG_RESULT($tcl_cv_proper_strstr)
+if test $tcl_cv_proper_strstr = no; then
+    test -n "$verbose" && echo "	Adding strstr.o."
     AC_LIBOBJ([strstr])
     USE_COMPAT=1
 fi
@@ -238,21 +242,27 @@ fi
 #	pointer for the string "0".
 #--------------------------------------------------------------------
 
-AC_CHECK_FUNC(strtoul, tcl_ok=1, tcl_ok=0)
-AC_TRY_RUN([
-extern int strtoul();
-int main()
-{
-    char *string = "0";
-    char *term;
-    int value;
-    value = strtoul(string, &term, 0);
-    if ((value != 0) || (term != (string+1))) {
-        exit(1);
-    }
-    exit(0);
-}], , tcl_ok=0, tcl_ok=0)
-if test "$tcl_ok" = 0; then
+AC_MSG_CHECKING([proper strtoul implementation])
+AC_CACHE_VAL(tcl_cv_proper_strtoul,
+    AC_TRY_RUN([
+        extern int strtoul();
+        int main()
+        {
+            char *string = "0";
+            char *term;
+            int value;
+            value = strtoul(string, &term, 0);
+            if ((value != 0) || (term != (string+1))) {
+                exit(1);
+            }
+            exit(0);
+        }],
+	tcl_cv_proper_strtoul=yes,
+	tcl_cv_proper_strtoul=no,
+	tcl_cv_proper_strtoul=no)
+)
+AC_MSG_RESULT($tcl_cv_proper_strtoul)
+if test $tcl_cv_proper_strtoul = no; then
     test -n "$verbose" && echo "	Adding strtoul.o."
     AC_LIBOBJ([strtoul])
     USE_COMPAT=1
@@ -263,21 +273,27 @@ fi
 #	versions of Linux strtod mis-parses strings starting with "+".
 #--------------------------------------------------------------------
 
-AC_CHECK_FUNC(strtod, tcl_ok=1, tcl_ok=0)
-AC_TRY_RUN([
-extern double strtod();
-int main()
-{
-    char *string = " +69";
-    char *term;
-    double value;
-    value = strtod(string, &term);
-    if ((value != 69) || (term != (string+4))) {
-	exit(1);
-    }
-    exit(0);
-}], , tcl_ok=0, tcl_ok=0)
-if test "$tcl_ok" = 0; then
+AC_MSG_CHECKING([proper strtod implementation])
+AC_CACHE_VAL(tcl_cv_proper_strtoul,
+    AC_TRY_RUN([
+        extern double strtod();
+        int main()
+        {
+            char *string = " +69";
+            char *term;
+            double value;
+            value = strtod(string, &term);
+            if ((value != 69) || (term != (string+4))) {
+        	exit(1);
+            }
+            exit(0);
+        }],
+	tcl_cv_proper_strtod=yes,
+	tcl_cv_proper_strtod=no,
+	tcl_cv_proper_strtod=no)
+)
+AC_MSG_RESULT($tcl_cv_proper_strtod)
+if test $tcl_cv_proper_strtod = no; then
     test -n "$verbose" && echo "	Adding strtod.o."
     AC_LIBOBJ([strtod])
     USE_COMPAT=1