2017-10-12 08:32:18 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2018-02-24 19:39:29 +00:00
|
|
|
# bash 3 does not work for this code
|
|
|
|
if [ -z "$IN_DASH" ]; then
|
|
|
|
if command -v dash >/dev/null; then
|
|
|
|
export IN_DASH=1
|
|
|
|
exec dash "$0" "$@"
|
2017-10-22 22:35:56 +00:00
|
|
|
else
|
2018-02-24 19:39:29 +00:00
|
|
|
echo >&2 "please install dash from homebrew or macports to run this script"
|
2017-10-12 08:32:18 +00:00
|
|
|
exit 1
|
2018-02-24 19:39:29 +00:00
|
|
|
fi
|
|
|
|
fi
|
2017-10-12 21:31:23 +00:00
|
|
|
|
2018-02-24 19:39:29 +00:00
|
|
|
BUILD_ROOT=$HOME/vbam-build-mac
|
2017-10-12 21:31:23 +00:00
|
|
|
|
2018-02-24 19:39:29 +00:00
|
|
|
BUILD_ENV=$(cat <<'EOF'
|
|
|
|
export MACOSX_DEPLOYMENT_TARGET=10.7
|
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
|
|
|
export CPPFLAGS="-DICONV_CONST="
|
|
|
|
export CFLAGS="-framework Carbon -framework Foundation -framework CoreServices -arch x86_64 -Wno-unused-command-line-argument -DICONV_CONST="
|
|
|
|
export CXXFLAGS="-stdlib=libc++ -framework Carbon -framework Foundation -framework CoreServices -arch x86_64 -Wno-unused-command-line-argument -DICONV_CONST="
|
|
|
|
export OBJCXXFLAGS="-stdlib=libc++ -framework Carbon -framework Foundation -framework CoreServices -arch x86_64 -Wno-unused-command-line-argument -DICONV_CONST="
|
|
|
|
export LDFLAGS="-framework Carbon -framework Foundation -framework CoreServices -arch x86_64 -Wno-unused-command-line-argument"
|
|
|
|
EOF
|
|
|
|
)
|
2017-10-12 21:31:23 +00:00
|
|
|
|
2018-02-24 19:39:29 +00:00
|
|
|
TAR=tar
|
2017-10-22 22:35:56 +00:00
|
|
|
|
2018-02-24 19:39:29 +00:00
|
|
|
. "$(dirname "$0")/../builder/core.sh"
|
2017-10-12 21:31:23 +00:00
|
|
|
|
2018-02-24 19:39:29 +00:00
|
|
|
table_line_remove DISTS flex
|
|
|
|
table_line_remove DISTS libsecret
|
2017-10-12 21:31:23 +00:00
|
|
|
|
2018-02-24 19:39:29 +00:00
|
|
|
table_line_replace DIST_CONFIGURE_OVERRIDES openssl './Configure darwin64-x86_64-cc no-shared --prefix=/usr --openssldir=/etc/ssl'
|
2017-10-12 21:31:23 +00:00
|
|
|
|
2018-02-24 19:39:29 +00:00
|
|
|
table_line_replace DIST_CONFIGURE_TYPES libmodplug autoreconf
|
|
|
|
table_line_append DIST_PRE_BUILD libmodplug " \
|
|
|
|
sed -i.bak '/-mmacosx-version-min=/d' configure.ac; \
|
|
|
|
sed -i.bak 's/-lstdc++/-lc++/g' libmodplug.pc.in; \
|
|
|
|
"
|
2017-10-12 21:31:23 +00:00
|
|
|
|
2018-02-24 19:39:29 +00:00
|
|
|
table_line_append DIST_PRE_BUILD libzmq "sed -i.bak 's/-lstdc++/-lc++/g' src/libzmq.pc.in"
|
|
|
|
table_line_append DIST_PRE_BUILD ffmpeg "sed -i.bak 's/-lstdc++/-lc++/g' configure"
|
2017-10-12 21:31:23 +00:00
|
|
|
|
2018-02-24 19:39:29 +00:00
|
|
|
table_line_append DIST_ARGS wxwidgets "--with-macosx-version-min=$MACOSX_DEPLOYMENT_TARGET LDFLAGS='$LDFLAGS -stdlib=libc++'"
|
|
|
|
table_line_append DIST_ARGS ffmpeg "--disable-videotoolbox --extra-ldflags='-framework CoreText'"
|
|
|
|
table_line_append DIST_ARGS libmodplug "CC=clang++ CXX=clang++"
|
2017-10-12 21:31:23 +00:00
|
|
|
|
2018-02-24 19:39:29 +00:00
|
|
|
builder "$@"
|