19
19
If you have problems, you may need to regenerate the build system entirely.
20
20
To do so, use the procedure documented by the package, typically `autoreconf'.])])
29
AU_DEFUN([GNOME_COMMON_INIT],
31
dnl this macro should come after AC_CONFIG_MACRO_DIR
32
AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
34
dnl ensure that when the Automake generated makefile calls aclocal,
35
dnl it honours the $ACLOCAL_FLAGS environment variable
36
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
37
if test -n "$ac_macro_dir"; then
38
ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
41
AC_SUBST([ACLOCAL_AMFLAGS])
43
[[$0: This macro is deprecated. You should set put "ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}"
44
in your top-level Makefile.am, instead, where "m4" is the macro directory set
45
with AC_CONFIG_MACRO_DIR() in your configure.ac]])
47
AC_DEFUN([GNOME_DEBUG_CHECK],
49
AC_ARG_ENABLE([debug],
50
AC_HELP_STRING([--enable-debug],
51
[turn on debugging]),,
54
if test x$enable_debug = xyes ; then
55
AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
56
[Enable additional debugging at the expense of performance and size])
60
dnl GNOME_MAINTAINER_MODE_DEFINES ()
61
dnl define DISABLE_DEPRECATED
63
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
65
AC_REQUIRE([AM_MAINTAINER_MODE])
68
if test $USE_MAINTAINER_MODE = yes; then
69
DOMAINS="G ATK PANGO GDK GDK_PIXBUF GTK GCONF BONOBO BONOBO_UI GNOME LIBGLADE VTE GNOME_VFS WNCK LIBSOUP"
70
for DOMAIN in $DOMAINS; do
71
DISABLE_DEPRECATED="$DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_SINGLE_INCLUDES"
75
AC_SUBST(DISABLE_DEPRECATED)
78
dnl GNOME_COMPILE_WARNINGS
79
dnl Turn on many useful compiler warnings
80
dnl For now, only works on GCC
81
AC_DEFUN([GNOME_COMPILE_WARNINGS],[
82
dnl ******************************
83
dnl More compiler warnings
84
dnl ******************************
86
AC_ARG_ENABLE(compile-warnings,
87
AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
88
[Turn on compiler warnings]),,
89
[enable_compile_warnings="m4_default([$1],[yes])"])
92
if test "x$GCC" != xyes; then
93
enable_compile_warnings=no
97
realsave_CFLAGS="$CFLAGS"
99
case "$enable_compile_warnings" in
104
warning_flags="-Wall"
107
warning_flags="-Wall -Wmissing-prototypes"
110
warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
111
CFLAGS="$warning_flags $CFLAGS"
112
for option in -Wno-sign-compare; do
113
SAVE_CFLAGS="$CFLAGS"
114
CFLAGS="$CFLAGS $option"
115
AC_MSG_CHECKING([whether gcc understands $option])
116
AC_TRY_COMPILE([], [],
119
CFLAGS="$SAVE_CFLAGS"
120
AC_MSG_RESULT($has_option)
121
if test $has_option = yes; then
122
warning_flags="$warning_flags $option"
128
if test "$enable_compile_warnings" = "error" ; then
129
warning_flags="$warning_flags -Werror"
133
AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
136
CFLAGS="$realsave_CFLAGS"
137
AC_MSG_CHECKING(what warning flags to pass to the C compiler)
138
AC_MSG_RESULT($warning_flags)
141
AC_HELP_STRING([--enable-iso-c],
142
[Try to warn if code is not ISO C ]),,
145
AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
147
if test "x$enable_iso_c" != "xno"; then
148
if test "x$GCC" = "xyes"; then
150
*[\ \ ]-ansi[\ \ ]*) ;;
151
*) complCFLAGS="$complCFLAGS -ansi" ;;
154
*[\ \ ]-pedantic[\ \ ]*) ;;
155
*) complCFLAGS="$complCFLAGS -pedantic" ;;
159
AC_MSG_RESULT($complCFLAGS)
161
WARN_CFLAGS="$warning_flags $complCFLAGS"
162
AC_SUBST(WARN_CFLAGS)
165
dnl For C++, do basically the same thing.
167
AC_DEFUN([GNOME_CXX_WARNINGS],[
168
AC_ARG_ENABLE(cxx-warnings,
169
AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
170
[Turn on compiler warnings.]),,
171
[enable_cxx_warnings="m4_default([$1],[minimum])"])
173
AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
175
if test "x$GXX" != xyes; then
176
enable_cxx_warnings=no
178
if test "x$enable_cxx_warnings" != "xno"; then
179
if test "x$GXX" = "xyes"; then
180
case " $CXXFLAGS " in
181
*[\ \ ]-Wall[\ \ ]*) ;;
182
*) warnCXXFLAGS="-Wall -Wno-unused" ;;
185
## -W is not all that useful. And it cannot be controlled
186
## with individual -Wno-xxx flags, unlike -Wall
187
if test "x$enable_cxx_warnings" = "xyes"; then
188
warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
192
AC_MSG_RESULT($warnCXXFLAGS)
194
AC_ARG_ENABLE(iso-cxx,
195
AC_HELP_STRING([--enable-iso-cxx],
196
[Try to warn if code is not ISO C++ ]),,
199
AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
201
if test "x$enable_iso_cxx" != "xno"; then
202
if test "x$GXX" = "xyes"; then
203
case " $CXXFLAGS " in
204
*[\ \ ]-ansi[\ \ ]*) ;;
205
*) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
208
case " $CXXFLAGS " in
209
*[\ \ ]-pedantic[\ \ ]*) ;;
210
*) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
214
AC_MSG_RESULT($complCXXFLAGS)
216
WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
217
AC_SUBST(WARN_CXXFLAGS)
220
# nls.m4 serial 5 (gettext-0.18)
221
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
223
dnl This file is free software; the Free Software Foundation
224
dnl gives unlimited permission to copy and/or distribute it,
225
dnl with or without modifications, as long as this notice is preserved.
227
dnl This file can can be used in projects which are not available under
228
dnl the GNU General Public License or the GNU Library General Public
229
dnl License but which still want to provide support for the GNU gettext
231
dnl Please note that the actual code of the GNU gettext library is covered
232
dnl by the GNU Library General Public License, and the rest of the GNU
233
dnl gettext package package is covered by the GNU General Public License.
234
dnl They are *not* in the public domain.
237
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
238
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
244
AC_MSG_CHECKING([whether NLS is requested])
245
dnl Default is enabled NLS
247
[ --disable-nls do not use Native Language Support],
248
USE_NLS=$enableval, USE_NLS=yes)
249
AC_MSG_RESULT([$USE_NLS])
253
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
254
# serial 1 (pkg-config-0.24)
256
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
258
# This program is free software; you can redistribute it and/or modify
259
# it under the terms of the GNU General Public License as published by
260
# the Free Software Foundation; either version 2 of the License, or
261
# (at your option) any later version.
263
# This program is distributed in the hope that it will be useful, but
264
# WITHOUT ANY WARRANTY; without even the implied warranty of
265
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
266
# General Public License for more details.
268
# You should have received a copy of the GNU General Public License
269
# along with this program; if not, write to the Free Software
270
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
272
# As a special exception to the GNU General Public License, if you
273
# distribute this file as part of a program that contains a
274
# configuration script generated by Autoconf, you may include it under
275
# the same distribution terms that you use for the rest of that program.
277
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
278
# ----------------------------------
279
AC_DEFUN([PKG_PROG_PKG_CONFIG],
280
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
281
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
282
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
283
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
284
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
285
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
287
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
288
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
290
if test -n "$PKG_CONFIG"; then
291
_pkg_min_version=m4_default([$1], [0.9.0])
292
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
293
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
300
])# PKG_PROG_PKG_CONFIG
302
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
304
# Check to see whether a particular set of modules exists. Similar
305
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
307
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
308
# only at the first occurence in configure.ac, so if the first place
309
# it's called might be skipped (such as if it is within an "if", you
310
# have to call PKG_CHECK_EXISTS manually
311
# --------------------------------------------------------------
312
AC_DEFUN([PKG_CHECK_EXISTS],
313
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
314
if test -n "$PKG_CONFIG" && \
315
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
316
m4_default([$2], [:])
317
m4_ifvaln([$3], [else
321
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
322
# ---------------------------------------------
323
m4_define([_PKG_CONFIG],
324
[if test -n "$$1"; then
326
elif test -n "$PKG_CONFIG"; then
327
PKG_CHECK_EXISTS([$3],
328
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
329
test "x$?" != "x0" && pkg_failed=yes ],
336
# _PKG_SHORT_ERRORS_SUPPORTED
337
# -----------------------------
338
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
339
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
340
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
341
_pkg_short_errors_supported=yes
343
_pkg_short_errors_supported=no
345
])# _PKG_SHORT_ERRORS_SUPPORTED
348
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
349
# [ACTION-IF-NOT-FOUND])
352
# Note that if there is a possibility the first call to
353
# PKG_CHECK_MODULES might not happen, you should be sure to include an
354
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
357
# --------------------------------------------------------------
358
AC_DEFUN([PKG_CHECK_MODULES],
359
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
360
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
361
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
364
AC_MSG_CHECKING([for $1])
366
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
367
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
369
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
370
and $1[]_LIBS to avoid the need to call pkg-config.
371
See the pkg-config man page for more details.])
373
if test $pkg_failed = yes; then
375
_PKG_SHORT_ERRORS_SUPPORTED
376
if test $_pkg_short_errors_supported = yes; then
377
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
379
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
381
# Put the nasty error message in config.log where it belongs
382
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
384
m4_default([$4], [AC_MSG_ERROR(
385
[Package requirements ($2) were not met:
389
Consider adjusting the PKG_CONFIG_PATH environment variable if you
390
installed software in a non-standard prefix.
394
elif test $pkg_failed = untried; then
396
m4_default([$4], [AC_MSG_FAILURE(
397
[The pkg-config script could not be found or is too old. Make sure it
398
is in your PATH or set the PKG_CONFIG environment variable to the full
403
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
406
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
407
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
411
])# PKG_CHECK_MODULES
413
22
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
415
24
# This file is free software; the Free Software Foundation
1459
1068
AC_SUBST([am__untar])
1460
1069
]) # _AM_PROG_TAR
1071
# nls.m4 serial 5 (gettext-0.18)
1072
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
1074
dnl This file is free software; the Free Software Foundation
1075
dnl gives unlimited permission to copy and/or distribute it,
1076
dnl with or without modifications, as long as this notice is preserved.
1078
dnl This file can can be used in projects which are not available under
1079
dnl the GNU General Public License or the GNU Library General Public
1080
dnl License but which still want to provide support for the GNU gettext
1082
dnl Please note that the actual code of the GNU gettext library is covered
1083
dnl by the GNU Library General Public License, and the rest of the GNU
1084
dnl gettext package package is covered by the GNU General Public License.
1085
dnl They are *not* in the public domain.
1088
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1089
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1095
AC_MSG_CHECKING([whether NLS is requested])
1096
dnl Default is enabled NLS
1097
AC_ARG_ENABLE([nls],
1098
[ --disable-nls do not use Native Language Support],
1099
USE_NLS=$enableval, USE_NLS=yes)
1100
AC_MSG_RESULT([$USE_NLS])
1104
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1105
# serial 1 (pkg-config-0.24)
1107
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1109
# This program is free software; you can redistribute it and/or modify
1110
# it under the terms of the GNU General Public License as published by
1111
# the Free Software Foundation; either version 2 of the License, or
1112
# (at your option) any later version.
1114
# This program is distributed in the hope that it will be useful, but
1115
# WITHOUT ANY WARRANTY; without even the implied warranty of
1116
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1117
# General Public License for more details.
1119
# You should have received a copy of the GNU General Public License
1120
# along with this program; if not, write to the Free Software
1121
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1123
# As a special exception to the GNU General Public License, if you
1124
# distribute this file as part of a program that contains a
1125
# configuration script generated by Autoconf, you may include it under
1126
# the same distribution terms that you use for the rest of that program.
1128
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1129
# ----------------------------------
1130
AC_DEFUN([PKG_PROG_PKG_CONFIG],
1131
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1132
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1133
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1134
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1135
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1137
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1138
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1140
if test -n "$PKG_CONFIG"; then
1141
_pkg_min_version=m4_default([$1], [0.9.0])
1142
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1143
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1144
AC_MSG_RESULT([yes])
1150
])# PKG_PROG_PKG_CONFIG
1152
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1154
# Check to see whether a particular set of modules exists. Similar
1155
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1157
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1158
# only at the first occurence in configure.ac, so if the first place
1159
# it's called might be skipped (such as if it is within an "if", you
1160
# have to call PKG_CHECK_EXISTS manually
1161
# --------------------------------------------------------------
1162
AC_DEFUN([PKG_CHECK_EXISTS],
1163
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1164
if test -n "$PKG_CONFIG" && \
1165
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1166
m4_default([$2], [:])
1167
m4_ifvaln([$3], [else
1171
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1172
# ---------------------------------------------
1173
m4_define([_PKG_CONFIG],
1174
[if test -n "$$1"; then
1176
elif test -n "$PKG_CONFIG"; then
1177
PKG_CHECK_EXISTS([$3],
1178
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1185
# _PKG_SHORT_ERRORS_SUPPORTED
1186
# -----------------------------
1187
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1188
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1189
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1190
_pkg_short_errors_supported=yes
1192
_pkg_short_errors_supported=no
1194
])# _PKG_SHORT_ERRORS_SUPPORTED
1197
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1198
# [ACTION-IF-NOT-FOUND])
1201
# Note that if there is a possibility the first call to
1202
# PKG_CHECK_MODULES might not happen, you should be sure to include an
1203
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1206
# --------------------------------------------------------------
1207
AC_DEFUN([PKG_CHECK_MODULES],
1208
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1209
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1210
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1213
AC_MSG_CHECKING([for $1])
1215
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1216
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1218
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1219
and $1[]_LIBS to avoid the need to call pkg-config.
1220
See the pkg-config man page for more details.])
1222
if test $pkg_failed = yes; then
1224
_PKG_SHORT_ERRORS_SUPPORTED
1225
if test $_pkg_short_errors_supported = yes; then
1226
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1228
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1230
# Put the nasty error message in config.log where it belongs
1231
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1233
m4_default([$4], [AC_MSG_ERROR(
1234
[Package requirements ($2) were not met:
1238
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1239
installed software in a non-standard prefix.
1243
elif test $pkg_failed = untried; then
1245
m4_default([$4], [AC_MSG_FAILURE(
1246
[The pkg-config script could not be found or is too old. Make sure it
1247
is in your PATH or set the PKG_CONFIG environment variable to the full
1252
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
1255
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1256
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1257
AC_MSG_RESULT([yes])
1260
])# PKG_CHECK_MODULES
1267
dnl GNOME_COMMON_INIT
1269
AU_DEFUN([GNOME_COMMON_INIT],
1271
dnl this macro should come after AC_CONFIG_MACRO_DIR
1272
AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
1274
dnl ensure that when the Automake generated makefile calls aclocal,
1275
dnl it honours the $ACLOCAL_FLAGS environment variable
1276
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
1277
if test -n "$ac_macro_dir"; then
1278
ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
1281
AC_SUBST([ACLOCAL_AMFLAGS])
1283
[[$0: This macro is deprecated. You should set put "ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}"
1284
in your top-level Makefile.am, instead, where "m4" is the macro directory set
1285
with AC_CONFIG_MACRO_DIR() in your configure.ac]])
1287
AC_DEFUN([GNOME_DEBUG_CHECK],
1289
AC_ARG_ENABLE([debug],
1290
AC_HELP_STRING([--enable-debug],
1291
[turn on debugging]),,
1294
if test x$enable_debug = xyes ; then
1295
AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
1296
[Enable additional debugging at the expense of performance and size])
1300
dnl GNOME_MAINTAINER_MODE_DEFINES ()
1301
dnl define DISABLE_DEPRECATED
1303
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
1305
AC_REQUIRE([AM_MAINTAINER_MODE])
1307
DISABLE_DEPRECATED=""
1308
if test $USE_MAINTAINER_MODE = yes; then
1309
DOMAINS="G ATK PANGO GDK GDK_PIXBUF GTK GCONF BONOBO BONOBO_UI GNOME LIBGLADE VTE GNOME_VFS WNCK LIBSOUP"
1310
for DOMAIN in $DOMAINS; do
1311
DISABLE_DEPRECATED="$DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_SINGLE_INCLUDES"
1315
AC_SUBST(DISABLE_DEPRECATED)
1318
dnl GNOME_COMPILE_WARNINGS
1319
dnl Turn on many useful compiler warnings
1320
dnl For now, only works on GCC
1321
AC_DEFUN([GNOME_COMPILE_WARNINGS],[
1322
dnl ******************************
1323
dnl More compiler warnings
1324
dnl ******************************
1326
AC_ARG_ENABLE(compile-warnings,
1327
AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
1328
[Turn on compiler warnings]),,
1329
[enable_compile_warnings="m4_default([$1],[yes])"])
1332
if test "x$GCC" != xyes; then
1333
enable_compile_warnings=no
1337
realsave_CFLAGS="$CFLAGS"
1339
case "$enable_compile_warnings" in
1344
warning_flags="-Wall"
1347
warning_flags="-Wall -Wmissing-prototypes"
1350
warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
1351
CFLAGS="$warning_flags $CFLAGS"
1352
for option in -Wno-sign-compare; do
1353
SAVE_CFLAGS="$CFLAGS"
1354
CFLAGS="$CFLAGS $option"
1355
AC_MSG_CHECKING([whether gcc understands $option])
1356
AC_TRY_COMPILE([], [],
1359
CFLAGS="$SAVE_CFLAGS"
1360
AC_MSG_RESULT($has_option)
1361
if test $has_option = yes; then
1362
warning_flags="$warning_flags $option"
1368
if test "$enable_compile_warnings" = "error" ; then
1369
warning_flags="$warning_flags -Werror"
1373
AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
1376
CFLAGS="$realsave_CFLAGS"
1377
AC_MSG_CHECKING(what warning flags to pass to the C compiler)
1378
AC_MSG_RESULT($warning_flags)
1380
AC_ARG_ENABLE(iso-c,
1381
AC_HELP_STRING([--enable-iso-c],
1382
[Try to warn if code is not ISO C ]),,
1385
AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
1387
if test "x$enable_iso_c" != "xno"; then
1388
if test "x$GCC" = "xyes"; then
1390
*[\ \ ]-ansi[\ \ ]*) ;;
1391
*) complCFLAGS="$complCFLAGS -ansi" ;;
1394
*[\ \ ]-pedantic[\ \ ]*) ;;
1395
*) complCFLAGS="$complCFLAGS -pedantic" ;;
1399
AC_MSG_RESULT($complCFLAGS)
1401
WARN_CFLAGS="$warning_flags $complCFLAGS"
1402
AC_SUBST(WARN_CFLAGS)
1405
dnl For C++, do basically the same thing.
1407
AC_DEFUN([GNOME_CXX_WARNINGS],[
1408
AC_ARG_ENABLE(cxx-warnings,
1409
AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
1410
[Turn on compiler warnings.]),,
1411
[enable_cxx_warnings="m4_default([$1],[minimum])"])
1413
AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
1415
if test "x$GXX" != xyes; then
1416
enable_cxx_warnings=no
1418
if test "x$enable_cxx_warnings" != "xno"; then
1419
if test "x$GXX" = "xyes"; then
1420
case " $CXXFLAGS " in
1421
*[\ \ ]-Wall[\ \ ]*) ;;
1422
*) warnCXXFLAGS="-Wall -Wno-unused" ;;
1425
## -W is not all that useful. And it cannot be controlled
1426
## with individual -Wno-xxx flags, unlike -Wall
1427
if test "x$enable_cxx_warnings" = "xyes"; then
1428
warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
1432
AC_MSG_RESULT($warnCXXFLAGS)
1434
AC_ARG_ENABLE(iso-cxx,
1435
AC_HELP_STRING([--enable-iso-cxx],
1436
[Try to warn if code is not ISO C++ ]),,
1437
[enable_iso_cxx=no])
1439
AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
1441
if test "x$enable_iso_cxx" != "xno"; then
1442
if test "x$GXX" = "xyes"; then
1443
case " $CXXFLAGS " in
1444
*[\ \ ]-ansi[\ \ ]*) ;;
1445
*) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
1448
case " $CXXFLAGS " in
1449
*[\ \ ]-pedantic[\ \ ]*) ;;
1450
*) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
1454
AC_MSG_RESULT($complCXXFLAGS)
1456
WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
1457
AC_SUBST(WARN_CXXFLAGS)
1462
1460
m4_include([m4/gnome-doc-utils.m4])
1463
1461
m4_include([m4/intltool.m4])
1464
1462
m4_include([m4/libtool.m4])