Skip to content

Commit

Permalink
configure.ac: Exit if compiler does not have c++11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
amitdo authored Jan 8, 2017
1 parent 263a4d2 commit e682954
Showing 1 changed file with 22 additions and 25 deletions.
47 changes: 22 additions & 25 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -368,15 +368,35 @@ AC_COMPILE_IFELSE(
]])
], [
AC_MSG_RESULT(yes)
has_cpp11=yes
],
[
AC_MSG_RESULT(no)
has_cpp11=no
AC_MSG_ERROR([Your compiler does not have the necessary c++11 support! Cannot proceed.])
])
AC_CHECK_FUNCS([snprintf],, [snprintfworks=yes])
CXXFLAGS="$OLD_CXXFLAGS"
# set c++11 support based on platform/compiler
case "${host_os}" in
cygwin*)
CXXFLAGS="$CXXFLAGS -std=gnu++11"
;;
*-darwin* | *-macos10*)
if test "x$CLANG" = "xyes"; then
CXXFLAGS="$CXXFLAGS -std=c++11 "
LDFLAGS="$LDFLAGS -stdlib=libc++"
else
CXXFLAGS="$CXXFLAGS -std=c++11"
fi
;;
*)
# default
CXXFLAGS="$CXXFLAGS -std=c++11"
;;
esac
# ----------------------------------------
# Check for libraries
# ----------------------------------------
Expand Down Expand Up @@ -458,29 +478,6 @@ else
CPPFLAGS="$CPPFLAGS $cairo_CFLAGS"
fi
# set c++11 support based on platform/compiler
if test "x$has_cpp11" = "xyes"; then
case "${host_os}" in
cygwin*)
CXXFLAGS="$CXXFLAGS -std=gnu++11"
;;
*-darwin* | *-macos10*)
if test "x$CLANG" = "xyes"; then
CXXFLAGS="$CXXFLAGS -std=c++11 "
LDFLAGS="$LDFLAGS -stdlib=libc++"
else
CXXFLAGS="$CXXFLAGS -std=c++11"
fi
;;
*)
# default
CXXFLAGS="$CXXFLAGS -std=c++11"
;;
esac
else
AC_MSG_WARN([Training tools WILL NOT be built because of missing c++11 support.])
AM_CONDITIONAL([ENABLE_TRAINING], false)
fi
# ----------------------------------------
# Final Tasks and Output
Expand Down

0 comments on commit e682954

Please sign in to comment.