renamed the package to libgedcom-dev
[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.90.0
12 VERSION_MAJOR=`echo $VERSION | sed 's/\..*$//'`
13 changequote(<<,>>)
14 VERSION_MINOR=`echo $VERSION | sed 's/^[^\.]*\.//' | sed 's/\..*$//'`
15 VERSION_PATCH=`echo $VERSION | sed 's/^[^\.]*\.[^\.]*\.//'`
16 changequote([,])
17 AC_SUBST(VERSION_MAJOR)
18 AC_SUBST(VERSION_MINOR)
19 AC_SUBST(VERSION_PATCH)
20 AC_SUBST(VERSION)
21
22 LIBVERSION=0:9
23 AC_SUBST(LIBVERSION)
24
25 SHELL=/bin/sh
26 AC_SUBST(SHELL)
27
28 dnl =============================================================
29 AM_INIT_AUTOMAKE(${NAME},${VERSION})
30 AM_CONFIG_HEADER(config.h)
31 AC_CONFIG_SUBDIRS(utf8)
32 ALL_LINGUAS="nl"
33
34 AC_CANONICAL_HOST
35
36 EXTRA_CFLAGS=""
37 case "$host_os" in
38  darwin*) AC_MSG_WARN([Disabling smart preprocessing])
39           EXTRA_CFLAGS="-no-cpp-precomp $EXTRA_CFLAGS";;
40 esac
41
42 AC_ARG_ENABLE(debug,
43 [  --enable-debug          Compilation flags to allow debugging [default=yes]],
44   if test $enableval == "yes"
45   then
46     EXTRA_CFLAGS="-g $EXTRA_CFLAGS"
47   fi,
48   EXTRA_CFLAGS="-g $EXTRA_CFLAGS"
49 )
50
51 AC_SUBST(EXTRA_CFLAGS)
52
53 dnl =============================================================
54 dnl Checks for programs.
55 AC_PROG_CC
56 AM_PROG_LIBTOOL
57 AC_PROG_AWK
58 AM_PROG_LEX
59 AC_PROG_INSTALL
60 AC_PROG_LN_S
61 AC_PROG_MAKE_SET
62 AC_PROG_RANLIB
63 AC_PROG_YACC
64 if test "$YACC" = "bison -y"; then
65   AC_MSG_WARN([We'll remove the -y option here])
66   YACC=bison
67 else
68   AC_MSG_ERROR([Sorry, bison is needed])
69 fi
70
71 dnl =============================================================
72 dnl Checks for libraries.
73 AM_GNU_GETTEXT([use-libtool],[need-ngettext])
74
75 dnl =============================================================
76 dnl Checks for typedefs, structures, and compiler characteristics.
77 AC_C_CONST
78 AC_C_INLINE
79 AC_TYPE_SIZE_T
80 AC_CHECK_SIZEOF(void *, 4)
81
82 dnl ==========================================================
83 dnl Checks for library functions.
84 AC_CHECK_HEADERS(stddef.h stdlib.h string.h)
85 AC_CHECK_FUNCS(setlocale vsnprintf vsprintf)
86
87 dnl ==========================================================
88 dnl My local stuff
89
90 gedcom_SYS_NEWLINE
91 AM_ICONV
92 gedcom_SANE_ICONV
93 if test "$am_cv_func_iconv" != yes -o "$is_iconv_sane" != yes; then
94   AC_MSG_ERROR([
95 *******************************************************************************
96 You need 'iconv' (with features comparable to what is in glibc 2.2) to use this
97 library, consider installing GNU libiconv or use --with-libiconv-prefix to
98 point to an existing installation of that library (see README)
99 *******************************************************************************
100   ])
101 fi
102
103 if test "${with_libiconv_prefix+set}" = set; then
104   withval="$with_libiconv_prefix"
105   
106     for dir in `echo "$withval" | tr : ' '`; do
107       if test -d $dir/lib; then ICONV_LIBPATH="$ICONV_LIBPATH -L$dir/lib"; fi
108     done
109
110   ICONV_PATH=`echo "$withval" | tr : '/bin:'`
111   ICONV_PATH="$ICONV_PATH/bin"
112 fi
113 AC_SUBST(ICONV_LIBPATH)
114 AC_SUBST(ICONV_PATH)
115
116 AC_MSG_CHECKING(for location of iconv)
117 if test "$am_cv_lib_iconv" = yes; then
118   AC_MSG_RESULT(libiconv)
119   gedcom_LIBICONV_HAS_ANSEL
120 else
121   AC_MSG_RESULT(libc)
122   gedcom_GLIBC22_ICONV
123   if test "$is_glibc22_iconv" = yes; then
124     DIRS="glibc"
125     is_ansel_supported=yes
126     AC_SUBST(DIRS)
127   fi
128 fi
129
130 if test "$is_ansel_supported" != yes; then
131   AC_MSG_WARN([
132 *******************************************************************************
133 Your iconv implementation doesn't support ANSEL.  Consider installing the
134 modified libiconv library if you need ANSEL support in the Gedcom parser
135 library (see README).
136 *******************************************************************************
137   ])
138 fi
139
140 AC_OUTPUT(GNUmakefile
141           Makefile
142           gedcom-config
143           gedcom/Makefile
144           gedcom/calendar/Makefile
145           gom/Makefile
146           iconv/Makefile
147           iconv/glibc/Makefile
148           iconv/libiconv/Makefile
149           t/Makefile
150           t/src/Makefile
151           t/input/Makefile
152           t/output/Makefile
153           data/Makefile
154           data/new.ged
155           doc/Makefile
156           doc/images/Makefile
157           doc/index.html
158           doc/doxygen/Makefile
159           doc/doxygen/doxygen.conf
160           doc/html/Makefile
161           doc/html/images/Makefile
162           include/Makefile
163           include/gedcom.h
164           intl/Makefile
165           po/Makefile.in
166           m4/Makefile
167           bin/Makefile)