2 # Process this file with autoconf to produce a configure script.
6 m4_include([m4/version.m4])
9 [quvi], [_QUVI_VERSION],
10 [http://sourceforge.net/apps/trac/quvi],
12 [http://quvi.sourceforge.net/])
15 QUVI_CURRENT=_QUVI_CURRENT
16 QUVI_REVISION=_QUVI_REVISION
18 AC_SUBST(QUVI_CURRENT)
19 AC_SUBST(QUVI_REVISION)
22 AC_CONFIG_SRCDIR([lib/quvi.c])
23 AC_CONFIG_HEADERS([config.h])
24 AC_CONFIG_AUX_DIR([config.aux])
25 AC_CONFIG_MACRO_DIR([m4])
30 AC_DEFINE_UNQUOTED([CANONICAL_TARGET], "$target", [...])
31 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [...])
33 AM_INIT_AUTOMAKE([-Wall -Werror foreign dist-bzip2])
41 *-*-mingw32* | *-*-cygwin*)
42 AC_DEFINE([HOST_W32], [1], [...])
44 if [ test x"$enable_shared" != "xno" ]; then
45 NO_UNDEFINED="-no-undefined"
49 EXTRA_LIBQUVI_LDFLAGS="$NO_UNDEFINED"
50 AC_SUBST(EXTRA_LIBQUVI_LDFLAGS)
52 # Checks for programs.
61 AC_PATH_PROG(GENGETOPT, gengetopt, no)
62 AM_CONDITIONAL([HAVE_GENGETOPT], [test x"$GENGETOPT" != "xno"])
65 AC_PATH_PROG(DOXYGEN, doxygen, no)
66 AM_CONDITIONAL([HAVE_DOXYGEN], [test x"$DOXYGEN" != "xno"])
69 AC_PATH_PROG(PERL, perl, no)
70 AM_CONDITIONAL([HAVE_PERL], [test x"$PERL" != "xno"])
74 AC_MSG_CHECKING([for Pod::Checker])
75 if [ $PERL -mPod::Checker >/dev/null 2>&1 ]; then
79 AM_CONDITIONAL([HAVE_PERL_POD_CHECKER], [test x"$have_pod_checker" = "xyes"])
81 AC_PATH_PROG(POD2MAN, pod2man, no)
82 AM_CONDITIONAL([HAVE_POD2MAN], [test x"$POD2MAN" != "xno"])
85 AC_PATH_PROG(POD2HTML, pod2html, no)
86 AM_CONDITIONAL([HAVE_POD2HTML], [test x"$POD2HTML" != "xno"])
89 AC_PATH_PROG(DATE, date, no)
90 if [ test x"$DATE" != "xno" ]; then
91 build_date=`"$DATE" +%Y-%m-%d 2>/dev/null`
92 if [ test x"$build_date" != "x" ]; then
93 AC_DEFINE_UNQUOTED([BUILD_DATE], "$build_date", [We have 'date'])
97 AC_PATH_PROG(GIT, git, no)
98 if [ test x"$GIT" != "xno" ]; then
99 QUVI_BRANCH=_QUVI_BRANCH
100 git_describe=`"$GIT" describe "$QUVI_BRANCH" 2>/dev/null`
101 if [ test x"$git_describe" != "x" ]; then
102 AC_DEFINE_UNQUOTED([GIT_DESCRIBE],
103 "$git_describe", [We have 'git describe'])
107 # Checks for libraries.
109 PKG_CHECK_MODULES(libcurl, libcurl >= 7.18.0)
110 PKG_CHECK_MODULES(liblua, lua >= 5.1, [], [
111 PKG_CHECK_MODULES(liblua, lua51 >= 5.1, [], [
112 PKG_CHECK_MODULES(liblua, lua5.1 >= 5.1, [], [
113 PKG_CHECK_MODULES(liblua, lua-5.1 >= 5.1)
117 AM_SILENT_RULES([yes])
119 # Checks for header files.
120 AC_HEADER_STDC # `stdlib.h', `stdarg.h', `string.h', ...
121 AC_CHECK_HEADERS([memory.h stdint.h stdlib.h limits.h stddef.h])
123 # Checks for typedefs, structures, and compiler characteristics.
128 AC_CHECK_TYPES([ptrdiff_t])
130 # Checks for library functions.
131 if [ test x"$host_w32" = "xno" ]; then
136 [memset strdup strstr strtol strerror strcspn getcwd strchr strrchr strspn])
140 AC_CHECK_FUNCS([vasprintf], [
141 AC_CHECK_FUNCS([asprintf], [have_asprintf=yes])
143 AM_CONDITIONAL([NO_ASPRINTF], [test x"$have_asprintf" != "xyes"])
146 AC_CHECK_FUNCS([strupr], [have_strupr=yes])
147 AM_CONDITIONAL([NO_STRUPR], [test x"$have_strupr" != "xyes"])
150 AC_ARG_ENABLE([quvi],
151 [AS_HELP_STRING([--enable-quvi],
152 [build quvi command line tool@<:@default=yes@:>@])],
155 AM_CONDITIONAL([ENABLE_QUVI], [test x"$enable_quvi" != "xno"])
158 AC_ARG_ENABLE([examples],
159 [AS_HELP_STRING([--enable-examples],
160 [build examples @<:@default=no@:>@])],
162 [enable_examples=no])
163 AM_CONDITIONAL([ENABLE_EXAMPLES], [test x"$enable_examples" != "xno"])
166 AC_ARG_ENABLE([nsfw],
167 [AS_HELP_STRING([--enable-nsfw],
168 [build with adult website support @<:@default=no@:>@])],
171 AM_CONDITIONAL([ENABLE_NSFW], [test x"$enable_nsfw" != "xno"])
173 if [ test x"$enable_nsfw" != "xno" ]; then
174 AC_DEFINE([ENABLE_NSFW], [1], [Define to enable nsfw])
178 AC_ARG_ENABLE([tests],
179 [AS_HELP_STRING([--enable-tests],
180 [enable tests @<:@default=no@:>@])],
183 AM_CONDITIONAL([ENABLE_TESTS], [test x"$enable_tests" != "xno"])
186 AC_ARG_ENABLE([broken],
187 [AS_HELP_STRING([--enable-broken],
188 [build with broken website support @<:@default=no@:>@])],
191 AM_CONDITIONAL([ENABLE_BROKEN], [test x"$enable_broken" != "xno"])
193 if [ test x"$enable_broken" != "xno" ]; then
194 AC_DEFINE([ENABLE_BROKEN], [1], [Define to enable broken support])
199 [AS_HELP_STRING([--with-man],
200 [install manual pages @<:@default=yes@:>@])],
203 AM_CONDITIONAL([WITH_MAN], [test x"$with_man" != "xno"])
207 [AS_HELP_STRING([--with-doc],
208 [install documentation @<:@default=yes@:>@])],
211 AM_CONDITIONAL([WITH_DOC], [test x"$with_doc" != "xno"])
214 AM_CONDITIONAL([HAVE_GNU_LD], [test x"$with_gnu_ld" = "xyes"])
219 include/quvi/Makefile
235 AC_MSG_NOTICE([Configured to build quvi/libquvi:
237 quvi version: ${VERSION} g:$git_describe b:$build_date
239 install prefix: ${prefix}
244 build libquvi: shared=${enable_shared} static=${enable_static}
245 build quvi: ${enable_quvi}
246 build examples: ${enable_examples}
247 enable nsfw: ${enable_nsfw}
248 enable broken: ${enable_broken}
249 enable tests: ${enable_tests}
250 install manual: ${with_man}
251 install docs: ${with_doc}
255 # gengetopt: ${GENGETOPT}
256 # doxygen: ${DOXYGEN}
258 # Pod::Checker: ${have_pod_checker}
259 # pod2man: ${POD2MAN}
260 # pod2html: ${POD2HTML}