(library
 (foreign_stubs
  (language c)
  (names unix_pseudo_terminal_stubs))
 (name unix_pseudo_terminal)
 (public_name core_unix.unix_pseudo_terminal)
 (libraries core_kernel.caml_unix core)
 (preprocessor_deps config_ext.h)
 (preprocess
  (pps ppx_jane ppx_optcomp)))

(install
 (section lib)
 (files
  (config_ext.h as unix_pseudo_terminal/config_ext.h)))

(rule
 (targets config_ext.h)
 (deps
  (:first_dep discover.sh))
 (action
  (bash "./%{first_dep} config_ext.h %{lib:jst-config:config.h}")))
