Rename get_message_id() to convert_message_id().
[shigofumi.git] / configure.ac
blob4a2851567095eb88b1320c9b57ee1b9acadcf9cb
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ([2.63])
5 AC_INIT([shigofumi], [0.1], [petr.pisar@atlas.cz])
6 AM_INIT_AUTOMAKE(shigofumi, 0.1)
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.5)
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 # Find DocBook XSLT sheets
57 AC_CHECK_PROG([HAVE_XSLTPROC], [xsltproc], [yes])
58 AC_ARG_WITH(docbook-xsl-stylesheets,
59             [AS_HELP_STRING([--with-docbook-xsl-stylesheets=DIR],
60                     [Specify XSL style sheet root directory for manual page
61                      regeneration from DocBook source])],
62             , with_docbook_xsl_stylesheets=yes)
63 AS_IF([test "$with_docbook_xsl_stylesheets" = "no"],
64     AC_MSG_WARN([Make sure you have sources with pregenerated manual pages.]),
66     AS_IF([test "$HAVE_XSLTPROC" != "yes"], 
67           AS_IF([test "$with_docbook_xsl_stylesheets" = "yes"],
68                 AC_MSG_WARN([Missing xsltproc!]),
69                 AC_MSG_FAILURE([Missing xsltproc!])
70                 )
71           )
72     DOCBOOK_STYLE="/usr/share/sgml/docbook/xsl-stylesheets"
73     AS_IF([test "$with_docbook_xsl_stylesheets" != "yes"],
74         [DOCBOOK_STYLE="$with_docbook_xsl_stylesheets"])
75     AC_MSG_CHECKING([for DocBook XSLT stylesheet location in "$DOCBOOK_STYLE"])
76     AS_IF([echo '<para/>' |
77            xsltproc "${DOCBOOK_STYLE}/manpages/docbook.xsl" - 2>/dev/null],
78           AC_MSG_RESULT([ok]) AC_SUBST(DOCBOOK_STYLE),
79           DOCBOOK_STYLE=""
80           AS_IF([test "$with_docbook_xsl_stylesheets" = "yes"],
81                 AC_MSG_WARN([missing!]),
82                 AC_MSG_FAILURE([missing!])
83                 )
84           )
85     
87 AS_IF([test "$HAVE_XSLTPROC" != "yes"],
88       AC_MSG_WARN([Missing xsltproc. Make sure you have sources with
89                    pregenerated manual pages.]))
90 AM_CONDITIONAL([BUILD_MAN], [test -n "$DOCBOOK_STYLE"])
92 # Check for po4a needed to generate DocBook manual sources for gettext
93 # catalogues
94 AS_IF([test "$USE_NLS" = "yes"],
95     AC_CHECK_PROG([HAVE_PO4A], [po4a], [yes])
96     AS_IF([test "$HAVE_PO4A" != "yes"],
97           AC_MSG_WARN([Missing po4a. Make sure you have sources with
98                        pregenerated localized manual pages.])
99     )
101 AM_CONDITIONAL([BUILD_MANPO], [test "$HAVE_PO4A" = "yes"])
103 # Check for extended attributes
104 # XXX: AC_CHECK_HEADER() must be in top level scope
105 AC_CHECK_HEADER([attr/xattr.h], [have_xattr=yes], [have_xattr=no])
106 AC_ARG_ENABLE(xattr, [AS_HELP_STRING([--disable-xattr],
107                         [Disable extended attribute support])])
108 AS_IF([test "$enable_xattr" = "no"],
109     AC_MSG_WARN([Extended attribute support disabled]),
110     AS_IF([test "$have_xattr" = "yes"],
111         AC_DEFINE([ENABLE_XATTR], [1],
112             [Define if you want support extended attributes]),
113         AS_IF([test "$enable_xattr" = "yes"],
114             AC_MSG_FAILURE([Glibc style extended attributes not supported]),
115             AC_MSG_WARN([Glibc style extended attributes not supported])
116         )
117     )
121 # Checks for header files.
122 AC_CHECK_HEADERS([fcntl.h langinfo.h limits.h locale.h stdint.h stdlib.h string.h termios.h unistd.h wchar.h])
124 # Checks for typedefs, structures, and compiler characteristics.
125 AC_TYPE_SIZE_T
126 AC_TYPE_SSIZE_T
127 AC_TYPE_UINT8_T
129 # Checks for library functions.
130 AC_FUNC_MALLOC
131 AC_FUNC_MBRTOWC
132 AC_FUNC_MMAP
133 AC_FUNC_REALLOC
134 AC_FUNC_STRCOLL
135 AC_CHECK_FUNCS([getcwd localtime_r memset munmap nl_langinfo setenv setlocale strdup strerror strtol tzset wcwidth])
137 # Default CFLAGS
138 CFLAGS="${CFLAGS} -std=c99 -Wall"
140 AC_CONFIG_FILES([Makefile doc/Makefile doc/po/Makefile doc/po/po4a-build.conf doc/po/cs/Makefile po/Makefile.in src/Makefile])
141 AC_OUTPUT