On Thu, Jun 19, 2025 at 05:44:59PM +0200, Bruno Haible via Discussion list for 
the GNU libtool shared library maintenance tool wrote:
> In the past few days, I've added an 'installcheck' Makefile target to
> GNU libiconv, GNU libunistring, GNU gettext, and GNU libsigsegv.
> And that uncovered a couple of bugs. Therefore I think such an
> 'installcheck' target is a good practice to have.
> 
> This 'installcheck' needs an piece of information that comes from
> libtool: The shlibpath_var. It needs to be used in a particular way
> when running programs that reference the just-installed libraries.
[...]
> installcheck:
>       $(CC) -I$(includedir) -L$(libdir) \
>             $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
>             $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
>             -o test-api $(srcdir)/test-api.c -lfoo
>       @AUGMENT_SHLIBPATH@ ./test-api
>       rm -rf test-api test-api$(EXEEXT)

Won't the problem of setting up shared library search paths be solved
if you just link the test program using libtool, so the usual wrapper
programs are generated to setup the platform-specific search paths?

In my own packages, I just use Automake to do the heavy lifting:

  EXTRA_PROGRAMS += t/installcheck
  t_installcheck_CPPFLAGS = -I$(DESTDIR)$(includedir)
  t_installcheck_LDADD = $(DESTDIR)$(libdir)/libfoo.la
  t_installcheck_CFLAGS =
  t_installcheck_SHORTNAME = i

  installcheck-local:
        rm -f t/installcheck$(EXEEXT) $(t_installcheck_OBJECTS)
        $(MAKE) $(AM_MAKEFLAGS) t/installcheck$(EXEEXT)
        t/installcheck$(EXEEXT)

This picks up the just-installed shared libraries on every shared
library system I've tested (including Windows w/ MSYS and CYGWIN).

Cheers,
  Nick

  • ... Bruno Haible via Discussion list for the GNU libtool shared library maintenance tool
    • ... Nick Bowler
      • ... Bruno Haible via Discussion list for the GNU libtool shared library maintenance tool
        • ... Nick Bowler
          • ... Bruno Haible via Discussion list for the GNU libtool shared library maintenance tool

Reply via email to