NetXMS Support Forum

Please login or register.

Login with username, password and session length

Author Topic: Building static 1.2 agent  (Read 638 times)

KjellO

  • Newbie
  • *
  • Posts: 10
    • View Profile
Building static 1.2 agent
« on: April 27, 2012, 01:01:06 pm »

Hi!

I'm trying to build a static 1.2 agent,

Code: [Select]
./configure --with-static-agent

Configure script is happy, but make fails:
Code: [Select]
  CXX    snmpproxy.o
../../../tools/create_ssa_list.sh "linux ecs logwatch ping portcheck ups" > static_subagents.cpp
  CXX    static_subagents.o
  CXX    subagent.o
  CXX    sysinfo.o
  CXX    tools.o
  CXX    trap.o
  CXX    upgrade.o
  CXX    watchdog.o
make[4]: *** No rule to make target `../../../src/db/libnxdb/libnxdb.la', needed by `nxagentd'.  Stop.

Other configurations are building fine.

Any workarounds? Also, is there a way to control what subagents that are compiled in? (Trying to optimizing footprint for use in embedded devices )

Best regards.
Logged

Victor Kirhenshtein

  • Lead Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3250
    • View Profile
Re: Building static 1.2 agent
« Reply #1 on: April 27, 2012, 03:52:26 pm »

Hi!

Looks like a bug in makefiles. I'll check it later today and let you know.

Best regards,
Victor
Logged

KjellO

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Building static 1.2 agent
« Reply #2 on: May 04, 2012, 03:03:26 pm »

Just curious... is there a chance for a fix for this issue? No panic, otherwise I'll go for a "normal" build.

Thanks!
Logged

Victor Kirhenshtein

  • Lead Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3250
    • View Profile
Re: Building static 1.2 agent
« Reply #3 on: May 05, 2012, 09:10:22 am »

Hi!

I've fixed that. You can download updated source archive from http://www.netxms.org/download/rc/netxms-1.2.1-rc1.tar.gz. I also add two new options for configure:

--with-all-static

linker will produce really static executable, with system libraries statically linked too;

--with-static-subagents=list

specify list of subagents to be included into static agent. For example,

./configure --with-static-agent --with-static-subagents="logwatch ping"

will produce static agent with only logwatch and ping subagents.

Best regards,
Victor
Logged

KjellO

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Building static 1.2 agent
« Reply #4 on: May 09, 2012, 02:23:52 pm »

Hi, thank you very much for your efforts!

But, I wonder if something still is broken?

Building on an old Debian etch (32-bit) with configuration
Code: [Select]
./configure --with-static-agent --with-all-static --with-static-subagents="pingcheck"

Configure script ok, but make complains:
Code: [Select]
../../../tools/create_ssa_list.sh "linux pingcheck" > static_subagents.cpp
  CXX    static_subagents.o
make[4]: *** No rule to make target `../../../src/db/libnxdb/libnxdb.la', needed by `nxagentd'.  Stop.

Also, seems to be some 64bit issues in RC1. When building on SuSE 64 bit, I get this:
Code: [Select]
  CXX    extagent.o
extagent.cpp: In function CSCPMessage* ReadMessageFromPipe(void*, void*):
extagent.cpp:131:34: error: cast from void to SOCKET loses precision
make[4]: *** [extagent.o] Error 1

Changed file include/nms_common.h, from int to intptr_t in the SOCKET typedef:
Code: [Select]
typedef intptr_t SOCKET;

Got a bit longer, next error was
Code: [Select]
push.cpp: In function void* PushConnector(void*):
push.cpp:245:63: error: cannot convert size_t* to socklen_t* for argument 3 to int accept(int, sock  addr*, socklen_t*)
make[4]: *** [push.o] Error 1

changed push.cpp,
Code: [Select]
from: size_t size = sizeof(struct sockaddr_un);
 to: socklen_t size = sizeof(struct sockaddr_un);

Then a normal build is ok, but when building with
./configure --with-static-agent --with-all-static

it complains,
Code: [Select]
/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: attempted static link of dynamic object `../../../src/db/libnxdb/.libs/libnxdb.so'
collect2: ld returned 1 exit status

I think I give up on this for now :) Will try again when next release is out. Again, thanks for your support.



Logged