Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
4.4KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_boost_date_time.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_BOOST_DATE_TIME
  8. #
  9. # DESCRIPTION
  10. #
  11. # Test for Date_Time library from the Boost C++ libraries. The macro
  12. # requires a preceding call to AX_BOOST_BASE. Further documentation is
  13. # available at <http://randspringer.de/boost/index.html>.
  14. #
  15. # This macro calls:
  16. #
  17. # AC_SUBST(BOOST_DATE_TIME_LIB)
  18. #
  19. # And sets:
  20. #
  21. # HAVE_BOOST_DATE_TIME
  22. #
  23. # LICENSE
  24. #
  25. # Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
  26. # Copyright (c) 2008 Michael Tindal
  27. #
  28. # Copying and distribution of this file, with or without modification, are
  29. # permitted in any medium without royalty provided the copyright notice
  30. # and this notice are preserved. This file is offered as-is, without any
  31. # warranty.
  32. #serial 22
  33. AC_DEFUN([AX_BOOST_DATE_TIME],
  34. [
  35. AC_ARG_WITH([boost-date-time],
  36. AS_HELP_STRING([--with-boost-date-time@<:@=special-lib@:>@],
  37. [use the Date_Time library from boost - it is possible to specify a certain library for the linker
  38. e.g. --with-boost-date-time=boost_date_time-gcc-mt-d-1_33_1 ]),
  39. [
  40. if test "$withval" = "no"; then
  41. want_boost="no"
  42. elif test "$withval" = "yes"; then
  43. want_boost="yes"
  44. ax_boost_user_date_time_lib=""
  45. else
  46. want_boost="yes"
  47. ax_boost_user_date_time_lib="$withval"
  48. fi
  49. ],
  50. [want_boost="yes"]
  51. )
  52. if test "x$want_boost" = "xyes"; then
  53. AC_REQUIRE([AC_PROG_CC])
  54. CPPFLAGS_SAVED="$CPPFLAGS"
  55. CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  56. export CPPFLAGS
  57. LDFLAGS_SAVED="$LDFLAGS"
  58. LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
  59. export LDFLAGS
  60. AC_CACHE_CHECK(whether the Boost::Date_Time library is available,
  61. ax_cv_boost_date_time,
  62. [AC_LANG_PUSH([C++])
  63. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/date_time/gregorian/gregorian_types.hpp>]],
  64. [[using namespace boost::gregorian; date d(2002,Jan,10);
  65. return 0;
  66. ]])],
  67. ax_cv_boost_date_time=yes, ax_cv_boost_date_time=no)
  68. AC_LANG_POP([C++])
  69. ])
  70. if test "x$ax_cv_boost_date_time" = "xyes"; then
  71. AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::Date_Time library is available])
  72. BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
  73. if test "x$ax_boost_user_date_time_lib" = "x"; then
  74. for libextension in `ls $BOOSTLIBDIR/libboost_date_time*.so* $BOOSTLIBDIR/libboost_date_time*.dylib* $BOOSTLIBDIR/libboost_date_time*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_date_time.*\)\.so.*$;\1;' -e 's;^lib\(boost_date_time.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_date_time.*\)\.a*$;\1;'` ; do
  75. ax_lib=${libextension}
  76. AC_CHECK_LIB($ax_lib, exit,
  77. [BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
  78. [link_date_time="no"])
  79. done
  80. if test "x$link_date_time" != "xyes"; then
  81. for libextension in `ls $BOOSTLIBDIR/boost_date_time*.dll* $BOOSTLIBDIR/boost_date_time*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_date_time.*\)\.dll.*$;\1;' -e 's;^\(boost_date_time.*\)\.a.*$;\1;'` ; do
  82. ax_lib=${libextension}
  83. AC_CHECK_LIB($ax_lib, exit,
  84. [BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
  85. [link_date_time="no"])
  86. done
  87. fi
  88. else
  89. for ax_lib in $ax_boost_user_date_time_lib boost_date_time-$ax_boost_user_date_time_lib; do
  90. AC_CHECK_LIB($ax_lib, main,
  91. [BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
  92. [link_date_time="no"])
  93. done
  94. fi
  95. if test "x$ax_lib" = "x"; then
  96. AC_MSG_ERROR(Could not find a version of the library!)
  97. fi
  98. if test "x$link_date_time" != "xyes"; then
  99. AC_MSG_ERROR(Could not link against $ax_lib !)
  100. fi
  101. fi
  102. CPPFLAGS="$CPPFLAGS_SAVED"
  103. LDFLAGS="$LDFLAGS_SAVED"
  104. fi
  105. ])