[prev in list] [next in list] [prev in thread] [next in thread] 

List:       net-snmp-coders
Subject:    Re: SNMP Configure Script Issue: When I include a header file in include/net-snmp/library/snmp_loggi
From:       prabu varadharajan <prabuvaradharajan () gmail ! com>
Date:       2019-03-25 14:59:12
Message-ID: CACuftwGtAqYVazNJX16PJpYPJKkCze=92KGh8axjs8gdvTU26Q () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Dear All,

As per my understanding with respect to Autoconf, I've made the following
changes and still observed the same fatal errors with less number.

*Changes Done with respect to configure.d:*

diff --git a/configure.d/config_modules_lib b/configure.d/config_modules_lib
index bb69daa..cffed6c 100644
--- a/configure.d/config_modules_lib
+++ b/configure.d/config_modules_lib
@@ -99,6 +99,9 @@ if test ! -d snmplib/transports ; then
   mkdir snmplib/transports
 fi

+echo "CPPFLAGS = "$CPPFLAGS
+
 #
 # Do transport module processing.
 #
diff --git a/configure.d/config_project_paths b/configure.d/
config_project_paths
index 9690c84..4878e1e 100644
--- a/configure.d/config_project_paths
+++ b/configure.d/config_project_paths
@@ -5,6 +5,8 @@
 ##
 #########################################

+CPPFLAGS="$CPPFLAGS -I$(pwd)/../../inc"
+
 ##
 #   Prefix paths:
 ##

*After making changes, did reconfiguration using the following command:*

$ autoreconf

*The output logs of ./configure: *













*checking ipv6 stack type... "linux-glibc, yes, using libc"checking for
platform-specific source...  CPPFLAGS =
-I/home/anand/workspace/modules/snmp/net-snmp-5.8.pre2/../../incchecking
for and configuring transport modules to use... In file included from
./include/net-snmp/output_api.h:181:0,                 from
./include/net-snmp/library/snmp_client.h:32,                 from
./include/net-snmp/varbind_api.h:102,                 from
./include/net-snmp/library/snmp_api.h:33,                 from
./include/net-snmp/definitions.h:23,                 from
./include/net-snmp/types.h:462,                 from
include/net-snmp/library/snmpUDPIPv6Domain.h:11,                 from
module_tmp_header.h:160:./include/net-snmp/library/snmp_logging.h:8:23:
fatal error: my_macros.h: No such file or directorycompilation terminated.*

Before the reconfiguration(autoreconf), I observed around 12 fatal errors
which have been reduced to 2 errors only. Please correct me if I'm going in
the wrong direction and help me to resolve this issue!

*Note:* The my_macros.h file is available in the
/home/anand/workspace/modules/snmp/net-snmp-5.8.pre2/../../inc directory
and in this scenario I did not make use of the ./configure option
--with-cflags.

Thanks in advance!

On Fri, Mar 22, 2019 at 3:50 PM prabu varadharajan <
prabuvaradharajan@gmail.com> wrote:

