Browse Source

Implement proper C++11 mode detection

Newer compilers have C++14 mode as default and package maintainers tend
to not specifying a C++ version when building a package, this causes
compatibility issues when (for example) qbt is compiled in C++11 and
dependency lib is in C++14. See issue #9485.

What this commit does:
1. Checks if compiler supports at least C++11
2. Checks if compiler is set in at least C++11 mode
adaptive-webui-19844
Chocobo1 6 years ago
parent
commit
819a84eb7a
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 4
      .travis.yml
  2. 367
      configure
  3. 28
      configure.ac
  4. 3
      src/src.pro

4
.travis.yml

@ -158,7 +158,9 @@ script:
if [ "$TRAVIS_OS_NAME" = "osx" ]; then if [ "$TRAVIS_OS_NAME" = "osx" ]; then
# For some reason for RC_1_1 we need to also specify the OpenSSL compiler/linker flags # For some reason for RC_1_1 we need to also specify the OpenSSL compiler/linker flags
# Homebrew doesn't symlink OpenSSL for security reasons # Homebrew doesn't symlink OpenSSL for security reasons
./bootstrap.sh && ./configure $qbtconf CXXFLAGS="$(PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH" pkg-config --cflags openssl)" LDFLAGS="$(PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH" pkg-config --libs openssl)" ./bootstrap.sh
./configure $qbtconf CXXFLAGS="$CXXFLAGS $(PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH" pkg-config --cflags openssl) -std=c++14" \
LDFLAGS="$LDFLAGS $(PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH" pkg-config --libs openssl)"
sed -i "" -e "s/^\(CC.*&&\).*$/\1 $CC/" src/Makefile # workaround for Qt & ccache: https://bugreports.qt.io/browse/QTBUG-31034 sed -i "" -e "s/^\(CC.*&&\).*$/\1 $CC/" src/Makefile # workaround for Qt & ccache: https://bugreports.qt.io/browse/QTBUG-31034
sed -i "" -e "s/^\(CXX.*&&\).*$/\1 $CXX/" src/Makefile sed -i "" -e "s/^\(CXX.*&&\).*$/\1 $CXX/" src/Makefile
sed -i "" -e 's/^\(CXXFLAGS.*\)$/\1 -Wno-unused-local-typedefs -Wno-inconsistent-missing-override/' src/Makefile sed -i "" -e 's/^\(CXXFLAGS.*\)$/\1 -Wno-unused-local-typedefs -Wno-inconsistent-missing-override/' src/Makefile

367
configure vendored

@ -626,7 +626,6 @@ am__nodep
AMDEPBACKSLASH AMDEPBACKSLASH
AMDEP_FALSE AMDEP_FALSE
AMDEP_TRUE AMDEP_TRUE
am__quote
am__include am__include
DEPDIR DEPDIR
am__untar am__untar
@ -709,7 +708,8 @@ PACKAGE_VERSION
PACKAGE_TARNAME PACKAGE_TARNAME
PACKAGE_NAME PACKAGE_NAME
PATH_SEPARATOR PATH_SEPARATOR
SHELL' SHELL
am__quote'
ac_subst_files='' ac_subst_files=''
ac_user_opts=' ac_user_opts='
enable_option_checking enable_option_checking
@ -3274,7 +3274,7 @@ IFS=$ac_save_IFS
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
am__api_version='1.15' am__api_version='1.16'
# Find a good install program. We prefer a C program (faster), # Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or # so one script is as good as another. But avoid the broken or
@ -3700,45 +3700,45 @@ DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles" ac_config_commands="$ac_config_commands depfiles"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
am_make=${MAKE-make} $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
cat > confinc << 'END' cat > confinc.mk << 'END'
am__doit: am__doit:
@echo this is the am__doit target @echo this is the am__doit target >confinc.out
.PHONY: am__doit .PHONY: am__doit
END END
# If we don't find an include directive, just comment out the code.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
$as_echo_n "checking for style of include used by $am_make... " >&6; }
am__include="#" am__include="#"
am__quote= am__quote=
_am_result=none # BSD make does it like this.
# First try GNU make style include. echo '.include "confinc.mk" # ignored' > confmf.BSD
echo "include confinc" > confmf # Other make implementations (GNU, Solaris 10, AIX) do it like this.
# Ignore all kinds of additional output from 'make'. echo 'include confinc.mk # ignored' > confmf.GNU
case `$am_make -s -f confmf 2> /dev/null` in #( _am_result=no
*the\ am__doit\ target*) for s in GNU BSD; do
am__include=include { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
am__quote= (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
_am_result=GNU ac_status=$?
;; echo "$as_me:$LINENO: \$? = $ac_status" >&5
esac (exit $ac_status); }
# Now try BSD make style include. case $?:`cat confinc.out 2>/dev/null` in #(
if test "$am__include" = "#"; then '0:this is the am__doit target') :
echo '.include "confinc"' > confmf case $s in #(
case `$am_make -s -f confmf 2> /dev/null` in #( BSD) :
*the\ am__doit\ target*) am__include='.include' am__quote='"' ;; #(
am__include=.include *) :
am__quote="\"" am__include='include' am__quote='' ;;
_am_result=BSD esac ;; #(
*) :
;; ;;
esac esac
if test "$am__include" != "#"; then
_am_result="yes ($s style)"
break
fi fi
done
rm -f confinc.* confmf.*
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
$as_echo "$_am_result" >&6; } $as_echo "${_am_result}" >&6; }
rm -f confinc confmf
# Check whether --enable-dependency-tracking was given. # Check whether --enable-dependency-tracking was given.
if test "${enable_dependency_tracking+set}" = set; then : if test "${enable_dependency_tracking+set}" = set; then :
@ -3850,8 +3850,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# For better backward compatibility. To be removed once Automake 1.9.x # For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see: # dies out for good. For more background, see:
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> # <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> # <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)' mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target (and possibly the TAP driver). The # We need awk for the "check" target (and possibly the TAP driver). The
@ -4158,7 +4158,7 @@ END
Aborting the configuration process, to ensure you take notice of the issue. Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: <http://www.gnu.org/software/coreutils/>. that behaves properly: <https://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@ -4170,8 +4170,6 @@ END
fi fi
# Define --wth-* and --enable-* arguments # Define --wth-* and --enable-* arguments
@ -5497,6 +5495,75 @@ $as_echo "yes" >&6; }
LIBS="$zlib_LIBS $LIBS" LIBS="$zlib_LIBS $LIBS"
fi fi
# Check compiler C++11 support
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
_tmp="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++11"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201103L
#error "This is not a C++11 compiler"
#endif
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
else
as_fn_error $? "A compiler supporting C++11 is required." "$LINENO" 5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CXXFLAGS="$_tmp"
_tmp="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $libtorrent_CFLAGS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201103L
#error "This is not a C++11 compiler"
#endif
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
else
as_fn_error $? "Compiler is not working in C++11 or later mode.
Make sure you use the same C++ mode for qBittorrent and its dependencies.
Example: \`CXXFLAGS=\"\$CXXFLAGS -std=c++11\" ./configure\`" "$LINENO" 5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CXXFLAGS="$_tmp"
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
# These are required because autoconf doesn't expand these **particular** # These are required because autoconf doesn't expand these **particular**
# vars automatically. And qmake cannot autoexpand them. # vars automatically. And qmake cannot autoexpand them.
@ -6340,7 +6407,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# #
# INIT-COMMANDS # INIT-COMMANDS
# #
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
_ACEOF _ACEOF
@ -6785,29 +6852,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# Older Autoconf quotes --file arguments for eval, but not when files # Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval # are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting. # if we detect the quoting.
case $CONFIG_FILES in # TODO: see whether this extra hack can be removed once we start
*\'*) eval set x "$CONFIG_FILES" ;; # requiring Autoconf 2.70 or later.
*) set x $CONFIG_FILES ;; case $CONFIG_FILES in #(
*\'*) :
eval set x "$CONFIG_FILES" ;; #(
*) :
set x $CONFIG_FILES ;; #(
*) :
;;
esac esac
shift shift
for mf # Used to flag and report bootstrapping failures.
am_rc=0
for am_mf
do do
# Strip MF so we end up with the name of the file. # Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'` am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not. # Check whether this is an Automake generated Makefile which includes
# We used to match only the files named 'Makefile.in', but # dependency-tracking related rules and includes.
# some people rename them; so instead we look at the file content. # Grep'ing the whole file directly is not great: AIX grep has a line
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000. # limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
dirpart=`$as_dirname -- "$mf" || || continue
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ am_dirpart=`$as_dirname -- "$am_mf" ||
X"$mf" : 'X\(//\)[^/]' \| \ $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \
X"$mf" : 'X\(/\)' \| . 2>/dev/null || X"$am_mf" : 'X\(//\)$' \| \
$as_echo X"$mf" | X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$am_mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/ s//\1/
q q
@ -6825,53 +6898,48 @@ $as_echo X"$mf" |
q q
} }
s/.*/./; q'` s/.*/./; q'`
else am_filepart=`$as_basename -- "$am_mf" ||
continue $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
fi X"$am_mf" : 'X\(//\)$' \| \
# Extract the definition of DEPDIR, am__include, and am__quote X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
# from the Makefile without running 'make'. $as_echo X/"$am_mf" |
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` sed '/^.*\/\([^/][^/]*\)\/*$/{
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`$as_dirname -- "$file" ||
$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$file" : 'X\(//\)[^/]' \| \
X"$file" : 'X\(//\)$' \| \
X"$file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/ s//\1/
q q
} }
/^X\(\/\/\)$/{ /^X\/\(\/\/\)$/{
s//\1/ s//\1/
q q
} }
/^X\(\/\).*/{ /^X\/\(\/\).*/{
s//\1/ s//\1/
q q
} }
s/.*/./; q'` s/.*/./; q'`
as_dir=$dirpart/$fdir; as_fn_mkdir_p { echo "$as_me:$LINENO: cd "$am_dirpart" \
# echo "creating $dirpart/$file" && sed -e '/# am--include-marker/d' "$am_filepart" \
echo '# dummy' > "$dirpart/$file" | $MAKE -f - am--depfiles" >&5
done (cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } || am_rc=$?
done done
if test $am_rc -ne 0; then
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. Try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).
See \`config.log' for more details" "$LINENO" 5; }
fi
{ am_dirpart=; unset am_dirpart;}
{ am_filepart=; unset am_filepart;}
{ am_mf=; unset am_mf;}
{ am_rc=; unset am_rc;}
rm -f conftest-deps.mk
} }
;; ;;
@ -7655,7 +7723,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# #
# INIT-COMMANDS # INIT-COMMANDS
# #
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
_ACEOF _ACEOF
@ -8101,29 +8169,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# Older Autoconf quotes --file arguments for eval, but not when files # Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval # are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting. # if we detect the quoting.
case $CONFIG_FILES in # TODO: see whether this extra hack can be removed once we start
*\'*) eval set x "$CONFIG_FILES" ;; # requiring Autoconf 2.70 or later.
*) set x $CONFIG_FILES ;; case $CONFIG_FILES in #(
*\'*) :
eval set x "$CONFIG_FILES" ;; #(
*) :
set x $CONFIG_FILES ;; #(
*) :
;;
esac esac
shift shift
for mf # Used to flag and report bootstrapping failures.
am_rc=0
for am_mf
do do
# Strip MF so we end up with the name of the file. # Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'` am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not. # Check whether this is an Automake generated Makefile which includes
# We used to match only the files named 'Makefile.in', but # dependency-tracking related rules and includes.
# some people rename them; so instead we look at the file content. # Grep'ing the whole file directly is not great: AIX grep has a line
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000. # limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
dirpart=`$as_dirname -- "$mf" || || continue
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ am_dirpart=`$as_dirname -- "$am_mf" ||
X"$mf" : 'X\(//\)[^/]' \| \ $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \
X"$mf" : 'X\(/\)' \| . 2>/dev/null || X"$am_mf" : 'X\(//\)$' \| \
$as_echo X"$mf" | X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$am_mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/ s//\1/
q q
@ -8141,53 +8215,48 @@ $as_echo X"$mf" |
q q
} }
s/.*/./; q'` s/.*/./; q'`
else am_filepart=`$as_basename -- "$am_mf" ||
continue $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
fi X"$am_mf" : 'X\(//\)$' \| \
# Extract the definition of DEPDIR, am__include, and am__quote X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
# from the Makefile without running 'make'. $as_echo X/"$am_mf" |
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` sed '/^.*\/\([^/][^/]*\)\/*$/{
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`$as_dirname -- "$file" ||
$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$file" : 'X\(//\)[^/]' \| \
X"$file" : 'X\(//\)$' \| \
X"$file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/ s//\1/
q q
} }
/^X\(\/\/\)$/{ /^X\/\(\/\/\)$/{
s//\1/ s//\1/
q q
} }
/^X\(\/\).*/{ /^X\/\(\/\).*/{
s//\1/ s//\1/
q q
} }
s/.*/./; q'` s/.*/./; q'`
as_dir=$dirpart/$fdir; as_fn_mkdir_p { echo "$as_me:$LINENO: cd "$am_dirpart" \
# echo "creating $dirpart/$file" && sed -e '/# am--include-marker/d' "$am_filepart" \
echo '# dummy' > "$dirpart/$file" | $MAKE -f - am--depfiles" >&5
done (cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } || am_rc=$?
done done
if test $am_rc -ne 0; then
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. Try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).
See \`config.log' for more details" "$LINENO" 5; }
fi
{ am_dirpart=; unset am_dirpart;}
{ am_filepart=; unset am_filepart;}
{ am_mf=; unset am_mf;}
{ am_rc=; unset am_rc;}
rm -f conftest-deps.mk
} }
;; ;;

28
configure.ac

@ -8,8 +8,6 @@ AC_LANG(C++)
AC_CANONICAL_HOST AC_CANONICAL_HOST
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE
# Define --wth-* and --enable-* arguments # Define --wth-* and --enable-* arguments
AC_ARG_WITH(qtsingleapplication, AC_ARG_WITH(qtsingleapplication,
@ -204,6 +202,32 @@ PKG_CHECK_MODULES(zlib,
[CPPFLAGS="$zlib_CFLAGS $CPPFLAGS" [CPPFLAGS="$zlib_CFLAGS $CPPFLAGS"
LIBS="$zlib_LIBS $LIBS"]) LIBS="$zlib_LIBS $LIBS"])
# Check compiler C++11 support
AC_LANG_PUSH(C++)
m4_define([DETECT_CPP11_PROGRAM],
[AC_LANG_PROGRAM([[
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201103L
#error "This is not a C++11 compiler"
#endif]],
[[]])])
_tmp="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++11"
AC_COMPILE_IFELSE([DETECT_CPP11_PROGRAM()],
[],
[AC_MSG_ERROR([A compiler supporting C++11 is required.])])
CXXFLAGS="$_tmp $libtorrent_CFLAGS"
AC_COMPILE_IFELSE([DETECT_CPP11_PROGRAM()],
[],
[AC_MSG_ERROR([Compiler is not working in C++11 or later mode.
Make sure you use the same C++ mode for qBittorrent and its dependencies.
Example: `CXXFLAGS="\$CXXFLAGS -std=c++11" ./configure`])])
CXXFLAGS="$_tmp"
AC_LANG_POP([C++])
# These are required because autoconf doesn't expand these **particular** # These are required because autoconf doesn't expand these **particular**
# vars automatically. And qmake cannot autoexpand them. # vars automatically. And qmake cannot autoexpand them.
AX_DEFINE_DIR([EXPAND_PREFIX], [prefix]) AX_DEFINE_DIR([EXPAND_PREFIX], [prefix])

3
src/src.pro

@ -2,9 +2,6 @@
TEMPLATE = app TEMPLATE = app
CONFIG += qt thread silent CONFIG += qt thread silent
# C++11 support
CONFIG += c++11
# Platform specific configuration # Platform specific configuration
win32: include(../winconf.pri) win32: include(../winconf.pri)
macx: include(../macxconf.pri) macx: include(../macxconf.pri)

Loading…
Cancel
Save