Allow compilation with compatible system-installed versions of libjpeg and libflac [wallyweek, R. Belmont]

This commit is contained in:
R. Belmont 2012-03-29 21:56:18 +00:00
parent f7a94cda02
commit 647311cde1
3 changed files with 45 additions and 6 deletions

View File

@ -211,6 +211,12 @@ BUILD_EXPAT = 1
# uncomment next line to build zlib as part of MAME build # uncomment next line to build zlib as part of MAME build
BUILD_ZLIB = 1 BUILD_ZLIB = 1
# uncomment next line to build libflac as part of MAME build
BUILD_FLAC = 1
# uncomment next line to build jpeglib as part of MAME build
BUILD_JPEGLIB = 1
# uncomment next line to include the symbols # uncomment next line to include the symbols
# SYMBOLS = 1 # SYMBOLS = 1
@ -411,7 +417,14 @@ DEFS += -DUSE_NETWORK
endif endif
# need to ensure FLAC functions are statically linked # need to ensure FLAC functions are statically linked
ifeq ($(BUILD_FLAC),1)
DEFS += -DFLAC__NO_DLL DEFS += -DFLAC__NO_DLL
endif
# define USE_SYSTEM_JPEGLIB if library shipped with MAME is not used
ifneq ($(BUILD_JPEGLIB),1)
DEFS += -DUSE_SYSTEM_JPEGLIB
endif
@ -620,14 +633,31 @@ LIBS += -lz
ZLIB = ZLIB =
endif endif
# add flac library
ifeq ($(BUILD_FLAC),1)
INCPATH += -I$(SRC)/lib/util
FLAC_LIB = $(OBJ)/libflac.a
# $(OBJ)/libflac++.a
else
LIBS += -lFLAC
FLAC_LIB =
endif
# add jpeglib image library
ifeq ($(BUILD_JPEGLIB),1)
INCPATH += -I$(SRC)/lib/libjpeg
JPEG_LIB = $(OBJ)/libjpeg.a
else
LIBS += -ljpeg
JPEG_LIB =
endif
# add SoftFloat floating point emulation library # add SoftFloat floating point emulation library
SOFTFLOAT = $(OBJ)/libsoftfloat.a SOFTFLOAT = $(OBJ)/libsoftfloat.a
# add formats emulation library # add formats emulation library
FORMATS_LIB = $(OBJ)/libformats.a FORMATS_LIB = $(OBJ)/libformats.a
JPEG_LIB = $(OBJ)/libjpeg.a
#------------------------------------------------- #-------------------------------------------------
# 'default' target needs to go here, before the # 'default' target needs to go here, before the
# include files which define additional targets # include files which define additional targets
@ -637,9 +667,6 @@ default: maketree buildtools emulator
all: default tools all: default tools
FLAC_LIB = $(OBJ)/libflac.a
# $(OBJ)/libflac++.a
7Z_LIB = $(OBJ)/lib7z.a 7Z_LIB = $(OBJ)/lib7z.a

View File

@ -11,6 +11,13 @@
* and perhaps jerror.h if they want to know the exact error codes. * and perhaps jerror.h if they want to know the exact error codes.
*/ */
#ifdef USE_SYSTEM_JPEGLIB
#ifndef XMD_H
#define XMD_H
#endif
#include <jpeglib.h>
#else
#ifndef JPEGLIB_H #ifndef JPEGLIB_H
#define JPEGLIB_H #define JPEGLIB_H
@ -1156,5 +1163,5 @@ struct jpeg_color_quantizer { long dummy; };
} }
#endif #endif
#endif #endif
#endif /* JPEGLIB_H */ #endif /* JPEGLIB_H */
#endif /* USE_SYSTEM_JPEGLIB */

View File

@ -44,7 +44,12 @@
#include "osdcore.h" #include "osdcore.h"
#include "corefile.h" #include "corefile.h"
#ifdef FLAC__NO_DLL
#include "../../lib/libflac/include/flac/all.h" #include "../../lib/libflac/include/flac/all.h"
#else
#include <FLAC/all.h>
#endif
//************************************************************************** //**************************************************************************