[devel] Attempted to fix cpp on Solaris with S. Studio 12 cc, fix build

Added a make macro DFNCPP that is a CPP that will accept the tokens in
    a .dfn file and adds configure stuff to test for such a CPP.  ./configure
    should fail if one is not available.
This commit is contained in:
John Bowler 2011-01-22 17:03:33 -06:00 committed by Glenn Randers-Pehrson
parent a861ed971e
commit 71a10f2ca1
5 changed files with 42 additions and 3 deletions

View File

@ -76,6 +76,10 @@ Version 1.5.1beta08 [January 22, 2011]
to the manual. Removed the synopses from libpngpf.3 because they
were out of date and no longer useful. Better information can be
obtained by reading the prototypes and comments in pngpriv.h
Attempted to fix cpp on Solaris with S. Studio 12 cc, fix build
Added a make macro DFNCPP that is a CPP that will accept the tokens in
a .dfn file and adds configure stuff to test for such a CPP. ./configure
should fail if one is not available.
Version 1.5.1rc01 [January 22, 2011]

View File

@ -3192,6 +3192,10 @@ Version 1.5.1beta08 [January 22, 2011]
to the manual. Removed the synopses from libpngpf.3 because they
were out of date and no longer useful. Better information can be
obtained by reading the prototypes and comments in pngpriv.h
Attempted to fix cpp on Solaris with S. Studio 12 cc, fix build
Added a make macro DFNCPP that is a CPP that will accept the tokens in
a .dfn file and adds configure stuff to test for such a CPP. ./configure
should fail if one is not available.
Version 1.5.1rc01 [January 22, 2011]

View File

@ -81,6 +81,13 @@ CLEANFILES= dfn.c dfn?.out pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
config.sub configure depcomp install-sh ltmain.sh missing
# DFNCPP is normally just CPP - the C preprocessor - but on Solaris and maybe
# other operating systems (NeXT?) the C preprocessor selected by configure
# checks input tokens for validity - effectively it performs part of the ANSI-C
# parsing - and therefore fails with the .df files. configure.ac has special
# checks for this and sets DFNCPP appropriately.
DFNCPP = @DFNCPP@
SUFFIXES = .chk .dfn .out
$(PNGLIB_BASENAME).pc: libpng.pc
@ -119,7 +126,7 @@ SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\
rm -f $@ dfn.c dfn?.out
test -d scripts || mkdir scripts
echo '#include "$<"' >dfn.c
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) @LIBPNG_DEFINES@\
$(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) @LIBPNG_DEFINES@\
$(CPPFLAGS) $(SYMBOL_CFLAGS) dfn.c > dfn1.out
$(SED) -n -e 's|^.*PNG_DEFN_MAGIC-\(.*\)-PNG_DEFN_END.*$$|\1|p'\
dfn1.out >dfn2.out

View File

@ -34,6 +34,7 @@ AC_CONFIG_SRCDIR([pngget.c])
AM_CONFIG_HEADER(config.h)
# Checks for programs.
AC_LANG([C])
AC_PROG_CC
AC_PROG_LD
AC_PROG_CPP
@ -44,6 +45,28 @@ AC_PROG_LN_S
AC_PROG_MAKE_SET
LT_INIT([win32-dll])
# 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_TRY_CPP([1.5.0 16BIT],
[DFNCPP="$CPP"],
[DFNCPP=""
sav_CPP="$CPP"
for CPP in "${CC-cc} -E" "${CC-cc} -E -traditional-cpp" "/lib/cpp" "cpp"; do
AC_TRY_CPP([1.5.0 16BIT],
[DFNCPP="$CPP"]
[break],,)
done
CPP="$sav_CPP"])
if test -n "$DFNCPP"; then
AC_MSG_RESULT([$DFNCPP])
AC_SUBST(DFNCPP)
else
AC_MSG_FAILURE([not found], 1)
fi
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h])
@ -76,7 +99,7 @@ AC_MSG_CHECKING([if libraries can be versioned])
# support for version-script, but doesn't actually
# DO anything with it.
case $host in
*cygwin* | *mingw32* )
*cygwin* | *mingw32* | *interix* )
have_ld_version_script=no
AC_MSG_RESULT(no)
;;

3
png.h
View File

@ -2232,7 +2232,8 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i));
*/
/* The last ordinal number (this is the *last* one already used; the next
* one to use is one more than this.)
* one to use is one more than this.) Maintainer, remember to add an entry to
* scripts/symbols.def as well.
*/
#ifdef PNG_EXPORT_LAST_ORDINAL
PNG_EXPORT_LAST_ORDINAL(216);