Commit Graph

291 Commits

Author SHA1 Message Date
Oscar Lesta
8ece85d220 configure: let CC default to gcc-x86 on Haiku 32 bits.
Fixes #18935.

Change-Id: I05807d0f38e38b7abaad770fc390d38cbc76f8a5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8503
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-25 16:14:43 +00:00
Augustin Cavalier
678ea4c357 configure: Fix checks for HOST_HAIKU_PORTER and related variables. 2024-10-18 16:05:13 -04:00
Augustin Cavalier
2a39b810fa configure: Allow specifying Python interpreter in HOST_PYTHON.
This reverts commit b6554e72fc
which added the --with-python flag. Using environment variables
to specify host and cross tools is how the rest of this script
behaves, so let's be consistent.
2024-10-14 13:53:42 -04:00
Jessica Hamilton
7c6ab83094 configure: detect supported retry flags for wget.
Some systems may be using wget2 symlinked to wget (Fedora,
currently), which doesn't support --retry-on-host-error.

Change-Id: I9fac080e7ac1cc4c39a03f6c27e9c42f8697ecff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8336
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-10-14 11:01:19 +00:00
Jessica Hamilton
b6554e72fc configure: allow specifying python to use --with-python.
Change-Id: Iba5e5a428a4cd84e6dc149943c033d2c5025ae23
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8327
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-16 16:57:03 +00:00
Jessica Hamilton
c40570934e configure: add a version check for python.
Tooling used by HaikuDepotServer relies on typing features that
exist in Python >= 3.9.

Change-Id: I926d464130a3cef331a00b9a6abbbad5edfcefda
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8326
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-16 16:57:03 +00:00
Jessica Hamilton
e22ea41c57 configure: add missing sanity check for cross tools options.
Change-Id: Ia79a7eb654dc4bb8dfa35df0f85b2428965e1571
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8325
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-16 16:57:03 +00:00
Augustin Cavalier
77d89de0ad configure: Remove special logic for detecting Clang tools.
They can be overridden anyway, and this allows specifying a cross-tools
prefix in addition to --use-clang to use the GCC binutils.
2024-08-24 01:44:42 -04:00
Augustin Cavalier
c7b5f2821c configure: Fix check for whether architecture is already set.
The old one relied on Bash extensions to regular expressions
which a plain POSIX shell (such as /bin/dash) doesn't support.
2024-08-24 01:44:42 -04:00
Augustin Cavalier
0bbef5d79f configure: Remove support for HOST_CC_IS_LEGACY_GCC.
Add an error message if it's detected to be such, and
remove all the build machinery related to it.

Fixes #18935.
2024-07-24 21:33:57 -04:00
Kacper Kasper
6f58244192 Support repositories created with git worktree
* .git is a file in worktree-created copies.
* Determines the correct directory using git command, when
  running configure.
* Fixes #16808.

Change-Id: I72c7b2e79aac5140d35e0339fad16160a35911ae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6914
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-11-01 09:09:27 +00:00
Jessica Hamilton
e9e00b80c0 cross_tools: allow specifying a custom sysroot path
* Use with --sysroot /path/to/sysroot; useful for CI
  environments and cross-building.

Change-Id: I27a93a5d209cd5324591587e85fce9b47c18172d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5318
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-06-05 09:08:20 +00:00
Jérôme Duval
4df4b48fc6 configure & build: make use of 64-bit libgcc and libsupc++ for EFI/x86_64
Change-Id: I7636530d927843d155b9d7dada2db4f67c875290
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5139
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-03-25 09:51:39 +00:00
Alexander von Gluck IV
31f27c4d39 boot/efi: Optionally sign our EFI bootloader
* The private keys are in possession of Haiku, Inc.

