~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Colin Watson
  • Date: 2013-10-30 15:48:33 UTC
  • mfrom: (8.3.5 sid)
  • Revision ID: cjwatson@canonical.com-20131030154833-xdt6e1yfffqom1c4
merge from Debian 8.21-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- autoconf -*-
2
2
# Process this file with autoconf to produce a configure script.
3
3
 
4
 
# Copyright (C) 1991-2012 Free Software Foundation, Inc.
 
4
# Copyright (C) 1991-2013 Free Software Foundation, Inc.
5
5
 
6
6
# This program is free software: you can redistribute it and/or modify
7
7
# it under the terms of the GNU General Public License as published by
67
67
case $PERL in *"/missing "*) cu_have_perl=no;; esac
68
68
AM_CONDITIONAL([HAVE_PERL], [test $cu_have_perl = yes])
69
69
 
70
 
AC_ARG_ENABLE([gcc-warnings],
71
 
  [AS_HELP_STRING([--enable-gcc-warnings],
72
 
     [turn on many GCC warnings (for developers; best with GNU make)])],
73
 
  [case $enableval in
74
 
     yes|no) ;;
75
 
     *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
76
 
   esac
77
 
   gl_gcc_warnings=$enableval],
78
 
  [if test -d "$srcdir"/.git; then
79
 
     gl_gcc_warnings=yes
80
 
   else
81
 
     gl_gcc_warnings=no
82
 
   fi]
83
 
)
84
 
 
85
70
# gl_GCC_VERSION_IFELSE([major], [minor], [run-if-found], [run-if-not-found])
86
71
# ------------------------------------------------
87
72
# If $CPP is gcc-MAJOR.MINOR or newer, then run RUN-IF-FOUND.
100
85
  ]
101
86
)
102
87
 
 
88
AC_ARG_ENABLE([gcc-warnings],
 
89
  [AS_HELP_STRING([--enable-gcc-warnings],
 
90
     [turn on many GCC warnings (for developers; best with GNU make)])],
 
91
  [case $enableval in
 
92
     yes|no) ;;
 
93
     *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
 
94
   esac
 
95
   gl_gcc_warnings=$enableval],
 
96
  [
 
97
   # GCC provides fine-grained control over diagnostics which
 
98
   # is used in gnulib for example to suppress warnings from
 
99
   # certain sections of code.  So if this is available and
 
100
   # we're running from a git repo, then auto enable the warnings.
 
101
   gl_gcc_warnings=no
 
102
   gl_GCC_VERSION_IFELSE([4], [6],
 
103
                         [test -d "$srcdir"/.git && gl_gcc_warnings=yes])]
 
104
)
 
105
 
103
106
if test "$gl_gcc_warnings" = yes; then
104
107
  gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
105
108
  AC_SUBST([WERROR_CFLAGS])
170
173
  AH_VERBATIM([FORTIFY_SOURCE],
171
174
  [/* Enable compile-time and run-time bounds-checking, and some warnings,
172
175
      without upsetting glibc 2.15+. */
173
 
   #if defined __OPTIMIZE__ && __OPTIMIZE__
 
176
   #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
174
177
   # define _FORTIFY_SOURCE 2
175
178
   #endif
176
179
  ])