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 | 8f23091 | 2017-03-06 14:34:02 +0100 | [diff] [blame] | 4 | AC_INIT([Liblouis], [3.1.0], [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 | |
Christian Egli | 31ef6ff | 2015-06-05 11:22:36 +0200 | [diff] [blame] | 15 | # gnulib for the library |
Christian Egli | 4255aa2 | 2009-10-08 09:34:06 +0000 | [diff] [blame] | 16 | gl_EARLY |
Christian Egli | 31ef6ff | 2015-06-05 11:22:36 +0200 | [diff] [blame] | 17 | # gnulib for the tools |
| 18 | gl_tools_EARLY |
| 19 | |
Christian Egli | 4255aa2 | 2009-10-08 09:34:06 +0000 | [diff] [blame] | 20 | gl_INIT |
Christian Egli | 31ef6ff | 2015-06-05 11:22:36 +0200 | [diff] [blame] | 21 | gl_tools_INIT |
Christian Egli | 311d52b | 2013-01-11 16:19:23 +0000 | [diff] [blame] | 22 | |
Christian Egli | 4255aa2 | 2009-10-08 09:34:06 +0000 | [diff] [blame] | 23 | # Checks for more programs. |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 24 | AC_PROG_INSTALL |
| 25 | AC_PROG_LN_S |
| 26 | AC_PROG_MAKE_SET |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 27 | |
Bert Frees | e580f39 | 2016-10-10 12:29:29 +0200 | [diff] [blame] | 28 | # Checks for libraries. |
| 29 | AC_CHECK_LIB([yaml], [yaml_parser_initialize]) |
| 30 | |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 31 | # Checks for header files. |
| 32 | AC_HEADER_STDC |
| 33 | AC_CHECK_HEADERS([stddef.h stdlib.h string.h]) |
| 34 | |
| 35 | # Checks for typedefs, structures, and compiler characteristics. |
| 36 | AC_C_CONST |
| 37 | |
| 38 | # Checks for library functions. |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 39 | AC_FUNC_MEMCMP |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 40 | AC_FUNC_VPRINTF |
| 41 | AC_CHECK_FUNCS([memset]) |
| 42 | |
| 43 | # This is for stuff that absolutely must end up in pyconfig.h. |
| 44 | # Please use pyport.h instead, if possible. |
| 45 | AH_TOP([ |
| 46 | #ifndef LOUISCFG_H |
| 47 | #define LOUISCFG_H |
| 48 | ]) |
| 49 | AH_BOTTOM([ |
| 50 | #endif /*LOUISCFG_H*/ |
| 51 | ]) |
| 52 | |
| 53 | # increment if the interface has additions, changes, removals. |
Christian Egli | 8f23091 | 2017-03-06 14:34:02 +0100 | [diff] [blame] | 54 | LIBLOUIS_CURRENT=13 |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 55 | |
Christian Egli | 5f8769f | 2014-12-01 11:38:15 +0100 | [diff] [blame] | 56 | # increment any time the source changes; set to 0 if you increment |
| 57 | # CURRENT |
Christian Egli | 96a0a8d | 2015-06-01 15:49:21 +0200 | [diff] [blame] | 58 | LIBLOUIS_REVISION=0 |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 59 | |
Christian Egli | 5f8769f | 2014-12-01 11:38:15 +0100 | [diff] [blame] | 60 | # increment if any interfaces have been added; set to 0 if any |
| 61 | # interfaces have been changed or removed. removal has precedence over |
| 62 | # adding, so set to 0 if both happened. |
Christian Egli | 8f23091 | 2017-03-06 14:34:02 +0100 | [diff] [blame] | 63 | LIBLOUIS_AGE=1 |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 64 | |
| 65 | AC_SUBST(LIBLOUIS_CURRENT) |
| 66 | AC_SUBST(LIBLOUIS_REVISION) |
| 67 | AC_SUBST(LIBLOUIS_AGE) |
| 68 | |
Christian Egli | 0899aa1 | 2015-09-08 10:39:35 +0200 | [diff] [blame] | 69 | # needed to build the liblouis.def |
| 70 | DLL_VERSION=`expr ${LIBLOUIS_CURRENT} - ${LIBLOUIS_AGE}` |
| 71 | AC_SUBST(DLL_VERSION) |
| 72 | |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 73 | AC_ISC_POSIX |
| 74 | AC_HEADER_STDC |
| 75 | AC_LIBTOOL_WIN32_DLL |
Christian Egli | b715941 | 2009-10-30 11:14:49 +0000 | [diff] [blame] | 76 | AC_PROG_LIBTOOL |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 77 | |
Christian Egli | 644ed62 | 2009-10-08 15:02:15 +0000 | [diff] [blame] | 78 | # GNU help2man creates man pages from --help output; in many cases, |
| 79 | # this is sufficient, and obviates the need to maintain man pages |
| 80 | # separately. However, some developers do not have it so we do not |
| 81 | # make its use mandatory. |
Christian Egli | e63b359 | 2010-01-26 14:28:33 +0000 | [diff] [blame] | 82 | if test "x$cross_compiling" = xyes; then |
| 83 | AC_MSG_WARN([cannot generate manual pages while cross compiling]) |
| 84 | else |
| 85 | AC_CHECK_PROG([HELP2MAN], [help2man], [help2man]) |
| 86 | fi |
Christian Egli | 644ed62 | 2009-10-08 15:02:15 +0000 | [diff] [blame] | 87 | AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man]) |
| 88 | |
Simon Aittamaa | bd5e648 | 2014-11-25 19:39:51 +0100 | [diff] [blame] | 89 | # Check for makeinfo version >= 5, required for building documentation. |
Christian Egli | 5d9030a | 2015-03-16 22:38:47 +0100 | [diff] [blame] | 90 | have_makeinfo_5=false |
Simon Aittamaa | bd5e648 | 2014-11-25 19:39:51 +0100 | [diff] [blame] | 91 | AC_PROG_SED |
| 92 | AC_CHECK_PROG([MAKEINFO_FOUND], [makeinfo], [yes]) |
| 93 | if test x"${MAKEINFO_FOUND}" = xyes |
| 94 | then |
| 95 | MAKEINFO_VERSION_REQ=5 |
Christian Egli | 774d74b | 2014-11-26 11:03:50 +0100 | [diff] [blame] | 96 | AC_MSG_CHECKING([for makeinfo version >= $MAKEINFO_VERSION_REQ]) |
Martin Michlmayr | e2fa19e | 2015-06-30 12:40:49 -0400 | [diff] [blame] | 97 | MAKEINFO_VERSION=`makeinfo --version | sed -ne 's/^\(makeinfo\|texi2any\) .* \([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*$/\2/p'` |
Simon Aittamaa | bd5e648 | 2014-11-25 19:39:51 +0100 | [diff] [blame] | 98 | if test x$MAKEINFO_VERSION = x -o 0$MAKEINFO_VERSION -lt $MAKEINFO_VERSION_REQ |
| 99 | then |
| 100 | AC_MSG_RESULT([no]) |
Christian Egli | 674844e | 2015-03-12 13:56:49 +0100 | [diff] [blame] | 101 | AC_MSG_WARN([Program 'makeinfo' version >= $MAKEINFO_VERSION_REQ is required. Documentation will not be built.]) |
Simon Aittamaa | bd5e648 | 2014-11-25 19:39:51 +0100 | [diff] [blame] | 102 | else |
| 103 | AC_MSG_RESULT([yes]) |
Christian Egli | 674844e | 2015-03-12 13:56:49 +0100 | [diff] [blame] | 104 | have_makeinfo_5=true |
Simon Aittamaa | bd5e648 | 2014-11-25 19:39:51 +0100 | [diff] [blame] | 105 | fi |
| 106 | else |
Christian Egli | 25ef16b | 2015-05-22 12:22:52 +0200 | [diff] [blame] | 107 | AC_MSG_WARN([Missing program 'makeinfo', Documentation will not be built. Please install you you want documentation or refer to online resources.]) |
Simon Aittamaa | bd5e648 | 2014-11-25 19:39:51 +0100 | [diff] [blame] | 108 | fi |
Christian Egli | 674844e | 2015-03-12 13:56:49 +0100 | [diff] [blame] | 109 | AM_CONDITIONAL([HAVE_MAKEINFO_5], [test x$have_makeinfo_5 = xtrue]) |
Simon Aittamaa | bd5e648 | 2014-11-25 19:39:51 +0100 | [diff] [blame] | 110 | |
Christian Egli | 51c156e | 2017-03-06 10:19:25 +0100 | [diff] [blame] | 111 | # Check if the user wants to enable yaml tests |
| 112 | AC_ARG_WITH([yaml], |
| 113 | [AS_HELP_STRING([--with-yaml], [enable YAML-based tests @<:@default=yes@:>@])], |
| 114 | [with_yaml=$withval], |
| 115 | []) |
| 116 | |
| 117 | if test "x$with_yaml" == xno; then |
| 118 | AC_DEFINE([WITHOUT_YAML],[1],[Disable YAML tests]) |
| 119 | fi |
| 120 | |
| 121 | # if libyaml is missing warn or die depending on --with-yaml |
| 122 | if test x$ac_cv_lib_yaml_yaml_parser_initialize != xyes; then |
| 123 | case "$with_yaml" in |
| 124 | yes) AC_MSG_ERROR([--with-yaml was given, but libyaml was not found]);; |
| 125 | no) ;; |
| 126 | *) AC_MSG_WARN([libyaml was not found. YAML tests will be skipped]);; |
| 127 | esac |
| 128 | fi |
| 129 | |
Christian Egli | 66cfe50 | 2012-03-01 14:50:42 +0000 | [diff] [blame] | 130 | # Check if we have Python installed |
| 131 | AM_PATH_PYTHON([2.6],, [:]) |
| 132 | AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) |
| 133 | |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 134 | AC_PATH_PROG(PKG_CONFIG, pkg-config) |
| 135 | |
| 136 | AC_ARG_ENABLE(ucs4, |
Christian Egli | 697a0d2 | 2014-03-03 09:46:35 +0000 | [diff] [blame] | 137 | AC_HELP_STRING(--enable-ucs4, Enable 4 byte-wide characters), |
Christian Egli | d4aaee8 | 2016-06-20 12:36:16 +0200 | [diff] [blame] | 138 | [AC_DEFINE([WIDECHARS_ARE_UCS4], [1], [Define if widechars are ucs4])], |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 139 | [enable_ucs4=no]) |
| 140 | |
Christian Egli | bbf00fd | 2009-11-12 10:02:23 +0000 | [diff] [blame] | 141 | AC_MSG_CHECKING([whether 4 byte-wide characters should be supported]) |
| 142 | AC_MSG_RESULT($enable_ucs4) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 143 | |
| 144 | case "$enable_ucs4" in |
Christian Egli | bbf00fd | 2009-11-12 10:02:23 +0000 | [diff] [blame] | 145 | yes) WIDECHAR_TYPE='unsigned int';; |
| 146 | *) WIDECHAR_TYPE='unsigned short int';; |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 147 | esac |
Christian Egli | bbf00fd | 2009-11-12 10:02:23 +0000 | [diff] [blame] | 148 | AC_SUBST(WIDECHAR_TYPE) |
Christian Egli | 33ded85 | 2012-03-20 14:13:30 +0000 | [diff] [blame] | 149 | AM_CONDITIONAL([HAVE_UCS4], [test x$enable_ucs4 = xyes]) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 150 | |
James Teh | 75bfbe2 | 2009-01-20 12:19:47 +0000 | [diff] [blame] | 151 | case $host in |
| 152 | *mingw* | *cygwin*) |
James Teh | 115fb83 | 2009-02-14 00:47:32 +0000 | [diff] [blame] | 153 | CFLAGS="$CFLAGS -Wl,--add-stdcall-alias" |
Michael Whapples | 2bea4c8 | 2014-09-23 15:29:59 +0100 | [diff] [blame] | 154 | LDFLAGS="$LDFLAGS -avoid-version" |
James Teh | 75bfbe2 | 2009-01-20 12:19:47 +0000 | [diff] [blame] | 155 | ;; |
| 156 | esac |
| 157 | |
John Boyer | 9bfed87 | 2011-06-12 22:56:54 +0000 | [diff] [blame] | 158 | AC_CONFIG_FILES([ |
| 159 | Makefile |
| 160 | doc/Makefile |
| 161 | man/Makefile |
| 162 | liblouis/Makefile |
| 163 | liblouis/liblouis.h |
| 164 | windows/Makefile |
| 165 | windows/include/Makefile |
| 166 | tables/Makefile |
| 167 | liblouis.pc |
| 168 | tests/Makefile |
Christian Egli | bb8a27b | 2014-03-03 09:43:05 +0000 | [diff] [blame] | 169 | tests/resolve_table.h |
John Boyer | 9bfed87 | 2011-06-12 22:56:54 +0000 | [diff] [blame] | 170 | tests/tables/Makefile |
Bert Frees | 595c8bd | 2015-12-22 00:09:31 +0100 | [diff] [blame] | 171 | tests/tables/emphclass/Makefile |
Christian Egli | 98e193a | 2012-05-31 15:07:11 +0000 | [diff] [blame] | 172 | tests/tables/moreTables/Makefile |
Christian Egli | 393e0d9 | 2014-02-28 12:51:51 +0000 | [diff] [blame] | 173 | tests/tables/resolve_table/Makefile |
| 174 | tests/tables/resolve_table/dir_1/Makefile |
| 175 | tests/tables/resolve_table/dir_1/dir_1.1/Makefile |
| 176 | tests/tables/resolve_table/dir_2/Makefile |
Christian Egli | 2a57605 | 2015-05-29 14:10:05 +0200 | [diff] [blame] | 177 | tests/tablesWithMetadata/Makefile |
Christian Egli | 66cfe50 | 2012-03-01 14:50:42 +0000 | [diff] [blame] | 178 | tests/doctests/Makefile |
Christian Egli | 66acf85 | 2016-06-15 18:14:32 +0200 | [diff] [blame] | 179 | tests/ueb_test_data/Makefile |
Christian Egli | 6d10c38 | 2016-01-12 17:10:21 +0100 | [diff] [blame] | 180 | tests/yaml/Makefile |
John Boyer | 9bfed87 | 2011-06-12 22:56:54 +0000 | [diff] [blame] | 181 | python/Makefile |
Christopher Brannon | a4539ce | 2017-04-24 18:03:29 -0700 | [diff] [blame] | 182 | python/setup.py |
John Boyer | 9bfed87 | 2011-06-12 22:56:54 +0000 | [diff] [blame] | 183 | python/louis/Makefile |
| 184 | tools/Makefile |
Christian Egli | 31ef6ff | 2015-06-05 11:22:36 +0200 | [diff] [blame] | 185 | tools/gnulib/Makefile |
Christian Egli | 60e5bf8 | 2016-06-20 11:08:16 +0200 | [diff] [blame] | 186 | gnulib/Makefile]) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 187 | AC_OUTPUT |
| 188 | |