Hello Sergio, * Sergio Belkin wrote on Mon, Oct 25, 2010 at 07:44:20PM CEST: > I am using ax_lib_mysql.m4 in order to detect location of mysql libs, > but the problem is that LD_FLAGS is a mixed if LD_FLAGS and LIBS: > -rdynamic -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lssl > -lcrypto > The problem is that I want only link against mysqlclient, so I want to > add "--as-needed" be honored, how can I do that?
Put -Wl,--as-needed before the whole list, and -Wl,--no-as-needed afterwards? I should note that this will not work if you're linking with libtool and creating a shared library (which is a bug/limitation in libtool). Hope that helps. Cheers, Ralf