[Rpm-maint] [PATCH 2/5] Only build bundled fts if system has a bad version that doesn't handle LFS

Panu Matilainen pmatilai at redhat.com
Fri Mar 24 09:15:46 UTC 2017


On 03/23/2017 08:21 PM, Gleb Fotengauer-Malinovskiy wrote:
> Older versions of glibc included an fts implementation that didn't have
> Large File Support on 32-bit systems.  We worked that around by bundling
> fts into rpm codebase.  Thanks to Mark Wielaard, glibc >= 2.23 has LFS
> support in fts.
>
> Unfortunately, we can't drop bundled fts because we have to support
> build with other libcs which do not implement fts at all or their
> implementations do not provide Large File Support.
>
> Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm at altlinux.org>
> ---
>  build/files.c    | 11 ++++++++++-
>  configure.ac     |  3 +++
>  misc/Makefile.am |  5 ++++-
>  3 files changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/build/files.c b/build/files.c
> index 984439d..7884768 100644
> --- a/build/files.c
> +++ b/build/files.c
> @@ -28,7 +28,16 @@
>  #include <rpm/rpmbase64.h>
>
>  #include "rpmio/rpmio_internal.h"	/* XXX rpmioSlurp */
> -#include "misc/rpmfts.h"
> +
> +#ifdef HAVE_FTS_H
> +# include <fts.h>
> +# define Fts_open fts_open
> +# define Fts_read fts_read
> +# define Fts_close fts_close
> +#else
> +# include "misc/rpmfts.h"
> +#endif
> +
>  #include "lib/rpmfi_internal.h"	/* XXX fi->apath */
>  #include "lib/rpmug.h"
>  #include "build/rpmbuild_internal.h"
> diff --git a/configure.ac b/configure.ac
> index bdcb741..687d58c 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -717,6 +717,9 @@ AC_CHECK_FUNCS(
>     [mkstemp getcwd basename dirname realpath setenv unsetenv regcomp lchown utimes],
>     [], [AC_MSG_ERROR([function required by rpm])])
>
> +AC_CHECK_HEADERS([fts.h])
> +AM_CONDITIONAL([USE_BUNDLED_FTS_KLUDGE], [test "$ac_cv_header_fts_h" = no])
> +
>  AC_LIBOBJ(fnmatch)
>

How exactly does this ensure the system fts.h is LFS compatible?

	- Panu -



More information about the Rpm-maint mailing list