2 # Process this file with autoconf to produce a configure script.
6 AC_INIT([quvi], m4_esyscmd([./gen-ver.sh -c | tr -d '\n']),
7 [http://quvi.sf.net/bugs/],[],[http://quvi.sf.net/])
9 AC_CONFIG_SRCDIR([src/main.c])
10 AC_CONFIG_HEADERS([config.h])
11 AC_CONFIG_AUX_DIR([config.aux])
12 AC_CONFIG_MACRO_DIR([m4])
15 AC_USE_SYSTEM_EXTENSIONS
17 AC_DEFINE_UNQUOTED([CANONICAL_TARGET], "$target", [...])
18 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [...])
20 # GNU Automake 1.13 spews a warning about AM_GNU_GETTEXT (0.18.1,
21 # 0.18.2) using the deprecated AM_PROG_MKDIR_P macro. Do not specify
22 # '-Werror` in the options to work around this.
23 AM_INIT_AUTOMAKE([1.11.1 -Wall dist-xz no-dist-gzip tar-ustar])
24 AM_SILENT_RULES([yes])
26 # GNU Automake 1.12 requires this macro. Earlier versions do not
27 # recognize this macro. Work around this.
28 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
30 LT_INIT([disable-static])
33 AM_GNU_GETTEXT_VERSION([0.18.1])
34 AM_GNU_GETTEXT([external])
35 # GETTEXT_PACKAGE is used by glib.
36 AC_DEFINE([GETTEXT_PACKAGE], [PACKAGE], [Define to the gettext package name])
37 AC_SUBST([GETTEXT_PACKAGE], [PACKAGE])
39 # Checks for programs.
43 AC_DEFINE_UNQUOTED([CFLAGS], "$CFLAGS", [Define to compiler flags])
44 AC_DEFINE_UNQUOTED([CC], "$CC", [Define to compiler])
46 AC_PATH_PROG([DATE], [date], [no])
47 AS_IF([test x"$DATE" != "xno"], [build_time=`$DATE +"%F %T %z"`])
48 AC_DEFINE_UNQUOTED([BUILD_TIME], ["$build_time"], [We have build time])
50 AC_PATH_PROG([A2X], [a2x], [no])
51 AM_CONDITIONAL([HAVE_A2X], [test x"$A2X" != "xno"])
54 AS_IF([test x"$A2X" = "xno" && test -d "$srcdir/.git"],
55 AC_MSG_ERROR([a2x is required to create man pages when building from git])])
57 # Checks for libraries.
58 PKG_CHECK_MODULES([libquvi], [libquvi-0.9 >= 0.9])
59 PKG_CHECK_MODULES([libcurl], [libcurl >= 7.18.2])
60 PKG_CHECK_MODULES([gobject], [gobject-2.0 >= 2.24])
61 PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.24])
63 PKG_CHECK_MODULES([json_glib], [json-glib-1.0 >= 0.12],
65 AC_DEFINE([HAVE_JSON_GLIB], [1], [Define to json-glib package])
68 AC_MSG_NOTICE([json-glib 0.12+ not found, building without json output])
70 AM_CONDITIONAL([HAVE_JSON_GLIB], [test x"$have_json_glib" = "xyes"])
72 PKG_CHECK_MODULES([libxml], [libxml-2.0 >= 2.7.8],
74 AC_DEFINE([HAVE_LIBXML], [1], [Define to libxml package])
77 AC_MSG_NOTICE([libxml 2.7.8+ not found, building without xml output])
79 AM_CONDITIONAL([HAVE_LIBXML], [test x"$have_libxml" = "xyes"])
81 # Checks for header files.
82 AC_CHECK_HEADERS([locale.h])
84 # Checks for typedefs, structures, and compiler characteristics.
86 # Checks for library functions.
87 AC_CHECK_FUNCS([setlocale memset strerror])
91 VN=`$srcdir/gen-ver.sh`
92 AC_DEFINE_UNQUOTED([VN],["$VN"], [We have version number from gen-ver.sh])
96 [AS_HELP_STRING([--with-manual],
97 [install manual page(s) @<:@default=yes@:>@])],
100 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
128 json-glib 0.12+ ${have_json_glib}
129 libxml 2.7.8+ ${have_libxml}
132 - manual ${with_manual}])
134 # vim: set ts=2 sw=2 tw=72 expandtab: