[libpng16] Updated configure.ac from autoupdate: added --enable-werror option.

Also some layout regularization and removal of introduced tab characters
(replaced with 3-character indentation).  Obsolete macros identified by
autoupdate have been removed; the replacements are all in 2.59 so
the pre-req hasn't been changed.  --enable-werror checks for support
for -Werror (or the given argument) in the compiler.  This mimics the
gcc configure option by allowing -Werror to be turned on safely; without
the option the tests written in configure itself fail compilation because
they cause compiler warnings.
This commit is contained in:
John Bowler 2012-01-25 08:07:29 -06:00 committed by Glenn Randers-Pehrson
parent 8fb6c6a9b3
commit 1eb2c48458
4 changed files with 94 additions and 42 deletions

View File

@ -123,6 +123,15 @@ Version 1.6.0beta07 [January 25, 2012]
compiler issues slightly different warnings from those issued by the compiler issues slightly different warnings from those issued by the
current vesions of GCC. This eliminates those warnings by current vesions of GCC. This eliminates those warnings by
adding/removing casts and small code rewrites. adding/removing casts and small code rewrites.
Updated configure.ac from autoupdate: added --enable-werror option.
Also some layout regularization and removal of introduced tab characters
(replaced with 3-character indentation). Obsolete macros identified by
autoupdate have been removed; the replacements are all in 2.59 so
the pre-req hasn't been changed. --enable-werror checks for support
for -Werror (or the given argument) in the compiler. This mimics the
gcc configure option by allowing -Werror to be turned on safely; without
the option the tests written in configure itself fail compilation because
they cause compiler warnings.
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

@ -3874,6 +3874,15 @@ Version 1.6.0beta07 [January 25, 2012]
compiler issues slightly different warnings from those issued by the compiler issues slightly different warnings from those issued by the
current vesions of GCC. This eliminates those warnings by current vesions of GCC. This eliminates those warnings by
adding/removing casts and small code rewrites. adding/removing casts and small code rewrites.
Updated configure.ac from autoupdate: added --enable-werror option.
Also some layout regularization and removal of introduced tab characters
(replaced with 3-character indentation). Obsolete macros identified by
autoupdate have been removed; the replacements are all in 2.59 so
the pre-req hasn't been changed. --enable-werror checks for support
for -Werror (or the given argument) in the compiler. This mimics the
gcc configure option by allowing -Werror to be turned on safely; without
the option the tests written in configure itself fail compilation because
they cause compiler warnings.
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

@ -94,6 +94,12 @@ CLEANFILES= *.tf? pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
config.sub configure depcomp install-sh ltmain.sh missing config.sub configure depcomp install-sh ltmain.sh missing
# PNG_COPTS give extra options for the C compiler to be used on all compilation
# steps (unless targe_CFLAGS is specified; that will take precedence over
# AM_CFLAGS)
PNG_COPTS = @PNG_COPTS@
AM_CFLAGS = ${PNG_COPTS}
# DFNCPP is normally just CPP - the C preprocessor - but on Solaris and maybe # DFNCPP is normally just CPP - the C preprocessor - but on Solaris and maybe
# other operating systems (NeXT?) the C preprocessor selected by configure # other operating systems (NeXT?) the C preprocessor selected by configure
# checks input tokens for validity - effectively it performs part of the ANSI-C # checks input tokens for validity - effectively it performs part of the ANSI-C

View File

