Update NEWS for v0.9.5
[quvi-tool.git] / configure.ac
blobc45d4d84992ad94ec28fafaf01896246bcaf12e5
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ([2.69])
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])
17 AC_CANONICAL_TARGET
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])
34 LT_PREREQ([2.2.6])
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.
43 AC_PROG_CC
44 AM_PROG_CC_C_O
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"])
55 AC_SUBST([A2X])
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],
67   [have_json_glib=yes
68    AC_DEFINE([HAVE_JSON_GLIB], [1], [Define to json-glib package])
69   ],
70   [have_json_glib=no
71    AC_MSG_NOTICE([json-glib 0.12+ not found, building without json output])
72   ])
73 AM_CONDITIONAL([HAVE_JSON_GLIB], [test x"$have_json_glib" = "xyes"])
75 PKG_CHECK_MODULES([libxml], [libxml-2.0 >= 2.7.8],
76   [have_libxml=yes
77    AC_DEFINE([HAVE_LIBXML], [1], [Define to libxml package])
78   ],
79   [have_libxml=no
80    AC_MSG_NOTICE([libxml 2.7.8+ not found, building without xml output])
81   ])
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])
91 AC_FUNC_STRERROR_R
93 # Version.
94 VN=`$srcdir/gen-ver.sh`
95 AC_DEFINE_UNQUOTED([VN],["$VN"], [We have version number from gen-ver.sh])
97 # --with-manual
98 AC_ARG_WITH([manual],
99   [AS_HELP_STRING([--with-manual],
100     [install manual page(s) @<:@default=yes@:>@])],
101   [],
102   [with_manual=yes])
103 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
105 AC_CONFIG_FILES([
106   Makefile
107   doc/Makefile
108   doc/man1/Makefile
109   doc/man5/Makefile
110   src/get/Makefile
111   src/input/Makefile
112   src/opts/Makefile
113   src/pbar/Makefile
114   src/print/Makefile
115   src/util/Makefile
116   src/Makefile
117   po/Makefile.in
119 AC_OUTPUT
121 AC_MSG_NOTICE([
122   version:        ${VERSION}
123   prefix:         ${prefix}
124   compiler:       ${CC}
125   cflags:         ${CFLAGS}
126 System types
127   target          ${target}
128   build           ${build}
129   host            ${host}
130 Build options
131   json-glib 0.12+ ${have_json_glib}
132   libxml 2.7.8+   ${have_libxml}
133 Install options
134   with
135   - manual  ${with_manual}])
137 # vim: set ts=2 sw=2 tw=72 expandtab: