configure.ac, vars.am: Use host-specific link options for test programs.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 9 May 2020 12:26:13 +0000 (13:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 9 May 2020 12:35:40 +0000 (13:35 +0100)
It turns out that `libtool' spams an annoying warning message to the
terminal every time you call it with `-no-install' on a Windowsish or
Mac OSish system.  Since this is just intended to be an optimization and
developer-convenience feature, wind it down to `-no-fast-install' on the
affected platforms so as not to provoke these really annoying messages.

configure.ac
vars.am

index f8ad8b7..8ebda7b 100644 (file)
@@ -39,6 +39,13 @@ AC_PROG_CC
 AX_CFLAGS_WARN_ALL
 AM_PROG_LIBTOOL
 mdw_LIBTOOL_VERSION_INFO
+case $host_os in
+  cygwin* | mingw* | pw32* | os2* | darwin* | cegcc*)
+    TEST_LDFLAGS=-no-fast-install ;;
+  *)
+    TEST_LDFLAGS=-no-install ;;
+esac
+AC_SUBST([TEST_LDFLAGS])
 
 AM_PROG_AS
 
diff --git a/vars.am b/vars.am
index 115cb31..223f2ba 100644 (file)
--- a/vars.am
+++ b/vars.am
@@ -120,13 +120,13 @@ SUFFIXES          += .c .t$(EXEEXT) .to
 .c.to:
        $(AM_V_CC)$(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $< -o $@
 .to.t$(EXEEXT):
-       $(AM_V_CCLD)$(LINK) -no-install $< \
+       $(AM_V_CCLD)$(LINK) $(TEST_LDFLAGS) $< \
                $(TEST_LIBS) $(top_builddir)/libcatacomb.la \
                $(mLib_LIBS) $(CATACOMB_LIBS) $(LIBS)
 %.to: %.c %.lo
        $(AM_V_CC)$(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $< -o $@
 %.t$(EXEEXT): %.to $(TEST_LIBS) $(top_builddir)/libcatacomb.la
-       $(AM_V_CCLD)$(LINK) -no-install $+ \
+       $(AM_V_CCLD)$(LINK) $(TEST_LDFLAGS) $+ \
                $(mLib_LIBS) $(CATACOMB_LIBS) $(LIBS)
 
 .PRECIOUS: %.to %.t$(EXEEXT)