Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | From a05eba68c42222f02465d7ba376015926433c531 Mon Sep 17 00:00:00 2001 |
| 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
| 3 | Date: Wed, 26 Jul 2017 13:37:49 +0300 |
| 4 | Subject: [PATCH] Fix build with gperf 3.1 |
| 5 | |
| 6 | The generated gperf file refers to size_t which needs to be |
| 7 | provided by stddef.h include. Also, adjust the makefile |
| 8 | to match the declaration in the gperf file. |
| 9 | |
| 10 | Upstream-Status: Pending |
| 11 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
| 12 | |
| 13 | --- |
| 14 | libcap/Makefile | 4 ++-- |
| 15 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 16 | |
| 17 | diff --git a/libcap/Makefile b/libcap/Makefile |
| 18 | index d189777..1a57206 100644 |
| 19 | --- a/libcap/Makefile |
| 20 | +++ b/libcap/Makefile |
| 21 | @@ -22,7 +22,7 @@ all: $(MINLIBNAME) $(STALIBNAME) libcap.pc |
| 22 | |
| 23 | ifeq ($(BUILD_GPERF),yes) |
| 24 | USE_GPERF_OUTPUT = $(GPERF_OUTPUT) |
| 25 | -INCLUDE_GPERF_OUTPUT = -include $(GPERF_OUTPUT) |
| 26 | +INCLUDE_GPERF_OUTPUT = -include stddef.h -include $(GPERF_OUTPUT) |
| 27 | endif |
| 28 | |
| 29 | libcap.pc: libcap.pc.in |
| 30 | @@ -41,7 +41,7 @@ cap_names.h: _makenames |
| 31 | ./_makenames > cap_names.h |
| 32 | |
| 33 | $(GPERF_OUTPUT): cap_names.list.h |
| 34 | - perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@ |
| 35 | + perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, register size_t);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@ |
| 36 | |
| 37 | cap_names.list.h: Makefile $(KERNEL_HEADERS)/linux/capability.h |
| 38 | @echo "=> making $@ from $(KERNEL_HEADERS)/linux/capability.h" |
| 39 | -- |
| 40 | 2.13.2 |
| 41 | |