1 # This file is part of GDBM. -*- autoconf -*-
2 # Copyright (C) 2007, 2009, 2011 Free Software Foundation, Inc.
4 # GDBM is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # GDBM is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with GDBM. If not, see <http://www.gnu.org/licenses/>. */
17 m4_define([_GDBM_VERSION_MAJOR], 1)
18 m4_define([_GDBM_VERSION_MINOR], 10)
19 dnl m4_define([_GDBM_VERSION_PATCH], 90)
22 _GDBM_VERSION_MAJOR._GDBM_VERSION_MINOR[]m4_ifdef([_GDBM_VERSION_PATCH],._GDBM_VERSION_PATCH),
25 AC_CONFIG_SRCDIR([src/gdbmdefs.h])
26 AC_CONFIG_AUX_DIR([build-aux])
27 AC_CONFIG_HEADERS([autoconf.h])
28 AC_CONFIG_MACRO_DIR([m4])
29 AM_INIT_AUTOMAKE([gnits 1.11 std-options silent-rules])
31 # Enable silent rules by default:
32 AM_SILENT_RULES([yes])
34 AC_SUBST([GDBM_VERSION_MAJOR], _GDBM_VERSION_MAJOR)
35 AC_SUBST([GDBM_VERSION_MINOR], _GDBM_VERSION_MINOR)
36 AC_SUBST([GDBM_VERSION_PATCH], m4_ifdef([_GDBM_VERSION_PATCH],_GDBM_VERSION_PATCH,0))
38 AC_ARG_ENABLE([memory-mapped-io],
40 [--enable-memory-mapped-io]
41 [Use mmap(2) for disk I/O. (Default is YES.)]),
42 [mapped_io=$enableval],
45 AC_ARG_ENABLE([libgdbm-compat],
47 [--enable-libgdbm-compat]
48 [Build and install libgdbm_compat. (Default is NO.)]),
49 [want_compat=$enableval],
52 AC_ARG_ENABLE([gdbm-export],
54 [--enable-gdbm-export],
55 [Build and install gdbmexport with specified gdbm 1.8 library. (Default is NO.)]),
56 [want_export=$enableval],
59 AC_ARG_WITH([gdbm183-library],
61 [--with-gdbm183-library],
62 [Build gdbmexport with specified (static) library.]),
63 [GDBM183_LIBRARY=$withval],
64 [GDBM183_LIBRARY="-lgdbm"])
66 AC_ARG_WITH([gdbm183-libdir],
68 [--with-gdbm183-libdir],
69 [Build gdbmexport with the gdbm library in the specified directory.]),
70 [GDBM183_LIBDIR=$withval],
71 [GDBM183_LIBDIR="/usr/local/lib"])
73 AC_ARG_WITH([gdbm183-includedir],
75 [--with-gdbm183-includedir],
76 [Build gdbmexport with gdbm.h in the specified directory.]),
77 [GDBM183_INCLUDEDIR=$withval],
78 [GDBM183_INCLUDEDIR="/usr/local/include"])
80 dnl Check for programs
87 dnl AC_C_BIGENDIAN([])
90 dnl Internationalization macros.
91 AM_GNU_GETTEXT([external], [need-ngettext])
92 AM_GNU_GETTEXT_VERSION(0.18)
94 AC_CHECK_HEADERS([stdlib.h string.h sys/file.h unistd.h fcntl.h sys/types.h memory.h sys/termios.h locale.h])
96 AC_CHECK_LIB(dbm, main)
97 AC_CHECK_LIB(ndbm, main)
98 AC_CHECK_FUNCS([rename ftruncate flock lockf fsync setlocale])
100 if test x$mapped_io = xyes
103 AC_CHECK_FUNCS([msync])
106 AC_CHECK_SIZEOF(off_t)
107 AC_CHECK_MEMBERS([struct stat.st_blksize])
109 AC_SUBST(GDBM183_LIBRARY)
110 AC_SUBST(GDBM183_LIBDIR)
111 AC_SUBST(GDBM183_INCLUDEDIR)
112 AM_CONDITIONAL([COMPAT_OPT], [test "$want_compat" = yes])
113 AM_CONDITIONAL([ENABLE_EXPORT], [test "$want_export" = yes])
115 # Initialize the test suite.
116 AC_CONFIG_TESTDIR(tests)
117 AC_CONFIG_FILES([tests/Makefile tests/atlocal po/Makefile.in])
118 AM_MISSING_PROG([AUTOM4TE], [autom4te])
120 AC_CONFIG_FILES([Makefile