package dune-configurator
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Helper library for gathering system configuration
Install
dune-project
Dependency
Authors
Maintainers
Sources
dune-3.22.2.tbz
sha256=c2ccf8bc6b17afa47c450297357496303aa7c8680e329b79d98c68e35013a118
sha512=26d3df56a509c6e8937a9333944303bdd8800a41e1b869c3adfb76d1e1fe615b6ec41491d596bd5982e338dcf70b97c18f963f37bfbf2bd581cbd356f3d5f4e5
doc/index.html
dune-configurator - Helper library for gathering system configuration
dune-configurator is a small library that helps writing OCaml scripts that test features available on the system, in order to generate config.h files for instance.
Among other things, dune-configurator allows one to:
- test if a C program compiles
- query
pkg-config - import
#definefrom OCaml header files - generate a
config.hfile
API Documentation
The entry point for this library is Configurator.V1.
Example
The following happens in a dune project that contains some C code that needs to link against libpng.
The following program (discover/discover.ml) uses dune-configurator to query pkg-config and create cflags.sexp and libs.sexp:
let () =
Configurator.V1.main ~name:"libpng"
(fun c ->
let pkg_config =
match Configurator.V1.Pkg_config.get c with
| Some p -> p
| None -> failwith "Cannot find pkg-config"
in
let conf = Configurator.V1.Pkg_config.query ~package:"libpng" in
Configurator.V1.Flags.write_sexp "cflags.sexp" conf.cflags;
Configurator.V1.Flags.write_sexp "libs.sexp" conf.libs)It can be built using the following discover/dune file:
(executable (name discover) (libraries dune-configurator)) (rule (targets cflags.sexp libs.sexp) (action (run ./discover.exe)))
And used when building the C code in the following dune file:
(library (name png) (foreign_stubs (language c) (names bindings) (flags :standard (:include discover/cflags.sexp))) (c_library_flags :standard (:include discover/libs.sexp)))
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page