Source build configure

I’m building Haiku from source, because I’m interested in input driver issues.

Or rather, I’m building the C compiler, again, because I wasn’t able to easily figure out how to skip that step, and I thought maybe as it’s already built … but nope, it’s recompiling everything. I built it a couple days ago, it isn’t at all necessary, and it takes at least twice as long as building the OS.

What would the ../configure command look like, to just configure haiku, in a build subdirectory, for x86_64 with the compiler etc. already built in ../../buildtools?

Script I’m using to build 64bit on 64bit host Haiku:

# prerequirements
pkgman install cmd:python3 cmd:xorriso devel:libzstd -y

# getting the sources
sourceDir="/Opslag/Haiku"
mkdir -p $sourceDir
cd $sourceDir

git clone https://review.haiku-os.org/buildtools
git clone https://review.haiku-os.org/haiku

# fetch latest changes
cd $sourceDir/buildtools
git pull

# fetch latest changes
cd $sourceDir/haiku
git switch master
git pull

# prepare buildtools
mkdir generated.x86_64; cd generated.x86_64
../configure --cross-tools-source ../../buildtools --build-cross-tools x86_64

jam -q -j16 @nightly-anyboot

EDIT: for the record, cloning is only needed once, disabled on the next run (although it doesn’t interfere the process afaik).

I never had to do that. Following the instructions, I just had to run configure to build the compiler once (and whenever I update it), then jam whenever I want to build Haiku. A configure --update now and then when the script itself changes.

Not sure why you would need to reconfigure Haiku build, but from configure --help it seems --cross-tools-prefix is what you need.

The buildtools/ directory contains only the sourcecode for the build tools. The built build tools are stored in the generated/ directory when you run configure for the first time.

If you deleted your generated directory, you have to start over. Otherwise, you can just run jam to build things, no need to run configure again.

If I clone the source to the same directory, the configure will still be valid?

You can usually update the sources (with “git pull” or similar) without recloning.

As long as you keep your generated/ directory, you can also re-clone the sources if you want (in the same path as they were before)