X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2FMakefile.am;h=13267836f714d3e4686d01bcac44830cf9daea12;hb=6cf6907d4c76235adfb19ca44ea354c8af254e2e;hp=4dc11f9d16a3820888dad31ade882006a614c3ca;hpb=a9fa6b9f0f3b15165f43e2fac6acaa7482b069dc;p=liboping.git diff --git a/src/Makefile.am b/src/Makefile.am index 4dc11f9..1326783 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,17 +21,46 @@ lib_LTLIBRARIES = liboping.la # set age to 0. # # -liboping_la_LDFLAGS = -version-info 1:0:1 +liboping_la_SOURCES = oping.h liboping.c + +liboping_la_CPPFLAGS = $(AM_CPPFLAGS) +liboping_la_LDFLAGS = $(AM_LDFLAGS) -version-info @LIBOPING_CURRENT@:@LIBOPING_REVISION@:@LIBOPING_AGE@ +liboping_la_LIBADD = if BUILD_WITH_LIBSOCKET -liboping_la_LDFLAGS += -lsocket +liboping_la_LIBADD += -lsocket +endif +if BUILD_WITH_LIBXNET +liboping_la_LIBADD += -lxnet endif -liboping_la_SOURCES = oping.h liboping.c bin_PROGRAMS = oping oping_SOURCES = oping.c -oping_LDADD = liboping.la -oping_LDFLAGS = -lm +oping_LDADD = liboping.la -lm if BUILD_WITH_LIBRT -oping_LDFLAGS += -lrt +oping_LDADD += -lrt endif + +if BUILD_WITH_LIBNCURSES +bin_PROGRAMS += noping + +noping_SOURCES = oping.c +noping_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_NCURSES=1 +noping_LDADD = liboping.la -lm -lncurses +if BUILD_WITH_LIBRT +noping_LDADD += -lrt +endif +endif # BUILD_WITH_LIBNCURSES + +install-exec-hook: + @if test "x0" = "x$$UID"; then \ + if test "xLinux" = "x`uname -s`"; then \ + echo "Setting CAP_NET_RAW capability on binaries."; \ + setcap cap_net_raw=ep $(DESTDIR)$(bindir)/oping || true; \ + setcap cap_net_raw=ep $(DESTDIR)$(bindir)/noping || true; \ + else \ + echo "Setting set-UID bit on binaries."; \ + chmod u+s $(DESTDIR)$(bindir)/oping || true; \ + chmod u+s $(DESTDIR)$(bindir)/noping || true; \ + fi; \ + fi