Require ngettext on GETTEXT (is equivalent to requiring
[gedcom-parse.git] / configure.in
1 # Process this file with autoconf to produce a configure script.
2 # $Id$
3 # $Name$
4 AC_INIT(gedcom/interface.c)
5
6 dnl =============================================================
7 dnl Global variables
8 NAME=gedcom-parse
9 AC_SUBST(NAME)
10
11 VERSION=0.17
12 VERSION_MAJOR=`echo $VERSION | sed 's/\..*$//'`
13 changequote(<<,>>)
14 VERSION_MINOR=`echo $VERSION | sed 's/^[^\.]*\.//'`
15 changequote([,])
16 AC_SUBST(VERSION_MAJOR)
17 AC_SUBST(VERSION_MINOR)
18 AC_SUBST(VERSION)
19
20 LIBVERSION=0:7
21 AC_SUBST(LIBVERSION)
22
23 SHELL=/bin/sh
24 AC_SUBST(SHELL)
25
26 dnl =============================================================
27 AM_INIT_AUTOMAKE(${NAME},${VERSION})
28 AM_CONFIG_HEADER(config.h)
29 ALL_LINGUAS="nl"
30
31 AC_CANONICAL_HOST
32
33 dnl =============================================================
34 dnl Checks for programs.
35 AC_PROG_CC
36 AM_PROG_LIBTOOL
37 AC_PROG_AWK
38 AM_PROG_LEX
39 AC_PROG_INSTALL
40 AC_PROG_LN_S
41 AC_PROG_MAKE_SET
42 AC_PROG_RANLIB
43 AC_PROG_YACC
44 if test "$YACC" = "bison -y"; then
45   AC_MSG_WARN([We'll remove the -y option here])
46   YACC=bison
47 else
48   AC_MSG_ERROR([Sorry, bison is needed])
49 fi
50
51 dnl =============================================================
52 dnl Checks for libraries.
53 AM_GNU_GETTEXT([use-libtool],[need-ngettext])
54 AM_WITH_DMALLOC
55
56 dnl == Make statically linked test program for dmalloc tests
57 if test "$with_dmalloc" = "yes"; then
58   EXTRA_PROGS=gomtest_static
59 fi
60 AC_SUBST(EXTRA_PROGS)
61
62 dnl =============================================================
63 dnl Checks for typedefs, structures, and compiler characteristics.
64 AC_C_CONST
65 AC_C_INLINE
66 AC_TYPE_SIZE_T
67
68 dnl ==========================================================
69 dnl Checks for library functions.
70 AC_CHECK_HEADERS(stddef.h stdlib.h string.h)
71 AC_CHECK_FUNCS(setlocale vsnprintf vsprintf)
72 jm_LANGINFO_CODESET
73 jm_GLIBC21
74
75 dnl ==========================================================
76 dnl My local stuff
77
78 AM_ICONV
79
80 if test "$am_cv_func_iconv" != yes; then
81   AC_MSG_ERROR([
82 *******************************************************************************
83 You need 'iconv' to use this library, consider installing GNU libiconv or
84 use --with-libiconv-prefix to point to an existing installation of that
85 library (see README)
86 *******************************************************************************
87   ])
88 fi
89
90 AC_MSG_CHECKING(for location of iconv)
91 if test "$am_cv_lib_iconv" = yes; then
92   AC_MSG_RESULT(libiconv)
93   gedcom_LIBICONV_HAS_ANSEL
94 else
95   AC_MSG_RESULT(libc)
96   LCS_SUBDIRS=libcharset
97   LCS_INCLUDES='-I $(srcdir)/libcharset'
98   LCS_LIBADD=libcharset/libcharset.la
99   AC_SUBST(LCS_SUBDIRS)
100   AC_SUBST(LCS_INCLUDES)
101   AC_SUBST(LCS_LIBADD)
102   gedcom_GLIBC22_ICONV
103   if test "$is_glibc22_iconv" = yes; then
104     DIRS="glibc"
105     is_ansel_supported=yes
106     AC_SUBST(DIRS)
107   fi
108 fi
109
110 if test "$is_ansel_supported" != yes; then
111   AC_MSG_WARN([
112 *******************************************************************************
113 Your iconv implementation doesn't support ANSEL.  Consider installing the
114 modified libiconv library if you need ANSEL support in the Gedcom parser
115 library (see README).
116 *******************************************************************************
117   ])
118 fi
119
120 AC_OUTPUT(GNUmakefile
121           Makefile
122           gedcom/Makefile
123           gedcom/calendar/Makefile
124           gom/Makefile
125           iconv/Makefile
126           iconv/glibc/Makefile
127           iconv/libiconv/Makefile
128           utf8/Makefile
129           utf8/libcharset/Makefile
130           t/Makefile
131           t/src/Makefile
132           t/input/Makefile
133           t/output/Makefile
134           data/Makefile
135           data/new.ged
136           doc/Makefile
137           doc/images/Makefile
138           doc/index.html
139           include/Makefile
140           include/gedcom.h
141           intl/Makefile
142           po/Makefile.in)