-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
88 lines (74 loc) · 1.94 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([USTB-CLOCK], [v0.9], [https://github.com/jason23347/ustb-clock])
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([subdir-objects])
# debug mode
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug], [enable debugging, default: no]))
AS_IF([! test "x$enable_debug" = xyes ], [
AC_DEFINE([NDEBUG], [1], [disable debugging code])
])
# detect window size
AC_ARG_ENABLE(detect_winsize,
AS_HELP_STRING([--enable-winsize-detection],
[detect winsize, default: no]))
AS_IF([ test "x$enable_detect_winsize" = xyes ], [
AC_DEFINE([ALWAYS_DETECT_WINSIZE], [1], [always detect winsize and redraw])
])
# colorfulization
AC_ARG_ENABLE(colorful_output,
AS_HELP_STRING([--enable-colorful-output],
[print info colorfully, default: yes]))
AS_IF([ test "x$enable_colorful_output" != xno ], [
AC_DEFINE([COLORFUL_OUTPUT], [1], [print info colorfully])
])
# Clock type: "digits" or "randmap"
AC_ARG_ENABLE(clock_type,
AS_HELP_STRING([--enable-clock-type],
[specify clock type, default: digits]))
AS_CASE(["$enable_clock_type"],
[randmap], [
AC_DEFINE([CLOCK_TYPE], [CLOCK_TYPE_RANDMAP], [clock type])
]
[*], [
AC_DEFINE([CLOCK_TYPE], [CLOCK_TYPE_DIGITS], [clock type])
]
)
# Checks for programs.
AC_PROG_CC
AC_PROG_CC_C99
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([ \
arpa/inet.h \
netinet/in.h \
stddef.h \
stdlib.h \
string.h \
sys/socket.h \
sys/time.h \
unistd.h \
])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_SIZE_T
# POSIX types
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
# Checks for library functions.
AX_PTHREAD()
AC_CHECK_FUNCS([ \
clock_gettime \
gettimeofday \
memset \
socket \
strchr \
strerror \
strstr \
])
LIBS="$LIBS -lpthread"
AC_CONFIG_FILES([Makefile])
AC_OUTPUT