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
|
AC_INIT([assignment-list-tui], [0.1], [lshprung@tutanota.com])
AC_CONFIG_SRCDIR([src/group.h])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
AX_WITH_CURSES
if test "x$ax_cv_curses" != xyes; then
AC_MSG_ERROR([requires an X/Open-compatible Curses library])
fi
AX_LIB_SQLITE3
# TODO consider erroring out if sqlite3 does not exist
# Checks for header files.
AC_CHECK_HEADERS([unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
# Checks for library functions.
#AC_CHECK_FUNCS([mkdir])
# Setting default buffer size
bufsize=1024
AC_ARG_ENABLE([custom-bufsize],
[AS_HELP_STRING([--enable-custom-bufsize],
[set buffer size (default is 1024)])],
[bufsize=$enableval])
AC_DEFINE_UNQUOTED([BUF_LEN], [${bufsize}], ["Buffer Size"])
# Setting default user data dir and file name
default_user_data_dir="$HOME/.local/share/${PACKAGE_NAME}"
AC_DEFINE_UNQUOTED([USER_DATA_DIR], ["${default_user_data_dir}"], ["User Data Directory"])
default_user_data_path="${default_user_data_dir}/data.db"
AC_DEFINE_UNQUOTED([USER_DATA_PATH], ["${default_user_data_path}"], ["User Data Path"])
# Setting default db to use
default_db="sqlite3"
AC_DEFINE_UNQUOTED([DB], ["${default_db}"], ["Default Database to use"])
AC_SUBST([default_db], [${default_db}])
AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_OUTPUT
# Print helpful message
cat << EOF
** Configuration summary for ${PACKAGE_NAME} ${PACKAGE_VERSION}
Prefix: ${prefix}
Compiler: ${CC} ${CFLAGS} ${CPPFLAGS}
Libraries: ${LIBS}
Buffer Size: ${bufsize}
Default User Data Dir: ${default_user_data_dir}
Database: ${default_db}
EOF
|