Skip to content

build: feature options, and JNI headers and JDK paths by option - #415

Merged
jwinarske merged 1 commit into
mainfrom
build/feature-options
Dec 3, 2026
Merged

jwinarske merged 1 commit into
mainfrom
build/feature-options

Conversation

@jwinarske

Copy link
Copy Markdown
Contributor

Summary

A packager could not say what a4l is built with. Every optional part was built if pkg-config found its dependency, jni.h came from the JDK of whichever java was on PATH, and that JDK's javac and libjvm.so paths were written into the executable. A Yocto recipe had to fake a JDK, edit acl_config.h and point ACL_AOSP_ROOT at nothing.

  • Feature options, one per optional part: wayland, skia, vulkan, gl, dmabuf_codec, gstreamer, ffmpeg, drm_cxx, alsa, pipewire, libcamera, sdbus, secret, crypto. auto is the behavior until now; enabled makes a missing dependency a configure error; disabled leaves the part out.
  • -Djni_include=<dir> gives jni.h, and no JDK is looked for.
  • -Djavac= and -Dlibjvm= set the paths recorded for --vm=jvm.
  • -Dandroid_jar=none looks in no AOSP checkout.
  • sdbus-c++ is asked for at 2.0.0 or later, which the code needs.

A build with no jni.h never compiled: the service bridges include it. That is now a configure error and not a compile failure, so there is no jni on/off option.

The /mnt/dev/aosp default for ACL_AOSP_ROOT is unchanged.

Test status (x86-64)

Check Result
Default configure Same parts and messages as before
Default build No warning
Suite, default build 134 of 135
-Djni_include, -Dlibjvm=libjvm.so, -Dandroid_jar=none, -O2, plain Builds with no warning; no JDK, AOSP or build-directory path in the executable
All fourteen disabled Configures, builds, runs
enabled with the dependency missing Configure errors that name the cause

The suite failure is browser-tab. It fails the same way on a build from before this change: the host's desktop portal does not answer on the test machine today.

Not tested: a cross build with these options, and each option alone set to enabled on a machine that has its dependency.

A packager could not say what a4l is built with. Every optional part
was built if pkg-config found its dependency, jni.h came from the JDK
of whichever `java` was on PATH, and that JDK's javac and libjvm.so
paths were written into the executable. A Yocto recipe faked a JDK,
edited acl_config.h and pointed ACL_AOSP_ROOT at nothing.

- Fourteen feature options, one per optional part: wayland, skia,
  vulkan, gl, dmabuf_codec, gstreamer, ffmpeg, drm_cxx, alsa,
  pipewire, libcamera, sdbus, secret, crypto. auto is the behavior
  until now; enabled makes a missing dependency a configure error;
  disabled leaves the part out.
- -Djni_include=<dir> gives jni.h, and no JDK is looked for.
- -Djavac= and -Dlibjvm= set the paths recorded for --vm=jvm.
- -Dandroid_jar=none looks in no AOSP checkout.
- sdbus-c++ is asked for at 2.0.0 or later, which the code needs.

A build with no jni.h never compiled: the service bridges include it.
That is now a configure error and not a compile failure.

Three unit-test helpers are unused without libcrypto and are marked
so; the all-disabled build then has no warning.

Tested, x86-64:
- Default configure: the same parts and messages as before. Builds
  with no warning; suite 134 of 135. browser-tab fails, and fails the
  same way on a build from before this change: the host's desktop
  portal does not answer on this machine today.
- -Djni_include, -Dlibjvm=libjvm.so, -Dandroid_jar=none, -O2, plain:
  builds with no warning; the executable holds no JDK, AOSP or build
  directory path.
- All fourteen disabled: configures, builds, runs.
- enabled with the dependency missing (skia, vulkan without skia, a
  jni_include with no jni.h): configure errors that name the cause.

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
@jwinarske
jwinarske merged commit b149064 into main Dec 3, 2026
11 checks passed
@jwinarske
jwinarske deleted the build/feature-options branch December 3, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant