From a6629720902151d49d5cc32f28594166c5e7fae5 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sat, 5 Oct 2019 08:35:08 +0200 Subject: README: Add section on how to use libnet with pkg-config Signed-off-by: Joachim Nilsson --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 48e8200..09f35af 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,34 @@ UNIX and GNU/Linux systems, see `chmcmd`, which is available in the sudo apt install fp-utils-3.0.4 +Using -lnet +----------- + +Libnet is installed as a library and a set of include files. The main +include file to use in your program is: + + #include + +To get the correct search paths to both the header and library files, +use the standard `pkg-config` tool: + + $ pkg-config --libs --static --cflags libnet + -I/usr/local/include -L/usr/local/lib -lnet + +The prefix path `/usr/local/` shown here is only the default. Use the +`configure` script to select a different prefix when installing libnet. + +For GNU autotools based projects, use the following in `configure.ac`: + + # Check for required libraries + PKG_CHECK_MODULES([libnet], [libnet >= 1.2]) + +and in your `Makefile.am`: + + proggy_CFLAGS = $(libnet_CFLAGS) + proggy_LDADD = $(libnet_LIBS) + + Origin & References ------------------- -- cgit v1.2.1