(rule
 (targets config.h config.ml ldlibs.sexp)
 (deps
  (:gen ../discover/discover.exe))
 (action
  (run %{gen})))

(rule
 (action
  (progn
   (copy extUnix.pp.ml all.ml)
   (copy extUnix.pp.ml specific.ml))))

(library
 (name ExtUnix)
 (public_name extunix)
 (modules_without_implementation ExtUnix)
 (libraries unix bigarray bytes)
 (preprocess
  (per_module
   ((pps ppx_have --gen-all)
    All)
   ((pps ppx_have)
    Specific)))
 (c_library_flags
  (:include ldlibs.sexp))
 (foreign_stubs
  (language c)
  (flags :standard)
  (names
   atfile
   bigarray
   common
   dirfd
   endian
   endianba
   execinfo
   fadvise
   fallocate
   fexecve
   fsync
   ioctl_siocgifconf
   malloc
   memalign
   mktemp
   mman
   mount
   poll
   pread_pwrite_ba
   ptrace
   pts
   read_cred
   realpath
   resource
   sendmsg
   signalfd
   sockopt
   splice
   statvfs
   stdlib
   sysconf
   sysinfo
   syslog
   time
   tty_ioctl
   uname
   unistd
   unshare
   eventfd)))
