summaryrefslogtreecommitdiffstats
path: root/unicode/configure.ac
blob: 67b55f6d3e2ce12d2ba0fb05cea84716b04ec868 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
dnl Process this file with autoconf to produce a configure script.

AC_INIT([courier-unicode], [1.0], [courier-users@lists.sourceforge.net])

>confdefs.h  # Kill PACKAGE_ macros

AC_CONFIG_SRCDIR(unicodecpp.C)

LPATH="$PATH:/usr/local/bin"

AC_CONFIG_HEADERS(unicode_config.h)
AM_INIT_AUTOMAKE([foreign no-define dist-bzip2])
dnl Checks for programs.

AC_PROG_MAKE_SET
AM_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_CC
AC_PROG_CXX
AC_PATH_PROGS(PERL, perl5 perl, perl, $LPATH)

if test "$PERL" = "perl"
then
	AC_MSG_ERROR(Perl not found.)
fi

dnl Checks for libraries.

dnl Checks for header files.

AC_CHECK_HEADERS(stddef.h wchar.h locale.h)

dnl Checks for typedefs, structures, and compiler characteristics.

dnl Checks for library functions.

AC_CHECK_FUNCS(setlocale)

AM_CONDITIONAL(UPDATE_UNICODE, test -f ${srcdir}/UnicodeData.txt)

AC_SYS_LARGEFILE

AC_C_BIGENDIAN

AC_MSG_CHECKING([whether libcharset is used])
AC_ARG_WITH(libcharset,
	[  --with-libcharset     Use the libcharset library],
	unicode_with_libcharset=$withval,
	unicode_with_libcharset=no)
AC_MSG_RESULT($unicode_with_libcharset)
if test "$unicode_with_libcharset" = "yes"; then
  AC_CHECK_LIB(charset,locale_charset)
  if test "$ac_cv_lib_charset_locale_charset" = "yes"; then
    AC_CHECK_HEADERS(localcharset.h libcharset.h)
  else
    AC_MSG_ERROR([libcharset was not found.  Install libcharset package.])
  fi
  AC_DEFINE_UNQUOTED(UNICODE_USE_LIBCHARSET, 1,
	[ Set this to 1 to use libcharset library. ])
else
  AM_LANGINFO_CODESET
fi

save_LIBS="$LIBS"

LIBS="$LIBS -liconv"

AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <iconv.h>
],[

iconv_open("","");
])] ,[ : ], [LIBS="$save_LIBS"])

if test "$GCC" = "yes"
then
	CFLAGS="$CFLAGS -Wall -fexceptions"
fi
CFLAGS="-I.. -I$srcdir/.. $CFLAGS"
CXXFLAGS="-I.. -I$srcdir/.. $CXXFLAGS"

AM_CONDITIONAL(HAVE_DOCS,[test -f $srcdir/docbook/icon.gif])
AC_OUTPUT(Makefile courier-unicode.spec)