diff options
| author | Albert Cervin <albert@acervin.com> | 2024-05-12 22:55:43 +0200 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2024-05-12 22:55:43 +0200 |
| commit | 9a4e99b436efefa00277d592ff67798eb491e87a (patch) | |
| tree | 3603646adf972cd252772b7b2832ca72fcdcaa4b /configure | |
| parent | 1e7e71d151bac48f150b4edb4bfa3f1ac4e80f44 (diff) | |
| download | dged-9a4e99b436efefa00277d592ff67798eb491e87a.tar.gz dged-9a4e99b436efefa00277d592ff67798eb491e87a.tar.xz dged-9a4e99b436efefa00277d592ff67798eb491e87a.zip | |
Improve API docs and configure system
There is now a super minimalistic configure script that automatically
detects the event system (epoll/kqueue) and generates a config.h and a
config.mk.
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/configure b/configure new file mode 100755 index 0000000..820344e --- /dev/null +++ b/configure @@ -0,0 +1,24 @@ +#! /usr/bin/env sh + +echo "/* Generated by configure */" > src/config.h +echo "#ifndef _CONFIG_H" >> src/config.h +echo "#define _CONFIG_H" >> src/config.h + +echo "# generated by configure" > config.mk + +echo -n "detecting event system... " +if ./scripts/has_header "sys/epoll.h"; then + echo "epoll." + echo "#define HAS_EPOLL 1" >> src/config.h + echo "HAS_EPOLL ?= true" >> config.mk +elif ./scripts/has_header "sys/event.h"; then + echo "kqueue." + echo "#define HAS_KQUEUE 1" >> src/config.h + echo "HAS_KQUEUE ?= true" >> config.mk +else + echo "none." +fi + +echo "#endif" >> src/config.h +echo "wrote src/config.h" +echo "wrote config.mk" |
