Opened 3 years ago

Closed 3 years ago

#5069 closed defect (fixed)

Hook's developer's guide default directories may be wrong for Debian

Reported by: tmark Owned by: stephen
Priority: low Milestone: Kea1.2
Component: documentation Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

From a user:

  1. FYI, on a Debian-based system, the include and lib directories for

compiling the hook library were somewhat different (especially the
lib) than the example in the docs:

-I /usr/local/include/kea
-L /usr/local/lib

Our apologies. Could you point us to the specific reference?

https://jenkins.isc.org/job/Kea_doc/doxygen/df/d46/hooksdgDevelopersGuide.html#hooksdgBuild

Building the Library

Building the code requires building a sharable library. This requires the the code be compiled as position-independent code (using the compiler's "-fpic" switch) and linked as a shared library (with the linker's "-shared" switch). The build command also needs to point to the Kea include directory and link in the appropriate libraries.

Assuming that Kea has been installed in the default location, the command line needed to create the library using the Gnu C++ compiler on a Linux system is:
g++ -I /usr/include/kea -L /usr/lib/kea/lib -fpic -shared -o example.so \
    load_unload.cc pkt4_receive.cc pkt4_send.cc version.cc \
    -lkea-dhcpsrv -lkea-dhcp++ -lkea-hooks -lkea-log -lkea-util -lkea-exceptions

Notes:

    The compilation command and switches required may vary depending on your operating system and compiler - consult the relevant documentation for details.
    The values for the "-I" and "-L" switches depend on where you have installed Kea.
    The list of libraries that need to be included in the command line depends on the functionality used by the hook code and the module to which they are attached. Depending on operating system, you may also need to explicitly list libraries on which the Kea libraries you link against depend.

May need further clarification or correction.

Subtickets

Change History (7)

comment:1 Changed 3 years ago by fdupont

Doesn't make sense: autotools and libtool should be used! Of course you can make this manually but please not be surprised because it is not portable...

comment:2 Changed 3 years ago by hschempf

  • Milestone changed from Kea-proposed to Kea1.2

Per Dec 1 Kea team meeting, accept 1.2 as low

comment:3 Changed 3 years ago by stephen

  • Owner set to stephen
  • Status changed from new to accepted

comment:4 Changed 3 years ago by stephen

  • Owner changed from stephen to Unassigned
  • Status changed from accepted to assigned

Minor change to the documentation. Ready for review.

comment:5 Changed 3 years ago by stephen

  • Status changed from assigned to reviewing

comment:6 Changed 3 years ago by tmark

  • Owner changed from Unassigned to stephen

Changes are fine, please merge.

comment:7 Changed 3 years ago by stephen

  • Resolution set to fixed
  • Status changed from reviewing to closed

Merged in commit 5949d7056fa3f45ef07a07895d3b6715910549fa

Note: See TracTickets for help on using tickets.