blob: 823d75e8c9a191824864bc22c6d745330df9d4ae [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 Eglia6d26292013-06-21 12:30:11 +00004AC_INIT(liblouis, 2.5.3, 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
Christian Egli60736802012-12-19 09:33:05 +00008dnl backwards compatibility for autoconf <= 2.64
9dnl PACKAGE_URL should be the fifth argument of AC_INIT
10m4_define([AC_PACKAGE_URL], [http://code.google.com/p/liblouis/])
11AC_DEFINE(PACKAGE_URL, "AC_PACKAGE_URL", [Package URL])
12AC_SUBST(PACKAGE_URL, AC_PACKAGE_URL)
13
Christian Eglib7159412009-10-30 11:14:49 +000014AC_CONFIG_AUX_DIR([build-aux])
15AC_CONFIG_MACRO_DIR([m4])
Christian Egli462dcc62012-09-11 07:29:49 +000016AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
Christian Egli9ebcbd22012-09-24 14:37:50 +000017#AM_INIT_AUTOMAKE([color-tests])
Eitan Isaacson109996e2008-12-20 14:52:53 +000018
19# Checks for programs.
20AC_PROG_CC
Christian Egli4255aa22009-10-08 09:34:06 +000021
22# gnulib
23gl_EARLY
24gl_INIT
25
Christian Egli311d52b2013-01-11 16:19:23 +000026# make sure we have a decent malloc and realloc
27gl_FUNC_MALLOC_GNU
28if test $REPLACE_MALLOC = 1; then
29AC_LIBOBJ([malloc])
30fi
31gl_MODULE_INDICATOR([malloc-gnu])
32
33gl_FUNC_REALLOC_GNU
34if test $REPLACE_REALLOC = 1; then
35AC_LIBOBJ([realloc])
36fi
37gl_MODULE_INDICATOR([realloc-gnu])
38
Christian Egli4255aa22009-10-08 09:34:06 +000039# Checks for more programs.
Eitan Isaacson109996e2008-12-20 14:52:53 +000040AC_PROG_INSTALL
41AC_PROG_LN_S
42AC_PROG_MAKE_SET
Eitan Isaacson109996e2008-12-20 14:52:53 +000043
44# Checks for libraries.
45
46# Checks for header files.
47AC_HEADER_STDC
48AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
49
50# Checks for typedefs, structures, and compiler characteristics.
51AC_C_CONST
52
53# Checks for library functions.
Eitan Isaacson109996e2008-12-20 14:52:53 +000054AC_FUNC_MEMCMP
Eitan Isaacson109996e2008-12-20 14:52:53 +000055AC_FUNC_VPRINTF
56AC_CHECK_FUNCS([memset])
57
58# This is for stuff that absolutely must end up in pyconfig.h.
59# Please use pyport.h instead, if possible.
60AH_TOP([
61#ifndef LOUISCFG_H
62#define LOUISCFG_H
63])
64AH_BOTTOM([
65#endif /*LOUISCFG_H*/
66])
67
68# increment if the interface has additions, changes, removals.
Christian Egli3bdb45c2012-09-10 09:54:14 +000069LIBLOUIS_CURRENT=5
Eitan Isaacson109996e2008-12-20 14:52:53 +000070
71# increment any time the source changes; set to
72# 0 if you increment CURRENT
Christian Eglia6d26292013-06-21 12:30:11 +000073LIBLOUIS_REVISION=3
Eitan Isaacson109996e2008-12-20 14:52:53 +000074
75# increment if any interfaces have been added; set to 0
76# if any interfaces have been changed or removed. removal has
77# precedence over adding, so set to 0 if both happened.
Christian Egli3bdb45c2012-09-10 09:54:14 +000078LIBLOUIS_AGE=3
Eitan Isaacson109996e2008-12-20 14:52:53 +000079
80AC_SUBST(LIBLOUIS_CURRENT)
81AC_SUBST(LIBLOUIS_REVISION)
82AC_SUBST(LIBLOUIS_AGE)
83
84AC_ISC_POSIX
85AC_HEADER_STDC
86AC_LIBTOOL_WIN32_DLL
Christian Eglib7159412009-10-30 11:14:49 +000087AC_PROG_LIBTOOL
Eitan Isaacson109996e2008-12-20 14:52:53 +000088
Christian Egli644ed622009-10-08 15:02:15 +000089# GNU help2man creates man pages from --help output; in many cases,
90# this is sufficient, and obviates the need to maintain man pages
91# separately. However, some developers do not have it so we do not
92# make its use mandatory.
Christian Eglie63b3592010-01-26 14:28:33 +000093if test "x$cross_compiling" = xyes; then
94 AC_MSG_WARN([cannot generate manual pages while cross compiling])
95else
96 AC_CHECK_PROG([HELP2MAN], [help2man], [help2man])
97fi
Christian Egli644ed622009-10-08 15:02:15 +000098AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man])
99
Christian Egli66cfe502012-03-01 14:50:42 +0000100# Check if we have Python installed
101AM_PATH_PYTHON([2.6],, [:])
102AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
103
Eitan Isaacson109996e2008-12-20 14:52:53 +0000104AC_PATH_PROG(PKG_CONFIG, pkg-config)
105
106AC_ARG_ENABLE(ucs4,
107 AC_HELP_STRING(--enable-ucs4, Enable 4 byte-wide characters.),
108 [],
109 [enable_ucs4=no])
110
Christian Eglibbf00fd2009-11-12 10:02:23 +0000111AC_MSG_CHECKING([whether 4 byte-wide characters should be supported])
112AC_MSG_RESULT($enable_ucs4)
Eitan Isaacson109996e2008-12-20 14:52:53 +0000113
114case "$enable_ucs4" in
Christian Eglibbf00fd2009-11-12 10:02:23 +0000115yes) WIDECHAR_TYPE='unsigned int';;
116*) WIDECHAR_TYPE='unsigned short int';;
Eitan Isaacson109996e2008-12-20 14:52:53 +0000117esac
Christian Eglibbf00fd2009-11-12 10:02:23 +0000118AC_SUBST(WIDECHAR_TYPE)
Christian Egli33ded852012-03-20 14:13:30 +0000119AM_CONDITIONAL([HAVE_UCS4], [test x$enable_ucs4 = xyes])
Eitan Isaacson109996e2008-12-20 14:52:53 +0000120
James Teh75bfbe22009-01-20 12:19:47 +0000121case $host in
122 *mingw* | *cygwin*)
James Teh115fb832009-02-14 00:47:32 +0000123 CFLAGS="$CFLAGS -Wl,--add-stdcall-alias"
James Teh75bfbe22009-01-20 12:19:47 +0000124 ;;
125esac
126
John Boyer9bfed872011-06-12 22:56:54 +0000127AC_CONFIG_FILES([
128 Makefile
129 doc/Makefile
130 man/Makefile
131 liblouis/Makefile
132 liblouis/liblouis.h
133 windows/Makefile
134 windows/include/Makefile
135 tables/Makefile
136 liblouis.pc
137 tests/Makefile
Christian Eglibb8a27b2014-03-03 09:43:05 +0000138 tests/resolve_table.h
John Boyer9bfed872011-06-12 22:56:54 +0000139 tests/tables/Makefile
Christian Egli98e193a2012-05-31 15:07:11 +0000140 tests/tables/moreTables/Makefile
Christian Egli393e0d92014-02-28 12:51:51 +0000141 tests/tables/resolve_table/Makefile
142 tests/tables/resolve_table/dir_1/Makefile
143 tests/tables/resolve_table/dir_1/dir_1.1/Makefile
144 tests/tables/resolve_table/dir_2/Makefile
Christian Egli66cfe502012-03-01 14:50:42 +0000145 tests/doctests/Makefile
Christian Eglicc1a0a42012-03-02 13:34:09 +0000146 tests/harness/Makefile
Mesar Hameed96f30d82012-07-20 08:43:00 +0000147 tests/harnessSources/Makefile
John Boyer9bfed872011-06-12 22:56:54 +0000148 python/Makefile
149 python/louis/Makefile
150 tools/Makefile
151 gnulib/Makefile
152 m4/Makefile])
Eitan Isaacson109996e2008-12-20 14:52:53 +0000153AC_OUTPUT
154