On Fri, 22 Mar 2024 11:38:25 GMT, Magnus Ihse Bursie <i...@openjdk.org> wrote:

> I can give a spoiler to what the upcoming JDK_LIBS rewrite will do.
> 
> Currently, if you want to link with e.g. `jli`, this is what you need to do:
> 
> ```
> $(eval $(call SetupJdkLibrary, BUILD_LIBMYLIB, \
>     NAME := mylib, \
>     EXTRA_HEADER_DIRS := java.base:libjli, \
>     LDFLAGS_linux := -L$(call FindLibDirForModule, java.base), \
>     LDFLAGS_macosx := -L$(call FindLibDirForModule, java.base), \
>     JDK_LIBS_linux := -ljli, \
>     JDK_LIBS_macosx := -ljli, \
>     JDK_LIBS_windows := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib, 
> \
> ))
> 
> $(BUILD_LIBMYLIB): $(call FindLib, java.base, jli)
> ```
> 
> This is cumbersome, and easy to forget (we almost never get it 100% right in 
> any place...).
> 
> I intend to replace it with the following, and to have the build system 
> generate the boiler plate automatically:
> 
> ```
> $(eval $(call SetupJdkLibrary, BUILD_LIBMYLIB, \
>     NAME := mylib, \
>     JDK_LIBS := jli, \
> ))
> ```

I see, that's a definite +1 for me

-------------

PR Comment: https://git.openjdk.org/jdk/pull/18430#issuecomment-2014905990

Reply via email to