Use renamed quvi.http.fetch
[libquvi-scripts.git] / configure.ac
blob0d72508595c6ebcd2447b581585e05bc24a5c2df
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ([2.67])
6 AC_INIT([libquvi-scripts], m4_esyscmd([./gen-ver.sh -c | tr -d '\n']),
7         [http://quvi.sf.net/bugs/],[],[http://quvi.sf.net/])
9 AC_CONFIG_SRCDIR([tests/lib/env.c])
10 AC_CONFIG_HEADERS([config.h])
11 AC_CONFIG_AUX_DIR([config.aux])
12 AC_CONFIG_MACRO_DIR([m4])
14 AM_INIT_AUTOMAKE([1.11.1 -Wall -Werror dist-xz no-dist-gzip tar-ustar])
15 AM_SILENT_RULES([yes])
16 #AM_PROG_AR
18 LT_INIT([disable-static])
19 LT_PREREQ([2.2.6])
21 # Checks for programs.
22 AC_PROG_CC
23 AM_PROG_CC_C_O
24 AC_PROG_LN_S
26 AC_PATH_PROG([A2X], [a2x], [no])
27 AM_CONDITIONAL([HAVE_A2X], [test x"$A2X" != "xno"])
28 AC_SUBST([A2X])
30 # Check for the Lua modules.
31 have_lua=no
32 have_sct=no
33 have_lxp=no
34 AC_PATH_PROG([LUA], [lua], [no])
35 AS_IF([test x"$LUA" != "xno"], [
36   v=2.0.2
37   AC_MSG_CHECKING([for module LuaSocket $v or later])
38   o=`$LUA $srcdir/chk_mod.lua socket $v`
39   AS_IF([test "$?" -eq 0],
40     [have_sct=yes
41       AC_MSG_RESULT([yes])],
42     [AC_MSG_ERROR([module not found])])
43   v=1.2.0
44   AC_MSG_CHECKING([for module LuaExpat $v or later])
45   o=`$LUA $srcdir/chk_mod.lua lxp $v`
46   AS_IF([test "$?" -eq 0],
47     [have_lxp=yes
48       AC_MSG_RESULT([yes])],
49     [AC_MSG_ERROR([module not found])])
50   have_lua=yes
51 ], [AC_MSG_WARN([Could not find the the lua(1) command])
52     AC_MSG_WARN([Will NOT check for the *required* Lua modules])
53     AC_MSG_WARN([See README file for the prerequisites])
56 # --with-tests
57 pkg_libquvi=libquvi-0.9
58 AC_ARG_WITH([tests],
59   [AS_HELP_STRING([--with-tests],
60     [Enable tests for scripts @<:@default=no@:>@])],
61   [PKG_CHECK_MODULES([libquvi], ["$pkg_libquvi" >= 0.9],
62     [libquvi_modver=`$PKG_CONFIG --modversion $pkg_libquvi 2>/dev/null`
63       PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.24],
64       [PKG_CHECK_MODULES([libcurl], [libcurl >= 7.21], [with_tests=yes])])
65     ])
66   ], [with_tests=no])
67 AM_CONDITIONAL([WITH_TESTS], [test x"$with_tests" = "xyes"])
69 # --with-nsfw
70 AC_ARG_WITH([nsfw],
71   [AS_HELP_STRING([--with-nsfw],
72     [Install scripts marked as "NSFW" @<:@default=no@:>@])],
73   [], [with_nsfw=no])
74 AM_CONDITIONAL([WITH_NSFW], [test x"$with_nsfw" != "xno"])
76 # --with-fixme
77 AC_ARG_WITH([fixme],
78   [AS_HELP_STRING([--with-fixme],
79     [Install scripts marked as "FIXME" @<:@default=no@:>@])],
80   [], [with_fixme=no])
81 AM_CONDITIONAL([WITH_FIXME], [test x"$with_fixme" != "xno"])
83 # --with-geoblocked
84 AC_ARG_WITH([geoblocked],
85   [AS_HELP_STRING([--with-geoblocked],
86     [Install scripts marked as "geoblocked" @<:@default=yes@:>@])],
87   [], [with_geoblocked=yes])
88 AM_CONDITIONAL([WITH_GEOBLOCKED], [test x"$with_geoblocked" = "xyes"])
90 # --with-manual
91 AC_ARG_WITH([manual],
92   [AS_HELP_STRING([--with-manual],
93     [Install manual page(s) @<:@default=yes@:>@])],
94   [], [with_manual=yes])
95 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
97 # Version: Major/minor -pair, used to symlink
98 # from
99 #   $prefix/share/libquvi-scripts/$version/
100 # to
101 #   $prefix/share/libquvi-scripts/$major.$minor/
102 VERSION_MM=`$srcdir/gen-ver.sh -c -m`
103 AC_SUBST([VERSION_MM])
105 VN_C=`$srcdir/gen-ver.sh -c` # Use this value in the .pc file
106 AC_SUBST([VN_C])
108 AC_CONFIG_FILES([
109   Makefile
110   doc/Makefile
111   doc/man7/Makefile
112   share/Makefile
113   tests/Makefile
114   tests/lib/Makefile
115   libquvi-scripts-0.9.pc])
116 AC_OUTPUT
118 AC_MSG_NOTICE([
119   version       ${VERSION}
120   prefix        ${prefix}
121   compiler      ${CC}
122   cflags        ${CFLAGS}
123 Prerequisites
124   lua           ${have_lua}
125     luasocket   ${have_sct}
126     luaexpat    ${have_lxp}
127 Testsuite options
128   with
129   - tests       ${with_tests}
130     - libquvi .pc modversion ${libquvi_modver}
131 Install options
132   with
133   - geoblocked  ${with_geoblocked}
134   - fixme       ${with_fixme}
135   - nsfw        ${with_nsfw}])