Lines Matching +full:- +full:- +full:cross +full:- +full:bindir
3 # -
4 # SPDX-License-Identifier: BSD-2-Clause
31 # This script makes it easier to build on non-FreeBSD systems by bootstrapping
35 # `MAKEOBJDIRPREFIX=~/obj ./tools/build/make.py buildworld -DWITH_FOO`
38 # --cross-bindir to specify the path to the cross-compiler bindir:
40 # --cross-bindir=/path/to/cross/compiler buildworld -DWITH_FOO TARGET=foo
57 "universe-toolchain",
61 "kernel-toolchains",
78 bmake_build_dir = objdir_prefix / "bmake-build"
79 bmake_install_dir = objdir_prefix / "bmake-install"
81 bmake_config = bmake_install_dir / ".make-py-config"
84 "sh", "-c", ". \"$0\"/VERSION; echo $_MAKE_VERSION", bmake_source_dir],
94 bmake_binary, "-r", "-f", "/dev/null", "-V", "MAKE_VERSION"],
103 "--with-default-sys-path=.../share/mk:" +
105 "--with-machine=amd64", # TODO? "--with-machine-arch=amd64",
106 "--without-filemon", "--prefix=" + str(bmake_install_dir)]
135 run(["sh", bmake_source_dir / "boot-strap"] + configure_args,
137 run(["sh", bmake_source_dir / "boot-strap", "op=install"] + configure_args,
153 x.startswith(var + "=") or x == ("-D" + var) for x in sys.argv[1:])
156 def check_required_make_env_var(varname, binary_name, bindir):
160 if not bindir:
162 varname + " or pass --cross-bindir=/cross/compiler/dir/bin")
164 guess = os.path.join(bindir, binary_name)
172 run([guess, "--version"])
176 # Avoid calling brew --prefix on macOS if all variables are already set:
187 # default to homebrew-installed clang on MacOS if available
191 "brew", "--prefix", "llvm"],
195 if llvm_dir and Path(llvm_dir.decode("utf-8"), "bin").exists():
196 return str(Path(llvm_dir.decode("utf-8"), "bin"))
205 parser.add_argument("--host-bindir",
209 parser.add_argument("--cross-bindir", default=None,
213 parser.add_argument("--cross-compiler-type", choices=("clang", "gcc"),
215 help="Compiler type to find in --cross-bindir (only "
218 parser.add_argument("--host-compiler-type", choices=("cc", "clang", "gcc"),
220 help="Compiler type to find in --host-bindir (only "
222 parser.add_argument("--debug", action="store_true",
224 parser.add_argument("--bootstrap-toolchain", action="store_true",
227 parser.add_argument("--clean", action="store_true",
229 "-DWITHOUT_CLEAN")
230 parser.add_argument("--no-clean", action="store_false", dest="clean",
232 "-DWITHOUT_CLEAN")
255 "when building on non-FreeBSD")
260 # FIXME: this should take values like `clang-9` and then look for
261 # clang-cpp-9, etc. Would alleviate the need to set the bindir on
265 "clang", "clang++", "clang-cpp")
276 # On non-FreeBSD we need to explicitly pass XCC/XLD/X_COMPILER_TYPE
281 "cpp" if use_cross_gcc else "clang-cpp")
292 strip_binary = "llvm-strip"
305 # at -j1 cleandir+obj is unbearably slow. AUTO_OBJ helps a lot
306 debug("Adding -DWITH_AUTO_OBJ")
307 bmake_args.append("-DWITH_AUTO_OBJ")
309 bmake_args.append("-DWITHOUT_CLEAN")
313 # time cleaning directories instead of just doing a rm -rf ${.OBJDIR}
314 want_clean = input("You did not set -DWITHOUT_CLEAN/--(no-)clean."
317 bmake_args.append("-DWITHOUT_CLEAN")