Skip to content

Commit e682954

Browse files
authored
configure.ac: Exit if compiler does not have c++11 support
1 parent 263a4d2 commit e682954

File tree

1 file changed

+22
-25
lines changed

1 file changed

+22
-25
lines changed

configure.ac

+22-25
Original file line numberDiff line numberDiff line change
@@ -368,15 +368,35 @@ AC_COMPILE_IFELSE(
368368
]])
369369
], [
370370
AC_MSG_RESULT(yes)
371-
has_cpp11=yes
372371
],
373372
[
374373
AC_MSG_RESULT(no)
375-
has_cpp11=no
374+
AC_MSG_ERROR([Your compiler does not have the necessary c++11 support! Cannot proceed.])
376375
])
377376
AC_CHECK_FUNCS([snprintf],, [snprintfworks=yes])
378377
CXXFLAGS="$OLD_CXXFLAGS"
379378
379+
380+
# set c++11 support based on platform/compiler
381+
case "${host_os}" in
382+
cygwin*)
383+
CXXFLAGS="$CXXFLAGS -std=gnu++11"
384+
;;
385+
*-darwin* | *-macos10*)
386+
if test "x$CLANG" = "xyes"; then
387+
CXXFLAGS="$CXXFLAGS -std=c++11 "
388+
LDFLAGS="$LDFLAGS -stdlib=libc++"
389+
else
390+
CXXFLAGS="$CXXFLAGS -std=c++11"
391+
fi
392+
;;
393+
*)
394+
# default
395+
CXXFLAGS="$CXXFLAGS -std=c++11"
396+
;;
397+
esac
398+
399+
380400
# ----------------------------------------
381401
# Check for libraries
382402
# ----------------------------------------
@@ -458,29 +478,6 @@ else
458478
CPPFLAGS="$CPPFLAGS $cairo_CFLAGS"
459479
fi
460480
461-
# set c++11 support based on platform/compiler
462-
if test "x$has_cpp11" = "xyes"; then
463-
case "${host_os}" in
464-
cygwin*)
465-
CXXFLAGS="$CXXFLAGS -std=gnu++11"
466-
;;
467-
*-darwin* | *-macos10*)
468-
if test "x$CLANG" = "xyes"; then
469-
CXXFLAGS="$CXXFLAGS -std=c++11 "
470-
LDFLAGS="$LDFLAGS -stdlib=libc++"
471-
else
472-
CXXFLAGS="$CXXFLAGS -std=c++11"
473-
fi
474-
;;
475-
*)
476-
# default
477-
CXXFLAGS="$CXXFLAGS -std=c++11"
478-
;;
479-
esac
480-
else
481-
AC_MSG_WARN([Training tools WILL NOT be built because of missing c++11 support.])
482-
AM_CONDITIONAL([ENABLE_TRAINING], false)
483-
fi
484481
485482
# ----------------------------------------
486483
# Final Tasks and Output

0 commit comments

Comments
 (0)