> Thanks for the quick response, Magnus.
>
> Please find the compilation options below and let me know if anything else
> required.
>
> libtool: compile:  gcc -I../include -I. -I../snmplib -I/usr/include/libnl3
> -I/home/anand/workspace/modules/snmp/explore/net-snmp-5.8.pre2/../inc/
> -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -DNETSNMP_REMOVE_U64
> -I/home/anand/workspace/modules/snmp/explore/net-snmp-5.8.pre2/../inc/
> -Ulinux -Dlinux=linux -c transports/snmpUDPIPv6Domain.c  -fPIC -DPIC -o
> transports/.libs/snmpUDPIPv6Domain.o
>
> For additional reference please find the configure options as well.
>
> *./configure --without-openssl --with-default-snmp-version=2
> --with-sys-contact=contact --with-sys-location=location
> --with-logfile=/var/log/snmpd.log --with-persistent-directory=/var/net-snmp
> --disable-manuals --disable-scripts --disable-mibs --without-perl-modules
> --disable-embedded-perl --enable-mini-agent --enable-fast-install
> --enable-ipv6 --with-transports=UDPIPv6
> --with-cflags=-I/home/anand/workspace/modules/snmp/explore/net-snmp-5.8.pre2/../inc/*
>
>
>
>
> On Fri, Mar 22, 2019 at 3:22 PM Magnus Fromreide <magfr@lysator.liu.se>
> wrote:
>
>> On Fri, Mar 22, 2019 at 01:15:52PM +0530, prabu varadharajan wrote:
>> > Dear All,
>> >
>> > Following is my project source code hierarchy,
>> > + src
>> >     |
>> >     +---- snmp
>> >     |
>> >     +---- my_app
>> >     |
>> >     +---- inc
>> >             |
>> >             +---- local_snmp_macros.h
>> >             +---- my_macros.h
>> >
>> > I have declared few functions and macros in both local_snmp_macros.h and
>> > my_macros.h files which are being used by both snmp and my_app
>> > applications. As of now I'm copying the header files before ./configure
>> and
>> > compilation from src/inc/ to src/snmp/agent/mibgroup and removing those
>> on
>> > clean which is not recommended. So now I would like to avoid this
>> copying
>> > overhead and include from src/inc itself.
>> >
>> > For this I have updated ./configure --with-cflags=-I$(pwd)/../inc and
>> able
>> > to build the application successfully but I'm getting following fatal
>> errors.
>> > In this case also I'm observing some* weird behaviour* like I have
>> > included my_macros.h
>> > and local_snmp_macros.h files in
>> > src/snmp/include/net-snmp/library/snmp_logging.h whereas I'm getting
>> fatal
>> > errors for the *first one*(my_macros.h) only. I have tried exploring
>> > Makefile.* and configure script as well but I could not resolve this
>> one.
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > *In file included from
>> > ./include/net-snmp/output_api.h:181:0,                 from
>> > ./include/net-snmp/library/snmp_client.h:32,                 from
>> > ./include/net-snmp/varbind_api.h:102,                 from
>> > ./include/net-snmp/library/snmp_api.h:33,                 from
>> > ./include/net-snmp/definitions.h:23,                 from
>> > ./include/net-snmp/types.h:462,                 from
>> > include/net-snmp/library/snmpUDPIPv6Domain.h:11,                 from
>> > module_tmp_header.h:164:./include/net-snmp/library/snmp_logging.h:7:23:
>> > fatal error: my_macros.h: No such file or directorycompilation
>> terminated.*
>> >
>> > *File include view for reference:*
>> > #ifndef SNMP_LOGGING_H
>> > #define SNMP_LOGGING_H
>> >
>> > #include <net-snmp/types.h>
>> > #include <net-snmp/output_api.h>
>> > #include "dummy.h"
>> > #include <my_macros.h>
>> > #include <local_snmp_macros.h>
>> >
>> > As per my understanding, I suspect the *configure* script only which
>> could
>> > have some bug. Please correct me if I'm wrong and help me to overcome
>> from
>> > this error.
>> >
>> > *Note: *I have observed same behaviour in noth Net-SNMP-5.5 and
>> > Net-SNMP-5.8.pre2 as well.
>> >
>> > Please feel free to ask more details if required that I can provide to
>> > resolve this issue. Or let me know if any reference link if this issue
>> is
>> > already reported and resolved.
>>
>> Could you please show the compile line before the error message (something
>> like gcc blah blah something.c -o something.o)
>>
>
>
> --
> With Best Regards,
> Anandaprabu V <https://www.linkedin.com/in/anandaprabu-v-10867671/>
> VVDN Technologies Pvt. Ltd <http://www.vvdntech.com/>, Chennai
> Cell : +91 9500650885 | Skype : prabuvaradharajan
>


-- 
With Best Regards,
Anandaprabu V <https://www.linkedin.com/in/anandaprabu-v-10867671/>
VVDN Technologies Pvt. Ltd <http://www.vvdntech.com/>, Chennai
Cell : +91 9500650885 | Skype : prabuvaradharajan

[Attachment #5 (text/html)]

<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div \
dir="ltr"><div>Dear All,</div><div><br></div><div>As per my understanding with \
respect to Autoconf, I&#39;ve made the following changes and still observed the same \
fatal errors with less number.</div><div><br></div><div><b><u>Changes Done with \
respect to configure.d</u>:</b><br></div><div><br></div><div>diff --git \
a/configure.d/config_modules_lib b/configure.d/config_modules_lib<br>index \
bb69daa..cffed6c 100644<br>--- a/configure.d/config_modules_lib<br>+++ \
b/configure.d/config_modules_lib<br>@@ -99,6 +99,9 @@ if test ! -d snmplib/transports \
; then<br>     mkdir snmplib/transports<br>  fi<br>  <br>+echo &quot;CPPFLAGS = \
&quot;$CPPFLAGS<br>+<br>  #<br>  # Do transport module processing.<br>  #<br>diff \
--git a/configure.d/config_project_paths b/configure.d/<span \
style="color:rgb(255,0,0)">config_project_paths</span><br>index 9690c84..4878e1e \
100644<br>--- a/configure.d/config_project_paths<br>+++ \
b/configure.d/config_project_paths<br>@@ -5,6 +5,8 @@<br>  ##<br>  \
#########################################<br>  <br>+<span \
style="color:rgb(255,0,0)">CPPFLAGS=&quot;$CPPFLAGS \
-I$(pwd)/../../inc&quot;</span><br>+<br>  ##<br>  #     Prefix paths:<br>  \
##<br></div><div><br></div><div><b><u>After making changes, did reconfiguration using \
the following command:</u></b></div><div> <br></div><div>$ autoreconf \
<br></div><div><br></div><div><u><b>The output logs of ./configure: \
</b></u><br></div><div><br></div><div><i>checking ipv6 stack type... \
&quot;linux-glibc, yes, using libc&quot;<br>checking for platform-specific source...  \
<br><span style="color:rgb(11,83,148)">CPPFLAGS =   \
-I/home/anand/workspace/modules/snmp/net-snmp-5.8.pre2/../../inc</span><br>checking \
for and configuring transport modules to use... In file included from \
./include/net-snmp/output_api.h:181:0,<br>                                 from \
./include/net-snmp/library/snmp_client.h:32,<br>                                 from \
./include/net-snmp/varbind_api.h:102,<br>                                 from \
./include/net-snmp/library/snmp_api.h:33,<br>                                 from \
./include/net-snmp/definitions.h:23,<br>                                 from \
./include/net-snmp/types.h:462,<br>                                 from \
include/net-snmp/library/snmpUDPIPv6Domain.h:11,<br>                                 \
from module_tmp_header.h:160:<br>./include/net-snmp/library/snmp_logging.h:8:23: \
<span style="color:rgb(11,83,148)">fatal error: my_macros.h</span>: No such file or \
directory<br>compilation terminated.</i><br></div><div><br></div><div>Before the \
reconfiguration(autoreconf), I observed around<span style="color:rgb(11,83,148)"> 12 \
fatal errors which have been reduced to 2 errors only</span>. Please correct me if \
I&#39;m going in the wrong direction and help me to resolve this \
issue!<br></div><div><br></div><div><b>Note:</b> The my_macros.h file is available in \
the /home/anand/workspace/modules/snmp/net-snmp-5.8.pre2/../../inc directory and in \
this scenario I did not make use of the ./configure option \
--with-cflags.</div><div><br></div><div>Thanks in \
advance!<br></div></div></div></div></div></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 22, 2019 at 3:50 PM \
prabu varadharajan &lt;<a href="mailto:prabuvaradharajan@gmail.com" \
target="_blank">prabuvaradharajan@gmail.com</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div \
dir="ltr"><div dir="ltr"><div>Thanks for the quick response, Magnus. \
<br></div><div><br></div><div>Please find the compilation options below and let me \
know if anything else required.</div><div><br></div><div><span \
style="color:rgb(11,83,148)">libtool: compile:   gcc -I../include -I. -I../snmplib \
-I/usr/include/libnl3 \
-I/home/anand/workspace/modules/snmp/explore/net-snmp-5.8.pre2/../inc/ \
-DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -DNETSNMP_REMOVE_U64 \
-I/home/anand/workspace/modules/snmp/explore/net-snmp-5.8.pre2/../inc/ -Ulinux \
-Dlinux=linux -c transports/snmpUDPIPv6Domain.c   -fPIC -DPIC -o \
transports/.libs/snmpUDPIPv6Domain.o</span><br></div><div><br></div><div>For \
additional reference please find the configure options as \
well.<br></div><div><br></div><div><i>./configure --without-openssl \
--with-default-snmp-version=2 --with-sys-contact=contact --with-sys-location=location \
--with-logfile=/var/log/snmpd.log --with-persistent-directory=/var/net-snmp \
--disable-manuals --disable-scripts --disable-mibs --without-perl-modules \
--disable-embedded-perl --enable-mini-agent --enable-fast-install --enable-ipv6 \
--with-transports=UDPIPv6 \
--with-cflags=-I/home/anand/workspace/modules/snmp/explore/net-snmp-5.8.pre2/../inc/</i><br></div><div><br></div><div> \
<br></div><br></div></div></div></div></div><br><div class="gmail_quote"><div \
dir="ltr" class="gmail_attr">On Fri, Mar 22, 2019 at 3:22 PM Magnus Fromreide &lt;<a \
href="mailto:magfr@lysator.liu.se" target="_blank">magfr@lysator.liu.se</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Mar 22, 2019 \
at 01:15:52PM +0530, prabu varadharajan wrote:<br> &gt; Dear All,<br>
&gt; <br>
&gt; Following is my project source code hierarchy,<br>
&gt; + src<br>
&gt;        |<br>
&gt;        +---- snmp<br>
&gt;        |<br>
&gt;        +---- my_app<br>
&gt;        |<br>
&gt;        +---- inc<br>
&gt;                    |<br>
&gt;                    +---- local_snmp_macros.h<br>
&gt;                    +---- my_macros.h<br>
&gt; <br>
&gt; I have declared few functions and macros in both local_snmp_macros.h and<br>
&gt; my_macros.h files which are being used by both snmp and my_app<br>
&gt; applications. As of now I&#39;m copying the header files before ./configure \
and<br> &gt; compilation from src/inc/ to src/snmp/agent/mibgroup and removing those \
on<br> &gt; clean which is not recommended. So now I would like to avoid this \
copying<br> &gt; overhead and include from src/inc itself.<br>
&gt; <br>
&gt; For this I have updated ./configure --with-cflags=-I$(pwd)/../inc and able<br>
&gt; to build the application successfully but I&#39;m getting following fatal \
errors.<br> &gt; In this case also I&#39;m observing some* weird behaviour* like I \
have<br> &gt; included my_macros.h<br>
&gt; and local_snmp_macros.h files in<br>
&gt; src/snmp/include/net-snmp/library/snmp_logging.h whereas I&#39;m getting \
fatal<br> &gt; errors for the *first one*(my_macros.h) only. I have tried \
exploring<br> &gt; Makefile.* and configure script as well but I could not resolve \
this one.<br> &gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; *In file included from<br>
&gt; ./include/net-snmp/output_api.h:181:0,                          from<br>
&gt; ./include/net-snmp/library/snmp_client.h:32,                          from<br>
&gt; ./include/net-snmp/varbind_api.h:102,                          from<br>
&gt; ./include/net-snmp/library/snmp_api.h:33,                          from<br>
&gt; ./include/net-snmp/definitions.h:23,                          from<br>
&gt; ./include/net-snmp/types.h:462,                          from<br>
&gt; include/net-snmp/library/snmpUDPIPv6Domain.h:11,                          \
from<br> &gt; module_tmp_header.h:164:./include/net-snmp/library/snmp_logging.h:7:23:<br>
 &gt; fatal error: my_macros.h: No such file or directorycompilation terminated.*<br>
&gt; <br>
&gt; *File include view for reference:*<br>
&gt; #ifndef SNMP_LOGGING_H<br>
&gt; #define SNMP_LOGGING_H<br>
&gt; <br>
&gt; #include &lt;net-snmp/types.h&gt;<br>
&gt; #include &lt;net-snmp/output_api.h&gt;<br>
&gt; #include &quot;dummy.h&quot;<br>
&gt; #include &lt;my_macros.h&gt;<br>
&gt; #include &lt;local_snmp_macros.h&gt;<br>
&gt; <br>
&gt; As per my understanding, I suspect the *configure* script only which could<br>
&gt; have some bug. Please correct me if I&#39;m wrong and help me to overcome \
from<br> &gt; this error.<br>
&gt; <br>
&gt; *Note: *I have observed same behaviour in noth Net-SNMP-5.5 and<br>
&gt; Net-SNMP-5.8.pre2 as well.<br>
&gt; <br>
&gt; Please feel free to ask more details if required that I can provide to<br>
&gt; resolve this issue. Or let me know if any reference link if this issue is<br>
&gt; already reported and resolved.<br>
<br>
Could you please show the compile line before the error message (something<br>
like gcc blah blah something.c -o something.o)<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" \
class="gmail-m_7111964110162140926gmail-m_-6911294113810338111gmail_signature"><div \
dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span \
style="color:rgb(51,51,51);font-family:&quot;helvetica \
neue&quot;,helvetica,arial,sans-serif;font-size:16px;text-align:justify;font-weight:700">With \
Best Regards,</span><br style="color:rgb(51,51,51);font-family:&quot;helvetica \
neue&quot;,helvetica,arial,sans-serif;font-size:16px;text-align:justify"><div \
style="font-size:12.8px;text-align:justify"><a \
href="https://www.linkedin.com/in/anandaprabu-v-10867671/" target="_blank"><font \
face="helvetica neue, helvetica, arial, sans-serif" color="#333333"><span \
style="font-size:16px">Anandaprabu V</span></font></a></div><span \
style="color:rgb(51,51,51);font-family:&quot;helvetica \
neue&quot;,helvetica,arial,sans-serif;font-size:16px;text-align:justify"><a \
href="http://www.vvdntech.com/" target="_blank">VVDN Technologies Pvt. Ltd</a>, \
Chennai<br style="color:rgb(51,51,51);font-family:&quot;helvetica \
neue&quot;,helvetica,arial,sans-serif;font-size:16px;text-align:justify"></span><span \
style="color:rgb(51,51,51);font-family:&quot;helvetica \
neue&quot;,helvetica,arial,sans-serif;font-size:16px;text-align:justify">Cell : +91 \
9500650885 | Skype : \
prabuvaradharajan</span><br></div></div></div></div></div></div></div></div> \
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" \
class="gmail-m_7111964110162140926gmail_signature"><div dir="ltr"><div><div \
dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span \
style="color:rgb(51,51,51);font-family:&quot;helvetica \
neue&quot;,helvetica,arial,sans-serif;font-size:16px;text-align:justify;font-weight:700">With \
Best Regards,</span><br style="color:rgb(51,51,51);font-family:&quot;helvetica \
neue&quot;,helvetica,arial,sans-serif;font-size:16px;text-align:justify"><div \
style="font-size:12.8px;text-align:justify"><a \
href="https://www.linkedin.com/in/anandaprabu-v-10867671/" target="_blank"><font \
face="helvetica neue, helvetica, arial, sans-serif" color="#333333"><span \
style="font-size:16px">Anandaprabu V</span></font></a></div><span \
style="color:rgb(51,51,51);font-family:&quot;helvetica \
neue&quot;,helvetica,arial,sans-serif;font-size:16px;text-align:justify"><a \
href="http://www.vvdntech.com/" target="_blank">VVDN Technologies Pvt. Ltd</a>, \
Chennai<br style="color:rgb(51,51,51);font-family:&quot;helvetica \
neue&quot;,helvetica,arial,sans-serif;font-size:16px;text-align:justify"></span><span \
style="color:rgb(51,51,51);font-family:&quot;helvetica \
neue&quot;,helvetica,arial,sans-serif;font-size:16px;text-align:justify">Cell : +91 \
9500650885 | Skype : \
prabuvaradharajan</span><br></div></div></div></div></div></div></div></div>





_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic