-
-
Notifications
You must be signed in to change notification settings - Fork 528
Use pkg-config to discover libnl-3 #1637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,17 +78,17 @@ static int load_libnl(void) { | |
if (libnlHandle && libnlGenlHandle) | ||
return 0; | ||
|
||
libnlHandle = dlopen("libnl-3.so", RTLD_LAZY); | ||
libnlHandle = dlopen(LIBDIR_LIBNL "/libnl-3.so", RTLD_LAZY); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed a slash is used here unconditionally. Normally for libraries it's better to load them from default search paths rather than forcing a directory prefix at compile time. I know the directory is grabbed from |
||
if (!libnlHandle) { | ||
libnlHandle = dlopen("libnl-3.so.200", RTLD_LAZY); | ||
libnlHandle = dlopen(LIBDIR_LIBNL "/libnl-3.so.200", RTLD_LAZY); | ||
if (!libnlHandle) { | ||
goto dlfailure; | ||
} | ||
} | ||
|
||
libnlGenlHandle = dlopen("libnl-genl-3.so", RTLD_LAZY); | ||
libnlGenlHandle = dlopen(LIBDIR_LIBNL "/libnl-genl-3.so", RTLD_LAZY); | ||
if (!libnlGenlHandle) { | ||
libnlGenlHandle = dlopen("libnl-genl-3.so.200", RTLD_LAZY); | ||
libnlGenlHandle = dlopen(LIBDIR_LIBNL "/libnl-genl-3.so.200", RTLD_LAZY); | ||
if (!libnlGenlHandle) { | ||
goto dlfailure; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Um. A small question (maybe this is bike shedding).
Which name for the shell variable / C macro is better,
LIBNL_LIBDIR
orLIBDIR_LIBNL
?I would vote for
LIBNL_LIBDIR
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other places like for hwloc use
FOO_LIBS
, thusLIBNL_LIBDIR
would be reasonable.