On Tue, 11 Oct 2005 19:07:36 +1000 Danny wrote:
DT> I finally managed to install a current version of NetSNMP completely
DT> separate to the version already installed, and to also install the perl
DT> modules under a non-system perl (/opt/bin/perl).
DT>
DT> I ran into a few problems which I believe highlight build issues in which
DT> sometimes parts of an existing installation are picked-up. Often this might
DT> not cause any problem, but did for me because I was trying to install
DT> 5.2.2pre3 which is incompatible with older versions of net-snmp shared
DT> libraries.
DT>
DT> I've provided some simple patches which fix part of the problem, with
DT> just the library search path still to be fixed.
DT>
DT> I hope the following proves useful.
Thanks. In the future, please send this type of message to the coders list, or
post it in a bug report, instead of sending it to any particular developer(s).
DT> one way of using a non-standard perl is
DT> sh
DT> PERLPROG=/opt/bin/perl \
DT> ./configure --prefix=/opt/pkg/net-snmp --with-perl-modules
DT>
DT> but this did not seem to work (NB in spite of comments in pre4 Changelog)
DT> the problem is that 'perl' needs changing to '@PERLPROG@' in Makefile.in
DT> or probably ${PERL} for pre4.
Sppoky. I just made this change yesterday, for unrelated reasons. $(PERL) is
now defined in all makefiles.
DT> The problem seems to come around because
DT> 1) perl/Makefile has these (from config.sh ?)
DT> LDDLFLAGS = -shared -L/usr/local/lib
DT> LDFLAGS = -Wl,-E -L/usr/local/lib
DT> even though I've I used --prefix=/opt/pkg/net-snmp
DT> and a 'make install' does put the libraries in ${prefix}/lib
DT>
DT> Anyway back to point 1), I suspected /usr/local/lib was being picked up
DT> from the wrong net-snmp-config:
DT> # which net-snmp-config
DT> /usr/local/bin/net-snmp-config
DT> with that from the existing installation
DT> # net-snmp-config --libs
DT> -L/usr/local/lib -lnetsnmp -lcrypto -lm -lkvm -ldevstat
DT> whereas from the source tree I was using
DT> # /opt/src/net-snmp/net-snmp-5.2.2.pre3/net-snmp-config --libs
DT> -L/opt/pkg/net-snmp/lib -lnetsnmp -lcrypto -lm
DT>
DT> One place net-snmp-config was used in a Makefile was in the top-level one.
DT> In fact in the very same line mentioned above; perl -> @PERLPROG@
DT> I was hoping that changing '$$dir' -> '${srcdir}' would help, but
DT> '/usr/local/lib' still appeared in perl/Makefile.
DT> Nevertheless, I suspect '$$dir' is a typo, and worth fixing.
No, dir is set to $PWD, and the $$ is needed in a makefile. I suspect the
problem is that the net-snmp-config in the src path is not executable at the
time that the perl makefiles are built. Try the attached patch, and see if it
helps (you'll need to regenerate the makefile).
DT> The second place I saw net-snmp-config, was in each Makefile.PL.
DT> In particular the line
DT> $ret{'nsconfig'}="net-snmp-config";
DT> used when NET-SNMP-CONFIG was not set from the environment or command-line.
DT> I confirmed this line was executed during the execution of Makefile.PL
DT> and was concerned that it was being set without any path. That would
DT> explain my build was picking up parts of the older version. So I changed
DT> this line in each Makefile.PL and changed it to be one of
DT> $ret{'nsconfig'}="../net-snmp-config";
DT> $ret{'nsconfig'}="../../net-snmp-config";
DT> $ret{'nsconfig'}="../../../net-snmp-config";
DT> depending on the directory depth. I suspect a similar change might be
DT> in order for the line just above:
DT> $ret{'nsconfig'}="sh ROOTPATH../net-snmp-config";
I'll let Wes or someone else comment on these changes, if the attached patch
doesn't help you.
--
NOTE: messages sent directly to me, instead of the lists, will be deleted
unless they are requests for paid consulting services.
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>
You are lost in a twisty maze of little standards, all different.
Index: Makefile.in
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/Makefile.in,v
retrieving revision 5.59
diff -u -p -r5.59 Makefile.in
--- Makefile.in 10 Oct 2005 21:51:32 -0000 5.59
+++ Makefile.in 11 Oct 2005 11:25:05 -0000
@@ -156,7 +156,7 @@ perlmodules: perlmakefiles
exit 1 ; \
fi
-perlmakefiles:
+perlmakefiles: net-snmp-config-x
@if test ! -f perl/Makefile; then \
(dir=`pwd`; \
cd perl ; \