~ubuntu-branches/ubuntu/natty/diffutils/natty

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2010-05-04 20:38:00 UTC
  • mfrom: (2.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100504203800-f67xd9rsa9xl9qqj
Tags: 1:3.0-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Configure template for GNU Diffutils.
2
2
 
3
 
# Copyright (C) 1994, 1995, 1998, 2001, 2002 Free Software Foundation, Inc.
 
3
# Copyright (C) 1994-1995, 1998, 2001-2002, 2004, 2006, 2009-2010 Free Software
 
4
# Foundation, Inc.
4
5
 
5
 
# This program is free software; you can redistribute it and/or modify
 
6
# This program is free software: you can redistribute it and/or modify
6
7
# it under the terms of the GNU General Public License as published by
7
 
# the Free Software Foundation; either version 2, or (at your option)
8
 
# any later version.
 
8
# the Free Software Foundation, either version 3 of the License, or
 
9
# (at your option) any later version.
9
10
 
10
11
# This program is distributed in the hope that it will be useful,
11
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
14
# GNU General Public License for more details.
14
15
 
15
16
# You should have received a copy of the GNU General Public License
16
 
# along with this program; if not, write to the Free Software
17
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18
 
# 02111-1307, USA.
19
 
 
20
 
AC_PREREQ(2.53)
21
 
 
22
 
AC_INIT(GNU diffutils, 2.8.1, bug-gnu-utils@gnu.org)
23
 
AC_CONFIG_SRCDIR(src/diff.c)
24
 
 
25
 
AC_CONFIG_AUX_DIR(config)
26
 
AM_CONFIG_HEADER([config.h:config.hin])
27
 
AM_INIT_AUTOMAKE([gnits])
 
17
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 
 
19
AC_PREREQ(2.61)
 
20
 
 
21
AC_INIT([GNU diffutils],
 
22
        m4_esyscmd([build-aux/git-version-gen .tarball-version]),
 
23
        [bug-diffutils@gnu.org])
 
24
 
 
25
AC_CONFIG_SRCDIR([src/diff.c])
 
26
AC_CONFIG_AUX_DIR([build-aux])
 
27
AC_CONFIG_MACRO_DIR([m4])
 
28
 
 
29
AM_INIT_AUTOMAKE([1.11 dist-xz color-tests parallel-tests])
 
30
AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
 
31
 
 
32
AC_CONFIG_HEADER([lib/config.h:lib/config.hin])
28
33
 
29
34
AC_PROG_AWK
30
35
AC_PROG_CC
31
 
AC_ISC_POSIX
32
36
AM_PROG_CC_STDC
33
 
AC_PROG_CPP
34
 
AM_MISSING_PROG(HELP2MAN, help2man)
35
 
AC_PROG_INSTALL
 
37
AM_MISSING_PROG([HELP2MAN], [help2man])
36
38
AC_PROG_RANLIB
37
 
 
38
 
AC__GNU_SOURCE
39
 
AC_DEFINE([__EXTENSIONS__], 1, [Enable Solaris extensions.])
 
39
gl_EARLY
 
40
gl_USE_SYSTEM_EXTENSIONS
40
41
AC_SYS_LARGEFILE
41
 
 
42
 
AC_C_CONST
 
42
gl_INIT
 
43
 
 
44
AC_ARG_ENABLE([gcc-warnings],
 
45
  [AS_HELP_STRING([--enable-gcc-warnings],
 
46
                  [turn on lots of GCC warnings (for developers)])],
 
47
  [case $enableval in
 
48
     yes|no) ;;
 
49
     *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
 
50
   esac
 
51
   gl_gcc_warnings=$enableval],
 
52
  [gl_gcc_warnings=no]
 
53
)
 
54
 
 
55
if test "$gl_gcc_warnings" = yes; then
 
56
  gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
 
57
  AC_SUBST([WERROR_CFLAGS])
 
58
 
 
59
  nw=
 
60
  # This, $nw, is the list of warnings we disable.
 
61
  nw="$nw -Wdeclaration-after-statement" # too useful to forbid
 
62
  nw="$nw -Waggregate-return"       # anachronistic
 
63
  nw="$nw -Wlong-long"              # C90 is anachronistic (lib/gethrxtime.h)
 
64
  nw="$nw -Wc++-compat"             # We don't care about C++ compilers
 
65
  nw="$nw -Wundef"                  # Warns on '#if GNULIB_FOO' etc in gnulib
 
66
  nw="$nw -Wtraditional"            # Warns on #elif which we use often
 
67
  nw="$nw -Wcast-qual"              # Too many warnings for now
 
68
  nw="$nw -Wconversion"             # Too many warnings for now
 
69
  nw="$nw -Wsystem-headers"         # Don't let system headers trigger warnings
 
70
  nw="$nw -Wsign-conversion"        # Too many warnings for now
 
71
  nw="$nw -Wtraditional-conversion" # Too many warnings for now
 
72
  nw="$nw -Wunreachable-code"       # Too many warnings for now
 
73
  nw="$nw -Wpadded"                 # Our structs are not padded
 
74
  nw="$nw -Wredundant-decls"        # openat.h declares e.g., mkdirat
 
75
  nw="$nw -Wlogical-op"             # any use of fwrite provokes this
 
76
  nw="$nw -Wformat-nonliteral"      # who.c and pinky.c strftime uses
 
77
  nw="$nw -Wvla"                    # warnings in gettext.h
 
78
  nw="$nw -Wnested-externs"         # use of XARGMATCH/verify_function__
 
79
  nw="$nw -Wswitch-enum"            # Too many warnings for now
 
80
  nw="$nw -Wswitch-default"         # Too many warnings for now
 
81
  nw="$nw -Wstack-protector"        # not worth working around
 
82
  # things I might fix soon:
 
83
  nw="$nw -Wfloat-equal"            # sort.c, seq.c
 
84
  nw="$nw -Wmissing-format-attribute" # copy.c
 
85
  nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c
 
86
  nw="$nw -Winline"                 # system.h's readdir_ignoring_dot_and_dotdot
 
87
  nw="$nw -Wstrict-overflow"        # expr.c, pr.c, tr.c, factor.c
 
88
  nw="$nw -Wformat-extra-args"      # sdiff.c
 
89
  # ?? -Wstrict-overflow
 
90
 
 
91
  gl_MANYWARN_ALL_GCC([ws])
 
92
  gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw])
 
93
  for w in $ws; do
 
94
    gl_WARN_ADD([$w])
 
95
  done
 
96
  gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
 
97
  gl_WARN_ADD([-Wno-sign-compare])     # Too many warnings for now
 
98
  gl_WARN_ADD([-Wno-pointer-sign])     # Too many warnings for now
 
99
  gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
 
100
 
 
101
  # In spite of excluding -Wlogical-op above, it is enabled, as of
 
102
  # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c
 
103
  gl_WARN_ADD([-Wno-logical-op])
 
104
 
 
105
  gl_WARN_ADD([-fdiagnostics-show-option])
 
106
  gl_WARN_ADD([-funit-at-a-time])
 
107
 
 
108
  AC_SUBST([WARN_CFLAGS])
 
109
 
 
110
  AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
 
111
  AC_DEFINE([_FORTIFY_SOURCE], [2],
 
112
    [enable compile-time and run-time bounds-checking, and some warnings])
 
113
  AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
 
114
 
 
115
  # We use a slightly smaller set of warning options for lib/.
 
116
  # Remove the following and save the result in GNULIB_WARN_CFLAGS.
 
117
  nw=
 
118
  nw="$nw -Wunused-macros"
 
119
  nw="$nw -Wmissing-prototypes"
 
120
  nw="$nw -Wold-style-definition"
 
121
  gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
 
122
  AC_SUBST([GNULIB_WARN_CFLAGS])
 
123
fi
 
124
 
43
125
AC_C_INLINE
44
126
AC_C_VARARRAYS
45
127
 
46
 
AC_DEFINE(DEFAULT_DIFF_PROGRAM, "diff",
47
 
  [Name of "diff" program, unless overridden.])
48
 
 
49
 
AC_DEFINE(DEFAULT_EDITOR_PROGRAM, "ed",
 
128
AC_DEFINE([DEFAULT_EDITOR_PROGRAM], ["ed"],
50
129
  [Name of editor program, unless overridden.])
51
130
 
52
 
AC_PATH_PROG(PR_PROGRAM, pr, "")
53
 
AC_DEFINE_UNQUOTED(PR_PROGRAM, "$PR_PROGRAM", [Name of "pr" program.])
 
131
AC_PATH_PROG([PR_PROGRAM], [pr], [""])
 
132
AC_DEFINE_UNQUOTED([PR_PROGRAM], ["$PR_PROGRAM"], [Name of "pr" program.])
54
133
 
55
 
AC_HEADER_STDBOOL
56
 
AC_HEADER_STDC
57
 
AC_CHECK_HEADERS(fcntl.h libintl.h limits.h locale.h \
58
 
  stdlib.h string.h sys/file.h time.h unistd.h)
59
134
AC_CHECK_MEMBERS([struct stat.st_blksize])
60
135
AC_CHECK_MEMBERS([struct stat.st_rdev])
61
 
AC_CHECK_TYPE(ptrdiff_t, int)
62
 
AC_CHECK_TYPE(ssize_t, int)
63
 
jm_AC_TYPE_UINTMAX_T
64
 
AM_GNU_GETTEXT([external])
65
 
XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT"
66
136
AC_HEADER_DIRENT
67
 
AC_HEADER_STAT
68
137
AC_HEADER_SYS_WAIT
69
 
AC_STRUCT_ST_MTIM_NSEC
70
138
AC_TYPE_PID_T
71
 
AC_TYPE_SIGNAL
72
139
 
73
 
AC_CHECK_FUNCS(diraccess dup2 gettimeofday \
74
 
  sigaction sigprocmask strchr strerror tmpnam)
75
 
AC_REPLACE_FUNCS(memchr mkstemp strcasecmp waitpid)
76
 
if test $ac_cv_func_mkstemp != yes; then
77
 
  AC_LIBOBJ(tempname)
 
140
AC_CHECK_FUNCS_ONCE([sigaction sigprocmask strcasecoll stricoll])
 
141
if test $ac_cv_func_sigprocmask = no; then
 
142
  AC_CHECK_FUNCS([sigblock])
78
143
fi
79
144
AC_FUNC_CLOSEDIR_VOID
80
145
AC_FUNC_FORK
81
 
AC_FUNC_VPRINTF
82
 
jm_FUNC_GLIBC_UNLOCKED_IO
83
 
jm_FUNC_GNU_STRFTIME
84
 
# No need for AC_FUNC_MEMCMP, since memcmp is used only to test for equality.
85
 
jm_FUNC_MALLOC
86
 
jm_FUNC_REALLOC
87
 
jm_PREREQ_C_STACK
88
 
jm_PREREQ_ERROR
89
 
jm_PREREQ_HARD_LOCALE
90
 
jm_PREREQ_QUOTEARG
91
 
jm_PREREQ_REGEX
92
 
AC_DEFINE([REGEX_MALLOC], 1,
93
 
  [Define to 1 to avoid alloca in the regular-expression implementation.])
94
 
jm_PREREQ_TEMPNAME
95
 
jm_AC_PREREQ_XSTRTOUMAX
96
 
 
97
 
# Check for clock_gettime and its library.  Solaris puts it in -lrt or
98
 
# -lposix4, but we don't want to link that library unless we have to.
99
 
diff_saved_libs=$LIBS
100
 
AC_SEARCH_LIBS(clock_gettime, [rt posix4])
101
 
case $ac_cv_search_clock_gettime in
102
 
no | 'none required')
103
 
  LIB_CLOCK_GETTIME=;;
104
 
*)
105
 
  LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime;;
106
 
esac
107
 
AC_SUBST([LIB_CLOCK_GETTIME])
108
 
AC_CHECK_FUNCS(clock_gettime)
109
 
LIBS=$diff_saved_libs
110
 
 
111
 
# fnmatch
112
 
AC_FUNC_FNMATCH
113
 
if test $ac_cv_func_fnmatch_works = yes; then
114
 
  rm -f lib/fnmatch.h
115
 
else
116
 
  AC_LIBOBJ(fnmatch)
117
 
  AC_CONFIG_LINKS(lib/fnmatch.h:lib/fnmatch.hin)
118
 
fi
119
 
 
120
 
# regex
121
 
jm_INCLUDED_REGEX([lib/regex.c])
122
 
if test "$jm_with_regex" = yes; then
123
 
  AC_CONFIG_LINKS(lib/regex.h:lib/regex.hin)
124
 
else
125
 
  rm -f lib/regex.h
126
 
fi
127
 
 
128
 
jm_AC_DOS
129
 
AC_FUNC_SETMODE_DOS
130
 
 
131
 
AC_CONFIG_FILES([Makefile \
132
 
                 lib/Makefile lib/posix/Makefile man/Makefile \
133
 
                 m4/Makefile ms/Makefile po/Makefile.in src/Makefile])
134
 
AC_CONFIG_COMMANDS([default], [date > stamp-h])
 
146
 
 
147
AM_GNU_GETTEXT([external], [need-ngettext])
 
148
AM_GNU_GETTEXT_VERSION([0.17])
 
149
XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT"
 
150
 
 
151
AC_CONFIG_FILES([
 
152
  Makefile
 
153
  lib/Makefile
 
154
  src/Makefile
 
155
  tests/Makefile
 
156
  gnulib-tests/Makefile
 
157
  man/Makefile
 
158
  po/Makefile.in
 
159
  ms/Makefile
 
160
])
135
161
AC_OUTPUT