diff options
| author | Sam Varshavchik | 2017-03-11 10:21:17 -0500 | 
|---|---|---|
| committer | Sam Varshavchik | 2017-03-11 10:21:17 -0500 | 
| commit | 2fbe4c6aa77fd64b3d6598e6158e10076159b0c1 (patch) | |
| tree | ba2930c7066274d09387982684ec1d214e5bad64 /unicode/m4 | |
| parent | 19717bb6b4bea979efc5b441f91ae11b982f6fd4 (diff) | |
| download | courier-libs-2fbe4c6aa77fd64b3d6598e6158e10076159b0c1.tar.bz2 | |
courier-unicode: add autoconf macros.
Diffstat (limited to 'unicode/m4')
| -rw-r--r-- | unicode/m4/courier-unicode.m4 | 76 | 
1 files changed, 76 insertions, 0 deletions
| diff --git a/unicode/m4/courier-unicode.m4 b/unicode/m4/courier-unicode.m4 new file mode 100644 index 0000000..06b544a --- /dev/null +++ b/unicode/m4/courier-unicode.m4 @@ -0,0 +1,76 @@ +dnl Sets the COURIER_UNICODE_CXXFLAGS variable to any additional compiler +dnl flags needed to build the courier-unicode package and packages that +dnl use the courier-unicode package. + +AC_DEFUN([AX_COURIER_UNICODE_CXXFLAGS],[ + +save_FLAGS="$CXXFLAGS" + +AC_LANG_PUSH([C++]) + +AC_TRY_COMPILE([ +#include <string> +], [ +     std::u32string s; +     char32_t c; +     ], +     [ +     ], +     [ + +COURIER_UNICODE_CXXFLAGS="-std=c++11" +CXXFLAGS="$save_CFLAGS $COURIER_UNICODE_CXXFLAGS" + +AC_TRY_COMPILE([ +#include <string> +], [ +     std::u32string s; +     char32_t c; +     ], +     [ +     ], +     [ + +COURIER_UNICODE_CXXFLAGS="-std=c++0x" +CXXFLAGS="$save_CFLAGS $COURIER_UNICODE_CXXFLAGS" + +AC_TRY_COMPILE([ +#include <string> +], [ +     std::u32string s; +     char32_t c; +     ], +     [ +     ], +     [ +AC_MSG_ERROR([*** A compiler with C++11 Unicode support was not found]) +]) +]) +]) +CXXFLAGS="$save_FLAGS" +AC_LANG_POP([C++]) +]) + +AC_DEFUN([AX_COURIER_UNICODE_VERSION],[ + +AC_MSG_CHECKING(courier-unicode library and version) + +AC_TRY_COMPILE([ +#include <courier-unicode.h> +#ifndef COURIER_UNICODE_VERSION +#define COURIER_UNICODE_VERSION 0 +#endif + +#if COURIER_UNICODE_VERSION < 200 +#error "courier-unicode 2.0 library is required" +#endif + +],[],[], +AC_MSG_ERROR([ +ERROR: The Courier Unicode Library 2.0 header files appear not to be installed. +You may need to upgrade the library or install a separate development +subpackage in addition to the main package.]) +) + +AC_MSG_RESULT([ok]) +]) | 
