mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
configure: allow to disable building of tools and test
This PR adds two set of options to the configure script: --enable-png-tests/--disable-png-tests and --enable-png-tools/--disable-png-tools By using this feature, a user will be allowed to build only library if needed, which will be useful on platforms not able to build the tools and/or the tests. This PR leaves the existing behaviour as default setting, by building both the tools and the tests if the options are not used. CMakeLists.txt already supports this feature with the options PNG_TESTS and PNG_EXECUTABLES. After this commit, Autotools will provide the same feature. Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in:
parent
ee9d6d7bf2
commit
71475b064f
20
Makefile.am
20
Makefile.am
@ -12,13 +12,21 @@ PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
|
|||||||
ACLOCAL_AMFLAGS = -I scripts
|
ACLOCAL_AMFLAGS = -I scripts
|
||||||
|
|
||||||
# test programs - run on make check, make distcheck
|
# test programs - run on make check, make distcheck
|
||||||
|
if ENABLE_PNG_TESTS
|
||||||
check_PROGRAMS= pngtest pngunknown pngstest pngvalid pngimage pngcp
|
check_PROGRAMS= pngtest pngunknown pngstest pngvalid pngimage pngcp
|
||||||
if HAVE_CLOCK_GETTIME
|
if HAVE_CLOCK_GETTIME
|
||||||
check_PROGRAMS += timepng
|
check_PROGRAMS += timepng
|
||||||
endif
|
endif
|
||||||
|
else
|
||||||
|
check_PROGRAMS=
|
||||||
|
endif
|
||||||
|
|
||||||
# Utilities - installed
|
# Utilities - installed
|
||||||
|
if ENABLE_PNG_TOOLS
|
||||||
bin_PROGRAMS= pngfix png-fix-itxt
|
bin_PROGRAMS= pngfix png-fix-itxt
|
||||||
|
else
|
||||||
|
bin_PROGRAMS=
|
||||||
|
endif
|
||||||
|
|
||||||
# This ensures that pnglibconf.h gets built at the start of 'make all' or
|
# This ensures that pnglibconf.h gets built at the start of 'make all' or
|
||||||
# 'make check', but it does not add dependencies to the individual programs,
|
# 'make check', but it does not add dependencies to the individual programs,
|
||||||
@ -30,6 +38,7 @@ bin_PROGRAMS= pngfix png-fix-itxt
|
|||||||
# always wrong and always very confusing.
|
# always wrong and always very confusing.
|
||||||
BUILT_SOURCES = pnglibconf.h
|
BUILT_SOURCES = pnglibconf.h
|
||||||
|
|
||||||
|
if ENABLE_PNG_TESTS
|
||||||
pngtest_SOURCES = pngtest.c
|
pngtest_SOURCES = pngtest.c
|
||||||
pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||||
|
|
||||||
@ -48,16 +57,20 @@ pngimage_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
|||||||
timepng_SOURCES = contrib/libtests/timepng.c
|
timepng_SOURCES = contrib/libtests/timepng.c
|
||||||
timepng_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
timepng_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||||
|
|
||||||
|
pngcp_SOURCES = contrib/tools/pngcp.c
|
||||||
|
pngcp_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||||
|
endif
|
||||||
|
|
||||||
|
if ENABLE_PNG_TOOLS
|
||||||
pngfix_SOURCES = contrib/tools/pngfix.c
|
pngfix_SOURCES = contrib/tools/pngfix.c
|
||||||
pngfix_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
pngfix_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||||
|
|
||||||
png_fix_itxt_SOURCES = contrib/tools/png-fix-itxt.c
|
png_fix_itxt_SOURCES = contrib/tools/png-fix-itxt.c
|
||||||
|
endif
|
||||||
pngcp_SOURCES = contrib/tools/pngcp.c
|
|
||||||
pngcp_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
|
||||||
|
|
||||||
# Generally these are single line shell scripts to run a test with a particular
|
# Generally these are single line shell scripts to run a test with a particular
|
||||||
# set of parameters:
|
# set of parameters:
|
||||||
|
if ENABLE_PNG_TESTS
|
||||||
TESTS =\
|
TESTS =\
|
||||||
tests/pngtest-all\
|
tests/pngtest-all\
|
||||||
tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\
|
tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\
|
||||||
@ -75,6 +88,7 @@ TESTS =\
|
|||||||
tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\
|
tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\
|
||||||
tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg\
|
tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg\
|
||||||
tests/pngimage-quick tests/pngimage-full
|
tests/pngimage-quick tests/pngimage-full
|
||||||
|
endif
|
||||||
|
|
||||||
# man pages
|
# man pages
|
||||||
dist_man_MANS= libpng.3 libpngpf.3 png.5
|
dist_man_MANS= libpng.3 libpngpf.3 png.5
|
||||||
|
16
configure.ac
16
configure.ac
@ -89,6 +89,22 @@ fi
|
|||||||
DFNCPP="$CPP"
|
DFNCPP="$CPP"
|
||||||
AC_SUBST(DFNCPP)
|
AC_SUBST(DFNCPP)
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([png-tests],
|
||||||
|
AS_HELP_STRING([--enable-png-tests],
|
||||||
|
[enable building of the test programs. This is done by default - use]
|
||||||
|
[--disable-png-tests to change this.]))
|
||||||
|
|
||||||
|
AM_CONDITIONAL([ENABLE_PNG_TESTS],
|
||||||
|
[test "$enable_png_tests" != "no"])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([png-tools],
|
||||||
|
AS_HELP_STRING([--enable-png-tools],
|
||||||
|
[enable building of the tool programs. This is done by default - use]
|
||||||
|
[--disable-png-tools to change this.]))
|
||||||
|
|
||||||
|
AM_CONDITIONAL([ENABLE_PNG_TOOLS],
|
||||||
|
[test "$enable_png_tools" != "no"])
|
||||||
|
|
||||||
# -Werror cannot be passed to GCC in CFLAGS because configure will fail
|
# -Werror cannot be passed to GCC in CFLAGS because configure will fail
|
||||||
# (it checks the compiler with a program that generates a warning).
|
# (it checks the compiler with a program that generates a warning).
|
||||||
# Add the following option to deal with this:
|
# Add the following option to deal with this:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user