2 # Process this file with autoconf to produce a configure script.
6 m4_include([m4/version.m4])
8 AC_INIT([libquvi],[libquvi_lt_rel],
9 [http://quvi.sf.net/bugs/],[],[http://quvi.sf.net/])
21 AC_CONFIG_SRCDIR([src/api/new.c])
22 AC_CONFIG_HEADERS([config.h])
23 AC_CONFIG_AUX_DIR([config.aux])
24 AC_CONFIG_MACRO_DIR([m4])
27 AC_USE_SYSTEM_EXTENSIONS
29 AC_DEFINE_UNQUOTED([CANONICAL_TARGET], "$target", [...])
30 AC_DEFINE_UNQUOTED([CANONICAL_BUILD], "$build", [...])
31 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [...])
33 AM_INIT_AUTOMAKE([1.11.1 -Wall -Werror dist-xz no-dist-gzip tar-ustar])
34 AM_SILENT_RULES([yes])
37 LT_INIT([disable-static])
40 # Checks for programs.
44 AC_PATH_PROG([DOXYGEN], [doxygen], [no])
45 AM_CONDITIONAL([HAVE_DOXYGEN], [test x"$DOXYGEN" != "xno"])
48 AC_PATH_PROG([DATE], [date], [no])
49 AS_IF([test "$DATE" != x"$xno"], [build_time=`$DATE +"%F %T %z"`])
50 AC_DEFINE_UNQUOTED([BUILD_TIME], ["$build_time"], [We have build time])
52 AC_PATH_PROG([VALGRIND], [valgrind], [no])
53 AM_CONDITIONAL([HAVE_VALGRIND], [test x"$VALGRIND" != "xno"])
56 # Checks for libraries.
57 PKG_CHECK_MODULES([liblua], [lua >= 5.1], [], [
58 PKG_CHECK_MODULES([liblua], [lua51 >= 5.1], [], [
59 PKG_CHECK_MODULES([liblua], [lua5.1 >= 5.1], [], [
60 PKG_CHECK_MODULES(liblua, [lua-5.1 >= 5.1])])
63 PKG_CHECK_MODULES([libproxy], [libproxy-1.0 >= 0.3.1])
64 PKG_CHECK_MODULES([libcurl], [libcurl >= 7.21])
65 PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.24])
68 pkg_scripts=libquvi-scripts-1.0
69 AC_ARG_WITH([scriptsdir],
70 [AS_HELP_STRING([--with-scriptsdir=DIR],
71 [Set libquvi-scripts directory to DIR. Overrides the libquvi-scripts
72 package check. DIR is expected to contain all of the libquvi-scripts
73 as well as the "version" file containing the libquvi-scripts version
76 versionfile=$scriptsdir/version],
77 [PKG_CHECK_MODULES([libquvi_scripts], [libquvi-scripts-1.0 >= 1.0])
78 scriptsdir=`$PKG_CONFIG --variable scriptsdir $pkg_scripts 2>/dev/null`
79 versionfile=`$PKG_CONFIG --variable versionfile $pkg_scripts 2>/dev/null`
80 scriptsmodver=`$PKG_CONFIG --modversion $pkg_scripts 2>/dev/null`])
82 AS_IF([test -z "$scriptsdir"], [
83 AC_MSG_ERROR([scriptsdir: variable not found])])
85 AS_IF([ ! test -d "$scriptsdir"], [
86 AC_MSG_ERROR([$scriptsdir: does not exist or is not a directory])])
88 AS_IF([test -z "$versionfile"], [
89 AC_MSG_ERROR([versionfile: variable not found])])
91 AS_IF([ ! test -f "$versionfile"], [
92 AC_MSG_ERROR([$versionfile: does not exist or is not not a regular file])])
94 AC_DEFINE_UNQUOTED([SCRIPTSDIR], ["$scriptsdir"], [We have scriptsdir])
95 AC_DEFINE_UNQUOTED([VERSIONFILE], ["$versionfile"], [We have versionfile])
97 scriptsver=`head -n1 "$versionfile" 2>/dev/null`
99 # Checks for header files.
100 AC_CHECK_HEADERS([stdint.h string.h])
102 # Checks for typedefs, structures, and compiler characteristics.
107 # Checks for library functions.
108 AC_CHECK_FUNCS([strrchr])
111 VN=`$srcdir/gen-ver.sh $srcdir`
112 AC_DEFINE_UNQUOTED([VN], ["$VN"], [We have version number from gen-ver.sh])
115 AC_ARG_WITH([manual],
116 [AS_HELP_STRING([--with-manual],
117 [install manual pages @<:@default=yes@:>@])],
120 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
129 examples/lib/Makefile
135 src/quvi-1.0/quvi/Makefile
136 src/quvi-1.0/Makefile
144 version ${VERSION} (${VN})
153 install manual ${with_manual}
155 .pc modversion ${scriptsmodver}
156 versionfile ${versionfile}
157 version ${scriptsver}
158 scriptsdir ${scriptsdir}])