This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 36a72a1ec467da8e2b49ed57e98be58f911d01f7 (commit) via 3c4a561ca197f91aa1b3040a18ced825667e63dc (commit) from 42ad59f700932298c5d6441054ca7d6d7590a9e1 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/36a72a1ec467da8e2b49ed57e98be58f911d0...
commit 36a72a1ec467da8e2b49ed57e98be58f911d01f7 Author: Cyril Hrubis metan@ucw.cz Date: Fri Dec 9 17:48:08 2011 +0100
build: Now jpeg or libpng could be disabled by configure.
diff --git a/include/core/GP_Common.h b/include/core/GP_Common.h index cae989e..62ba32c 100644 --- a/include/core/GP_Common.h +++ b/include/core/GP_Common.h @@ -19,12 +19,12 @@ * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2010 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-#ifndef GP_COMMON_H -#define GP_COMMON_H +#ifndef CORE_GP_COMMON_H +#define CORE_GP_COMMON_H
#include <stdio.h> #include <stdint.h> @@ -70,6 +70,8 @@ #endif #endif
+#define GP_UNUSED(x) (x)__attribute__ ((unused)) + /* * Internal macros with common code for GP_ABORT, GP_ASSERT and GP_CHECK. * GP_INTERNAL_ABORT takes a message that may contain % (e.g. assert condition) @@ -149,4 +151,4 @@ (_a > 0) ? 1 : ((_a < 0) ? -1 : 0); })
-#endif /* GP_COMMON_H */ +#endif /* CORE_GP_COMMON_H */ diff --git a/libs/loaders/GP_JPG.c b/libs/loaders/GP_JPG.c index db3de62..4ea6e35 100644 --- a/libs/loaders/GP_JPG.c +++ b/libs/loaders/GP_JPG.c @@ -34,10 +34,14 @@ #include <stdio.h> #include <setjmp.h>
-#include <jpeglib.h> +#include "../../config.h" +#include "core/GP_Debug.h"
#include "GP_JPG.h" -#include "core/GP_Debug.h" + +#ifdef HAVE_JPEG + +#include <jpeglib.h>
GP_RetCode GP_OpenJPG(const char *src_path, FILE **f) { @@ -285,3 +289,34 @@ err1: unlink(dst_path); return ret; } + +#else + +GP_RetCode GP_OpenJPG(const char GP_UNUSED(*src_path), + FILE GP_UNUSED(**f)) +{ + return GP_ENOIMPL; +} + +GP_RetCode GP_ReadJPG(FILE GP_UNUSED(*f), + GP_Context GP_UNUSED(**res), + GP_ProgressCallback GP_UNUSED(*callback)) +{ + return GP_ENOIMPL; +} + +GP_RetCode GP_LoadJPG(const char GP_UNUSED(*src_path), + GP_Context GP_UNUSED(**res), + GP_ProgressCallback GP_UNUSED(*callback)) +{ + return GP_ENOIMPL; +} + +GP_RetCode GP_SaveJPG(const char GP_UNUSED(*dst_path), + const GP_Context GP_UNUSED(*src), + GP_ProgressCallback GP_UNUSED(*callback)) +{ + return GP_ENOIMPL; +} + +#endif /* HAVE_JPEG */ diff --git a/libs/loaders/GP_PNG.c b/libs/loaders/GP_PNG.c index 32a6358..51c645e 100644 --- a/libs/loaders/GP_PNG.c +++ b/libs/loaders/GP_PNG.c @@ -32,10 +32,14 @@ #include <errno.h> #include <string.h>
-#include <png.h> +#include "../../config.h" +#include "core/GP_Debug.h"
#include "GP_PNG.h" -#include "core/GP_Debug.h" + +#ifdef HAVE_LIBPNG + +#include <png.h>
GP_RetCode GP_OpenPNG(const char *src_path, FILE **f) { @@ -305,3 +309,34 @@ err1: unlink(dst_path); return ret; } + +#else + +GP_RetCode GP_OpenPNG(const char GP_UNUSED(*src_path), + FILE GP_UNUSED(**f)) +{ + return GP_ENOIMPL; +} + +GP_RetCode GP_ReadPNG(FILE GP_UNUSED(*f), + GP_Context GP_UNUSED(**res), + GP_ProgressCallback GP_UNUSED(*callback)) +{ + return GP_ENOIMPL; +} + +GP_RetCode GP_LoadPNG(const char GP_UNUSED(*src_path), + GP_Context GP_UNUSED(**res), + GP_ProgressCallback GP_UNUSED(*callback)) +{ + return GP_ENOIMPL; +} + +GP_RetCode GP_SavePNG(const char GP_UNUSED(*dst_path), + const GP_Context GP_UNUSED(*src), + GP_ProgressCallback GP_UNUSED(*callback)) +{ + return GP_ENOIMPL; +} + +#endif /* HAVE_LIBPNG */
http://repo.or.cz/w/gfxprim.git/commit/3c4a561ca197f91aa1b3040a18ced825667e6...
commit 3c4a561ca197f91aa1b3040a18ced825667e63dc Author: Cyril Hrubis metan@ucw.cz Date: Fri Dec 9 17:27:15 2011 +0100
build: The CFLAGS and LDFLAGS are now from configure.
diff --git a/app.mk b/app.mk index 0b301df..460ebf7 100644 --- a/app.mk +++ b/app.mk @@ -2,7 +2,7 @@ ifndef APPS $(error APPS not defined, fix your library Makefile) endif
-LDLIBS+=-lpng -ljpeg -lm -ldl +LDLIBS+=-lm -ldl
all: $(APPS)
diff --git a/configure b/configure index 12c3a89..36b0418 100755 --- a/configure +++ b/configure @@ -97,7 +97,7 @@ class libraries: # # Writes '#define HAVE_XXX_H' into passed file # - def write(self, f): + def write_config_h(self, f): for i in self.libraries: f.write("/*n * {0}n */n".format(i[1])) if self.results[i[0]]: @@ -106,6 +106,14 @@ class libraries: f.write("//#define HAVE_{0}n".format(i[0].upper())) f.write("n")
+ # + # Writes LDFLAGS and CFLAGS into passed file + # + def write_config_mk(self, f): + for i in self.libraries: + if self.results[i[0]]: + f.write("# {0}nCFLAGS+={1}nLDFLAGS+={2}n".format(i[0], i[3], i[4])) + def basic_checks(cfg): sys.stderr.write("Basic checksn") sys.stderr.write("------------n") @@ -121,7 +129,7 @@ def basic_checks(cfg): def write_config_h(cfg, libs): f = open("config.h", "w") f.write("#ifndef CONFIG_Hn#define CONFIG_Hnn") - libs.write(f); + libs.write_config_h(f); f.write("#endif /* CONFIG_H */n"); sys.stderr.write("Config 'config.h' writtenn") f.close() @@ -129,7 +137,8 @@ def write_config_h(cfg, libs): def write_config_mk(cfg, libs): f = open('config.gen.mk', 'w') for i in cfg: - f.write("#{0}n{1}={2}n".format(cfg[i][1], i, cfg[i][0])) + f.write("# {0}n{1}={2}n".format(cfg[i][1], i, cfg[i][0])) + libs.write_config_mk(f); f.close() sys.stderr.write("Config 'config.gen.mk' writtenn")
@@ -145,15 +154,20 @@ if __name__ == '__main__': # # Library detection/enable disable # + # name, description, [detection], cflags, ldflags + # l = libraries([["libpng", "Portable Network Graphics Library", - [header_exists, "png.h"]], + [header_exists, "png.h"], "", "-lpng"], ["libsdl", "Simple Direct Media Layer", - [header_exists, "SDL/SDL.h"]], + [header_exists, "SDL/SDL.h"], "", ""], ["jpeg", "Library to load, handle and manipulate images in the JPEG format", - [header_exists, "jpeglib.h"]]], cfg) + [header_exists, "jpeglib.h"], "", "-ljpeg"], + ["freetype", + "A high-quality and portable font engine", + [header_exists, "ft2build.h"], "", ""]], cfg) parser = OptionParser(); diff --git a/tests/core/Makefile b/tests/core/Makefile index 1ee793a..67d52e1 100644 --- a/tests/core/Makefile +++ b/tests/core/Makefile @@ -2,7 +2,7 @@ TOPDIR=../..
LIBNAME=core TESTSUITE=core_suite -LDLIBS+=-lGP -L$(TOPDIR)/build/ -lcheck -lpng -ljpeg -lm -ldl +LDLIBS+=-lGP -L$(TOPDIR)/build/ -lcheck -lm -ldl GENSOURCES+=GP_Convert.test.gen.c GP_WritePixel.test.gen.c
all: $(TESTSUITE)
-----------------------------------------------------------------------
Summary of changes: app.mk | 2 +- configure | 26 ++++++++++++++++++++------ include/core/GP_Common.h | 10 ++++++---- libs/loaders/GP_JPG.c | 39 +++++++++++++++++++++++++++++++++++++-- libs/loaders/GP_PNG.c | 39 +++++++++++++++++++++++++++++++++++++-- tests/core/Makefile | 2 +- 6 files changed, 102 insertions(+), 16 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.