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