Control: tags -1 patch

On Fri, 19 Jan 2018 07:03:51 +0200 Adrian Bunk <b...@debian.org> wrote:
> Source: vpcs
> ...
> gcc  -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat 
> -Werror=format-security -DLinux -Wall -I. -DTAP -DHV -Wno-strict-aliasing -c 
> hv.c
> In file included from hv.c:45:0:
> ./getopt.h:53:5: error: conflicting types for 'getopt'
>  int getopt(int argc, char** argv, char* optstr);
>      ^~~~~~
> In file included from /usr/include/x86_64-linux-gnu/bits/getopt_posix.h:27:0,
>                  from /usr/include/unistd.h:872,
>                  from hv.c:33:
> /usr/include/x86_64-linux-gnu/bits/getopt_core.h:91:12: note: previous 
> declaration of 'getopt' was here
>  extern int getopt (int ___argc, char *const *___argv, const char 
> *__shortopts)

I came up with the attached patch that renames src/getopt.h to force the use of
/usr/include/getopt.h from libc6-dev. Fixes the FTBFS for me on amd64.

Regards,
Juhani
diff --git a/debian/rules b/debian/rules
index bc09966..acdb8b9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,7 +22,11 @@ export DEB_LDFLAGS_MAINT_APPEND = -lpthread -lutil -s
 	dh $@
 
 override_dh_auto_build:
+	# src/getopt.h clashes with /usr/include/getopt.h
+	mv src/getopt.h src/getopt.h_RENAMED
 	dh_auto_build
+	mv src/getopt.h_RENAMED src/getopt.h
+
 	sed -n -e '1,/History/!p' readme.txt > CHANGELOG
 
 override_dh_auto_clean:

Reply via email to