Change-Id: I3b5b004e1dce0102f8a65f6d682f7e428845efe8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4936
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-02-18 21:32:56 +00:00
Augustin Cavalier
dbaef85011 configure: Use IS_LEGACY_GCC instead of manually comparing GCC versions. 2021-12-07 14:22:54 -05:00
Augustin Cavalier
f638102196 Remove conditions for HOST_PLATFORM=msys.
It never really worked beyond the most basic of commands
and required a lot of hacks, and these days WSL should be used instead.
2021-10-22 17:03:44 -04:00
Augustin Cavalier
34fef46b06 configure: Pass -e to JAMSHELL.
We have a number of "actions" blocks in our Jam rules with more than
one command, and so without -e, the actions will only fail if the last
command does. This is clearly not what was intended in virtually all
cases, so we should pass -e to the shell to ensure any command failing
causes the whole actions to fail.

I am kind of surprised that nobody noticed this before now, even
in the original Jamrules going back to the Perforce days. I only
noticed it because I experimented with making "rm" fail to find
places where it was invoked instead of $(RM)...
2021-09-06 16:02:17 -04:00
Jérôme Duval
04be20a75a Implement stack protection support
this adds kernel & libroot stack protector hooks. it uses /dev/random in userspace.
A configure option --enable-stack-protector is added to activate -fstack-protector
on selected system components (ATM apps, kits, servers).

Change-Id: If3a2920ba9aa0a85eaff4ba6778947f8c76ade31
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3895
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-05-03 17:52:31 +00:00
Augustin Cavalier
47320dd0ab configure & build: Rework legacy GCC detection to parse versions outside of Jam.
Jam comparison logic is string-based, and so was detecting GCC >= 10
as being < 2. This rectifies that by removing the GCC version parsing
from Jam logic entirely, and setting various BuildConfig variables
instead.

Change-Id: I0c0ae3b9002fb5e77f9ca7a78600c91871657f03
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3293
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2020-10-09 01:20:02 +00:00
Alexander von Gluck IV
14d8c772a1 configure: Break out cross-tools source path
* Stops the ackward "buildtools sources on first --build-cross-tools"

Change-Id: I683acf5ccc2a83b526a58aa54c7716d28d47b52d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3206
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
2020-10-02 19:52:41 +00:00
Alexander von Gluck IV
583db6f559 configure: Properly detect clang version > 9
Change-Id: Ide083442fddc6f3f103f1ff3811a92d5db5c75a1
2020-07-08 14:39:47 -05:00
Augustin Cavalier
7d72ed0184 configure: Use /bin/dash as JAMSHELL if available.
On platforms (such as Haiku) where dash is available or can be installed
but is not the default /bin/sh, this can provide a significant improvement
to compile times vs. /bin/bash or other more complex shells.

At least under Haiku, this is around a ~10% "real" time gain for builds.

This also allows one to specify a JAMSHELL by passing that environ
to ./configure.
2020-05-29 23:11:47 -04:00
Augustin Cavalier
7a617f59fd configure & build: Add basic support for building with MSYS.
Also remove the MINGW support, as it was far too incomplete.

This *should* work under case-sensitive NTFS, but instead,
it seems #14963 occurs. So perhaps there is a GCC bug
related to case-sensitive vs. case-insensitivity after all.
2020-05-03 13:24:26 -04:00
Augustin Cavalier
78b224583c configure: Building GCC2-only Haiku is not supported anymore.
Fixes #15682.
2020-02-08 13:25:23 -05:00
Jaroslaw Pelczar
1f52c921e2 ARM64: Initial changes so we can compile GCC toolchain
Signed-off-by: Jaroslaw Pelczar <jarek@jpelczar.com>
Change-Id: I0859d0619d601efd003472e2846d2f980ee2e457
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1799
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-08-30 19:05:16 +00:00
John Scipione
2a1cc90e3e configure: use stat -f on bsds, -c otherwise
Move host platform detection up, fix indentation.

If the host platform is a BSD (darwin|freebsd|openbsd) use stat -f,
otherwise use stat -c to check for a restrictive umask.

Change-Id: Ifb57eb69153221a23a84700445ff08a96517844a
Reviewed-on: https://review.haiku-os.org/c/1535
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-06-28 03:31:06 +00:00
Alexander von Gluck IV
c59cde3d69 riscv32: Drop any remaining mentions
* I added this early on, but to be honest, any interesting
  workstation class hardware would be riscv64.
* Since riscv32 is mostly embedded or low power, just drop.

Change-Id: Id36274c882c46e766268f2ab53eb1bd5f95227be
Reviewed-on: https://review.haiku-os.org/c/1352
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-04 13:23:32 +00:00
PulkoMandy
f23db0edb5 sparc: add to known architectures in configure script
Change-Id: Ic6cfdd2a94c8d6c0a7f4963fe892f8dc73e97afd
Reviewed-on: https://review.haiku-os.org/c/1323
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2019-03-30 15:23:15 +00:00
Augustin Cavalier
2b20049687 configure: Check for python the same way we check for sha256.
Avoids printing an extra line to stdout that users don't really
need to see.
2019-03-03 16:50:29 -05:00
Andrew Lindesay
17dc34acd6 HaikuDepot: Build Configure for Python
Some operating systems only ship with Python 3 and the
binary for this is 'python3' instead of 'python' which
causes the Jam build process to fail because it expects
to find 'python'.  This change will mean that the
configure process will detect this case and configure
the build to use the correct binary name.

Fixes #14938

Change-Id: I30cd0df828792715a54d760b86dd79aee04e2b2f
Reviewed-on: https://review.haiku-os.org/c/1134
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-03-03 07:49:25 +00:00
Adrien Destugues
5629675a32 sparc: add defines and minimum set of required files
Gets the stage0 bootstrap to run.
Imlementation is probably nonsense at this point.

Change-Id: I10876efbb54314b864c0ad951152757cdb2fd366
Reviewed-on: https://review.haiku-os.org/c/1061
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-23 16:30:50 +00:00
Augustin Cavalier
1d91b37193 build: Fixes to support building in paths with spaces in them.
Now that HAIKU_TOP is a relative path, nearly all paths Jam actually
has to deal with will never contain spaces, so this is now feasible.
Only one issue remains after this commit (namely, setting
HOST_BUILD_COMPATIBILITY_LIB_DIR.)
2019-01-09 19:18:28 -05:00
Augustin Cavalier
d4c38925ba configure: Restore execute bit.
It seems "git stash" on Windows loses filemodes... sorry about that.
2018-11-23 18:40:47 -05:00
Augustin Cavalier
807304b100 build: Add basic support for MinGW hosts.
This doesn't fully work yet (the FS code in libroot_build
needs to be adapted, as some of the symlink-related calls
are not available on MinGW), but it gets much further than
the "Cygwin" target did.
2018-11-23 16:24:25 -05:00
Augustin Cavalier
37c106060a build: Remove support for cross-building from Cygwin and SunOS.
These have been broken for a long time. Some Cygwin changes that
are relevant on MinGW are kept here, but users on Windows who
want to build Haiku should probably use WSL at this point.

However, now that we are using relative paths and don't need
to worry about drive path kludges, it's actually possible to
get some host tools built on MinGW. Changes for that coming.
2018-11-23 15:40:50 -05:00
Augustin Cavalier
241b61a7f5 Revert "configure: Change default ARFLAGS to use deterministic mode."
This reverts commit da693d1fdc.

GCC2 binutils doesn't like this. As mentioned in the previous commit,
"u" is a no-op on modern binutils and only issues a warning.
2018-11-21 21:16:40 -05:00
Augustin Cavalier
da693d1fdc configure: Change default ARFLAGS to use deterministic mode.
Jambase now expects this (and its defaults were changed); and this
is already the default on most systems, so adding this should
silence the "D is now the default mode" warning.
2018-11-21 19:16:50 -05:00
Alexander von Gluck IV
5bd0fbd13a build: Add riscv architecture
* I mean, qemu 3.0 supports it.
* Nobody get excited, we need all the triplets added to
  our gcc buildtools. clang 7.0 seems to be cool with riscv though.

