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