2 # Process this file with autoconf to produce a configure script.
6 AM_INIT_AUTOMAKE([blerg], [1.6])
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 PKG_CHECK_MODULES([MICROHTTPD], [libmicrohttpd])
21 AC_SUBST([MICROHTTPD_CFLAGS])
22 AC_SUBST([MICROHTTPD_LIBS])
25 # Checks for header files.
26 AC_CHECK_HEADERS([fcntl.h memory.h stdint.h stdlib.h string.h sys/file.h unistd.h])
28 # Checks for typedefs, structures, and compiler characteristics.
35 # Checks for library functions.
39 AC_CHECK_FUNCS([ftruncate memset mkdir munmap select strchr strtoull])
41 # Needed variables for programs to function...
42 AC_ARG_WITH([blerg-data-path],
43 AC_HELP_STRING([--with-blerg-data-path=@<:@DIR@:>@],
44 [Where database files will be stored default=data]
47 if test "$withval" != "no"; then
48 AC_DEFINE_UNQUOTED([DATA_PATH], ["$withval"], [Where data is located])
50 AC_MSG_ERROR(blerg-data-path MUST be defined)
53 [AC_DEFINE([DATA_PATH], ["data"], [Where data is located])]
56 AC_ARG_WITH([blerg-hash-tags-path],
57 AC_HELP_STRING([--with-blerg-hash-tags-path=@<:@DIR@:>@],
58 [Where hash tags files will be stored default=hash_tags]
61 if test "$withval" != "no"; then
62 AC_DEFINE_UNQUOTED([HASH_TAGS_PATH], ["$withval"], [Where tags will be saved])
64 AC_MSG_ERROR(blerg-hash-tags-path MUST be defined)
67 [AC_DEFINE([HASH_TAGS_PATH], ["hash_tags"], [Where tags will be saved])]
71 AC_ARG_WITH([blerg-ref-tags-path],
72 AC_HELP_STRING([--with-blerg-ref-tags-path=@<:@DIR@:>@],
73 [Where ref tags files will be stored default=ref_tags]
76 if test "$withval" != "no"; then
77 AC_DEFINE_UNQUOTED([REF_TAGS_PATH], ["$withval"], [Where refs will be saved])
79 AC_MSG_ERROR(blerg-ref-tags-path MUST be defined)
82 [AC_DEFINE([REF_TAGS_PATH], ["ref_tags"], [Where reffering tags will be save])]
85 AC_ARG_WITH([blerg-baseurl],
86 AC_HELP_STRING([--with-blerg-baseurl=@<:@URL@:>@],
87 [Baseurl is used for generating urls from cgi default=http://blerg.dominionofawesome.com/]
90 if test "$withval" != "no"; then
91 AC_DEFINE_UNQUOTED([BASEURL], ["$withval"], [Base url for cgi])
93 AC_MSG_ERROR(blerg-baseurl MUST be defined)
96 [AC_DEFINE([BASEURL], ["http://blerg.dominionofawesome.com/"], [Base URL for this blerg instance])]
99 AC_ARG_WITH([blerg-http-port],
100 AC_HELP_STRING([--with-blerg-http-port=@<:@INT@:>@],
101 [Listening port number default=8080]
104 if test "$withval" != "no"; then
105 AC_DEFINE_UNQUOTED([HTTP_BLERG_PORT], [$withval], [Port number for blerg.http])
107 AC_MSG_ERROR(blerg-http-port MUST be defined)
110 [AC_DEFINE([HTTP_BLERG_PORT], [8080], [Blerg listening port])]
113 AC_ARG_WITH([blerg-records-per-segment],
114 AC_HELP_STRING([--with-blerg-records-per-segment=@<:@INT@:>@],
115 [Records per segment default=65536]
118 if test "$withval" != "no"; then
119 AC_DEFINE_UNQUOTED([RECORDS_PER_SEGMENT], [$withval], [Database setting])
121 AC_MSG_ERROR(blerg-records-per-segment MUST be defined)
124 [AC_DEFINE([RECORDS_PER_SEGMENT], [65536], [Database settings])]
127 AC_ARG_WITH([blerg-max-record-size],
128 AC_HELP_STRING([--with-blerg-max-record-size=@<:@INT@:>@],
129 [Max record size default=65535]
132 if test "$withval" != "no"; then
133 AC_DEFINE_UNQUOTED([MAX_RECORD_SIZE], [$withval], [Database setting])
135 AC_MSG_ERROR(blerg-max-record-size MUST be defined)
138 [AC_DEFINE([MAX_RECORD_SIZE], [65535], [No greater than 65535])]
141 AC_ARG_WITH([blerg-max-tag-length],
142 AC_HELP_STRING([--with-blerg-max-tag-length=@<:@INT@:>@],
143 [Max size of tag default=64]
146 if test "$withval" != "no"; then
147 AC_DEFINE_UNQUOTED([MAX_TAG_LENGTH], [$withval], [Length of tags])
149 AC_MSG_ERROR(blerg-max-tag-length MUST be defined)
152 [AC_DEFINE([MAX_TAG_LENGTH], [64],[Length of tags])]
155 AC_ARG_WITH([blerg-max-tags-per-record],
156 AC_HELP_STRING([--with-blerg-max-tags-per-record=@<:@INT@:>@],
157 [Number of tags per record default=1024]
160 if test "$withval" != "no"; then
161 AC_DEFINE_UNQUOTED([MAX_TAGS_PER_RECORD], [$withval], [Tags per record])
163 AC_MSG_ERROR(blerg-max-tags-per-record MUST be defined)
166 [AC_DEFINE([MAX_TAGS_PER_RECORD], [1024],[Tags per record])]
169 AC_ARG_WITH([cgi-bin-dir],
170 AC_HELP_STRING([--with-cgi-bin-dir=@<:@DIR@:>@],
171 [Path where to install cgi programs default=/srv/www/cgi-bin]
174 if test "$withval" != "no"; then
177 AC_MSG_ERROR(cgi-bin-dir MUST be set)
180 [CGIBINDIR="/srv/www/cgi-bin/"]
185 AC_CONFIG_FILES([Makefile])