Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 1 | # Process this file with autoconf to produce a configure script. |
| 2 | |
Christian Egli | 84b1a81 | 2014-05-06 14:28:14 +0000 | [diff] [blame] | 3 | AC_PREREQ(2.68) |
Christian Egli | 55263cd | 2015-03-01 23:42:35 +0100 | [diff] [blame] | 4 | AC_INIT([Liblouis], [2.6.2], [liblouis-liblouisxml@freelists.org], [liblouis], [http://www.liblouis.org]) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 5 | AC_CONFIG_SRCDIR([liblouis/lou_backTranslateString.c]) |
Christian Egli | 4255aa2 | 2009-10-08 09:34:06 +0000 | [diff] [blame] | 6 | AM_CONFIG_HEADER(liblouis/config.h) |
Christian Egli | b715941 | 2009-10-30 11:14:49 +0000 | [diff] [blame] | 7 | |
| 8 | AC_CONFIG_AUX_DIR([build-aux]) |
| 9 | AC_CONFIG_MACRO_DIR([m4]) |
Christian Egli | 84b1a81 | 2014-05-06 14:28:14 +0000 | [diff] [blame] | 10 | AM_INIT_AUTOMAKE |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 11 | |
| 12 | # Checks for programs. |
| 13 | AC_PROG_CC |
Christian Egli | 4255aa2 | 2009-10-08 09:34:06 +0000 | [diff] [blame] | 14 | |
| 15 | # gnulib |
| 16 | gl_EARLY |
| 17 | gl_INIT |
| 18 | |
Christian Egli | 311d52b | 2013-01-11 16:19:23 +0000 | [diff] [blame] | 19 | # make sure we have a decent malloc and realloc |
| 20 | gl_FUNC_MALLOC_GNU |
| 21 | if test $REPLACE_MALLOC = 1; then |
| 22 | AC_LIBOBJ([malloc]) |
| 23 | fi |
| 24 | gl_MODULE_INDICATOR([malloc-gnu]) |
| 25 | |
| 26 | gl_FUNC_REALLOC_GNU |
| 27 | if test $REPLACE_REALLOC = 1; then |
| 28 | AC_LIBOBJ([realloc]) |
| 29 | fi |
| 30 | gl_MODULE_INDICATOR([realloc-gnu]) |
| 31 | |
Christian Egli | 4255aa2 | 2009-10-08 09:34:06 +0000 | [diff] [blame] | 32 | # Checks for more programs. |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 33 | AC_PROG_INSTALL |
| 34 | AC_PROG_LN_S |
| 35 | AC_PROG_MAKE_SET |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 36 | |
| 37 | # Checks for libraries. |
| 38 | |
| 39 | # Checks for header files. |
| 40 | AC_HEADER_STDC |
| 41 | AC_CHECK_HEADERS([stddef.h stdlib.h string.h]) |
| 42 | |
| 43 | # Checks for typedefs, structures, and compiler characteristics. |
| 44 | AC_C_CONST |
| 45 | |
| 46 | # Checks for library functions. |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 47 | AC_FUNC_MEMCMP |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 48 | AC_FUNC_VPRINTF |
| 49 | AC_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. |
| 53 | AH_TOP([ |
| 54 | #ifndef LOUISCFG_H |
| 55 | #define LOUISCFG_H |
| 56 | ]) |
| 57 | AH_BOTTOM([ |
| 58 | #endif /*LOUISCFG_H*/ |
| 59 | ]) |
| 60 | |
| 61 | # increment if the interface has additions, changes, removals. |
Christian Egli | 529741b | 2014-09-01 13:55:25 +0200 | [diff] [blame] | 62 | LIBLOUIS_CURRENT=7 |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 63 | |
Christian Egli | 5f8769f | 2014-12-01 11:38:15 +0100 | [diff] [blame] | 64 | # increment any time the source changes; set to 0 if you increment |
| 65 | # CURRENT |
Christian Egli | 55263cd | 2015-03-01 23:42:35 +0100 | [diff] [blame] | 66 | LIBLOUIS_REVISION=2 |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 67 | |
Christian Egli | 5f8769f | 2014-12-01 11:38:15 +0100 | [diff] [blame] | 68 | # 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 Egli | 529741b | 2014-09-01 13:55:25 +0200 | [diff] [blame] | 71 | LIBLOUIS_AGE=5 |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 72 | |
| 73 | AC_SUBST(LIBLOUIS_CURRENT) |
| 74 | AC_SUBST(LIBLOUIS_REVISION) |
| 75 | AC_SUBST(LIBLOUIS_AGE) |
| 76 | |
| 77 | AC_ISC_POSIX |
| 78 | AC_HEADER_STDC |
| 79 | AC_LIBTOOL_WIN32_DLL |
Christian Egli | b715941 | 2009-10-30 11:14:49 +0000 | [diff] [blame] | 80 | AC_PROG_LIBTOOL |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 81 | |
Christian Egli | 644ed62 | 2009-10-08 15:02:15 +0000 | [diff] [blame] | 82 | # 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 Egli | e63b359 | 2010-01-26 14:28:33 +0000 | [diff] [blame] | 86 | if test "x$cross_compiling" = xyes; then |
| 87 | AC_MSG_WARN([cannot generate manual pages while cross compiling]) |
| 88 | else |
| 89 | AC_CHECK_PROG([HELP2MAN], [help2man], [help2man]) |
| 90 | fi |
Christian Egli | 644ed62 | 2009-10-08 15:02:15 +0000 | [diff] [blame] | 91 | AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man]) |
| 92 | |
Simon Aittamaa | bd5e648 | 2014-11-25 19:39:51 +0100 | [diff] [blame] | 93 | # Check for makeinfo version >= 5, required for building documentation. |
| 94 | AC_PROG_SED |
| 95 | AC_CHECK_PROG([MAKEINFO_FOUND], [makeinfo], [yes]) |
| 96 | if test x"${MAKEINFO_FOUND}" = xyes |
| 97 | then |
| 98 | MAKEINFO_VERSION_REQ=5 |
Christian Egli | 774d74b | 2014-11-26 11:03:50 +0100 | [diff] [blame] | 99 | AC_MSG_CHECKING([for makeinfo version >= $MAKEINFO_VERSION_REQ]) |
Bert Frees | 0c56d1e | 2014-12-28 14:20:32 +0100 | [diff] [blame] | 100 | MAKEINFO_VERSION=`makeinfo --version | sed -ne 's/^makeinfo .* \([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*$/\1/p'` |
Simon Aittamaa | bd5e648 | 2014-11-25 19:39:51 +0100 | [diff] [blame] | 101 | 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 |
| 108 | else |
| 109 | AC_MSG_ERROR([Missing program 'makeinfo', please install.)]) |
| 110 | fi |
| 111 | |
Christian Egli | 66cfe50 | 2012-03-01 14:50:42 +0000 | [diff] [blame] | 112 | # Check if we have Python installed |
| 113 | AM_PATH_PYTHON([2.6],, [:]) |
| 114 | AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) |
| 115 | |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 116 | AC_PATH_PROG(PKG_CONFIG, pkg-config) |
| 117 | |
| 118 | AC_ARG_ENABLE(ucs4, |
Christian Egli | 697a0d2 | 2014-03-03 09:46:35 +0000 | [diff] [blame] | 119 | AC_HELP_STRING(--enable-ucs4, Enable 4 byte-wide characters), |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 120 | [], |
| 121 | [enable_ucs4=no]) |
| 122 | |
Christian Egli | bbf00fd | 2009-11-12 10:02:23 +0000 | [diff] [blame] | 123 | AC_MSG_CHECKING([whether 4 byte-wide characters should be supported]) |
| 124 | AC_MSG_RESULT($enable_ucs4) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 125 | |
| 126 | case "$enable_ucs4" in |
Christian Egli | bbf00fd | 2009-11-12 10:02:23 +0000 | [diff] [blame] | 127 | yes) WIDECHAR_TYPE='unsigned int';; |
| 128 | *) WIDECHAR_TYPE='unsigned short int';; |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 129 | esac |
Christian Egli | bbf00fd | 2009-11-12 10:02:23 +0000 | [diff] [blame] | 130 | AC_SUBST(WIDECHAR_TYPE) |
Christian Egli | 33ded85 | 2012-03-20 14:13:30 +0000 | [diff] [blame] | 131 | AM_CONDITIONAL([HAVE_UCS4], [test x$enable_ucs4 = xyes]) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 132 | |
James Teh | 75bfbe2 | 2009-01-20 12:19:47 +0000 | [diff] [blame] | 133 | case $host in |
| 134 | *mingw* | *cygwin*) |
James Teh | 115fb83 | 2009-02-14 00:47:32 +0000 | [diff] [blame] | 135 | CFLAGS="$CFLAGS -Wl,--add-stdcall-alias" |
Michael Whapples | 2bea4c8 | 2014-09-23 15:29:59 +0100 | [diff] [blame] | 136 | LDFLAGS="$LDFLAGS -avoid-version" |
James Teh | 75bfbe2 | 2009-01-20 12:19:47 +0000 | [diff] [blame] | 137 | ;; |
| 138 | esac |
| 139 | |
John Boyer | 9bfed87 | 2011-06-12 22:56:54 +0000 | [diff] [blame] | 140 | AC_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 Egli | bb8a27b | 2014-03-03 09:43:05 +0000 | [diff] [blame] | 151 | tests/resolve_table.h |
John Boyer | 9bfed87 | 2011-06-12 22:56:54 +0000 | [diff] [blame] | 152 | tests/tables/Makefile |
Christian Egli | 98e193a | 2012-05-31 15:07:11 +0000 | [diff] [blame] | 153 | tests/tables/moreTables/Makefile |
Christian Egli | 393e0d9 | 2014-02-28 12:51:51 +0000 | [diff] [blame] | 154 | 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 Egli | 66cfe50 | 2012-03-01 14:50:42 +0000 | [diff] [blame] | 158 | tests/doctests/Makefile |
Christian Egli | cc1a0a4 | 2012-03-02 13:34:09 +0000 | [diff] [blame] | 159 | tests/harness/Makefile |
Mesar Hameed | 96f30d8 | 2012-07-20 08:43:00 +0000 | [diff] [blame] | 160 | tests/harnessSources/Makefile |
John Boyer | 9bfed87 | 2011-06-12 22:56:54 +0000 | [diff] [blame] | 161 | python/Makefile |
| 162 | python/louis/Makefile |
| 163 | tools/Makefile |
| 164 | gnulib/Makefile |
| 165 | m4/Makefile]) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 166 | AC_OUTPUT |
| 167 | |