diff --git a/ANNOUNCE b/ANNOUNCE index 2ecf1b4a0..b54580b90 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -31,6 +31,10 @@ Version 1.6.1 [February 16, 2013] files. Back ported from libpng 1.7. Made sRGB check numbers consistent. 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 (subscription required; visit diff --git a/CHANGES b/CHANGES index c41f7409e..79e5aabc8 100644 --- a/CHANGES +++ b/CHANGES @@ -4387,6 +4387,10 @@ Version 1.6.1 [February 16, 2013] files. Back ported from libpng 1.7. Made sRGB check numbers consistent. 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 (subscription required; visit diff --git a/configure.ac b/configure.ac index d6b14956a..edf4d1c44 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/scripts/options.awk b/scripts/options.awk index c924b132a..d178b493a 100755 --- a/scripts/options.awk +++ b/scripts/options.awk @@ -30,7 +30,7 @@ # are copied to the preprocessed file). BEGIN{ - out="/dev/null" # intermediate, preprocessed, file + out="" # intermediate, preprocessed, file pre=-1 # preprocess (first line) version="libpng version unknown" # version information version_file="" # where to find the version @@ -79,7 +79,7 @@ BEGIN{ } # The output file must be specified before any input: -out == "/dev/null" { +out == "" { print "out=output.file must be given on the command line" err = 1 exit 1