Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check compiler version in configure.ac #470

Merged
merged 1 commit into from
Apr 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,45 @@ AM_SILENT_RULES([yes])

LT_INIT
AC_CONFIG_MACRO_DIR([m4])

AC_PROG_CXX(clang++ g++ c++)
AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
AC_LANG(C++)

AC_MSG_CHECKING([if compiler is new enough])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [[
#if defined(__clang__)

#define CLANG_VERSION (__clang_major__ * 10000 \
+ __clang_minor__ * 100 \
+ __clang_patchlevel__)
#if CLANG_VERSION < 30300
#error
#endif

#else

#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
#if GCC_VERSION < 40900
#error
#endif

#endif
]])],
[COMPILER_OK=yes], [COMPILER_OK=no])
AC_MSG_RESULT([$COMPILER_OK])
if test "x$COMPILER_OK" = "xno"; then
AC_MSG_ERROR([compiler is too old; GCC 4.9 or later and Clang 3.3 or later are supported])
fi

AC_PROG_RANLIB
AC_PROG_CC
AC_PROG_LEX
AC_PROG_YACC
AC_PROG_RANLIB
AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
AC_LANG(C++)

AM_PATH_PYTHON

AC_CHECK_FUNCS([clock_gettime])
Expand Down