From: Ulf Hermann <ulf.hermann@qt.io>
To: <elfutils-devel@sourceware.org>
Subject: [PATCH] Wrap gnulib fts_.h in fts.h
Date: Thu, 04 May 2017 09:36:00 -0000 [thread overview]
Message-ID: <7274df1d-c3b6-c3cc-b7a7-36cfd6aca5c3@qt.io> (raw)
For some reason gnulib calls the headers fts_.h. We need to wrap it into
an actual fts.h to make it available.
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
---
ChangeLog | 4 ++++
configure.ac | 18 +++++++++++-------
libgnu/ChangeLog | 5 +++++
libgnu/Makefile.am | 9 ++++++++-
libgnu/fts.in.h | 34 ++++++++++++++++++++++++++++++++++
5 files changed, 62 insertions(+), 8 deletions(-)
create mode 100644 libgnu/fts.in.h
diff --git a/ChangeLog b/ChangeLog
index 30b3884..da4d288 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
+ * configure.ac: Check for fts.h before testing for BAD_FTS.
+
+2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
+
* configure.ac: Check for stdio_ext.h.
2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
diff --git a/configure.ac b/configure.ac
index 2488bbc..f04a6c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -302,13 +302,17 @@ dnl tests, because the choice of the file model can (in principle) affect
dnl whether functions and headers are available, whether they work, etc.
AC_SYS_LARGEFILE
-dnl Older glibc had a broken fts that didn't work with Large File Systems.
-dnl We want the version that can handler LFS, but include workaround if we
-dnl get a bad one. Add define to CFLAGS (not AC_DEFINE it) since we need to
-dnl check it before including config.h (which might define _FILE_OFFSET_BITS).
-AC_CACHE_CHECK([whether fts.h is bad when included (with LFS)], ac_cv_bad_fts,
- [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <fts.h>]])],
- ac_cv_bad_fts=no, ac_cv_bad_fts=yes)])
+AC_CHECK_HEADER(fts.h)
+AM_CONDITIONAL(HAVE_FTS_H, [test "x$ac_cv_header_fts_h" = "xyes"])
+if test "x$ac_cv_header_fts_h" = "xyes"; then
+ dnl Older glibc had a broken fts that didn't work with Large File Systems.
+ dnl We want the version that can handler LFS, but include workaround if we
+ dnl get a bad one. Add define to CFLAGS (not AC_DEFINE it) since we need to
+ dnl check it before including config.h (which might define _FILE_OFFSET_BITS).
+ AC_CACHE_CHECK([whether fts.h is bad when included (with LFS)], ac_cv_bad_fts,
+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <fts.h>]])],
+ ac_cv_bad_fts=no, ac_cv_bad_fts=yes)])
+fi
AS_IF([test "x$ac_cv_bad_fts" = "xyes"], [CFLAGS="$CFLAGS -DBAD_FTS=1"])
# See if we can add -D_FORTIFY_SOURCE=2. Don't do it if it is already
diff --git a/libgnu/ChangeLog b/libgnu/ChangeLog
index 2cbc87f..d6ada7c 100644
--- a/libgnu/ChangeLog
+++ b/libgnu/ChangeLog
@@ -1,5 +1,10 @@
2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
+ * Makefile.am: If fts.h is unavailable, use our own.
+ * fts.in.h: New file.
+
+2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
+
* Makefile.am: If stdio_ext.h is unavailable, use our own.
* stdio_ext.in.h: New file.
diff --git a/libgnu/Makefile.am b/libgnu/Makefile.am
index ca1a078..21f9c5f 100644
--- a/libgnu/Makefile.am
+++ b/libgnu/Makefile.am
@@ -36,7 +36,7 @@ MOSTLYCLEANFILES =
MOSTLYCLEANDIRS =
BUILT_SOURCES =
EXTRA_DIST = endian.in.h byteswap.in.h sys_mman.win32.h mman_win32.c sysconf_win32.c ar.in.h \
- features.in.h stdio_ext.in.h
+ features.in.h stdio_ext.in.h fts.in.h
CLEANFILES =
SUFFIXES =
@@ -68,6 +68,13 @@ BUILT_SOURCES += features.h
MOSTLYCLEANFILES += features.h
endif
+if !HAVE_FTS_H
+fts.h: fts.in.h
+ $(AM_V_GEN)rm -f $@ && cat $< > $@
+BUILT_SOURCES += fts.h
+MOSTLYCLEANFILES += fts.h
+endif
+
if !HAVE_SYS_MMAN_H
if USE_WIN32_MMAN
sys/mman.h: sys_mman.win32.h
diff --git a/libgnu/fts.in.h b/libgnu/fts.in.h
new file mode 100644
index 0000000..2fc57d1
--- /dev/null
+++ b/libgnu/fts.in.h
@@ -0,0 +1,34 @@
+/* Wrap fts_.h under real name
+ Copyright (C) 2017 The Qt Company Ltd
+ This file is part of elfutils.
+
+ This file is free software; you can redistribute it and/or modify
+ it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at
+ your option) any later version
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at
+ your option) any later version
+
+ or both in parallel, as here.
+
+ elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _FTS_REAL_H
+#define _FTS_REAL_H 1
+
+#include "fts_.h"
+
+#endif /* fts.h */
--
2.1.4
reply other threads:[~2017-05-04 9:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7274df1d-c3b6-c3cc-b7a7-36cfd6aca5c3@qt.io \
--to=ulf.hermann@qt.io \
--cc=elfutils-devel@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).