From: Sergey Senozhatsky <sergey.senozhatsky at gmail.com>
To: powertop@lists.01.org
Subject: Re: [Powertop] [PATCH] Change library/pkg search condition for libnl2/3
Date: Fri, 09 Nov 2012 15:07:51 +0300 [thread overview]
Message-ID: <20121109120750.GD3239@swordfish.minsk.epam.com> (raw)
In-Reply-To: CAGLu0vNzi+Gbum7R+MWZvmXVFd3Pu8tN5Vr33U8WGYKiTBTDZg@mail.gmail.com
[-- Attachment #1: Type: text/plain, Size: 1778 bytes --]
Rework libnl detection.
PKG_CHECK_MODULES macro appends FOO_CFLAGS and FOO_LIBS flags
Example:
LIBNL_CFLAGS = -I/usr/include/libnl3
LIBNL_LIBS = -lnl-genl-3 -lnl-3
while AC_SEARCH_LIBS only prepends -llibrary to LIBS, so AC_SEARCH_LIBS
is not helpful here.
Use pkg-config PC file names to search for minimum package versions:
libnl 3.+ -- libnl-3.0.pc
libnl 2.+ -- libnl-2.0.pc
libnl 1.+ -- libnl-1.0.pc
patch also changes $has_libnl_ver == 0 error message and suppresses
failed PKG_CHECK_MODULES output.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
---
configure.ac | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/configure.ac b/configure.ac
index b8c183f..070b126 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,15 +54,12 @@ PKG_CHECK_MODULES([PCIUTILS], [libpci],[has_libpci=1],[
has_libnl_ver=0
-PKG_CHECK_MODULES([LIBNL], [libnl-3.0 libnl-genl-3.0], [
- has_libnl_ver=3], [
- AC_SEARCH_LIBS([nl_socket_alloc], [nl-3 nl-genl-3], [
- has_libnl_ver=3], [
- AC_SEARCH_LIBS([nl_socket_alloc], [nl], [
- has_libnl_ver=2], [
- PKG_CHECK_MODULES([LIBNL], [libnl-1], [has_libnl_ver=1], [])])])])
+
+PKG_CHECK_MODULES([LIBNL], [libnl-3.0 >= 3.0 libnl-genl-3.0 >= 3.0], [has_libnl_ver=3], [
+ PKG_CHECK_MODULES([LIBNL], [libnl-2.0 >= 2.0 libnl-genl-2.0 >= 2.0], [has_libnl_ver=2], [
+ PKG_CHECK_MODULES([LIBNL], [libnl-1.0], [has_libnl_ver=1], [has_libnl_ver=0])])])
if (test "$has_libnl_ver" -eq 0); then
- AC_MSG_ERROR(libnl is required but not found)
+ AC_MSG_ERROR(libnl and libnl-genl are required but were not found)
fi
if (test "$has_libnl_ver" -gt 1); then
AC_DEFINE([HAVE_LIBNL20], [1], [Define if you have libnl-2.0 or higher])
next reply other threads:[~2012-11-09 12:07 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-09 12:07 Sergey Senozhatsky [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-11-13 15:30 [Powertop] [PATCH] Change library/pkg search condition for libnl2/3 Namhyung Kim
2012-11-13 10:18 Sergey Senozhatsky
2012-11-13 9:49 Austin Zhang
2012-11-13 9:47 Austin Zhang
2012-11-13 9:26 Sergey Senozhatsky
2012-11-13 9:06 Austin Zhang
2012-11-12 9:09 Sergey Senozhatsky
2012-11-09 15:25 Sergey Senozhatsky
2012-11-09 15:19 Austin Zhang
2012-11-09 13:01 Sergey Senozhatsky
2012-11-09 12:18 Austin Zhang
2012-11-09 11:47 Sergey Senozhatsky
2012-11-09 11:43 Austin Zhang
2012-11-09 11:30 Sergey Senozhatsky
2012-11-09 11:17 Austin Zhang
2012-11-09 11:01 Sergey Senozhatsky
2012-11-09 10:56 Austin Zhang
2012-11-08 14:09 Sergey Senozhatsky
2012-11-05 10:51 Sergey Senozhatsky
2012-11-05 10:24 Sergey Senozhatsky
2012-11-02 14:32 Ferron, Chris E
2012-11-02 12:30 zhang.austin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121109120750.GD3239@swordfish.minsk.epam.com \
--to=powertop@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.