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/])
19 AC_CONFIG_SRCDIR([src/api/new.c])
20 AC_CONFIG_HEADERS([config.h])
21 AC_CONFIG_AUX_DIR([config.aux])
22 AC_CONFIG_MACRO_DIR([m4])
25 AC_USE_SYSTEM_EXTENSIONS
27 AC_DEFINE_UNQUOTED([CANONICAL_TARGET], "$target", [...])
28 AC_DEFINE_UNQUOTED([CANONICAL_BUILD], "$build", [...])
29 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [...])
31 AM_INIT_AUTOMAKE([1.11.1 -Wall -Werror dist-xz no-dist-gzip tar-ustar])
32 AM_SILENT_RULES([yes])
35 LT_INIT([disable-static])
38 # Checks for programs.
42 AC_PATH_PROG([DOXYGEN], [doxygen], [no])
43 AM_CONDITIONAL([HAVE_DOXYGEN], [test x"$DOXYGEN" != "xno"])
46 AC_PATH_PROG([DATE], [date], [no])
47 AS_IF([test "$DATE" != x"$xno"], [build_time=`$DATE +"%F %T %z"`])
48 AC_DEFINE_UNQUOTED([BUILD_TIME], ["$build_time"], [We have build time])
50 BUILD_TIME="$build_time"
51 AC_SUBST([BUILD_TIME])
53 AC_PATH_PROG([VALGRIND], [valgrind], [no])
54 AM_CONDITIONAL([HAVE_VALGRIND], [test x"$VALGRIND" != "xno"])
57 # Checks for libraries.
58 PKG_CHECK_MODULES([liblua], [lua >= 5.1], [], [
59 PKG_CHECK_MODULES([liblua], [lua51 >= 5.1], [], [
60 PKG_CHECK_MODULES([liblua], [lua5.1 >= 5.1], [], [
61 PKG_CHECK_MODULES(liblua, [lua-5.1 >= 5.1])])
64 PKG_CHECK_MODULES([libproxy], [libproxy-1.0 >= 0.3.1])
65 PKG_CHECK_MODULES([libcurl], [libcurl >= 7.21])
66 PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.24])
69 pkg_scripts=libquvi-scripts-0.9
71 AC_ARG_WITH([scriptsdir],
72 [AS_HELP_STRING([--with-scriptsdir=DIR],
73 [Set libquvi-scripts directory to DIR. This negates the
74 libquvi-scripts check. DIR is assumed to contain the files
75 installed with libquvi-scripts to the
76 $prefix/share/libquvi-scripts/ directory.])],
78 versionfile=$scriptsdir/version],
79 [PKG_CHECK_MODULES([libquvi_scripts], ["$pkg_scripts" >= 0.9])
80 scriptsdir=`$PKG_CONFIG --variable scriptsdir $pkg_scripts 2>/dev/null`
81 versionfile=`$PKG_CONFIG --variable versionfile $pkg_scripts 2>/dev/null`
82 scriptsmodver=`$PKG_CONFIG --modversion $pkg_scripts 2>/dev/null`])
84 AS_IF([test -z "$scriptsdir"], [
85 AC_MSG_ERROR([scriptsdir: variable not found])])
87 AS_IF([ ! test -d "$scriptsdir"], [
88 AC_MSG_ERROR([$scriptsdir: does not exist or is not a directory])])
90 AS_IF([test -z "$versionfile"], [
91 AC_MSG_ERROR([versionfile: variable not found])])
93 AS_IF([ ! test -f "$versionfile"], [
94 AC_MSG_WARN([$versionfile: does not exist or is not not a regular file])])
96 AC_DEFINE_UNQUOTED([SCRIPTSDIR], ["$scriptsdir"], [We have scriptsdir])
97 AC_DEFINE_UNQUOTED([VERSIONFILE], ["$versionfile"], [We have versionfile])
99 scriptsver=`head -n1 "$versionfile" 2>/dev/null`
101 # Checks for header files.
102 AC_CHECK_HEADERS([stdint.h string.h])
104 # Checks for typedefs, structures, and compiler characteristics.
109 # Checks for library functions.
110 AC_CHECK_FUNCS([strrchr])
113 VN=`$srcdir/gen-ver.sh`
114 AC_DEFINE_UNQUOTED([VN], ["$VN"], [We have version number from gen-ver.sh])
116 VN_C=`$srcdir/gen-ver.sh -c`
119 # Version: Major/Minor -pair, used to find the libquvi scripts.
120 # e.g. $prefix/share/libquvi-scripts/$maj.$min/
121 VERSION_MM=`$srcdir/gen-ver.sh -c -m`
122 AC_DEFINE_UNQUOTED([VERSION_MM], "$VERSION_MM", [Version major/minor])
125 AC_ARG_WITH([manual],
126 [AS_HELP_STRING([--with-manual],
127 [install manual pages @<:@default=yes@:>@])],
130 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
139 examples/lib/Makefile
146 src/quvi-0.9/quvi/Makefile
147 src/quvi-0.9/Makefile
164 install manual ${with_manual}
166 .pc modversion ${scriptsmodver}
167 versionfile ${versionfile}
168 version ${scriptsver}
169 scriptsdir ${scriptsdir}])