blob: f17032f40c5dc648f681eae9fb612509ab8af21b [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)
4AC_INIT([Liblouis], [2.6.0], [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
64# increment any time the source changes; set to
65# 0 if you increment CURRENT
Christian Eglie8bac5a2014-03-03 11:28:52 +000066LIBLOUIS_REVISION=0
Eitan Isaacson109996e2008-12-20 14:52:53 +000067
68# increment if any interfaces have been added; set to 0
69# if any interfaces have been changed or removed. removal has
70# precedence over 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
Christian Egli66cfe502012-03-01 14:50:42 +000093# Check if we have Python installed
94AM_PATH_PYTHON([2.6],, [:])
95AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
96
Eitan Isaacson109996e2008-12-20 14:52:53 +000097AC_PATH_PROG(PKG_CONFIG, pkg-config)
98
99AC_ARG_ENABLE(ucs4,
Christian Egli697a0d22014-03-03 09:46:35 +0000100 AC_HELP_STRING(--enable-ucs4, Enable 4 byte-wide characters),
Eitan Isaacson109996e2008-12-20 14:52:53 +0000101 [],
102 [enable_ucs4=no])
103
Christian Eglibbf00fd2009-11-12 10:02:23 +0000104AC_MSG_CHECKING([whether 4 byte-wide characters should be supported])
105AC_MSG_RESULT($enable_ucs4)
Eitan Isaacson109996e2008-12-20 14:52:53 +0000106
107case "$enable_ucs4" in
Christian Eglibbf00fd2009-11-12 10:02:23 +0000108yes) WIDECHAR_TYPE='unsigned int';;
109*) WIDECHAR_TYPE='unsigned short int';;
Eitan Isaacson109996e2008-12-20 14:52:53 +0000110esac
Christian Eglibbf00fd2009-11-12 10:02:23 +0000111AC_SUBST(WIDECHAR_TYPE)
Christian Egli33ded852012-03-20 14:13:30 +0000112AM_CONDITIONAL([HAVE_UCS4], [test x$enable_ucs4 = xyes])
Eitan Isaacson109996e2008-12-20 14:52:53 +0000113
James Teh75bfbe22009-01-20 12:19:47 +0000114case $host in
115 *mingw* | *cygwin*)
James Teh115fb832009-02-14 00:47:32 +0000116 CFLAGS="$CFLAGS -Wl,--add-stdcall-alias"
Michael Whapples2bea4c82014-09-23 15:29:59 +0100117 LDFLAGS="$LDFLAGS -avoid-version"
James Teh75bfbe22009-01-20 12:19:47 +0000118 ;;
119esac
120
John Boyer9bfed872011-06-12 22:56:54 +0000121AC_CONFIG_FILES([
122 Makefile
123 doc/Makefile
124 man/Makefile
125 liblouis/Makefile
126 liblouis/liblouis.h
127 windows/Makefile
128 windows/include/Makefile
129 tables/Makefile
130 liblouis.pc
131 tests/Makefile
Christian Eglibb8a27b2014-03-03 09:43:05 +0000132 tests/resolve_table.h
John Boyer9bfed872011-06-12 22:56:54 +0000133 tests/tables/Makefile
Christian Egli98e193a2012-05-31 15:07:11 +0000134 tests/tables/moreTables/Makefile
Christian Egli393e0d92014-02-28 12:51:51 +0000135 tests/tables/resolve_table/Makefile
136 tests/tables/resolve_table/dir_1/Makefile
137 tests/tables/resolve_table/dir_1/dir_1.1/Makefile
138 tests/tables/resolve_table/dir_2/Makefile
Christian Egli66cfe502012-03-01 14:50:42 +0000139 tests/doctests/Makefile
Christian Eglicc1a0a42012-03-02 13:34:09 +0000140 tests/harness/Makefile
Mesar Hameed96f30d82012-07-20 08:43:00 +0000141 tests/harnessSources/Makefile
John Boyer9bfed872011-06-12 22:56:54 +0000142 python/Makefile
143 python/louis/Makefile
144 tools/Makefile
145 gnulib/Makefile
146 m4/Makefile])
Eitan Isaacson109996e2008-12-20 14:52:53 +0000147AC_OUTPUT
148