Beginnings of write support.
[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 EXTRA_CFLAGS=
34 case "$host_os" in
35  darwin*) AC_MSG_WARN([Disabling smart preprocessing])
36           EXTRA_CFLAGS="-no-cpp-precomp";;
37 esac
38 AC_SUBST(EXTRA_CFLAGS)
39
40 dnl =============================================================
41 dnl Checks for programs.
42 AC_PROG_CC
43 AM_PROG_LIBTOOL
44 AC_PROG_AWK
45 AM_PROG_LEX
46 AC_PROG_INSTALL
47 AC_PROG_LN_S
48 AC_PROG_MAKE_SET
49 AC_PROG_RANLIB
50 AC_PROG_YACC
51 if test "$YACC" = "bison -y"; then
52   AC_MSG_WARN([We'll remove the -y option here])
53   YACC=bison
54 else
55   AC_MSG_ERROR([Sorry, bison is needed])
56 fi
57
58 dnl =============================================================
59 dnl Checks for libraries.
60 AM_GNU_GETTEXT([use-libtool],[need-ngettext])
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 AC_CHECK_SIZEOF(void *, 4)
68
69 dnl ==========================================================
70 dnl Checks for library functions.
71 AC_CHECK_HEADERS(stddef.h stdlib.h string.h)
72 AC_CHECK_FUNCS(setlocale vsnprintf vsprintf)
73 jm_LANGINFO_CODESET
74 jm_GLIBC21
75
76 dnl ==========================================================
77 dnl My local stuff
78
79 gedcom_SYS_NEWLINE
80 AM_ICONV
81 gedcom_SANE_ICONV
82 if test "$am_cv_func_iconv" != yes -o "$is_iconv_sane" != yes; then
83   AC_MSG_ERROR([
84 *******************************************************************************
85 You need 'iconv' (with features comparable to what is in glibc 2.2) to use this
86 library, consider installing GNU libiconv or use --with-libiconv-prefix to
87 point to an existing installation of that library (see README)
88 *******************************************************************************
89   ])
90 fi
91
92 AC_MSG_CHECKING(for location of iconv)
93 if test "$am_cv_lib_iconv" = yes; then
94   AC_MSG_RESULT(libiconv)
95   gedcom_LIBICONV_HAS_ANSEL
96 else
97   AC_MSG_RESULT(libc)
98   LCS_SUBDIRS=libcharset
99   LCS_INCLUDES='-I $(srcdir)/libcharset'
100   LCS_LIBADD=libcharset/libcharset.la
101   AC_SUBST(LCS_SUBDIRS)
102   AC_SUBST(LCS_INCLUDES)
103   AC_SUBST(LCS_LIBADD)
104   gedcom_GLIBC22_ICONV
105   if test "$is_glibc22_iconv" = yes; then
106     DIRS="glibc"
107     is_ansel_supported=yes
108     AC_SUBST(DIRS)
109   fi
110 fi
111
112 if test "$is_ansel_supported" != yes; then
113   AC_MSG_WARN([
114 *******************************************************************************
115 Your iconv implementation doesn't support ANSEL.  Consider installing the
116 modified libiconv library if you need ANSEL support in the Gedcom parser
117 library (see README).
118 *******************************************************************************
119   ])
120 fi
121
122 AC_OUTPUT(GNUmakefile
123           Makefile
124           gedcom/Makefile
125           gedcom/calendar/Makefile
126           gom/Makefile
127           iconv/Makefile
128           iconv/glibc/Makefile
129           iconv/libiconv/Makefile
130           utf8/Makefile
131           utf8/libcharset/Makefile
132           t/Makefile
133           t/src/Makefile
134           t/input/Makefile
135           t/output/Makefile
136           data/Makefile
137           data/new.ged
138           doc/Makefile
139           doc/images/Makefile
140           doc/index.html
141           include/Makefile
142           include/gedcom.h
143           intl/Makefile
144           po/Makefile.in
145           m4/Makefile)