2 # Process this file with autoconf to produce a configure script.
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])
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])
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])
56 # Checks for programs.
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"])
67 AC_PATH_PROG([A2X], [a2x], [no])
68 AM_CONDITIONAL([HAVE_A2X], [test x"$A2X" != "xno"])
70 if test x"$A2X" = "xno" && test -d .git ; then
71 AC_MSG_ERROR([a2x is required to create man pages when building from git])
74 AC_PATH_PROG([DATE], [date], [no])
75 AS_IF([test "$DATE" != x"$xno"], [build_time=`$DATE +"%F %T %z"`])
76 AC_DEFINE_UNQUOTED([BUILD_TIME], ["$build_time"], [We have build time])
78 BUILD_TIME="$build_time"
79 AC_SUBST([BUILD_TIME])
81 AC_PATH_PROG([VALGRIND], [valgrind], [no])
82 AM_CONDITIONAL([HAVE_VALGRIND], [test x"$VALGRIND" != "xno"])
85 # Checks for libraries.
86 PKG_CHECK_MODULES([liblua], [lua >= 5.1], [], [
87 PKG_CHECK_MODULES([liblua], [lua51 >= 5.1], [], [
88 PKG_CHECK_MODULES([liblua], [lua5.1 >= 5.1], [], [
89 PKG_CHECK_MODULES(liblua, [lua-5.1 >= 5.1])])
92 PKG_CHECK_MODULES([libproxy], [libproxy-1.0 >= 0.3.1])
93 PKG_CHECK_MODULES([libcurl], [libcurl >= 7.21])
94 PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.24])
98 pkg_scripts=libquvi-scripts-0.9
100 AC_ARG_WITH([scriptsdir],
101 [AS_HELP_STRING([--with-scriptsdir=DIR],
102 [Set libquvi-scripts directory to DIR. This negates the
103 libquvi-scripts check. DIR is assumed to contain the files
104 installed with libquvi-scripts to the
105 $prefix/share/libquvi-scripts/ directory.])],
107 versionfile=$scriptsdir/version],
108 [PKG_CHECK_MODULES([libquvi_scripts], ["$pkg_scripts" >= 0.9])
109 scriptsdir=`$PKG_CONFIG --variable scriptsdir $pkg_scripts 2>/dev/null`
110 versionfile=`$PKG_CONFIG --variable versionfile $pkg_scripts 2>/dev/null`
111 scriptsmodver=`$PKG_CONFIG --modversion $pkg_scripts 2>/dev/null`])
113 AS_IF([test -z "$scriptsdir"], [
114 AC_MSG_ERROR([scriptsdir: variable not found])])
116 AS_IF([ ! test -d "$scriptsdir"], [
117 AC_MSG_ERROR([$scriptsdir: does not exist or is not a directory])])
119 AS_IF([test -z "$versionfile"], [
120 AC_MSG_ERROR([versionfile: variable not found])])
122 AS_IF([ ! test -f "$versionfile"], [
123 AC_MSG_WARN([$versionfile: does not exist or is not not a regular file])])
125 AC_DEFINE_UNQUOTED([SCRIPTSDIR], ["$scriptsdir"], [We have scriptsdir])
126 AC_DEFINE_UNQUOTED([VERSIONFILE], ["$versionfile"], [We have versionfile])
128 scriptsver=`head -n1 "$versionfile" 2>/dev/null`
130 # Checks for header files.
131 AC_CHECK_HEADERS([stdint.h string.h locale.h])
133 # Checks for typedefs, structures, and compiler characteristics.
138 # Checks for library functions.
139 AC_CHECK_FUNCS([strrchr memset setlocale])
142 VN=`$srcdir/gen-ver.sh`
143 AC_DEFINE_UNQUOTED([VN], ["$VN"], [We have version number from gen-ver.sh])
145 VN_C=`$srcdir/gen-ver.sh -c`
148 # Version: Major/Minor -pair, used to find the libquvi scripts.
149 # e.g. $prefix/share/libquvi-scripts/$maj.$min/
150 VERSION_MM=`$srcdir/gen-ver.sh -c -m`
151 AC_DEFINE_UNQUOTED([VERSION_MM], "$VERSION_MM", [Version major/minor])
154 AC_ARG_WITH([manual],
155 [AS_HELP_STRING([--with-manual],
156 [install manual pages @<:@default=yes@:>@])],
159 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
169 examples/lib/Makefile
177 src/quvi-0.9/quvi/Makefile
178 src/quvi-0.9/Makefile
197 - manual ${with_manual}
199 .pc modversion ${scriptsmodver}
200 versionfile ${versionfile}
201 version ${scriptsver}
202 scriptsdir ${scriptsdir}])
204 # vim: set ts=2 sw=2 tw=72 expandtab: