]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Support gcov-tool without ftw.h
authorTrevor Saunders <tsaunders@mozilla.com>
Tue, 10 Feb 2015 03:40:20 +0000 (03:40 +0000)
committerTrevor Saunders <tbsaunde@gcc.gnu.org>
Tue, 10 Feb 2015 03:40:20 +0000 (03:40 +0000)
gcc/

PR gcov-profile/61889
* config.in: regenerate.
* configure.in: Likewise.
* configure.ac: Check for ftw.h.
* gcov-tool.c: Check for ftw.h before using nftw.

From-SVN: r220566

gcc/ChangeLog
gcc/config.in
gcc/configure
gcc/configure.ac
gcc/gcov-tool.c

index d98276b80b3bfb858b72dfbf2e7d7a8f73f9450e..f21856768d22dd521b3462baf2d9b816b563b195 100644 (file)
@@ -1,3 +1,11 @@
+2015-02-09  Trevor Saunders  <tsaunders@mozilla.com>
+
+       PR gcov-profile/61889
+       * config.in: regenerate.
+       * configure.in: Likewise.
+       * configure.ac: Check for ftw.h.
+       * gcov-tool.c: Check for ftw.h before using nftw.
+
 2015-02-09  Trevor Saunders  <tsaunders@mozilla.com>
 
        PR lto/64076
index f34adb57e6ddd9a71f4ed53bafb7c1f080e17d18..7bde5b1509d4d1a4fa6a5ec9c259ce092bebe959 100644 (file)
 #endif
 
 
+/* Define to 1 if you have the <ftw.h> header file. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_FTW_H
+#endif
+
+
 /* Define to 1 if you have the `fwrite_unlocked' function. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_FWRITE_UNLOCKED
index 1bf43589ae6bfbdf0d94d2f391ccc7f0275e6485..1a35d5a186aecc587f44ad7373de5f5ab4b80d29 100755 (executable)
@@ -8448,7 +8448,7 @@ $as_echo "#define GWINSZ_IN_SYS_IOCTL 1" >>confdefs.h
 fi
 
 for ac_header in limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \
-                fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
+                fcntl.h ftw.h unistd.h sys/file.h sys/time.h sys/mman.h \
                 sys/resource.h sys/param.h sys/times.h sys/stat.h \
                 direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h
 do :
index 102dab966fd827606293a62d53e84c8247ddc057..a553a653f92bffa17ea96b7945c53a07a2e0fec4 100644 (file)
@@ -1028,7 +1028,7 @@ ACX_HEADER_STRING
 AC_HEADER_SYS_WAIT
 AC_HEADER_TIOCGWINSZ
 AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \
-                fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
+                fcntl.h ftw.h unistd.h sys/file.h sys/time.h sys/mman.h \
                 sys/resource.h sys/param.h sys/times.h sys/stat.h \
                 direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h)
 
index 0f97b532d7f34234d1295ef984a873611b5c4498..d63ad1c102ebe2023ffe9d22ab5970e2025faade 100644 (file)
@@ -35,7 +35,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include <stdio.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#if HAVE_FTW_H
 #include <ftw.h>
+#endif
 #include <getopt.h>
 
 extern int gcov_profile_merge (struct gcov_info*, struct gcov_info*, int, int);
@@ -49,6 +51,8 @@ extern void gcov_set_verbose (void);
 /* Set to verbose output mode.  */
 static bool verbose;
 
+#if HAVE_FTW_H
+
 /* Remove file NAME if it has a gcda suffix. */
 
 static int
@@ -69,13 +73,18 @@ unlink_gcda_file (const char *name,
 
   return ret;
 }
+#endif
 
 /* Remove the gcda files in PATH recursively.  */
 
 static int
-unlink_profile_dir (const char *path)
+unlink_profile_dir (const char *path ATTRIBUTE_UNUSED)
 {
+#if HAVE_FTW_H
     return nftw(path, unlink_gcda_file, 64, FTW_DEPTH | FTW_PHYS);
+#else
+    return -1;
+#endif
 }
 
 /* Output GCOV_INFO lists PROFILE to directory OUT. Note that