2 # Process this file with autoconf to produce a configure script.
6 AM_INIT_AUTOMAKE([blerg], [1.7])
8 AC_CONFIG_SRCDIR([common/app.c])
9 AC_CONFIG_HEADERS([config.h])
11 # Checks for programs.
16 # Checks for libraries.
17 AC_CHECK_LIB([pthread], [main])
20 # blerg.httpd deprecated
21 #PKG_CHECK_MODULES([MICROHTTPD], [libmicrohttpd])
22 #AC_SUBST([MICROHTTPD_CFLAGS])
23 #AC_SUBST([MICROHTTPD_LIBS])
26 # Checks for header files.
27 AC_CHECK_HEADERS([fcntl.h memory.h stdint.h stdlib.h string.h sys/file.h unistd.h])
29 # Checks for typedefs, structures, and compiler characteristics.
36 # Checks for library functions.
40 AC_CHECK_FUNCS([ftruncate memset mkdir munmap select strchr strtoull])
42 # Needed variables for programs to function...
43 AC_ARG_WITH([blerg-data-path],
44 AC_HELP_STRING([--with-blerg-data-path=@<:@DIR@:>@],
45 [Where database files will be stored default=data]
48 if test "$withval" != "no"; then
49 AC_DEFINE_UNQUOTED([DATA_PATH], ["$withval"], [Where data is located])
51 AC_MSG_ERROR(blerg-data-path MUST be defined)
54 [AC_DEFINE([DATA_PATH], ["data"], [Where data is located])]
57 AC_ARG_WITH([blerg-hash-tags-path],
58 AC_HELP_STRING([--with-blerg-hash-tags-path=@<:@DIR@:>@],
59 [Where hash tags files will be stored default=hash_tags]
62 if test "$withval" != "no"; then
63 AC_DEFINE_UNQUOTED([HASH_TAGS_PATH], ["$withval"], [Where tags will be saved])
65 AC_MSG_ERROR(blerg-hash-tags-path MUST be defined)
68 [AC_DEFINE([HASH_TAGS_PATH], ["hash_tags"], [Where tags will be saved])]
72 AC_ARG_WITH([blerg-ref-tags-path],
73 AC_HELP_STRING([--with-blerg-ref-tags-path=@<:@DIR@:>@],
74 [Where ref tags files will be stored default=ref_tags]
77 if test "$withval" != "no"; then
78 AC_DEFINE_UNQUOTED([REF_TAGS_PATH], ["$withval"], [Where refs will be saved])
80 AC_MSG_ERROR(blerg-ref-tags-path MUST be defined)
83 [AC_DEFINE([REF_TAGS_PATH], ["ref_tags"], [Where reffering tags will be save])]
86 AC_ARG_WITH([blerg-baseurl],
87 AC_HELP_STRING([--with-blerg-baseurl=@<:@URL@:>@],
88 [Baseurl is used for generating urls from cgi default=http://blerg.dominionofawesome.com/]
91 if test "$withval" != "no"; then
92 AC_DEFINE_UNQUOTED([BASEURL], ["$withval"], [Base url for cgi])
94 AC_MSG_ERROR(blerg-baseurl MUST be defined)
97 [AC_DEFINE([BASEURL], ["http://blerg.dominionofawesome.com/"], [Base URL for this blerg instance])]
100 AC_ARG_WITH([blerg-http-port],
101 AC_HELP_STRING([--with-blerg-http-port=@<:@INT@:>@],
102 [Listening port number default=8080]
105 if test "$withval" != "no"; then
106 AC_DEFINE_UNQUOTED([HTTP_BLERG_PORT], [$withval], [Port number for blerg.http])
108 AC_MSG_ERROR(blerg-http-port MUST be defined)
111 [AC_DEFINE([HTTP_BLERG_PORT], [8080], [Blerg listening port])]
114 AC_ARG_WITH([blerg-records-per-segment],
115 AC_HELP_STRING([--with-blerg-records-per-segment=@<:@INT@:>@],
116 [Records per segment default=65536]
119 if test "$withval" != "no"; then
120 AC_DEFINE_UNQUOTED([RECORDS_PER_SEGMENT], [$withval], [Database setting])
122 AC_MSG_ERROR(blerg-records-per-segment MUST be defined)
125 [AC_DEFINE([RECORDS_PER_SEGMENT], [65536], [Database settings])]
128 AC_ARG_WITH([blerg-max-record-size],
129 AC_HELP_STRING([--with-blerg-max-record-size=@<:@INT@:>@],
130 [Max record size default=65535]
133 if test "$withval" != "no"; then
134 AC_DEFINE_UNQUOTED([MAX_RECORD_SIZE], [$withval], [Database setting])
136 AC_MSG_ERROR(blerg-max-record-size MUST be defined)
139 [AC_DEFINE([MAX_RECORD_SIZE], [65535], [No greater than 65535])]
142 AC_ARG_WITH([blerg-max-tag-length],
143 AC_HELP_STRING([--with-blerg-max-tag-length=@<:@INT@:>@],
144 [Max size of tag default=64]
147 if test "$withval" != "no"; then
148 AC_DEFINE_UNQUOTED([MAX_TAG_LENGTH], [$withval], [Length of tags])
150 AC_MSG_ERROR(blerg-max-tag-length MUST be defined)
153 [AC_DEFINE([MAX_TAG_LENGTH], [64],[Length of tags])]
156 AC_ARG_WITH([blerg-max-tags-per-record],
157 AC_HELP_STRING([--with-blerg-max-tags-per-record=@<:@INT@:>@],
158 [Number of tags per record default=1024]
161 if test "$withval" != "no"; then
162 AC_DEFINE_UNQUOTED([MAX_TAGS_PER_RECORD], [$withval], [Tags per record])
164 AC_MSG_ERROR(blerg-max-tags-per-record MUST be defined)
167 [AC_DEFINE([MAX_TAGS_PER_RECORD], [1024],[Tags per record])]
170 AC_ARG_WITH([cgi-bin-dir],
171 AC_HELP_STRING([--with-cgi-bin-dir=@<:@DIR@:>@],
172 [Path where to install cgi programs default=/srv/www/cgi-bin]
175 if test "$withval" != "no"; then
178 AC_MSG_ERROR(cgi-bin-dir MUST be set)
181 [CGIBINDIR="/srv/www/cgi-bin/"]
186 AC_CONFIG_FILES([Makefile])