-
Notifications
You must be signed in to change notification settings - Fork 4
/
dsnpd-configure.in
93 lines (76 loc) · 3.13 KB
/
dsnpd-configure.in
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
89
90
91
92
93
dnl Copyright (c) 2008-2011, Adrian Thurston <[email protected]>
dnl
dnl Permission to use, copy, modify, and/or distribute this software for any
dnl purpose with or without fee is hereby granted, provided that the above
dnl copyright notice and this permission notice appear in all copies.
dnl
dnl THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
dnl WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
dnl ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_INIT(dsnpd/main.cc)
AC_CONFIG_HEADER(dsnpd/config.h)
dnl Checks for programs.
AC_PROG_CXX
AC_LANG_C
dnl Check for definition of MAKE.
AC_PROG_MAKE_SET
dnl Need ragel to build.
dnl FIXME: distribute the ragel-generated code with the tarball.
AC_CHECK_PROG(RAGEL, ragel, ragel)
if test -z "$RAGEL"; then
AC_ERROR([ragel not found])
fi
AC_CHECK_HEADER([pthread.h], [], AC_ERROR([pthread.h not found]))
AC_CHECK_LIB(pthread, pthread_create, [], AC_ERROR([libpthread not found]))
LDFLAGS="${LDFLAGS} -L/usr/lib/mysql"
AC_CHECK_HEADER([mysql/mysql.h], [], AC_ERROR([mysql/mysql.h not found]))
AC_CHECK_LIB(mysqlclient, mysql_init, [], AC_ERROR([libmysqlclient not found]))
AC_CHECK_HEADER([openssl/ssl.h], [], AC_ERROR([openssl/ssl.h not found]))
AC_CHECK_LIB(ssl, SSL_new, [], AC_ERROR([libssl not found]))
AC_ARG_WITH(dsnpd-user,
[ --with-dsnpd-user=who user the dsnpd should run as (default is dsnpd)],
[DSNPD_USER="$withval"], [DSNPD_USER="dsnpd"] )
AC_ARG_WITH(dsnpk-user,
[ --with-dsnpk-user=who user the dsnp key agent should run as (default is dsnpk)],
[DSNPK_USER="$withval"], [DSNPK_USER="dsnpk"] )
AC_ARG_WITH(notif-user,
[ --with-notif-user=who user the notification callback should run as (default is www-data)],
[NOTIF_USER="$withval"], [NOTIF_USER="www-data"] )
AC_SUBST(NOTIF_USER)
AC_SUBST(DSNPD_USER)
AC_SUBST(DSNPK_USER)
CA_CERT_FILE=""
AC_ARG_WITH(ca-cert-file,
[ --with-ca-cert-file=file location of the certificate authority cert list],
[WITH_CA_CERT_FILE="$withval"],
[AC_CHECK_FILE(/etc/ssl/certs/ca-certificates.crt,
[WITH_CA_CERT_FILE=/etc/ssl/certs/ca-certificates.crt], [])
])
if test -n "$WITH_CA_CERT_FILE"; then
if test \! -f "$WITH_CA_CERT_FILE"; then
AC_ERROR([$WITH_CA_CERT_FILE does not exist])
fi
CA_CERT_FILE="$WITH_CA_CERT_FILE";
else
AC_ERROR([could not guess default for --with-ca-cert-file, please specify it])
fi
AC_SUBST(CA_CERT_FILE)
AC_ARG_WITH(pid-dir,
[ --with-pid-dir=dir directory to put the pid file],
[PID_DIR="$withval"],
[PID_DIR=${localstatedir}/run])
AC_SUBST(PID_DIR)
AC_ARG_ENABLE(debug,
[ --enable-debug Enable debug statements],
[ENABLE_DEBUG=1],
[ENABLE_DEBUG=0])
AC_SUBST(ENABLE_DEBUG)
dnl
dnl Write Output Files
dnl
AC_OUTPUT(Makefile doc/Makefile etc/Makefile db/Makefile dsnpd/Makefile choice/Makefile)
echo "configuration of DSNPd complete"