Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 1 | # Process this file with autoconf to produce a configure script. |
| 2 | |
| 3 | AC_PREREQ(2.59) |
Christian Egli | a6d2629 | 2013-06-21 12:30:11 +0000 | [diff] [blame] | 4 | AC_INIT(liblouis, 2.5.3, john.boyer@abilitiessoft.com) |
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 | |
Christian Egli | 6073680 | 2012-12-19 09:33:05 +0000 | [diff] [blame] | 8 | dnl backwards compatibility for autoconf <= 2.64 |
| 9 | dnl PACKAGE_URL should be the fifth argument of AC_INIT |
| 10 | m4_define([AC_PACKAGE_URL], [http://code.google.com/p/liblouis/]) |
| 11 | AC_DEFINE(PACKAGE_URL, "AC_PACKAGE_URL", [Package URL]) |
| 12 | AC_SUBST(PACKAGE_URL, AC_PACKAGE_URL) |
| 13 | |
Christian Egli | b715941 | 2009-10-30 11:14:49 +0000 | [diff] [blame] | 14 | AC_CONFIG_AUX_DIR([build-aux]) |
| 15 | AC_CONFIG_MACRO_DIR([m4]) |
Christian Egli | 462dcc6 | 2012-09-11 07:29:49 +0000 | [diff] [blame] | 16 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) |
Christian Egli | 9ebcbd2 | 2012-09-24 14:37:50 +0000 | [diff] [blame] | 17 | #AM_INIT_AUTOMAKE([color-tests]) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 18 | |
| 19 | # Checks for programs. |
| 20 | AC_PROG_CC |
Christian Egli | 4255aa2 | 2009-10-08 09:34:06 +0000 | [diff] [blame] | 21 | |
| 22 | # gnulib |
| 23 | gl_EARLY |
| 24 | gl_INIT |
| 25 | |
Christian Egli | 311d52b | 2013-01-11 16:19:23 +0000 | [diff] [blame] | 26 | # make sure we have a decent malloc and realloc |
| 27 | gl_FUNC_MALLOC_GNU |
| 28 | if test $REPLACE_MALLOC = 1; then |
| 29 | AC_LIBOBJ([malloc]) |
| 30 | fi |
| 31 | gl_MODULE_INDICATOR([malloc-gnu]) |
| 32 | |
| 33 | gl_FUNC_REALLOC_GNU |
| 34 | if test $REPLACE_REALLOC = 1; then |
| 35 | AC_LIBOBJ([realloc]) |
| 36 | fi |
| 37 | gl_MODULE_INDICATOR([realloc-gnu]) |
| 38 | |
Christian Egli | 4255aa2 | 2009-10-08 09:34:06 +0000 | [diff] [blame] | 39 | # Checks for more programs. |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 40 | AC_PROG_INSTALL |
| 41 | AC_PROG_LN_S |
| 42 | AC_PROG_MAKE_SET |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 43 | |
| 44 | # Checks for libraries. |
| 45 | |
| 46 | # Checks for header files. |
| 47 | AC_HEADER_STDC |
| 48 | AC_CHECK_HEADERS([stddef.h stdlib.h string.h]) |
| 49 | |
| 50 | # Checks for typedefs, structures, and compiler characteristics. |
| 51 | AC_C_CONST |
| 52 | |
| 53 | # Checks for library functions. |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 54 | AC_FUNC_MEMCMP |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 55 | AC_FUNC_VPRINTF |
| 56 | AC_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. |
| 60 | AH_TOP([ |
| 61 | #ifndef LOUISCFG_H |
| 62 | #define LOUISCFG_H |
| 63 | ]) |
| 64 | AH_BOTTOM([ |
| 65 | #endif /*LOUISCFG_H*/ |
| 66 | ]) |
| 67 | |
| 68 | # increment if the interface has additions, changes, removals. |
Christian Egli | 3bdb45c | 2012-09-10 09:54:14 +0000 | [diff] [blame] | 69 | LIBLOUIS_CURRENT=5 |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 70 | |
| 71 | # increment any time the source changes; set to |
| 72 | # 0 if you increment CURRENT |
Christian Egli | a6d2629 | 2013-06-21 12:30:11 +0000 | [diff] [blame] | 73 | LIBLOUIS_REVISION=3 |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 74 | |
| 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 Egli | 3bdb45c | 2012-09-10 09:54:14 +0000 | [diff] [blame] | 78 | LIBLOUIS_AGE=3 |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 79 | |
| 80 | AC_SUBST(LIBLOUIS_CURRENT) |
| 81 | AC_SUBST(LIBLOUIS_REVISION) |
| 82 | AC_SUBST(LIBLOUIS_AGE) |
| 83 | |
| 84 | AC_ISC_POSIX |
| 85 | AC_HEADER_STDC |
| 86 | AC_LIBTOOL_WIN32_DLL |
Christian Egli | b715941 | 2009-10-30 11:14:49 +0000 | [diff] [blame] | 87 | AC_PROG_LIBTOOL |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 88 | |
Christian Egli | 644ed62 | 2009-10-08 15:02:15 +0000 | [diff] [blame] | 89 | # 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 Egli | e63b359 | 2010-01-26 14:28:33 +0000 | [diff] [blame] | 93 | if test "x$cross_compiling" = xyes; then |
| 94 | AC_MSG_WARN([cannot generate manual pages while cross compiling]) |
| 95 | else |
| 96 | AC_CHECK_PROG([HELP2MAN], [help2man], [help2man]) |
| 97 | fi |
Christian Egli | 644ed62 | 2009-10-08 15:02:15 +0000 | [diff] [blame] | 98 | AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man]) |
| 99 | |
Christian Egli | 66cfe50 | 2012-03-01 14:50:42 +0000 | [diff] [blame] | 100 | # Check if we have Python installed |
| 101 | AM_PATH_PYTHON([2.6],, [:]) |
| 102 | AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) |
| 103 | |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 104 | AC_PATH_PROG(PKG_CONFIG, pkg-config) |
| 105 | |
| 106 | AC_ARG_ENABLE(ucs4, |
| 107 | AC_HELP_STRING(--enable-ucs4, Enable 4 byte-wide characters.), |
| 108 | [], |
| 109 | [enable_ucs4=no]) |
| 110 | |
Christian Egli | bbf00fd | 2009-11-12 10:02:23 +0000 | [diff] [blame] | 111 | AC_MSG_CHECKING([whether 4 byte-wide characters should be supported]) |
| 112 | AC_MSG_RESULT($enable_ucs4) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 113 | |
| 114 | case "$enable_ucs4" in |
Christian Egli | bbf00fd | 2009-11-12 10:02:23 +0000 | [diff] [blame] | 115 | yes) WIDECHAR_TYPE='unsigned int';; |
| 116 | *) WIDECHAR_TYPE='unsigned short int';; |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 117 | esac |
Christian Egli | bbf00fd | 2009-11-12 10:02:23 +0000 | [diff] [blame] | 118 | AC_SUBST(WIDECHAR_TYPE) |
Christian Egli | 33ded85 | 2012-03-20 14:13:30 +0000 | [diff] [blame] | 119 | AM_CONDITIONAL([HAVE_UCS4], [test x$enable_ucs4 = xyes]) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 120 | |
James Teh | 75bfbe2 | 2009-01-20 12:19:47 +0000 | [diff] [blame] | 121 | case $host in |
| 122 | *mingw* | *cygwin*) |
James Teh | 115fb83 | 2009-02-14 00:47:32 +0000 | [diff] [blame] | 123 | CFLAGS="$CFLAGS -Wl,--add-stdcall-alias" |
James Teh | 75bfbe2 | 2009-01-20 12:19:47 +0000 | [diff] [blame] | 124 | ;; |
| 125 | esac |
| 126 | |
John Boyer | 9bfed87 | 2011-06-12 22:56:54 +0000 | [diff] [blame] | 127 | AC_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 Egli | bb8a27b | 2014-03-03 09:43:05 +0000 | [diff] [blame^] | 138 | tests/resolve_table.h |
John Boyer | 9bfed87 | 2011-06-12 22:56:54 +0000 | [diff] [blame] | 139 | tests/tables/Makefile |
Christian Egli | 98e193a | 2012-05-31 15:07:11 +0000 | [diff] [blame] | 140 | tests/tables/moreTables/Makefile |
Christian Egli | 393e0d9 | 2014-02-28 12:51:51 +0000 | [diff] [blame] | 141 | 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 Egli | 66cfe50 | 2012-03-01 14:50:42 +0000 | [diff] [blame] | 145 | tests/doctests/Makefile |
Christian Egli | cc1a0a4 | 2012-03-02 13:34:09 +0000 | [diff] [blame] | 146 | tests/harness/Makefile |
Mesar Hameed | 96f30d8 | 2012-07-20 08:43:00 +0000 | [diff] [blame] | 147 | tests/harnessSources/Makefile |
John Boyer | 9bfed87 | 2011-06-12 22:56:54 +0000 | [diff] [blame] | 148 | python/Makefile |
| 149 | python/louis/Makefile |
| 150 | tools/Makefile |
| 151 | gnulib/Makefile |
| 152 | m4/Makefile]) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 153 | AC_OUTPUT |
| 154 | |