add changelog
[platform/upstream/gdbm.git] / configure.ac
1 # This file is part of GDBM.                                   -*- autoconf -*-
2 # Copyright (C) 2007, 2009, 2011, 2013 Free Software Foundation, Inc.
3 #
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)
7 # any later version.
8 #
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.
13 #
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/>. */
16
17 m4_define([_GDBM_VERSION_MAJOR], 1)
18 m4_define([_GDBM_VERSION_MINOR], 11)
19 dnl m4_define([_GDBM_VERSION_PATCH], 0)
20
21 AC_INIT([gdbm],
22         _GDBM_VERSION_MAJOR._GDBM_VERSION_MINOR[]m4_ifdef([_GDBM_VERSION_PATCH],._GDBM_VERSION_PATCH),
23         [bug-gdbm@gnu.org],,
24         [http://www.gnu.org/software/gdbm])
25 AC_PREREQ(2.69)
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])
31
32 # Enable silent rules by default:
33 AM_SILENT_RULES([yes])
34
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))
38
39 AC_ARG_ENABLE([memory-mapped-io],
40   AC_HELP_STRING(
41     [--enable-memory-mapped-io]
42     [Use mmap(2) for disk I/O. (Default is YES.)]),
43     [mapped_io=$enableval],
44     [mapped_io=yes])
45
46 AC_ARG_ENABLE([libgdbm-compat],
47   AC_HELP_STRING(
48     [--enable-libgdbm-compat]
49     [Build and install libgdbm_compat. (Default is NO.)]),
50     [want_compat=$enableval],
51     [want_compat=no])
52
53 AC_ARG_ENABLE([gdbm-export],
54   AC_HELP_STRING(
55     [--enable-gdbm-export],
56     [Build and install gdbmexport with specified gdbm 1.8 library. (Default is NO.)]),
57     [want_export=$enableval],
58     [want_export=no])
59
60 AC_ARG_WITH([gdbm183-library],
61   AC_HELP_STRING(
62     [--with-gdbm183-library],
63     [Build gdbmexport with specified (static) library.]),
64     [GDBM183_LIBRARY=$withval],
65     [GDBM183_LIBRARY="-lgdbm"])
66
67 AC_ARG_WITH([gdbm183-libdir],
68   AC_HELP_STRING(
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"])
73
74 AC_ARG_WITH([gdbm183-includedir],
75   AC_HELP_STRING(
76     [--with-gdbm183-includedir],
77     [Build gdbmexport with gdbm.h in the specified directory.]),
78     [GDBM183_INCLUDEDIR=$withval],
79     [GDBM183_INCLUDEDIR="/usr/local/include"])
80     
81 dnl Check for programs
82 AC_PROG_CC
83 AC_PROG_CPP
84 AC_PROG_INSTALL
85 AC_PROG_LIBTOOL
86 AC_SYS_LARGEFILE
87 AC_PROG_YACC
88 AC_PROG_LEX
89 AC_C_CONST
90 AC_TYPE_UNSIGNED_LONG_LONG_INT
91
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"
95 else
96         GDBM_COUNT_T="unsigned long"
97 fi
98
99 dnl Internationalization macros.
100 AM_GNU_GETTEXT([external], [need-ngettext])
101 AM_GNU_GETTEXT_VERSION(0.18)
102
103 AC_CHECK_HEADERS([sys/file.h sys/termios.h string.h locale.h getopt.h])
104
105 AC_CHECK_LIB(dbm, main)
106 AC_CHECK_LIB(ndbm, main)
107 AC_CHECK_FUNCS([rename ftruncate flock lockf fsync setlocale getopt_long])
108
109 if test x$mapped_io = xyes
110 then
111   AC_FUNC_MMAP()
112   AC_CHECK_FUNCS([msync])
113 fi
114 AC_TYPE_OFF_T
115 AC_CHECK_SIZEOF(off_t)
116 AC_CHECK_MEMBERS([struct stat.st_blksize])
117
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])
123
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])
128
129 AC_CONFIG_FILES([Makefile
130                  src/Makefile
131                  src/gdbm.h
132                  doc/Makefile
133                  compat/Makefile
134                  export/Makefile])
135 AC_OUTPUT