X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2FMakefile.am;h=ec4c398e933f2f06f3ba675035a574217eeea3b0;hb=e2e3792234afd45625dba679ddbb661efc47f705;hp=f773f87f01fb1c403c317722416f0568bc46e9db;hpb=5cb8e484010e30cf02ba17cc560654478f469ce7;p=liboping.git diff --git a/src/Makefile.am b/src/Makefile.am index f773f87..ec4c398 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,17 +21,44 @@ lib_LTLIBRARIES = liboping.la # set age to 0. # # -liboping_la_LDFLAGS = -version-info @LIBOPING_CURRENT@:@LIBOPING_REVISION@:@LIBOPING_AGE@ -if BUILD_WITH_LIBSOCKET -liboping_la_LDFLAGS += -lsocket -endif 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 = $(LIBOPING_PC_LIBS_PRIVATE) + +pkgconfig_DATA = liboping.pc + +MOSTLYCLEANFILES = $(pkgconfig_DATA) + 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 $(NCURSES_LIB) +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