[libpng16] Removed cc -E workround, corrected png_get_palette_max API Tested on SUN OS cc 5.9,

which demonstrates the tokenization problem previously avoided by using /lib/cpp.
Since all .dfn output is now protected in double quotes unless it is to be macro
substituted the fix should work everywhere.
This commit is contained in:
John Bowler 2013-02-15 23:46:37 -06:00 committed by Glenn Randers-Pehrson
parent 42835d3d19
commit 0695fcd834
4 changed files with 25 additions and 26 deletions

View File

@ -31,6 +31,10 @@ Version 1.6.1 [February 16, 2013]
files. Back ported from libpng 1.7. files. Back ported from libpng 1.7.
Made sRGB check numbers consistent. Made sRGB check numbers consistent.
Ported libpng 1.5 options.awk/dfn file handling to 1.6, fixed one bug. Ported libpng 1.5 options.awk/dfn file handling to 1.6, fixed one bug.
Removed cc -E workround, corrected png_get_palette_max API Tested on SUN OS cc 5.9,
which demonstrates the tokenization problem previously avoided by using /lib/cpp.
Since all .dfn output is now protected in double quotes unless it is to be macro
substituted the fix should work everywhere.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -4387,6 +4387,10 @@ Version 1.6.1 [February 16, 2013]
files. Back ported from libpng 1.7. files. Back ported from libpng 1.7.
Made sRGB check numbers consistent. Made sRGB check numbers consistent.
Ported libpng 1.5 options.awk/dfn file handling to 1.6, fixed one bug. Ported libpng 1.5 options.awk/dfn file handling to 1.6, fixed one bug.
Removed cc -E workround, corrected png_get_palette_max API Tested on SUN OS cc 5.9,
which demonstrates the tokenization problem previously avoided by using /lib/cpp.
Since all .dfn output is now protected in double quotes unless it is to be macro
substituted the fix should work everywhere.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -53,8 +53,7 @@ AC_PROG_CC
AM_PROG_AS AM_PROG_AS
LT_PATH_LD LT_PATH_LD
AC_PROG_CPP AC_PROG_CPP
AC_CHECK_TOOL(SED, sed, :) AC_PROG_AWK
AC_CHECK_TOOL(AWK, awk, :)
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_LN_S AC_PROG_LN_S
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
@ -64,30 +63,23 @@ dnl compatible later version may be used
LT_INIT([win32-dll]) LT_INIT([win32-dll])
LT_PREREQ([2.4.2]) LT_PREREQ([2.4.2])
# On Solaris 10 and 12 CPP gets set to cc -E, however this still # Some awks crash when confronted with pnglibconf.dfa, do a test run now
# does some input parsing. We need strict ANSI-C style tokenization, # to make sure this doesn't happen
# check this: AC_MSG_CHECKING([that AWK works])
AC_REQUIRE_CPP if ${AWK} -f ${srcdir}/scripts/options.awk out="/dev/null" version=search\
AC_MSG_CHECKING([for a C preprocessor that does not parse its input]) ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[1.1.1 16BIT]])], ${srcdir}/pngusr.dfa 1>&2
[DFNCPP="$CPP"], then
[ DFNCPP="" AC_MSG_RESULT([ok])
sav_CPP="$CPP"
for CPP in "${CC-cc} -E" "${CC-cc} -E -traditional-cpp" "/lib/cpp" "cpp"
do
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[1.1.1 16BIT]])],
[DFNCPP="$CPP"]
[break],,)
done
CPP="$sav_CPP"
])
if test -n "$DFNCPP"; then
AC_MSG_RESULT([$DFNCPP])
AC_SUBST(DFNCPP)
else else
AC_MSG_FAILURE([not found], 1) AC_MSG_FAILURE([failed], 1)
fi fi
# This is a remnant of the old cc -E validation, where it may have been
# necessary to use a different preprocessor for .dfn files
DFNCPP="$CPP"
AC_SUBST(DFNCPP)
# -Werror cannot be passed to GCC in CFLAGS because configure will fail (it # -Werror cannot be passed to GCC in CFLAGS because configure will fail (it
# checks the compiler with a program that generates a warning), add the # checks the compiler with a program that generates a warning), add the
# following option to deal with this # following option to deal with this
@ -115,7 +107,6 @@ AC_ARG_ENABLE(werror,
# Checks for header files. # Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h])
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST AC_C_CONST

View File

@ -30,7 +30,7 @@
# are copied to the preprocessed file). # are copied to the preprocessed file).
BEGIN{ BEGIN{
out="/dev/null" # intermediate, preprocessed, file out="" # intermediate, preprocessed, file
pre=-1 # preprocess (first line) pre=-1 # preprocess (first line)
version="libpng version unknown" # version information version="libpng version unknown" # version information
version_file="" # where to find the version version_file="" # where to find the version
@ -79,7 +79,7 @@ BEGIN{
} }
# The output file must be specified before any input: # The output file must be specified before any input:
out == "/dev/null" { out == "" {
print "out=output.file must be given on the command line" print "out=output.file must be given on the command line"
err = 1 err = 1
exit 1 exit 1