How to tell jextract to use different lib name for the same binding?

Davide Perini perini.davide at dpsoftware.org
Wed Nov 13 10:35:37 UTC 2024



Hi all,
I'm starting to use jextract to workaround some issues I found in AWT.
AWT uses 20+ years old APIs for notifications and tray icons and it 
doesn't work well in recent Linux distros and on Windows 11 24H2.

I must say that foreign memory API is a massive improvement to the Java 
ecosystem, wow.
I created a binding for the tray icon and for the notification API in 
minutes, this is awesome.

To create my bindings I start with jextract with something like this:
jextract \
-l ayatana-appindicator3 \
-l appindicator3 \
....
/usr/include/libayatana-appindicator3-0.1/libayatana-appindicator/app-indicator.h

With this command I would tell to jextract to search for
ayatana-appindicator3
or
appindicator3

but when I use the binding it throws an exception if one of the two libs 
are not present.

Libs uses the same interfaces and I don't need two bindings for these 
two libraries.

Is it possible to tell to jextract to create a binding that searches for 
"multiple lib name" and don't throw and error in the event that one lib 
is found?

Thanks
Davide
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20241113/821289f4/attachment.htm>


More information about the panama-dev mailing list