Conversation
|
Please review it carefully, your knowledge of bash are far more advanced than mine and I'm sure that a lot of stuff can be done in a better way, but I think this PR could be a good base :) |
modules/configure.base
Outdated
| # Arguments: | ||
| # [--static=<lib>] (allows static linking (--enable-static) for the | ||
| # library provided, e.g.: --static=-lrdkafka "librdkafka"..) | ||
| # [--bootstrap_url=<url> (Automatic download of library to vendor/ folder if |
There was a problem hiding this comment.
This gets a little noisy, what do you think of adding just a function reference?
function bootstrap_librd {
mkl_lib_bootstrap $URL $my_ccflags ....
}
Or maybe automatically resolve the bootstrapper so that if mkl_bootstrap__<confname> is available it is called automatically from mkl_lib_check() if configure --bootstrap ?
There was a problem hiding this comment.
In a first step I though in add them as you said, but then I had problems with recursion, since mkl_lib_check will call itself for bootstrap forever. It needs a break condition, maybe another flag, or internally delete the variable once we have called bootstrap as fallback.
There was a problem hiding this comment.
Currently it goes via mkl meta bootstrap_fn, but if you prefer it could be with `bootstrap_${config_name}" and let it auto-discovery. We will save one mkl_meta_set that way.
| fi | ||
|
|
||
| if ! mkl_compile_check "$1" "$2" "$3" "$4" "$libs" "$6"; then | ||
| local action="$3" |
There was a problem hiding this comment.
refactor this into separate functions
0b08c88 to
e7003b2
Compare
If `configure` script is called with `--bootstrap` option, and proper
instructions are added to build dep, it will be automatically downloaded
& built under `vendor` folder.
For example, to build a GIT revision of librd:
```
LIBRD_GIT_VERSION=73fae1cc0ca378669fa09bcda54b408397f80c18
function make_librd {
if [[ -d "librd-$LIBRD_GIT_VERSION" && ! -d librd ]]; then
mv "librd-$LIBRD_GIT_VERSION" librd
fi
cd librd
make libs
}
```
And in `checks` function:
```
...
mkl_meta_set librd bootstrap_url "https://github.com/eugpermar/librd/archive/$LIBRD_GIT_VERSION.zip"
mkl_meta_set librd bootstrap_makefn make_librd
mkl_meta_set librd bootstrap_cppflags "-I./vendor/librd"
mkl_meta_set librd bootstrap_static_lib "vendor/librd/librd/librd.a"
mkl_lib_check --static=-lrd \
"librd" "" fail CC "-lrd -lpthread -lrt" \
"#include <librd/rdlog.h>
void f() { rdlog(LOG_ERR, \"TEST\"); }"
...
```
Other configurations could use installation under local folder with
--prefix or DESTDIR and include that one.
e7003b2 to
a4c85c3
Compare
|
Hi! I've updated with dependency meta variables. Could you please check the changes? Thanks! |
|
Hi, Magnus! Were you able to check this? I can try the Thanks! |
If
configurescript is called with--bootstrapoption, and properinstructions are added to build dep, it will be automatically downloaded
& built under
vendorfolder.For example, to build a GIT revision of librd:
And in
checksfunction:Other configurations could use installation under local folder with
--prefix or DESTDIR and include that one.