[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

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