1 # This file is part of GDBM. -*- autoconf -*-
2 # Copyright (C) 2007, 2009, 2011, 2013 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], 11)
19 dnl m4_define([_GDBM_VERSION_PATCH], 0)
22 _GDBM_VERSION_MAJOR._GDBM_VERSION_MINOR[]m4_ifdef([_GDBM_VERSION_PATCH],._GDBM_VERSION_PATCH),
24 [http://www.gnu.org/software/gdbm])
26 AC_CONFIG_SRCDIR([src/gdbmdefs.h])
27 AC_CONFIG_AUX_DIR([build-aux])
28 AC_CONFIG_HEADERS([autoconf.h])
29 AC_CONFIG_MACRO_DIR([m4])
30 AM_INIT_AUTOMAKE([gnits 1.11 std-options silent-rules])
32 # Enable silent rules by default:
33 AM_SILENT_RULES([yes])
35 AC_SUBST([GDBM_VERSION_MAJOR], _GDBM_VERSION_MAJOR)
36 AC_SUBST([GDBM_VERSION_MINOR], _GDBM_VERSION_MINOR)
37 AC_SUBST([GDBM_VERSION_PATCH], m4_ifdef([_GDBM_VERSION_PATCH],_GDBM_VERSION_PATCH,0))
39 AC_ARG_ENABLE([memory-mapped-io],
41 [--enable-memory-mapped-io]
42 [Use mmap(2) for disk I/O. (Default is YES.)]),
43 [mapped_io=$enableval],
46 AC_ARG_ENABLE([libgdbm-compat],
48 [--enable-libgdbm-compat]
49 [Build and install libgdbm_compat. (Default is NO.)]),
50 [want_compat=$enableval],
53 AC_ARG_ENABLE([gdbm-export],
55 [--enable-gdbm-export],
56 [Build and install gdbmexport with specified gdbm 1.8 library. (Default is NO.)]),
57 [want_export=$enableval],
60 AC_ARG_WITH([gdbm183-library],
62 [--with-gdbm183-library],
63 [Build gdbmexport with specified (static) library.]),
64 [GDBM183_LIBRARY=$withval],
65 [GDBM183_LIBRARY="-lgdbm"])
67 AC_ARG_WITH([gdbm183-libdir],
69 [--with-gdbm183-libdir],
70 [Build gdbmexport with the gdbm library in the specified directory.]),
71 [GDBM183_LIBDIR=$withval],
72 [GDBM183_LIBDIR="/usr/local/lib"])
74 AC_ARG_WITH([gdbm183-includedir],
76 [--with-gdbm183-includedir],
77 [Build gdbmexport with gdbm.h in the specified directory.]),
78 [GDBM183_INCLUDEDIR=$withval],
79 [GDBM183_INCLUDEDIR="/usr/local/include"])
81 dnl Check for programs
90 AC_TYPE_UNSIGNED_LONG_LONG_INT
92 AC_SUBST(GDBM_COUNT_T)
93 if test $ac_cv_type_unsigned_long_long_int = yes; then
94 GDBM_COUNT_T="unsigned long long int"
96 GDBM_COUNT_T="unsigned long"
99 dnl Internationalization macros.
100 AM_GNU_GETTEXT([external], [need-ngettext])
101 AM_GNU_GETTEXT_VERSION(0.18)
103 AC_CHECK_HEADERS([sys/file.h sys/termios.h string.h locale.h getopt.h])
105 AC_CHECK_LIB(dbm, main)
106 AC_CHECK_LIB(ndbm, main)
107 AC_CHECK_FUNCS([rename ftruncate flock lockf fsync setlocale getopt_long])
109 if test x$mapped_io = xyes
112 AC_CHECK_FUNCS([msync])
115 AC_CHECK_SIZEOF(off_t)
116 AC_CHECK_MEMBERS([struct stat.st_blksize])
118 AC_SUBST(GDBM183_LIBRARY)
119 AC_SUBST(GDBM183_LIBDIR)
120 AC_SUBST(GDBM183_INCLUDEDIR)
121 AM_CONDITIONAL([COMPAT_OPT], [test "$want_compat" = yes])
122 AM_CONDITIONAL([ENABLE_EXPORT], [test "$want_export" = yes])
124 # Initialize the test suite.
125 AC_CONFIG_TESTDIR(tests)
126 AC_CONFIG_FILES([tests/Makefile tests/atlocal po/Makefile.in])
127 AM_MISSING_PROG([AUTOM4TE], [autom4te])
129 AC_CONFIG_FILES([Makefile