Modify backend to use new auth cookie format
[blerg.git] / configure.in
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ([2.65])
5 AC_INIT(config.h)
6 AM_INIT_AUTOMAKE([blerg], [1.7])
7 AC_PROG_RANLIB
8 AC_CONFIG_SRCDIR([common/app.c])
9 AC_CONFIG_HEADERS([config.h])
10
11 # Checks for programs.
12 AC_PROG_CC
13 AM_PROG_CC_C_O
14 PKG_PROG_PKG_CONFIG
15
16 # Checks for libraries.
17 AC_CHECK_LIB([pthread], [main])
18 AX_CHECK_YAJL
19 AX_CHECK_CGIUTIL
20 # blerg.httpd deprecated
21 #PKG_CHECK_MODULES([MICROHTTPD], [libmicrohttpd])
22 #AC_SUBST([MICROHTTPD_CFLAGS])
23 #AC_SUBST([MICROHTTPD_LIBS])
24
25
26 # Checks for header files.
27 AC_CHECK_HEADERS([fcntl.h memory.h stdint.h stdlib.h string.h sys/file.h unistd.h])
28
29 # Checks for typedefs, structures, and compiler characteristics.
30 AC_TYPE_SIZE_T
31 AC_TYPE_SSIZE_T
32 AC_TYPE_UINT16_T
33 AC_TYPE_UINT32_T
34 AC_TYPE_UINT64_T
35
36 # Checks for library functions.
37 AC_FUNC_MALLOC
38 AC_FUNC_MMAP
39 AC_FUNC_REALLOC
40 AC_CHECK_FUNCS([ftruncate memset mkdir munmap select strchr strtoull])
41
42 # Needed variables for programs to function...
43 AC_ARG_WITH([blerg-path],
44 AC_HELP_STRING([--with-blerg-path=@<:@DIR@:>@],
45 [Base directory for database default=/var/lib/blerg]
46 ),  
47 [
48 if test "$withval" != "no"; then
49         AC_DEFINE_UNQUOTED([DATA_PATH], ["$withval"], [Base data directory])
50 else
51         AC_MSG_ERROR(blerg-path MUST be defined)
52 fi
53 ],
54 [AC_DEFINE([BLERG_PATH], ["/var/lib/blerg"], [Base data directory])]
55 )
56
57 AC_ARG_WITH([blerg-data-path],
58 AC_HELP_STRING([--with-blerg-data-path=@<:@DIR@:>@],
59 [Where account data will be stored default=data]
60 ),  
61 [
62 if test "$withval" != "no"; then
63         AC_DEFINE_UNQUOTED([DATA_PATH], ["$withval"], [Where account data is located])
64 else
65         AC_MSG_ERROR(blerg-data-path MUST be defined)
66 fi
67 ],
68 [AC_DEFINE([DATA_PATH], ["data"], [Where data is located])]
69 )
70
71 AC_ARG_WITH([blerg-hash-tags-path],
72 AC_HELP_STRING([--with-blerg-hash-tags-path=@<:@DIR@:>@],
73 [Where hash tags files will be stored default=hash_tags]
74 ),  
75 [
76 if test "$withval" != "no"; then
77         AC_DEFINE_UNQUOTED([HASH_TAGS_PATH], ["$withval"], [Where tags will be saved])
78 else
79         AC_MSG_ERROR(blerg-hash-tags-path MUST be defined)
80 fi
81 ],
82 [AC_DEFINE([HASH_TAGS_PATH], ["hash_tags"], [Where tags will be saved])]
83 )
84
85
86 AC_ARG_WITH([blerg-ref-tags-path],
87 AC_HELP_STRING([--with-blerg-ref-tags-path=@<:@DIR@:>@],
88 [Where ref tags files will be stored default=ref_tags]
89 ),  
90 [
91 if test "$withval" != "no"; then
92         AC_DEFINE_UNQUOTED([REF_TAGS_PATH], ["$withval"], [Where refs will be saved])
93 else
94         AC_MSG_ERROR(blerg-ref-tags-path MUST be defined)
95 fi
96 ],
97 [AC_DEFINE([REF_TAGS_PATH], ["ref_tags"], [Where reffering tags will be save])]
98 )
99
100 AC_ARG_WITH([blerg-baseurl],
101 AC_HELP_STRING([--with-blerg-baseurl=@<:@URL@:>@],
102 [Baseurl is used for generating urls from cgi default=http://blerg.dominionofawesome.com/]
103 ),  
104 [
105 if test "$withval" != "no"; then
106         AC_DEFINE_UNQUOTED([BASEURL], ["$withval"], [Base url for cgi])
107 else
108         AC_MSG_ERROR(blerg-baseurl MUST be defined)
109 fi
110 ],
111 [AC_DEFINE([BASEURL], ["http://blerg.dominionofawesome.com/"], [Base URL for this blerg instance])]
112 )
113
114 AC_ARG_WITH([blerg-http-port],
115 AC_HELP_STRING([--with-blerg-http-port=@<:@INT@:>@],
116 [Listening port number default=8080]
117 ),  
118 [
119 if test "$withval" != "no"; then
120         AC_DEFINE_UNQUOTED([HTTP_BLERG_PORT], [$withval], [Port number for blerg.http])
121 else
122         AC_MSG_ERROR(blerg-http-port MUST be defined)
123 fi
124 ],
125 [AC_DEFINE([HTTP_BLERG_PORT], [8080], [Blerg listening port])]
126 )
127
128 AC_ARG_WITH([blerg-records-per-segment],
129 AC_HELP_STRING([--with-blerg-records-per-segment=@<:@INT@:>@],
130 [Records per segment default=65536]
131 ),  
132 [
133 if test "$withval" != "no"; then
134         AC_DEFINE_UNQUOTED([RECORDS_PER_SEGMENT], [$withval], [Database setting])
135 else
136         AC_MSG_ERROR(blerg-records-per-segment MUST be defined)
137 fi
138 ],
139 [AC_DEFINE([RECORDS_PER_SEGMENT], [65536], [Database settings])]
140 )
141
142 AC_ARG_WITH([blerg-max-record-size],
143 AC_HELP_STRING([--with-blerg-max-record-size=@<:@INT@:>@],
144 [Max record size default=65535]
145 ),  
146 [
147 if test "$withval" != "no"; then
148         AC_DEFINE_UNQUOTED([MAX_RECORD_SIZE], [$withval], [Database setting])
149 else
150         AC_MSG_ERROR(blerg-max-record-size MUST be defined)
151 fi
152 ],
153 [AC_DEFINE([MAX_RECORD_SIZE], [65535], [No greater than 65535])]
154 )
155
156 AC_ARG_WITH([blerg-max-tag-length],
157 AC_HELP_STRING([--with-blerg-max-tag-length=@<:@INT@:>@],
158 [Max size of tag default=64]
159 ),  
160 [
161 if test "$withval" != "no"; then
162         AC_DEFINE_UNQUOTED([MAX_TAG_LENGTH], [$withval], [Length of tags])
163 else
164         AC_MSG_ERROR(blerg-max-tag-length MUST be defined)
165 fi
166 ],
167 [AC_DEFINE([MAX_TAG_LENGTH], [64],[Length of tags])]
168 )
169
170 AC_ARG_WITH([blerg-max-tags-per-record],
171 AC_HELP_STRING([--with-blerg-max-tags-per-record=@<:@INT@:>@],
172 [Number of tags per record default=1024]
173 ),  
174 [
175 if test "$withval" != "no"; then
176         AC_DEFINE_UNQUOTED([MAX_TAGS_PER_RECORD], [$withval], [Tags per record])
177 else
178         AC_MSG_ERROR(blerg-max-tags-per-record MUST be defined)
179 fi
180 ],
181 [AC_DEFINE([MAX_TAGS_PER_RECORD], [1024],[Tags per record])]
182 )
183
184 AC_ARG_WITH([cgi-bin-dir],
185 AC_HELP_STRING([--with-cgi-bin-dir=@<:@DIR@:>@],
186 [Path where to install cgi programs default=/srv/www/cgi-bin]
187 ),  
188 [
189 if test "$withval" != "no"; then
190         CGIBINDIR="$withval"
191 else
192         AC_MSG_ERROR(cgi-bin-dir MUST be set)
193 fi
194 ],
195 [CGIBINDIR="/srv/www/cgi-bin/"]
196 )
197
198 AC_SUBST(CGIBINDIR)
199
200 AC_CONFIG_FILES([Makefile])
201 AC_OUTPUT