<div dir="ltr">Hi Jorn<div><br></div><div>Thanks so much. I haven't seen this new options and it works nicely. The manual work after the code generation is no longer needed.</div><div><br></div><div>Regards</div><div>Manuel</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Di., 20. Feb. 2024 um 21:54 Uhr schrieb Jorn Vernee <<a href="mailto:jorn.vernee@oracle.com">jorn.vernee@oracle.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><u></u>

  
  <div>
    <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>On 20/02/2024 21:29, Manuel
      Bleichenbacher wrote:<br>
    </div>
    <blockquote type="cite">
      
      <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$" target="_blank">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>
  </div>

</blockquote></div>