Skip to content

Commit

Permalink
This patch accomplishes the following:
Browse files Browse the repository at this point in the history
-- Auto-generates HAVE_LOCALE_H macro and adds it to jconfig.h (this is used by rdjpgcom.c.)
-- Reconciles the description and ordering of macros between config.h.in and jconfig.h.in, so the two files can be easily diffed.
-- Eliminates the use of the autoheader-generated config.h in the project and moves relevant internal-only macros into a new file, jconfigint.h.  This is to avoid "already defined" warnings in files that were including both config.h (to get the internal autotools package information or the INLINE definition) and jconfig.h.


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.3.x@1258 632fc199-4ca6-4c93-a231-07263d6284db
  • Loading branch information
dcommander committed Apr 20, 2014
1 parent ac9a92e commit ff6961f
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 25 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -143,7 +143,7 @@ endif()
message(STATUS "Install directory = ${CMAKE_INSTALL_PREFIX}")

configure_file(win/jconfig.h.in jconfig.h)
configure_file(win/config.h.in config.h)
configure_file(win/jconfigint.h.in jconfigint.h)

include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})

Expand Down
2 changes: 1 addition & 1 deletion cjpeg.c
Expand Up @@ -28,7 +28,7 @@

#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
#include "jversion.h" /* for version message */
#include "config.h"
#include "jconfigint.h"

#ifdef USE_CCOMMAND /* command-line reader for Macintosh */
#ifdef __MWERKS__
Expand Down
16 changes: 9 additions & 7 deletions configure.ac
Expand Up @@ -97,9 +97,9 @@ fi

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
AC_CHECK_HEADERS([stddef.h stdlib.h locale.h string.h])
AC_CHECK_HEADER([sys/types.h],
AC_DEFINE([NEED_SYS_TYPES_H], 1, [Define if you have sys/types.h]))
AC_DEFINE([NEED_SYS_TYPES_H], 1, [Define if you need to include <sys/types.h> to get size_t.]))

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
Expand Down Expand Up @@ -131,7 +131,8 @@ AC_TRY_RUN(
exit(is_shifting_signed(-0x7F7E80B1L));
}],
[AC_MSG_RESULT(no)
AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], 1, [Define if shift is unsigned])],
AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], 1,
[Define if your (broken) compiler shifts signed values as if they were unsigned.])],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(Assuming that right shift is signed on target machine.)])

Expand All @@ -143,12 +144,12 @@ AC_TRY_LINK(
[AC_MSG_RESULT(ok)],
[AC_MSG_RESULT(short)
AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES], 1,
[Define if you need short function names])])
[Define if linker requires that the first 15 characters of global names be unique.])])

# Checks for library functions.
AC_CHECK_FUNCS([memset memcpy], [],
[AC_DEFINE([NEED_BSD_STRINGS], 1,
[Define if you have BSD-like bzero and bcopy])])
[Define if you have BSD-like bzero and bcopy in <strings.h> rather than memset/memcpy in <string.h>.])])

