<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Hey Manuel,</p>
<p>You should be able to use the '<font face="monospace">:</font>'
prefix to the library you pass to <font face="monospace">-l</font>
to specify a path.</p>
<p>So, on Linux you should be able to use <font face="monospace">-l
:libudev.so.1</font> and on Mac <font face="monospace">-l :</font><code>/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation</code></p>
<p>Does that work?<br>
Jorn<br>
</p>
<div class="moz-cite-prefix">On 20/02/2024 21:29, Manuel
Bleichenbacher wrote:<br>
</div>
<blockquote type="cite" cite="mid:CAA7F5j+x90Ls52Wz069J4m=hcWBXWEkQg_Uqkd2FKw_=+UFs-Q@mail.gmail.com">
<div dir="ltr">Hi Panama team
<div><br>
</div>
<div>Thanks again for quickly addressing the issues. I was able
to upgrade my library to JDK 22 using the latest jextract
version on all three platforms.</div>
<div><br>
</div>
<div>All issues that I have reported previously are fixed.</div>
<div><br>
</div>
<div><br>
</div>
<div>I've discovered one more issue. For a particular type (on
macOS), jextract creates code because a dependency was not
specified. I guess it would be supposed to abort with an error
regarding the missing dependency. The problem is quickly fixed
if the dependency is included.</div>
<div><br>
</div>
<div>The minimal commands to reproduce it is:</div>
<div><br>
</div>
<div>JEXTRACT=../../../../jextract/build/jextract/bin/jextract<br>
SDK_DIR=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk<br>
<br>
$JEXTRACT --output ../../src/main/java \<br>
-I $SDK_DIR/usr/include \<br>
-lIOKit.framework \<br>
--header-class-name IOKit \<br>
--target-package net.codecrete.usb.macos.gen.iokit \<br>
--include-struct IOCFPlugInInterfaceStruct \<br>
iokit_helper.h<br>
</div>
<div><br>
</div>
<div>The file iokit_helper.h:</div>
<div><br>
</div>
<div>#include <IOKit/usb/IOUSBLib.h><br>
#include <IOKit/IOCFPlugIn.h><br>
</div>
<div><br>
</div>
<div>The missing dependency is CFUUIDBytes and the path to it is
that a typedef (REFIID) referring to it is used in a parameter
of a function pointer (QueryInterface) of
IOCFPlugInInterfaceStruct.</div>
<div><br>
</div>
<div><br>
</div>
<div>I notice that I don't use any "--include-typedef" anymore.
Since jextract resolves typedefs to the underlying type, only
the referred struct needs to be included. Is there any use
left for "--include-typedef"?</div>
<div><br>
</div>
<div><br>
</div>
<div>The biggest annoyance is that the generated code still
needs to be manually modified (unless I've overlooked a
jextract option). The details can be found here: <a href="https://urldefense.com/v3/__https://github.com/manuelbl/JavaDoesUSB/blob/jdk22/java-does-usb/jextract/README.md__;!!ACWV5N9M2RV99hQ!JZksYXAXMLHwazJaDbyPbj4eOkTSMvg9QhB8DCZNIMGWMA2Yo4jDTemgCsNg-3UPxHbee0Qg00WLEQt2Y0wZWXBha80y$" moz-do-not-send="true">https://github.com/manuelbl/JavaDoesUSB/blob/jdk22/java-does-usb/jextract/README.md</a></div>
<div><br>
</div>
<div>It's related to two cases of locating the library at
run-time: referring to major version 1 of libudev in Linux,
and referring to a system framework on macOS.</div>
<div><br>
</div>
<div>Regards</div>
<div>Manuel</div>
<div><br>
</div>
</div>
</blockquote>
</body>
</html>