@ -14,11 +14,11 @@ dnl Makefile.am to upgrade the package name.
dnl This is here to prevent earlier autoconf from being used, it dnl This is here to prevent earlier autoconf from being used, it
dnl should not be necessary to regenerate configure if the time dnl should not be necessary to regenerate configure if the time
dnl stamps are correct dnl stamps are correct
AC_PREREQ(2.59) AC_PREREQ([2.59])
dnl Version number stuff here: dnl Version number stuff here:
AC_INIT([libpng], [1.6.0beta07], [png-mng-implement@lists.sourceforge.net]) AC_INIT([libpng],[1.6.0beta07], [png-mng-implement@lists.sourceforge.net])
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE
dnl stop configure from automagically running automake dnl stop configure from automagically running automake
AM_MAINTAINER_MODE AM_MAINTAINER_MODE
@ -31,13 +31,13 @@ PNGLIB_RELEASE=0
dnl End of version number stuff dnl End of version number stuff
AC_CONFIG_SRCDIR([pngget.c]) AC_CONFIG_SRCDIR([pngget.c])
AM_CONFIG_HEADER(config.h) AC_CONFIG_HEADERS([config.h])
# Checks for programs. # Checks for programs.
AC_LANG([C]) AC_LANG([C])
AC_PROG_CC AC_PROG_CC
AM_PROG_AS AM_PROG_AS
AC_PROG_LD LT_PATH_LD
AC_PROG_CPP AC_PROG_CPP
AC_CHECK_TOOL(SED, sed, :) AC_CHECK_TOOL(SED, sed, :)
AC_CHECK_TOOL(AWK, awk, :) AC_CHECK_TOOL(AWK, awk, :)
@ -51,16 +51,18 @@ LT_INIT([win32-dll])
# check this: # check this:
AC_REQUIRE_CPP AC_REQUIRE_CPP
AC_MSG_CHECKING([for a C preprocessor that does not parse its input]) AC_MSG_CHECKING([for a C preprocessor that does not parse its input])
AC_TRY_CPP([1.5.0 16BIT], AC_PREPROC_IFELSE([AC_LANG_SOURCE([[1.1.1 16BIT]])],
[DFNCPP="$CPP"], [DFNCPP="$CPP"],
[DFNCPP="" [ DFNCPP=""
sav_CPP="$CPP" sav_CPP="$CPP"
for CPP in "${CC-cc} -E" "${CC-cc} -E -traditional-cpp" "/lib/cpp" "cpp"; do for CPP in "${CC-cc} -E" "${CC-cc} -E -traditional-cpp" "/lib/cpp" "cpp"
AC_TRY_CPP([1.5.0 16BIT], do
[DFNCPP="$CPP"] AC_PREPROC_IFELSE([AC_LANG_SOURCE([[1.1.1 16BIT]])],
[break],,) [DFNCPP="$CPP"]
done [break],,)
CPP="$sav_CPP"]) done
CPP="$sav_CPP"
])
if test -n "$DFNCPP"; then if test -n "$DFNCPP"; then
AC_MSG_RESULT([$DFNCPP]) AC_MSG_RESULT([$DFNCPP])
AC_SUBST(DFNCPP) AC_SUBST(DFNCPP)
@ -68,6 +70,31 @@ else
AC_MSG_FAILURE([not found], 1) AC_MSG_FAILURE([not found], 1)
fi fi
# -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
AC_ARG_VAR(PNG_COPTS,
[additional flags for the C compiler, use this for options that would]
[cause configure itself to fail])
AC_ARG_ENABLE(werror,
AS_HELP_STRING([[[--enable-werror[=OPT]]]],
[Pass -Werror or the given argument to the compiler if it is supported]),
[test "$enable_werror" = "yes" && enable_werror="-Werror"
if test "$enable_werror" != "no"; then
sav_CFLAGS="$CFLAGS"
CFLAGS="$enable_werror $CFLAGS"
AC_MSG_CHECKING([if the compiler allows $enable_werror])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([
[int main(int argc, char **argv){]
[return argv[argc-1][0];]
[}]])],
AC_MSG_RESULT(yes)
PNG_COPTS="$PNG_COPTS $enable_werror",
AC_MSG_RESULT(no))
CFLAGS="$sav_CFLAGS"
fi],)
# 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]) AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h])
@ -80,16 +107,15 @@ AC_C_RESTRICT
# Checks for library functions. # Checks for library functions.
AC_FUNC_STRTOD AC_FUNC_STRTOD
AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc])) AC_CHECK_FUNCS([memset], , AC_MSG_ERROR(memset not found in libc))
AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) ) AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_MSG_ERROR(cannot find pow)) )
AC_ARG_WITH(zlib-prefix, AC_ARG_WITH(zlib-prefix,
AC_HELP_STRING([--with-zlib-prefix], AS_HELP_STRING([[[--with-zlib-prefix]]],
[prefix that may have been used in installed zlib]), [prefix that may have been used in installed zlib]),
[ZPREFIX=${withval}], [ZPREFIX=${withval}],
[ZPREFIX='z_']) [ZPREFIX='z_'])
AC_CHECK_LIB(z, zlibVersion, , AC_CHECK_LIB(z, zlibVersion, ,
AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, , AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, , AC_MSG_ERROR(zlib not installed)))
AC_ERROR([zlib not installed])))
# The following is for pngvalid, to ensure it catches FP errors even on # The following is for pngvalid, to ensure it catches FP errors even on
# platforms that don't enable FP exceptions, the function appears in the math # platforms that don't enable FP exceptions, the function appears in the math
@ -157,26 +183,26 @@ AC_SUBST(PNGLIB_RELEASE)
# Additional arguments (and substitutions) # Additional arguments (and substitutions)
# Allow the pkg-config directory to be set # Allow the pkg-config directory to be set
AC_ARG_WITH(pkgconfigdir, AC_ARG_WITH(pkgconfigdir,
AC_HELP_STRING([--with-pkgconfigdir], AS_HELP_STRING([[[--with-pkgconfigdir]]],
[Use the specified pkgconfig dir (default is libdir/pkgconfig)]), [Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
[pkgconfigdir=${withval}], [pkgconfigdir=${withval}],
[pkgconfigdir='${libdir}/pkgconfig']) [pkgconfigdir='${libdir}/pkgconfig'])
AC_SUBST([pkgconfigdir]) AC_SUBST([pkgconfigdir])
AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}]) AC_MSG_NOTICE([[pkgconfig directory is ${pkgconfigdir}]])
# Make the *-config binary config scripts optional # Make the *-config binary config scripts optional
AC_ARG_WITH(binconfigs, AC_ARG_WITH(binconfigs,
AC_HELP_STRING([--with-binconfigs], AS_HELP_STRING([[[--with-binconfigs]]],
[Generate shell libpng-config scripts as well as pkg-config data] [Generate shell libpng-config scripts as well as pkg-config data]
[@<:@default=yes@:>@]), [@<:@default=yes@:>@]),
[if test "${withval}" = no; then [if test "${withval}" = no; then
binconfigs= binconfigs=
AC_MSG_NOTICE([libpng-config scripts will not be built]) AC_MSG_NOTICE([[libpng-config scripts will not be built]])
else else
binconfigs='${binconfigs}' binconfigs='${binconfigs}'
fi], fi],
[binconfigs='${binconfigs}']) [binconfigs='${binconfigs}'])
AC_SUBST([binconfigs]) AC_SUBST([binconfigs])
# Because GCC by default assembles code with an executable stack, even though it # Because GCC by default assembles code with an executable stack, even though it
@ -185,16 +211,18 @@ AC_SUBST([binconfigs])
AC_SUBST([AM_CCASFLAGS], [-Wa,--noexecstack]) AC_SUBST([AM_CCASFLAGS], [-Wa,--noexecstack])
AC_ARG_ENABLE([arm-neon], AC_ARG_ENABLE([arm-neon],
AC_HELP_STRING([--enable-arm-neon], [Enable ARM NEON optimizations]), AS_HELP_STRING([[[--enable-arm-neon]]], [Enable ARM NEON optimizations]),
[if test "${enableval}" = yes; then [if test "${enableval}" = "yes"; then
AC_DEFINE([PNG_ARM_NEON], [1], [Enable ARM NEON optimizations]) AC_DEFINE([PNG_ARM_NEON], [1], [Enable ARM NEON optimizations])
AC_DEFINE([PNG_ALIGNED_MEMORY_SUPPORTED], [1], [Align row buffers]) AC_DEFINE([PNG_ALIGNED_MEMORY_SUPPORTED], [1], [Align row buffers])
fi]) fi])
AM_CONDITIONAL([PNG_ARM_NEON], [test "${enable_arm_neon:-no}" = yes]) AM_CONDITIONAL([PNG_ARM_NEON], [test "${enable_arm_neon:-no}" = yes])
AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
# Config files, substituting as above # Config files, substituting as above
AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in]) AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in])
AC_CONFIG_FILES([libpng-config:libpng-config.in], AC_CONFIG_FILES([libpng-config:libpng-config.in],
[chmod +x libpng-config]) [chmod +x libpng-config])
AC_OUTPUT AC_OUTPUT