-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
61 lines (49 loc) · 1.61 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
AC_PREREQ([2.63])
AC_INIT([libnss-dbng], [0.5.1], [[email protected]])
AM_INIT_AUTOMAKE
LT_INIT([dlopen])
AC_CONFIG_SRCDIR([lib/dbng.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_PATH_PROG([VALGRIND], [valgrind])
AC_PATH_PROG([BASH], [bash])
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AM_PROG_CC_C_O
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h syslog.h unistd.h])
AC_ARG_VAR([DEFAULT_BASE], [default base for database files])
if test -z ${DEFAULT_BASE}; then
DEFAULT_BASE="${localstatedir}/dbng"
fi
AC_ARG_VAR([TEST_BASE], [test base for database files])
if test -z ${TEST_BASE}; then
TEST_BASE="/tmp/"
fi
AC_ARG_VAR([MIN_UID], [minimum UID for database update/read operations])
if test -z ${MIN_UID}; then
MIN_UID=0
fi
AC_ARG_VAR([MIN_GID], [minimum GID for database update/read operations])
if test -z ${MIN_GID}; then
MIN_GID=0
fi
AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [build the library in debug mode])],
[debug=yes], [debug=no])
if test "x${debug}" = xyes; then
AC_DEFINE([DEBUG], [1], [Debug mode])
fi
have_bdb=no
AC_SEARCH_LIBS([db_env_create], [db-5.3 db5 db4 db], [have_bdb=yes])
if test "x${have_bdb}" = xyes; then
AC_CHECK_HEADERS([db5/db.h db4/db.h db.h], [have_bdb=yes;break], [have_bdb=no])
fi
if test "x${have_bdb}" = xyes; then
AC_DEFINE([HAVE_LIBDB], [1], [Berkeley DB development library])
else
AC_MSG_FAILURE([libdb is required])
fi
AC_CHECK_FUNCS([strerror])
AC_CONFIG_FILES([Makefile lib/Makefile nss/Makefile check/Makefile dbngctl/Makefile check/test-wrapper check/test_dbngctl.sh])
AC_OUTPUT