Skip to content

Commit

Permalink
Auto merge of #2697 - str4d:darwin-build, r=str4d
Browse files Browse the repository at this point in the history
Darwin build fixes

Includes fixes cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7136
  - Only the third commit (to avoid a merge conflict)
- bitcoin/bitcoin#7302
  - Excluding the first commit, which is unnecessary (we use Boost 1.62)
- bitcoin/bitcoin#7487
- bitcoin/bitcoin#7606
- bitcoin/bitcoin#7711
- bitcoin/bitcoin#7165
- bitcoin/bitcoin#8002
- bitcoin/bitcoin#8210
  - Only the second commit
- bitcoin/bitcoin#9114
  • Loading branch information
zkbot committed Nov 30, 2017
2 parents 06f6783 + c6b39fb commit 02c4467
Show file tree
Hide file tree
Showing 25 changed files with 1,216 additions and 339 deletions.
10 changes: 8 additions & 2 deletions .travis.yml
Expand Up @@ -2,7 +2,13 @@
# - A travis bug causes caches to trample eachother when using the same
# compiler key (which we don't use anyway). This is worked around for now by
# replacing the "compilers" with a build name prefixed by the no-op ":"
# command. See: https://github.com/travis-ci/casher/issues/6
# command. See: https://github.com/travis-ci/travis-ci/issues/4393
# - sudo/dist/group are set so as to get Blue Box VMs, necessary for [loopback]
# IPv6 support

sudo: required
dist: precise
group: legacy

os: linux
language: cpp
Expand Down Expand Up @@ -51,7 +57,7 @@ install:
before_script:
- unset CC; unset CXX
- mkdir -p depends/SDKs depends/sdk-sources
- if [ -n "$OSX_SDK" -a ! -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then wget $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -O depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi
- if [ -n "$OSX_SDK" -a ! -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then curl --location --fail $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -o depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi
- if [ -n "$OSX_SDK" -a -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi
- make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS
script:
Expand Down
20 changes: 15 additions & 5 deletions build-aux/m4/ax_boost_base.m4
Expand Up @@ -33,7 +33,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 23
#serial 26

AC_DEFUN([AX_BOOST_BASE],
[
Expand Down Expand Up @@ -95,8 +95,8 @@ if test "x$want_boost" = "xyes"; then
x86_64)
libsubdirs="lib64 libx32 lib lib64"
;;
ppc64|s390x|sparc64|aarch64)
libsubdirs="lib64 lib lib64"
ppc64|s390x|sparc64|aarch64|ppc64le)
libsubdirs="lib64 lib lib64 ppc64le"
;;
esac
Expand Down Expand Up @@ -170,7 +170,7 @@ if test "x$want_boost" = "xyes"; then
AC_MSG_RESULT(yes)
succeeded=yes
found_system=yes
],[:
],[
])
AC_LANG_POP([C++])
Expand All @@ -179,6 +179,10 @@ if test "x$want_boost" = "xyes"; then
dnl if we found no boost with system layout we search for boost libraries
dnl built and installed without the --layout=system option or for a staged(not installed) version
if test "x$succeeded" != "xyes"; then
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
BOOST_CPPFLAGS=
BOOST_LDFLAGS=
_version=0
if test "$ac_boost_path" != ""; then
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
Expand All @@ -191,6 +195,12 @@ if test "x$want_boost" = "xyes"; then
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
done
dnl if nothing found search for layout used in Windows distributions
if test -z "$BOOST_CPPFLAGS"; then
if test -d "$ac_boost_path/boost" && test -r "$ac_boost_path/boost"; then
BOOST_CPPFLAGS="-I$ac_boost_path"
fi
fi
fi
else
if test "$cross_compiling" != yes; then
Expand Down Expand Up @@ -253,7 +263,7 @@ if test "x$want_boost" = "xyes"; then
AC_MSG_RESULT(yes)
succeeded=yes
found_system=yes
],[:
],[
])
AC_LANG_POP([C++])
fi
Expand Down
7 changes: 3 additions & 4 deletions build-aux/m4/ax_boost_program_options.m4
Expand Up @@ -29,7 +29,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 22
#serial 24

AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS],
[
Expand Down Expand Up @@ -63,9 +63,9 @@ AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS],
AC_CACHE_CHECK([whether the Boost::Program_Options library is available],
ax_cv_boost_program_options,
[AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/program_options.hpp>
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/program_options/errors.hpp>
]],
[[boost::program_options::options_description generic("Generic options");
[[boost::program_options::error err("Error message");
return 0;]])],
ax_cv_boost_program_options=yes, ax_cv_boost_program_options=no)
AC_LANG_POP([C++])
Expand All @@ -74,7 +74,6 @@ AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS],
AC_DEFINE(HAVE_BOOST_PROGRAM_OPTIONS,,[define if the Boost::PROGRAM_OPTIONS library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
if test "x$ax_boost_user_program_options_lib" = "x"; then
ax_lib=
for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.dylib* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.dylib.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.a.*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
Expand Down
5 changes: 3 additions & 2 deletions build-aux/m4/ax_boost_system.m4
Expand Up @@ -31,7 +31,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 17
#serial 18

AC_DEFUN([AX_BOOST_SYSTEM],
[
Expand Down Expand Up @@ -68,9 +68,10 @@ AC_DEFUN([AX_BOOST_SYSTEM],
ax_cv_boost_system,
[AC_LANG_PUSH([C++])
CXXFLAGS_SAVE=$CXXFLAGS
CXXFLAGS=
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/system/error_code.hpp>]],
[[boost::system::system_category]])],
[[boost::system::error_category *a = 0;]])],
ax_cv_boost_system=yes, ax_cv_boost_system=no)
CXXFLAGS=$CXXFLAGS_SAVE
AC_LANG_POP([C++])
Expand Down
12 changes: 7 additions & 5 deletions build-aux/m4/ax_check_compile_flag.m4
Expand Up @@ -4,7 +4,7 @@
#
# SYNOPSIS
#
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
Expand All @@ -19,6 +19,8 @@
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
# force the compiler to issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
#
Expand Down Expand Up @@ -53,19 +55,19 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.

#serial 2
#serial 4

AC_DEFUN([AX_CHECK_COMPILE_FLAG],
[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
[AS_VAR_SET(CACHEVAR,[yes])],
[AS_VAR_SET(CACHEVAR,[no])])
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
AS_VAR_IF(CACHEVAR,yes,
[m4_default([$2], :)],
[m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
Expand Down
13 changes: 8 additions & 5 deletions build-aux/m4/ax_check_link_flag.m4
Expand Up @@ -4,7 +4,7 @@
#
# SYNOPSIS
#
# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
Expand All @@ -19,6 +19,8 @@
# EXTRA-FLAGS FLAG". This can for example be used to force the linker to
# issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_LINK_IFELSE.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG.
#
Expand Down Expand Up @@ -53,18 +55,19 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.

#serial 2
#serial 4

AC_DEFUN([AX_CHECK_LINK_FLAG],
[AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
ax_check_save_flags=$LDFLAGS
LDFLAGS="$LDFLAGS $4 $1"
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
[AS_VAR_SET(CACHEVAR,[yes])],
[AS_VAR_SET(CACHEVAR,[no])])
LDFLAGS=$ax_check_save_flags])
AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
AS_VAR_IF(CACHEVAR,yes,
[m4_default([$2], :)],
[m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
Expand Down
12 changes: 7 additions & 5 deletions build-aux/m4/ax_check_preproc_flag.m4
Expand Up @@ -4,7 +4,7 @@
#
# SYNOPSIS
#
# AX_CHECK_PREPROC_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
# AX_CHECK_PREPROC_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
Expand All @@ -19,6 +19,8 @@
# "CPPFLAGS EXTRA-FLAGS FLAG". This can for example be used to force the
# preprocessor to issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_PREPROC_IFELSE.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
# macro in sync with AX_CHECK_{COMPILE,LINK}_FLAG.
#
Expand Down Expand Up @@ -53,19 +55,19 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.

#serial 2
#serial 4

AC_DEFUN([AX_CHECK_PREPROC_FLAG],
[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]cppflags_$4_$1])dnl
AC_CACHE_CHECK([whether _AC_LANG preprocessor accepts $1], CACHEVAR, [
ax_check_save_flags=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $4 $1"
AC_PREPROC_IFELSE([AC_LANG_PROGRAM()],
AC_PREPROC_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
[AS_VAR_SET(CACHEVAR,[yes])],
[AS_VAR_SET(CACHEVAR,[no])])
CPPFLAGS=$ax_check_save_flags])
AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
AS_VAR_IF(CACHEVAR,yes,
[m4_default([$2], :)],
[m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
Expand Down

0 comments on commit 02c4467

Please sign in to comment.