]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - configure
ncurses 6.2 - patch 20210424
[ncurses.git] / configure
index a5afbc1f7b16aef01ddff23c9208cf0c553f2593..4471f97bdb95930dc1ff711cec37213ce111432e 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.729 .
+# From configure.in Revision: 1.730 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by Autoconf 2.52.20210105.
 #
@@ -8139,7 +8139,7 @@ fi
 ### Depending on the system, someone may use rpath to build ncurses but not
 # want users of the package to rely upon that feature.  Give those people an
 # option to suppress that detail from EXTRA_LDFLAGS.
-EXTRA_PKG_LDFLAGS="$EXTRA_LDFLAGS"
+EXTRA_PKG_LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
 if test -n "$EXTRA_PKG_LDFLAGS"
 then
        echo "$as_me:8145: checking if you want to disable extra LDFLAGS for package-scripts" >&5
@@ -9426,6 +9426,7 @@ else
 #line 9426 "configure"
 #include "confdefs.h"
 
+#include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #ifdef HAVE_UNISTD_H
@@ -9434,27 +9435,26 @@ else
 int main(void)
 {
        int fail = 0;
-       char *src = "config.log";
+       char *src = "conftest.tmp";
        char *dst = "conftest.chk";
-       struct stat src_sb;
-       struct stat dst_sb;
-
-       stat(src, &src_sb);
-       if ($cf_func("config.log", "conftest.chk") < 0) {
-               fail = 1;
-       } else if (stat(dst, &dst_sb) < 0) {
-               fail = 2;
-       } else {
-               long diff = (dst_sb.st_mtime - src_sb.st_mtime);
-               if (diff < 0)
-                       diff = -diff;
-               if (diff > 2)
-                       fail = 3;
+       struct stat src_sb, dst_sb;
+       FILE *fp = fopen(src, "w");
+       if (fp == 0) { fail = 3; } else {
+               fclose(fp); stat(src, &src_sb);
+               if ($cf_func(src, dst) < 0) {
+                       fail = 1;
+               } else if (stat(dst, &dst_sb) < 0) {
+                       fail = 2;
+               } else {
+                       long diff = (dst_sb.st_mtime - src_sb.st_mtime);
+                       if (diff < 0) diff = -diff;
+                       if (diff > 2) fail = 3;
+               }
        }
 #ifdef HAVE_UNLINK
-       unlink(dst);
+       unlink(dst); unlink(src);
 #else
-       remove(dst);
+       remove(dst); remove(src);
 #endif
        ${cf_cv_main_return:-return} (fail);
 }