My gmail account lost patch 4/6, so my this reply is to 0/6 instead...
(Sorry about that.)
> diff --git a/makefile b/makefile
> index fafacbe..6981ba5 100644
> --- a/makefile
> +++ b/makefile
> @@ -20,22 +20,24 @@ KBUILD_OUTPUT =
> DEBUG =
> CC = $(CROSS_COMPILE)gcc
> VER = -DVER=$(version)
> -CFLAGS = -Wall $(VER) $(incdefs) $(DEBUG) $(EXTRA_CFLAGS)
> -LDLIBS = -lm -lrt $(EXTRA_LDFLAGS)
> -PRG = ptp4l hwstamp_ctl nsm phc2sys phc_ctl pmc timemaster
> +CFLAGS = -Wall $(VER) $(incdefs) $(DEBUG) $(EXTRA_CFLAGS) $(SNMPCFLAGS)
> +LDLIBS = -lm -lrt $(EXTRA_LDFLAGS) $(SNMPAGENTLIBS)
> +PRG = ptp4l hwstamp_ctl nsm phc2sys phc_ctl pmc snmpd timemaster
> OBJ = bmc.o clock.o clockadj.o clockcheck.o config.o e2e_tc.o fault.o \
> filter.o fsm.o hash.o linreg.o mave.o mmedian.o msg.o ntpshm.o nullf.o
> phc.o \
> pi.o port.o print.o ptp4l.o p2p_tc.o raw.o rtnl.o servo.o sk.o stats.o tc.o
> \
> telecom.o tlv.o transport.o tsproc.o udp.o udp6.o uds.o util.o version.o
>
> OBJECTS = $(OBJ) hwstamp_ctl.o nsm.o phc2sys.o phc_ctl.o pmc.o
> pmc_common.o \
> - sysoff.o timemaster.o
> + snmpd.o sysoff.o timemaster.o
> SRC = $(OBJECTS:.o=.c)
> DEPEND = $(OBJECTS:.o=.d)
> srcdir := $(dir $(lastword $(MAKEFILE_LIST)))
> incdefs := $(shell $(srcdir)/incdefs.sh)
> version := $(shell $(srcdir)/version.sh $(srcdir))
> VPATH = $(srcdir)
> +SNMPCFLAGS = -I. `net-snmp-config --cflags`
When I tried to compile this, it failed because I didn't have
libsnmp-dev installed. This will be the first library dependency that
linuxptp ever had (other than the C library). I want the project to
still compile even without libsnmp.
Please extend the `incdefs.sh` script to test for the presence of
libsnmp. If it isn't found, then the compilation should continue
normally, simply omitting the snmp feature.
> +SNMPAGENTLIBS = `net-snmp-config --agent-libs`
For this you should invent a new shell script that tests whether libsnmp
is present and delivers the linker flags as appropriate.
So the makefile might look like this:
LDLIBS = -lm -lrt $(ldlibs) $(EXTRA_LDFLAGS)
...
incdefs := $(shell $(srcdir)/incdefs.sh)
ldlibs := $(shell $(srcdir)/ldlibs.sh)
Thanks,
Richard
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel