summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-03-28 13:46:26 +0200
committerUlf Hermann <ulf.hermann@qt.io>2017-05-03 15:06:25 +0000
commitbc44466ccd2045eea2352f0569399fb0515b46ba (patch)
treef4b8d05a882d27ceb927aa59419d9f858ef11113
parentfdc98439e9c4a662c8c3248a823dca0cd486f6fc (diff)
Wrap fts_.h in fts.h
Change-Id: I87cc19052ded7b9ec1a3347faa05709318cc9a74 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--configure.ac18
-rw-r--r--libgnu/Makefile.am9
-rw-r--r--libgnu/fts.in.h34
3 files changed, 53 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 2488bbcd..f04a6c81 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/Makefile.am b/libgnu/Makefile.am
index 301744c6..1c8e6b8f 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
+ 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 00000000..2fc57d1f
--- /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 */