Make TARGET_DIR configurable (#108, #137, #201)

This commit is contained in:
Thomas Pöchtrager 2019-10-23 16:06:00 +02:00
parent 49e49b1c56
commit 379f7648c3
4 changed files with 19 additions and 22 deletions

View File

@ -76,7 +76,7 @@ if [ $f_res -eq 1 ]; then
if [ $(osxcross-cmp $OSXCROSS_SDK_VERSION "<=" 10.11) -eq 1 ]; then
# https://github.com/tpoechtrager/osxcross/issues/178
patch -p1 < $PATCH_DIR/compiler-rt_clock-gettime.patch
patch -p1 < $OSXCROSS_PATCH_DIR/compiler-rt_clock-gettime.patch
fi
EXTRA_MAKE_FLAGS=""

View File

@ -62,18 +62,18 @@ rm -f $OSXCROSS_TARGET_DIR/bin/*-g++*
if [ $(osxcross-cmp $GCC_VERSION '>' 5.0.0) -eq 1 ] &&
[ $(osxcross-cmp $GCC_VERSION '<' 5.3.0) -eq 1 ]; then
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66035
patch -p1 < $PATCH_DIR/gcc-pr66035.patch
patch -p1 < $OSXCROSS_PATCH_DIR/gcc-pr66035.patch
fi
if [ $(osxcross-cmp $GCC_VERSION '>=' 6.1.0) -eq 1 ] &&
[ $(osxcross-cmp $GCC_VERSION '<=' 6.3.0) -eq 1 ]; then
# https://gcc.gnu.org/ml/gcc-patches/2016-09/msg00129.html
patch -p1 < $PATCH_DIR/gcc-6-buildfix.patch
patch -p1 < $OSXCROSS_PATCH_DIR/gcc-6-buildfix.patch
fi
if [ $(osxcross-cmp $GCC_VERSION '==' 6.3.0) -eq 1 ]; then
# https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/config/darwin-driver.c?r1=244010&r2=244009&pathrev=244010
patch -p1 < $PATCH_DIR/darwin-driver.c.patch
patch -p1 < $OSXCROSS_PATCH_DIR/darwin-driver.c.patch
fi
if [ $(osxcross-cmp $OSXCROSS_SDK_VERSION '>=' 10.14) -eq 1 ] &&
@ -152,7 +152,7 @@ GCC_VERSION=`echo $GCC_VERSION | tr '-' ' ' | awk '{print $1}'`
pushd $OSXCROSS_TARGET_DIR/x86_64-apple-$OSXCROSS_TARGET/include &>/dev/null
pushd c++/${GCC_VERSION}* &>/dev/null
cat $OSXCROSS_TARGET_DIR/../patches/libstdcxx.patch | \
cat $OSXCROSS_PATCH_DIR/libstdcxx.patch | \
$SED "s/darwin13/$OSXCROSS_TARGET/g" | \
patch -p0 -l &>/dev/null || true

View File

@ -6,7 +6,7 @@ BASE_DIR=$PWD
TARBALL_DIR=$BASE_DIR/tarballs
BUILD_DIR=$BASE_DIR/build
TARGET_DIR=$BASE_DIR/target
TARGET_DIR=${TARGET_DIR:-$BASE_DIR/target}
TARGET_DIR_SDK_TOOLS=$TARGET_DIR/SDK/tools
PATCH_DIR=$BASE_DIR/patches
SDK_DIR=$TARGET_DIR/SDK
@ -122,7 +122,7 @@ function guess_sdk_version()
for sdk in $sdks; do echo $sdk; done
echo 'more than one MacOSX SDK tarball found. please set'
echo 'SDK_VERSION environment variable for the one you want'
echo '(for example: SDK_VERSION=10.x [OSX_VERSION_MIN=10.x] ./build.sh)'
echo '(for example: SDK_VERSION=10.x [OSX_VERSION_MIN=10.x] [TARGET_DIR=...] ./build.sh)'
exit 1
else
sdk=$(find -L tarballs/ -type f | grep MacOSX)

View File

@ -31,7 +31,12 @@ int conf(Target &target) {
std::string SDKPath;
OSVersion OSXVersionMin = getDefaultMinTarget();
const char *ltopath = getLibLTOPath();
const char *builddir = getBuildDir();
std::string BuildDir = getBuildDir();
if (BuildDir.empty()) {
BuildDir += target.execpath;
BuildDir += "/../../build";
}
if (!target.getSDKPath(SDKPath))
return 1;
@ -52,24 +57,16 @@ int conf(Target &target) {
<< std::endl;
std::cout << "export OSXCROSS_SDK=" << SDKPath
<< std::endl;
std::cout << "export OSXCROSS_TARBALL_DIR=" << target.execpath
<< "/../../tarballs"
std::cout << "export OSXCROSS_TARBALL_DIR=" << BuildDir.c_str()
<< "/../tarballs"
<< std::endl;
std::cout << "export OSXCROSS_PATCH_DIR=" << target.execpath
<< "/../../patches"
std::cout << "export OSXCROSS_PATCH_DIR=" << BuildDir.c_str()
<< "/../patches"
<< std::endl;
std::cout << "export OSXCROSS_TARGET_DIR=" << target.execpath << "/.."
<< std::endl;
std::cout << "export OSXCROSS_BUILD_DIR=";
if (builddir[0])
std::cout << builddir;
else
std::cout << target.execpath << "/../../build";
std::cout << std::endl;
std::cout << "export OSXCROSS_BUILD_DIR=" << BuildDir.c_str()
<< std::endl;
std::cout << "export OSXCROSS_CCTOOLS_PATH=" << target.execpath
<< std::endl;
std::cout << "export OSXCROSS_LIBLTO_PATH=" << ltopath