Quote:
Originally Posted by JohnGraham
Why do you want to do that? It could break certain link dependencies - if you had "-la -lb -la" it would be turned into "-la -lb", but if libb depends on liba then it could fail to link unless you pass certain special options to the linker to iterate through libraries repeatedly (the default is to go through once, and only use libraries later in the list to resolve dependencies for the current library). This would especially be a problem when linking statically.
|
Thanks for see beyond that emerging problem
I don't want that -la -lb -la turn into -la -lb, but -lb -la
Quote:
Originally Posted by JohnGraham
Is it just for interest, or do you expect some benefit from this? If the latter, I'd say don't bother - it'll cause problems while solving none.
|
Quote:
It's because I've autoconfiscated a project and found a macro ax_ext_have_lib.m4 that with its little documentation says:
AX_EXT_HAVE_LIB is identical to AC_SEARCH_LIBS with the exception that
# will add -L<directory> when looking, and use a different variable for
# each directory.
#
# Any required -L<directory> flags are added to LDFLAGS and located
# libraies are added to LIBS
#
|
The problem that the macro as is can only be used once, otherwise override the earlier library on LIBS, so I append as a quick and dirty workaround at the end:
Code:
LIBS="$new_libs $LIBS"
You may take a look at macro code on
http://www.gnu.org/software/autoconf..._have_lib.html
But weirdly causes the some entries duplicated, I wonder is that is harmful. What do you think?
Thanks in advance