[tests/tools] Don't install libdisable-npots.so

The libdisable-npots library is just used as a helper as part of
make test so it should not be installed.

If noinst_* is used then automake will generate a static library but
this won't work with LD_PRELOAD so we then need an extra custom rule
to link that into a shared library. The custom rule uses the $(LINK)
Makefile var which gets put in the Makefile because of the static
library. We pass libtool a stub -rpath option which causes it to
generate a shared library.
This commit is contained in:
Neil Roberts 2009-02-24 16:44:30 +00:00
parent bff6ce414a
commit 3425331cc1

View File

@ -1,14 +1,18 @@
lib_LTLIBRARIES = noinst_LTLIBRARIES =
build_shared_libs =
if HAVE_LIBDL if HAVE_LIBDL
lib_LTLIBRARIES += libdisable-npots.la noinst_LTLIBRARIES += libdisable-npots-static.la
build_shared_libs += libdisable-npots.la
endif endif
libdisable_npots_la_SOURCES = disable-npots.c libdisable_npots_static_la_SOURCES = disable-npots.c
libdisable_npots_la_LIBADD = -ldl libdisable_npots_static_la_LIBADD = -ldl
INCLUDES = \ INCLUDES = \
-I$(top_srcdir)/clutter \ -I$(top_srcdir)/clutter \
@ -16,13 +20,19 @@ INCLUDES = \
$(CLUTTER_CFLAGS) \ $(CLUTTER_CFLAGS) \
-D_GNU_SOURCE -D_GNU_SOURCE
all-local : disable-npots.sh all-local : disable-npots.sh $(build_shared_libs)
clean-local : clean-local :
rm -f disable-npots.sh rm -f disable-npots.sh libdisable-npots.la
disable-npots.sh : $(top_builddir)/tests/tools/disable-npots.sh.in disable-npots.sh : $(top_builddir)/tests/tools/disable-npots.sh.in
sed 's|--builddir--|'`cd '$(top_builddir)' && pwd`'|' < $< > $@ && \ sed 's|--builddir--|'`cd '$(top_builddir)' && pwd`'|' < $< > $@ && \
chmod 755 disable-npots.sh chmod 755 disable-npots.sh
# Also put the static library into a shared library. We need to do
# this without the automake magic because we don't want it to get
# installed
libdisable-npots.la : libdisable-npots-static.la
$(LINK) -ldl -rpath /nowhere libdisable-npots-static.la
EXTRA_DIST = README disable-npots.sh.in EXTRA_DIST = README disable-npots.sh.in