Commit eca2f5b9 authored by Alberto Miranda's avatar Alberto Miranda ♨️
Browse files

Fix bug in ax_boost macros that produced wrong error reporting

parent a5e26dde
Loading
Loading
Loading
Loading
+26 −21
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 17
#serial 18

AC_DEFUN([AX_BOOST_ASIO],
[
@@ -62,7 +62,7 @@ AC_DEFUN([AX_BOOST_ASIO],
        LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
        export LDFLAGS

        AC_CACHE_CHECK(whether the Boost::ASIO library is available,
        AC_CACHE_CHECK(whether the Boost::ASIO library headers are available,
                       ax_cv_boost_asio,
        [AC_LANG_PUSH([C++])
         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ @%:@include <boost/asio.hpp>
@@ -79,28 +79,33 @@ AC_DEFUN([AX_BOOST_ASIO],
                             ax_cv_boost_asio=yes, ax_cv_boost_asio=no)
         AC_LANG_POP([C++])
        ])

        if test "x$ax_cv_boost_asio" = "xyes"; then
            ax_lib=""
            AC_DEFINE(HAVE_BOOST_ASIO,,[define if the Boost::ASIO library is available])
            BN=boost_system
            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
            if test "x$ax_boost_user_asio_lib" = "x"; then
                for ax_lib in `ls $BOOSTLIBDIR/libboost_system*.so* $BOOSTLIBDIR/libboost_system*.dylib* $BOOSTLIBDIR/libboost_system*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_system.*\)\.so.*$;\1;' -e 's;^lib\(boost_system.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_system.*\)\.a.*$;\1;' ` ; do
                for ax_lib in `ls $BOOSTLIBDIR/libboost_system*.so* $BOOSTLIBDIR/libboost_system*.dylib* $BOOSTLIBDIR/libboost_system*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_system.*\)\.so.*$;\1;' -e 's;^lib\(boost_system.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_system.*\)\.a.*$;\1;' ` ; 
                do
                    AC_MSG_NOTICE([checking whether the Boost::ASIO library is available...])
                    AC_CHECK_LIB($ax_lib, main, [BOOST_ASIO_LIB="-l$ax_lib" AC_SUBST(BOOST_ASIO_LIB) link_thread="yes" break],
                                 [link_thread="no"])
                done
            else
               for ax_lib in $ax_boost_user_asio_lib $BN-$ax_boost_user_asio_lib; do
                for ax_lib in $ax_boost_user_asio_lib $BN-$ax_boost_user_asio_lib; 
                do
                    AC_MSG_NOTICE([checking whether the Boost::ASIO library is available...])
                    AC_CHECK_LIB($ax_lib, main,
                                 [BOOST_ASIO_LIB="-l$ax_lib" AC_SUBST(BOOST_ASIO_LIB) link_asio="yes" break],
                                 [link_asio="no"])
                done

            fi
            if test "x$ax_lib" = "x"; then
                AC_MSG_ERROR(Could not find a version of the library!)
                AC_MSG_ERROR([Could not find a version of the Boost::ASIO library!])
            fi
            if test "x$link_asio" = "xno"; then
                AC_MSG_ERROR(Could not link against $ax_lib !)
                AC_MSG_ERROR([Could not link against [$ax_lib] !])
            fi
        fi

+63 −54
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 27
#serial 28

AC_DEFUN([AX_BOOST_FILESYSTEM],
[
@@ -67,7 +67,7 @@ AC_DEFUN([AX_BOOST_FILESYSTEM],
        LIBS="$LIBS $BOOST_SYSTEM_LIB"
        export LIBS

        AC_CACHE_CHECK(whether the Boost::Filesystem library is available,
        AC_CACHE_CHECK(whether the Boost::Filesystem library headers are available,
                       ax_cv_boost_filesystem,
        [AC_LANG_PUSH([C++])
         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/filesystem/path.hpp>]],
@@ -77,37 +77,46 @@ AC_DEFUN([AX_BOOST_FILESYSTEM],
                           ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no)
         AC_LANG_POP([C++])
        ])

        if test "x$ax_cv_boost_filesystem" = "xyes"; then
            AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available])
            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`

            if test "x$ax_boost_user_filesystem_lib" = "x"; then
                for libextension in `ls -r $BOOSTLIBDIR/libboost_filesystem* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do
                     ax_lib=${libextension}
                ax_lib=""
                for ax_lib in `ls -r $BOOSTLIBDIR/libboost_filesystem* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; 
                do
                    AC_MSG_NOTICE([checking whether the Boost::Filesystem library is available...])
                    AC_CHECK_LIB($ax_lib, exit,
                                 [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
                                 [link_filesystem="no"])
                done

                if test "x$link_filesystem" != "xyes"; then
                for libextension in `ls -r $BOOSTLIBDIR/boost_filesystem* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do
                     ax_lib=${libextension}
                    for ax_lib in `ls -r $BOOSTLIBDIR/boost_filesystem* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; 
                    do
                        AC_MSG_NOTICE([checking whether the Boost::Filesystem library is available...])
                        AC_CHECK_LIB($ax_lib, exit,
                                     [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
                                     [link_filesystem="no"])
                    done
                fi
            else
               for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do
                for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; 
                do
                    AC_MSG_NOTICE([checking whether the Boost::Filesystem library is available...])
                    AC_CHECK_LIB($ax_lib, exit,
                                 [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
                                 [link_filesystem="no"])
                done

            fi

            if test "x$ax_lib" = "x"; then
                AC_MSG_ERROR(Could not find a version of the library!)
                AC_MSG_ERROR([Could not find a valid version of the Boost::Filesystem library!])
            fi

            if test "x$link_filesystem" != "xyes"; then
				AC_MSG_ERROR(Could not link against $ax_lib !)
                AC_MSG_ERROR([Could not link against [$ax_lib] !])
            fi
        fi

+41 −36
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 25
#serial 26

AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS],
[
@@ -60,7 +60,7 @@ AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS],
        LDFLAGS_SAVED="$LDFLAGS"
        LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
        export LDFLAGS
        AC_CACHE_CHECK([whether the Boost::Program_Options library is available],
        AC_CACHE_CHECK([whether the Boost::Program_Options library headers are available],
                       ax_cv_boost_program_options,
                       [AC_LANG_PUSH(C++)
                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/program_options/errors.hpp>
@@ -71,32 +71,37 @@ AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS],
                    AC_LANG_POP([C++])
        ])
        if test "$ax_cv_boost_program_options" = yes; then
            ax_lib=""
            AC_DEFINE(HAVE_BOOST_PROGRAM_OPTIONS,,[define if the Boost::PROGRAM_OPTIONS library is available])
                BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
            if test "x$ax_boost_user_program_options_lib" = "x"; then
                for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.dylib* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.dylib.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.a.*$;\1;'` ; do
                     ax_lib=${libextension}
                for ax_lib in `ls $BOOSTLIBDIR/libboost_program_options*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.dylib* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.dylib.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.a.*$;\1;'` ; 
                do
                    AC_MSG_NOTICE([checking whether the Boost::Program_Options library is available...])
                    AC_CHECK_LIB($ax_lib, exit,
                                    [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
                                    [link_program_options="no"])
                done
                if test "x$link_program_options" != "xyes"; then
                for libextension in `ls $BOOSTLIBDIR/boost_program_options*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.a.*$;\1;'` ; do
                     ax_lib=${libextension}
                    for ax_lib in `ls $BOOSTLIBDIR/boost_program_options*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.a.*$;\1;'` ; 
                    do
                        AC_MSG_NOTICE([checking whether the Boost::Program_Options library is available...])
                        AC_CHECK_LIB($ax_lib, exit,
                                        [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
                                        [link_program_options="no"])
                    done
                fi
            else
                  for ax_lib in $ax_boost_user_program_options_lib boost_program_options-$ax_boost_user_program_options_lib; do
                for ax_lib in $ax_boost_user_program_options_lib boost_program_options-$ax_boost_user_program_options_lib; 
                do
                    AC_MSG_NOTICE([checking whether the Boost::Program_Options library is available...])
                    AC_CHECK_LIB($ax_lib, main,
                                    [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
                                    [link_program_options="no"])
                done
            fi
            if test "x$ax_lib" = "x"; then
                AC_MSG_ERROR(Could not find a version of the library!)
                AC_MSG_ERROR([Could not find a valid version of the Boost::Program_Options library!])
            fi
            if test "x$link_program_options" != "xyes"; then
                AC_MSG_ERROR([Could not link against [$ax_lib] !])
+55 −50
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 23
#serial 24

AC_DEFUN([AX_BOOST_REGEX],
[
@@ -62,7 +62,7 @@ AC_DEFUN([AX_BOOST_REGEX],
        LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
        export LDFLAGS

        AC_CACHE_CHECK(whether the Boost::Regex library is available,
        AC_CACHE_CHECK(whether the Boost::Regex headers are available,
                       ax_cv_boost_regex,
        [AC_LANG_PUSH([C++])
             AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/regex.hpp>
@@ -72,18 +72,21 @@ AC_DEFUN([AX_BOOST_REGEX],
         AC_LANG_POP([C++])
        ])
        if test "x$ax_cv_boost_regex" = "xyes"; then
            ax_lib=""
            AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available])
            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
            if test "x$ax_boost_user_regex_lib" = "x"; then
                for libextension in `ls $BOOSTLIBDIR/libboost_regex*.so* $BOOSTLIBDIR/libboost_regex*.dylib* $BOOSTLIBDIR/libboost_regex*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_regex.*\)\.so.*$;\1;' -e 's;^lib\(boost_regex.*\)\.dylib.*;\1;' -e 's;^lib\(boost_regex.*\)\.a.*$;\1;'` ; do
                     ax_lib=${libextension}
                for ax_lib in `ls $BOOSTLIBDIR/libboost_regex*.so* $BOOSTLIBDIR/libboost_regex*.dylib* $BOOSTLIBDIR/libboost_regex*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_regex.*\)\.so.*$;\1;' -e 's;^lib\(boost_regex.*\)\.dylib.*;\1;' -e 's;^lib\(boost_regex.*\)\.a.*$;\1;'` ; 
                do
                    AC_MSG_NOTICE([checking whether the Boost::Regex library is available...])
                    AC_CHECK_LIB($ax_lib, exit,
                                 [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
                                 [link_regex="no"])
                done
                if test "x$link_regex" != "xyes"; then
                for libextension in `ls $BOOSTLIBDIR/boost_regex*.dll* $BOOSTLIBDIR/boost_regex*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_regex.*\)\.dll.*$;\1;' -e 's;^\(boost_regex.*\)\.a.*$;\1;'` ; do
                     ax_lib=${libextension}
                    for ax_lib in `ls $BOOSTLIBDIR/boost_regex*.dll* $BOOSTLIBDIR/boost_regex*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_regex.*\)\.dll.*$;\1;' -e 's;^\(boost_regex.*\)\.a.*$;\1;'` ; 
                    do
                        AC_MSG_NOTICE([checking whether the Boost::Regex library is available...])
                        AC_CHECK_LIB($ax_lib, exit,
                                     [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
                                     [link_regex="no"])
@@ -91,17 +94,19 @@ AC_DEFUN([AX_BOOST_REGEX],
                fi

            else
               for ax_lib in $ax_boost_user_regex_lib boost_regex-$ax_boost_user_regex_lib; do
                for ax_lib in $ax_boost_user_regex_lib boost_regex-$ax_boost_user_regex_lib; 
                do
                    AC_MSG_NOTICE([checking whether the Boost::Regex library is available...])
                    AC_CHECK_LIB($ax_lib, main,
                                 [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
                                 [link_regex="no"])
                done
            fi
            if test "x$ax_lib" = "x"; then
                AC_MSG_ERROR(Could not find a version of the Boost::Regex library!)
                AC_MSG_ERROR([Could not find a valid version of the Boost::Regex library!])
            fi
            if test "x$link_regex" != "xyes"; then
				AC_MSG_ERROR(Could not link against $ax_lib !)
                AC_MSG_ERROR([Could not link against $ax_lib !])
            fi
        fi

+57 −52
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 19
#serial 20

AC_DEFUN([AX_BOOST_SYSTEM],
[
@@ -64,7 +64,7 @@ AC_DEFUN([AX_BOOST_SYSTEM],
        LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
        export LDFLAGS

        AC_CACHE_CHECK(whether the Boost::System library is available,
        AC_CACHE_CHECK(whether the Boost::System library headers are available,
                       ax_cv_boost_system,
        [AC_LANG_PUSH([C++])
             CXXFLAGS_SAVE=$CXXFLAGS
@@ -78,40 +78,45 @@ AC_DEFUN([AX_BOOST_SYSTEM],
        ])
        if test "x$ax_cv_boost_system" = "xyes"; then
            AC_SUBST(BOOST_CPPFLAGS)

            AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available])
            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`

            LDFLAGS_SAVE=$LDFLAGS
            if test "x$ax_boost_user_system_lib" = "x"; then
                for libextension in `ls -r $BOOSTLIBDIR/libboost_system* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do
                     ax_lib=${libextension}
                ax_lib=""
                for ax_lib in `ls -r $BOOSTLIBDIR/libboost_system* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; 
                do
                    AC_MSG_NOTICE([checking whether the Boost::System library is available...])
                    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 -r $BOOSTLIBDIR/boost_system* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do
                     ax_lib=${libextension}
                    for ax_lib in `ls -r $BOOSTLIBDIR/boost_system* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; 
                    do
                        AC_MSG_NOTICE([checking whether the Boost::System library is available...])
                        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
                fi

            else
               for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; do
                for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; 
                do
                    AC_MSG_NOTICE([checking whether the Boost::System library is available...])
                    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

            fi

            if test "x$ax_lib" = "x"; then
                AC_MSG_ERROR(Could not find a version of the library!)
                AC_MSG_ERROR([Could not find a valid version of the Boost::System library!])
            fi
            if test "x$link_system" = "xno"; then
				AC_MSG_ERROR(Could not link against $ax_lib !)
                AC_MSG_ERROR([Could not link against "$ax_lib"!])
            fi
        fi

Loading