8000 Add BSD to autoconf scrips by snake66 · Pull Request #4 · openjdk/bsd-port · GitHub
[go: up one dir, main page]

Skip to content

Add BSD to autoconf scrips#4

Open
snake66 wants to merge 1 commit intoopenjdk:bsd-portfrom
snake66:enable-configure-for-bsd
Open

Add BSD to autoconf scrips#4
snake66 wants to merge 1 commit intoopenjdk:bsd-portfrom
snake66:enable-configure-for-bsd

Conversation

@snake66
Copy link
Collaborator
@snake66 snake66 commented Mar 9, 2026

This basically allows configure to complete and set up a configuration suitable for building the BSD port for supported platforms (FreeBSD, OpenBSD and NetBSD.)

The flag _BSDONLY_SOURCE is defined for all the BSD's except for Apple MacOS, while the existing _ALLBSD_SOURCE includes Apple MacOS.

For the BSD's we set the OPENJDK_TARGET_OS_ENV variable to distinct values reflecting the BSD variant being built. This is used to distinguish build flags, library locations and what libraries and modules to include for the various builds.

As an example, FreeBSD includes the ALSA library, and should build the Serviceability Agent, while the other BSD's do not.

This work was sponsored by: The FreeBSD Foundation


Progress

  • Change must not contain extraneous whitespace
  • Change must be properly reviewed (1 review required, with at least 1 Committer)

Contributors

  • Greg Lewis <glewis@openjdk.org>
  • Kurt Miller <kurt@openjdk.org>

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/bsd-port.git pull/4/head:pull/4
$ git checkout pull/4

Update a local copy of the PR:
$ git checkout pull/4
$ git pull https://git.openjdk.org/bsd-port.git pull/4/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4

View PR using the GUI difftool:
$ git pr show -t 4

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/bsd-port/pull/4.diff

Using Webrev

Link to Webrev Comment

This basically allows configure to complete and set up a configuration
suitable for building the BSD port for supported platforms (FreeBSD,
OpenBSD and NetBSD.)

The flag `_BSDONLY_SOURCE` is defined for all the BSD's _except_ for
Apple MacOS, while the existing `_ALLBSD_SOURCE` _includes_ Apple MacOS.

For the BSD's we set the `OPENJDK_TARGET_OS_ENV` variable to distinct
values reflecting the BSD variant being built. This is used to
distinguish build flags, library locations and what libraries and
modules to include for the various builds.

As an example, FreeBSD includes the ALSA library, and should build the
Serviceability Agent, while the other BSD's do not.

This work was sponsored by: The FreeBSD Foundation

Co-authored-by: Greg Lewis <glewis@eyesbeyond.com>
Co-authored-by: Kurt Miller <bsdkurt@gmail.com>
@bridgekeeper
Copy link
bridgekeeper bot commented Mar 9, 2026

👋 Welcome back haraldei! A progress list of the required criteria for merging this PR into bsd-port will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
openjdk bot commented Mar 9, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@snake66
Copy link
Collaborator Author
snake66 commented Mar 9, 2026

This is a squashed version of #3, but from a fork so that actions will run for the PR in the forked repo.

@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 9, 2026
@mlbridge
Copy link
mlbridge bot commented Mar 9, 2026

Webrevs

@snake66
Copy link
Collaborator Author
snake66 commented Mar 10, 2026

/contributor @bsdkurt
/contributor @battleblow
/label build

@openjdk
Copy link
openjdk bot commented Mar 10, 2026

@snake66 Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <duke@openjdk.org>

User names can only be used for users in the census associated with this repository. For other contributors you need to supply the full name and email address.

@openjdk
Copy link
openjdk bot commented Mar 10, 2026

@snake66 Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <duke@openjdk.org>

User names can only be used for users in the census associated with this repository. For other contributors you need to supply the full name and email address.

@openjdk
Copy link
openjdk bot commented Mar 10, 2026

@snake66
The label build is not a valid label.
These labels are valid:

@snake66
Copy link
Collaborator Author
snake66 commented Mar 10, 2026

/contributor add @battleblow
/contributor add @bsdkurt

@openjdk
Copy link
openjdk bot commented Mar 10, 2026

@snake66
Contributor Greg Lewis <glewis@openjdk.org> successfully added.

@openjdk
Copy link
openjdk bot commented Mar 10, 2026

