build fixes for OS X

stupid libjpeg and their stupid bool type argh
This commit is contained in:
John Cupitt 2013-10-04 11:54:01 +01:00
parent 3afaaaf29e
commit 6c0eced22c
10 changed files with 85 additions and 63 deletions

View File

@ -1,3 +1,6 @@
3/10/13 started 7.36.0
- fiex to help OS X build
3/10/13 started 7.36.0 3/10/13 started 7.36.0
- version bump - version bump

View File

@ -2,7 +2,7 @@
# also update the version number in the m4 macros below # also update the version number in the m4 macros below
AC_INIT([vips], [7.36.0], [vipsip@jiscmail.ac.uk]) AC_INIT([vips], [7.36.1], [vipsip@jiscmail.ac.uk])
# required for gobject-introspection # required for gobject-introspection
AC_PREREQ(2.62) AC_PREREQ(2.62)
@ -17,7 +17,7 @@ AC_CONFIG_MACRO_DIR([m4])
# user-visible library versioning # user-visible library versioning
m4_define([vips_major_version], [7]) m4_define([vips_major_version], [7])
m4_define([vips_minor_version], [36]) m4_define([vips_minor_version], [36])
m4_define([vips_micro_version], [0]) m4_define([vips_micro_version], [1])
m4_define([vips_version], m4_define([vips_version],
[vips_major_version.vips_minor_version.vips_micro_version]) [vips_major_version.vips_minor_version.vips_micro_version])
@ -37,7 +37,7 @@ VIPS_VERSION_STRING=$VIPS_VERSION-`date`
# binary interface changes not backwards compatible?: reset age to 0 # binary interface changes not backwards compatible?: reset age to 0
LIBRARY_CURRENT=35 LIBRARY_CURRENT=35
LIBRARY_REVISION=0 LIBRARY_REVISION=1
LIBRARY_AGE=0 LIBRARY_AGE=0
# patched into include/vips/version.h # patched into include/vips/version.h

View File

@ -49,9 +49,7 @@
#include <vips/vips.h> #include <vips/vips.h>
#ifdef HAVE_JPEG #ifdef HAVE_JPEG
#include <jpeglib.h> #include "../foreign/vipsjpeg.h"
#include <jerror.h>
#include "../foreign/jpeg.h"
#endif /*HAVE_JPEG*/ #endif /*HAVE_JPEG*/
static int static int

View File

@ -58,6 +58,7 @@ libforeign_la_SOURCES = \
vips2jpeg.c \ vips2jpeg.c \
jpeg2vips.c \ jpeg2vips.c \
jpeg.h \ jpeg.h \
vipsjpeg.h \
jpegload.c \ jpegload.c \
jpegsave.c jpegsave.c

View File

