From 389370d01e3f5e53b0f8450f959e602ee0adc3c1 Mon Sep 17 00:00:00 2001 From: Darrell Walisser Date: Sun, 19 Feb 2017 16:10:55 -0500 Subject: [PATCH 1/5] clang: prevent detecting clang as gcc --- src/Audacity.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Audacity.h b/src/Audacity.h index c5ff40e1e..57220b87a 100644 --- a/src/Audacity.h +++ b/src/Audacity.h @@ -26,8 +26,10 @@ // If building with GNU compiler, then must be 4.9 or later. // TODO: This would be much nicer as a standalone test in configure.ac -#if !defined(__APPLE__) && defined __GNUC__ && ( __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9)) -#error insufficient compiler +#if !defined(__APPLE__) && !defined(__clang__) && \ + defined __GNUC__ && ( __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9)) + + #error Audacity requires at least GCC 4.9 #endif From 4f397b288cd47331c0f7b289c7a616e54c306d8d Mon Sep 17 00:00:00 2001 From: Darrell Walisser Date: Mon, 27 Mar 2017 18:03:26 -0400 Subject: [PATCH 2/5] clang: correct detection of gcc --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 3c4024c11..dbf71388a 100644 --- a/configure.ac +++ b/configure.ac @@ -206,7 +206,7 @@ fi if test x$enable_sse = xyes; then - if test "${ax_cv_cxx_compiler_vendor}" = "gnu"; then + if test "${CXX}" = "gnu"; then AX_CHECK_COMPILER_FLAGS(-msse, [SBSMS_CFLAGS="$SBSMS_CFLAGS -msse"],[AC_MSG_ERROR([Need a version of gcc with -msse])]) fi @@ -237,7 +237,7 @@ 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 +if "${CXX}" -v 2>&1 | grep -q '^gcc version'; 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]) From 6434ab7066efc5b418774e94e9098fe825c71ec9 Mon Sep 17 00:00:00 2001 From: Darrell Walisser Date: Mon, 27 Mar 2017 18:06:06 -0400 Subject: [PATCH 3/5] update autoconf script --- configure | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 2b3ef6ba5..5f8371793 100755 --- a/configure +++ b/configure @@ -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"} # 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. @@ -19176,7 +19189,7 @@ fi if test x$enable_sse = xyes; then - if test "${ax_cv_cxx_compiler_vendor}" = "gnu"; then + if test "${CXX}" = "gnu"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -msse" >&5 $as_echo_n "checking whether C++ compiler accepts -msse... " >&6; } if ${ax_cv_cxx_flags__msse+:} false; then : @@ -19366,7 +19379,7 @@ done -if test "${ax_cv_c_compiler_vendor}" = "gnu"; then +if "${CXX}" -v 2>&1 | grep -q '^gcc version'; then From d16274e88348624b18ede5a00dcb8eb9a18820ba Mon Sep 17 00:00:00 2001 From: Darrell Walisser Date: Thu, 30 Mar 2017 12:01:07 -0400 Subject: [PATCH 4/5] correct mistake in clang patch --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index dbf71388a..df358edcf 100644 --- a/configure.ac +++ b/configure.ac @@ -206,7 +206,7 @@ fi if test x$enable_sse = xyes; then - if test "${CXX}" = "gnu"; then + if test "${ax_cv_cxx_compiler_vendor}" = "gnu"; then AX_CHECK_COMPILER_FLAGS(-msse, [SBSMS_CFLAGS="$SBSMS_CFLAGS -msse"],[AC_MSG_ERROR([Need a version of gcc with -msse])]) fi From a0ff99b472030a3a28057f7c0aec16b9c9a79230 Mon Sep 17 00:00:00 2001 From: Darrell Walisser Date: Fri, 31 Mar 2017 12:48:30 -0400 Subject: [PATCH 5/5] update autoconf script --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 5f8371793..83df563ed 100755 --- a/configure +++ b/configure @@ -19189,7 +19189,7 @@ fi if test x$enable_sse = xyes; then - if test "${CXX}" = "gnu"; then + if test "${ax_cv_cxx_compiler_vendor}" = "gnu"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -msse" >&5 $as_echo_n "checking whether C++ compiler accepts -msse... " >&6; } if ${ax_cv_cxx_flags__msse+:} false; then :