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) |
John Boyer | 2b06972 | 2009-01-20 16:55:44 +0000 | [diff] [blame^] | 4 | AC_INIT(liblouis, 1.5.2, john.boyer@jjb-software.com) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 5 | AC_CONFIG_SRCDIR([liblouis/lou_backTranslateString.c]) |
| 6 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) |
| 7 | AM_CONFIG_HEADER(liblouis/louiscfg.h) |
John Boyer | daafc2d | 2009-01-13 17:04:28 +0000 | [diff] [blame] | 8 | # AM_MAINTAINER_MODE |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 9 | |
| 10 | # Checks for programs. |
| 11 | AC_PROG_CC |
| 12 | AC_PROG_INSTALL |
| 13 | AC_PROG_LN_S |
| 14 | AC_PROG_MAKE_SET |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 15 | |
| 16 | # Checks for libraries. |
| 17 | |
| 18 | # Checks for header files. |
| 19 | AC_HEADER_STDC |
| 20 | AC_CHECK_HEADERS([stddef.h stdlib.h string.h]) |
| 21 | |
| 22 | # Checks for typedefs, structures, and compiler characteristics. |
| 23 | AC_C_CONST |
| 24 | |
| 25 | # Checks for library functions. |
| 26 | AC_FUNC_MALLOC |
| 27 | AC_FUNC_MEMCMP |
| 28 | AC_FUNC_REALLOC |
| 29 | AC_FUNC_VPRINTF |
| 30 | AC_CHECK_FUNCS([memset]) |
| 31 | |
| 32 | # This is for stuff that absolutely must end up in pyconfig.h. |
| 33 | # Please use pyport.h instead, if possible. |
| 34 | AH_TOP([ |
| 35 | #ifndef LOUISCFG_H |
| 36 | #define LOUISCFG_H |
| 37 | ]) |
| 38 | AH_BOTTOM([ |
| 39 | #endif /*LOUISCFG_H*/ |
| 40 | ]) |
| 41 | |
| 42 | # increment if the interface has additions, changes, removals. |
John Boyer | 16689ac | 2009-01-12 15:11:39 +0000 | [diff] [blame] | 43 | LIBLOUIS_CURRENT=2 |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 44 | |
| 45 | # increment any time the source changes; set to |
| 46 | # 0 if you increment CURRENT |
John Boyer | c675d7a | 2009-01-15 14:32:20 +0000 | [diff] [blame] | 47 | LIBLOUIS_REVISION=1 |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 48 | |
| 49 | # increment if any interfaces have been added; set to 0 |
| 50 | # if any interfaces have been changed or removed. removal has |
| 51 | # precedence over adding, so set to 0 if both happened. |
John Boyer | 2b06972 | 2009-01-20 16:55:44 +0000 | [diff] [blame^] | 52 | LIBLOUIS_AGE=2 |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 53 | |
| 54 | AC_SUBST(LIBLOUIS_CURRENT) |
| 55 | AC_SUBST(LIBLOUIS_REVISION) |
| 56 | AC_SUBST(LIBLOUIS_AGE) |
| 57 | |
| 58 | AC_ISC_POSIX |
| 59 | AC_HEADER_STDC |
| 60 | AC_LIBTOOL_WIN32_DLL |
| 61 | AM_PROG_LIBTOOL |
| 62 | |
| 63 | AC_PATH_PROG(PKG_CONFIG, pkg-config) |
| 64 | |
| 65 | AC_ARG_ENABLE(ucs4, |
| 66 | AC_HELP_STRING(--enable-ucs4, Enable 4 byte-wide characters.), |
| 67 | [], |
| 68 | [enable_ucs4=no]) |
| 69 | |
| 70 | AH_TEMPLATE(WIDECHAR_SIZE, |
| 71 | [Define as the size of the unicode type.]) |
| 72 | |
| 73 | case "$enable_ucs4" in |
| 74 | no) unicode_size="2" |
| 75 | AC_DEFINE(WIDECHAR_SIZE,2) |
| 76 | ;; |
| 77 | yes) unicode_size="4" |
| 78 | AC_DEFINE(WIDECHAR_SIZE,4) |
| 79 | ;; |
| 80 | esac |
| 81 | |
James Teh | 75bfbe2 | 2009-01-20 12:19:47 +0000 | [diff] [blame] | 82 | case $host in |
| 83 | *mingw* | *cygwin*) |
| 84 | LDFLAGS="$LDFLAGS -avoid-version" |
| 85 | ;; |
| 86 | esac |
| 87 | |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 88 | AC_CONFIG_FILES([Makefile |
| 89 | doc/Makefile |
| 90 | liblouis/Makefile |
| 91 | tables/Makefile |
| 92 | liblouis.pc |
| 93 | tests/Makefile |
Eitan Isaacson | 9b1f03b | 2009-01-19 13:06:25 +0000 | [diff] [blame] | 94 | python/Makefile |
| 95 | python/louis/Makefile |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 96 | tools/Makefile]) |
| 97 | AC_OUTPUT |
| 98 | |