blob: ea4d2088c05859dd2dd56e5652404907e1b03245 [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 Egli55263cd2015-03-01 23:42:35 +01004AC_INIT([Liblouis], [2.6.2], [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
15# gnulib
16gl_EARLY
17gl_INIT
18
Christian Egli311d52b2013-01-11 16:19:23 +000019# make sure we have a decent malloc and realloc
20gl_FUNC_MALLOC_GNU
21if test $REPLACE_MALLOC = 1; then
22AC_LIBOBJ([malloc])
23fi
24gl_MODULE_INDICATOR([malloc-gnu])
25
26gl_FUNC_REALLOC_GNU
27if test $REPLACE_REALLOC = 1; then
28AC_LIBOBJ([realloc])
29fi
30gl_MODULE_INDICATOR([realloc-gnu])
31
Christian Egli4255aa22009-10-08 09:34:06 +000032# Checks for more programs.
Eitan Isaacson109996e2008-12-20 14:52:53 +000033AC_PROG_INSTALL
34AC_PROG_LN_S
35AC_PROG_MAKE_SET
Eitan Isaacson109996e2008-12-20 14:52:53 +000036
37# Checks for libraries.
38
39# Checks for header files.
40AC_HEADER_STDC
41AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
42
43# Checks for typedefs, structures, and compiler characteristics.
44AC_C_CONST
45
46# Checks for library functions.
Eitan Isaacson109996e2008-12-20 14:52:53 +000047AC_FUNC_MEMCMP
Eitan Isaacson109996e2008-12-20 14:52:53 +000048AC_FUNC_VPRINTF
49AC_CHECK_FUNCS([memset])
50
51# This is for stuff that absolutely must end up in pyconfig.h.
52# Please use pyport.h instead, if possible.
53AH_TOP([
54#ifndef LOUISCFG_H
55#define LOUISCFG_H
56])
57AH_BOTTOM([
58#endif /*LOUISCFG_H*/
59])
60
61# increment if the interface has additions, changes, removals.
Christian Egli529741b2014-09-01 13:55:25 +020062LIBLOUIS_CURRENT=7
Eitan Isaacson109996e2008-12-20 14:52:53 +000063
Christian Egli5f8769f2014-12-01 11:38:15 +010064# increment any time the source changes; set to 0 if you increment
65# CURRENT
Christian Egli55263cd2015-03-01 23:42:35 +010066LIBLOUIS_REVISION=2
Eitan Isaacson109996e2008-12-20 14:52:53 +000067
Christian Egli5f8769f2014-12-01 11:38:15 +010068# increment if any interfaces have been added; set to 0 if any
69# interfaces have been changed or removed. removal has precedence over
70# adding, so set to 0 if both happened.
Christian Egli529741b2014-09-01 13:55:25 +020071LIBLOUIS_AGE=5
Eitan Isaacson109996e2008-12-20 14:52:53 +000072
73AC_SUBST(LIBLOUIS_CURRENT)
74AC_SUBST(LIBLOUIS_REVISION)
75AC_SUBST(LIBLOUIS_AGE)
76
77AC_ISC_POSIX
78AC_HEADER_STDC
79AC_LIBTOOL_WIN32_DLL
Christian Eglib7159412009-10-30 11:14:49 +000080AC_PROG_LIBTOOL
Eitan Isaacson109996e2008-12-20 14:52:53 +000081
Christian Egli644ed622009-10-08 15:02:15 +000082# GNU help2man creates man pages from --help output; in many cases,
83# this is sufficient, and obviates the need to maintain man pages
84# separately. However, some developers do not have it so we do not
85# make its use mandatory.
Christian Eglie63b3592010-01-26 14:28:33 +000086if test "x$cross_compiling" = xyes; then
87 AC_MSG_WARN([cannot generate manual pages while cross compiling])
88else
89 AC_CHECK_PROG([HELP2MAN], [help2man], [help2man])
90fi
Christian Egli644ed622009-10-08 15:02:15 +000091AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man])
92
Simon Aittamaabd5e6482014-11-25 19:39:51 +010093# Check for makeinfo version >= 5, required for building documentation.
94AC_PROG_SED
95AC_CHECK_PROG([MAKEINFO_FOUND], [makeinfo], [yes])
96if test x"${MAKEINFO_FOUND}" = xyes
97then
98 MAKEINFO_VERSION_REQ=5
Christian Egli774d74b2014-11-26 11:03:50 +010099 AC_MSG_CHECKING([for makeinfo version >= $MAKEINFO_VERSION_REQ])
Bert Frees0c56d1e2014-12-28 14:20:32 +0100100 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 +0100101 if test x$MAKEINFO_VERSION = x -o 0$MAKEINFO_VERSION -lt $MAKEINFO_VERSION_REQ
102 then
103 AC_MSG_RESULT([no])
104 AC_MSG_ERROR([Program 'makeinfo' version >= $MAKEINFO_VERSION_REQ is required.])
105 else
106 AC_MSG_RESULT([yes])
107 fi
108else
109 AC_MSG_ERROR([Missing program 'makeinfo', please install.)])
110fi
111
Christian Egli66cfe502012-03-01 14:50:42 +0000112# Check if we have Python installed
113AM_PATH_PYTHON([2.6],, [:])
114AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
115
Eitan Isaacson109996e2008-12-20 14:52:53 +0000116AC_PATH_PROG(PKG_CONFIG, pkg-config)
117
118AC_ARG_ENABLE(ucs4,
Christian Egli697a0d22014-03-03 09:46:35 +0000119 AC_HELP_STRING(--enable-ucs4, Enable 4 byte-wide characters),
Eitan Isaacson109996e2008-12-20 14:52:53 +0000120 [],
121 [enable_ucs4=no])
122
Christian Eglibbf00fd2009-11-12 10:02:23 +0000123AC_MSG_CHECKING([whether 4 byte-wide characters should be supported])
124AC_MSG_RESULT($enable_ucs4)
Eitan Isaacson109996e2008-12-20 14:52:53 +0000125
126case "$enable_ucs4" in
Christian Eglibbf00fd2009-11-12 10:02:23 +0000127yes) WIDECHAR_TYPE='unsigned int';;
128*) WIDECHAR_TYPE='unsigned short int';;
Eitan Isaacson109996e2008-12-20 14:52:53 +0000129esac
Christian Eglibbf00fd2009-11-12 10:02:23 +0000130AC_SUBST(WIDECHAR_TYPE)
Christian Egli33ded852012-03-20 14:13:30 +0000131AM_CONDITIONAL([HAVE_UCS4], [test x$enable_ucs4 = xyes])
Eitan Isaacson109996e2008-12-20 14:52:53 +0000132
James Teh75bfbe22009-01-20 12:19:47 +0000133case $host in
134 *mingw* | *cygwin*)
James Teh115fb832009-02-14 00:47:32 +0000135 CFLAGS="$CFLAGS -Wl,--add-stdcall-alias"
Michael Whapples2bea4c82014-09-23 15:29:59 +0100136 LDFLAGS="$LDFLAGS -avoid-version"
James Teh75bfbe22009-01-20 12:19:47 +0000137 ;;
138esac
139
John Boyer9bfed872011-06-12 22:56:54 +0000140AC_CONFIG_FILES([
141 Makefile
142 doc/Makefile
143 man/Makefile
144 liblouis/Makefile
145 liblouis/liblouis.h
146 windows/Makefile
147 windows/include/Makefile
148 tables/Makefile
149 liblouis.pc
150 tests/Makefile
Christian Eglibb8a27b2014-03-03 09:43:05 +0000151 tests/resolve_table.h
John Boyer9bfed872011-06-12 22:56:54 +0000152 tests/tables/Makefile
Christian Egli98e193a2012-05-31 15:07:11 +0000153 tests/tables/moreTables/Makefile
Christian Egli393e0d92014-02-28 12:51:51 +0000154 tests/tables/resolve_table/Makefile
155 tests/tables/resolve_table/dir_1/Makefile
156 tests/tables/resolve_table/dir_1/dir_1.1/Makefile
157 tests/tables/resolve_table/dir_2/Makefile
Christian Egli66cfe502012-03-01 14:50:42 +0000158 tests/doctests/Makefile
Christian Eglicc1a0a42012-03-02 13:34:09 +0000159 tests/harness/Makefile
Mesar Hameed96f30d82012-07-20 08:43:00 +0000160 tests/harnessSources/Makefile
John Boyer9bfed872011-06-12 22:56:54 +0000161 python/Makefile
162 python/louis/Makefile
163 tools/Makefile
164 gnulib/Makefile
165 m4/Makefile])
Eitan Isaacson109996e2008-12-20 14:52:53 +0000166AC_OUTPUT
167