summaryrefslogtreecommitdiff
path: root/configure
blob: 8cce0d0c21320f28dac44d5da3720c1f7dba4d67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/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"