fi
-# Test --compress-debug-sections. FIXME: check we actually compress.
-check_PROGRAMS += flagstest_compress_debug_sections
-flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib
- test -s $@
-
-
# Test -o when emitting to a special file (such as something in /dev).
check_PROGRAMS += flagstest_o_specialfile
flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld
chmod a+x $@
test -s $@
+if HAVE_ZLIB
+
+# Test --compress-debug-sections. FIXME: check we actually compress.
+check_PROGRAMS += flagstest_compress_debug_sections
+flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
+ $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib
+ test -s $@
+
+
# The specialfile output has a tricky case when we also compress debug
# sections, because it requires output-file resizing.
check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections
chmod a+x $@
test -s $@
+endif HAVE_ZLIB
+
# Test symbol versioning.
check_PROGRAMS += ver_test
ver_test_SOURCES = ver_test_main.cc