[iortcw] 333/497: All: Use pkg-config for a system libjpeg if available (libjpeg-turbo has it)

Simon McVittie smcv at debian.org
Fri Sep 8 10:37:18 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit baa742527975f0751daa2d8849436d84f395a445
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Wed Apr 15 16:20:52 2015 -0400

    All: Use pkg-config for a system libjpeg if available (libjpeg-turbo has it)
---
 MP/Makefile             |  9 ++++-----
 MP/code/qcommon/unzip.c | 12 +++++++++---
 SP/Makefile             |  9 ++++-----
 SP/code/qcommon/unzip.c | 12 +++++++++---
 4 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/MP/Makefile b/MP/Makefile
index 2853d57..375788f 100644
--- a/MP/Makefile
+++ b/MP/Makefile
@@ -1167,11 +1167,10 @@ ifeq ($(USE_INTERNAL_JPEG),1)
   BASE_CFLAGS += -DUSE_INTERNAL_JPEG
   BASE_CFLAGS += -I$(JPDIR)
 else
-  # libjpeg doesn't have pkg-config yet, but let users override with
-  # "make JPEG_CFLAGS=-I/opt/jpeg/include JPEG_LIBS='-L/opt/jpeg/lib -ljpeg'"
-  # if they need to
-  JPEG_CFLAGS ?=
-  JPEG_LIBS ?= -ljpeg
+  # IJG libjpeg doesn't have pkg-config, but libjpeg-turbo uses libjpeg.pc;
+  # we fall back to hard-coded answers if libjpeg.pc is unavailable
+  JPEG_CFLAGS ?= $(shell pkg-config --silence-errors --cflags libjpeg || true)
+  JPEG_LIBS ?= $(shell pkg-config --silence-errors --libs libjpeg || echo -ljpeg)
   BASE_CFLAGS += $(JPEG_CFLAGS)
   RENDERER_LIBS += $(JPEG_LIBS)
 endif
diff --git a/MP/code/qcommon/unzip.c b/MP/code/qcommon/unzip.c
index fd6ec1a..b5043c1 100644
--- a/MP/code/qcommon/unzip.c
+++ b/MP/code/qcommon/unzip.c
@@ -1,4 +1,10 @@
 /* unzip.c -- IO for uncompress .zip files using zlib
+
+   Modified for Quake III Arena to use the Z_Malloc() memory pool;
+   this means a system copy of minizip is not a suitable replacement.
+
+   Based on minizip:
+
    Version 1.01e, February 12th, 2005
 
    Copyright (C) 1998-2005 Gilles Vollant
@@ -713,8 +719,8 @@ local int unzlocal_GetCurrentFileInfoInternal (file,
 
         if (lSeek!=0)
         {
-		if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)!=0)
-			err=UNZ_ERRNO;
+            if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)!=0)
+                err=UNZ_ERRNO;
         }
         if ((file_info.size_file_comment>0) && (commentBufferSize>0))
             if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead)
@@ -1140,7 +1146,7 @@ extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password)
       pfile_in_zip_read_info->stream.avail_in = 0;
 
       if (inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS) == Z_OK)
-	      pfile_in_zip_read_info->stream_initialised=1;
+        pfile_in_zip_read_info->stream_initialised=1;
       else
       {
         TRYFREE(pfile_in_zip_read_info);
diff --git a/SP/Makefile b/SP/Makefile
index 1aa856a..9610bd7 100644
--- a/SP/Makefile
+++ b/SP/Makefile
@@ -1159,11 +1159,10 @@ ifeq ($(USE_INTERNAL_JPEG),1)
   BASE_CFLAGS += -DUSE_INTERNAL_JPEG
   BASE_CFLAGS += -I$(JPDIR)
 else
-  # libjpeg doesn't have pkg-config yet, but let users override with
-  # "make JPEG_CFLAGS=-I/opt/jpeg/include JPEG_LIBS='-L/opt/jpeg/lib -ljpeg'"
-  # if they need to
-  JPEG_CFLAGS ?=
-  JPEG_LIBS ?= -ljpeg
+  # IJG libjpeg doesn't have pkg-config, but libjpeg-turbo uses libjpeg.pc;
+  # we fall back to hard-coded answers if libjpeg.pc is unavailable
+  JPEG_CFLAGS ?= $(shell pkg-config --silence-errors --cflags libjpeg || true)
+  JPEG_LIBS ?= $(shell pkg-config --silence-errors --libs libjpeg || echo -ljpeg)
   BASE_CFLAGS += $(JPEG_CFLAGS)
   RENDERER_LIBS += $(JPEG_LIBS)
 endif
diff --git a/SP/code/qcommon/unzip.c b/SP/code/qcommon/unzip.c
index fd6ec1a..b5043c1 100644
--- a/SP/code/qcommon/unzip.c
+++ b/SP/code/qcommon/unzip.c
@@ -1,4 +1,10 @@
 /* unzip.c -- IO for uncompress .zip files using zlib
+
+   Modified for Quake III Arena to use the Z_Malloc() memory pool;
+   this means a system copy of minizip is not a suitable replacement.
+
+   Based on minizip:
+
    Version 1.01e, February 12th, 2005
 
    Copyright (C) 1998-2005 Gilles Vollant
@@ -713,8 +719,8 @@ local int unzlocal_GetCurrentFileInfoInternal (file,
 
         if (lSeek!=0)
         {
-		if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)!=0)
-			err=UNZ_ERRNO;
+            if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)!=0)
+                err=UNZ_ERRNO;
         }
         if ((file_info.size_file_comment>0) && (commentBufferSize>0))
             if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead)
@@ -1140,7 +1146,7 @@ extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password)
       pfile_in_zip_read_info->stream.avail_in = 0;
 
       if (inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS) == Z_OK)
-	      pfile_in_zip_read_info->stream_initialised=1;
+        pfile_in_zip_read_info->stream_initialised=1;
       else
       {
         TRYFREE(pfile_in_zip_read_info);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list