diff --git a/build.sh b/build.sh index 9c6c93b..f1e572b 100755 --- a/build.sh +++ b/build.sh @@ -202,9 +202,9 @@ fi # MacPorts symlinks pushd $TARGET_DIR/bin &>/dev/null # The BSD ln command doesn't support '-r' -ln -sf ../../tools/osxcross-macports osxcross-macports -ln -sf ../../tools/osxcross-macports osxcross-mp -ln -sf ../../tools/osxcross-macports omp +ln -sf $BASE_DIR/tools/osxcross-macports osxcross-macports +ln -sf $BASE_DIR/tools/osxcross-macports osxcross-mp +ln -sf $BASE_DIR/tools/osxcross-macports omp popd &>/dev/null SDK=$(ls $TARBALL_DIR/MacOSX$SDK_VERSION*) @@ -308,6 +308,7 @@ export OSXCROSS_VERSION export OSXCROSS_TARGET=$TARGET export OSXCROSS_OSX_VERSION_MIN=$OSX_VERSION_MIN export OSXCROSS_LINKER_VERSION=$LINKER_VERSION +export OSXCROSS_BUILD_DIR=$BUILD_DIR if [ "$PLATFORM" != "Darwin" ]; then # libLTO.so diff --git a/wrapper/Makefile b/wrapper/Makefile index 018cf83..767cd96 100644 --- a/wrapper/Makefile +++ b/wrapper/Makefile @@ -22,6 +22,7 @@ override CXXFLAGS+=-DOSXCROSS_TARGET="\"$(OSXCROSS_TARGET)\"" override CXXFLAGS+=-DOSXCROSS_OSX_VERSION_MIN="\"$(OSXCROSS_OSX_VERSION_MIN)\"" override CXXFLAGS+=-DOSXCROSS_LINKER_VERSION="\"$(OSXCROSS_LINKER_VERSION)\"" override CXXFLAGS+=-DOSXCROSS_LIBLTO_PATH="\"$(OSXCROSS_LIBLTO_PATH)\"" +override CXXFLAGS+=-DOSXCROSS_BUILD_DIR="\"$(OSXCROSS_BUILD_DIR)\"" override CXXFLAGS+= $(OSXCROSS_CXXFLAGS) diff --git a/wrapper/build.sh b/wrapper/build.sh index fbb8e1a..0792f62 100755 --- a/wrapper/build.sh +++ b/wrapper/build.sh @@ -127,7 +127,7 @@ if [ -n "$BWCOMPILEONLY" ]; then exit 0 fi -verbose_cmd mv wrapper "../target/bin/${TARGETTRIPLE}-wrapper${EXESUFFIX}" +verbose_cmd mv wrapper "${TARGET_DIR}/bin/${TARGETTRIPLE}-wrapper${EXESUFFIX}" pushd "../target/bin" &>/dev/null diff --git a/wrapper/programs/osxcross-conf.cpp b/wrapper/programs/osxcross-conf.cpp index 003f99f..bb2af31 100644 --- a/wrapper/programs/osxcross-conf.cpp +++ b/wrapper/programs/osxcross-conf.cpp @@ -31,6 +31,7 @@ int conf(Target &target) { std::string SDKPath; OSVersion OSXVersionMin = getDefaultMinTarget(); const char *ltopath = getLibLTOPath(); + const char *builddir = getBuildDir(); if (!target.getSDKPath(SDKPath)) return 1; @@ -59,8 +60,16 @@ int conf(Target &target) { << std::endl; std::cout << "export OSXCROSS_TARGET_DIR=" << target.execpath << "/.." << std::endl; - std::cout << "export OSXCROSS_BUILD_DIR=" << target.execpath << "/../../build" - << 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_CCTOOLS_PATH=" << target.execpath << std::endl; std::cout << "export OSXCROSS_LIBLTO_PATH=" << ltopath diff --git a/wrapper/target.h b/wrapper/target.h index 36243ec..2dfdac4 100644 --- a/wrapper/target.h +++ b/wrapper/target.h @@ -32,6 +32,7 @@ constexpr const char *getDefaultTarget() { return OSXCROSS_TARGET; } constexpr const char *getDefaultCompiler() { return "clang"; } constexpr const char *getDefaultCXXCompiler() { return "clang++"; } constexpr const char *getLinkerVersion() { return OSXCROSS_LINKER_VERSION; } +constexpr const char *getBuildDir() { return OSXCROSS_BUILD_DIR; } constexpr const char *getLibLTOPath() { #ifdef OSXCROSS_LIBLTO_PATH