Change-Id: I17728163e4f28a3c16cee482a253364724b06f3a
2018-11-04 13:47:50 -06:00
Augustin Cavalier
3facc270ea Jamrules: Force HAIKU_TOP to be relative.
Prior to hrev47631 (2014), HAIKU_TOP was relative when jam was invoked
from the repository root, and not relative when jam was invoked from
any other location, including "generated." In hrev47631, Jamrules
was changed to be as it was before this commit, in order to fix #11101
(Haiku repository creation failed due to the use of relative paths.)

GCC, however, injects the full path passed to the compiler into some
symbols under certain circumstanes (anonymous namespaces, for one),
and so a relative path for more reproducible builds is preferred.
It seems the aforementioned bug is no longer with us, as a full image
build that I did with this change worked just fine.

Note that you will have to run "configure --update" after this
in the case that you usually invoke "jam" from the generated directory,
as the Jamfile configure generated included absolute paths. (The reminder
to do that this diff includes can be removed after some reasonable amount
of time.)
2018-11-01 20:56:04 -04:00
Augustin Cavalier
ca20bd2e48 configure: Account for umasks < 0022.
It seems recent Debian has a umask of 002, interestingly enough;
and so the original check failed there.

Thanks to luroh for reporting!
2018-10-27 14:00:56 -04:00
Augustin Cavalier
02f3646adc configure: Ensure the git checkout was not done with a restrictive umask.
It seems that the old buildbots had their (ancient) checkouts done with a
restrictive umask, and this meant that some files in buildbot-generated
builds were not readable by "world" as they should have been.

Now instead of just verifying the umask itself is not too restrictive,
we also validate the "SetupEnvironment" script in the tree has mode 644.

Fixes #14085.
2018-10-20 23:03:14 +00:00
Augustin Cavalier
b57e7df9ef configure: Clean up BuildConfig generation and add HOST_CC.
We do a lot of checks against the CC specified in environment,
but we never pass it into the BuildConfig, so we have no guarantee
that's what Jam's actually using.

Additionally remove HAIKU_BOOT_BOARD while we're at it (nothing uses
it anymore), and reorder the sections in BuildConfig to make a little
more sense.
2018-08-15 14:40:03 -04:00
Augustin Cavalier
252e4f6299 configure: Set a default LINKFLAGS in addition to LDFLAGS.
The former is passed to the compiler when linking using it,
the latter is passed to ld when it is invoked directly.

Also modify ArchitectureRules to not overwrite this setting.
2018-08-15 14:19:30 -04:00
Augustin Cavalier
20c61bb7a4 Revert unrelated changes from previous commit.
I should have read the update script more closely as to
how it added changes for committing...
2018-08-13 15:58:01 -04:00
Augustin Cavalier
5924b6e410 configure: Guard against using Clang < 7 for builds.
Only Clang 7+ has -fno-delete-null-pointer-checks.
2018-08-13 15:54:53 -04:00
Autocomitter
ef9994ee77 Update translations from Pootle 2018-08-13 19:45:39 +00:00
Augustin Cavalier
fb4cc98472 build: Add initial ARM64 target.
It will probably be just stubs for the significant future, but,
here it is anyway.

Regarding the naming: Yes, the official name is "aarch64." However,
Linux, FreeBSD, and Zircon all call it "arm64", and so we will do the same.

I've configured it initially to be a Clang-only port, making no
changes to GCC buildtools whatsoever here. We'll see if that sticks,
however.
2018-08-02 19:48:29 -04:00
Augustin Cavalier
d9f698eaf0 configure: Fix copying clang_headers for non-x86 architectures.
Also allow Clang for PowerPC builds.
2018-08-01 20:11:10 -04:00
Alexander von Gluck IV
20dbf03267 configure: Allow Clang for ARM builds. 2018-08-01 19:31:01 -04:00
Augustin Cavalier
a107d3b4f9 configure: Do --update check earlier.
Previously we initialized variables and ran a few $CC tests first
(which was what the old version of --update needed.) Now, we can do it
almost immediately after the script begins.

Spotted by running --update on a GCCless system (as the $CC tests
gave warning messages due to no GCC, while CC= was set in --update
environs.)
2018-08-01 19:23:18 -04:00