Checks for portability and for use of libiconv if iconv is not in libc.
[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 dnl =============================================================
32 dnl Checks for programs.
33 AC_PROG_CC
34 AM_PROG_LIBTOOL
35 AC_PROG_AWK
36 AM_PROG_LEX
37 AC_PROG_INSTALL
38 AC_PROG_LN_S
39 AC_PROG_MAKE_SET
40 AC_PROG_RANLIB
41 AC_PROG_YACC
42 if test "$YACC" = "bison -y"; then
43   AC_MSG_WARN([We'll remove the -y option here])
44   YACC=bison
45 else
46   AC_MSG_ERROR([Sorry, bison is needed])
47 fi
48
49 dnl =============================================================
50 dnl Checks for libraries.
51 AM_GNU_GETTEXT
52 AM_WITH_DMALLOC
53
54 dnl == Make statically linked test program for dmalloc tests
55 if test "$with_dmalloc" = "yes"; then
56   EXTRA_PROGS=gomtest_static
57 fi
58 AC_SUBST(EXTRA_PROGS)
59
60 dnl =============================================================
61 dnl Checks for typedefs, structures, and compiler characteristics.
62 AC_C_CONST
63 AC_C_INLINE
64 AC_TYPE_SIZE_T
65
66 dnl ==========================================================
67 dnl Checks for library functions.
68 AC_CHECK_FUNCS(vsnprintf vsprintf)
69
70 dnl ==========================================================
71 dnl My local stuff
72
73 AM_ICONV
74
75 if test "$am_cv_func_iconv" != yes; then
76   AC_MSG_ERROR([
77 *******************************************************************************
78 You need 'iconv' to use this library, consider installing GNU libiconv or
79 use --with-libiconv-prefix to point to an existing installation of that
80 library (see README)
81 *******************************************************************************
82   ])
83 fi
84
85 AC_MSG_CHECKING(for location of iconv)
86 if test "$am_cv_lib_iconv" = yes; then
87   AC_MSG_RESULT(libiconv)
88   AC_LIBICONV_HAS_ANSEL
89 else
90   AC_MSG_RESULT(libc)
91   AC_GLIBC_ICONV
92   if test "$is_glibc_iconv" = yes; then
93     DIRS="ansel"
94     is_ansel_supported=yes
95     AC_SUBST(DIRS)
96   fi
97 fi
98
99 if test "$is_ansel_supported" != yes; then
100   AC_MSG_WARN([
101 *******************************************************************************
102 Your libiconv library doesn't support ANSEL.  Consider installing the modified
103 libiconv library if you need ANSEL support in the Gedcom parser library (see
104 README).
105 *******************************************************************************
106   ])
107 fi
108
109 AC_OUTPUT(Makefile
110           gedcom/Makefile
111           gedcom/calendar/Makefile
112           gom/Makefile
113           ansel/Makefile
114           utf8/Makefile
115           t/Makefile
116           t/src/Makefile
117           t/input/Makefile
118           data/Makefile
119           data/new.ged
120           doc/Makefile
121           doc/images/Makefile
122           include/Makefile
123           include/gedcom.h
124           intl/Makefile
125           po/Makefile.in)