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 AS_IF([test x"$A2X" = "xno" && test -d "$srcdir/.git"],
71 AC_MSG_ERROR([a2x is required to create man pages when building from git])])
73 AC_PATH_PROG([DATE], [date], [no])
74 AS_IF([test x"$DATE" != "xno"], [build_time=`$DATE +"%F %T %z"`])
75 AC_DEFINE_UNQUOTED([BUILD_TIME], ["$build_time"], [We have build time])
77 BUILD_TIME="$build_time"
78 AC_SUBST([BUILD_TIME])
80 AC_PATH_PROG([VALGRIND], [valgrind], [no])
81 AM_CONDITIONAL([HAVE_VALGRIND], [test x"$VALGRIND" != "xno"])
84 # Checks for libraries.
85 PKG_CHECK_MODULES([liblua], [lua >= 5.1], [], [
86 PKG_CHECK_MODULES([liblua], [lua51 >= 5.1], [], [
87 PKG_CHECK_MODULES([liblua], [lua5.1 >= 5.1], [], [
88 PKG_CHECK_MODULES(liblua, [lua-5.1 >= 5.1])])
91 PKG_CHECK_MODULES([libproxy], [libproxy-1.0 >= 0.3.1])
92 PKG_CHECK_MODULES([libcurl], [libcurl >= 7.21])
93 PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.24])
97 pkg_scripts=libquvi-scripts-0.9
99 AC_ARG_WITH([scriptsdir],
100 [AS_HELP_STRING([--with-scriptsdir=DIR],
101 [Set libquvi-scripts directory to DIR. This negates the
102 libquvi-scripts check. DIR is assumed to contain the files
103 installed with libquvi-scripts to the
104 $prefix/share/libquvi-scripts/ directory.])],
106 versionfile=$scriptsdir/version],
107 [PKG_CHECK_MODULES([libquvi_scripts], ["$pkg_scripts" >= 0.9])
108 scriptsdir=`$PKG_CONFIG --variable scriptsdir $pkg_scripts 2>/dev/null`
109 versionfile=`$PKG_CONFIG --variable versionfile $pkg_scripts 2>/dev/null`
110 scriptsmodver=`$PKG_CONFIG --modversion $pkg_scripts 2>/dev/null`])
112 AS_IF([test -z "$scriptsdir"], [
113 AC_MSG_ERROR([scriptsdir: variable not found])])
115 AS_IF([ ! test -d "$scriptsdir"], [
116 AC_MSG_ERROR([$scriptsdir: does not exist or is not a directory])])
118 AS_IF([test -z "$versionfile"], [
119 AC_MSG_ERROR([versionfile: variable not found])])
121 AS_IF([ ! test -f "$versionfile"], [
122 AC_MSG_WARN([$versionfile: does not exist or is not not a regular file])])
124 AC_DEFINE_UNQUOTED([SCRIPTSDIR], ["$scriptsdir"], [We have scriptsdir])
125 AC_DEFINE_UNQUOTED([VERSIONFILE], ["$versionfile"], [We have versionfile])
127 scriptsver=`grep <"$versionfile" "version ="|awk '{print $3}' 2>/dev/null`
129 # Checks for header files.
130 AC_CHECK_HEADERS([stdint.h string.h locale.h])
132 # Checks for typedefs, structures, and compiler characteristics.
137 # Checks for library functions.
138 AC_CHECK_FUNCS([strrchr memset setlocale])
141 VN=`$srcdir/gen-ver.sh`
142 AC_DEFINE_UNQUOTED([VN], ["$VN"], [We have version number from gen-ver.sh])
144 VN_C=`$srcdir/gen-ver.sh -c`
147 # Version: Major/Minor -pair, used to find the libquvi scripts.
148 # e.g. $prefix/share/libquvi-scripts/$maj.$min/
149 VERSION_MM=`$srcdir/gen-ver.sh -c -m`
150 AC_DEFINE_UNQUOTED([VERSION_MM], "$VERSION_MM", [Version major/minor])
153 AC_ARG_WITH([manual],
154 [AS_HELP_STRING([--with-manual],
155 [install manual pages @<:@default=yes@:>@])],
158 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
160 # 'quvi-object' is currently a globally accessible module. Lua 5.2
161 # discourages this practice by removing the luaL_register (and adds the
162 # luaL_setfuncs) call from the C API. We'll dismiss that (for now) with:
163 AC_DEFINE([LUA_COMPAT_MODULE], [1],
164 [Define for backwards-compatibility with Lua 5.1])
174 examples/lib/Makefile
182 src/quvi-0.9/quvi/Makefile
183 src/quvi-0.9/Makefile
202 - manual ${with_manual}
204 .pc modversion ${scriptsmodver}
205 versionfile ${versionfile}
206 version ${scriptsver}
207 scriptsdir ${scriptsdir}])
209 # vim: set ts=2 sw=2 tw=72 expandtab: