Code

Change pst3 again, this time to remove use of kvm which is not
[nagiosplug.git] / plugins-root / Makefile.am
1 ## Process this file with automake to produce Makefile.in
3 VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t $(srcdir)
5 INCLUDES = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins @SSLINCLUDE@
7 localedir = $(datadir)/locale
8 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
9 # Don't add LTLIBINTL to all, as pst3 doesn't need it
10 #LIBS = @LTLIBINTL@ @LIBS@
12 noinst_PROGRAMS = check_dhcp check_icmp @EXTRAS_ROOT@
14 EXTRA_PROGRAMS = pst3
16 EXTRA_DIST = pst3.c
18 BASEOBJS = ../plugins/utils.o ../lib/libnagiosplug.a ../gl/libgnu.a
19 NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS)
20 NETLIBS = $(NETOBJS) $(SOCKETLIBS)
22 TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)
24 TESTS = @PLUGIN_TEST@
26 test:
27         perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
29 setuid_root_mode = ug=rx,u+s
31 # /* Author Coreutils team - see ACKNOWLEDGEMENTS */
33 INSTALL_SUID = \
34         for f in $(noinst_PROGRAMS) ; do \
35         p=$$f; \
36         echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p"; \
37         $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p; \
38         echo " chown root $(DESTDIR)$(libexecdir)/$$p"; \
39         chown root $(DESTDIR)$(libexecdir)/$$p; \
40         echo " chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p"; \
41         chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p; \
42         done
44 install-root: $(noinst_PROGRAMS)
45         @$(INSTALL_SUID)
47 install-exec-local: $(noinst_PROGRAMS)
48         @TMPFILE=$(DESTDIR)$(libexecdir)/.setuid-$$$$; \
49         rm -f $$TMPFILE; \
50         echo > $$TMPFILE; \
51         ## See if we can create a setuid root executable in $(libexecdir).
52         ## If not, then don't even try to install setuid plugins.
53         can_create_suid_root_executable=no; \
54         chown root $$TMPFILE > /dev/null 2>&1 \
55           && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \
56           && can_create_suid_root_executable=yes; \
57         rm -f $$TMPFILE; \
58         if test $$can_create_suid_root_executable = yes; then \
59           $(INSTALL_SUID); \
60         else \
61           echo "WARNING: insufficient access; not installing setuid plugins"; \
62           echo "NOTE: to install setuid plugins, run 'make install-root' as root"; \
63         fi
65 # /* Author Coreutils team sub-citation */
67 ##############################################################################
68 # the actual targets
69 check_dhcp_LDADD = @LTLIBINTL@ $(NETLIBS)
70 check_icmp_LDADD = @LTLIBINTL@ $(NETLIBS) $(SOCKETLIBS)
71 # -m64 needed at compiler and linker phase
72 pst3_CFLAGS = @PST3CFLAGS@
73 pst3_LDFLAGS = @PST3CFLAGS@
75 check_dhcp_DEPENDENCIES = check_dhcp.c $(NETOBJS) $(DEPLIBS) 
76 check_icmp_DEPENDENCIES = check_icmp.c $(NETOBJS)