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_DEFINE_UNQUOTED([BUILD_OPTS], "$@",
10 [Define to configure invocation command line options])
12 AC_CONFIG_SRCDIR([src/main.c])
13 AC_CONFIG_HEADERS([config.h])
14 AC_CONFIG_AUX_DIR([config.aux])
15 AC_CONFIG_MACRO_DIR([m4])
18 AC_USE_SYSTEM_EXTENSIONS
20 AC_DEFINE_UNQUOTED([CANONICAL_TARGET], "$target", [...])
21 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [...])
23 # GNU Automake 1.13 spews a warning about AM_GNU_GETTEXT (0.18.1,
24 # 0.18.2) using the deprecated AM_PROG_MKDIR_P macro. Do not specify
25 # '-Werror` in the options to work around this.
26 AM_INIT_AUTOMAKE([1.11.1 -Wall dist-xz no-dist-gzip tar-ustar])
27 AM_SILENT_RULES([yes])
29 # GNU Automake 1.12 requires this macro. Earlier versions do not
30 # recognize this macro. Work around this.
31 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
33 LT_INIT([disable-static])
36 AM_GNU_GETTEXT_VERSION([0.18.1])
37 AM_GNU_GETTEXT([external])
38 # GETTEXT_PACKAGE is used by glib.
39 AC_DEFINE([GETTEXT_PACKAGE], [PACKAGE], [Define to the gettext package name])
40 AC_SUBST([GETTEXT_PACKAGE], [PACKAGE])
42 # Checks for programs.
46 AC_DEFINE_UNQUOTED([CFLAGS], "$CFLAGS", [Define to compiler flags])
47 AC_DEFINE_UNQUOTED([CC], "$CC", [Define to compiler])
49 AC_PATH_PROG([DATE], [date], [no])
50 AS_IF([test x"$DATE" != "xno"], [build_time=`$DATE +"%F %T %z"`])
51 AC_DEFINE_UNQUOTED([BUILD_TIME], ["$build_time"], [We have build time])
53 AC_PATH_PROG([A2X], [a2x], [no])
54 AM_CONDITIONAL([HAVE_A2X], [test x"$A2X" != "xno"])
57 AS_IF([test x"$A2X" = "xno" && test -d "$srcdir/.git"],
58 AC_MSG_ERROR([a2x is required to create man pages when building from git])])
60 # Checks for libraries.
61 PKG_CHECK_MODULES([libquvi], [libquvi-0.9 >= 0.9])
62 PKG_CHECK_MODULES([libcurl], [libcurl >= 7.18.2])
63 PKG_CHECK_MODULES([gobject], [gobject-2.0 >= 2.24])
64 PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.24])
66 PKG_CHECK_MODULES([json_glib], [json-glib-1.0 >= 0.12],
68 AC_DEFINE([HAVE_JSON_GLIB], [1], [Define to json-glib package])
71 AC_MSG_NOTICE([json-glib 0.12+ not found, building without json output])
73 AM_CONDITIONAL([HAVE_JSON_GLIB], [test x"$have_json_glib" = "xyes"])
75 PKG_CHECK_MODULES([libxml], [libxml-2.0 >= 2.7.8],
77 AC_DEFINE([HAVE_LIBXML], [1], [Define to libxml package])
80 AC_MSG_NOTICE([libxml 2.7.8+ not found, building without xml output])
82 AM_CONDITIONAL([HAVE_LIBXML], [test x"$have_libxml" = "xyes"])
84 # Checks for header files.
85 AC_CHECK_HEADERS([locale.h])
87 # Checks for typedefs, structures, and compiler characteristics.
89 # Checks for library functions.
90 AC_CHECK_FUNCS([setlocale memset strerror])
94 VN=`$srcdir/gen-ver.sh`
95 AC_DEFINE_UNQUOTED([VN],["$VN"], [We have version number from gen-ver.sh])
99 [AS_HELP_STRING([--with-manual],
100 [install manual page(s) @<:@default=yes@:>@])],
103 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
131 json-glib 0.12+ ${have_json_glib}
132 libxml 2.7.8+ ${have_libxml}
135 - manual ${with_manual}])
137 # vim: set ts=2 sw=2 tw=72 expandtab: