Skip to content

Commit

Permalink
Tidying up boost configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Mapleson committed Dec 9, 2016
1 parent b947521 commit 0e1b99f
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 75 deletions.
8 changes: 7 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ if [[ "${dynboost}" == "yes" ]]; then
BOOST_LIBS="${BOOST_DYN_LIBS}"
else
if [[ -z "${BOOST_TIMER_STATIC_LIB}" ]] || [[ -z "${BOOST_CHRONO_STATIC_LIB}" ]] || [[ -z "${BOOST_FILESYSTEM_STATIC_LIB}" ]] || [[ -z "${BOOST_PROGRAM_OPTIONS_STATIC_LIB}" ]] || [[ -z "${BOOST_SYSTEM_STATIC_LIB}" ]]; then
AC_MSG_WARN([Not all static boost libraries could be found. Using dynamic libraries instead.])
AC_MSG_WARN([Not all static boost libraries could be found. Will use dynamic libraries instead.])
BOOST_LIBS="${BOOST_DYN_LIBS}"
else
BOOST_LIBS="${BOOST_STATIC_LIBS}"
Expand Down Expand Up @@ -229,4 +229,10 @@ else
AC_MSG_NOTICE([Building documentation with sphinx])
fi

if [[ "${dynboost}" == "yes" ]]; then
AC_MSG_NOTICE([Boost will be dynamically linked to your executable])
else
AC_MSG_NOTICE([Boost will be statically linked to your executable])
fi


26 changes: 12 additions & 14 deletions m4/ax_boost_chrono.m4
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,13 @@ AC_DEFUN([AX_BOOST_CHRONO],
done
no_find="no"
if test "x$ax_lib" = "x"; then
if test "x$ax_static_lib" = "x"; then
no_find="yes"
fi
if [[ -z "$ax_lib" ]] && [[ -z "$ax_static_lib" ]]; then
no_find="yes"
fi
no_link="no"
if test "x$link_chrono" != "xyes"; then
if test "x$link_chrono_static" != "xyes"; then
no_link="yes"
fi
if [[ "$link_chrono" == "no" ]] && [[ "$link_chrono_static" == "no" ]]; then
no_link="yes"
fi
else
Expand All @@ -127,21 +123,23 @@ AC_DEFUN([AX_BOOST_CHRONO],
done
fi
if test "x$ax_lib" = "x"; then
if [[ -z "$ax_lib" ]]; then
AC_MSG_WARN(Could not find a dynamic version of boost_chrono)
elif test "x$ax_static_lib" = "x"; then
fi
if [[ -z "$ax_static_lib" ]]; then
AC_MSG_WARN(Could not find a static version of boost_chrono)
fi
if test "x$no_find" = "xyes"; then
if [[ "$no_find" == "yes" ]]; then
AC_MSG_ERROR(Could not find any version boost_chrono to link to)
fi
if test "x$link_chrono" = "xno"; then
if [[ "$link_chrono" = "no" ]]; then
AC_MSG_WARN(Could not dynamic link against $ax_lib)
elif test "x$link_chrono_static" = "xno"; then
fi
if [[ "$link_chrono_static" == "no" ]]; then
AC_MSG_WARN(Could not static link against $ax_static_lib)
fi
if test "x$no_link" = "xyes"; then
if [[ "$no_link" == "yes" ]]; then
AC_MSG_ERROR(Could not link against any boost_chrono lib)
fi
Expand Down
28 changes: 13 additions & 15 deletions m4/ax_boost_filesystem.m4
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,13 @@ AC_DEFUN([AX_BOOST_FILESYSTEM],
done
no_find="no"
if test "x$ax_lib" = "x"; then
if test "x$ax_static_lib" = "x"; then
no_find="yes"
fi
if [[ -z "$ax_lib" ]] && [[ -z "$ax_static_lib" ]]; then
no_find="yes"
fi
no_link="no"
if test "x$link_filesystem" != "xyes"; then
if test "x$link_filesystem_static" != "xyes"; then
no_link="yes"
fi
if [[ "$link_filesystem" == "no" ]] && [[ "$link_filesystem_static" == "no" ]]; then
no_link="yes"
fi
else
Expand All @@ -129,21 +125,23 @@ AC_DEFUN([AX_BOOST_FILESYSTEM],
done
fi
if test "x$ax_lib" = "x"; then
if [[ -z "$ax_lib" ]]; then
AC_MSG_WARN(Could not find a dynamic version of boost_filesystem)
elif test "x$ax_static_lib" = "x"; then
fi
if [[ -z "$ax_static_lib" ]]; then
AC_MSG_WARN(Could not find a static version of boost_filesystem)
fi
if test "x$no_find" = "xyes"; then
AC_MSG_ERROR(Could not find any version of boost_filesystem to link to)
if [[ "$no_find" == "yes" ]]; then
AC_MSG_ERROR(Could not find any version boost_filesystem to link to)
fi
if test "x$link_filesystem" = "xno"; then
if [[ "$link_filesystem" = "no" ]]; then
AC_MSG_WARN(Could not dynamic link against $ax_lib)
elif test "x$link_filesystem_static" = "xno"; then
fi
if [[ "$link_filesystem_static" == "no" ]]; then
AC_MSG_WARN(Could not static link against $ax_static_lib)
fi
if test "x$no_link" = "xyes"; then
if [[ "$no_link" == "yes" ]]; then
AC_MSG_ERROR(Could not link against any boost_filesystem lib)
fi
Expand Down
28 changes: 13 additions & 15 deletions m4/ax_boost_program_options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,13 @@ AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS],
done
no_find="no"
if test "x$ax_lib" = "x"; then
if test "x$ax_static_lib" = "x"; then
no_find="yes"
fi
if [[ -z "$ax_lib" ]] && [[ -z "$ax_static_lib" ]]; then
no_find="yes"
fi
no_link="no"
if test "x$link_program_options" != "xyes"; then
if test "x$link_program_options_static" != "xyes"; then
no_link="yes"
fi
if [[ "$link_program_options" == "no" ]] && [[ "$link_program_options_static" == "no" ]]; then
no_link="yes"
fi
else
Expand All @@ -121,21 +117,23 @@ AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS],
done
fi
if test "x$ax_lib" = "x"; then
if [[ -z "$ax_lib" ]]; then
AC_MSG_WARN(Could not find a dynamic version of boost_program_options)
elif test "x$ax_static_lib" = "x"; then
fi
if [[ -z "$ax_static_lib" ]]; then
AC_MSG_WARN(Could not find a static version of boost_program_options)
fi
if test "x$no_find" = "xyes"; then
AC_MSG_ERROR(Could not find any version of boost_program_options to link to)
if [[ "$no_find" == "yes" ]]; then
AC_MSG_ERROR(Could not find any version boost_program_options to link to)
fi
if test "x$link_program_options" = "xno"; then
if [[ "$link_program_options" = "no" ]]; then
AC_MSG_WARN(Could not dynamic link against $ax_lib)
elif test "x$link_program_options_static" = "xno"; then
fi
if [[ "$link_program_options_static" == "no" ]]; then
AC_MSG_WARN(Could not static link against $ax_static_lib)
fi
if test "x$no_link" = "xyes"; then
if [[ "$no_link" == "yes" ]]; then
AC_MSG_ERROR(Could not link against any boost_program_options lib)
fi
Expand Down
28 changes: 13 additions & 15 deletions m4/ax_boost_system.m4
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,13 @@ AC_DEFUN([AX_BOOST_SYSTEM],
done
no_find="no"
if test "x$ax_lib" = "x"; then
if test "x$ax_static_lib" = "x"; then
no_find="yes"
fi
if [[ -z "$ax_lib" ]] && [[ -z "$ax_static_lib" ]]; then
no_find="yes"
fi
no_link="no"
if test "x$link_system" != "xyes"; then
if test "x$link_system_static" != "xyes"; then
no_link="yes"
fi
if [[ "$link_system" == "no" ]] && [[ "$link_system_static" == "no" ]]; then
no_link="yes"
fi
else
Expand All @@ -127,21 +123,23 @@ AC_DEFUN([AX_BOOST_SYSTEM],
done
fi
if test "x$ax_lib" = "x"; then
if [[ -z "$ax_lib" ]]; then
AC_MSG_WARN(Could not find a dynamic version of boost_system)
elif test "x$ax_static_lib" = "x"; then
fi
if [[ -z "$ax_static_lib" ]]; then
AC_MSG_WARN(Could not find a static version of boost_system)
fi
if test "x$no_find" = "xyes"; then
AC_MSG_ERROR(Could not find any version of boost_system to link to)
if [[ "$no_find" == "yes" ]]; then
AC_MSG_ERROR(Could not find any version boost_system to link to)
fi
if test "x$link_system" = "xno"; then
if [[ "$link_system" = "no" ]]; then
AC_MSG_WARN(Could not dynamic link against $ax_lib)
elif test "x$link_system_static" = "xno"; then
fi
if [[ "$link_system_static" == "no" ]]; then
AC_MSG_WARN(Could not static link against $ax_static_lib)
fi
if test "x$no_link" = "xyes"; then
if [[ "$no_link" == "yes" ]]; then
AC_MSG_ERROR(Could not link against any boost_system lib)
fi
Expand Down
28 changes: 13 additions & 15 deletions m4/ax_boost_timer.m4
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,13 @@ AC_DEFUN([AX_BOOST_TIMER],
done
no_find="no"
if test "x$ax_lib" = "x"; then
if test "x$ax_static_lib" = "x"; then
no_find="yes"
fi
if [[ -z "$ax_lib" ]] && [[ -z "$ax_static_lib" ]]; then
no_find="yes"
fi
no_link="no"
if test "x$link_timer" != "xyes"; then
if test "x$link_timer_static" != "xyes"; then
no_link="yes"
fi
if [[ "$link_timer" == "no" ]] && [[ "$link_timer_static" == "no" ]]; then
no_link="yes"
fi
else
Expand All @@ -128,21 +124,23 @@ AC_DEFUN([AX_BOOST_TIMER],
done
fi
if test "x$ax_lib" = "x"; then
if [[ -z "$ax_lib" ]]; then
AC_MSG_WARN(Could not find a dynamic version of boost_timer)
elif test "x$ax_static_lib" = "x"; then
fi
if [[ -z "$ax_static_lib" ]]; then
AC_MSG_WARN(Could not find a static version of boost_timer)
fi
if test "x$no_find" = "xyes"; then
AC_MSG_ERROR(Could not find any version of boost_timer to link to)
if [[ "$no_find" == "yes" ]]; then
AC_MSG_ERROR(Could not find any version boost_timer to link to)
fi
if test "x$link_timer" = "xno"; then
if [[ "$link_timer" = "no" ]]; then
AC_MSG_WARN(Could not dynamic link against $ax_lib)
elif test "x$link_timer_static" = "xno"; then
fi
if [[ "$link_timer_static" == "no" ]]; then
AC_MSG_WARN(Could not static link against $ax_static_lib)
fi
if test "x$no_link" = "xyes"; then
if [[ "$no_link" == "yes" ]]; then
AC_MSG_ERROR(Could not link against any boost_timer lib)
fi
Expand Down

0 comments on commit 0e1b99f

Please sign in to comment.