@ -35,6 +35,22 @@
extern "C" { extern "C" {
#endif /*__cplusplus*/ #endif /*__cplusplus*/
/* jpeglib includes jconfig.h, which can define HAVE_STDLIB_H ... which we
* also define. Make sure it's turned off.
*/
#ifdef HAVE_STDLIB_H
#undef HAVE_STDLIB_H
#endif /*HAVE_STDLIB_H*/
/* jpeglib defines its own boolean type which then clashes with everyone
* elses. Turn it off and make our own.
*/
#define HAVE_BOOLEAN
typedef int boolean;
#include <jpeglib.h>
#include <jerror.h>
/* Define a new error handler for when we bomb out. /* Define a new error handler for when we bomb out.
*/ */
typedef struct { typedef struct {
@ -48,24 +64,9 @@ typedef struct {
FILE *fp; /* fclose() if non-NULL */ FILE *fp; /* fclose() if non-NULL */
} ErrorManager; } ErrorManager;
extern const char *vips__jpeg_suffs[];
void vips__new_output_message( j_common_ptr cinfo ); void vips__new_output_message( j_common_ptr cinfo );
void vips__new_error_exit( j_common_ptr cinfo ); void vips__new_error_exit( j_common_ptr cinfo );
int vips__jpeg_write_file( VipsImage *in,
const char *filename, int Q, const char *profile,
gboolean optimize_coding );
int vips__jpeg_write_buffer( VipsImage *in,
void **obuf, size_t *olen, int Q, const char *profile,
gboolean optimize_coding );
int vips__isjpeg( const char *filename );
int vips__jpeg_read_file( const char *name, VipsImage *out,
gboolean header_only, int shrink, gboolean fail, gboolean readbehind );
int vips__jpeg_read_buffer( void *buf, size_t len, VipsImage *out,
gboolean header_only, int shrink, int fail, gboolean readbehind );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /*__cplusplus*/ #endif /*__cplusplus*/

View File

@ -119,17 +119,8 @@
#include <vips/buf.h> #include <vips/buf.h>
#include <vips/internal.h> #include <vips/internal.h>
/* jpeglib includes jconfig.h, which can define HAVE_STDLIB_H ... which we
* also define. Make sure it's turned off.
*/
#ifdef HAVE_STDLIB_H
#undef HAVE_STDLIB_H
#endif /*HAVE_STDLIB_H*/
#include <jpeglib.h>
#include <jerror.h>
#include "jpeg.h" #include "jpeg.h"
#include "vipsjpeg.h"
/* Stuff we track during a read. /* Stuff we track during a read.
*/ */

View File

@ -68,17 +68,7 @@
#include <vips/buf.h> #include <vips/buf.h>
#include <vips/internal.h> #include <vips/internal.h>
/* jpeglib includes jconfig.h, which can define HAVE_STDLIB_H ... which we #include "vipsjpeg.h"
* also define. Make sure it's turned off.
*/
#ifdef HAVE_STDLIB_H
#undef HAVE_STDLIB_H
#endif /*HAVE_STDLIB_H*/
#include <jpeglib.h>
#include <jerror.h>
#include "jpeg.h"
typedef struct _VipsForeignLoadJpeg { typedef struct _VipsForeignLoadJpeg {
VipsForeignLoad parent_object; VipsForeignLoad parent_object;

View File

@ -66,17 +66,7 @@
#include <vips/buf.h> #include <vips/buf.h>
#include <vips/internal.h> #include <vips/internal.h>
/* jpeglib includes jconfig.h, which can define HAVE_STDLIB_H ... which we #include "vipsjpeg.h"
* also define. Make sure it's turned off.
*/
#ifdef HAVE_STDLIB_H
#undef HAVE_STDLIB_H
#endif /*HAVE_STDLIB_H*/
#include <jpeglib.h>
#include <jerror.h>
#include "jpeg.h"
typedef struct _VipsForeignSaveJpeg { typedef struct _VipsForeignSaveJpeg {
VipsForeignSave parent_object; VipsForeignSave parent_object;

View File

@ -121,17 +121,8 @@
#endif /*UNTAGGED_EXIF*/ #endif /*UNTAGGED_EXIF*/
#endif /*HAVE_EXIF*/ #endif /*HAVE_EXIF*/
/* jpeglib includes jconfig.h, which can define HAVE_STDLIB_H ... which we
* also define. Make sure it's turned off.
*/
#ifdef HAVE_STDLIB_H
#undef HAVE_STDLIB_H
#endif /*HAVE_STDLIB_H*/
#include <jpeglib.h>
#include <jerror.h>
#include "jpeg.h" #include "jpeg.h"
#include "vipsjpeg.h"
/* New output message method - send to VIPS. /* New output message method - send to VIPS.
*/ */

View File

@ -0,0 +1,57 @@
/* simple interface to our jpg functions
*/
/*
Copyright (C) 1991-2005 The National Gallery
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
/*
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
*/
#ifndef VIPS_VIPSJPEG_H
#define VIPS_VIPSJPEG_H
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus*/
extern const char *vips__jpeg_suffs[];
int vips__jpeg_write_file( VipsImage *in,
const char *filename, int Q, const char *profile,
gboolean optimize_coding );
int vips__jpeg_write_buffer( VipsImage *in,
void **obuf, size_t *olen, int Q, const char *profile,
gboolean optimize_coding );
int vips__isjpeg( const char *filename );
int vips__jpeg_read_file( const char *name, VipsImage *out,
gboolean header_only, int shrink, gboolean fail, gboolean readbehind );
int vips__jpeg_read_buffer( void *buf, size_t len, VipsImage *out,
gboolean header_only, int shrink, int fail, gboolean readbehind );
#ifdef __cplusplus
}
#endif /*__cplusplus*/
#endif /*VIPS_VIPSJPEG_H*/