Index: .gitignore =================================================================== --- .gitignore +++ .gitignore @@ -55,22 +55,9 @@ libraries/source/nvtt/src/build/ # Build files (libs) (OS X) -libraries/osx/boost/ -libraries/osx/enet/ -libraries/osx/gloox/ -libraries/osx/iconv/ -libraries/osx/icu/ -libraries/osx/libcurl/ -libraries/osx/libjpg/ -libraries/osx/libogg/ -libraries/osx/libpng/ -libraries/osx/libxml2/ -libraries/osx/miniupnpc/ -libraries/osx/nspr/ -libraries/osx/sdl2/ -libraries/osx/vorbis/ -libraries/osx/wxwidgets/ -libraries/osx/zlib/ +libraries/osx/* +!libraries/osx/patches/ +!libraries/osx/build-osx-libs.sh libraries/source/fcollada/.already-built libraries/source/nvtt/.already-built Index: libraries/osx/build-osx-libs.sh =================================================================== --- libraries/osx/build-osx-libs.sh +++ libraries/osx/build-osx-libs.sh @@ -35,9 +35,9 @@ VORBIS_VERSION="libvorbis-1.3.6" # gloox requires GnuTLS, GnuTLS requires Nettle and GMP GMP_VERSION="gmp-6.1.2" -NETTLE_VERSION="nettle-3.4" -GNUTLS_VERSION="gnutls-3.5.19" -GLOOX_VERSION="gloox-1.0.20" +NETTLE_VERSION="nettle-3.5.1" +GNUTLS_VERSION="gnutls-3.6.8" +GLOOX_VERSION="gloox-1.0.22" # NSPR is necessary for threadsafe Spidermonkey NSPR_VERSION="4.15" # OS X only includes part of ICU, and only the dylib @@ -169,7 +169,7 @@ pushd $LIB_DIRECTORY # patch zlib's configure script to use our CFLAGS and LDFLAGS - (patch -p0 -i ../../patches/zlib_flags.diff && CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" ./configure --prefix="$ZLIB_DIR" --static && make ${JOBS} && make install) || die "zlib build failed" + (patch -Np0 -i ../../patches/zlib_flags.diff && CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" ./configure --prefix="$ZLIB_DIR" --static && make ${JOBS} && make install) || die "zlib build failed" popd touch .already-built else @@ -489,6 +489,8 @@ tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY + # NOTE: enable-fat in this case allows building and running on different CPUS. + # Otherwise CPU-specific instructions will be used with no fallback for older CPUs. (./configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" --prefix="$INSTALL_DIR" --enable-fat --disable-shared && make ${JOBS} && make install) || die "GMP build failed" popd touch .already-built @@ -521,7 +523,9 @@ tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY -(./configure CFLAGS="$CFLAGS -m64" CXXFLAGS="$CXXFLAGS -m64" LDFLAGS="$LDFLAGS -m64" --with-include-path="${GMP_DIR}/include" --with-lib-path="${GMP_DIR}/lib" --prefix="$INSTALL_DIR" --disable-shared --disable-documentation --disable-openssl --disable-assembler && make ${JOBS} && make install) || die "Nettle build failed" + # NOTE: enable-fat in this case allows building and running on different CPUS. + # Otherwise CPU-specific instructions will be used with no fallback for older CPUs. + (./configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" --with-include-path="${GMP_DIR}/include" --with-lib-path="${GMP_DIR}/lib" --prefix="$INSTALL_DIR" --enable-fat --disable-shared --disable-documentation --disable-openssl --disable-assembler && make ${JOBS} && make install) || die "Nettle build failed" popd touch .already-built else @@ -535,7 +539,7 @@ LIB_VERSION="${GNUTLS_VERSION}" LIB_ARCHIVE="$LIB_VERSION.tar.xz" LIB_DIRECTORY="$LIB_VERSION" -LIB_URL="https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/" +LIB_URL="https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/" mkdir -p gnutls pushd gnutls > /dev/null @@ -553,7 +557,10 @@ tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY -(./configure CFLAGS="$CFLAGS -m64" CXXFLAGS="$CXXFLAGS -m64" LDFLAGS="$LDFLAGS -m64" NETTLE_CFLAGS="-I${NETTLE_DIR}/include" NETTLE_LIBS="-L${NETTLE_DIR}/lib -lnettle" HOGWEED_CFLAGS="-I${NETTLE_DIR}/include" HOGWEED_LIBS="-L${NETTLE_DIR}/lib -lhogweed" GMP_CFLAGS="-I${GMP_DIR}/include" GMP_LIBS="-L${GMP_DIR}/lib -lgmp" --prefix="$INSTALL_DIR" --enable-shared=no --without-idn --with-included-unistring --with-included-libtasn1 --without-p11-kit --disable-tests && make ${JOBS} && make install) || die "GnuTLS build failed" + # GnuTLS 3.6.8 added the TCP Fast Open feature, which requires connectx + # but that's only available on OS X 10.11+ (GnuTLS doesn't support SDK based builds yet) + # So we disable that functionality + (patch -Np0 -i ../../patches/gnutls-disable-tcpfastopen.diff && ./configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" LIBS="-L${GMP_DIR}/lib -lgmp" NETTLE_CFLAGS="-I${NETTLE_DIR}/include" NETTLE_LIBS="-L${NETTLE_DIR}/lib -lnettle" HOGWEED_CFLAGS="-I${NETTLE_DIR}/include" HOGWEED_LIBS="-L${NETTLE_DIR}/lib -lhogweed" GMP_CFLAGS="-I${GMP_DIR}/include" GMP_LIBS="-L${GMP_DIR}/lib -lgmp" --prefix="$INSTALL_DIR" --enable-shared=no --without-idn --with-included-unistring --with-included-libtasn1 --without-p11-kit --disable-tests && make ${JOBS} && make install) || die "GnuTLS build failed" popd touch .already-built else @@ -584,7 +591,7 @@ pushd $LIB_DIRECTORY # TODO: pulls in libresolv dependency from /usr/lib - (./configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" --prefix="$INSTALL_DIR" GNUTLS_CFLAGS="-I${GNUTLS_DIR}/include" GNUTLS_LIBS="-L${GNUTLS_DIR}/lib -lgnutls" --enable-shared=no --with-zlib="${ZLIB_DIR}" --without-libidn --with-gnutls="yes" --without-openssl --without-tests --without-examples && make ${JOBS} && make install) || die "gloox build failed" + (./configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" --prefix="$INSTALL_DIR" GNUTLS_CFLAGS="-I${GNUTLS_DIR}/include" GNUTLS_LIBS="-L${GNUTLS_DIR}/lib -lgnutls" --enable-shared=no --with-zlib="${ZLIB_DIR}" --without-libidn --with-gnutls="yes" --without-openssl --without-tests --without-examples --disable-getaddrinfo && make ${JOBS} && make install) || die "gloox build failed" popd touch .already-built else Index: libraries/osx/patches/gnutls-disable-tcpfastopen.diff =================================================================== --- /dev/null +++ libraries/osx/patches/gnutls-disable-tcpfastopen.diff @@ -0,0 +1,11 @@ +--- lib/system/fastopen.c 2019-03-15 05:10:27.000000000 -0400 ++++ lib/system/fastopen.c 2019-07-10 07:53:30.000000000 -0400 +@@ -38,7 +38,7 @@ + + /* TCP Fast Open on OSX behaves differently from Linux, so define these helpers */ + #if defined __APPLE__ && defined __MACH__ && defined CONNECT_DATA_IDEMPOTENT && defined CONNECT_RESUME_ON_READ_WRITE +-# define TCP_FASTOPEN_OSX ++//# define TCP_FASTOPEN_OSX + #elif defined TCP_FASTOPEN && defined MSG_FASTOPEN + # define TCP_FASTOPEN_LINUX + #endif