blob: 10a5efe9a455c4017d257b951c7b3f61998b8aa1 [file] [log] [blame]
Eitan Isaacson109996e2008-12-20 14:52:53 +00001# Process this file with autoconf to produce a configure script.
2
Christian Egli84b1a812014-05-06 14:28:14 +00003AC_PREREQ(2.68)
Christian Egli96a0a8d2015-06-01 15:49:21 +02004AC_INIT([Liblouis], [2.6.3], [liblouis-liblouisxml@freelists.org], [liblouis], [http://www.liblouis.org])
Eitan Isaacson109996e2008-12-20 14:52:53 +00005AC_CONFIG_SRCDIR([liblouis/lou_backTranslateString.c])
Christian Egli4255aa22009-10-08 09:34:06 +00006AM_CONFIG_HEADER(liblouis/config.h)
Christian Eglib7159412009-10-30 11:14:49 +00007
8AC_CONFIG_AUX_DIR([build-aux])
9AC_CONFIG_MACRO_DIR([m4])
Christian Egli84b1a812014-05-06 14:28:14 +000010AM_INIT_AUTOMAKE
Eitan Isaacson109996e2008-12-20 14:52:53 +000011
12# Checks for programs.
13AC_PROG_CC
Christian Egli4255aa22009-10-08 09:34:06 +000014
Christian Egli31ef6ff2015-06-05 11:22:36 +020015# gnulib for the library
Christian Egli4255aa22009-10-08 09:34:06 +000016gl_EARLY
Christian Egli31ef6ff2015-06-05 11:22:36 +020017# gnulib for the tools
18gl_tools_EARLY
19
Christian Egli4255aa22009-10-08 09:34:06 +000020gl_INIT
Christian Egli31ef6ff2015-06-05 11:22:36 +020021gl_tools_INIT
Christian Egli311d52b2013-01-11 16:19:23 +000022
Christian Egli4255aa22009-10-08 09:34:06 +000023# Checks for more programs.
Eitan Isaacson109996e2008-12-20 14:52:53 +000024AC_PROG_INSTALL
25AC_PROG_LN_S
26AC_PROG_MAKE_SET
Eitan Isaacson109996e2008-12-20 14:52:53 +000027
28# Checks for libraries.
29
30# Checks for header files.
31AC_HEADER_STDC
32AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
33
34# Checks for typedefs, structures, and compiler characteristics.
35AC_C_CONST
36
37# Checks for library functions.
Eitan Isaacson109996e2008-12-20 14:52:53 +000038AC_FUNC_MEMCMP
Eitan Isaacson109996e2008-12-20 14:52:53 +000039AC_FUNC_VPRINTF
40AC_CHECK_FUNCS([memset])
41
42# This is for stuff that absolutely must end up in pyconfig.h.
43# Please use pyport.h instead, if possible.
44AH_TOP([
45#ifndef LOUISCFG_H
46#define LOUISCFG_H
47])
48AH_BOTTOM([
49#endif /*LOUISCFG_H*/
50])
51
52# increment if the interface has additions, changes, removals.
Christian Egli96a0a8d2015-06-01 15:49:21 +020053LIBLOUIS_CURRENT=8
Eitan Isaacson109996e2008-12-20 14:52:53 +000054
Christian Egli5f8769f2014-12-01 11:38:15 +010055# increment any time the source changes; set to 0 if you increment
56# CURRENT
Christian Egli96a0a8d2015-06-01 15:49:21 +020057LIBLOUIS_REVISION=0
Eitan Isaacson109996e2008-12-20 14:52:53 +000058
Christian Egli5f8769f2014-12-01 11:38:15 +010059# increment if any interfaces have been added; set to 0 if any
60# interfaces have been changed or removed. removal has precedence over
61# adding, so set to 0 if both happened.
Christian Egli96a0a8d2015-06-01 15:49:21 +020062LIBLOUIS_AGE=6
Eitan Isaacson109996e2008-12-20 14:52:53 +000063
64AC_SUBST(LIBLOUIS_CURRENT)
65AC_SUBST(LIBLOUIS_REVISION)
66AC_SUBST(LIBLOUIS_AGE)
67
68AC_ISC_POSIX
69AC_HEADER_STDC
70AC_LIBTOOL_WIN32_DLL
Christian Eglib7159412009-10-30 11:14:49 +000071AC_PROG_LIBTOOL
Eitan Isaacson109996e2008-12-20 14:52:53 +000072
Christian Egli644ed622009-10-08 15:02:15 +000073# GNU help2man creates man pages from --help output; in many cases,
74# this is sufficient, and obviates the need to maintain man pages
75# separately. However, some developers do not have it so we do not
76# make its use mandatory.
Christian Eglie63b3592010-01-26 14:28:33 +000077if test "x$cross_compiling" = xyes; then
78 AC_MSG_WARN([cannot generate manual pages while cross compiling])
79else
80 AC_CHECK_PROG([HELP2MAN], [help2man], [help2man])
81fi
Christian Egli644ed622009-10-08 15:02:15 +000082AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man])
83
Simon Aittamaabd5e6482014-11-25 19:39:51 +010084# Check for makeinfo version >= 5, required for building documentation.
Christian Egli5d9030a2015-03-16 22:38:47 +010085have_makeinfo_5=false
Simon Aittamaabd5e6482014-11-25 19:39:51 +010086AC_PROG_SED
87AC_CHECK_PROG([MAKEINFO_FOUND], [makeinfo], [yes])
88if test x"${MAKEINFO_FOUND}" = xyes
89then
90 MAKEINFO_VERSION_REQ=5
Christian Egli774d74b2014-11-26 11:03:50 +010091 AC_MSG_CHECKING([for makeinfo version >= $MAKEINFO_VERSION_REQ])
Bert Frees0c56d1e2014-12-28 14:20:32 +010092 MAKEINFO_VERSION=`makeinfo --version | sed -ne 's/^makeinfo .* \([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*$/\1/p'`
Simon Aittamaabd5e6482014-11-25 19:39:51 +010093 if test x$MAKEINFO_VERSION = x -o 0$MAKEINFO_VERSION -lt $MAKEINFO_VERSION_REQ
94 then
95 AC_MSG_RESULT([no])
Christian Egli674844e2015-03-12 13:56:49 +010096 AC_MSG_WARN([Program 'makeinfo' version >= $MAKEINFO_VERSION_REQ is required. Documentation will not be built.])
Simon Aittamaabd5e6482014-11-25 19:39:51 +010097 else
98 AC_MSG_RESULT([yes])
Christian Egli674844e2015-03-12 13:56:49 +010099 have_makeinfo_5=true
Simon Aittamaabd5e6482014-11-25 19:39:51 +0100100 fi
101else
Christian Egli25ef16b2015-05-22 12:22:52 +0200102 AC_MSG_WARN([Missing program 'makeinfo', Documentation will not be built. Please install you you want documentation or refer to online resources.])
Simon Aittamaabd5e6482014-11-25 19:39:51 +0100103fi
Christian Egli674844e2015-03-12 13:56:49 +0100104AM_CONDITIONAL([HAVE_MAKEINFO_5], [test x$have_makeinfo_5 = xtrue])
Simon Aittamaabd5e6482014-11-25 19:39:51 +0100105
Christian Egli66cfe502012-03-01 14:50:42 +0000106# Check if we have Python installed
107AM_PATH_PYTHON([2.6],, [:])
108AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
109
Eitan Isaacson109996e2008-12-20 14:52:53 +0000110AC_PATH_PROG(PKG_CONFIG, pkg-config)
111
112AC_ARG_ENABLE(ucs4,
Christian Egli697a0d22014-03-03 09:46:35 +0000113 AC_HELP_STRING(--enable-ucs4, Enable 4 byte-wide characters),
Eitan Isaacson109996e2008-12-20 14:52:53 +0000114 [],
115 [enable_ucs4=no])
116
Christian Eglibbf00fd2009-11-12 10:02:23 +0000117AC_MSG_CHECKING([whether 4 byte-wide characters should be supported])
118AC_MSG_RESULT($enable_ucs4)
Eitan Isaacson109996e2008-12-20 14:52:53 +0000119
120case "$enable_ucs4" in
Christian Eglibbf00fd2009-11-12 10:02:23 +0000121yes) WIDECHAR_TYPE='unsigned int';;
122*) WIDECHAR_TYPE='unsigned short int';;
Eitan Isaacson109996e2008-12-20 14:52:53 +0000123esac
Christian Eglibbf00fd2009-11-12 10:02:23 +0000124AC_SUBST(WIDECHAR_TYPE)
Christian Egli33ded852012-03-20 14:13:30 +0000125AM_CONDITIONAL([HAVE_UCS4], [test x$enable_ucs4 = xyes])
Eitan Isaacson109996e2008-12-20 14:52:53 +0000126
James Teh75bfbe22009-01-20 12:19:47 +0000127case $host in
128 *mingw* | *cygwin*)
James Teh115fb832009-02-14 00:47:32 +0000129 CFLAGS="$CFLAGS -Wl,--add-stdcall-alias"
Michael Whapples2bea4c82014-09-23 15:29:59 +0100130 LDFLAGS="$LDFLAGS -avoid-version"
James Teh75bfbe22009-01-20 12:19:47 +0000131 ;;
132esac
133
John Boyer9bfed872011-06-12 22:56:54 +0000134AC_CONFIG_FILES([
135 Makefile
136 doc/Makefile
137 man/Makefile
138 liblouis/Makefile
139 liblouis/liblouis.h
140 windows/Makefile
141 windows/include/Makefile
142 tables/Makefile
143 liblouis.pc
144 tests/Makefile
Christian Eglibb8a27b2014-03-03 09:43:05 +0000145 tests/resolve_table.h
John Boyer9bfed872011-06-12 22:56:54 +0000146 tests/tables/Makefile
Christian Egli98e193a2012-05-31 15:07:11 +0000147 tests/tables/moreTables/Makefile
Christian Egli393e0d92014-02-28 12:51:51 +0000148 tests/tables/resolve_table/Makefile
149 tests/tables/resolve_table/dir_1/Makefile
150 tests/tables/resolve_table/dir_1/dir_1.1/Makefile
151 tests/tables/resolve_table/dir_2/Makefile
Christian Egli2a576052015-05-29 14:10:05 +0200152 tests/tablesWithMetadata/Makefile
Christian Egli66cfe502012-03-01 14:50:42 +0000153 tests/doctests/Makefile
Christian Eglicc1a0a42012-03-02 13:34:09 +0000154 tests/harness/Makefile
Mesar Hameed96f30d82012-07-20 08:43:00 +0000155 tests/harnessSources/Makefile
John Boyer9bfed872011-06-12 22:56:54 +0000156 python/Makefile
157 python/louis/Makefile
158 tools/Makefile
Christian Egli31ef6ff2015-06-05 11:22:36 +0200159 tools/gnulib/Makefile
John Boyer9bfed872011-06-12 22:56:54 +0000160 gnulib/Makefile
161 m4/Makefile])
Eitan Isaacson109996e2008-12-20 14:52:53 +0000162AC_OUTPUT
163