1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_INIT(dbf, 0.9.0, [http://dbf.berlios.de])
5AC_CONFIG_SRCDIR(src/dbf.c)
6AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
7
8AM_MAINTAINER_MODE
9AC_CONFIG_HEADER(config.h)
10AC_PROG_INTLTOOL
11
12# Checks for programs.
13AC_PROG_CC
14AC_PROG_INSTALL
15AC_PROG_LN_S
16AC_PROG_MAKE_SET
17
18dnl Add the languages which your application supports here.
19ALL_LINGUAS="de"
20AM_GLIB_GNU_GETTEXT
21GETTEXT_PACKAGE=dbf
22AC_SUBST(GETTEXT_PACKAGE)
23AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", GETTEXT_PACKAGE)
24
25AM_PROG_LIBTOOL
26
27# Checks for libraries.
28AC_ARG_WITH(dbflib, [  --with-dbflib=DIR        Path to dbf library (/usr)])
29if test -r ${withval}/include/dbf.h ; then
30  DBFLIB_LIBDIR=-L${withval}/lib
31  DBFLIB_INCLUDEDIR=-I${withval}/include
32else
33  DBFLIB_LIBDIR=-L/usr
34  DBFLIB_INCLUDEDIR=-I/usr/include
35fi
36
37AC_CHECK_LIB(dbf, dbf_Open,
38  DBFLIB_LIBDIR="$DBFLIB_LIBDIR",
39  AC_MSG_ERROR([libdbf not found. You will need at least libdbf 0.3.0]),
40  "$DBFLIB_LIBDIR")
41
42DBFLIB_LIBS=-ldbf
43
44
45# Checks for header files.
46AC_HEADER_STDC
47AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h unistd.h])
48
49# Checks for typedefs, structures, and compiler characteristics.
50AC_C_CONST
51AC_TYPE_SIZE_T
52
53# Checks for library functions.
54AC_FUNC_MALLOC
55
56AC_CHECK_PROG(DOC_TO_MAN, docbook-to-man, docbook-to-man)
57if test ! "$DOC_TO_MAN" ; then
58  DOCDIR=
59  AC_MSG_RESULT([docbook-to-man could not be found. I will not build man pages!])
60else
61  DOCDIR=man
62fi
63
64AC_SUBST(DBFLIB_LIBDIR)
65AC_SUBST(DBFLIB_LIBS)
66AC_SUBST(DBFLIB_INCLUDEDIR)
67
68AC_SUBST(DOCDIR)
69AC_SUBST(DOC_TO_MAN)
70
71AC_OUTPUT([dbf.spec
72           Makefile
73           man/Makefile
74           src/Makefile
75					 po/Makefile.in
76					])
77