configure.ac: require C++11 compiler
We'll add some C++11 code soon.
This commit is contained in:
parent
0d2abdb5d9
commit
2571accfc3
@ -1316,7 +1316,6 @@ test_test_queue_priority_SOURCES = \
|
|||||||
test_test_queue_priority_LDADD = \
|
test_test_queue_priority_LDADD = \
|
||||||
$(GLIB_LIBS)
|
$(GLIB_LIBS)
|
||||||
|
|
||||||
if HAVE_CXX
|
|
||||||
noinst_PROGRAMS += src/dsd2pcm/dsd2pcm
|
noinst_PROGRAMS += src/dsd2pcm/dsd2pcm
|
||||||
|
|
||||||
src_dsd2pcm_dsd2pcm_SOURCES = \
|
src_dsd2pcm_dsd2pcm_SOURCES = \
|
||||||
@ -1324,7 +1323,6 @@ src_dsd2pcm_dsd2pcm_SOURCES = \
|
|||||||
src/dsd2pcm/noiseshape.c src/dsd2pcm/noiseshape.h \
|
src/dsd2pcm/noiseshape.c src/dsd2pcm/noiseshape.h \
|
||||||
src/dsd2pcm/main.cpp
|
src/dsd2pcm/main.cpp
|
||||||
src_dsd2pcm_dsd2pcm_LDADD = libutil.a
|
src_dsd2pcm_dsd2pcm_LDADD = libutil.a
|
||||||
endif
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
23
configure.ac
23
configure.ac
@ -21,24 +21,9 @@ dnl Programs
|
|||||||
dnl ---------------------------------------------------------------------------
|
dnl ---------------------------------------------------------------------------
|
||||||
AC_PROG_CC_C99
|
AC_PROG_CC_C99
|
||||||
AC_PROG_CXX
|
AC_PROG_CXX
|
||||||
|
AC_CXX_COMPILE_STDCXX_0X
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
|
|
||||||
HAVE_CXX=yes
|
|
||||||
if test x$CXX = xg++; then
|
|
||||||
# CXX=g++ probably means that autoconf hasn't found any C++
|
|
||||||
# compiler; to be sure, we check again
|
|
||||||
AC_PATH_PROG(CXX, $CXX, no)
|
|
||||||
if test x$CXX = xno; then
|
|
||||||
# no, we don't have C++ - the following hack is
|
|
||||||
# required because automake insists on using $(CXX)
|
|
||||||
# for linking the MPD binary
|
|
||||||
AC_MSG_NOTICE([Disabling C++ support])
|
|
||||||
CXX="$CC"
|
|
||||||
HAVE_CXX=no
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
AM_CONDITIONAL(HAVE_CXX, test x$HAVE_CXX = xyes)
|
|
||||||
|
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
PKG_PROG_PKG_CONFIG
|
PKG_PROG_PKG_CONFIG
|
||||||
@ -899,9 +884,6 @@ fi
|
|||||||
AM_CONDITIONAL(ENABLE_MIKMOD_DECODER, test x$enable_mikmod = xyes)
|
AM_CONDITIONAL(ENABLE_MIKMOD_DECODER, test x$enable_mikmod = xyes)
|
||||||
|
|
||||||
dnl -------------------------------- libmodplug -------------------------------
|
dnl -------------------------------- libmodplug -------------------------------
|
||||||
found_modplug=$HAVE_CXX
|
|
||||||
MPD_AUTO_PRE(modplug, [modplug decoder plugin], [No C++ compiler found])
|
|
||||||
|
|
||||||
MPD_AUTO_PKG(modplug, MODPLUG, [libmodplug],
|
MPD_AUTO_PKG(modplug, MODPLUG, [libmodplug],
|
||||||
[modplug decoder plugin], [libmodplug not found])
|
[modplug decoder plugin], [libmodplug not found])
|
||||||
|
|
||||||
@ -1010,9 +992,6 @@ fi
|
|||||||
AM_CONDITIONAL(ENABLE_VORBIS_DECODER, test x$enable_vorbis = xyes || test x$enable_tremor = xyes)
|
AM_CONDITIONAL(ENABLE_VORBIS_DECODER, test x$enable_vorbis = xyes || test x$enable_tremor = xyes)
|
||||||
|
|
||||||
dnl --------------------------------- sidplay ---------------------------------
|
dnl --------------------------------- sidplay ---------------------------------
|
||||||
found_sidplay=$HAVE_CXX
|
|
||||||
MPD_AUTO_PRE(sidplay, [sidplay decoder plugin], [No C++ compiler found])
|
|
||||||
|
|
||||||
if test x$enable_sidplay != xno; then
|
if test x$enable_sidplay != xno; then
|
||||||
# we're not using pkg-config here
|
# we're not using pkg-config here
|
||||||
# because libsidplay2's .pc file requires libtool
|
# because libsidplay2's .pc file requires libtool
|
||||||
|
107
m4/ax_cxx_compile_stdcxx_0x.m4
Normal file
107
m4/ax_cxx_compile_stdcxx_0x.m4
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
# ============================================================================
|
||||||
|
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_0x.html
|
||||||
|
# ============================================================================
|
||||||
|
#
|
||||||
|
# SYNOPSIS
|
||||||
|
#
|
||||||
|
# AX_CXX_COMPILE_STDCXX_0X
|
||||||
|
#
|
||||||
|
# DESCRIPTION
|
||||||
|
#
|
||||||
|
# Check for baseline language coverage in the compiler for the C++0x
|
||||||
|
# standard.
|
||||||
|
#
|
||||||
|
# LICENSE
|
||||||
|
#
|
||||||
|
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
|
||||||
|
#
|
||||||
|
# Copying and distribution of this file, with or without modification, are
|
||||||
|
# permitted in any medium without royalty provided the copyright notice
|
||||||
|
# and this notice are preserved. This file is offered as-is, without any
|
||||||
|
# warranty.
|
||||||
|
|
||||||
|
#serial 7
|
||||||
|
|
||||||
|
AU_ALIAS([AC_CXX_COMPILE_STDCXX_0X], [AX_CXX_COMPILE_STDCXX_0X])
|
||||||
|
AC_DEFUN([AX_CXX_COMPILE_STDCXX_0X], [
|
||||||
|
AC_CACHE_CHECK(if g++ supports C++0x features without additional flags,
|
||||||
|
ax_cv_cxx_compile_cxx0x_native,
|
||||||
|
[AC_LANG_SAVE
|
||||||
|
AC_LANG_CPLUSPLUS
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
template <typename T>
|
||||||
|
struct check
|
||||||
|
{
|
||||||
|
static_assert(sizeof(int) <= sizeof(T), "not big enough");
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef check<check<bool>> right_angle_brackets;
|
||||||
|
|
||||||
|
int a;
|
||||||
|
decltype(a) b;
|
||||||
|
|
||||||
|
typedef check<int> check_type;
|
||||||
|
check_type c;
|
||||||
|
check_type&& cr = static_cast<check_type&&>(c);],,
|
||||||
|
ax_cv_cxx_compile_cxx0x_native=yes, ax_cv_cxx_compile_cxx0x_native=no)
|
||||||
|
AC_LANG_RESTORE
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x,
|
||||||
|
ax_cv_cxx_compile_cxx0x_cxx,
|
||||||
|
[AC_LANG_SAVE
|
||||||
|
AC_LANG_CPLUSPLUS
|
||||||
|
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||||
|
CXXFLAGS="$CXXFLAGS -std=c++0x"
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
template <typename T>
|
||||||
|
struct check
|
||||||
|
{
|
||||||
|
static_assert(sizeof(int) <= sizeof(T), "not big enough");
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef check<check<bool>> right_angle_brackets;
|
||||||
|
|
||||||
|
int a;
|
||||||
|
decltype(a) b;
|
||||||
|
|
||||||
|
typedef check<int> check_type;
|
||||||
|
check_type c;
|
||||||
|
check_type&& cr = static_cast<check_type&&>(c);],,
|
||||||
|
ax_cv_cxx_compile_cxx0x_cxx=yes, ax_cv_cxx_compile_cxx0x_cxx=no)
|
||||||
|
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||||
|
AC_LANG_RESTORE
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x,
|
||||||
|
ax_cv_cxx_compile_cxx0x_gxx,
|
||||||
|
[AC_LANG_SAVE
|
||||||
|
AC_LANG_CPLUSPLUS
|
||||||
|
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||||
|
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
template <typename T>
|
||||||
|
struct check
|
||||||
|
{
|
||||||
|
static_assert(sizeof(int) <= sizeof(T), "not big enough");
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef check<check<bool>> right_angle_brackets;
|
||||||
|
|
||||||
|
int a;
|
||||||
|
decltype(a) b;
|
||||||
|
|
||||||
|
typedef check<int> check_type;
|
||||||
|
check_type c;
|
||||||
|
check_type&& cr = static_cast<check_type&&>(c);],,
|
||||||
|
ax_cv_cxx_compile_cxx0x_gxx=yes, ax_cv_cxx_compile_cxx0x_gxx=no)
|
||||||
|
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||||
|
AC_LANG_RESTORE
|
||||||
|
])
|
||||||
|
|
||||||
|
if test "$ax_cv_cxx_compile_cxx0x_native" = yes ||
|
||||||
|
test "$ax_cv_cxx_compile_cxx0x_cxx" = yes ||
|
||||||
|
test "$ax_cv_cxx_compile_cxx0x_gxx" = yes; then
|
||||||
|
AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ])
|
||||||
|
fi
|
||||||
|
])
|
Loading…
Reference in New Issue
Block a user