media/youtube.lua: Use 'quvi/youtube' functions
[libquvi-scripts.git] / configure.ac
blob998a1279f3df7e51b748ded657dc2053acfd3297
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 # Check for the Lua modules.
27 have_lua=no
28 have_sct=no
29 have_lxp=no
30 AC_PATH_PROG([LUA], [lua], [no])
31 AS_IF([test x"$LUA" != "xno"], [
32   v=2.0.2
33   AC_MSG_CHECKING([for module LuaSocket $v or later])
34   o=`$LUA $srcdir/chk_mod.lua socket $v`
35   AS_IF([test "$?" -eq 0],
36     [have_sct=yes
37       AC_MSG_RESULT([yes])],
38     [AC_MSG_ERROR([module not found])])
39   v=1.2.0
40   AC_MSG_CHECKING([for module LuaExpat $v or later])
41   o=`$LUA $srcdir/chk_mod.lua lxp $v`
42   AS_IF([test "$?" -eq 0],
43     [have_lxp=yes
44       AC_MSG_RESULT([yes])],
45     [AC_MSG_ERROR([module not found])])
46   have_lua=yes
47 ], [AC_MSG_WARN([Could not find the the lua(1) command])
48     AC_MSG_WARN([Will NOT check for the *required* Lua modules])
49     AC_MSG_WARN([See README file for the prerequisites])
52 # --with-tests
53 pkg_libquvi=libquvi-0.9
54 AC_ARG_WITH([tests],
55   [AS_HELP_STRING([--with-tests],
56     [Enable tests for scripts @<:@default=no@:>@])],
57   [PKG_CHECK_MODULES([libquvi], ["$pkg_libquvi" >= 0.9],
58     [libquvi_modver=`$PKG_CONFIG --modversion $pkg_libquvi 2>/dev/null`
59       PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.24],
60       [PKG_CHECK_MODULES([libcurl], [libcurl >= 7.21], [with_tests=yes])])
61     ])
62   ], [with_tests=no])
63 AM_CONDITIONAL([WITH_TESTS], [test x"$with_tests" = "xyes"])
65 # --with-nsfw
66 AC_ARG_WITH([nsfw],
67   [AS_HELP_STRING([--with-nsfw],
68     [Install scripts marked as "NSFW" @<:@default=no@:>@])],
69   [], [with_nsfw=no])
70 AM_CONDITIONAL([WITH_NSFW], [test x"$with_nsfw" != "xno"])
72 # --with-fixme
73 AC_ARG_WITH([fixme],
74   [AS_HELP_STRING([--with-fixme],
75     [Install scripts marked as "FIXME" @<:@default=no@:>@])],
76   [], [with_fixme=no])
77 AM_CONDITIONAL([WITH_FIXME], [test x"$with_fixme" != "xno"])
79 # --with-geoblocked
80 AC_ARG_WITH([geoblocked],
81   [AS_HELP_STRING([--with-geoblocked],
82     [Install scripts marked as "geoblocked" @<:@default=yes@:>@])],
83   [], [with_geoblocked=yes])
84 AM_CONDITIONAL([WITH_GEOBLOCKED], [test x"$with_geoblocked" = "xyes"])
86 # --with-manual
87 AC_ARG_WITH([manual],
88   [AS_HELP_STRING([--with-manual],
89     [Install manual page(s) @<:@default=yes@:>@])],
90   [], [with_manual=yes])
91 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
93 # Version: Major/minor -pair, used to symlink
94 # from
95 #   $prefix/share/libquvi-scripts/$version/
96 # to
97 #   $prefix/share/libquvi-scripts/$major.$minor/
98 VERSION_MM=`$srcdir/gen-ver.sh -c -m`
99 AC_SUBST([VERSION_MM])
101 VN_C=`$srcdir/gen-ver.sh -c` # Use this value in the .pc file
102 AC_SUBST([VN_C])
104 AC_CONFIG_FILES([
105   Makefile
106   doc/Makefile
107   doc/man7/Makefile
108   share/Makefile
109   tests/Makefile
110   tests/lib/Makefile
111   libquvi-scripts-0.9.pc])
112 AC_OUTPUT
114 AC_MSG_NOTICE([
115   version       ${VERSION}
116   prefix        ${prefix}
117   compiler      ${CC}
118   cflags        ${CFLAGS}
119 Prerequisites
120   lua           ${have_lua}
121     luasocket   ${have_sct}
122     luaexpat    ${have_lxp}
123 Testsuite options
124   with
125   - tests       ${with_tests}
126     - libquvi .pc modversion ${libquvi_modver}
127 Install options
128   with
129   - geoblocked  ${with_geoblocked}
130   - fixme       ${with_fixme}
131   - nsfw        ${with_nsfw}])