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 | 881c8cc | 2012-02-22 11:14:03 +0000 | [diff] [blame] | 4 | AC_INIT(liblouis, 2.4.1, 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 | |
| 8 | AC_CONFIG_AUX_DIR([build-aux]) |
| 9 | AC_CONFIG_MACRO_DIR([m4]) |
| 10 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) |
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 | |
| 19 | # Checks for more programs. |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 20 | AC_PROG_INSTALL |
| 21 | AC_PROG_LN_S |
| 22 | AC_PROG_MAKE_SET |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 23 | |
| 24 | # Checks for libraries. |
| 25 | |
| 26 | # Checks for header files. |
| 27 | AC_HEADER_STDC |
| 28 | AC_CHECK_HEADERS([stddef.h stdlib.h string.h]) |
| 29 | |
| 30 | # Checks for typedefs, structures, and compiler characteristics. |
| 31 | AC_C_CONST |
| 32 | |
| 33 | # Checks for library functions. |
| 34 | AC_FUNC_MALLOC |
| 35 | AC_FUNC_MEMCMP |
| 36 | AC_FUNC_REALLOC |
| 37 | AC_FUNC_VPRINTF |
| 38 | AC_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. |
| 42 | AH_TOP([ |
| 43 | #ifndef LOUISCFG_H |
| 44 | #define LOUISCFG_H |
| 45 | ]) |
| 46 | AH_BOTTOM([ |
| 47 | #endif /*LOUISCFG_H*/ |
| 48 | ]) |
| 49 | |
| 50 | # increment if the interface has additions, changes, removals. |
John Boyer | 7641256 | 2010-08-03 21:52:58 +0000 | [diff] [blame] | 51 | LIBLOUIS_CURRENT=4 |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 52 | |
| 53 | # increment any time the source changes; set to |
| 54 | # 0 if you increment CURRENT |
Christian Egli | 870363e | 2012-02-22 12:37:44 +0000 | [diff] [blame] | 55 | LIBLOUIS_REVISION=5 |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 56 | |
| 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 Boyer | 7641256 | 2010-08-03 21:52:58 +0000 | [diff] [blame] | 60 | LIBLOUIS_AGE=2 |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 61 | |
| 62 | AC_SUBST(LIBLOUIS_CURRENT) |
| 63 | AC_SUBST(LIBLOUIS_REVISION) |
| 64 | AC_SUBST(LIBLOUIS_AGE) |
| 65 | |
| 66 | AC_ISC_POSIX |
| 67 | AC_HEADER_STDC |
| 68 | AC_LIBTOOL_WIN32_DLL |
Christian Egli | b715941 | 2009-10-30 11:14:49 +0000 | [diff] [blame] | 69 | AC_PROG_LIBTOOL |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 70 | |
Christian Egli | 644ed62 | 2009-10-08 15:02:15 +0000 | [diff] [blame] | 71 | # 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. |
Christian Egli | e63b359 | 2010-01-26 14:28:33 +0000 | [diff] [blame] | 75 | if test "x$cross_compiling" = xyes; then |
| 76 | AC_MSG_WARN([cannot generate manual pages while cross compiling]) |
| 77 | else |
| 78 | AC_CHECK_PROG([HELP2MAN], [help2man], [help2man]) |
| 79 | fi |
Christian Egli | 644ed62 | 2009-10-08 15:02:15 +0000 | [diff] [blame] | 80 | AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man]) |
| 81 | |
Christian Egli | 66cfe50 | 2012-03-01 14:50:42 +0000 | [diff] [blame] | 82 | # Check if we have Python installed |
| 83 | AM_PATH_PYTHON([2.6],, [:]) |
| 84 | AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) |
| 85 | |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 86 | AC_PATH_PROG(PKG_CONFIG, pkg-config) |
| 87 | |
| 88 | AC_ARG_ENABLE(ucs4, |
| 89 | AC_HELP_STRING(--enable-ucs4, Enable 4 byte-wide characters.), |
| 90 | [], |
| 91 | [enable_ucs4=no]) |
| 92 | |
Christian Egli | bbf00fd | 2009-11-12 10:02:23 +0000 | [diff] [blame] | 93 | AC_MSG_CHECKING([whether 4 byte-wide characters should be supported]) |
| 94 | AC_MSG_RESULT($enable_ucs4) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 95 | |
| 96 | case "$enable_ucs4" in |
Christian Egli | bbf00fd | 2009-11-12 10:02:23 +0000 | [diff] [blame] | 97 | yes) WIDECHAR_TYPE='unsigned int';; |
| 98 | *) WIDECHAR_TYPE='unsigned short int';; |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 99 | esac |
Christian Egli | bbf00fd | 2009-11-12 10:02:23 +0000 | [diff] [blame] | 100 | AC_SUBST(WIDECHAR_TYPE) |
Christian Egli | 33ded85 | 2012-03-20 14:13:30 +0000 | [diff] [blame] | 101 | AM_CONDITIONAL([HAVE_UCS4], [test x$enable_ucs4 = xyes]) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 102 | |
James Teh | 75bfbe2 | 2009-01-20 12:19:47 +0000 | [diff] [blame] | 103 | case $host in |
| 104 | *mingw* | *cygwin*) |
James Teh | 115fb83 | 2009-02-14 00:47:32 +0000 | [diff] [blame] | 105 | CFLAGS="$CFLAGS -Wl,--add-stdcall-alias" |
James Teh | 75bfbe2 | 2009-01-20 12:19:47 +0000 | [diff] [blame] | 106 | ;; |
| 107 | esac |
| 108 | |
John Boyer | 9bfed87 | 2011-06-12 22:56:54 +0000 | [diff] [blame] | 109 | AC_CONFIG_FILES([ |
| 110 | Makefile |
| 111 | doc/Makefile |
| 112 | man/Makefile |
| 113 | liblouis/Makefile |
| 114 | liblouis/liblouis.h |
| 115 | windows/Makefile |
| 116 | windows/include/Makefile |
| 117 | tables/Makefile |
| 118 | liblouis.pc |
| 119 | tests/Makefile |
John Boyer | 9bfed87 | 2011-06-12 22:56:54 +0000 | [diff] [blame] | 120 | tests/tables/Makefile |
Christian Egli | 98e193a | 2012-05-31 15:07:11 +0000 | [diff] [blame^] | 121 | tests/tables/moreTables/Makefile |
Christian Egli | 66cfe50 | 2012-03-01 14:50:42 +0000 | [diff] [blame] | 122 | tests/doctests/Makefile |
Christian Egli | cc1a0a4 | 2012-03-02 13:34:09 +0000 | [diff] [blame] | 123 | tests/harness/Makefile |
John Boyer | 9bfed87 | 2011-06-12 22:56:54 +0000 | [diff] [blame] | 124 | python/Makefile |
| 125 | python/louis/Makefile |
| 126 | tools/Makefile |
| 127 | gnulib/Makefile |
| 128 | m4/Makefile]) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 129 | AC_OUTPUT |
| 130 | |