blob: 34742930bd1148fcde6d04b130a411623c4916ac [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)
John Boyera9104b52009-08-18 23:45:28 +00004AC_INIT(liblouis, 1.7.0, 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 Boyer16689ac2009-01-12 15:11:39 +000051LIBLOUIS_CURRENT=2
Eitan Isaacson109996e2008-12-20 14:52:53 +000052
53# increment any time the source changes; set to
54# 0 if you increment CURRENT
John Boyera9104b52009-08-18 23:45:28 +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 Boyer2b069722009-01-20 16:55:44 +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.
75AC_CHECK_PROG([HELP2MAN], [help2man], [help2man])
76AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man])
77
Eitan Isaacson109996e2008-12-20 14:52:53 +000078AC_PATH_PROG(PKG_CONFIG, pkg-config)
79
80AC_ARG_ENABLE(ucs4,
81 AC_HELP_STRING(--enable-ucs4, Enable 4 byte-wide characters.),
82 [],
83 [enable_ucs4=no])
84
85AH_TEMPLATE(WIDECHAR_SIZE,
86 [Define as the size of the unicode type.])
87
88case "$enable_ucs4" in
89no) unicode_size="2"
90 AC_DEFINE(WIDECHAR_SIZE,2)
91 ;;
92yes) unicode_size="4"
93 AC_DEFINE(WIDECHAR_SIZE,4)
94 ;;
95esac
96
James Teh75bfbe22009-01-20 12:19:47 +000097case $host in
98 *mingw* | *cygwin*)
James Teh115fb832009-02-14 00:47:32 +000099 CFLAGS="$CFLAGS -Wl,--add-stdcall-alias"
James Teh75bfbe22009-01-20 12:19:47 +0000100 ;;
101esac
102
Eitan Isaacson109996e2008-12-20 14:52:53 +0000103AC_CONFIG_FILES([Makefile
104 doc/Makefile
Christian Egli644ed622009-10-08 15:02:15 +0000105 man/Makefile
Eitan Isaacson109996e2008-12-20 14:52:53 +0000106 liblouis/Makefile
107 tables/Makefile
Christian Egli4255aa22009-10-08 09:34:06 +0000108 liblouis.pc
Eitan Isaacson109996e2008-12-20 14:52:53 +0000109 tests/Makefile
Christian Eglid0bf4b72009-10-27 10:50:59 +0000110 tests/table_test_corpuses/Makefile
Christian Egli4255aa22009-10-08 09:34:06 +0000111 python/Makefile
112 python/louis/Makefile
113 tools/Makefile
114 gnulib/Makefile])
Eitan Isaacson109996e2008-12-20 14:52:53 +0000115AC_OUTPUT
116