DOC: Use linkman with quvirc where applicable and unused
[quvi-tool.git] / configure.ac
blob850d933aa81f5d67d49a23b9d01d8f732130e7cb
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ([2.67])
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])
14 AC_CANONICAL_TARGET
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])
31 LT_PREREQ([2.2.6])
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.
40 AC_PROG_CC
41 AM_PROG_CC_C_O
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"])
52 AC_SUBST([A2X])
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],
64   [have_json_glib=yes
65    AC_DEFINE([HAVE_JSON_GLIB], [1], [Define to json-glib package])
66   ],
67   [have_json_glib=no
68    AC_MSG_NOTICE([json-glib 0.12+ not found, building without json output])
69   ])
70 AM_CONDITIONAL([HAVE_JSON_GLIB], [test x"$have_json_glib" = "xyes"])
72 PKG_CHECK_MODULES([libxml], [libxml-2.0 >= 2.7.8],
73   [have_libxml=yes
74    AC_DEFINE([HAVE_LIBXML], [1], [Define to libxml package])
75   ],
76   [have_libxml=no
77    AC_MSG_NOTICE([libxml 2.7.8+ not found, building without xml output])
78   ])
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])
88 AC_FUNC_STRERROR_R
90 # Version.
91 VN=`$srcdir/gen-ver.sh`
92 AC_DEFINE_UNQUOTED([VN],["$VN"], [We have version number from gen-ver.sh])
94 # --with-manual
95 AC_ARG_WITH([manual],
96   [AS_HELP_STRING([--with-manual],
97     [install manual page(s) @<:@default=yes@:>@])],
98   [],
99   [with_manual=yes])
100 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
102 AC_CONFIG_FILES([
103   Makefile
104   doc/Makefile
105   doc/man1/Makefile
106   doc/man5/Makefile
107   src/get/Makefile
108   src/input/Makefile
109   src/opts/Makefile
110   src/pbar/Makefile
111   src/print/Makefile
112   src/util/Makefile
113   src/Makefile
114   po/Makefile.in
116 AC_OUTPUT
118 AC_MSG_NOTICE([
119   version:        ${VERSION}
120   prefix:         ${prefix}
121   compiler:       ${CC}
122   cflags:         ${CFLAGS}
123 System types
124   target          ${target}
125   build           ${build}
126   host            ${host}
127 Build options
128   json-glib 0.12+ ${have_json_glib}
129   libxml 2.7.8+   ${have_libxml}
130 Install options
131   with
132   - manual  ${with_manual}])
134 # vim: set ts=2 sw=2 tw=72 expandtab: