-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure.ac
103 lines (87 loc) · 3.18 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Process this file with autoconf to produce a configure script.
AC_INIT([mlocate], [0.26], [mitr@redhat.com], ,
[https://fedorahosted.org/mlocate/])
AC_COPYRIGHT(
[Copyright (C) 2005, 2006, 2007, 2009, 2010, 2012 Red Hat, Inc. All rights
reserved.
This copyrighted material is made available to anyone wishing to use, modify,
copy, or redistribute it subject to the terms and conditions of the GNU General
Public License v.2.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA.
Author: Miloslav Trmac <mitr@redhat.com>])
AC_PREREQ([2.63b])
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_SRCDIR([src/locate.c])
AC_CONFIG_AUX_DIR([admin])
AC_CONFIG_TESTDIR([.], [src:tests])
AM_INIT_AUTOMAKE([no-dist-gzip dist-xz no-define subdir-objects -Wall])
# Checks for programs.
AC_PROG_CC
gl_EARLY
AM_PROG_CC_C_O
AM_PROG_AR
AC_PROG_RANLIB
# This interface seems to be undocumented, but bison uses it ;-)
AM_MISSING_PROG([AUTOM4TE], [autom4te])
gl_INIT
# Checks for libraries.
AM_GNU_GETTEXT([external], [need-ngettext])
AM_GNU_GETTEXT_VERSION([0.18.2])
# Checks for header files.
# Checks for types.
# Checks for structures.
# Checks for compiler characteristics.
# Checks for library functions.
## getopt_long () availability should be checked here
AC_CHECK_FUNCS_ONCE([fdopendir])
AC_FUNC_GETMNTENT
# Checks for system services.
AC_SYS_LARGEFILE
AC_CACHE_CHECK([for mounted filesystem table in /proc],
[mitr_cv_sys_proc_mounts],
[mitr_cv_sys_proc_mounts=no
if test "$cross_compiling" != yes; then
for i in /proc/self/mounts /proc/mounts; do
if test -f "$i"; then
mitr_cv_sys_proc_mounts=$i
break
fi
done
fi])
if test "$mitr_cv_sys_proc_mounts" != no; then
AC_DEFINE_UNQUOTED([PROC_MOUNTS_PATH], ["$mitr_cv_sys_proc_mounts"],
[Define to the path to the mounted filesystem table.])
fi
# Miscellanous hackery.
# Modify CFLAGS after all tests are run (some of them would fail because
# of the -Werror).
if test "$GCC" = yes ; then
AC_CACHE_CHECK([for available GCC warning flags],
[mitr_cv_prog_gcc_warnings],
[mitr_cv_prog_gcc_warnings=""
for i in -Wall -W -Wcast-align -Wmissing-noreturn -Wpointer-arith dnl
-Wshadow -Wstrict-prototypes -Wwrite-strings; do
oldcflags=$CFLAGS
CFLAGS="$CFLAGS $i"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
[mitr_cv_prog_gcc_warnings="$mitr_cv_prog_gcc_warnings $i"])
CFLAGS=$oldcflags
done])
CFLAGS="$CFLAGS $mitr_cv_prog_gcc_warnings"
AC_MSG_CHECKING([whether we should use -Werror])
AC_ARG_ENABLE([Werror],
AS_HELP_STRING([--enable-Werror],
[use -Werror if compiling with gcc (default is NO)]),
[], enable_Werror=no)
if test "x$enable_Werror" != xno; then
CFLAGS="$CFLAGS -Werror"
fi
AC_MSG_RESULT([$enable_Werror])
fi
AC_CONFIG_FILES([Makefile gnulib/lib/Makefile po/Makefile.in])
AC_OUTPUT