[Nagiosplug-devel] makefile.am patch for check_tcp programs
Ton Voon
tonvoon at mac.com
Thu Nov 14 16:06:03 CET 2002
Karl,
I've been looking through the automake manual and I think this is a
clean way of getting check_ftp, check_imap and the other check_tcp
derivative programs to be added to the makefile for make all, install
and uninstall. The patch is below. This was tested on MacOSX, but I'm
hoping to try it out on a Solaris server tomorrow - if you have a new a
snapshot ready!
Ton
*** Makefile.am.200211131100 Thu Nov 14 22:36:54 2002
--- Makefile.am Thu Nov 14 23:44:04 2002
***************
*** 8,14 ****
check_mrtg check_mrtgtraf check_nwstat check_overcr check_ping \
check_procs check_real check_smtp check_ssh check_tcp
check_time \
check_udp check_ups check_users check_vsz negate urlize \
- check_ftp check_imap check_nntp check_pop \
@EXTRAS@
EXTRA_PROGRAMS = check_mysql check_radius check_pgsql check_snmp
check_hpjd \
--- 8,13 ----
***************
*** 20,25 ****
--- 19,26 ----
PLUGINHDRS = common.h config.h
+ check_tcp_programs = check_ftp check_imap check_nntp check_pop
+
BASEOBJS = utils.o
NETOBJS = netutils.o $(BASEOBJS)
NETLIBS = $(NETOBJS) $(SOCKETLIBS)
***************
*** 36,46 ****
########################################################################
######
# the actual targets
- check_ftp_SOURCES = check_tcp.c
- check_imap_SOURCES = check_tcp.c
- check_nntp_SOURCES = check_tcp.c
- check_pop_SOURCES = check_tcp.c
-
check_dig_LDADD = $(BASEOBJS) popen.o
check_disk_LDADD = $(BASEOBJS) popen.o
check_dns_LDADD = $(BASEOBJS) popen.o
--- 37,42 ----
***************
*** 75,84 ****
check_by_ssh_LDADD = $(BASEOBJS) popen.o
negate_LDADD = $(BASEOBJS) popen.o
urlize_LDADD = $(BASEOBJS) popen.o
- check_ftp_LDADD = $(NETLIBS) $(SSLLIBS)
- check_imap_LDADD = $(NETLIBS) $(SSLLIBS)
- check_nntp_LDADD = $(NETLIBS) $(SSLLIBS)
- check_pop_LDADD = $(NETLIBS) $(SSLLIBS)
check_dig_DEPENDENCIES = check_dig.c $(BASEOBJS) popen.o $(DEPLIBS)
check_disk_DEPENDENCIES = check_disk.c $(BASEOBJS) popen.o $(DEPLIBS)
--- 71,76 ----
***************
*** 114,123 ****
check_by_ssh_DEPENDENCIES = check_by_ssh.c $(BASEOBJS) popen.o
$(DEPLIBS)
negate_DEPENDENCIES = negate.c $(BASEOBJS) popen.o $(DEPLIBS)
urlize_DEPENDENCIES = urlize.c $(BASEOBJS) popen.o $(DEPLIBS)
- check_ftp_DEPENDENCIES = check_tcp.c $(NETOBJS) $(DEPLIBS)
- check_imap_DEPENDENCIES = check_tcp.c $(NETOBJS) $(DEPLIBS)
- check_nntp_DEPENDENCIES = check_tcp.c $(NETOBJS) $(DEPLIBS)
- check_pop_DEPENDENCIES = check_tcp.c $(NETOBJS) $(DEPLIBS)
########################################################################
######
# secondary dependencies
--- 106,111 ----
***************
*** 135,141 ****
$(COMPILE) -c $(srcdir)/getopt1.c -o $@
snprintf.o: snprintf.c
! $(COMPILE) @NEED_VA_LIST@ -c $? -o $@
libgetopt.a: getopt.o getopt1.o
$(AR) -r $@ getopt.o getopt1.o
--- 123,129 ----
$(COMPILE) -c $(srcdir)/getopt1.c -o $@
snprintf.o: snprintf.c
! $(COMPILE) @NEED_VA_LIST@ -c $(srcdir)/snprintf.c -o $@
libgetopt.a: getopt.o getopt1.o
$(AR) -r $@ getopt.o getopt1.o
***************
*** 143,147 ****
libsnprintf.a: snprintf.o
$(AR) -r $@ snprintf.o
! check_ftp check_imap check_nntp check_pop:
ln -sf check_tcp $@
--- 131,148 ----
libsnprintf.a: snprintf.o
$(AR) -r $@ snprintf.o
! all-local: $(check_tcp_programs)
!
! $(check_tcp_programs): check_tcp
ln -sf check_tcp $@
+
+ install-exec-hook:
+ for i in $(check_tcp_programs) ; do \
+ ln -sf $(DESTDIR)$(libexecdir)/check_tcp $$i; \
+ done
+
+ clean-local:
+ rm -f $(check_tcp_programs)
+
+ uninstall-local:
+ cd $(DESTDIR)$(libexecdir) && rm -f $(check_tcp_programs)
More information about the Devel
mailing list