summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@codelibre.net>2022-06-24 12:57:54 +0100
committerRoger Leigh <rleigh@codelibre.net>2022-06-24 12:57:56 +0100
commit38f67894cdece5880317434823b56eb33f58fecf (patch)
tree348e3f805bea5f9e7be2674e269ffb6c4abb9249
parentdc73ae317e8ea3407bc15f8adfc8d9faa909b6f3 (diff)
downloadlibtiff-git-38f67894cdece5880317434823b56eb33f58fecf.tar.gz
build: Make rational2double static only for automake
This copies the same logic as used by CMake.
-rw-r--r--configure.ac2
-rw-r--r--test/Makefile.am13
2 files changed, 13 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 7b295fa1..1ae5573c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -163,6 +163,8 @@ AC_SUBST(tiff_libs_private)
tiff_requires_private=
AC_SUBST(tiff_requires_private)
+AM_CONDITIONAL(BUILD_STATIC, test "$enable_static" = "yes")
+
dnl We don't need to add math library to all targets
case "${host_os}" in
cygwin* | mingw32* | beos* | darwin*)
diff --git a/test/Makefile.am b/test/Makefile.am
index 6df12122..2da13dbf 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -67,12 +67,16 @@ JPEG_DEPENDENT_CHECK_PROG=
JPEG_DEPENDENT_TESTSCRIPTS=
endif
+if BUILD_STATIC
+STATIC_CHECK_PROGS=rational_precision2double
+endif
+
# Executable programs which need to be built in order to support tests
if TIFF_TESTS
check_PROGRAMS = \
ascii_tag long_tag short_tag strip_rw rewrite custom_dir custom_dir_EXIF_231 \
- rational_precision2double defer_strile_loading defer_strile_writing test_directory \
- testtypes test_signed_tags $(JPEG_DEPENDENT_CHECK_PROG)
+ defer_strile_loading defer_strile_writing test_directory \
+ testtypes test_signed_tags $(JPEG_DEPENDENT_CHECK_PROG) $(STATIC_CHECK_PROGS)
endif
# Test scripts to execute
@@ -226,8 +230,13 @@ raw_decode_SOURCES = raw_decode.c
raw_decode_LDADD = $(LIBTIFF)
custom_dir_SOURCES = custom_dir.c
custom_dir_LDADD = $(LIBTIFF)
+
+if BUILD_STATIC
rational_precision2double_SOURCES = rational_precision2double.c
rational_precision2double_LDADD = $(LIBTIFF)
+rational_precision2double_LDFLAGS = -static
+endif
+
custom_dir_EXIF_231_SOURCES = custom_dir_EXIF_231.c
custom_dir_EXIF_231_LDADD = $(LIBTIFF)
defer_strile_loading_SOURCES = defer_strile_loading.c