On Fri, Jun 15, 2018 at 12:30:15PM +0000, Anders Selhammer wrote:
>       # Look for libsnmp presence
>       for d in $dirs; do
>               files=$(find $d -type f -name net-snmp-agent-includes.h)
>               for f in $files; do
>                       if grep -q NET_SNMP_AGENT_INCLUDES_H $f; then
>                               printf " `net-snmp-config --cflags`"

This won't work.  The 'dirs' are only the built in include paths from
gcc, and the sysroot containing net-snmp-config will be somewhere
else.

Let's try something else:

If CROSS_COMPILE is empty, just test `which net-snmp-config`, and if
it doesn't fail, then use the output of net-snmp-config.

If CROSS_COMPILE is non-empty, then check that `which net-snmp-config`
is not /usr/bin/net-snmp-config.  If so, then use its output.

If the user puts the sysroot's /usr/bin first in the PATH the we will
have the correct net-snmp-config program.  That net-snmp-config is a
shell script, and so it will run on the build machine in a cross
environment.

>                               break 2

"break 2" - that's cute.  Didn't know you could do that.

>                       fi
>               done
>       done

> A suggestion from the guy with the envir was to build a dummy program 
> including 
> the lib and neglect build errors (if any) from that build. If it succeeds, 
> build in snmp,
> otherwise skip it.

no, No, NO!

That is the path of autoconf madness, and we will never ever go there.
 
> I have not found anything that points to that netsnmp provide pkg-config 
> files.
> Neither google nor search in lib has given me anything that point in that 
> direction.

I checked libsnmp-dev in debian, and it doesn't have the pkg-config
.pc files.
 
> Will you be able to try this cross compiling and see if it works with the 
> updated 
> version (I can send in a updated version if that is the case)?

Yes, please post v2, and I will test it with cross compiling, with and
without libsnmp.  There are four cases:

   1. build machine doesn't have libsnmp, cross sysroot doesn't either
   2. build machine has libsnmp, cross sysroot doesn't
   3. build machine has libsnmp, cross sysroot does as well
   4. build machine doesn't have libsnmp, cross sysroot does have it

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
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to