Merge https://github.com/luolimao/cclive into next
[cclive.git] / configure.ac
bloba08eedd498ae17ac6304294fa7f541d838ed99ea
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ([2.69])
6 AC_INIT([cclive], m4_esyscmd([./gen-ver.sh -c | tr -d '\n']),
7         [http://cclive.sf.net/bugs/],[],[http://cclive.sf.net/])
9 AC_CONFIG_SRCDIR([src/cc/application.cpp])
10 AC_CONFIG_HEADERS([config.h])
11 AC_CONFIG_AUX_DIR([config.aux])
12 AC_CONFIG_MACRO_DIR([m4])
14 AC_CANONICAL_TARGET
15 AC_USE_SYSTEM_EXTENSIONS
17 AC_DEFINE_UNQUOTED([CANONICAL_TARGET], "$target",
18   [Define to canonical target])
20 AM_INIT_AUTOMAKE([1.11.1 -Wall -Werror dist-xz no-dist-gzip tar-ustar])
21 AM_SILENT_RULES([yes])
23 # GNU Automake 1.12 requires this macro. Earlier versions do not
24 # recognize this macro. Work around this.
25 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
27 LT_INIT([disable-static])
28 LT_PREREQ([2.2.6])
30 # Checks for programs.
31 AC_PROG_CXX
32 AC_PROG_CC
33 AC_PROG_CPP
34 AC_PROG_LN_S
36 AC_DEFINE_UNQUOTED([CXXFLAGS], "$CXXFLAGS", [Define to compiler flags])
37 AC_DEFINE_UNQUOTED([CXX], "$CXX", [Define to compiler])
39 AC_PATH_PROG([DATE], [date], [no])
40 AS_IF([test x"$DATE" != "xno"], [build_time=`$DATE +"%F %T %z"`])
41 AC_DEFINE_UNQUOTED([BUILD_TIME], ["$build_time"], [We have build time])
43 AC_PATH_PROG([A2X], [a2x], [no])
44 AM_CONDITIONAL([HAVE_A2X], [test x"$A2X" != "xno"])
45 AC_SUBST([A2X])
47 AS_IF([test x"$A2X" = "xno" && test -d "$srcdir/.git"],
48   AC_MSG_ERROR([a2x is required to create man pages when building from git])])
50 # Checks for libraries.
52 have_libquvi_0_9=
53 PKG_CHECK_MODULES([libquvi], [libquvi-0.9 >= 0.9],
54   [
55     AC_DEFINE([HAVE_LIBQUVI_0_9], [1], [We have libquvi 0.9])
56     have_libquvi_0_9=yes
57   ],
58   [PKG_CHECK_MODULES([libquvi], [libquvi >= 0.4])])
59 AM_CONDITIONAL([HAVE_LIBQUVI_0_9], [test x"$have_libquvi_0_9" = "xyes"])
61 PKG_CHECK_MODULES([libcurl], [libcurl >= 7.18.0])
62 PKG_CHECK_MODULES([libpcre], [libpcre >= 8.02])
63 PKG_CHECK_MODULES([libpcrecpp], [libpcrecpp >= 8.02])
64 PKG_CHECK_MODULES([glibmm], [glibmm-2.4 >= 2.24])
65 PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.24])
67 BOOST_REQUIRE([1.49.0])
68 # Boost: Header-only libs
69 BOOST_FOREACH
70 BOOST_FORMAT
71 # Boost: Libs requiring linking
72 BOOST_DATE_TIME
73 BOOST_PROGRAM_OPTIONS
74 BOOST_IOSTREAMS
75 BOOST_FILESYSTEM
76 BOOST_SYSTEM
78 # Checks for header files.
79 AC_CHECK_HEADERS([sys/ioctl.h unistd.h sys/types.h sys/stat.h signal.h])
81 # Checks for typedefs, structures, and compiler characteristics.
82 AC_HEADER_STDBOOL
83 AC_TYPE_SIZE_T
84 AC_TYPE_PID_T
85 AC_C_INLINE
87 # Checks for library functions.
88 AC_CHECK_FUNCS([strerror strstr getpid signal memset setlocale])
89 AC_FUNC_ERROR_AT_LINE
90 AC_FUNC_STRERROR_R
91 AC_FUNC_FORK
93 # Version.
94 VN=`$srcdir/gen-ver.sh`
95 AC_DEFINE_UNQUOTED([VN],["$VN"], [We have version number from gen-ver.sh])
97 # --with-manual
98 AC_ARG_WITH([manual],
99   [AS_HELP_STRING([--with-manual],
100     [Install manual page(s) @<:@default=yes@:>@])],
101   [],
102   [with_manual=yes])
103 AM_CONDITIONAL([WITH_MANUAL], [test x"$with_manual" != "xno"])
105 # --enable-ccl
106 AC_ARG_ENABLE([ccl],
107   [AS_HELP_STRING([--enable-ccl],
108     [Symlink from 'cclive' executable to 'ccl' @<:@default=yes@:>@])],
109   [],
110   [enable_ccl=yes])
111 AM_CONDITIONAL([ENABLE_CCL], [test x"$enable_ccl" = "xyes"])
113 AC_CONFIG_FILES([
114   Makefile
115   doc/Makefile
116   doc/man1/Makefile
117   src/Makefile
120 AC_OUTPUT
122 AC_MSG_NOTICE([
123   version:    ${VERSION}
124   prefix:     ${prefix}
125   compiler:   ${CXX}
126   flags:      ${CXXFLAGS}
127 System types:
128   target      ${target}
129   build       ${build}
130   host        ${host}
131 Options:
132   add ccl symlink: ${enable_ccl}
133   install manual : ${with_manual}])
135 # vim: set ts=2 sw=2 tw=72 expandtab: