configure: add check for gcc 4.9.0 up-front

also sets -std=gnu++11 per wxWidgets requirement
closes bug #1506
This commit is contained in:
Darrell Walisser 2017-02-11 00:38:45 -05:00
parent 7517b2653e
commit ad24fee7dd
3 changed files with 122 additions and 8 deletions

78
configure vendored
View File

@ -896,6 +896,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@ -1073,6 +1074,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@ -1325,6 +1327,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@ -1462,7 +1473,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@ -1615,6 +1626,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@ -2887,7 +2899,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
am__api_version='1.14'
am__api_version='1.15'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@ -3059,8 +3071,8 @@ test "$program_suffix" != NONE &&
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
@ -3079,7 +3091,7 @@ else
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh}" != xset; then
if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@ -3407,8 +3419,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
@ -3582,6 +3594,7 @@ END
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
@ -19366,6 +19379,56 @@ done
if test "${ax_cv_c_compiler_vendor}" = "gnu"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using gcc 4.9.0 or later" >&5
$as_echo_n "checking whether we are using gcc 4.9.0 or later... " >&6; }
if ${ax_cv_gcc_4_9_0+:} false; then :
$as_echo_n "(cached) " >&6
else
ax_cv_gcc_4_9_0=no
if test "$GCC" = "yes"; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __GNUC__
# if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ > 9) \
|| (__GNUC__ == 4 && __GNUC_MINOR__ == 9 && __GNUC_PATCHLEVEL__ >= 0)
yes;
# endif
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "yes" >/dev/null 2>&1; then :
ax_cv_gcc_4_9_0=yes
fi
rm -f conftest*
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_4_9_0" >&5
$as_echo "$ax_cv_gcc_4_9_0" >&6; }
if test "$ax_cv_gcc_4_9_0" = yes; then
gcc_ok=yes
else
gcc_ok=no
fi
if test x$gcc_ok = xno; then
as_fn_error $? "Audacity requires at least GCC 4.9" "$LINENO" 5
fi
CXXFLAGS="${CXXFLAGS} --std=gnu++11"
else
CXXFLAGS="${CXXFLAGS} --std=c++11"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for strict prototypes" >&5
$as_echo_n "checking CFLAGS for strict prototypes... " >&6; }
@ -19607,7 +19670,6 @@ fi
flag=`echo "$wall_flags" | $SED 'y% .=/+-(){}<>:*,%_______________%'`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ preprocessor accepts the $wall_flags flag" >&5

View File

@ -236,6 +236,20 @@ dnl Solaris builds, by defining HAVE_ALLOCA_H
AC_CHECK_HEADERS_ONCE(alloca.h)
dnl Enable C++ 11 support. Use gnu++11 on GCC since wxWidgets uses extensions
if test "${ax_cv_c_compiler_vendor}" = "gnu"; then
dnl GCC < 4.9 has known bugs (#1397) and can't be used
AX_GCC_VERSION_ATLEAST(4,9,0,[gcc_ok=yes], [gcc_ok=no])
if test x$gcc_ok = xno; then
AC_MSG_ERROR([Audacity requires at least GCC 4.9])
fi
CXXFLAGS="${CXXFLAGS} --std=gnu++11"
else
CXXFLAGS="${CXXFLAGS} --std=c++11"
fi
dnl --------------------------------------------------------------------------
dnl We would like warnings enabled on the builds, but different compilers need
dnl different options for these. This bit tries to work out what flags we

View File

@ -0,0 +1,38 @@
dnl @synopsis AX_GCC_VERSION(MAJOR, MINOR, PATCHLEVEL, [ACTION-SUCCESS], [ACTION-FAILURE])
dnl @summary check wither gcc is at least version MAJOR.MINOR.PATCHLEVEL
dnl @category InstalledPackages
dnl
dnl Check whether we are using gcc and, if so, whether its version
dnl is at least MAJOR.MINOR.PATCHLEVEL
dnl
dnl ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
dnl success/failure.
dnl
dnl @version 2005-05-30
dnl @license GPLWithACException
dnl @author Steven G. Johnson <stevenj@alum.mit.edu> and Matteo Frigo.
AC_DEFUN([AX_GCC_VERSION_ATLEAST],
[
AC_REQUIRE([AC_PROG_CC])
AC_CACHE_CHECK(whether we are using gcc $1.$2.$3 or later, ax_cv_gcc_$1_$2_$3,
[
ax_cv_gcc_$1_$2_$3=no
if test "$GCC" = "yes"; then
dnl The semicolon after "yes" below is to pacify NeXT's syntax-checking cpp.
AC_EGREP_CPP(yes, [
#ifdef __GNUC__
# if (__GNUC__ > $1) || (__GNUC__ == $1 && __GNUC_MINOR__ > $2) \
|| (__GNUC__ == $1 && __GNUC_MINOR__ == $2 && __GNUC_PATCHLEVEL__ >= $3)
yes;
# endif
#endif
], [ax_cv_gcc_$1_$2_$3=yes])
fi
])
if test "$ax_cv_gcc_$1_$2_$3" = yes; then
m4_default([$4], :)
else
m4_default([$5], :)
fi
])