AC_CHECK_FUNCS: Add memset
[libquvi-scripts.git] / configure.ac
blob19d9b7168685263ea431e4cdbd4fd29c96fc4802
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])
17 # GNU Automake 1.12 requires this macro. Earlier versions do not
18 # recognize this macro. Work around this.
19 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
21 LT_INIT([disable-static])
22 LT_PREREQ([2.2.6])
24 # Checks for programs.
25 AC_PROG_CC
26 AM_PROG_CC_C_O
27 AC_PROG_LN_S
29 AC_PATH_PROG([A2X], [a2x], [no])
30 AM_CONDITIONAL([HAVE_A2X], [test x"$A2X" != "xno"])
31 AC_SUBST([A2X])
33 # Check for functions.
34 AC_CHECK_FUNCS([memset])
36 # --with-tests
37 pkg_libquvi=libquvi-0.9
38 AC_ARG_WITH([tests],
39   [AS_HELP_STRING([--with-tests],
40     [Enable tests for scripts @<:@default=no@:>@])],
41   [PKG_CHECK_MODULES([libquvi], ["$pkg_libquvi" >= 0.9],
42     [libquvi_modver=`$PKG_CONFIG --modversion $pkg_libquvi 2>/dev/null`
43       PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.24],
44       [PKG_CHECK_MODULES([libcurl], [libcurl >= 7.21], [with_tests=yes])])
45     ])
46   ], [with_tests=no])
47 AM_CONDITIONAL([WITH_TESTS], [test x"$with_tests" = "xyes"])
49 # --with-nsfw
50 AC_ARG_WITH([nsfw],
51   [AS_HELP_STRING([--with-nsfw],
52     [Install scripts marked as "NSFW" @<:@default=no@:>@])],
53   [], [with_nsfw=no])
54 AM_CONDITIONAL([WITH_NSFW], [test x"$with_nsfw" != "xno"])
56 # --with-fixme
57 AC_ARG_WITH([fixme],
58   [AS_HELP_STRING([--with-fixme],
59     [Install scripts marked as "FIXME" @<:@default=no@:>@])],
60   [], [with_fixme=no])
61 AM_CONDITIONAL([WITH_FIXME], [test x"$with_fixme" != "xno"])
63 # --with-geoblocked
64 AC_ARG_WITH([geoblocked],
65   [AS_HELP_STRING([--with-geoblocked],
66     [Install scripts marked as "geoblocked" @<:@default=yes@:>@])],
67   [], [with_geoblocked=yes])
68 AM_CONDITIONAL([WITH_GEOBLOCKED], [test x"$with_geoblocked" = "xyes"])
70 # --with-manual
71 AC_ARG_WITH([manual],
72   [AS_HELP_STRING([--with-manual],
73     [Install manual page(s) @<:@default=yes@:>@])],
74   [], [with_manual=yes])
75 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
77 # Version: Major/minor -pair, used to symlink
78 # from
79 #   $prefix/share/libquvi-scripts/$version/
80 # to
81 #   $prefix/share/libquvi-scripts/$major.$minor/
82 VERSION_MM=`$srcdir/gen-ver.sh -c -m`
83 AC_SUBST([VERSION_MM])
85 VN_C=`$srcdir/gen-ver.sh -c` # Use this value in the .pc file
86 AC_SUBST([VN_C])
88 AC_CONFIG_FILES([
89   Makefile
90   doc/Makefile
91   doc/man7/Makefile
92   share/Makefile
93   tests/Makefile
94   tests/lib/Makefile
95   libquvi-scripts-0.9.pc])
96 AC_OUTPUT
98 AC_MSG_NOTICE([
99   version       ${VERSION}
100   prefix        ${prefix}
101   compiler      ${CC}
102   cflags        ${CFLAGS}
103 Testsuite options
104   with
105   - tests       ${with_tests}
106     - libquvi .pc modversion ${libquvi_modver}
107 Install options
108   with
109   - geoblocked  ${with_geoblocked}
110   - fixme       ${with_fixme}
111   - nsfw        ${with_nsfw}])