@snake66
Contributor Kurt Miller <kurt@openjdk.org> successfully added.

@vieiro
Copy link
vieiro commented Mar 10, 2026

A happy FreeBSD user passed by, was delighted to see that this PR didn't break any build on other platforms, that even the tests were passing on those, and decided to give this a try on his system.

So he installed some stuff with pkg install bash autoconf gmake zip alsa-lib cups fontconfig openjdk25

And then ran the following command:

$ bash configure --with-toolchain-type=clang --with-alsa-include=/usr/local/include/alsa --with-cups-include=/usr/local/include --with-fontconfig-include=/usr/local/include

(Noting that configure was not executable)

To get the following output:

FREEBSD:~/bsd-port $ bash configure --with-toolchain-type=clang --with-alsa-include=/usr/local/include/alsa --with-cups-include=/usr/local/include --with-fontconfig-include=/usr/local/includ
e
configure: Configuration created at Tue Mar 10 20:12:50 CET 2026.
checking for basename... /usr/bin/basename
checking for dirname... /usr/bin/dirname
checking for file... /usr/bin/file
checking for ldd... /usr/bin/ldd
checking for echo... echo [builtin]
checking for tr... /usr/bin/tr
checking for uname... /usr/bin/uname
checking for wc... /usr/bin/wc
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for locale... /usr/bin/locale
checking for cygpath... [not found]
checking for wslpath... [not found]
checking for cmd.exe... [not found]
checking for lsb_release... [not found]
checking build system type... x86_64-unknown-freebsd15.0
checking host system type... x86_64-unknown-freebsd15.0
checking target system type... x86_64-unknown-freebsd15.0
checking openjdk-build os-cpu... bsd-x86_64
...[blah, stripped for brevity]
====================================================
A new configuration has been successfully created in
/home/antonio/bsd-port/build/bsd-x86_64-server-release
using configure arguments '--with-toolchain-type=clang --with-alsa-include=/usr/local/include/alsa --with-cups-include=/usr/local/include --with-fontconfig-include=/usr/local/include'.

Configuration summary:
* Name:           bsd-x86_64-server-release
* Debug level:    release
* HS debug level: product
* JVM variants:   server
* JVM features:   server: 'cds compiler1 compiler2 dtrace epsilongc g1gc jfr jni-check jvmci jvmti management parallelgc serialgc services shenandoahgc vm-structs' 
* OpenJDK target: OS: bsd, CPU architecture: x86, address length: 64
* Version string: 27-internal-adhoc.antonio.bsd-port (27-internal)
* Source date:    1773169971 (2026-03-10T19:12:51Z)

Tools summary:
* Boot JDK:       openjdk version "25.0.1" 2025-10-21 OpenJDK Runtime Environment (build 25.0.1+8-freebsd-1) OpenJDK 64-Bit Server VM (build 25.0.1+8-freebsd-1, mixed mode, sharing) (at /usr/local)
* Toolchain:      clang (clang/LLVM)
* C Compiler:     Version 19.1.7 (at /usr/bin/clang)
* C++ Compiler:   Version 19.1.7 (at /usr/bin/clang++)

Build performance summary:
* Build jobs:     8
* Memory limit:   16349 MB

The user didn't dare to try to make the resulting build configuration at that moment, because the dinner was getting cold.

While having dinner he thought that many other more experienced FreeBSD users could be interested in giving this a run in their own systems, or even contribute to this somehow. But then maybe those users didn't know about this effort. After a long working day, the user fell into a deep sleep, dreaming with Java on FreeBSD.

@snake66
Copy link
Collaborator Author
snake66 commented Mar 11, 2026

@vieiro Thanks for verifying that the configuration passes :)

And you're right, this is just the first step, so in itself not enough to build for FreeBSD yet. You will find a complete port for the current mainline in the battleblow/jdk repo. By now this passes all tier1 tests on AMD64, and all but one on Aarch64. (Except for a handful more if running on ZFS, as ZFS is not (yet?) able to give the guarantees required by posix_fallocate(3).

We also do have OpenJDK for FreeBSD in the ports tree and in pkg. Up to and including the latest OpenJDK 25.

@vieiro
Copy link
vieiro commented Mar 11, 2026

@snake66 My pleasure! Keep up the good work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rfr Pull request is ready for review 45AF

Development

Successfully merging this pull request may close these issues.

2 participants

0