ID_BOOST may check for regex
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 29 Jun 2011 14:11:46 +0000 (16:11 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 29 Jun 2011 14:11:46 +0000 (16:11 +0200)
boost.m4

index 0540465..1f6f03a 100644 (file)
--- a/boost.m4
+++ b/boost.m4
@@ -117,6 +117,28 @@ BOOST_AUTO_TEST_CASE( t )
                        fi
                        LIBS="${saveLIBS}"
                        ;;
+                   regex)
+                       AC_MSG_CHECKING([Boost regex])
+                       AC_SUBST([BOOST_REGEX_LIB])
+                       saveLIBS="${LIBS}"
+                       BOOST_REGEX_LIB=""
+                       for l in boost_regex${BOOST_TOOLSET}-mt boost_regex${BOOST_TOOLSET}; do
+                           LIBS="${saveLIBS} -l${l}"
+                       AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <boost/version.hpp>
+#include <boost/regex.hpp>
+]],[[ 
+int x = BOOST_VERSION;
+]])],[
+                           BOOST_REGEX_LIB="-l${l}"
+                           break],[])
+                       done
+                       if test "${BOOST_REGEX_LIB}"; then
+                           AC_MSG_RESULT([yes])
+                       else
+                           AC_MSG_RESULT([no])
+                       fi
+                       ;;
                esac
            done
        fi