Set release details for 0.2.13
[quvi.git] / configure.ac
blob66a74cfb06270e86647c07eeb85f070af7d3504d
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ([2.68])
6 m4_include([m4/version.m4])
8 AC_INIT(
9     [quvi], [_QUVI_VERSION],
10     [http://sourceforge.net/apps/trac/quvi],
11     [],
12     [http://quvi.sourceforge.net/])
14 # Interface:
15 QUVI_CURRENT=_QUVI_CURRENT
16 QUVI_REVISION=_QUVI_REVISION
17 QUVI_AGE=_QUVI_AGE
18 AC_SUBST(QUVI_CURRENT)
19 AC_SUBST(QUVI_REVISION)
20 AC_SUBST(QUVI_AGE)
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])
27 AC_CANONICAL_SYSTEM
28 AC_GNU_SOURCE
30 AC_DEFINE_UNQUOTED([CANONICAL_TARGET], "$target", [...])
31 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [...])
33 AM_INIT_AUTOMAKE([-Wall -Werror foreign dist-bzip2 dist-xz])
35 LT_INIT()
36 LT_PREREQ([2.2])
38 # Host specific.
39 NO_UNDEFINED=
40 case "$host" in
41     *-*-mingw32* | *-*-cygwin*)
42         AC_DEFINE([HOST_W32], [1], [...])
43         host_w32=yes
44         if [ test x"$enable_shared" != "xno" ]; then
45             NO_UNDEFINED="-no-undefined"
46         fi
47     ;;
48 esac
49 EXTRA_LIBQUVI_LDFLAGS="$NO_UNDEFINED"
50 AC_SUBST(EXTRA_LIBQUVI_LDFLAGS)
52 # Checks for programs.
53 AC_PROG_AWK
54 AC_PROG_CC
55 AC_PROG_CXX
56 AC_PROG_LN_S
57 AC_PROG_INSTALL
58 AC_PROG_MAKE_SET
59 AC_PROG_MKDIR_P
61 AC_PATH_PROG(GENGETOPT, gengetopt, no)
62 AM_CONDITIONAL([HAVE_GENGETOPT], [test x"$GENGETOPT" != "xno"])
63 AC_SUBST(GENGETOPT)
65 AC_PATH_PROG(DOXYGEN, doxygen, no)
66 AM_CONDITIONAL([HAVE_DOXYGEN], [test x"$DOXYGEN" != "xno"])
67 AC_SUBST(DOXYGEN)
69 AC_PATH_PROG(PERL, perl, no)
70 AM_CONDITIONAL([HAVE_PERL], [test x"$PERL" != "xno"])
71 AC_SUBST(PERL)
73 have_pod_checker=no
74 AC_MSG_CHECKING([for Pod::Checker])
75 if [ $PERL -mPod::Checker >/dev/null 2>&1 ]; then
76     AC_MSG_RESULT([yes])
77     have_pod_checker=yes
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"])
83 AC_SUBST(POD2MAN)
85 AC_PATH_PROG(POD2HTML, pod2html, no)
86 AM_CONDITIONAL([HAVE_POD2HTML], [test x"$POD2HTML" != "xno"])
87 AC_SUBST(POD2HTML)
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'])
94     fi
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'])
104     fi
107 # Checks for libraries.
108 AM_ICONV
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)
114         ])
115     ])
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.
124 AC_TYPE_SIZE_T
125 AC_TYPE_UINT32_T
126 AC_TYPE_UINT64_T
127 AC_TYPE_UINT8_T
128 AC_CHECK_TYPES([ptrdiff_t])
130 # Checks for library functions.
131 if [ test x"$host_w32" = "xno" ]; then
132     AC_FUNC_MALLOC
133     AC_FUNC_REALLOC
135 AC_CHECK_FUNCS(
136 [memset strdup strstr strtol strerror strcspn getcwd strchr strrchr strspn])
137 AC_FUNC_STRTOD
139 have_asprintf=no
140 AC_CHECK_FUNCS([vasprintf], [
141     AC_CHECK_FUNCS([asprintf], [have_asprintf=yes])
143 AM_CONDITIONAL([NO_ASPRINTF], [test x"$have_asprintf" != "xyes"])
145 # --enable-quvi
146 AC_ARG_ENABLE([quvi],
147     [AS_HELP_STRING([--enable-quvi],
148         [build quvi command line tool@<:@default=yes@:>@])],
149     [],
150     [enable_quvi=yes])
151 AM_CONDITIONAL([ENABLE_QUVI], [test x"$enable_quvi" != "xno"])
153 # --enable-examples
154 AC_ARG_ENABLE([examples],
155     [AS_HELP_STRING([--enable-examples],
156         [build examples @<:@default=no@:>@])],
157     [],
158     [enable_examples=no])
159 AM_CONDITIONAL([ENABLE_EXAMPLES], [test x"$enable_examples" != "xno"])
161 # --enable-nsfw
162 AC_ARG_ENABLE([nsfw],
163     [AS_HELP_STRING([--enable-nsfw],
164         [build with adult website support @<:@default=no@:>@])],
165     [],
166     [enable_nsfw=no])
167 AM_CONDITIONAL([ENABLE_NSFW], [test x"$enable_nsfw" != "xno"])
169 if [ test x"$enable_nsfw" != "xno" ]; then
170     AC_DEFINE([ENABLE_NSFW], [1], [Define to enable nsfw])
173 # --enable-tests
174 AC_ARG_ENABLE([tests],
175     [AS_HELP_STRING([--enable-tests],
176         [enable tests @<:@default=no@:>@])],
177     [],
178     [enable_tests=no])
179 AM_CONDITIONAL([ENABLE_TESTS], [test x"$enable_tests" != "xno"])
181 # --enable-broken
182 AC_ARG_ENABLE([broken],
183     [AS_HELP_STRING([--enable-broken],
184         [build with broken website support @<:@default=no@:>@])],
185     [],
186     [enable_broken=no])
187 AM_CONDITIONAL([ENABLE_BROKEN], [test x"$enable_broken" != "xno"])
189 if [ test x"$enable_broken" != "xno" ]; then
190     AC_DEFINE([ENABLE_BROKEN], [1], [Define to enable broken support])
193 # --with-man
194 AC_ARG_WITH([man],
195     [AS_HELP_STRING([--with-man],
196         [install manual pages @<:@default=yes@:>@])],
197     [],
198     [with_man=yes])
199 AM_CONDITIONAL([WITH_MAN], [test x"$with_man" != "xno"])
201 # --with-doc
202 AC_ARG_WITH([doc],
203     [AS_HELP_STRING([--with-doc],
204         [install documentation @<:@default=yes@:>@])],
205     [],
206     [with_doc=yes])
207 AM_CONDITIONAL([WITH_DOC], [test x"$with_doc" != "xno"])
209 # GNU ld?
210 AM_CONDITIONAL([HAVE_GNU_LD], [test x"$with_gnu_ld" = "xyes"])
212 AC_CONFIG_FILES([
213     Makefile
214     include/Makefile
215     include/quvi/Makefile
216     include/quvi/quvi.h
217     lib/Makefile
218     man1/Makefile
219     share/Makefile
220     doc/Makefile
221     src/Makefile
222     examples/Makefile
223     tests/Makefile
224     tests/quviTest.pm
225     scripts/Makefile
226     libquvi.pc
227     doxygen.conf
230 AC_OUTPUT
232 AC_MSG_NOTICE([
234 Configured:
235     quvi version:   ${VERSION}  g:${git_describe}  b:${build_date}
236     host setup:     ${host}
237     compiler:       ${CC}
238     cflags:         ${CFLAGS}
239     prefix:         ${prefix}
241 Options:
242     build libquvi:  shared=${enable_shared} static=${enable_static}
243     build examples: ${enable_examples}
244     build quvi:     ${enable_quvi}
245     --
246     enable broken:  ${enable_broken}
247     enable tests:   ${enable_tests}
248     enable nsfw:    ${enable_nsfw}
249     --
250     install manual: ${with_man}
251     install docs:   ${with_doc}
254 #Other:
255 #    gengetopt:      ${GENGETOPT}
256 #    doxygen:        ${DOXYGEN}
257 #    perl:           ${PERL}
258 #    Pod::Checker:   ${have_pod_checker}
259 #    pod2man:        ${POD2MAN}
260 #    pod2html:       ${POD2HTML}