AC_MSG_CHECKING([libjpeg API version])
AC_ARG_VAR(JPEG_LIB_VERSION, [libjpeg API version (62, 70, or 80)])
Expand Down Expand Up @@ -265,7 +266,7 @@ AC_SUBST(VERSION_SCRIPT_FLAG)
# Check for non-broken inline under various spellings
AC_MSG_CHECKING(for inline)
ljt_cv_inline=""
AC_TRY_COMPILE(, [} __attribute__((always_inline)) int foo() { return 0; }
AC_TRY_COMPILE(, [} inline __attribute__((always_inline)) int foo() { return 0; }
int bar() { return foo();], ljt_cv_inline="inline __attribute__((always_inline))",
AC_TRY_COMPILE(, [} __inline__ int foo() { return 0; }
int bar() { return foo();], ljt_cv_inline="__inline__",
Expand Down Expand Up @@ -484,14 +485,15 @@ AC_SUBST(RPMARCH)
AC_SUBST(RPM_CONFIG_ARGS)
AC_SUBST(DEBARCH)
AC_SUBST(BUILD)
AC_DEFINE_UNQUOTED([BUILD], "$BUILD", [Build number])
AC_DEFINE_UNQUOTED([BUILD], "$BUILD", [libjpeg-turbo build number])

# jconfig.h is the file we use, but we have another before that to
# fool autoheader. the reason is that we include this header in our
# API headers, which can screw things up for users of the lib.
# jconfig.h is a minimal version that allows this package to be built
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_HEADERS([jconfig.h])
AC_CONFIG_HEADERS([jconfigint.h])
AC_CONFIG_FILES([pkgscripts/libjpeg-turbo.spec.tmpl:release/libjpeg-turbo.spec.in])
AC_CONFIG_FILES([pkgscripts/makecygwinpkg.tmpl:release/makecygwinpkg.in])
AC_CONFIG_FILES([pkgscripts/makedpkg.tmpl:release/makedpkg.in])
Expand Down
2 changes: 1 addition & 1 deletion djpeg.c
Expand Up @@ -27,7 +27,7 @@

#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
#include "jversion.h" /* for version message */
#include "config.h"
#include "jconfigint.h"

#include <ctype.h> /* to declare isprint() */

Expand Down
2 changes: 1 addition & 1 deletion jccolor.c
Expand Up @@ -15,7 +15,7 @@
#include "jinclude.h"
#include "jpeglib.h"
#include "jsimd.h"
#include "config.h"
#include "jconfigint.h"


/* Private subobject */
Expand Down
26 changes: 16 additions & 10 deletions jconfig.h.in
Expand Up @@ -12,10 +12,10 @@
/* Support arithmetic decoding */
#undef D_ARITH_CODING_SUPPORTED

/* Support in-memory source/destination managers */
#undef MEM_SRCDST_SUPPORTED
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H

/* Compiler supports function prototypes. */
/* Define if your compiler supports prototypes */
#undef HAVE_PROTOTYPES

/* Define to 1 if you have the <stddef.h> header file. */
Expand All @@ -24,25 +24,31 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H

/* Compiler supports 'unsigned char'. */
/* Define to 1 if the system has the type `unsigned char'. */
#undef HAVE_UNSIGNED_CHAR

/* Compiler supports 'unsigned short'. */
/* Define to 1 if the system has the type `unsigned short'. */
#undef HAVE_UNSIGNED_SHORT

/* Compiler does not support pointers to unspecified structures. */
/* Compiler does not support pointers to undefined structures. */
#undef INCOMPLETE_TYPES_BROKEN

/* Compiler has <strings.h> rather than standard <string.h>. */
/* Support in-memory source/destination managers */
#undef MEM_SRCDST_SUPPORTED

/* Define if you have BSD-like bzero and bcopy in <strings.h> rather than
memset/memcpy in <string.h>. */
#undef NEED_BSD_STRINGS

/* Linker requires that global names be unique in first 15 characters. */
/* Define if linker requires that the first 15 characters of global names be
unique. */
#undef NEED_SHORT_EXTERNAL_NAMES

/* Need to include <sys/types.h> in order to obtain size_t. */
/* Define if you need to include <sys/types.h> to get size_t. */
#undef NEED_SYS_TYPES_H

/* Broken compiler shifts signed values as an unsigned shift. */
/* Define if your (broken) compiler shifts signed values as if they were
unsigned. */
#undef RIGHT_SHIFT_IS_UNSIGNED

/* Use accelerated SIMD routines. */
Expand Down
11 changes: 11 additions & 0 deletions jconfigint.h.in
@@ -0,0 +1,11 @@
/* libjpeg-turbo build number */
#undef BUILD

/* How to obtain function inlining. */
#undef INLINE

/* Define to the full name of this package. */
#undef PACKAGE_NAME

/* Version number of package */
#undef VERSION
2 changes: 1 addition & 1 deletion jdcolor.c
Expand Up @@ -16,7 +16,7 @@
#include "jinclude.h"
#include "jpeglib.h"
#include "jsimd.h"
#include "config.h"
#include "jconfigint.h"


/* Private subobject */
Expand Down
2 changes: 1 addition & 1 deletion jdmerge.c
Expand Up @@ -39,7 +39,7 @@
#include "jinclude.h"
#include "jpeglib.h"
#include "jsimd.h"
#include "config.h"
#include "jconfigint.h"

#ifdef UPSAMPLE_MERGING_SUPPORTED

Expand Down
4 changes: 2 additions & 2 deletions jpegtran.c
Expand Up @@ -16,7 +16,7 @@
#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
#include "transupp.h" /* Support routines for jpegtran */
#include "jversion.h" /* for version message */
#include "config.h"
#include "jconfigint.h"

#ifdef USE_CCOMMAND /* command-line reader for Macintosh */
#ifdef __MWERKS__
Expand Down Expand Up @@ -375,7 +375,7 @@ main (int argc, char **argv)
jvirt_barray_ptr * dst_coef_arrays;
int file_index;
/* We assume all-in-memory processing and can therefore use only a
* single file pointer for sequential input and output operation.
* single file pointer for sequential input and output operation.
*/
FILE * fp;

Expand Down
File renamed without changes.

0 comments on commit ff6961f

Please sign in to comment.