Use subdir-objects Automake option
[libquvi-scripts.git] / configure.ac
blob5de9872c5dcbf8a5169848875e3716f61c6fe536
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
15                   tar-ustar subdir-objects])
16 AM_SILENT_RULES([yes])
18 # GNU Automake 1.12 requires this macro. Earlier versions do not
19 # recognize this macro. Work around this.
20 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
22 LT_INIT([disable-static])
23 LT_PREREQ([2.2.6])
25 # Checks for programs.
26 AC_PROG_CC
27 AM_PROG_CC_C_O
28 AC_PROG_LN_S
30 AC_PATH_PROG([A2X], [a2x], [no])
31 AM_CONDITIONAL([HAVE_A2X], [test x"$A2X" != "xno"])
32 AC_SUBST([A2X])
34 AS_IF([test x"$A2X" = "xno" && test -d "$srcdir/.git"],
35   AC_MSG_ERROR([a2x is required to create man pages when building from git])])
37 # Check for headers.
38 AC_CHECK_HEADERS([string.h])
40 # Check for functions.
41 AC_CHECK_FUNCS([memset])
43 # --with-tests
44 pkg_libquvi=libquvi-0.9
45 AC_ARG_WITH([tests],
46   [AS_HELP_STRING([--with-tests],
47     [Enable tests for scripts @<:@default=no@:>@])],
48   [PKG_CHECK_MODULES([libquvi], ["$pkg_libquvi" >= 0.9],
49     [libquvi_modver=`$PKG_CONFIG --modversion $pkg_libquvi 2>/dev/null`
50       PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.24],
51       [PKG_CHECK_MODULES([libcurl], [libcurl >= 7.21], [with_tests=yes])])
52     ])
53   ], [with_tests=no])
54 AM_CONDITIONAL([WITH_TESTS], [test x"$with_tests" = "xyes"])
56 # --with-nsfw
57 AC_ARG_WITH([nsfw],
58   [AS_HELP_STRING([--with-nsfw],
59     [Install scripts marked as "NSFW" @<:@default=no@:>@])],
60   [], [with_nsfw=no])
61 AM_CONDITIONAL([WITH_NSFW], [test x"$with_nsfw" != "xno"])
63 # --with-fixme
64 AC_ARG_WITH([fixme],
65   [AS_HELP_STRING([--with-fixme],
66     [Install scripts marked as "FIXME" @<:@default=no@:>@])],
67   [], [with_fixme=no])
68 AM_CONDITIONAL([WITH_FIXME], [test x"$with_fixme" != "xno"])
70 # --with-geoblocked
71 AC_ARG_WITH([geoblocked],
72   [AS_HELP_STRING([--with-geoblocked],
73     [Install scripts marked as "geoblocked" @<:@default=yes@:>@])],
74   [], [with_geoblocked=yes])
75 AM_CONDITIONAL([WITH_GEOBLOCKED], [test x"$with_geoblocked" = "xyes"])
77 # --with-manual
78 AC_ARG_WITH([manual],
79   [AS_HELP_STRING([--with-manual],
80     [Install manual page(s) @<:@default=yes@:>@])],
81   [], [with_manual=yes])
82 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
84 # Version: Major/minor -pair, used to symlink
85 # from
86 #   $prefix/share/libquvi-scripts/$version/
87 # to
88 #   $prefix/share/libquvi-scripts/$major.$minor/
89 VERSION_MM=`$srcdir/gen-ver.sh -c -m`
90 AC_SUBST([VERSION_MM])
92 VN_C=`$srcdir/gen-ver.sh -c` # Use this value in the .pc file
93 AC_SUBST([VN_C])
95 AC_CONFIG_FILES([
96   Makefile
97   doc/Makefile
98   doc/man7/Makefile
99   share/Makefile
100   tests/Makefile
101   tests/lib/Makefile
102   libquvi-scripts-0.9.pc])
103 AC_OUTPUT
105 AC_MSG_NOTICE([
106   version       ${VERSION}
107   prefix        ${prefix}
108   compiler      ${CC}
109   cflags        ${CFLAGS}
110 Testsuite options
111   with
112   - tests       ${with_tests}
113     - libquvi .pc modversion ${libquvi_modver}
114 Install options
115   with
116   - geoblocked  ${with_geoblocked}
117   - fixme       ${with_fixme}
118   - nsfw        ${with_nsfw}])
120 # vim: set ts=2 sw=2 tw=72 expandtab: