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