[libpng16] Revised config.h handling; added bsconfig.h, deleted pngconfig.h

This commit is contained in:
John Bowler 2011-12-17 14:21:54 -06:00 committed by Glenn Randers-Pehrson
parent d1dceee2f7
commit ba6fbc57ba
12 changed files with 67 additions and 55 deletions

View File

@ -55,7 +55,7 @@ Version 1.6.0beta01 [December 15, 2011]
non-suffix rules use unique file names.
Version 1.6.0beta02 [December 17, 2011]
Added pngconfig.h file. This indirect reference to config.h avoids
Added bsconfig.h file. This indirect reference to config.h avoids
problems with build scripts that search for config.h and find an
inappropriate one in the standard paths.

View File

@ -3806,7 +3806,7 @@ Version 1.6.0beta01 [December 15, 2011]
non-suffix rules use unique file names.
Version 1.6.0beta02 [December 17, 2011]
Added pngconfig.h file. This indirect reference to config.h avoids
Added bsconfig.h file. This indirect reference to config.h avoids
problems with build scripts that search for config.h and find an
inappropriate one in the standard paths.

View File

@ -128,8 +128,6 @@ set(pngstest_sources
)
# SOME NEEDED DEFINITIONS
add_definitions(-DPNG_CONFIGURE_LIBPNG)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
endif(MSVC)

View File

@ -40,7 +40,7 @@ lib_LTLIBRARIES=libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c\
pngget.c pngmem.c pngpread.c pngread.c pngrio.c pngrtran.c pngrutil.c\
pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c\
png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngconfig.h
png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h bsconfig.h
if PNG_ARM_NEON
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/filter_neon.S
@ -48,8 +48,6 @@ endif
nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS = @LIBPNG_DEFINES@
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \
-version-number @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0
@ -146,7 +144,7 @@ SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\
rm -f $@ $*.c $*.tf[123]
test -d scripts || mkdir scripts
echo '#include "$<"' >$*.c
$(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) @LIBPNG_DEFINES@\
$(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)\
$(CPPFLAGS) $(SYMBOL_CFLAGS) $*.c > $*.tf1
$(SED) -n -e 's|^.*PNG_DEFN_MAGIC *-\(.*\)- *PNG_DEFN_END.*$$|\1|p'\
$*.tf1 >$*.tf2
@ -188,7 +186,7 @@ scripts/pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h
mv pnglibconf.tf7 $@
$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS): png.h pngconf.h \
pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h pngconfig.h
pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h
test: check-am

36
bsconfig.h Normal file
View File

@ -0,0 +1,36 @@
/* bsconfig.h - Build System CONFIGuration
*
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* Last changed in libpng 1.6.0 [(PENDING RELEASE)]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
/* This file contains includes that provide information itself provided by the
* environment that builds libpng. This file is included by any source file
* that needs build-system specific information, including test programs that
* are not, themselves, installed.
*
* It is provided solely to work round shortcomings in existing build systems;
* do not *define* anything in this file, simply include other files as
* required.
*/
/* autotools support */
/* autotools misuse -I to support separate build and source directories, to work
* round this the autotools generated file "config.h" is included by this file.
*
* config.h is created by the "configure" script which also sets HAVE_CONFIG_H.
* It is used to enable optimizations that can only be detected at build time by
* the configure script.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

View File

@ -97,10 +97,6 @@ AC_CHECK_LIB(z, zlibVersion, ,
AC_CHECK_LIB([m], [feenableexcept])
AC_CHECK_FUNCS([feenableexcept])
LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
LIBPNG_DEFINES=$LIBPNG_DEFINES
AC_SUBST(LIBPNG_DEFINES)
AC_MSG_CHECKING([if libraries can be versioned])
AC_MSG_CHECKING([if using Solaris linker])

17
contrib/libtests/config.h Normal file
View File

@ -0,0 +1,17 @@
/*-
* config.h
*
* Copyright (c) 2011 John Cunningham Bowler
*
* Last changed in libpng 1.6.0 [(PENDING RELEASE)]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*
* Use the "config.h" generated by configure for libpng. For indpendent
* compilation of the .c files in this directory either make an appropriate
* configure script to generate config.h or do not define HAVE_CONFIG_H.
*/
#include "../../bsconfig.h"

View File

@ -3,7 +3,7 @@
*
* Copyright (c) 2011 John Cunningham Bowler
*
* Last changed in libpng 1.5.7 [(PENDING RELEASE)]
* Last changed in libpng 1.6.0 [(PENDING RELEASE)]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@ -23,7 +23,7 @@
#include <math.h>
#ifdef HAVE_CONFIG_H
# include "../../config.h"
# include "config.h"
#endif
#include "../../png.h"

View File

@ -1,7 +1,7 @@
/* pngvalid.c - validate libpng by constructing then reading png files.
*
* Last changed in libpng 1.5.7 [(PENDING RELEASE)]
* Last changed in libpng 1.6.0 [(PENDING RELEASE)]
* Copyright (c) 2011 Glenn Randers-Pehrson
* Written by John Cunningham Bowler
*
@ -25,7 +25,7 @@
#include <signal.h>
#include "../../pngconfig.h"
#include "config.h"
#ifdef HAVE_FEENABLEEXCEPT
# include <fenv.h>

View File

@ -2,7 +2,7 @@
*
* Copyright (c) 2011 John Cunningham Bowler
*
* Last changed in libpng 1.5.7 [(PENDING RELEASE)]
* Last changed in libpng 1.6.0 [(PENDING RELEASE)]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@ -23,7 +23,7 @@
#include <time.h>
#ifdef HAVE_CONFIG_H
# include "../../config.h"
# include "config.h"
#endif
#include "../../png.h"

View File

@ -1,26 +0,0 @@
/* pngconf.h
*
* libpng version 1.6.0beta02 - December 17, 2011
*
* Copyright (c) 2011 Glenn Randers-Pehrson
* Written by John Bowler.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*
* config.h is created by and PNG_CONFIGURE_LIBPNG is set by the "configure"
* script. We may need it here to get the correct configuration on things
* like limits.
*/
#ifndef PNGCONFIG_H
#define PNGCONFIG_H
#ifdef PNG_CONFIGURE_LIBPNG
# ifdef HAVE_CONFIG_H
# include "config.h"
# endif
#endif
#endif /* PNGCONFIG_H */

View File

@ -137,15 +137,8 @@ typedef const png_uint_16p * png_const_uint_16pp;
/* Added at libpng-1.2.9 */
/* Moved to pngpriv.h at libpng-1.5.0 */
/* config.h is created by and PNG_CONFIGURE_LIBPNG is set by the "configure"
* script. We may need it here to get the correct configuration on things
* like limits.
*/
#ifdef PNG_CONFIGURE_LIBPNG
# ifdef HAVE_CONFIG_H
# include "config.h"
# endif
#endif
/* Extracted to bsconfig.h at libpng-1.6.0 */
#include "bsconfig.h"
/* Moved to pngpriv.h at libpng-1.5.0 */
/* NOTE: some of these may have been used in external applications as
@ -196,7 +189,7 @@ typedef const png_uint_16p * png_const_uint_16pp;
* empty if we can't be sure it is supported. configure builds have already
* done this work.
*/
#ifdef PNG_CONFIGURE_LIBPNG
#ifdef HAVE_CONFIG_H
# define PNG_RESTRICT restrict
#else
/* Modern compilers support restrict, but assume not for anything not