API: Return URLs in escaped (percent-encoded) form
[libquvi.git] / configure.ac
blobac84b29a72b7093a78f0e50ff0111323b39679fb
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ([2.69])
6 m4_include([m4/version.m4])
8 AC_INIT([libquvi], m4_esyscmd([./gen-ver.sh -c | tr -d '\n']),
9         [http://quvi.sf.net/bugs/],[],[http://quvi.sf.net/])
11 AC_DEFINE_UNQUOTED([BUILD_OPTS], "$@",
12   [Define to configure invocation command line options])
14 # Interface
15 LT_CUR=libquvi_lt_cur
16 LT_REV=libquvi_lt_rev
17 LT_AGE=libquvi_lt_age
18 AC_SUBST([LT_CUR])
19 AC_SUBST([LT_REV])
20 AC_SUBST([LT_AGE])
22 AC_CONFIG_SRCDIR([src/api/new.c])
23 AC_CONFIG_HEADERS([config.h])
24 AC_CONFIG_AUX_DIR([config.aux])
25 AC_CONFIG_MACRO_DIR([m4])
27 AC_CANONICAL_TARGET
28 AC_USE_SYSTEM_EXTENSIONS
30 AC_DEFINE_UNQUOTED([CANONICAL_TARGET], "$target",
31   [Define to canonical target])
32 AC_DEFINE_UNQUOTED([CANONICAL_BUILD], "$build",
33   [Define to canonical build])
34 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host",
35   [Define to canonical host])
37 # GNU Automake 1.13 spews a warning about AM_GNU_GETTEXT (0.18.1,
38 # 0.18.2) using the deprecated AM_PROG_MKDIR_P macro. Do not specify
39 # '-Werror` in the options to work around this.
40 AM_INIT_AUTOMAKE([1.11.1 -Wall dist-xz no-dist-gzip tar-ustar])
41 AM_SILENT_RULES([yes])
43 # GNU Automake 1.12 requires this macro. Earlier versions do not
44 # recognize this macro. Work around this.
45 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
47 AM_GNU_GETTEXT_VERSION([0.18.1])
48 AM_GNU_GETTEXT([external])
49 # GETTEXT_PACKAGE is used by glib.
50 AC_DEFINE([GETTEXT_PACKAGE], [PACKAGE], [Define to the gettext package name])
51 AC_SUBST([GETTEXT_PACKAGE], [PACKAGE])
53 LT_INIT([disable-static])
54 LT_PREREQ([2.2.6])
56 # Checks for programs.
57 AC_PROG_CC
58 AM_PROG_CC_C_O
60 AC_DEFINE_UNQUOTED([CFLAGS], "$CFLAGS", [Define to compiler flags])
61 AC_DEFINE_UNQUOTED([CC], "$CC", [Define to compiler])
63 AC_PATH_PROG([DOXYGEN], [doxygen], [no])
64 AM_CONDITIONAL([HAVE_DOXYGEN], [test x"$DOXYGEN" != "xno"])
65 AC_SUBST([DOXYGEN])
67 AC_PATH_PROG([A2X], [a2x], [no])
68 AM_CONDITIONAL([HAVE_A2X], [test x"$A2X" != "xno"])
69 AC_SUBST([A2X])
70 AS_IF([test x"$A2X" = "xno" && test -d "$srcdir/.git"],
71   AC_MSG_ERROR([a2x is required to create man pages when building from git])])
73 AC_PATH_PROG([DATE], [date], [no])
74 AS_IF([test x"$DATE" != "xno"], [build_time=`$DATE +"%F %T %z"`])
75 AC_DEFINE_UNQUOTED([BUILD_TIME], ["$build_time"], [We have build time])
77 BUILD_TIME="$build_time"
78 AC_SUBST([BUILD_TIME])
80 AC_PATH_PROG([VALGRIND], [valgrind], [no])
81 AM_CONDITIONAL([HAVE_VALGRIND], [test x"$VALGRIND" != "xno"])
82 AC_SUBST([VALGRIND])
84 # Checks for libraries.
85 PKG_CHECK_MODULES([liblua], [lua >= 5.1], [], [
86   PKG_CHECK_MODULES([liblua], [lua51 >= 5.1], [], [
87     PKG_CHECK_MODULES([liblua], [lua5.1 >= 5.1], [], [
88       PKG_CHECK_MODULES(liblua, [lua-5.1 >= 5.1])])
89   ])
91 PKG_CHECK_MODULES([libproxy], [libproxy-1.0 >= 0.3.1])
92 PKG_CHECK_MODULES([libcurl], [libcurl >= 7.21])
93 PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.24])
94 AM_PATH_LIBGCRYPT
96 # Checks for scripts.
97 pkg_scripts=libquvi-scripts-0.9
99 AC_ARG_WITH([scriptsdir],
100   [AS_HELP_STRING([--with-scriptsdir=DIR],
101     [Set libquvi-scripts directory to DIR. This negates the
102     libquvi-scripts check.  DIR is assumed to contain the files
103     installed with libquvi-scripts to the
104       $prefix/share/libquvi-scripts/ directory.])],
105   [scriptsdir=$withval
106    versionfile=$scriptsdir/version],
107   [PKG_CHECK_MODULES([libquvi_scripts], ["$pkg_scripts" >= 0.9])
108     scriptsdir=`$PKG_CONFIG --variable scriptsdir $pkg_scripts 2>/dev/null`
109     versionfile=`$PKG_CONFIG --variable versionfile $pkg_scripts 2>/dev/null`
110     scriptsmodver=`$PKG_CONFIG --modversion $pkg_scripts 2>/dev/null`])
112 AS_IF([test -z "$scriptsdir"], [
113   AC_MSG_ERROR([scriptsdir: variable not found])])
115 AS_IF([ ! test -d "$scriptsdir"], [
116   AC_MSG_ERROR([$scriptsdir: does not exist or is not a directory])])
118 AS_IF([test -z "$versionfile"], [
119   AC_MSG_ERROR([versionfile: variable not found])])
121 AS_IF([ ! test -f "$versionfile"], [
122   AC_MSG_WARN([$versionfile: does not exist or is not not a regular file])])
124 AC_DEFINE_UNQUOTED([SCRIPTSDIR], ["$scriptsdir"], [We have scriptsdir])
125 AC_DEFINE_UNQUOTED([VERSIONFILE], ["$versionfile"], [We have versionfile])
127 scriptsver=`grep <"$versionfile" "version ="|awk '{print $3}' 2>/dev/null`
129 # Checks for header files.
130 AC_CHECK_HEADERS([stdint.h string.h locale.h])
132 # Checks for typedefs, structures, and compiler characteristics.
133 AC_TYPE_UINT32_T
134 AC_TYPE_UINT64_T
135 AC_TYPE_UINT8_T
137 # Checks for library functions.
138 AC_CHECK_FUNCS([strrchr memset setlocale])
140 # Version.
141 VN=`$srcdir/gen-ver.sh`
142 AC_DEFINE_UNQUOTED([VN], ["$VN"], [We have version number from gen-ver.sh])
144 VN_C=`$srcdir/gen-ver.sh -c`
145 AC_SUBST([VN_C])
147 # Version: Major/Minor -pair, used to find the libquvi scripts.
148 # e.g. $prefix/share/libquvi-scripts/$maj.$min/
149 VERSION_MM=`$srcdir/gen-ver.sh -c -m`
150 AC_DEFINE_UNQUOTED([VERSION_MM], "$VERSION_MM", [Version major/minor])
152 # --with-manual
153 AC_ARG_WITH([manual],
154   [AS_HELP_STRING([--with-manual],
155     [install manual pages @<:@default=yes@:>@])],
156   [],
157   [with_manual=yes])
158 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
160 # 'quvi-object' is currently a globally accessible module. Lua 5.2
161 # discourages this practice by removing the luaL_register (and adds the
162 # luaL_setfuncs) call from the C API. We'll dismiss that (for now) with:
163 AC_DEFINE([LUA_COMPAT_MODULE], [1],
164   [Define for backwards-compatibility with Lua 5.1])
166 AC_CONFIG_FILES([
167   Makefile
168   doc/man3/Makefile
169   doc/man7/Makefile
170   doc/dox/Makefile
171   doc/dox/Doxyfile
172   doc/Makefile
173   examples/Makefile
174   examples/lib/Makefile
175   src/misc/Makefile
176   src/gcrypt/Makefile
177   src/curl/Makefile
178   src/net/Makefile
179   src/api/Makefile
180   src/api/doxy/main.dp
181   src/lua/Makefile
182   src/quvi-0.9/quvi/Makefile
183   src/quvi-0.9/Makefile
184   src/Makefile
185   tests/Makefile
186   tests/lib/Makefile
187   libquvi-0.9.pc
188   po/Makefile.in])
189 AC_OUTPUT
191 AC_MSG_NOTICE([
192   version         ${VERSION}
193   prefix          ${prefix}
194   compiler        ${CC}
195   cflags          ${CFLAGS}
196 System types
197   target          ${target}
198   build           ${build}
199   host            ${host}
200 Install options
201   with
202   - manual        ${with_manual}
203 libquvi-scripts
204   .pc modversion  ${scriptsmodver}
205   versionfile     ${versionfile}
206     version       ${scriptsver}
207   scriptsdir      ${scriptsdir}])
209 # vim: set ts=2 sw=2 tw=72 expandtab: