X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=m4%2Fax_compiler_version.m4;h=e074cf743c662e3b4ddd82a7acdb54386a3598ce;hb=f6879bcc9ff979bf313c7dd155ab2e1fee8605d8;hp=da897bc23e7b2a11e805d2eeb3e02f0b95bf7175;hpb=fa5dde3af5a99cda67d0ab005393cfd1627bd3d5;p=awesomized%2Flibmemcached diff --git a/m4/ax_compiler_version.m4 b/m4/ax_compiler_version.m4 index da897bc2..e074cf74 100644 --- a/m4/ax_compiler_version.m4 +++ b/m4/ax_compiler_version.m4 @@ -4,8 +4,7 @@ # # SYNOPSIS # -# AX_C_COMPILER_VERSION() -# AX_CXX_COMPILER_VERSION() +# AX_COMPILER_VERSION() # # DESCRIPTION # @@ -44,65 +43,58 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#serial 4 +#serial 5 +AC_DEFUN([_C_COMPILER_VERSION], + [AC_MSG_CHECKING([C Compiler version]) - AC_DEFUN([AX_C_COMPILER_VERSION],[ - AC_REQUIRE([AX_COMPILER_VENDOR]) - AC_MSG_CHECKING([C Compiler version]) + AS_CASE(["$ax_cv_c_compiler_vendor"], + [sun],[ax_c_compiler_version=`$CC -V 2>&1 | sed 1q`], + [intel],[ax_c_compiler_version=`$CC --version 2>&1 | sed 1q`], + [clang],[ax_c_compiler_version=`$CC --version 2>&1 | sed 1q`], + [gnu],[ax_c_compiler_version=`$CC --version | sed 1q`], + [mingw],[ax_c_compiler_version=`$CC --version | sed 1q`], + [ax_c_compiler_version="unknown: $ax_cv_c_compiler_vendor"]) - ax_cv_c_compiler_version_vendor="$ax_cv_c_compiler_vendor" + AC_MSG_RESULT(["$ax_c_compiler_version"]) + AC_SUBST([CC_VERSION_VENDOR],["$ax_cv_c_compiler_vendor"]) + AC_SUBST([CC_VERSION],["$ax_c_compiler_version"]) + ]) - AC_CHECK_DECL([__GNUC_PATCHLEVEL__],[ - GNUCC=yes - ],[GNUCC=no]) - AC_MSG_CHECKING([GNUCC]) - AC_MSG_RESULT([$GNUCC]) +AC_DEFUN([_CXX_COMPILER_VERSION], + [AC_MSG_CHECKING([C++ Compiler version]) - AC_CHECK_DECL([__SUNPRO_C],[SUNCC=yes],[SUNCC=no]) - AC_MSG_CHECKING([SUNCC]) - AC_MSG_RESULT([$SUNCC]) + AS_CASE(["$ax_cv_c_compiler_vendor"], + [sun],[ax_cxx_compiler_version=`$CXX -V 2>&1 | sed 1q`], + [intel],[ax_cxx_compiler_version=`$CXX --version 2>&1 | sed 1q`], + [clang],[ax_cxx_compiler_version=`$CXX --version 2>&1 | sed 1q`], + [gnu],[ax_cxx_compiler_version=`$CXX --version | sed 1q`], + [mingw],[ax_cxx_compiler_version=`$CXX --version | sed 1q`], + [ax_cxx_compiler_version="unknown: $ax_cv_c_compiler_vendor"]) - AC_CHECK_DECL([__ICC],[INTELCC=yes],[INTELCC=no]) - AC_MSG_CHECKING([INTELCC]) - AC_MSG_RESULT([$INTELCC]) + AC_MSG_RESULT(["$ax_cxx_compiler_version"]) + AC_SUBST([CXX_VERSION_VENDOR],["$ax_cv_c_compiler_vendor"]) + AC_SUBST([CXX_VERSION],["$ax_cxx_compiler_version"]) + ]) - AC_CHECK_DECL([__clang__],[CLANG=yes],[CLANG=no]) - AC_MSG_CHECKING([CLANG]) - AC_MSG_RESULT([$CLANG]) +AC_DEFUN([AX_COMPILER_VERSION], + [AC_REQUIRE([AX_COMPILER_VENDOR]) - AC_CHECK_DECL([__MINGW32__],[ - MINGW=yes - ax_cv_c_compiler_version_vendor=mingw - ],[MINGW=no]) - AC_MSG_CHECKING([MINGW]) - AC_MSG_RESULT([$MINGW]) + AC_MSG_CHECKING([MINGW]) + AC_CHECK_DECL([__MINGW32__], + [MINGW=yes + ax_c_compiler_version_vendor=mingw], + [MINGW=no]) + AC_MSG_RESULT([$MINGW]) - AS_CASE(["$ax_cv_c_compiler_version_vendor"],[ - sun],[ax_c_compiler_version=`$CC -V 2>&1 | sed 1q`],[ - intel],[ax_c_compiler_version=`$CC --version 2>&1 | sed 1q`],[ - clang],[ax_c_compiler_version=`$CC --version 2>&1 | sed 1q`],[ - gnu],[ax_c_compiler_version=`$CC --version | sed 1q`],[ - mingw],[ax_c_compiler_version=`$CC --version | sed 1q`],[ - ax_c_compiler_version=unknown]) - - AC_MSG_RESULT(["$ax_c_compiler_version"]) - AC_SUBST([CC_VERSION_VENDOR],["$ax_cv_c_compiler_version_vendor"]) - AC_SUBST([CC_VERSION],["$ax_c_compiler_version"]) - ]) - - AC_DEFUN([AX_CXX_COMPILER_VERSION],[ - AC_REQUIRE([AX_C_COMPILER_VERSION]) - AC_MSG_CHECKING([C++ Compiler version]) - - AS_CASE(["$ax_cv_c_compiler_version_vendor"],[ - sun],[ax_cxx_compiler_version=`$CC -V 2>&1 | sed 1q`],[ - intel],[ax_cxx_compiler_version=`$CC --version 2>&1 | sed 1q`],[ - clang],[ax_cxx_compiler_version=`$CC --version 2>&1 | sed 1q`],[ - gnu],[ax_cxx_compiler_version=`$CC --version | sed 1q`],[ - mingw],[ax_cxx_compiler_version=`$CC --version | sed 1q`],[ - ax_cxx_compiler_version=unknown]) - - AC_MSG_RESULT(["$ax_cxx_compiler_version"]) - AC_SUBST([CXX_VERSION_VENDOR],["$ax_cv_c_compiler_version_vendor"]) - AC_SUBST([CXX_VERSION],["$ax_cxx_compiler_version"]) + AC_REQUIRE([_C_COMPILER_VERSION]) + AC_REQUIRE([_CXX_COMPILER_VERSION]) + AS_IF([test "x$GCC" = xyes], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if !defined(__GNUC__) || (__GNUC__ < 4) || ((__GNUC__ >= 4) && (__GNUC_MINOR__ < 7)) +# error GCC is Too Old! +#endif + ]])], + [ac_c_gcc_recent=yes], + [ac_c_gcc_recent=no]) ]) + ])