blob: 18877c46dcbb14e10e9e76ff4c88c06150e68675 [file] [log] [blame]
Eitan Isaacson109996e2008-12-20 14:52:53 +00001# Process this file with autoconf to produce a configure script.
2
3AC_PREREQ(2.59)
Christian Egli881c8cc2012-02-22 11:14:03 +00004AC_INIT(liblouis, 2.4.1, john.boyer@abilitiessoft.com)
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])
10AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
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
19# Checks for more programs.
Eitan Isaacson109996e2008-12-20 14:52:53 +000020AC_PROG_INSTALL
21AC_PROG_LN_S
22AC_PROG_MAKE_SET
Eitan Isaacson109996e2008-12-20 14:52:53 +000023
24# Checks for libraries.
25
26# Checks for header files.
27AC_HEADER_STDC
28AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
29
30# Checks for typedefs, structures, and compiler characteristics.
31AC_C_CONST
32
33# Checks for library functions.
34AC_FUNC_MALLOC
35AC_FUNC_MEMCMP
36AC_FUNC_REALLOC
37AC_FUNC_VPRINTF
38AC_CHECK_FUNCS([memset])
39
40# This is for stuff that absolutely must end up in pyconfig.h.
41# Please use pyport.h instead, if possible.
42AH_TOP([
43#ifndef LOUISCFG_H
44#define LOUISCFG_H
45])
46AH_BOTTOM([
47#endif /*LOUISCFG_H*/
48])
49
50# increment if the interface has additions, changes, removals.
John Boyer76412562010-08-03 21:52:58 +000051LIBLOUIS_CURRENT=4
Eitan Isaacson109996e2008-12-20 14:52:53 +000052
53# increment any time the source changes; set to
54# 0 if you increment CURRENT
Christian Egli870363e2012-02-22 12:37:44 +000055LIBLOUIS_REVISION=5
Eitan Isaacson109996e2008-12-20 14:52:53 +000056
57# increment if any interfaces have been added; set to 0
58# if any interfaces have been changed or removed. removal has
59# precedence over adding, so set to 0 if both happened.
John Boyer76412562010-08-03 21:52:58 +000060LIBLOUIS_AGE=2
Eitan Isaacson109996e2008-12-20 14:52:53 +000061
62AC_SUBST(LIBLOUIS_CURRENT)
63AC_SUBST(LIBLOUIS_REVISION)
64AC_SUBST(LIBLOUIS_AGE)
65
66AC_ISC_POSIX
67AC_HEADER_STDC
68AC_LIBTOOL_WIN32_DLL
Christian Eglib7159412009-10-30 11:14:49 +000069AC_PROG_LIBTOOL
Eitan Isaacson109996e2008-12-20 14:52:53 +000070
Christian Egli644ed622009-10-08 15:02:15 +000071# GNU help2man creates man pages from --help output; in many cases,
72# this is sufficient, and obviates the need to maintain man pages
73# separately. However, some developers do not have it so we do not
74# make its use mandatory.
Christian Eglie63b3592010-01-26 14:28:33 +000075if test "x$cross_compiling" = xyes; then
76 AC_MSG_WARN([cannot generate manual pages while cross compiling])
77else
78 AC_CHECK_PROG([HELP2MAN], [help2man], [help2man])
79fi
Christian Egli644ed622009-10-08 15:02:15 +000080AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man])
81
Christian Egli66cfe502012-03-01 14:50:42 +000082# Check if we have Python installed
83AM_PATH_PYTHON([2.6],, [:])
84AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
85
Eitan Isaacson109996e2008-12-20 14:52:53 +000086AC_PATH_PROG(PKG_CONFIG, pkg-config)
87
88AC_ARG_ENABLE(ucs4,
89 AC_HELP_STRING(--enable-ucs4, Enable 4 byte-wide characters.),
90 [],
91 [enable_ucs4=no])
92
Christian Eglibbf00fd2009-11-12 10:02:23 +000093AC_MSG_CHECKING([whether 4 byte-wide characters should be supported])
94AC_MSG_RESULT($enable_ucs4)
Eitan Isaacson109996e2008-12-20 14:52:53 +000095
96case "$enable_ucs4" in
Christian Eglibbf00fd2009-11-12 10:02:23 +000097yes) WIDECHAR_TYPE='unsigned int';;
98*) WIDECHAR_TYPE='unsigned short int';;
Eitan Isaacson109996e2008-12-20 14:52:53 +000099esac
Christian Eglibbf00fd2009-11-12 10:02:23 +0000100AC_SUBST(WIDECHAR_TYPE)
Christian Egli33ded852012-03-20 14:13:30 +0000101AM_CONDITIONAL([HAVE_UCS4], [test x$enable_ucs4 = xyes])
Eitan Isaacson109996e2008-12-20 14:52:53 +0000102
James Teh75bfbe22009-01-20 12:19:47 +0000103case $host in
104 *mingw* | *cygwin*)
James Teh115fb832009-02-14 00:47:32 +0000105 CFLAGS="$CFLAGS -Wl,--add-stdcall-alias"
James Teh75bfbe22009-01-20 12:19:47 +0000106 ;;
107esac
108
John Boyer9bfed872011-06-12 22:56:54 +0000109AC_CONFIG_FILES([
110 Makefile
111 doc/Makefile
112 man/Makefile
113 liblouis/Makefile
114 liblouis/liblouis.h
115 windows/Makefile
116 windows/include/Makefile
117 tables/Makefile
118 liblouis.pc
119 tests/Makefile
John Boyer9bfed872011-06-12 22:56:54 +0000120 tests/tables/Makefile
Christian Egli98e193a2012-05-31 15:07:11 +0000121 tests/tables/moreTables/Makefile
Christian Egli66cfe502012-03-01 14:50:42 +0000122 tests/doctests/Makefile
Christian Eglicc1a0a42012-03-02 13:34:09 +0000123 tests/harness/Makefile
John Boyer9bfed872011-06-12 22:56:54 +0000124 python/Makefile
125 python/louis/Makefile
126 tools/Makefile
127 gnulib/Makefile
128 m4/Makefile])
Eitan Isaacson109996e2008-12-20 14:52:53 +0000129AC_OUTPUT
130