Merge branch 'cpp-11' into crashlog_improvements
# Conflicts: # config.lib
This commit is contained in:
92
config.lib
92
config.lib
@@ -178,7 +178,7 @@ set_default() {
|
||||
with_libbfd
|
||||
with_bfd_extra_debug
|
||||
with_self_gdb_debug
|
||||
CC CXX CFLAGS CXXFLAGS LDFLAGS CFLAGS_BUILD CXXFLAGS_BUILD LDFLAGS_BUILD"
|
||||
CC CXX CFLAGS CXXFLAGS LDFLAGS CFLAGS_BUILD CXXFLAGS_BUILD LDFLAGS_BUILD PKG_CONFIG_PATH PKG_CONFIG_LIBDIR"
|
||||
}
|
||||
|
||||
detect_params() {
|
||||
@@ -491,6 +491,8 @@ detect_params() {
|
||||
CFLAGS_BUILD=* | --CFLAGS_BUILD=* | --CFLAGS-BUILD=*) CFLAGS_BUILD="$optarg";;
|
||||
CXXFLAGS_BUILD=* | --CXXFLAGS_BUILD=* | --CXXFLAGS-BUILD=*) CXXFLAGS_BUILD="$optarg";;
|
||||
LDFLAGS_BUILD=* | --LDFLAGS_BUILD=* | --LDFLAGS-BUILD=*) LDFLAGS_BUILD="$optarg";;
|
||||
PKG_CONFIG_PATH=* | --PKG_CONFIG_PATH=* | --PKG-CONFIG-PATH=*) PKG_CONFIG_PATH="$optarg";;
|
||||
PKG_CONFIG_LIBDIR=* | --PKG_CONFIG_LIBDIR=* | --PKG-CONFIG-LIBDIR=*) PKG_CONFIG_LIBDIR="$optarg";;
|
||||
|
||||
--ignore-extra-parameters) ignore_extra_parameters="1";;
|
||||
|
||||
@@ -541,6 +543,20 @@ save_params() {
|
||||
echo "" >> $config_log
|
||||
}
|
||||
|
||||
# Export a variable so tools like pkg-config can see it when invoked.
|
||||
# If the variable contains an empty string then unset it.
|
||||
# $1 - name of the variable to export or unset
|
||||
export_or_unset() {
|
||||
eval local value=\$$1
|
||||
if [ -n "$value" ]; then
|
||||
export $1;
|
||||
log 2 "using $1=$value";
|
||||
else
|
||||
unset $1;
|
||||
log 2 "not using $1";
|
||||
fi
|
||||
}
|
||||
|
||||
check_params() {
|
||||
# Some params want to be in full uppercase, else they might not work as
|
||||
# expected.. fix that here
|
||||
@@ -549,6 +565,16 @@ check_params() {
|
||||
os=`echo $os | tr '[a-z]' '[A-Z]'`
|
||||
cpu_type=`echo $cpu_type | tr '[a-z]' '[A-Z]'`
|
||||
|
||||
# Export some variables to be used by pkg-config
|
||||
#
|
||||
# PKG_CONFIG_LIBDIR variable musn't be set if we are not willing to
|
||||
# override the default pkg-config search path, it musn't be an empty
|
||||
# string. If the variable is empty (e.g. when an empty string comes
|
||||
# from config.cache) then unset it. This way the "don't override" state
|
||||
# will be properly preserved when (re)configuring.
|
||||
export_or_unset PKG_CONFIG_PATH
|
||||
export_or_unset PKG_CONFIG_LIBDIR
|
||||
|
||||
# Check if all params have valid values
|
||||
|
||||
# Endian only allows AUTO, LE and, BE
|
||||
@@ -1431,11 +1457,14 @@ make_compiler_cflags() {
|
||||
flags="$flags -fno-tree-vrp"
|
||||
fi
|
||||
|
||||
if [ $cc_version -ge 407 ]; then
|
||||
if [ $cc_version -eq 407 ]; then
|
||||
# Disable -Wnarrowing which gives many warnings, such as:
|
||||
# warning: narrowing conversion of '...' from 'unsigned int' to 'int' inside { } [-Wnarrowing]
|
||||
# They are valid according to the C++ standard, but useless.
|
||||
cxxflags="$cxxflags -Wno-narrowing"
|
||||
fi
|
||||
|
||||
if [ $cc_version -ge 407 ]; then
|
||||
# Disable bogus 'attempt to free a non-heap object' warning
|
||||
flags="$flags -Wno-free-nonheap-object"
|
||||
else
|
||||
@@ -1881,23 +1910,6 @@ EOL
|
||||
CFLAGS="$OSX_SYSROOT $CFLAGS"
|
||||
LDFLAGS="$OSX_LD_SYSROOT $LDFLAGS"
|
||||
fi
|
||||
|
||||
if [ "$enable_universal" = "0" ] && [ $cc_version -gt 400 ]; then
|
||||
# Only set the min version when not doing an universal build.
|
||||
# Universal builds set the version elsewhere.
|
||||
if [ "$cpu_type" = "64" ]; then
|
||||
CFLAGS="$CFLAGS -mmacosx-version-min=10.5"
|
||||
else
|
||||
gcc_cpu=`$cc_host -dumpmachine`
|
||||
if [ "`echo $gcc_cpu | cut -c 1-3`" = "ppc" -o "`echo $gcc_cpu | cut -c 1-7`" = "powerpc" ]; then
|
||||
# PowerPC build can run on 10.3
|
||||
CFLAGS="$CFLAGS -mmacosx-version-min=10.3"
|
||||
else
|
||||
# Intel is only available starting from 10.4
|
||||
CFLAGS="$CFLAGS -mmacosx-version-min=10.4"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$os" = "BEOS" ] || [ "$os" = "HAIKU" ]; then
|
||||
@@ -3382,24 +3394,40 @@ detect_nforenum() {
|
||||
log 1 "checking nforenum... found"
|
||||
}
|
||||
|
||||
detect_cputype() {
|
||||
if [ -n "$cpu_type" ] && [ "$cpu_type" != "DETECT" ]; then
|
||||
log 1 "forcing cpu-type... $cpu_type bits"
|
||||
return;
|
||||
fi
|
||||
echo "#define _SQ64 1" > tmp.64bit.cpp
|
||||
echo "#include \"src/stdafx.h\"" >> tmp.64bit.cpp
|
||||
echo "assert_compile(sizeof(size_t) == 8);" >> tmp.64bit.cpp
|
||||
echo "int main() { return 0; }" >> tmp.64bit.cpp
|
||||
execute="$cxx_host $CFLAGS tmp.64bit.cpp -o tmp.64bit -DTESTING 2>&1"
|
||||
_detect_cputype_width() {
|
||||
echo "#define _SQ64 1" > $1.cpp
|
||||
echo "#include \"src/stdafx.h\"" >> $1.cpp
|
||||
echo "assert_compile(sizeof(size_t) == $2);" >> $1.cpp
|
||||
echo "int main() { return 0; }" >> $1.cpp
|
||||
execute="$cxx_host $CFLAGS -std=c++11 $1.cpp -o $1 -DTESTING 2>&1"
|
||||
cpu_type="`eval $execute 2>/dev/null`"
|
||||
ret=$?
|
||||
log 2 "executing $execute"
|
||||
log 2 " returned $cpu_type"
|
||||
log 2 " exit code $ret"
|
||||
if [ "$ret" = "0" ]; then cpu_type="64"; else cpu_type="32"; fi
|
||||
rm -f $1 $1.cpp
|
||||
return $ret
|
||||
}
|
||||
|
||||
detect_cputype() {
|
||||
if [ -n "$cpu_type" ] && [ "$cpu_type" != "DETECT" ]; then
|
||||
log 1 "forcing cpu-type... $cpu_type bits"
|
||||
return;
|
||||
fi
|
||||
_detect_cputype_width tmp.32bit 4
|
||||
result32=$?
|
||||
_detect_cputype_width tmp.64bit 8
|
||||
result64=$?
|
||||
|
||||
if [ "$result32" = 0 ] && [ "$result64" != 0 ]; then
|
||||
cpu_type="32"
|
||||
elif [ "$result32" != 0 ] && [ "$result64" = 0 ]; then
|
||||
cpu_type="64"
|
||||
else
|
||||
log 1 "configure: unable to determine cpu-type (pointer width)"
|
||||
exit 1
|
||||
fi
|
||||
log 1 "detecting cpu-type... $cpu_type bits"
|
||||
rm -f tmp.64bit tmp.64bit.cpp
|
||||
}
|
||||
|
||||
detect_sse_capable_architecture() {
|
||||
@@ -3854,6 +3882,8 @@ showhelp() {
|
||||
echo " CFLAGS_BUILD C compiler flags for build time tool generation"
|
||||
echo " CXXFLAGS_BUILD C++ compiler flags for build time tool generation"
|
||||
echo " LDFLAGS_BUILD linker flags for build time tool generation"
|
||||
echo " PKG_CONFIG_PATH additional library search paths (see \"man pkg-config\")"
|
||||
echo " PKG_CONFIG_LIBDIR replace the default library search path (see \"man pkg-config\")"
|
||||
echo ""
|
||||
echo "Use these variables to override the choices made by 'configure' or to help"
|
||||
echo "it to find libraries and programs with nonstandard names/locations."
|
||||
|
||||
Reference in New Issue
Block a user