diff --git a/ANNOUNCE b/ANNOUNCE index 41b0f3f66..1ee9becf4 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -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. diff --git a/CHANGES b/CHANGES index 58e0764af..0843e8ef2 100644 --- a/CHANGES +++ b/CHANGES @@ -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. diff --git a/CMakeLists.txt b/CMakeLists.txt index c4b7191d6..522b31e19 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/Makefile.am b/Makefile.am index bd82846c7..39a840883 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/bsconfig.h b/bsconfig.h new file mode 100644 index 000000000..1fef151bc --- /dev/null +++ b/bsconfig.h @@ -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 diff --git a/configure.ac b/configure.ac index af2fab68f..ce3eaab98 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/contrib/libtests/config.h b/contrib/libtests/config.h new file mode 100644 index 000000000..84720a324 --- /dev/null +++ b/contrib/libtests/config.h @@ -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" diff --git a/contrib/libtests/pngstest.c b/contrib/libtests/pngstest.c index bfc5d99cb..5fcd3d6de 100644 --- a/contrib/libtests/pngstest.c +++ b/contrib/libtests/pngstest.c @@ -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 #ifdef HAVE_CONFIG_H -# include "../../config.h" +# include "config.h" #endif #include "../../png.h" diff --git a/contrib/libtests/pngvalid.c b/contrib/libtests/pngvalid.c index a415d5143..952bdad5a 100644 --- a/contrib/libtests/pngvalid.c +++ b/contrib/libtests/pngvalid.c @@ -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 -#include "../../pngconfig.h" +#include "config.h" #ifdef HAVE_FEENABLEEXCEPT # include diff --git a/contrib/libtests/timepng.c b/contrib/libtests/timepng.c index 4e825bc7b..f2d607ca4 100644 --- a/contrib/libtests/timepng.c +++ b/contrib/libtests/timepng.c @@ -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 #ifdef HAVE_CONFIG_H -# include "../../config.h" +# include "config.h" #endif #include "../../png.h" diff --git a/pngconfig.h b/pngconfig.h deleted file mode 100644 index 88c8b9d8e..000000000 --- a/pngconfig.h +++ /dev/null @@ -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 */ diff --git a/pngpriv.h b/pngpriv.h index 98d008f1b..350787f86 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -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