Add configuration option `confirm_send' to control compose confirmation
[shigofumi.git] / configure.ac
blobd2d2ecbabb247fc9fc4b140ecd9492b075c8e81a
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ([2.63])
5 AC_INIT([shigofumi], [0.2], [petr.pisar@atlas.cz])
6 AM_INIT_AUTOMAKE(shigofumi, 0.2)
7 AC_CONFIG_SRCDIR([src/shigofumi.c])
8 AC_CONFIG_MACRO_DIR([m4])
9 AC_CONFIG_HEADERS([src/config.h])
11 # Checks for programs.
12 AC_PROG_CC
13 AC_PROG_CPP
16 # Enable debug
17 AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],
18                         [Compile in debugging mode])])
19 AS_IF([test "$enable_debug" = "yes"],
20       CFLAGS="${CFLAGS} -g"
21       dnl AC_SUBST(DEBUG_CFLAGS)
22       AC_DEFINE([ENABLE_DEBUG], [1],
23                 [Define if you want include debugging code])
24       )
26 # Enable gettext
27 AM_GNU_GETTEXT_VERSION([0.17])
28 AM_GNU_GETTEXT([external])
29 AM_CONDITIONAL([BUILD_NLS], [test "$USE_NLS" = "yes"])
31 # Checks for libraries.
32 # Check for libisds
33 AC_SYS_LARGEFILE
34 PKG_CHECK_MODULES([ISDS], libisds >= 0.6)
36 # Check for confuse
37 # TODO: Minimal version
38 PKG_CHECK_MODULES([CONFUSE], libconfuse)
40 # Check for magic
41 # TODO: Minimal version
42 AC_CHECK_LIB([magic], [magic_open])
44 # Check for readline
45 # TODO: Minimal version
46 AC_CHECK_LIB([readline], [readline])
49 # Consider compiler warnings as errors by default
50 AC_ARG_ENABLE(fatalwarnings, [AS_HELP_STRING([--disable-fatalwarnings],
51                                       [Do not consider compiler warnings as
52                                        errors])])
53 AS_IF([test "$enable_fatalwarnings" = "no"], , CFLAGS="${CFLAGS} -Werror")
56 # Install (and build if needed) documentation
57 AC_ARG_ENABLE(doc, [AS_HELP_STRING([--disable-doc],
58               [Do not install documentation])])
59 AM_CONDITIONAL([BUILD_DOC], [test "$enable_doc" != "no"])
61 AS_IF([test "$enable_doc" = "no"], , [
62     # Find DocBook XSLT sheets
63     AC_CHECK_PROG([HAVE_XSLTPROC], [xsltproc], [yes])
64     AC_ARG_WITH(docbook-xsl-stylesheets,
65                 [AS_HELP_STRING([--with-docbook-xsl-stylesheets=DIR],
66                         [Specify XSL style sheet root directory for manual page
67                          regeneration from DocBook source])],
68                 , with_docbook_xsl_stylesheets=yes)
70     AS_IF([test "$with_docbook_xsl_stylesheets" = "no"],
71         AC_MSG_WARN([Make sure you have sources with pregenerated manual pages.]),
73         AS_IF([test "$HAVE_XSLTPROC" != "yes"], 
74               AS_IF([test "$with_docbook_xsl_stylesheets" = "yes"],
75                     AC_MSG_WARN([Missing xsltproc!]),
76                     AC_MSG_FAILURE([Missing xsltproc!])
77                     )
78               )
79         DOCBOOK_STYLE="/usr/share/sgml/docbook/xsl-stylesheets"
80         AS_IF([test "$with_docbook_xsl_stylesheets" != "yes"],
81             [DOCBOOK_STYLE="$with_docbook_xsl_stylesheets"])
82         AC_MSG_CHECKING([for DocBook XSLT stylesheet location in "$DOCBOOK_STYLE"])
83         AS_IF([echo '<para/>' |
84                xsltproc "${DOCBOOK_STYLE}/manpages/docbook.xsl" - 2>/dev/null],
85               AC_MSG_RESULT([ok]) AC_SUBST(DOCBOOK_STYLE),
86               DOCBOOK_STYLE=""
87               AS_IF([test "$with_docbook_xsl_stylesheets" = "yes"],
88                     AC_MSG_WARN([missing!]),
89                     AC_MSG_FAILURE([missing!])
90                     )
91               )
92         
93     )
94     AS_IF([test "$HAVE_XSLTPROC" != "yes"],
95           AC_MSG_WARN([Missing xsltproc. Make sure you have sources with
96                        pregenerated manual pages.]))
97     ]
99 AM_CONDITIONAL([BUILD_MAN], [test -n "$DOCBOOK_STYLE"])
102 AS_IF([test "$enable_doc" = "no"], ,
103     # Check for po4a needed to generate DocBook manual sources for gettext
104     # catalogues
105     AS_IF([test "$USE_NLS" = "yes"],
106         AC_CHECK_PROG([HAVE_PO4A], [po4a], [yes])
107         AS_IF([test "$HAVE_PO4A" != "yes"],
108               AC_MSG_WARN([Missing po4a. Make sure you have sources with
109                            pregenerated localized manual pages.])
110         )
111     )
113 AM_CONDITIONAL([BUILD_MANPO], [test "$HAVE_PO4A" = "yes"])
115 # Check for extended attributes
116 # XXX: AC_CHECK_HEADER() must be in top level scope
117 AC_CHECK_HEADER([attr/xattr.h], [have_xattr=yes], [have_xattr=no])
118 AC_ARG_ENABLE(xattr, [AS_HELP_STRING([--disable-xattr],
119                         [Disable extended attribute support])])
120 AS_IF([test "$enable_xattr" = "no"],
121     AC_MSG_WARN([Extended attribute support disabled]),
122     AS_IF([test "$have_xattr" = "yes"],
123         AC_DEFINE([ENABLE_XATTR], [1],
124             [Define if you want support extended attributes]),
125         AS_IF([test "$enable_xattr" = "yes"],
126             AC_MSG_FAILURE([Glibc style extended attributes not supported]),
127             AC_MSG_WARN([Glibc style extended attributes not supported])
128         )
129     )
133 # Checks for header files.
134 AC_CHECK_HEADERS([fcntl.h langinfo.h limits.h locale.h stdint.h stdlib.h string.h termios.h unistd.h wchar.h])
136 # Checks for typedefs, structures, and compiler characteristics.
137 AC_TYPE_SIZE_T
138 AC_TYPE_SSIZE_T
139 AC_TYPE_UINT8_T
141 # Checks for library functions.
142 AC_FUNC_MALLOC
143 AC_FUNC_MBRTOWC
144 AC_FUNC_MMAP
145 AC_FUNC_REALLOC
146 AC_FUNC_STRCOLL
147 AC_CHECK_FUNCS([getcwd localtime_r memset mkstemps munmap nl_langinfo setenv setlocale strdup strerror strtol tzset wcwidth])
149 # Default CFLAGS
150 CFLAGS="${CFLAGS} -std=c99 -Wall"
152 AC_CONFIG_FILES([Makefile doc/Makefile doc/po/Makefile doc/po/po4a-build.conf doc/po/cs/Makefile po/Makefile.in src/Makefile])
153 AC_OUTPUT