~ubuntu-branches/ubuntu/oneiric/gnome-control-center/oneiric-proposed

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Package Import Robot
  • Author(s): Rodrigo Moya
  • Date: 2011-11-10 13:42:38 UTC
  • mfrom: (1.1.55)
  • Revision ID: package-import@ubuntu.com-20111110134238-ac0rt068x9l9nxct
Tags: 1:3.2.2-0ubuntu1
New upstream release (LP: #888526)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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'.])])
21
21
 
22
 
# gnome-common.m4
23
 
#
24
 
# serial 3
25
 
26
 
 
27
 
dnl GNOME_COMMON_INIT
28
 
 
29
 
AU_DEFUN([GNOME_COMMON_INIT],
30
 
[
31
 
  dnl this macro should come after AC_CONFIG_MACRO_DIR
32
 
  AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
33
 
 
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"
39
 
  fi
40
 
 
41
 
  AC_SUBST([ACLOCAL_AMFLAGS])
42
 
],
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]])
46
 
 
47
 
AC_DEFUN([GNOME_DEBUG_CHECK],
48
 
[
49
 
        AC_ARG_ENABLE([debug],
50
 
                      AC_HELP_STRING([--enable-debug],
51
 
                                     [turn on debugging]),,
52
 
                      [enable_debug=no])
53
 
 
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])
57
 
        fi
58
 
])
59
 
 
60
 
dnl GNOME_MAINTAINER_MODE_DEFINES ()
61
 
dnl define DISABLE_DEPRECATED
62
 
dnl
63
 
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
64
 
[
65
 
        AC_REQUIRE([AM_MAINTAINER_MODE])
66
 
 
67
 
        DISABLE_DEPRECATED=""
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"
72
 
                done
73
 
        fi
74
 
 
75
 
        AC_SUBST(DISABLE_DEPRECATED)
76
 
])
77
 
 
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 ******************************
85
 
 
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])"])
90
 
 
91
 
    warnCFLAGS=
92
 
    if test "x$GCC" != xyes; then
93
 
        enable_compile_warnings=no
94
 
    fi
95
 
 
96
 
    warning_flags=
97
 
    realsave_CFLAGS="$CFLAGS"
98
 
 
99
 
    case "$enable_compile_warnings" in
100
 
    no)
101
 
        warning_flags=
102
 
        ;;
103
 
    minimum)
104
 
        warning_flags="-Wall"
105
 
        ;;
106
 
    yes)
107
 
        warning_flags="-Wall -Wmissing-prototypes"
108
 
        ;;
109
 
    maximum|error)
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([], [],
117
 
                        has_option=yes,
118
 
                        has_option=no,)
119
 
                CFLAGS="$SAVE_CFLAGS"
120
 
                AC_MSG_RESULT($has_option)
121
 
                if test $has_option = yes; then
122
 
                  warning_flags="$warning_flags $option"
123
 
                fi
124
 
                unset has_option
125
 
                unset SAVE_CFLAGS
126
 
        done
127
 
        unset option
128
 
        if test "$enable_compile_warnings" = "error" ; then
129
 
            warning_flags="$warning_flags -Werror"
130
 
        fi
131
 
        ;;
132
 
    *)
133
 
        AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
134
 
        ;;
135
 
    esac
136
 
    CFLAGS="$realsave_CFLAGS"
137
 
    AC_MSG_CHECKING(what warning flags to pass to the C compiler)
138
 
    AC_MSG_RESULT($warning_flags)
139
 
 
140
 
    AC_ARG_ENABLE(iso-c,
141
 
                  AC_HELP_STRING([--enable-iso-c],
142
 
                                 [Try to warn if code is not ISO C ]),,
143
 
                  [enable_iso_c=no])
144
 
 
145
 
    AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
146
 
    complCFLAGS=
147
 
    if test "x$enable_iso_c" != "xno"; then
148
 
        if test "x$GCC" = "xyes"; then
149
 
        case " $CFLAGS " in
150
 
            *[\ \       ]-ansi[\ \      ]*) ;;
151
 
            *) complCFLAGS="$complCFLAGS -ansi" ;;
152
 
        esac
153
 
        case " $CFLAGS " in
154
 
            *[\ \       ]-pedantic[\ \  ]*) ;;
155
 
            *) complCFLAGS="$complCFLAGS -pedantic" ;;
156
 
        esac
157
 
        fi
158
 
    fi
159
 
    AC_MSG_RESULT($complCFLAGS)
160
 
 
161
 
    WARN_CFLAGS="$warning_flags $complCFLAGS"
162
 
    AC_SUBST(WARN_CFLAGS)
163
 
])
164
 
 
165
 
dnl For C++, do basically the same thing.
166
 
 
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])"])
172
 
 
173
 
  AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
174
 
  warnCXXFLAGS=
175
 
  if test "x$GXX" != xyes; then
176
 
    enable_cxx_warnings=no
177
 
  fi
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" ;;
183
 
      esac
184
 
 
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"
189
 
      fi
190
 
    fi
191
 
  fi
192
 
  AC_MSG_RESULT($warnCXXFLAGS)
193
 
 
194
 
   AC_ARG_ENABLE(iso-cxx,
195
 
                 AC_HELP_STRING([--enable-iso-cxx],
196
 
                                [Try to warn if code is not ISO C++ ]),,
197
 
                 [enable_iso_cxx=no])
198
 
 
199
 
   AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
200
 
   complCXXFLAGS=
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" ;;
206
 
      esac
207
 
 
208
 
      case " $CXXFLAGS " in
209
 
      *[\ \     ]-pedantic[\ \  ]*) ;;
210
 
      *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
211
 
      esac
212
 
     fi
213
 
   fi
214
 
  AC_MSG_RESULT($complCXXFLAGS)
215
 
 
216
 
  WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
217
 
  AC_SUBST(WARN_CXXFLAGS)
218
 
])
219
 
 
220
 
# nls.m4 serial 5 (gettext-0.18)
221
 
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
222
 
dnl Inc.
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.
226
 
dnl
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
230
 
dnl functionality.
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.
235
 
 
236
 
dnl Authors:
237
 
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
238
 
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
239
 
 
240
 
AC_PREREQ([2.50])
241
 
 
242
 
AC_DEFUN([AM_NLS],
243
 
[
244
 
  AC_MSG_CHECKING([whether NLS is requested])
245
 
  dnl Default is enabled NLS
246
 
  AC_ARG_ENABLE([nls],
247
 
    [  --disable-nls           do not use Native Language Support],
248
 
    USE_NLS=$enableval, USE_NLS=yes)
249
 
  AC_MSG_RESULT([$USE_NLS])
250
 
  AC_SUBST([USE_NLS])
251
 
])
252
 
 
253
 
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
254
 
# serial 1 (pkg-config-0.24)
255
 
256
 
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
257
 
#
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.
262
 
#
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.
267
 
#
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.
271
 
#
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.
276
 
 
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])
286
 
 
287
 
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
288
 
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
289
 
fi
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
294
 
                AC_MSG_RESULT([yes])
295
 
        else
296
 
                AC_MSG_RESULT([no])
297
 
                PKG_CONFIG=""
298
 
        fi
299
 
fi[]dnl
300
 
])# PKG_PROG_PKG_CONFIG
301
 
 
302
 
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
303
 
#
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.
306
 
#
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
318
 
  $3])dnl
319
 
fi])
320
 
 
321
 
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
322
 
# ---------------------------------------------
323
 
m4_define([_PKG_CONFIG],
324
 
[if test -n "$$1"; then
325
 
    pkg_cv_[]$1="$$1"
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 ],
330
 
                     [pkg_failed=yes])
331
 
 else
332
 
    pkg_failed=untried
333
 
fi[]dnl
334
 
])# _PKG_CONFIG
335
 
 
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
342
 
else
343
 
        _pkg_short_errors_supported=no
344
 
fi[]dnl
345
 
])# _PKG_SHORT_ERRORS_SUPPORTED
346
 
 
347
 
 
348
 
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
349
 
# [ACTION-IF-NOT-FOUND])
350
 
#
351
 
#
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
355
 
#
356
 
#
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
362
 
 
363
 
pkg_failed=no
364
 
AC_MSG_CHECKING([for $1])
365
 
 
366
 
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
367
 
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
368
 
 
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.])
372
 
 
373
 
if test $pkg_failed = yes; then
374
 
        AC_MSG_RESULT([no])
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`
378
 
        else 
379
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
380
 
        fi
381
 
        # Put the nasty error message in config.log where it belongs
382
 
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
383
 
 
384
 
        m4_default([$4], [AC_MSG_ERROR(
385
 
[Package requirements ($2) were not met:
386
 
 
387
 
$$1_PKG_ERRORS
388
 
 
389
 
Consider adjusting the PKG_CONFIG_PATH environment variable if you
390
 
installed software in a non-standard prefix.
391
 
 
392
 
_PKG_TEXT])[]dnl
393
 
        ])
394
 
elif test $pkg_failed = untried; then
395
 
        AC_MSG_RESULT([no])
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
399
 
path to pkg-config.
400
 
 
401
 
_PKG_TEXT
402
 
 
403
 
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
404
 
        ])
405
 
else
406
 
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
407
 
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
408
 
        AC_MSG_RESULT([yes])
409
 
        $3
410
 
fi[]dnl
411
 
])# PKG_CHECK_MODULES
412
 
 
413
22
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
414
23
#
415
24
# This file is free software; the Free Software Foundation
1459
1068
AC_SUBST([am__untar])
1460
1069
]) # _AM_PROG_TAR
1461
1070
 
 
1071
# nls.m4 serial 5 (gettext-0.18)
 
1072
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
 
1073
dnl Inc.
 
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.
 
1077
dnl
 
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
 
1081
dnl functionality.
 
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.
 
1086
 
 
1087
dnl Authors:
 
1088
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
1089
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
1090
 
 
1091
AC_PREREQ([2.50])
 
1092
 
 
1093
AC_DEFUN([AM_NLS],
 
1094
[
 
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])
 
1101
  AC_SUBST([USE_NLS])
 
1102
])
 
1103
 
 
1104
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 
1105
# serial 1 (pkg-config-0.24)
 
1106
 
1107
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
 
1108
#
 
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.
 
1113
#
 
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.
 
1118
#
 
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.
 
1122
#
 
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.
 
1127
 
 
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])
 
1136
 
 
1137
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 
1138
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
 
1139
fi
 
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])
 
1145
        else
 
1146
                AC_MSG_RESULT([no])
 
1147
                PKG_CONFIG=""
 
1148
        fi
 
1149
fi[]dnl
 
1150
])# PKG_PROG_PKG_CONFIG
 
1151
 
 
1152
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 
1153
#
 
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.
 
1156
#
 
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
 
1168
  $3])dnl
 
1169
fi])
 
1170
 
 
1171
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
 
1172
# ---------------------------------------------
 
1173
m4_define([_PKG_CONFIG],
 
1174
[if test -n "$$1"; then
 
1175
    pkg_cv_[]$1="$$1"
 
1176
 elif test -n "$PKG_CONFIG"; then
 
1177
    PKG_CHECK_EXISTS([$3],
 
1178
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
 
1179
                     [pkg_failed=yes])
 
1180
 else
 
1181
    pkg_failed=untried
 
1182
fi[]dnl
 
1183
])# _PKG_CONFIG
 
1184
 
 
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
 
1191
else
 
1192
        _pkg_short_errors_supported=no
 
1193
fi[]dnl
 
1194
])# _PKG_SHORT_ERRORS_SUPPORTED
 
1195
 
 
1196
 
 
1197
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
 
1198
# [ACTION-IF-NOT-FOUND])
 
1199
#
 
1200
#
 
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
 
1204
#
 
1205
#
 
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
 
1211
 
 
1212
pkg_failed=no
 
1213
AC_MSG_CHECKING([for $1])
 
1214
 
 
1215
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 
1216
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
 
1217
 
 
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.])
 
1221
 
 
1222
if test $pkg_failed = yes; then
 
1223
        AC_MSG_RESULT([no])
 
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`
 
1227
        else 
 
1228
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
 
1229
        fi
 
1230
        # Put the nasty error message in config.log where it belongs
 
1231
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
1232
 
 
1233
        m4_default([$4], [AC_MSG_ERROR(
 
1234
[Package requirements ($2) were not met:
 
1235
 
 
1236
$$1_PKG_ERRORS
 
1237
 
 
1238
Consider adjusting the PKG_CONFIG_PATH environment variable if you
 
1239
installed software in a non-standard prefix.
 
1240
 
 
1241
_PKG_TEXT])
 
1242
        ])
 
1243
elif test $pkg_failed = untried; then
 
1244
        AC_MSG_RESULT([no])
 
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
 
1248
path to pkg-config.
 
1249
 
 
1250
_PKG_TEXT
 
1251
 
 
1252
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
 
1253
        ])
 
1254
else
 
1255
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
 
1256
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
 
1257
        AC_MSG_RESULT([yes])
 
1258
        $3
 
1259
fi[]dnl
 
1260
])# PKG_CHECK_MODULES
 
1261
 
 
1262
# gnome-common.m4
 
1263
#
 
1264
# serial 3
 
1265
 
1266
 
 
1267
dnl GNOME_COMMON_INIT
 
1268
 
 
1269
AU_DEFUN([GNOME_COMMON_INIT],
 
1270
[
 
1271
  dnl this macro should come after AC_CONFIG_MACRO_DIR
 
1272
  AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
 
1273
 
 
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"
 
1279
  fi
 
1280
 
 
1281
  AC_SUBST([ACLOCAL_AMFLAGS])
 
1282
],
 
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]])
 
1286
 
 
1287
AC_DEFUN([GNOME_DEBUG_CHECK],
 
1288
[
 
1289
        AC_ARG_ENABLE([debug],
 
1290
                      AC_HELP_STRING([--enable-debug],
 
1291
                                     [turn on debugging]),,
 
1292
                      [enable_debug=no])
 
1293
 
 
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])
 
1297
        fi
 
1298
])
 
1299
 
 
1300
dnl GNOME_MAINTAINER_MODE_DEFINES ()
 
1301
dnl define DISABLE_DEPRECATED
 
1302
dnl
 
1303
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
 
1304
[
 
1305
        AC_REQUIRE([AM_MAINTAINER_MODE])
 
1306
 
 
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"
 
1312
                done
 
1313
        fi
 
1314
 
 
1315
        AC_SUBST(DISABLE_DEPRECATED)
 
1316
])
 
1317
 
 
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 ******************************
 
1325
 
 
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])"])
 
1330
 
 
1331
    warnCFLAGS=
 
1332
    if test "x$GCC" != xyes; then
 
1333
        enable_compile_warnings=no
 
1334
    fi
 
1335
 
 
1336
    warning_flags=
 
1337
    realsave_CFLAGS="$CFLAGS"
 
1338
 
 
1339
    case "$enable_compile_warnings" in
 
1340
    no)
 
1341
        warning_flags=
 
1342
        ;;
 
1343
    minimum)
 
1344
        warning_flags="-Wall"
 
1345
        ;;
 
1346
    yes)
 
1347
        warning_flags="-Wall -Wmissing-prototypes"
 
1348
        ;;
 
1349
    maximum|error)
 
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([], [],
 
1357
                        has_option=yes,
 
1358
                        has_option=no,)
 
1359
                CFLAGS="$SAVE_CFLAGS"
 
1360
                AC_MSG_RESULT($has_option)
 
1361
                if test $has_option = yes; then
 
1362
                  warning_flags="$warning_flags $option"
 
1363
                fi
 
1364
                unset has_option
 
1365
                unset SAVE_CFLAGS
 
1366
        done
 
1367
        unset option
 
1368
        if test "$enable_compile_warnings" = "error" ; then
 
1369
            warning_flags="$warning_flags -Werror"
 
1370
        fi
 
1371
        ;;
 
1372
    *)
 
1373
        AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
 
1374
        ;;
 
1375
    esac
 
1376
    CFLAGS="$realsave_CFLAGS"
 
1377
    AC_MSG_CHECKING(what warning flags to pass to the C compiler)
 
1378
    AC_MSG_RESULT($warning_flags)
 
1379
 
 
1380
    AC_ARG_ENABLE(iso-c,
 
1381
                  AC_HELP_STRING([--enable-iso-c],
 
1382
                                 [Try to warn if code is not ISO C ]),,
 
1383
                  [enable_iso_c=no])
 
1384
 
 
1385
    AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
 
1386
    complCFLAGS=
 
1387
    if test "x$enable_iso_c" != "xno"; then
 
1388
        if test "x$GCC" = "xyes"; then
 
1389
        case " $CFLAGS " in
 
1390
            *[\ \       ]-ansi[\ \      ]*) ;;
 
1391
            *) complCFLAGS="$complCFLAGS -ansi" ;;
 
1392
        esac
 
1393
        case " $CFLAGS " in
 
1394
            *[\ \       ]-pedantic[\ \  ]*) ;;
 
1395
            *) complCFLAGS="$complCFLAGS -pedantic" ;;
 
1396
        esac
 
1397
        fi
 
1398
    fi
 
1399
    AC_MSG_RESULT($complCFLAGS)
 
1400
 
 
1401
    WARN_CFLAGS="$warning_flags $complCFLAGS"
 
1402
    AC_SUBST(WARN_CFLAGS)
 
1403
])
 
1404
 
 
1405
dnl For C++, do basically the same thing.
 
1406
 
 
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])"])
 
1412
 
 
1413
  AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
 
1414
  warnCXXFLAGS=
 
1415
  if test "x$GXX" != xyes; then
 
1416
    enable_cxx_warnings=no
 
1417
  fi
 
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" ;;
 
1423
      esac
 
1424
 
 
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"
 
1429
      fi
 
1430
    fi
 
1431
  fi
 
1432
  AC_MSG_RESULT($warnCXXFLAGS)
 
1433
 
 
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])
 
1438
 
 
1439
   AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
 
1440
   complCXXFLAGS=
 
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" ;;
 
1446
      esac
 
1447
 
 
1448
      case " $CXXFLAGS " in
 
1449
      *[\ \     ]-pedantic[\ \  ]*) ;;
 
1450
      *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
 
1451
      esac
 
1452
     fi
 
1453
   fi
 
1454
  AC_MSG_RESULT($complCXXFLAGS)
 
1455
 
 
1456
  WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
 
1457
  AC_SUBST(WARN_CXXFLAGS)
 
1458
])
 
1459
 
1462
1460
m4_include([m4/gnome-doc-utils.m4])
1463
1461
m4_include([m4/intltool.m4])
1464
1462
m4_include([m4/libtool.m4])