New directory m4.
[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 AM_WITH_DMALLOC
62
63 dnl == Make statically linked test program for dmalloc tests
64 if test "$with_dmalloc" = "yes"; then
65   EXTRA_PROGS=gomtest_static
66 fi
67 AC_SUBST(EXTRA_PROGS)
68
69 dnl =============================================================
70 dnl Checks for typedefs, structures, and compiler characteristics.
71 AC_C_CONST
72 AC_C_INLINE
73 AC_TYPE_SIZE_T
74 AC_CHECK_SIZEOF(void *, 4)
75
76 dnl ==========================================================
77 dnl Checks for library functions.
78 AC_CHECK_HEADERS(stddef.h stdlib.h string.h)
79 AC_CHECK_FUNCS(setlocale vsnprintf vsprintf)
80 jm_LANGINFO_CODESET
81 jm_GLIBC21
82
83 dnl ==========================================================
84 dnl My local stuff
85
86 AM_ICONV
87 gedcom_SANE_ICONV
88 if test "$am_cv_func_iconv" != yes -o "$is_iconv_sane" != yes; then
89   AC_MSG_ERROR([
90 *******************************************************************************
91 You need 'iconv' (with features comparable to what is in glibc 2.2) to use this
92 library, consider installing GNU libiconv or use --with-libiconv-prefix to
93 point to an existing installation of that library (see README)
94 *******************************************************************************
95   ])
96 fi
97
98 AC_MSG_CHECKING(for location of iconv)
99 if test "$am_cv_lib_iconv" = yes; then
100   AC_MSG_RESULT(libiconv)
101   gedcom_LIBICONV_HAS_ANSEL
102 else
103   AC_MSG_RESULT(libc)
104   LCS_SUBDIRS=libcharset
105   LCS_INCLUDES='-I $(srcdir)/libcharset'
106   LCS_LIBADD=libcharset/libcharset.la
107   AC_SUBST(LCS_SUBDIRS)
108   AC_SUBST(LCS_INCLUDES)
109   AC_SUBST(LCS_LIBADD)
110   gedcom_GLIBC22_ICONV
111   if test "$is_glibc22_iconv" = yes; then
112     DIRS="glibc"
113     is_ansel_supported=yes
114     AC_SUBST(DIRS)
115   fi
116 fi
117
118 if test "$is_ansel_supported" != yes; then
119   AC_MSG_WARN([
120 *******************************************************************************
121 Your iconv implementation doesn't support ANSEL.  Consider installing the
122 modified libiconv library if you need ANSEL support in the Gedcom parser
123 library (see README).
124 *******************************************************************************
125   ])
126 fi
127
128 AC_OUTPUT(GNUmakefile
129           Makefile
130           gedcom/Makefile
131           gedcom/calendar/Makefile
132           gom/Makefile
133           iconv/Makefile
134           iconv/glibc/Makefile
135           iconv/libiconv/Makefile
136           utf8/Makefile
137           utf8/libcharset/Makefile
138           t/Makefile
139           t/src/Makefile
140           t/input/Makefile
141           t/output/Makefile
142           data/Makefile
143           data/new.ged
144           doc/Makefile
145           doc/images/Makefile
146           doc/index.html
147           include/Makefile
148           include/gedcom.h
149           intl/Makefile
150           po/Makefile.in
151           m4/Makefile)