From c4a7fdbcc109d6e8b465a427c714926fcb85c750 Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Fri, 3 Oct 2014 13:54:09 +0100 Subject: build: unbreak attr_copy_fd() and attr_copy_file(). Mike's build-system-revamping commit 9ce21bd of January this year accidentally dropped a crucial -include of "libattr.h". This silently undefined the HAVE_F*ATTR macros, causing attr_copy_{fd,file}.c to think that xattrs are not supported and to compile the functions in those files into a 'return 0;' stub. The code in these files uses the NLS _() macro, which was recently moved into misc.h, which can only sensibly be included by things outside libattr. So migrate the NLS macros into a new nls.h at the same time, and include it from misc.h. With these fixes in place, xattrs can be copied again. --- include/Makemodule.am | 1 + include/misc.h | 10 +--------- include/nls.h | 9 +++++++++ libattr/Makemodule.am | 1 + libattr/attr_copy_fd.c | 1 + libattr/attr_copy_file.c | 1 + 6 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 include/nls.h diff --git a/include/Makemodule.am b/include/Makemodule.am index c43e2e4..e2017c5 100644 --- a/include/Makemodule.am +++ b/include/Makemodule.am @@ -6,4 +6,5 @@ pkginclude_HEADERS += \ noinst_HEADERS += \ include/misc.h \ + include/nls.h \ include/walk_tree.h diff --git a/include/misc.h b/include/misc.h index 3bab7de..8b8ec48 100644 --- a/include/misc.h +++ b/include/misc.h @@ -22,12 +22,4 @@ extern char *unquote(char *str); extern char *next_line(FILE *file); -#ifdef ENABLE_NLS -# include -# define _(x) gettext(x) -#else -# define _(x) (x) -# define textdomain(d) do { } while (0) -# define bindtextdomain(d,dir) do { } while (0) -#endif -#include +#include "nls.h" diff --git a/include/nls.h b/include/nls.h new file mode 100644 index 0000000..06f84bb --- /dev/null +++ b/include/nls.h @@ -0,0 +1,9 @@ +#ifdef ENABLE_NLS +# include +# define _(x) gettext(x) +#else +# define _(x) (x) +# define textdomain(d) do { } while (0) +# define bindtextdomain(d,dir) do { } while (0) +#endif +#include diff --git a/libattr/Makemodule.am b/libattr/Makemodule.am index 7e06e8e..5c888f0 100644 --- a/libattr/Makemodule.am +++ b/libattr/Makemodule.am @@ -17,6 +17,7 @@ libattr_la_SOURCES = \ libattr/libattr.c \ libattr/libattr.h \ libattr/syscalls.c +libattr_la_CFLAGS = -include libattr/libattr.h libattr_la_LDFLAGS = \ -Wl,--version-script,$(top_srcdir)/exports \ -version-info $(LTVERSION) diff --git a/libattr/attr_copy_fd.c b/libattr/attr_copy_fd.c index 14b7368..a21e8c2 100644 --- a/libattr/attr_copy_fd.c +++ b/libattr/attr_copy_fd.c @@ -40,6 +40,7 @@ #define ERROR_CONTEXT_MACROS #include "error_context.h" +#include "nls.h" #if !defined(ENOTSUP) # define ENOTSUP (-1) diff --git a/libattr/attr_copy_file.c b/libattr/attr_copy_file.c index 2efc224..9132433 100644 --- a/libattr/attr_copy_file.c +++ b/libattr/attr_copy_file.c @@ -40,6 +40,7 @@ #define ERROR_CONTEXT_MACROS #include "error_context.h" +#include "nls.h" #if !defined(ENOTSUP) # define ENOTSUP (-1) -- cgit v1.2.1