diff --git a/Makefile.am b/Makefile.am index cdc3a23..5b343f5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,6 @@ pkgconfig_DATA = cmph.pc if USE_CXXMPH pkgconfig_DATA += cxxmph.pc endif -ACLOCAL_AMFLAGS="-I m4" +ACLOCAL_AMFLAGS="-Im4" pkgconfigdir = $(libdir)/pkgconfig diff --git a/m4/acinclude.m4 b/m4/acinclude.m4 new file mode 100644 index 0000000..07e81d1 --- /dev/null +++ b/m4/acinclude.m4 @@ -0,0 +1,7 @@ +AC_DEFUN([AC_ENABLE_CXXMPH], [AC_ARG_ENABLE([cxxmph], + [ --enable-cxxmph enable the c++ cxxmph library ], + [case "${enableval}" in + yes) cxxmph=true ;; + no) cxxmph=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-cxxmph]) ;; + esac],[cxxmph=false])]) diff --git a/m4/cxx0x.m4 b/m4/cxx0x.m4 new file mode 100644 index 0000000..27a33d1 --- /dev/null +++ b/m4/cxx0x.m4 @@ -0,0 +1,77 @@ +dnl Check for baseline language coverage in the compiler for the C++0x standard. +# AC_COMPILE_STDCXX_OX +AC_DEFUN([AC_COMPILE_STDCXX_0X], [ + AC_CACHE_CHECK(if compiler supports C++0x features without additional flags, + ac_cv_cxx_compile_cxx0x_native, + [AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + #include + #include + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + typedef check> right_angle_brackets; + + int a; + decltype(a) b; + ],, + ac_cv_cxx_compile_cxx0x_native=yes, ac_cv_cxx_compile_cxx0x_native=no) + AC_LANG_RESTORE + ]) + + AC_CACHE_CHECK(if compiler supports C++0x features with -std=c++0x, + ac_cv_cxx_compile_cxx0x_cxx, + [AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -std=c++0x" + AC_TRY_COMPILE([ + #include + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + typedef check> right_angle_brackets; + + int a; + decltype(a) b;],, + ac_cv_cxx_compile_cxx0x_cxx=yes, ac_cv_cxx_compile_cxx0x_cxx=no) + CXXFLAGS="$ac_save_CXXFLAGS" + AC_LANG_RESTORE + ]) + + AC_CACHE_CHECK(if compiler supports C++0x features with -std=gnu++0x, + ac_cv_cxx_compile_cxx0x_gxx, + [AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -std=gnu++0x" + AC_TRY_COMPILE([ + #include + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + typedef check> right_angle_brackets; + + int a; + decltype(a) b;],, + ac_cv_cxx_compile_cxx0x_gxx=yes, ac_cv_cxx_compile_cxx0x_gxx=no) + CXXFLAGS="$ac_save_CXXFLAGS" + AC_LANG_RESTORE + ]) + + if test "$ac_cv_cxx_compile_cxx0x_native" = yes || + test "$ac_cv_cxx_compile_cxx0x_cxx" = yes || + test "$ac_cv_cxx_compile_cxx0x_gxx" = yes; then + AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ]) + fi +]) diff --git a/acinclude.m4 b/m4/largefile.m4 similarity index 59% rename from acinclude.m4 rename to m4/largefile.m4 index c047ca7..908169f 100644 --- a/acinclude.m4 +++ b/m4/largefile.m4 @@ -1,95 +1,3 @@ -AC_DEFUN([AC_ENABLE_CXXMPH], [AC_ARG_ENABLE([cxxmph], - [ --enable-cxxmph enable the c++ cxxmph library ], - [case "${enableval}" in - yes) cxxmph=true ;; - no) cxxmph=false ;; - *) AC_MSG_ERROR([bad value ${enableval} for --enable-cxxmph]) ;; - esac],[cxxmph=false])]) - -AC_DEFUN([AC_CHECK_SPOON], [ - AC_ARG_WITH(spoon, [ --with-spoon=SPOON this is inocuous, since the truth is that there is no spoon ]) - AC_MSG_CHECKING(if there is spoon) - AC_MSG_RESULT(no) -]) - -dnl Check for baseline language coverage in the compiler for the C++0x standard. -# AC_COMPILE_STDCXX_OX -AC_DEFUN([AC_COMPILE_STDCXX_0X], [ - AC_CACHE_CHECK(if compiler supports C++0x features without additional flags, - ac_cv_cxx_compile_cxx0x_native, - [AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([ - #include - #include - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - typedef check> right_angle_brackets; - - int a; - decltype(a) b; - ],, - ac_cv_cxx_compile_cxx0x_native=yes, ac_cv_cxx_compile_cxx0x_native=no) - AC_LANG_RESTORE - ]) - - AC_CACHE_CHECK(if compiler supports C++0x features with -std=c++0x, - ac_cv_cxx_compile_cxx0x_cxx, - [AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -std=c++0x" - AC_TRY_COMPILE([ - #include - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - typedef check> right_angle_brackets; - - int a; - decltype(a) b;],, - ac_cv_cxx_compile_cxx0x_cxx=yes, ac_cv_cxx_compile_cxx0x_cxx=no) - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE - ]) - - AC_CACHE_CHECK(if compiler supports C++0x features with -std=gnu++0x, - ac_cv_cxx_compile_cxx0x_gxx, - [AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -std=gnu++0x" - AC_TRY_COMPILE([ - #include - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - typedef check> right_angle_brackets; - - int a; - decltype(a) b;],, - ac_cv_cxx_compile_cxx0x_gxx=yes, ac_cv_cxx_compile_cxx0x_gxx=no) - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE - ]) - - if test "$ac_cv_cxx_compile_cxx0x_native" = yes || - test "$ac_cv_cxx_compile_cxx0x_cxx" = yes || - test "$ac_cv_cxx_compile_cxx0x_gxx" = yes; then - AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ]) - fi -]) - dnl By default, many hosts won't let programs access large files; dnl one must use special compiler options to get large-file access to work. dnl For more details about this brain damage please see: @@ -203,5 +111,3 @@ AC_DEFUN([AC_SYS_EXTRA_LARGEFILE], esac]) fi ]) - - diff --git a/m4/spoon.m4 b/m4/spoon.m4 new file mode 100644 index 0000000..938efe0 --- /dev/null +++ b/m4/spoon.m4 @@ -0,0 +1,5 @@ +AC_DEFUN([AC_CHECK_SPOON], [ + AC_ARG_WITH(spoon, [ --with-spoon=SPOON this is inocuous, since the truth is that there is no spoon ]) + AC_MSG_CHECKING(if there is spoon) + AC_MSG_RESULT(no) +])