This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] libstdc++/66018 avoid AC_SEARCH_LIBS test
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 14 May 2015 12:47:27 +0100
- Subject: [patch] libstdc++/66018 avoid AC_SEARCH_LIBS test
- Authentication-results: sourceware.org; auth=none
The AC_STRUCT_DIRENT_D_TYPE autoconf macro expands to include
AC_SEARCH_LIBS for opendir, which can't be used when cross-compiling.
We don't actually care about crufty old systems that put opendir()
somewhere weird, so this just replaces AC_STRUCT_DIRENT_D_TYPE with a
manual check for the part we care about.
Tested powerpc64le-linux, committed to trunk.
commit 3f1454f94017afa9bb0f049fefba0d0f5bd229b4
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Thu May 14 12:31:17 2015 +0100
PR libstdc++/66018
* acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for struct
dirent.d_type.
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac (AC_STRUCT_DIRENT_D_TYPE): Remove.
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 46e303c..b2b48cc 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -3875,6 +3875,22 @@ dnl
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -fno-exceptions"
dnl
+ AC_MSG_CHECKING([for struct dirent.d_type])
+ AC_CACHE_VAL(glibcxx_cv_dirent_d_type, [dnl
+ GCC_TRY_COMPILE_OR_LINK(
+ [#include <dirent.h>],
+ [
+ struct dirent d;
+ if (sizeof d.d_type) return 0;
+ ],
+ [glibcxx_cv_dirent_d_type=yes],
+ [glibcxx_cv_dirent_d_type=no])
+ ])
+ if test $glibcxx_cv_dirent_d_type = yes; then
+ AC_DEFINE(_GLIBCXX_HAVE_STRUCT_DIRENT_D_TYPE, 1, [Define to 1 if `d_type' is a member of `struct dirent'.])
+ fi
+ AC_MSG_RESULT($glibcxx_cv_dirent_d_type)
+dnl
AC_MSG_CHECKING([for realpath])
AC_CACHE_VAL(glibcxx_cv_realpath, [dnl
GCC_TRY_COMPILE_OR_LINK(
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index 7eac8a1..96ff16f 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -403,7 +403,6 @@ GLIBCXX_CHECK_GTHREADS
# For Filesystem TS.
AC_CHECK_HEADERS([fcntl.h dirent.h sys/statvfs.h utime.h])
-AC_STRUCT_DIRENT_D_TYPE
GLIBCXX_ENABLE_FILESYSTEM_TS
GLIBCXX_CHECK_FILESYSTEM_DEPS