Workaround: AM_PROG_AR
[libquvi-scripts.git] / configure.ac
blobf1fdc15620c14d8ac84eb42d979464e8ec9a9aa0
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 # --with-tests
34 pkg_libquvi=libquvi-0.9
35 AC_ARG_WITH([tests],
36   [AS_HELP_STRING([--with-tests],
37     [Enable tests for scripts @<:@default=no@:>@])],
38   [PKG_CHECK_MODULES([libquvi], ["$pkg_libquvi" >= 0.9],
39     [libquvi_modver=`$PKG_CONFIG --modversion $pkg_libquvi 2>/dev/null`
40       PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.24],
41       [PKG_CHECK_MODULES([libcurl], [libcurl >= 7.21], [with_tests=yes])])
42     ])
43   ], [with_tests=no])
44 AM_CONDITIONAL([WITH_TESTS], [test x"$with_tests" = "xyes"])
46 # --with-nsfw
47 AC_ARG_WITH([nsfw],
48   [AS_HELP_STRING([--with-nsfw],
49     [Install scripts marked as "NSFW" @<:@default=no@:>@])],
50   [], [with_nsfw=no])
51 AM_CONDITIONAL([WITH_NSFW], [test x"$with_nsfw" != "xno"])
53 # --with-fixme
54 AC_ARG_WITH([fixme],
55   [AS_HELP_STRING([--with-fixme],
56     [Install scripts marked as "FIXME" @<:@default=no@:>@])],
57   [], [with_fixme=no])
58 AM_CONDITIONAL([WITH_FIXME], [test x"$with_fixme" != "xno"])
60 # --with-geoblocked
61 AC_ARG_WITH([geoblocked],
62   [AS_HELP_STRING([--with-geoblocked],
63     [Install scripts marked as "geoblocked" @<:@default=yes@:>@])],
64   [], [with_geoblocked=yes])
65 AM_CONDITIONAL([WITH_GEOBLOCKED], [test x"$with_geoblocked" = "xyes"])
67 # --with-manual
68 AC_ARG_WITH([manual],
69   [AS_HELP_STRING([--with-manual],
70     [Install manual page(s) @<:@default=yes@:>@])],
71   [], [with_manual=yes])
72 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
74 # Version: Major/minor -pair, used to symlink
75 # from
76 #   $prefix/share/libquvi-scripts/$version/
77 # to
78 #   $prefix/share/libquvi-scripts/$major.$minor/
79 VERSION_MM=`$srcdir/gen-ver.sh -c -m`
80 AC_SUBST([VERSION_MM])
82 VN_C=`$srcdir/gen-ver.sh -c` # Use this value in the .pc file
83 AC_SUBST([VN_C])
85 AC_CONFIG_FILES([
86   Makefile
87   doc/Makefile
88   doc/man7/Makefile
89   share/Makefile
90   tests/Makefile
91   tests/lib/Makefile
92   libquvi-scripts-0.9.pc])
93 AC_OUTPUT
95 AC_MSG_NOTICE([
96   version       ${VERSION}
97   prefix        ${prefix}
98   compiler      ${CC}
99   cflags        ${CFLAGS}
100 Testsuite options
101   with
102   - tests       ${with_tests}
103     - libquvi .pc modversion ${libquvi_modver}
104 Install options
105   with
106   - geoblocked  ${with_geoblocked}
107   - fixme       ${with_fixme}
108   - nsfw        ${with_nsfw}])