Commit | Line | Data |
---|---|---|
b0322a85 CE |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | ||
3 | AC_INIT(unicode, 0.10, [courier-maildrop@lists.sourceforge.net]) | |
4 | ||
5 | >confdefs.h # Kill PACKAGE_ macros | |
6 | ||
7 | AC_CONFIG_SRCDIR(unicodecpp.C) | |
8 | AC_CONFIG_AUX_DIR(../..) | |
9 | ||
10 | LPATH="$PATH:/usr/local/bin" | |
11 | ||
12 | AM_CONFIG_HEADER(unicode_config.h) | |
13 | AM_INIT_AUTOMAKE([foreign no-define]) | |
14 | dnl Checks for programs. | |
15 | ||
16 | AC_PROG_MAKE_SET | |
17 | AM_PROG_LIBTOOL | |
18 | AC_PROG_INSTALL | |
19 | AC_PROG_LN_S | |
20 | AC_PROG_CC | |
21 | AC_PROG_CXX | |
22 | AC_PATH_PROGS(PERL, perl5 perl, perl, $LPATH) | |
23 | ||
24 | if test "$PERL" = "perl" | |
25 | then | |
26 | AC_MSG_ERROR(Perl not found.) | |
27 | fi | |
28 | ||
29 | dnl Checks for libraries. | |
30 | ||
31 | dnl Checks for header files. | |
32 | ||
33 | AC_CHECK_HEADERS(stddef.h wchar.h locale.h) | |
34 | ||
35 | dnl Checks for typedefs, structures, and compiler characteristics. | |
36 | ||
37 | dnl Checks for library functions. | |
38 | ||
39 | AC_CHECK_FUNCS(setlocale) | |
40 | ||
41 | AM_CONDITIONAL(UPDATE_UNICODE, test -f ${srcdir}/UnicodeData.txt) | |
42 | ||
43 | AC_SYS_LARGEFILE | |
44 | ||
45 | AC_C_BIGENDIAN | |
46 | ||
47 | AC_MSG_CHECKING([whether libcharset is used]) | |
48 | AC_ARG_WITH(libcharset, | |
49 | [ --with-libcharset Use the libcharset library], | |
50 | unicode_with_libcharset=$withval, | |
51 | unicode_with_libcharset=no) | |
52 | AC_MSG_RESULT($unicode_with_libcharset) | |
53 | if test "$unicode_with_libcharset" = "yes"; then | |
54 | AC_CHECK_LIB(charset,locale_charset) | |
55 | if test "$ac_cv_lib_charset_locale_charset" = "yes"; then | |
56 | AC_CHECK_HEADERS(localcharset.h libcharset.h) | |
57 | else | |
58 | AC_MSG_ERROR([libcharset was not found. Install libcharset package.]) | |
59 | fi | |
60 | AC_DEFINE_UNQUOTED(UNICODE_USE_LIBCHARSET, 1, | |
61 | [ Set this to 1 to use libcharset library. ]) | |
62 | else | |
63 | AM_LANGINFO_CODESET | |
64 | fi | |
65 | ||
66 | save_LIBS="$LIBS" | |
67 | ||
68 | LIBS="$LIBS -liconv" | |
69 | ||
70 | AC_LINK_IFELSE([AC_LANG_PROGRAM([ | |
71 | #include <iconv.h> | |
72 | ],[ | |
73 | ||
74 | iconv_open("",""); | |
75 | ])] ,[ : ], [LIBS="$save_LIBS"]) | |
76 | ||
77 | if test "$GCC" = "yes" | |
78 | then | |
79 | CFLAGS="$CFLAGS -Wall -fexceptions" | |
80 | fi | |
81 | CFLAGS="-I.. -I$srcdir/.. $CFLAGS" | |
82 | CXXFLAGS="-I.. -I$srcdir/.. $CXXFLAGS" | |
83 | AC_OUTPUT(Makefile) |