- We have to include zlib.h explicitly when using symbols from there. - fbgrab does not link directly against zlib, and if libpng needs it, we can leave the job of finding the right libs to pkg_config
Signed-off-by: Robert Schwebel <[email protected]> --- ...001-make-makefile-cross-compilation-aware.patch | 37 ++++++++++++++++++++ .../fbgrab-1.0/0002-fbgrab-include-zlib.h.patch | 24 +++++++++++++ patches/fbgrab-1.0/fbgrab-1.0-crosscompile.diff | 37 -------------------- patches/fbgrab-1.0/series | 6 +++- rules/fbgrab.make | 2 +- 5 files changed, 67 insertions(+), 39 deletions(-) create mode 100644 patches/fbgrab-1.0/0001-make-makefile-cross-compilation-aware.patch create mode 100644 patches/fbgrab-1.0/0002-fbgrab-include-zlib.h.patch delete mode 100644 patches/fbgrab-1.0/fbgrab-1.0-crosscompile.diff diff --git a/patches/fbgrab-1.0/0001-make-makefile-cross-compilation-aware.patch b/patches/fbgrab-1.0/0001-make-makefile-cross-compilation-aware.patch new file mode 100644 index 0000000..9fd77f9 --- /dev/null +++ b/patches/fbgrab-1.0/0001-make-makefile-cross-compilation-aware.patch @@ -0,0 +1,37 @@ +From: Roland Hostettler <[email protected]> +Date: Tue, 16 Aug 2011 17:35:19 +0200 +Subject: [PATCH] make makefile cross compilation aware + +The upstream makefile is not usable for cross compilation. +[wsa] Simplified 'strip' support + +Signed-off-by: Robert Schwebel <[email protected]> +Signed-off-by: Wolfram Sang <[email protected]> +--- + Makefile | 11 +++++------ + 1 files changed, 5 insertions(+), 6 deletions(-) + +diff --git a/Makefile b/Makefile +index 14c63cb..252b098 100644 +--- a/Makefile ++++ b/Makefile +@@ -4,13 +4,12 @@ + ### + + fbgrab: fbgrab.c +- splint +posixlib fbgrab.c +- gcc -g -Wall fbgrab.c -lpng -lz -o fbgrab ++# splint +posixlib fbgrab.c ++ ${CC} ${CPPFLAGS} ${LDFLAGS} fbgrab.c -o fbgrab + + install: +- strip fbgrab +- install fbgrab /usr/bin/fbgrab +- install fbgrab.1.man /usr/man/man1/fbgrab.1 ++ install -s fbgrab ${DESTDIR}/usr/bin/fbgrab ++ install fbgrab.1.man ${DESTDIR}/usr/man/man1/fbgrab.1 + + clean: +- rm -f fbgrab *~ \#*\# +\ No newline at end of file ++ rm -f fbgrab *~ \#*\# diff --git a/patches/fbgrab-1.0/0002-fbgrab-include-zlib.h.patch b/patches/fbgrab-1.0/0002-fbgrab-include-zlib.h.patch new file mode 100644 index 0000000..6c1b33e --- /dev/null +++ b/patches/fbgrab-1.0/0002-fbgrab-include-zlib.h.patch @@ -0,0 +1,24 @@ +From: Robert Schwebel <[email protected]> +Date: Tue, 16 Aug 2011 17:36:49 +0200 +Subject: [PATCH] fbgrab: include zlib.h + +Newer libpng versions do not include zlib.h in their api any more, so if +we use symbols from there, we should include zlib.h directly. + +Signed-off-by: Robert Schwebel <[email protected]> +--- + fbgrab.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/fbgrab.c b/fbgrab.c +index fc89f5a..0c959f6 100644 +--- a/fbgrab.c ++++ b/fbgrab.c +@@ -23,6 +23,7 @@ + #include <getopt.h> + #include <sys/vt.h> /* to handle vt changing */ + #include <png.h> /* PNG lib */ ++#include <zlib.h> /* zlib */ + #include <linux/fb.h> /* to handle framebuffer ioctls */ + + #define VERSION "1.0 beta 1" diff --git a/patches/fbgrab-1.0/fbgrab-1.0-crosscompile.diff b/patches/fbgrab-1.0/fbgrab-1.0-crosscompile.diff deleted file mode 100644 index d85f71e..0000000 --- a/patches/fbgrab-1.0/fbgrab-1.0-crosscompile.diff +++ /dev/null @@ -1,37 +0,0 @@ -From: Roland Hostettler <[email protected]> -Subject: [patch] make makefile cross compilation aware - -The upstream makefile is not usable for cross compilation. -[wsa] Simplified 'strip' support - -Signed-off-by: Robert Schwebel <[email protected]> -Signed-off-by: Wolfram Sang <[email protected]> - ---- - Makefile | 10 ++++------ - 1 file changed, 4 insertions(+), 6 deletions(-) - -Index: Makefile -=================================================================== ---- a/Makefile.orig -+++ b/Makefile -@@ -4,13 +4,12 @@ - ### - - fbgrab: fbgrab.c -- splint +posixlib fbgrab.c -- gcc -g -Wall fbgrab.c -lpng -lz -o fbgrab -+# splint +posixlib fbgrab.c -+ ${CC} ${CPPFLAGS} ${LDFLAGS} fbgrab.c -o fbgrab - - install: -- strip fbgrab -- install fbgrab /usr/bin/fbgrab -- install fbgrab.1.man /usr/man/man1/fbgrab.1 -+ install -s fbgrab ${DESTDIR}/usr/bin/fbgrab -+ install fbgrab.1.man ${DESTDIR}/usr/man/man1/fbgrab.1 - - clean: -- rm -f fbgrab *~ \#*\# -\ No newline at end of file -+ rm -f fbgrab *~ \#*\# diff --git a/patches/fbgrab-1.0/series b/patches/fbgrab-1.0/series index d4a2f2b..45420ce 100644 --- a/patches/fbgrab-1.0/series +++ b/patches/fbgrab-1.0/series @@ -1 +1,5 @@ -fbgrab-1.0-crosscompile.diff +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-make-makefile-cross-compilation-aware.patch +0002-fbgrab-include-zlib.h.patch +# 07f6b94abfd5520604fa320ff0fa961c - git-ptx-patches magic diff --git a/rules/fbgrab.make b/rules/fbgrab.make index 8933354..1d320ac 100644 --- a/rules/fbgrab.make +++ b/rules/fbgrab.make @@ -47,7 +47,7 @@ FBGRAB_MAKE_ENV := $(CROSS_ENV) FBGRAB_MAKE_OPT = \ $(CROSS_ENV_CC) \ - LDFLAGS='`$(CROSS_ENV) eval $$PKG_CONFIG --libs libpng` `$(CROSS_ENV) eval $$PKG_CONFIG --libs libz` $(CROSS_LDFLAGS)' + LDFLAGS='`$(CROSS_ENV) eval $$PKG_CONFIG --libs libpng` $(CROSS_LDFLAGS)' # ---------------------------------------------------------------------------- # Target-Install -- 1.7.5.4 -- ptxdist mailing list [email protected]
