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]) |
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 | 16689ac | 2009-01-12 15:11:39 +0000 | [diff] [blame] | 51 | LIBLOUIS_CURRENT=2 |
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 |
John Boyer | a9104b5 | 2009-08-18 23:45:28 +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 | 2b06972 | 2009-01-20 16:55:44 +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. |
| 75 | AC_CHECK_PROG([HELP2MAN], [help2man], [help2man]) |
| 76 | AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man]) |
| 77 | |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 78 | AC_PATH_PROG(PKG_CONFIG, pkg-config) |
| 79 | |
| 80 | AC_ARG_ENABLE(ucs4, |
| 81 | AC_HELP_STRING(--enable-ucs4, Enable 4 byte-wide characters.), |
| 82 | [], |
| 83 | [enable_ucs4=no]) |
| 84 | |
Christian Egli | bbf00fd | 2009-11-12 10:02:23 +0000 | [diff] [blame] | 85 | AC_MSG_CHECKING([whether 4 byte-wide characters should be supported]) |
| 86 | AC_MSG_RESULT($enable_ucs4) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 87 | |
| 88 | case "$enable_ucs4" in |
Christian Egli | bbf00fd | 2009-11-12 10:02:23 +0000 | [diff] [blame] | 89 | yes) WIDECHAR_TYPE='unsigned int';; |
| 90 | *) WIDECHAR_TYPE='unsigned short int';; |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 91 | esac |
Christian Egli | bbf00fd | 2009-11-12 10:02:23 +0000 | [diff] [blame] | 92 | AC_SUBST(WIDECHAR_TYPE) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 93 | |
James Teh | 75bfbe2 | 2009-01-20 12:19:47 +0000 | [diff] [blame] | 94 | case $host in |
| 95 | *mingw* | *cygwin*) |
James Teh | 115fb83 | 2009-02-14 00:47:32 +0000 | [diff] [blame] | 96 | CFLAGS="$CFLAGS -Wl,--add-stdcall-alias" |
James Teh | 75bfbe2 | 2009-01-20 12:19:47 +0000 | [diff] [blame] | 97 | ;; |
| 98 | esac |
| 99 | |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 100 | AC_CONFIG_FILES([Makefile |
| 101 | doc/Makefile |
Christian Egli | 644ed62 | 2009-10-08 15:02:15 +0000 | [diff] [blame] | 102 | man/Makefile |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 103 | liblouis/Makefile |
Christian Egli | bbf00fd | 2009-11-12 10:02:23 +0000 | [diff] [blame] | 104 | liblouis/liblouis.h |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 105 | tables/Makefile |
Christian Egli | 4255aa2 | 2009-10-08 09:34:06 +0000 | [diff] [blame] | 106 | liblouis.pc |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 107 | tests/Makefile |
Christian Egli | d0bf4b7 | 2009-10-27 10:50:59 +0000 | [diff] [blame] | 108 | tests/table_test_corpuses/Makefile |
Christian Egli | 4255aa2 | 2009-10-08 09:34:06 +0000 | [diff] [blame] | 109 | python/Makefile |
| 110 | python/louis/Makefile |
| 111 | tools/Makefile |
Christian Egli | 014785b | 2009-11-06 11:02:32 +0000 | [diff] [blame] | 112 | gnulib/Makefile |
| 113 | m4/Makefile]) |
Eitan Isaacson | 109996e | 2008-12-20 14:52:53 +0000 | [diff] [blame] | 114 | AC_OUTPUT |
| 115 | |