Removed support for testing with dmalloc (valgrind is better...).
[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 AM_ICONV
80 gedcom_SANE_ICONV
81 if test "$am_cv_func_iconv" != yes -o "$is_iconv_sane" != yes; then
82   AC_MSG_ERROR([
83 *******************************************************************************
84 You need 'iconv' (with features comparable to what is in glibc 2.2) to use this
85 library, consider installing GNU libiconv or use --with-libiconv-prefix to
86 point to an existing installation of that library (see README)
87 *******************************************************************************
88   ])
89 fi
90
91 AC_MSG_CHECKING(for location of iconv)
92 if test "$am_cv_lib_iconv" = yes; then
93   AC_MSG_RESULT(libiconv)
94   gedcom_LIBICONV_HAS_ANSEL
95 else
96   AC_MSG_RESULT(libc)
97   LCS_SUBDIRS=libcharset
98   LCS_INCLUDES='-I $(srcdir)/libcharset'
99   LCS_LIBADD=libcharset/libcharset.la
100   AC_SUBST(LCS_SUBDIRS)
101   AC_SUBST(LCS_INCLUDES)
102   AC_SUBST(LCS_LIBADD)
103   gedcom_GLIBC22_ICONV
104   if test "$is_glibc22_iconv" = yes; then
105     DIRS="glibc"
106     is_ansel_supported=yes
107     AC_SUBST(DIRS)
108   fi
109 fi
110
111 if test "$is_ansel_supported" != yes; then
112   AC_MSG_WARN([
113 *******************************************************************************
114 Your iconv implementation doesn't support ANSEL.  Consider installing the
115 modified libiconv library if you need ANSEL support in the Gedcom parser
116 library (see README).
117 *******************************************************************************
118   ])
119 fi
120
121 AC_OUTPUT(GNUmakefile
122           Makefile
123           gedcom/Makefile
124           gedcom/calendar/Makefile
125           gom/Makefile
126           iconv/Makefile
127           iconv/glibc/Makefile
128           iconv/libiconv/Makefile
129           utf8/Makefile
130           utf8/libcharset/Makefile
131           t/Makefile
132           t/src/Makefile
133           t/input/Makefile
134           t/output/Makefile
135           data/Makefile
136           data/new.ged
137           doc/Makefile
138           doc/images/Makefile
139           doc/index.html
140           include/Makefile
141           include/gedcom.h
142           intl/Makefile
143           po/Makefile.in
144           m4/Makefile)