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_PATH_PROG([DOXYGEN], [doxygen], [no])
61 AM_CONDITIONAL([HAVE_DOXYGEN], [test x"$DOXYGEN" != "xno"])
64 AC_PATH_PROG([A2X], [a2x], [no])
65 AM_CONDITIONAL([HAVE_A2X], [test x"$A2X" != "xno"])
68 AC_PATH_PROG([DATE], [date], [no])
69 AS_IF([test "$DATE" != x"$xno"], [build_time=`$DATE +"%F %T %z"`])
70 AC_DEFINE_UNQUOTED([BUILD_TIME], ["$build_time"], [We have build time])
72 BUILD_TIME="$build_time"
73 AC_SUBST([BUILD_TIME])
75 AC_PATH_PROG([VALGRIND], [valgrind], [no])
76 AM_CONDITIONAL([HAVE_VALGRIND], [test x"$VALGRIND" != "xno"])
79 # Checks for libraries.
80 PKG_CHECK_MODULES([liblua], [lua >= 5.1], [], [
81 PKG_CHECK_MODULES([liblua], [lua51 >= 5.1], [], [
82 PKG_CHECK_MODULES([liblua], [lua5.1 >= 5.1], [], [
83 PKG_CHECK_MODULES(liblua, [lua-5.1 >= 5.1])])
86 PKG_CHECK_MODULES([libproxy], [libproxy-1.0 >= 0.3.1])
87 PKG_CHECK_MODULES([libcurl], [libcurl >= 7.21])
88 PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.24])
92 pkg_scripts=libquvi-scripts-0.9
94 AC_ARG_WITH([scriptsdir],
95 [AS_HELP_STRING([--with-scriptsdir=DIR],
96 [Set libquvi-scripts directory to DIR. This negates the
97 libquvi-scripts check. DIR is assumed to contain the files
98 installed with libquvi-scripts to the
99 $prefix/share/libquvi-scripts/ directory.])],
101 versionfile=$scriptsdir/version],
102 [PKG_CHECK_MODULES([libquvi_scripts], ["$pkg_scripts" >= 0.9])
103 scriptsdir=`$PKG_CONFIG --variable scriptsdir $pkg_scripts 2>/dev/null`
104 versionfile=`$PKG_CONFIG --variable versionfile $pkg_scripts 2>/dev/null`
105 scriptsmodver=`$PKG_CONFIG --modversion $pkg_scripts 2>/dev/null`])
107 AS_IF([test -z "$scriptsdir"], [
108 AC_MSG_ERROR([scriptsdir: variable not found])])
110 AS_IF([ ! test -d "$scriptsdir"], [
111 AC_MSG_ERROR([$scriptsdir: does not exist or is not a directory])])
113 AS_IF([test -z "$versionfile"], [
114 AC_MSG_ERROR([versionfile: variable not found])])
116 AS_IF([ ! test -f "$versionfile"], [
117 AC_MSG_WARN([$versionfile: does not exist or is not not a regular file])])
119 AC_DEFINE_UNQUOTED([SCRIPTSDIR], ["$scriptsdir"], [We have scriptsdir])
120 AC_DEFINE_UNQUOTED([VERSIONFILE], ["$versionfile"], [We have versionfile])
122 scriptsver=`head -n1 "$versionfile" 2>/dev/null`
124 # Checks for header files.
125 AC_CHECK_HEADERS([stdint.h string.h locale.h])
127 # Checks for typedefs, structures, and compiler characteristics.
132 # Checks for library functions.
133 AC_CHECK_FUNCS([strrchr memset setlocale])
136 VN=`$srcdir/gen-ver.sh`
137 AC_DEFINE_UNQUOTED([VN], ["$VN"], [We have version number from gen-ver.sh])
139 VN_C=`$srcdir/gen-ver.sh -c`
142 # Version: Major/Minor -pair, used to find the libquvi scripts.
143 # e.g. $prefix/share/libquvi-scripts/$maj.$min/
144 VERSION_MM=`$srcdir/gen-ver.sh -c -m`
145 AC_DEFINE_UNQUOTED([VERSION_MM], "$VERSION_MM", [Version major/minor])
148 AC_ARG_WITH([manual],
149 [AS_HELP_STRING([--with-manual],
150 [install manual pages @<:@default=yes@:>@])],
153 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
163 examples/lib/Makefile
171 src/quvi-0.9/quvi/Makefile
172 src/quvi-0.9/Makefile
191 - manual ${with_manual}
193 .pc modversion ${scriptsmodver}
194 versionfile ${versionfile}
195 version ${scriptsver}
196 scriptsdir ${scriptsdir}])