summaryrefslogtreecommitdiff
path: root/m4/ax_boost_system.m4
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.eu>2012-07-10 02:42:30 -0700
committerPeter Simons <simons@cryp.to>2012-07-22 20:35:29 +0200
commit9d7e7a421409b6afac469a5e555d76e5c894b7e4 (patch)
tree5060f353f404937b8a5d759ab474b2f5c1023da0 /m4/ax_boost_system.m4
parentb20d04fcd72e13352530b48e8f9aea86995288e0 (diff)
downloadautoconf-archive-9d7e7a421409b6afac469a5e555d76e5c894b7e4.tar.gz
AX_BOOST_SYSTEM, AX_BOOST_FILESYSTEM: inverse the order of search for libraries
With the original macros, the oldest versioned library is used, but for most distribution this is detrimental, as the old versions are kept for compatibility, and not to be linked against. By using tac we reverse the order of the libraries, preferring an unversioned one (usually the latest available on the system), and then proceeding in descending order. Together with this, also try to simplify the sed syntax. It's of note that even though tac might not be very portable, the sed syntax used is also not so portable, so it might be worth working this around in a different way. Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
Diffstat (limited to 'm4/ax_boost_system.m4')
-rw-r--r--m4/ax_boost_system.m46
1 files changed, 3 insertions, 3 deletions
diff --git a/m4/ax_boost_system.m4 b/m4/ax_boost_system.m4
index 7fbf6d3..20df5ee 100644
--- a/m4/ax_boost_system.m4
+++ b/m4/ax_boost_system.m4
@@ -31,7 +31,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 14
+#serial 15
AC_DEFUN([AX_BOOST_SYSTEM],
[
@@ -83,14 +83,14 @@ AC_DEFUN([AX_BOOST_SYSTEM],
LDFLAGS_SAVE=$LDFLAGS
if test "x$ax_boost_user_system_lib" = "x"; then
- for libextension in `ls $BOOSTLIBDIR/libboost_system*.so* $BOOSTLIBDIR/libboost_system*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_system.*\)\.so.*$;\1;' -e 's;^lib\(boost_system.*\)\.a*$;\1;'` ; do
+ for libextension in `ls $BOOSTLIBDIR/libboost_system*.a* $BOOSTLIBDIR/libboost_system*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_system.*\)\.\(so\|a\).*$;\1;' | tac` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
[link_system="no"])
done
if test "x$link_system" != "xyes"; then
- for libextension in `ls $BOOSTLIBDIR/boost_system*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_system.*\)\.dll.*$;\1;' -e 's;^\(boost_system.*\)\.a*$;\1;'` ; do
+ for libextension in `ls $BOOSTLIBDIR/boost_system*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_system.*\)\.\(dll\|a\).*$;\1;' | tac` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],