-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
87 lines (78 loc) · 2.3 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
AC_PREREQ([2.63])
AC_INIT([stu], [0.1.0], [[email protected]])
AC_USE_SYSTEM_EXTENSIONS
AM_INIT_AUTOMAKE
LT_INIT([dlopen])
AC_CONFIG_SRCDIR([src/libstu/stu.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
PKG_INSTALLDIR
AC_PROG_CC
AC_PROG_INSTALL
AC_CHECK_FUNCS([strdup])
AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_HEADERS([string.h])
AC_CHECK_HEADERS([stdbool.h])
AC_CHECK_HEADERS([unistd.h])
AC_PATH_PROG([POD2MAN], [pod2man])
AC_PATH_PROG([POD2HTML], [pod2html])
AC_PATH_PROG([VALGRIND], [valgrind])
AC_PATH_PROG([DIFF], [diff])
AC_PATH_PROG([BASENAME], [basename])
AC_PATH_PROG([BASH], [bash])
AC_PATH_PROG([PERL], [perl])
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_PROG_LEX
AC_PROG_YACC
AC_TYPE_SIZE_T
AM_PROG_CC_C_O
AC_FUNC_STRNLEN
# Documentation generation.
AC_ARG_VAR([DOC_CSS], [CSS styles for HTML documentation])
AS_IF([test -z ${DOC_CSS}], [DOC_CSS="man.css"])
# Memory allocation configuration.
AC_ARG_VAR([ALLOCATOR], [Memory allocator module])
AS_IF([test -z ${ALLOCATOR} -o "x${ALLOCATOR}" = "xsystem" ], [
AC_DEFINE([ALLOC_SYSTEM], 1, [use standard system allocator])
])
AS_IF([test "x${ALLOCATOR}" = "xslab" ], [
AC_DEFINE([ALLOC_SLAB], 1, [use slab memory allocator])
])
# Only relevant if the slab allocator is specified above.
AC_ARG_VAR([SLAB_SIZE], [Default slab size for the slab allocator])
AS_IF([test -z $SLAB_SIZE], [
AC_DEFINE([SLAB_SIZE], 1000, [slab allocator slab size])
], [
AC_DEFINE_UNQUOTED([SLAB_SIZE], $SLAB_SIZE, [slab allocator slab size])
])
AC_ARG_VAR([GC_THRESHOLD], [Number of allocations before a gc])
AS_IF([test -z $GC_THRESHOLD], [
AC_DEFINE([GC_THRESHOLD], 1000, [number of allocations before a gc])
], [
AC_DEFINE_UNQUOTED([GC_THRESHOLD], $GC_THRESHOLD, [number of allocations before a gc])
])
# Readline support for repl.
PKG_CHECK_MODULES([LIBEDIT], [libedit])
AC_CHECK_HEADERS([editline/readline.h])
AC_CHECK_HEADERS([histedit.h])
CFLAGS="${CFLAGS} ${LIBEDIT_CFLAGS}"
LIBS="${LIBS} ${LIBEDIT_LIBS}"
AC_CONFIG_FILES([
Makefile
src/Makefile
src/repl/Makefile
src/studoc/Makefile
src/libstu/Makefile
src/libstu/alloc/Makefile
src/libstu/libstu.pc
check/Makefile
docs/Makefile
])
# Executables
AC_CONFIG_FILES([
check/runner.sh
check/test_prog_runner.sh
docs/extract_pod.pl
], [chmod +x check/*.sh docs/*.pl])
AC_OUTPUT