From d0d65fa2d6e1256d011982fe121ad0417e9014ca Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 28 Nov 2013 15:07:03 +0100 Subject: Put thirdparty config headers in separate directories. Only -I the config header directory if building the thirdparty library, not if using the system library. Fix bug 694808. --- Makefile | 2 +- Makethird | 6 ++--- platform/android/jni/Core.mk | 4 ++- platform/android/jni/ThirdParty.mk | 4 ++- platform/win32/libmupdf-js-none.vcproj | 10 +++---- platform/win32/libmupdf-js-v8.vcproj | 10 +++---- platform/win32/libmupdf.vcproj | 10 +++---- platform/win32/libthirdparty.vcproj | 6 ++--- scripts/freetype/slimftmodules.h | 20 ++++++++++++++ scripts/freetype/slimftoptions.h | 14 ++++++++++ scripts/jconfig.h | 45 ------------------------------- scripts/jpeg/jconfig.h | 45 +++++++++++++++++++++++++++++++ scripts/openjpeg/opj_config.h | 18 +++++++++++++ scripts/openjpeg/opj_config_private.h | 48 ++++++++++++++++++++++++++++++++++ scripts/opj_config.h | 21 --------------- scripts/opj_config_private.h | 48 ---------------------------------- scripts/slimftmodules.h | 20 -------------- scripts/slimftoptions.h | 14 ---------- 18 files changed, 173 insertions(+), 172 deletions(-) create mode 100644 scripts/freetype/slimftmodules.h create mode 100644 scripts/freetype/slimftoptions.h delete mode 100644 scripts/jconfig.h create mode 100644 scripts/jpeg/jconfig.h create mode 100644 scripts/openjpeg/opj_config.h create mode 100644 scripts/openjpeg/opj_config_private.h delete mode 100644 scripts/opj_config.h delete mode 100644 scripts/opj_config_private.h delete mode 100644 scripts/slimftmodules.h delete mode 100644 scripts/slimftoptions.h diff --git a/Makefile b/Makefile index b0cdf056..0eb0da3b 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ default: all # Do not specify CFLAGS or LIBS on the make invocation line - specify # XCFLAGS or XLIBS instead. Make ignores any lines in the makefile that # set a variable that was set on the command line. -CFLAGS += $(XCFLAGS) -Iinclude -Iscripts -I$(GEN) +CFLAGS += $(XCFLAGS) -Iinclude -I$(GEN) LIBS += $(XLIBS) -lm include Makerules diff --git a/Makethird b/Makethird index d6db3b40..cc7478c2 100644 --- a/Makethird +++ b/Makethird @@ -108,7 +108,7 @@ $(FREETYPE_OUT)/%.o: $(FREETYPE_DIR)/src/truetype/%.c | $(FREETYPE_OUT) $(FREETYPE_OUT)/%.o: $(FREETYPE_DIR)/src/type1/%.c | $(FREETYPE_OUT) $(CC_CMD) $(FT_CFLAGS) -FREETYPE_CFLAGS := -I$(FREETYPE_DIR)/include +FREETYPE_CFLAGS := -Iscripts/freetype -I$(FREETYPE_DIR)/include else FREETYPE_CFLAGS := $(SYS_FREETYPE_CFLAGS) FREETYPE_LIBS := $(SYS_FREETYPE_LIBS) @@ -194,7 +194,7 @@ $(JPEG_OUT): $(JPEG_OUT)/%.o: $(JPEG_DIR)/%.c | $(JPEG_OUT) $(CC_CMD) -Dmain=xxxmain -JPEG_CFLAGS := -I$(JPEG_DIR) +JPEG_CFLAGS := -Iscripts/jpeg -I$(JPEG_DIR) else JPEG_CFLAGS := $(SYS_JPEG_CFLAGS) JPEG_LIBS := $(SYS_JPEG_LIBS) @@ -238,7 +238,7 @@ $(OPENJPEG_OUT): $(OPENJPEG_OUT)/%.o: $(OPENJPEG_DIR)/%.c | $(OPENJPEG_OUT) $(CC_CMD) -DOPJ_STATIC -DOPJ_HAVE_STDINT_H -OPENJPEG_CFLAGS += -I$(OPENJPEG_DIR) +OPENJPEG_CFLAGS += -Iscripts/openjpeg -I$(OPENJPEG_DIR) else OPENJPEG_CFLAGS := $(SYS_OPENJPEG_CFLAGS) OPENJPEG_LIBS := $(SYS_OPENJPEG_LIBS) diff --git a/platform/android/jni/Core.mk b/platform/android/jni/Core.mk index 26d5a629..336d82d9 100644 --- a/platform/android/jni/Core.mk +++ b/platform/android/jni/Core.mk @@ -31,7 +31,9 @@ LOCAL_C_INCLUDES := \ ../../source/xps \ ../../source/cbz \ ../../source/img \ - ../../scripts \ + ../../scripts/freetype \ + ../../scripts/jpeg \ + ../../scripts/openjpeg \ ../../generated \ ../../resources \ ../../include \ diff --git a/platform/android/jni/ThirdParty.mk b/platform/android/jni/ThirdParty.mk index 0092a438..72745494 100644 --- a/platform/android/jni/ThirdParty.mk +++ b/platform/android/jni/ThirdParty.mk @@ -10,7 +10,9 @@ LOCAL_C_INCLUDES := \ ../../thirdparty/jpeg \ ../../thirdparty/zlib \ ../../thirdparty/freetype/include \ - ../../scripts + ../../scripts/freetype \ + ../../scripts/jpeg \ + ../../scripts/openjpeg \ LOCAL_CFLAGS := \ -DFT2_BUILD_LIBRARY -DDARWIN_NO_CARBON -DHAVE_STDINT_H \ diff --git a/platform/win32/libmupdf-js-none.vcproj b/platform/win32/libmupdf-js-none.vcproj index 00ed55de..8735a2b3 100644 --- a/platform/win32/libmupdf-js-none.vcproj +++ b/platform/win32/libmupdf-js-none.vcproj @@ -40,7 +40,7 @@ +#undef FT_CONFIG_OPTION_USE_LZW +#undef FT_CONFIG_OPTION_USE_ZLIB +#undef FT_CONFIG_OPTION_MAC_FONTS +#undef FT_CONFIG_OPTION_INCREMENTAL +#undef TT_CONFIG_OPTION_EMBEDDED_BITMAPS +#undef TT_CONFIG_OPTION_GX_VAR_SUPPORT +#undef TT_CONFIG_OPTION_BDF +#undef T1_CONFIG_OPTION_NO_AFM +#undef T1_CONFIG_OPTION_NO_MM_SUPPORT + +#undef FT_CONFIG_OPTION_OLD_INTERNALS diff --git a/scripts/jconfig.h b/scripts/jconfig.h deleted file mode 100644 index 679404da..00000000 --- a/scripts/jconfig.h +++ /dev/null @@ -1,45 +0,0 @@ -/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */ -/* see jconfig.txt for explanations */ - -#define HAVE_PROTOTYPES -#define HAVE_UNSIGNED_CHAR -#define HAVE_UNSIGNED_SHORT -/* #define void char */ -/* #define const */ -#undef CHAR_IS_UNSIGNED -#define HAVE_STDDEF_H -#define HAVE_STDLIB_H -#undef NEED_BSD_STRINGS -#undef NEED_SYS_TYPES_H -#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */ -#undef NEED_SHORT_EXTERNAL_NAMES -#undef INCOMPLETE_TYPES_BROKEN - -/* Define "boolean" as unsigned char, not int, per Windows custom */ -#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ -typedef unsigned char boolean; -#endif -#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ - - -#ifdef JPEG_INTERNALS - -#undef RIGHT_SHIFT_IS_UNSIGNED - -#endif /* JPEG_INTERNALS */ - -#ifdef JPEG_CJPEG_DJPEG - -#define BMP_SUPPORTED /* BMP image file format */ -#define GIF_SUPPORTED /* GIF image file format */ -#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ -#undef RLE_SUPPORTED /* Utah RLE image file format */ -#define TARGA_SUPPORTED /* Targa image file format */ - -#define TWO_FILE_COMMANDLINE /* optional */ -#define USE_SETMODE /* Microsoft has setmode() */ -#undef NEED_SIGNAL_CATCHER -#undef DONT_USE_B_MODE -#undef PROGRESS_REPORT /* optional */ - -#endif /* JPEG_CJPEG_DJPEG */ diff --git a/scripts/jpeg/jconfig.h b/scripts/jpeg/jconfig.h new file mode 100644 index 00000000..679404da --- /dev/null +++ b/scripts/jpeg/jconfig.h @@ -0,0 +1,45 @@ +/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */ +/* see jconfig.txt for explanations */ + +#define HAVE_PROTOTYPES +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT +/* #define void char */ +/* #define const */ +#undef CHAR_IS_UNSIGNED +#define HAVE_STDDEF_H +#define HAVE_STDLIB_H +#undef NEED_BSD_STRINGS +#undef NEED_SYS_TYPES_H +#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */ +#undef NEED_SHORT_EXTERNAL_NAMES +#undef INCOMPLETE_TYPES_BROKEN + +/* Define "boolean" as unsigned char, not int, per Windows custom */ +#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ +typedef unsigned char boolean; +#endif +#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ + + +#ifdef JPEG_INTERNALS + +#undef RIGHT_SHIFT_IS_UNSIGNED + +#endif /* JPEG_INTERNALS */ + +#ifdef JPEG_CJPEG_DJPEG + +#define BMP_SUPPORTED /* BMP image file format */ +#define GIF_SUPPORTED /* GIF image file format */ +#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ +#undef RLE_SUPPORTED /* Utah RLE image file format */ +#define TARGA_SUPPORTED /* Targa image file format */ + +#define TWO_FILE_COMMANDLINE /* optional */ +#define USE_SETMODE /* Microsoft has setmode() */ +#undef NEED_SIGNAL_CATCHER +#undef DONT_USE_B_MODE +#undef PROGRESS_REPORT /* optional */ + +#endif /* JPEG_CJPEG_DJPEG */ diff --git a/scripts/openjpeg/opj_config.h b/scripts/openjpeg/opj_config.h new file mode 100644 index 00000000..647fe3b8 --- /dev/null +++ b/scripts/openjpeg/opj_config.h @@ -0,0 +1,18 @@ +/* If you want to build the library manually without using + * 'configure' or 'CMake' + * then copy this file + * 'opj_config.h.cmake.in' + * to + * 'opj_config.h' + * + * Open 'opj_config.h' and change the file contents + * if you want to define something because you know you have + * BOTH installed the library AND the header file(s). + * Then e.g. write +#define HAVE_LIBPNG 1 + * + * + * The file 'opj_config.h' will be included in some source files. + * ==== YOU CAN NOT COMPILE WITHOUT IT. ==== + * === DO NOT FORGET TO CHANGE 'config.nix' APPROPRIATELY. ==== +*/ diff --git a/scripts/openjpeg/opj_config_private.h b/scripts/openjpeg/opj_config_private.h new file mode 100644 index 00000000..70f1f6d8 --- /dev/null +++ b/scripts/openjpeg/opj_config_private.h @@ -0,0 +1,48 @@ +/* If you want to build the library manually without using + * 'configure' or 'CMake' + * then copy this file + * 'opj_config_private.h.cmake.in' + * to + * 'opj_config_private.h' + * + * Open 'opj_config_private.h' and change the file contents + * if you want to define something because you know you have + * BOTH installed the library AND the header file(s). + * Then e.g. write +#define HAVE_LIBPNG 1 + * + * + * The file 'opj_config_private.h' will be included in some source files. + * ==== YOU CAN NOT COMPILE WITHOUT IT. ==== + * === DO NOT FORGET TO CHANGE 'config.nix' APPROPRIATELY. ==== +*/ + +#ifndef _WIN32 +#define OPJ_HAVE_INTTYPES_H 1 +#else +#undef OPJ_HAVE_INTTYPES_H +#endif + +#define USE_JPIP +#define OPJ_PACKAGE_VERSION "2.0.0" + +/* DO NOT DEFINE BOTH VERSIONS OF LCMS */ +/* define to 1 if you have both liblcms and lcms.h installed */ +#undef OPJ_HAVE_LIBLCMS1 +/* #define OPJ_HAVE_LIBLCMS1 1 */ + +/* define to 1 if you have both liblcms2 and lcms2.h installed */ +#undef OPJ_HAVE_LIBLCMS2 +/* #define OPJ_HAVE_LIBLCMS2 1 */ + +/* define to 1 if you have both libpng and png.h installed */ +#undef OPJ_HAVE_LIBPNG +/* #define OPJ_HAVE_LIBPNG 1 */ + +/* define to 1 if you have both libtiff and tiff.h installed */ +#undef OPJ_HAVE_LIBTIFF +/* #define OPJ_HAVE_LIBTIFF 1 */ + +/*---------------- DO NOT CHANGE BELOW THIS LINE ----------------*/ +#define PACKAGE_URL "http://www.openjpeg.org/" +#define PACKAGE_BUGREPORT "http://code.google.com/p/openjpeg/" diff --git a/scripts/opj_config.h b/scripts/opj_config.h deleted file mode 100644 index 8ed0857f..00000000 --- a/scripts/opj_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* If you want to build the library manually without using - * 'configure' or 'CMake' - * then copy this file - * 'opj_config.h.cmake.in' - * to - * 'opj_config.h' - * - * Open 'opj_config.h' and change the file contents - * if you want to define something because you know you have - * BOTH installed the library AND the header file(s). - * Then e.g. write -#define HAVE_LIBPNG 1 - * - * - * The file 'opj_config.h' will be included in some source files. - * ==== YOU CAN NOT COMPILE WITHOUT IT. ==== - * === DO NOT FORGET TO CHANGE 'config.nix' APPROPRIATELY. ==== -*/ - - - diff --git a/scripts/opj_config_private.h b/scripts/opj_config_private.h deleted file mode 100644 index 70f1f6d8..00000000 --- a/scripts/opj_config_private.h +++ /dev/null @@ -1,48 +0,0 @@ -/* If you want to build the library manually without using - * 'configure' or 'CMake' - * then copy this file - * 'opj_config_private.h.cmake.in' - * to - * 'opj_config_private.h' - * - * Open 'opj_config_private.h' and change the file contents - * if you want to define something because you know you have - * BOTH installed the library AND the header file(s). - * Then e.g. write -#define HAVE_LIBPNG 1 - * - * - * The file 'opj_config_private.h' will be included in some source files. - * ==== YOU CAN NOT COMPILE WITHOUT IT. ==== - * === DO NOT FORGET TO CHANGE 'config.nix' APPROPRIATELY. ==== -*/ - -#ifndef _WIN32 -#define OPJ_HAVE_INTTYPES_H 1 -#else -#undef OPJ_HAVE_INTTYPES_H -#endif - -#define USE_JPIP -#define OPJ_PACKAGE_VERSION "2.0.0" - -/* DO NOT DEFINE BOTH VERSIONS OF LCMS */ -/* define to 1 if you have both liblcms and lcms.h installed */ -#undef OPJ_HAVE_LIBLCMS1 -/* #define OPJ_HAVE_LIBLCMS1 1 */ - -/* define to 1 if you have both liblcms2 and lcms2.h installed */ -#undef OPJ_HAVE_LIBLCMS2 -/* #define OPJ_HAVE_LIBLCMS2 1 */ - -/* define to 1 if you have both libpng and png.h installed */ -#undef OPJ_HAVE_LIBPNG -/* #define OPJ_HAVE_LIBPNG 1 */ - -/* define to 1 if you have both libtiff and tiff.h installed */ -#undef OPJ_HAVE_LIBTIFF -/* #define OPJ_HAVE_LIBTIFF 1 */ - -/*---------------- DO NOT CHANGE BELOW THIS LINE ----------------*/ -#define PACKAGE_URL "http://www.openjpeg.org/" -#define PACKAGE_BUGREPORT "http://code.google.com/p/openjpeg/" diff --git a/scripts/slimftmodules.h b/scripts/slimftmodules.h deleted file mode 100644 index d03bbc59..00000000 --- a/scripts/slimftmodules.h +++ /dev/null @@ -1,20 +0,0 @@ -/* custom ftmodule.h which selects the minimum features required by mupdf */ - -// FT_USE_MODULE( FT_Module_Class, autofit_module_class ) -FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class ) -FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class ) -// FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class ) -// FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class ) -// FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class ) -// FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class ) -FT_USE_MODULE( FT_Module_Class, psaux_module_class ) -FT_USE_MODULE( FT_Module_Class, psnames_module_class ) -FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) -FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) -// FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class ) -// FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class ) -// FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) diff --git a/scripts/slimftoptions.h b/scripts/slimftoptions.h deleted file mode 100644 index 066ee377..00000000 --- a/scripts/slimftoptions.h +++ /dev/null @@ -1,14 +0,0 @@ -/* custom ftoption.h which selects the minimum features needed by mupdf */ - -#include -#undef FT_CONFIG_OPTION_USE_LZW -#undef FT_CONFIG_OPTION_USE_ZLIB -#undef FT_CONFIG_OPTION_MAC_FONTS -#undef FT_CONFIG_OPTION_INCREMENTAL -#undef TT_CONFIG_OPTION_EMBEDDED_BITMAPS -#undef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#undef TT_CONFIG_OPTION_BDF -#undef T1_CONFIG_OPTION_NO_AFM -#undef T1_CONFIG_OPTION_NO_MM_SUPPORT - -#undef FT_CONFIG_OPTION_OLD_INTERNALS -- cgit v1.2.3