2014-05-17 23:15:15 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* OSXCross Compiler Wrapper *
|
2016-02-27 09:40:10 +01:00
|
|
|
* Copyright (C) 2014-2016 by Thomas Poechtrager *
|
2014-05-17 23:15:15 +02:00
|
|
|
* t.poechtrager@gmail.com *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or *
|
|
|
|
* modify it under the terms of the GNU General Public License *
|
|
|
|
* as published by the Free Software Foundation; either version 2 *
|
|
|
|
* of the License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program; if not, write to the Free Software *
|
|
|
|
* Foundation, Inc., *
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
|
|
|
***********************************************************************/
|
|
|
|
|
|
|
|
#include "proginc.h"
|
|
|
|
|
|
|
|
using namespace tools;
|
|
|
|
using namespace target;
|
|
|
|
|
|
|
|
namespace program {
|
|
|
|
namespace osxcross {
|
|
|
|
|
2014-09-27 19:45:49 +02:00
|
|
|
int conf(Target &target) {
|
2015-05-02 21:49:23 +02:00
|
|
|
std::string SDKPath;
|
2014-05-17 23:15:15 +02:00
|
|
|
OSVersion OSXVersionMin = getDefaultMinTarget();
|
|
|
|
const char *ltopath = getLibLTOPath();
|
2019-10-23 16:06:00 +02:00
|
|
|
std::string BuildDir = getBuildDir();
|
|
|
|
|
|
|
|
if (BuildDir.empty()) {
|
|
|
|
BuildDir += target.execpath;
|
|
|
|
BuildDir += "/../../build";
|
|
|
|
}
|
2014-05-17 23:15:15 +02:00
|
|
|
|
2015-06-21 14:07:19 +02:00
|
|
|
if (!target.getSDKPath(SDKPath))
|
2014-05-17 23:15:15 +02:00
|
|
|
return 1;
|
|
|
|
|
|
|
|
if (!OSXVersionMin.Num())
|
|
|
|
OSXVersionMin = target.getSDKOSNum();
|
|
|
|
|
|
|
|
if (!ltopath)
|
|
|
|
ltopath = "";
|
|
|
|
|
2019-11-02 13:26:21 +01:00
|
|
|
auto print = [](const char *var, const auto &val) {
|
|
|
|
std::cout << "export OSXCROSS_" << var << "=" << val << std::endl;
|
|
|
|
};
|
|
|
|
|
|
|
|
print("VERSION", getOSXCrossVersion());
|
|
|
|
print("OSX_VERSION_MIN", OSXVersionMin.shortStr());
|
|
|
|
print("TARGET", getDefaultTarget());
|
|
|
|
print("BASE_DIR", BuildDir + "/..");
|
|
|
|
print("SDK", SDKPath);
|
|
|
|
print("SDK_DIR", SDKPath + "/..");
|
|
|
|
print("SDK_VERSION", target.getSDKOSNum().shortStr());
|
|
|
|
print("TARBALL_DIR", BuildDir + "/../tarballs");
|
|
|
|
print("PATCH_DIR", BuildDir + "/../patches");
|
|
|
|
print("TARGET_DIR", std::string(target.execpath) + "/..");
|
|
|
|
print("DIR_SDK_TOOLS", SDKPath + "/../tools");
|
|
|
|
print("BUILD_DIR", BuildDir);
|
|
|
|
print("CCTOOLS_PATH", target.execpath);
|
|
|
|
print("LIBLTO_PATH", ltopath);
|
|
|
|
print("LINKER_VERSION", getLinkerVersion());
|
2014-05-17 23:15:15 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace osxcross
|
|
|
|
} // namespace program
|