~ubuntu-branches/ubuntu/oneiric/gnome-system-monitor/oneiric-proposed

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Loic Minier
  • Date: 2005-08-26 18:38:24 UTC
  • Revision ID: james.westby@ubuntu.com-20050826183824-zh2978nxikpkfxyd
Tags: upstream-2.8.1
ImportĀ upstreamĀ versionĀ 2.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl aclocal.m4 generated automatically by aclocal 1.4-p6
 
2
 
 
3
dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
 
4
dnl This file is free software; the Free Software Foundation
 
5
dnl gives unlimited permission to copy and/or distribute it,
 
6
dnl with or without modifications, as long as this notice is preserved.
 
7
 
 
8
dnl This program is distributed in the hope that it will be useful,
 
9
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
 
10
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 
11
dnl PARTICULAR PURPOSE.
 
12
 
 
13
# lib-prefix.m4 serial 3 (gettext-0.13)
 
14
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
 
15
dnl This file is free software, distributed under the terms of the GNU
 
16
dnl General Public License.  As a special exception to the GNU General
 
17
dnl Public License, this file may be distributed as part of a program
 
18
dnl that contains a configuration script generated by Autoconf, under
 
19
dnl the same distribution terms as the rest of that program.
 
20
 
 
21
dnl From Bruno Haible.
 
22
 
 
23
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
 
24
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
 
25
dnl require excessive bracketing.
 
26
ifdef([AC_HELP_STRING],
 
27
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
 
28
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
 
29
 
 
30
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
 
31
dnl to access previously installed libraries. The basic assumption is that
 
32
dnl a user will want packages to use other packages he previously installed
 
33
dnl with the same --prefix option.
 
34
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
 
35
dnl libraries, but is otherwise very convenient.
 
36
AC_DEFUN([AC_LIB_PREFIX],
 
37
[
 
38
  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
 
39
  AC_REQUIRE([AC_PROG_CC])
 
40
  AC_REQUIRE([AC_CANONICAL_HOST])
 
41
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
42
  dnl By default, look in $includedir and $libdir.
 
43
  use_additional=yes
 
44
  AC_LIB_WITH_FINAL_PREFIX([
 
45
    eval additional_includedir=\"$includedir\"
 
46
    eval additional_libdir=\"$libdir\"
 
47
  ])
 
48
  AC_LIB_ARG_WITH([lib-prefix],
 
49
[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
 
50
  --without-lib-prefix    don't search for libraries in includedir and libdir],
 
51
[
 
52
    if test "X$withval" = "Xno"; then
 
53
      use_additional=no
 
54
    else
 
55
      if test "X$withval" = "X"; then
 
56
        AC_LIB_WITH_FINAL_PREFIX([
 
57
          eval additional_includedir=\"$includedir\"
 
58
          eval additional_libdir=\"$libdir\"
 
59
        ])
 
60
      else
 
61
        additional_includedir="$withval/include"
 
62
        additional_libdir="$withval/lib"
 
63
      fi
 
64
    fi
 
65
])
 
66
  if test $use_additional = yes; then
 
67
    dnl Potentially add $additional_includedir to $CPPFLAGS.
 
68
    dnl But don't add it
 
69
    dnl   1. if it's the standard /usr/include,
 
70
    dnl   2. if it's already present in $CPPFLAGS,
 
71
    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
 
72
    dnl   4. if it doesn't exist as a directory.
 
73
    if test "X$additional_includedir" != "X/usr/include"; then
 
74
      haveit=
 
75
      for x in $CPPFLAGS; do
 
76
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
77
        if test "X$x" = "X-I$additional_includedir"; then
 
78
          haveit=yes
 
79
          break
 
80
        fi
 
81
      done
 
82
      if test -z "$haveit"; then
 
83
        if test "X$additional_includedir" = "X/usr/local/include"; then
 
84
          if test -n "$GCC"; then
 
85
            case $host_os in
 
86
              linux*) haveit=yes;;
 
87
            esac
 
88
          fi
 
89
        fi
 
90
        if test -z "$haveit"; then
 
91
          if test -d "$additional_includedir"; then
 
92
            dnl Really add $additional_includedir to $CPPFLAGS.
 
93
            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
 
94
          fi
 
95
        fi
 
96
      fi
 
97
    fi
 
98
    dnl Potentially add $additional_libdir to $LDFLAGS.
 
99
    dnl But don't add it
 
100
    dnl   1. if it's the standard /usr/lib,
 
101
    dnl   2. if it's already present in $LDFLAGS,
 
102
    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
 
103
    dnl   4. if it doesn't exist as a directory.
 
104
    if test "X$additional_libdir" != "X/usr/lib"; then
 
105
      haveit=
 
106
      for x in $LDFLAGS; do
 
107
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
108
        if test "X$x" = "X-L$additional_libdir"; then
 
109
          haveit=yes
 
110
          break
 
111
        fi
 
112
      done
 
113
      if test -z "$haveit"; then
 
114
        if test "X$additional_libdir" = "X/usr/local/lib"; then
 
115
          if test -n "$GCC"; then
 
116
            case $host_os in
 
117
              linux*) haveit=yes;;
 
118
            esac
 
119
          fi
 
120
        fi
 
121
        if test -z "$haveit"; then
 
122
          if test -d "$additional_libdir"; then
 
123
            dnl Really add $additional_libdir to $LDFLAGS.
 
124
            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
 
125
          fi
 
126
        fi
 
127
      fi
 
128
    fi
 
129
  fi
 
130
])
 
131
 
 
132
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
 
133
dnl acl_final_exec_prefix, containing the values to which $prefix and
 
134
dnl $exec_prefix will expand at the end of the configure script.
 
135
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
 
136
[
 
137
  dnl Unfortunately, prefix and exec_prefix get only finally determined
 
138
  dnl at the end of configure.
 
139
  if test "X$prefix" = "XNONE"; then
 
140
    acl_final_prefix="$ac_default_prefix"
 
141
  else
 
142
    acl_final_prefix="$prefix"
 
143
  fi
 
144
  if test "X$exec_prefix" = "XNONE"; then
 
145
    acl_final_exec_prefix='${prefix}'
 
146
  else
 
147
    acl_final_exec_prefix="$exec_prefix"
 
148
  fi
 
149
  acl_save_prefix="$prefix"
 
150
  prefix="$acl_final_prefix"
 
151
  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
 
152
  prefix="$acl_save_prefix"
 
153
])
 
154
 
 
155
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
 
156
dnl variables prefix and exec_prefix bound to the values they will have
 
157
dnl at the end of the configure script.
 
158
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
 
159
[
 
160
  acl_save_prefix="$prefix"
 
161
  prefix="$acl_final_prefix"
 
162
  acl_save_exec_prefix="$exec_prefix"
 
163
  exec_prefix="$acl_final_exec_prefix"
 
164
  $1
 
165
  exec_prefix="$acl_save_exec_prefix"
 
166
  prefix="$acl_save_prefix"
 
167
])
 
168
 
 
169
# lib-link.m4 serial 4 (gettext-0.12)
 
170
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
 
171
dnl This file is free software, distributed under the terms of the GNU
 
172
dnl General Public License.  As a special exception to the GNU General
 
173
dnl Public License, this file may be distributed as part of a program
 
174
dnl that contains a configuration script generated by Autoconf, under
 
175
dnl the same distribution terms as the rest of that program.
 
176
 
 
177
dnl From Bruno Haible.
 
178
 
 
179
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
 
180
dnl the libraries corresponding to explicit and implicit dependencies.
 
181
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
 
182
dnl augments the CPPFLAGS variable.
 
183
AC_DEFUN([AC_LIB_LINKFLAGS],
 
184
[
 
185
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
186
  AC_REQUIRE([AC_LIB_RPATH])
 
187
  define([Name],[translit([$1],[./-], [___])])
 
188
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
189
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
190
  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
 
191
    AC_LIB_LINKFLAGS_BODY([$1], [$2])
 
192
    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
 
193
    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
 
194
    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
 
195
  ])
 
196
  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
 
197
  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
 
198
  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
 
199
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
 
200
  AC_SUBST([LIB]NAME)
 
201
  AC_SUBST([LTLIB]NAME)
 
202
  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
 
203
  dnl results of this search when this library appears as a dependency.
 
204
  HAVE_LIB[]NAME=yes
 
205
  undefine([Name])
 
206
  undefine([NAME])
 
207
])
 
208
 
 
209
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
 
210
dnl searches for libname and the libraries corresponding to explicit and
 
211
dnl implicit dependencies, together with the specified include files and
 
212
dnl the ability to compile and link the specified testcode. If found, it
 
213
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
 
214
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
 
215
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
 
216
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
 
217
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
 
218
[
 
219
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
220
  AC_REQUIRE([AC_LIB_RPATH])
 
221
  define([Name],[translit([$1],[./-], [___])])
 
222
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
223
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
224
 
 
225
  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
 
226
  dnl accordingly.
 
227
  AC_LIB_LINKFLAGS_BODY([$1], [$2])
 
228
 
 
229
  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
 
230
  dnl because if the user has installed lib[]Name and not disabled its use
 
231
  dnl via --without-lib[]Name-prefix, he wants to use it.
 
232
  ac_save_CPPFLAGS="$CPPFLAGS"
 
233
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
 
234
 
 
235
  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
 
236
    ac_save_LIBS="$LIBS"
 
237
    LIBS="$LIBS $LIB[]NAME"
 
238
    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
 
239
    LIBS="$ac_save_LIBS"
 
240
  ])
 
241
  if test "$ac_cv_lib[]Name" = yes; then
 
242
    HAVE_LIB[]NAME=yes
 
243
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
 
244
    AC_MSG_CHECKING([how to link with lib[]$1])
 
245
    AC_MSG_RESULT([$LIB[]NAME])
 
246
  else
 
247
    HAVE_LIB[]NAME=no
 
248
    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
 
249
    dnl $INC[]NAME either.
 
250
    CPPFLAGS="$ac_save_CPPFLAGS"
 
251
    LIB[]NAME=
 
252
    LTLIB[]NAME=
 
253
  fi
 
254
  AC_SUBST([HAVE_LIB]NAME)
 
255
  AC_SUBST([LIB]NAME)
 
256
  AC_SUBST([LTLIB]NAME)
 
257
  undefine([Name])
 
258
  undefine([NAME])
 
259
])
 
260
 
 
261
dnl Determine the platform dependent parameters needed to use rpath:
 
262
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
 
263
dnl hardcode_direct, hardcode_minus_L.
 
264
AC_DEFUN([AC_LIB_RPATH],
 
265
[
 
266
  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
 
267
  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
 
268
  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
 
269
  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
 
270
  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
 
271
    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
 
272
    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
 
273
    . ./conftest.sh
 
274
    rm -f ./conftest.sh
 
275
    acl_cv_rpath=done
 
276
  ])
 
277
  wl="$acl_cv_wl"
 
278
  libext="$acl_cv_libext"
 
279
  shlibext="$acl_cv_shlibext"
 
280
  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
 
281
  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
 
282
  hardcode_direct="$acl_cv_hardcode_direct"
 
283
  hardcode_minus_L="$acl_cv_hardcode_minus_L"
 
284
  dnl Determine whether the user wants rpath handling at all.
 
285
  AC_ARG_ENABLE(rpath,
 
286
    [  --disable-rpath         do not hardcode runtime library paths],
 
287
    :, enable_rpath=yes)
 
288
])
 
289
 
 
290
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
 
291
dnl the libraries corresponding to explicit and implicit dependencies.
 
292
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
 
293
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
 
294
[
 
295
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
296
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
297
  dnl By default, look in $includedir and $libdir.
 
298
  use_additional=yes
 
299
  AC_LIB_WITH_FINAL_PREFIX([
 
300
    eval additional_includedir=\"$includedir\"
 
301
    eval additional_libdir=\"$libdir\"
 
302
  ])
 
303
  AC_LIB_ARG_WITH([lib$1-prefix],
 
304
[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
 
305
  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
 
306
[
 
307
    if test "X$withval" = "Xno"; then
 
308
      use_additional=no
 
309
    else
 
310
      if test "X$withval" = "X"; then
 
311
        AC_LIB_WITH_FINAL_PREFIX([
 
312
          eval additional_includedir=\"$includedir\"
 
313
          eval additional_libdir=\"$libdir\"
 
314
        ])
 
315
      else
 
316
        additional_includedir="$withval/include"
 
317
        additional_libdir="$withval/lib"
 
318
      fi
 
319
    fi
 
320
])
 
321
  dnl Search the library and its dependencies in $additional_libdir and
 
322
  dnl $LDFLAGS. Using breadth-first-seach.
 
323
  LIB[]NAME=
 
324
  LTLIB[]NAME=
 
325
  INC[]NAME=
 
326
  rpathdirs=
 
327
  ltrpathdirs=
 
328
  names_already_handled=
 
329
  names_next_round='$1 $2'
 
330
  while test -n "$names_next_round"; do
 
331
    names_this_round="$names_next_round"
 
332
    names_next_round=
 
333
    for name in $names_this_round; do
 
334
      already_handled=
 
335
      for n in $names_already_handled; do
 
336
        if test "$n" = "$name"; then
 
337
          already_handled=yes
 
338
          break
 
339
        fi
 
340
      done
 
341
      if test -z "$already_handled"; then
 
342
        names_already_handled="$names_already_handled $name"
 
343
        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
 
344
        dnl or AC_LIB_HAVE_LINKFLAGS call.
 
345
        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
 
346
        eval value=\"\$HAVE_LIB$uppername\"
 
347
        if test -n "$value"; then
 
348
          if test "$value" = yes; then
 
349
            eval value=\"\$LIB$uppername\"
 
350
            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
 
351
            eval value=\"\$LTLIB$uppername\"
 
352
            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
 
353
          else
 
354
            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
 
355
            dnl that this library doesn't exist. So just drop it.
 
356
            :
 
357
          fi
 
358
        else
 
359
          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
 
360
          dnl and the already constructed $LIBNAME/$LTLIBNAME.
 
361
          found_dir=
 
362
          found_la=
 
363
          found_so=
 
364
          found_a=
 
365
          if test $use_additional = yes; then
 
366
            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
 
367
              found_dir="$additional_libdir"
 
368
              found_so="$additional_libdir/lib$name.$shlibext"
 
369
              if test -f "$additional_libdir/lib$name.la"; then
 
370
                found_la="$additional_libdir/lib$name.la"
 
371
              fi
 
372
            else
 
373
              if test -f "$additional_libdir/lib$name.$libext"; then
 
374
                found_dir="$additional_libdir"
 
375
                found_a="$additional_libdir/lib$name.$libext"
 
376
                if test -f "$additional_libdir/lib$name.la"; then
 
377
                  found_la="$additional_libdir/lib$name.la"
 
378
                fi
 
379
              fi
 
380
            fi
 
381
          fi
 
382
          if test "X$found_dir" = "X"; then
 
383
            for x in $LDFLAGS $LTLIB[]NAME; do
 
384
              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
385
              case "$x" in
 
386
                -L*)
 
387
                  dir=`echo "X$x" | sed -e 's/^X-L//'`
 
388
                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
 
389
                    found_dir="$dir"
 
390
                    found_so="$dir/lib$name.$shlibext"
 
391
                    if test -f "$dir/lib$name.la"; then
 
392
                      found_la="$dir/lib$name.la"
 
393
                    fi
 
394
                  else
 
395
                    if test -f "$dir/lib$name.$libext"; then
 
396
                      found_dir="$dir"
 
397
                      found_a="$dir/lib$name.$libext"
 
398
                      if test -f "$dir/lib$name.la"; then
 
399
                        found_la="$dir/lib$name.la"
 
400
                      fi
 
401
                    fi
 
402
                  fi
 
403
                  ;;
 
404
              esac
 
405
              if test "X$found_dir" != "X"; then
 
406
                break
 
407
              fi
 
408
            done
 
409
          fi
 
410
          if test "X$found_dir" != "X"; then
 
411
            dnl Found the library.
 
412
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
 
413
            if test "X$found_so" != "X"; then
 
414
              dnl Linking with a shared library. We attempt to hardcode its
 
415
              dnl directory into the executable's runpath, unless it's the
 
416
              dnl standard /usr/lib.
 
417
              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
 
418
                dnl No hardcoding is needed.
 
419
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
420
              else
 
421
                dnl Use an explicit option to hardcode DIR into the resulting
 
422
                dnl binary.
 
423
                dnl Potentially add DIR to ltrpathdirs.
 
424
                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
 
425
                haveit=
 
426
                for x in $ltrpathdirs; do
 
427
                  if test "X$x" = "X$found_dir"; then
 
428
                    haveit=yes
 
429
                    break
 
430
                  fi
 
431
                done
 
432
                if test -z "$haveit"; then
 
433
                  ltrpathdirs="$ltrpathdirs $found_dir"
 
434
                fi
 
435
                dnl The hardcoding into $LIBNAME is system dependent.
 
436
                if test "$hardcode_direct" = yes; then
 
437
                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
 
438
                  dnl resulting binary.
 
439
                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
440
                else
 
441
                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
 
442
                    dnl Use an explicit option to hardcode DIR into the resulting
 
443
                    dnl binary.
 
444
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
445
                    dnl Potentially add DIR to rpathdirs.
 
446
                    dnl The rpathdirs will be appended to $LIBNAME at the end.
 
447
                    haveit=
 
448
                    for x in $rpathdirs; do
 
449
                      if test "X$x" = "X$found_dir"; then
 
450
                        haveit=yes
 
451
                        break
 
452
                      fi
 
453
                    done
 
454
                    if test -z "$haveit"; then
 
455
                      rpathdirs="$rpathdirs $found_dir"
 
456
                    fi
 
457
                  else
 
458
                    dnl Rely on "-L$found_dir".
 
459
                    dnl But don't add it if it's already contained in the LDFLAGS
 
460
                    dnl or the already constructed $LIBNAME
 
461
                    haveit=
 
462
                    for x in $LDFLAGS $LIB[]NAME; do
 
463
                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
464
                      if test "X$x" = "X-L$found_dir"; then
 
465
                        haveit=yes
 
466
                        break
 
467
                      fi
 
468
                    done
 
469
                    if test -z "$haveit"; then
 
470
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
 
471
                    fi
 
472
                    if test "$hardcode_minus_L" != no; then
 
473
                      dnl FIXME: Not sure whether we should use
 
474
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
 
475
                      dnl here.
 
476
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
477
                    else
 
478
                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
 
479
                      dnl here, because this doesn't fit in flags passed to the
 
480
                      dnl compiler. So give up. No hardcoding. This affects only
 
481
                      dnl very old systems.
 
482
                      dnl FIXME: Not sure whether we should use
 
483
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
 
484
                      dnl here.
 
485
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
 
486
                    fi
 
487
                  fi
 
488
                fi
 
489
              fi
 
490
            else
 
491
              if test "X$found_a" != "X"; then
 
492
                dnl Linking with a static library.
 
493
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
 
494
              else
 
495
                dnl We shouldn't come here, but anyway it's good to have a
 
496
                dnl fallback.
 
497
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
 
498
              fi
 
499
            fi
 
500
            dnl Assume the include files are nearby.
 
501
            additional_includedir=
 
502
            case "$found_dir" in
 
503
              */lib | */lib/)
 
504
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
 
505
                additional_includedir="$basedir/include"
 
506
                ;;
 
507
            esac
 
508
            if test "X$additional_includedir" != "X"; then
 
509
              dnl Potentially add $additional_includedir to $INCNAME.
 
510
              dnl But don't add it
 
511
              dnl   1. if it's the standard /usr/include,
 
512
              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
 
513
              dnl   3. if it's already present in $CPPFLAGS or the already
 
514
              dnl      constructed $INCNAME,
 
515
              dnl   4. if it doesn't exist as a directory.
 
516
              if test "X$additional_includedir" != "X/usr/include"; then
 
517
                haveit=
 
518
                if test "X$additional_includedir" = "X/usr/local/include"; then
 
519
                  if test -n "$GCC"; then
 
520
                    case $host_os in
 
521
                      linux*) haveit=yes;;
 
522
                    esac
 
523
                  fi
 
524
                fi
 
525
                if test -z "$haveit"; then
 
526
                  for x in $CPPFLAGS $INC[]NAME; do
 
527
                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
528
                    if test "X$x" = "X-I$additional_includedir"; then
 
529
                      haveit=yes
 
530
                      break
 
531
                    fi
 
532
                  done
 
533
                  if test -z "$haveit"; then
 
534
                    if test -d "$additional_includedir"; then
 
535
                      dnl Really add $additional_includedir to $INCNAME.
 
536
                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
 
537
                    fi
 
538
                  fi
 
539
                fi
 
540
              fi
 
541
            fi
 
542
            dnl Look for dependencies.
 
543
            if test -n "$found_la"; then
 
544
              dnl Read the .la file. It defines the variables
 
545
              dnl dlname, library_names, old_library, dependency_libs, current,
 
546
              dnl age, revision, installed, dlopen, dlpreopen, libdir.
 
547
              save_libdir="$libdir"
 
548
              case "$found_la" in
 
549
                */* | *\\*) . "$found_la" ;;
 
550
                *) . "./$found_la" ;;
 
551
              esac
 
552
              libdir="$save_libdir"
 
553
              dnl We use only dependency_libs.
 
554
              for dep in $dependency_libs; do
 
555
                case "$dep" in
 
556
                  -L*)
 
557
                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
 
558
                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
 
559
                    dnl But don't add it
 
560
                    dnl   1. if it's the standard /usr/lib,
 
561
                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
 
562
                    dnl   3. if it's already present in $LDFLAGS or the already
 
563
                    dnl      constructed $LIBNAME,
 
564
                    dnl   4. if it doesn't exist as a directory.
 
565
                    if test "X$additional_libdir" != "X/usr/lib"; then
 
566
                      haveit=
 
567
                      if test "X$additional_libdir" = "X/usr/local/lib"; then
 
568
                        if test -n "$GCC"; then
 
569
                          case $host_os in
 
570
                            linux*) haveit=yes;;
 
571
                          esac
 
572
                        fi
 
573
                      fi
 
574
                      if test -z "$haveit"; then
 
575
                        haveit=
 
576
                        for x in $LDFLAGS $LIB[]NAME; do
 
577
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
578
                          if test "X$x" = "X-L$additional_libdir"; then
 
579
                            haveit=yes
 
580
                            break
 
581
                          fi
 
582
                        done
 
583
                        if test -z "$haveit"; then
 
584
                          if test -d "$additional_libdir"; then
 
585
                            dnl Really add $additional_libdir to $LIBNAME.
 
586
                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
 
587
                          fi
 
588
                        fi
 
589
                        haveit=
 
590
                        for x in $LDFLAGS $LTLIB[]NAME; do
 
591
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
592
                          if test "X$x" = "X-L$additional_libdir"; then
 
593
                            haveit=yes
 
594
                            break
 
595
                          fi
 
596
                        done
 
597
                        if test -z "$haveit"; then
 
598
                          if test -d "$additional_libdir"; then
 
599
                            dnl Really add $additional_libdir to $LTLIBNAME.
 
600
                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
 
601
                          fi
 
602
                        fi
 
603
                      fi
 
604
                    fi
 
605
                    ;;
 
606
                  -R*)
 
607
                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
 
608
                    if test "$enable_rpath" != no; then
 
609
                      dnl Potentially add DIR to rpathdirs.
 
610
                      dnl The rpathdirs will be appended to $LIBNAME at the end.
 
611
                      haveit=
 
612
                      for x in $rpathdirs; do
 
613
                        if test "X$x" = "X$dir"; then
 
614
                          haveit=yes
 
615
                          break
 
616
                        fi
 
617
                      done
 
618
                      if test -z "$haveit"; then
 
619
                        rpathdirs="$rpathdirs $dir"
 
620
                      fi
 
621
                      dnl Potentially add DIR to ltrpathdirs.
 
622
                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
 
623
                      haveit=
 
624
                      for x in $ltrpathdirs; do
 
625
                        if test "X$x" = "X$dir"; then
 
626
                          haveit=yes
 
627
                          break
 
628
                        fi
 
629
                      done
 
630
                      if test -z "$haveit"; then
 
631
                        ltrpathdirs="$ltrpathdirs $dir"
 
632
                      fi
 
633
                    fi
 
634
                    ;;
 
635
                  -l*)
 
636
                    dnl Handle this in the next round.
 
637
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
 
638
                    ;;
 
639
                  *.la)
 
640
                    dnl Handle this in the next round. Throw away the .la's
 
641
                    dnl directory; it is already contained in a preceding -L
 
642
                    dnl option.
 
643
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
 
644
                    ;;
 
645
                  *)
 
646
                    dnl Most likely an immediate library name.
 
647
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
 
648
                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
 
649
                    ;;
 
650
                esac
 
651
              done
 
652
            fi
 
653
          else
 
654
            dnl Didn't find the library; assume it is in the system directories
 
655
            dnl known to the linker and runtime loader. (All the system
 
656
            dnl directories known to the linker should also be known to the
 
657
            dnl runtime loader, otherwise the system is severely misconfigured.)
 
658
            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
 
659
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
 
660
          fi
 
661
        fi
 
662
      fi
 
663
    done
 
664
  done
 
665
  if test "X$rpathdirs" != "X"; then
 
666
    if test -n "$hardcode_libdir_separator"; then
 
667
      dnl Weird platform: only the last -rpath option counts, the user must
 
668
      dnl pass all path elements in one option. We can arrange that for a
 
669
      dnl single library, but not when more than one $LIBNAMEs are used.
 
670
      alldirs=
 
671
      for found_dir in $rpathdirs; do
 
672
        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
 
673
      done
 
674
      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
 
675
      acl_save_libdir="$libdir"
 
676
      libdir="$alldirs"
 
677
      eval flag=\"$hardcode_libdir_flag_spec\"
 
678
      libdir="$acl_save_libdir"
 
679
      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
 
680
    else
 
681
      dnl The -rpath options are cumulative.
 
682
      for found_dir in $rpathdirs; do
 
683
        acl_save_libdir="$libdir"
 
684
        libdir="$found_dir"
 
685
        eval flag=\"$hardcode_libdir_flag_spec\"
 
686
        libdir="$acl_save_libdir"
 
687
        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
 
688
      done
 
689
    fi
 
690
  fi
 
691
  if test "X$ltrpathdirs" != "X"; then
 
692
    dnl When using libtool, the option that works for both libraries and
 
693
    dnl executables is -R. The -R options are cumulative.
 
694
    for found_dir in $ltrpathdirs; do
 
695
      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
 
696
    done
 
697
  fi
 
698
])
 
699
 
 
700
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
 
701
dnl unless already present in VAR.
 
702
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
 
703
dnl contains two or three consecutive elements that belong together.
 
704
AC_DEFUN([AC_LIB_APPENDTOVAR],
 
705
[
 
706
  for element in [$2]; do
 
707
    haveit=
 
708
    for x in $[$1]; do
 
709
      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
710
      if test "X$x" = "X$element"; then
 
711
        haveit=yes
 
712
        break
 
713
      fi
 
714
    done
 
715
    if test -z "$haveit"; then
 
716
      [$1]="${[$1]}${[$1]:+ }$element"
 
717
    fi
 
718
  done
 
719
])
 
720
 
 
721
# lib-ld.m4 serial 3 (gettext-0.13)
 
722
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
 
723
dnl This file is free software, distributed under the terms of the GNU
 
724
dnl General Public License.  As a special exception to the GNU General
 
725
dnl Public License, this file may be distributed as part of a program
 
726
dnl that contains a configuration script generated by Autoconf, under
 
727
dnl the same distribution terms as the rest of that program.
 
728
 
 
729
dnl Subroutines of libtool.m4,
 
730
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
 
731
dnl with libtool.m4.
 
732
 
 
733
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
 
734
AC_DEFUN([AC_LIB_PROG_LD_GNU],
 
735
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
 
736
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
 
737
case `$LD -v 2>&1 </dev/null` in
 
738
*GNU* | *'with BFD'*)
 
739
  acl_cv_prog_gnu_ld=yes ;;
 
740
*)
 
741
  acl_cv_prog_gnu_ld=no ;;
 
742
esac])
 
743
with_gnu_ld=$acl_cv_prog_gnu_ld
 
744
])
 
745
 
 
746
dnl From libtool-1.4. Sets the variable LD.
 
747
AC_DEFUN([AC_LIB_PROG_LD],
 
748
[AC_ARG_WITH(gnu-ld,
 
749
[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
 
750
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
 
751
AC_REQUIRE([AC_PROG_CC])dnl
 
752
AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
753
# Prepare PATH_SEPARATOR.
 
754
# The user is always right.
 
755
if test "${PATH_SEPARATOR+set}" != set; then
 
756
  echo "#! /bin/sh" >conf$$.sh
 
757
  echo  "exit 0"   >>conf$$.sh
 
758
  chmod +x conf$$.sh
 
759
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
 
760
    PATH_SEPARATOR=';'
 
761
  else
 
762
    PATH_SEPARATOR=:
 
763
  fi
 
764
  rm -f conf$$.sh
 
765
fi
 
766
ac_prog=ld
 
767
if test "$GCC" = yes; then
 
768
  # Check if gcc -print-prog-name=ld gives a path.
 
769
  AC_MSG_CHECKING([for ld used by GCC])
 
770
  case $host in
 
771
  *-*-mingw*)
 
772
    # gcc leaves a trailing carriage return which upsets mingw
 
773
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
 
774
  *)
 
775
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
 
776
  esac
 
777
  case $ac_prog in
 
778
    # Accept absolute paths.
 
779
    [[\\/]* | [A-Za-z]:[\\/]*)]
 
780
      [re_direlt='/[^/][^/]*/\.\./']
 
781
      # Canonicalize the path of ld
 
782
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
 
783
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
 
784
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
 
785
      done
 
786
      test -z "$LD" && LD="$ac_prog"
 
787
      ;;
 
788
  "")
 
789
    # If it fails, then pretend we aren't using GCC.
 
790
    ac_prog=ld
 
791
    ;;
 
792
  *)
 
793
    # If it is relative, then search for the first ld in PATH.
 
794
    with_gnu_ld=unknown
 
795
    ;;
 
796
  esac
 
797
elif test "$with_gnu_ld" = yes; then
 
798
  AC_MSG_CHECKING([for GNU ld])
 
799
else
 
800
  AC_MSG_CHECKING([for non-GNU ld])
 
801
fi
 
802
AC_CACHE_VAL(acl_cv_path_LD,
 
803
[if test -z "$LD"; then
 
804
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
 
805
  for ac_dir in $PATH; do
 
806
    test -z "$ac_dir" && ac_dir=.
 
807
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
 
808
      acl_cv_path_LD="$ac_dir/$ac_prog"
 
809
      # Check to see if the program is GNU ld.  I'd rather use --version,
 
810
      # but apparently some GNU ld's only accept -v.
 
811
      # Break only if it was the GNU/non-GNU ld that we prefer.
 
812
      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
 
813
      *GNU* | *'with BFD'*)
 
814
        test "$with_gnu_ld" != no && break ;;
 
815
      *)
 
816
        test "$with_gnu_ld" != yes && break ;;
 
817
      esac
 
818
    fi
 
819
  done
 
820
  IFS="$ac_save_ifs"
 
821
else
 
822
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
 
823
fi])
 
824
LD="$acl_cv_path_LD"
 
825
if test -n "$LD"; then
 
826
  AC_MSG_RESULT($LD)
 
827
else
 
828
  AC_MSG_RESULT(no)
 
829
fi
 
830
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 
831
AC_LIB_PROG_LD_GNU
 
832
])
 
833
 
 
834
# Do all the work for Automake.  This macro actually does too much --
 
835
# some checks are only needed if your package does certain things.
 
836
# But this isn't really a big deal.
 
837
 
 
838
# serial 1
 
839
 
 
840
dnl Usage:
 
841
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
 
842
 
 
843
AC_DEFUN([AM_INIT_AUTOMAKE],
 
844
[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
 
845
AC_REQUIRE([AC_PROG_INSTALL])
 
846
PACKAGE=[$1]
 
847
AC_SUBST(PACKAGE)
 
848
VERSION=[$2]
 
849
AC_SUBST(VERSION)
 
850
dnl test to see if srcdir already configured
 
851
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
 
852
  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
 
853
fi
 
854
ifelse([$3],,
 
855
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
 
856
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
 
857
AC_REQUIRE([AM_SANITY_CHECK])
 
858
AC_REQUIRE([AC_ARG_PROGRAM])
 
859
dnl FIXME This is truly gross.
 
860
missing_dir=`cd $ac_aux_dir && pwd`
 
861
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
 
862
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
 
863
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
 
864
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
 
865
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
 
866
AC_REQUIRE([AC_PROG_MAKE_SET])])
 
867
 
 
868
# Copyright 2002  Free Software Foundation, Inc.
 
869
 
 
870
# This program is free software; you can redistribute it and/or modify
 
871
# it under the terms of the GNU General Public License as published by
 
872
# the Free Software Foundation; either version 2, or (at your option)
 
873
# any later version.
 
874
 
 
875
# This program is distributed in the hope that it will be useful,
 
876
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
877
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
878
# GNU General Public License for more details.
 
879
 
 
880
# You should have received a copy of the GNU General Public License
 
881
# along with this program; if not, write to the Free Software
 
882
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
883
 
 
884
# AM_AUTOMAKE_VERSION(VERSION)
 
885
# ----------------------------
 
886
# Automake X.Y traces this macro to ensure aclocal.m4 has been
 
887
# generated from the m4 files accompanying Automake X.Y.
 
888
AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
 
889
 
 
890
# AM_SET_CURRENT_AUTOMAKE_VERSION
 
891
# -------------------------------
 
892
# Call AM_AUTOMAKE_VERSION so it can be traced.
 
893
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
 
894
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
 
895
         [AM_AUTOMAKE_VERSION([1.4-p6])])
 
896
 
 
897
#
 
898
# Check to make sure that the build environment is sane.
 
899
#
 
900
 
 
901
AC_DEFUN([AM_SANITY_CHECK],
 
902
[AC_MSG_CHECKING([whether build environment is sane])
 
903
# Just in case
 
904
sleep 1
 
905
echo timestamp > conftestfile
 
906
# Do `set' in a subshell so we don't clobber the current shell's
 
907
# arguments.  Must try -L first in case configure is actually a
 
908
# symlink; some systems play weird games with the mod time of symlinks
 
909
# (eg FreeBSD returns the mod time of the symlink's containing
 
910
# directory).
 
911
if (
 
912
   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
 
913
   if test "[$]*" = "X"; then
 
914
      # -L didn't work.
 
915
      set X `ls -t $srcdir/configure conftestfile`
 
916
   fi
 
917
   if test "[$]*" != "X $srcdir/configure conftestfile" \
 
918
      && test "[$]*" != "X conftestfile $srcdir/configure"; then
 
919
 
 
920
      # If neither matched, then we have a broken ls.  This can happen
 
921
      # if, for instance, CONFIG_SHELL is bash and it inherits a
 
922
      # broken ls alias from the environment.  This has actually
 
923
      # happened.  Such a system could not be considered "sane".
 
924
      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
 
925
alias in your environment])
 
926
   fi
 
927
 
 
928
   test "[$]2" = conftestfile
 
929
   )
 
930
then
 
931
   # Ok.
 
932
   :
 
933
else
 
934
   AC_MSG_ERROR([newly created file is older than distributed files!
 
935
Check your system clock])
 
936
fi
 
937
rm -f conftest*
 
938
AC_MSG_RESULT(yes)])
 
939
 
 
940
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
 
941
dnl The program must properly implement --version.
 
942
AC_DEFUN([AM_MISSING_PROG],
 
943
[AC_MSG_CHECKING(for working $2)
 
944
# Run test in a subshell; some versions of sh will print an error if
 
945
# an executable is not found, even if stderr is redirected.
 
946
# Redirect stdin to placate older versions of autoconf.  Sigh.
 
947
if ($2 --version) < /dev/null > /dev/null 2>&1; then
 
948
   $1=$2
 
949
   AC_MSG_RESULT(found)
 
950
else
 
951
   $1="$3/missing $2"
 
952
   AC_MSG_RESULT(missing)
 
953
fi
 
954
AC_SUBST($1)])
 
955
 
 
956
# Like AC_CONFIG_HEADER, but automatically create stamp file.
 
957
 
 
958
AC_DEFUN([AM_CONFIG_HEADER],
 
959
[AC_PREREQ([2.12])
 
960
AC_CONFIG_HEADER([$1])
 
961
dnl When config.status generates a header, we must update the stamp-h file.
 
962
dnl This file resides in the same directory as the config header
 
963
dnl that is generated.  We must strip everything past the first ":",
 
964
dnl and everything past the last "/".
 
965
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
 
966
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
 
967
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
 
968
<<am_indx=1
 
969
for am_file in <<$1>>; do
 
970
  case " <<$>>CONFIG_HEADERS " in
 
971
  *" <<$>>am_file "*<<)>>
 
972
    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
 
973
    ;;
 
974
  esac
 
975
  am_indx=`expr "<<$>>am_indx" + 1`
 
976
done<<>>dnl>>)
 
977
changequote([,]))])
 
978
 
 
979
 
 
980
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
 
981
# serial 1 IT_PROG_INTLTOOL
 
982
AC_DEFUN([IT_PROG_INTLTOOL],
 
983
[
 
984
 
 
985
if test -n "$1"; then
 
986
    AC_MSG_CHECKING(for intltool >= $1)
 
987
 
 
988
    INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ printf "%d", $[1] * 100 + $[2]; }'`
 
989
    INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { printf $[2]; }'  < ${ac_aux_dir}/intltool-update.in`
 
990
    changequote({{,}})
 
991
    INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split(${{2}}, VERSION, "."); printf "%d\n", VERSION[1] * 100 + VERSION[2];}' < ${ac_aux_dir}/intltool-update.in`
 
992
    changequote([,])
 
993
 
 
994
    if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT"; then
 
995
        AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
 
996
    else
 
997
        AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found. Your intltool is too old.  You need intltool $1 or later.])
 
998
        exit 1
 
999
    fi
 
1000
fi
 
1001
 
 
1002
  INTLTOOL_DESKTOP_RULE='%.desktop:   %.desktop.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
1003
INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
1004
     INTLTOOL_KEYS_RULE='%.keys:      %.keys.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
1005
     INTLTOOL_PROP_RULE='%.prop:      %.prop.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
1006
      INTLTOOL_OAF_RULE='%.oaf:       %.oaf.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
 
1007
     INTLTOOL_PONG_RULE='%.pong:      %.pong.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
1008
   INTLTOOL_SERVER_RULE='%.server:    %.server.in    $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
1009
    INTLTOOL_SHEET_RULE='%.sheet:     %.sheet.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
1010
INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
1011
       INTLTOOL_UI_RULE='%.ui:        %.ui.in        $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
1012
      INTLTOOL_XML_RULE='%.xml:       %.xml.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
1013
      INTLTOOL_XML_NOMERGE_RULE='%.xml:       %.xml.in       $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@' 
 
1014
      INTLTOOL_XAM_RULE='%.xam:       %.xml.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
1015
      INTLTOOL_KBD_RULE='%.kbd:       %.kbd.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
1016
    INTLTOOL_CAVES_RULE='%.caves:     %.caves.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
1017
  INTLTOOL_SCHEMAS_RULE='%.schemas:   %.schemas.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
1018
    INTLTOOL_THEME_RULE='%.theme:     %.theme.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
1019
 
 
1020
AC_SUBST(INTLTOOL_DESKTOP_RULE)
 
1021
AC_SUBST(INTLTOOL_DIRECTORY_RULE)
 
1022
AC_SUBST(INTLTOOL_KEYS_RULE)
 
1023
AC_SUBST(INTLTOOL_PROP_RULE)
 
1024
AC_SUBST(INTLTOOL_OAF_RULE)
 
1025
AC_SUBST(INTLTOOL_PONG_RULE)
 
1026
AC_SUBST(INTLTOOL_SERVER_RULE)
 
1027
AC_SUBST(INTLTOOL_SHEET_RULE)
 
1028
AC_SUBST(INTLTOOL_SOUNDLIST_RULE)
 
1029
AC_SUBST(INTLTOOL_UI_RULE)
 
1030
AC_SUBST(INTLTOOL_XAM_RULE)
 
1031
AC_SUBST(INTLTOOL_KBD_RULE)
 
1032
AC_SUBST(INTLTOOL_XML_RULE)
 
1033
AC_SUBST(INTLTOOL_XML_NOMERGE_RULE)
 
1034
AC_SUBST(INTLTOOL_CAVES_RULE)
 
1035
AC_SUBST(INTLTOOL_SCHEMAS_RULE)
 
1036
AC_SUBST(INTLTOOL_THEME_RULE)
 
1037
 
 
1038
# Use the tools built into the package, not the ones that are installed.
 
1039
 
 
1040
INTLTOOL_EXTRACT='$(top_builddir)/intltool-extract'
 
1041
INTLTOOL_MERGE='$(top_builddir)/intltool-merge'
 
1042
INTLTOOL_UPDATE='$(top_builddir)/intltool-update'
 
1043
 
 
1044
AC_SUBST(INTLTOOL_EXTRACT)
 
1045
AC_SUBST(INTLTOOL_MERGE)
 
1046
AC_SUBST(INTLTOOL_UPDATE)
 
1047
 
 
1048
AC_PATH_PROG(INTLTOOL_PERL, perl)
 
1049
if test -z "$INTLTOOL_PERL"; then
 
1050
   AC_MSG_ERROR([perl not found; required for intltool])
 
1051
fi
 
1052
if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
 
1053
   AC_MSG_ERROR([perl 5.x required for intltool])
 
1054
fi
 
1055
if test "x$2" != "xno-xml"; then
 
1056
   AC_MSG_CHECKING([for XML::Parser])
 
1057
   if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
 
1058
       AC_MSG_RESULT([ok])
 
1059
   else
 
1060
       AC_MSG_ERROR([XML::Parser perl module is required for intltool])
 
1061
   fi
 
1062
fi
 
1063
 
 
1064
AC_PATH_PROG(ICONV, iconv, iconv)
 
1065
AC_PATH_PROG(MSGFMT, msgfmt, msgfmt)
 
1066
AC_PATH_PROG(MSGMERGE, msgmerge, msgmerge)
 
1067
AC_PATH_PROG(XGETTEXT, xgettext, xgettext)
 
1068
 
 
1069
# Remove file type tags (using []) from po/POTFILES.
 
1070
 
 
1071
ifdef([AC_DIVERSION_ICMDS],[
 
1072
  AC_DIVERT_PUSH(AC_DIVERSION_ICMDS)
 
1073
      changequote(,)
 
1074
      mv -f po/POTFILES po/POTFILES.tmp
 
1075
      sed -e '/\[encoding.*\]/d' -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
 
1076
      rm -f po/POTFILES.tmp
 
1077
      changequote([,])
 
1078
  AC_DIVERT_POP()
 
1079
],[
 
1080
  ifdef([AC_CONFIG_COMMANDS_PRE],[
 
1081
    AC_CONFIG_COMMANDS_PRE([
 
1082
        changequote(,)
 
1083
        mv -f po/POTFILES po/POTFILES.tmp
 
1084
        sed -e '/\[encoding.*\]/d' -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
 
1085
        rm -f po/POTFILES.tmp
 
1086
        changequote([,])
 
1087
    ])
 
1088
  ])
 
1089
 
 
1090
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
 
1091
  # Keeping the `.' argument allows $(mkdir_p) to be used without
 
1092
  # argument.  Indeed, we sometimes output rules like
 
1093
  #   $(mkdir_p) $(somedir)
 
1094
  # where $(somedir) is conditionally defined.
 
1095
  # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more
 
1096
  # expensive solution, as it forces Make to start a sub-shell.)
 
1097
  mkdir_p='mkdir -p -- .'
 
1098
else
 
1099
  # On NextStep and OpenStep, the `mkdir' command does not
 
1100
  # recognize any option.  It will interpret all options as
 
1101
  # directories to create, and then abort because `.' already
 
1102
  # exists.
 
1103
  for d in ./-p ./--version;
 
1104
  do
 
1105
    test -d $d && rmdir $d
 
1106
  done
 
1107
  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
 
1108
  if test -f "$ac_aux_dir/mkinstalldirs"; then
 
1109
    mkdir_p='$(mkinstalldirs)'
 
1110
  else
 
1111
    mkdir_p='$(install_sh) -d'
 
1112
  fi
 
1113
fi
 
1114
AC_SUBST([mkdir_p])
 
1115
])
 
1116
 
 
1117
# Manually sed perl in so people don't have to put the intltool scripts in AC_OUTPUT.
 
1118
 
 
1119
AC_CONFIG_COMMANDS([intltool], [
 
1120
 
 
1121
intltool_edit="-e 's:@INTLTOOL_EXTRACT@:`pwd`/intltool-extract:g' \
 
1122
               -e 's:@INTLTOOL_ICONV@:${ICONV}:g' \
 
1123
               -e 's:@INTLTOOL_MSGFMT@:${MSGFMT}:g' \
 
1124
               -e 's:@INTLTOOL_MSGMERGE@:${MSGMERGE}:g' \
 
1125
               -e 's:@INTLTOOL_XGETTEXT@:${XGETTEXT}:g' \
 
1126
               -e 's:@INTLTOOL_PERL@:${INTLTOOL_PERL}:g'"
 
1127
 
 
1128
eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-extract.in \
 
1129
  > intltool-extract.out
 
1130
if cmp -s intltool-extract intltool-extract.out 2>/dev/null; then
 
1131
  rm -f intltool-extract.out
 
1132
else
 
1133
  mv -f intltool-extract.out intltool-extract
 
1134
fi
 
1135
chmod ugo+x intltool-extract
 
1136
chmod u+w intltool-extract
 
1137
 
 
1138
eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-merge.in \
 
1139
  > intltool-merge.out
 
1140
if cmp -s intltool-merge intltool-merge.out 2>/dev/null; then
 
1141
  rm -f intltool-merge.out
 
1142
else
 
1143
  mv -f intltool-merge.out intltool-merge
 
1144
fi
 
1145
chmod ugo+x intltool-merge
 
1146
chmod u+w intltool-merge
 
1147
 
 
1148
eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-update.in \
 
1149
  > intltool-update.out
 
1150
if cmp -s intltool-update intltool-update.out 2>/dev/null; then
 
1151
  rm -f intltool-update.out
 
1152
else
 
1153
  mv -f intltool-update.out intltool-update
 
1154
fi
 
1155
chmod ugo+x intltool-update
 
1156
chmod u+w intltool-update
 
1157
 
 
1158
], INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir=${ac_aux_dir}
 
1159
INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' ICONV='${ICONV}'
 
1160
MSGFMT='${MSGFMT}' MSGMERGE='${MSGMERGE}' XGETTEXT='${XGETTEXT}')
 
1161
 
 
1162
])
 
1163
 
 
1164
# deprecated macros
 
1165
AC_DEFUN([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL($@)])
 
1166
 
 
1167
 
 
1168
# isc-posix.m4 serial 2 (gettext-0.11.2)
 
1169
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
 
1170
dnl This file is free software, distributed under the terms of the GNU
 
1171
dnl General Public License.  As a special exception to the GNU General
 
1172
dnl Public License, this file may be distributed as part of a program
 
1173
dnl that contains a configuration script generated by Autoconf, under
 
1174
dnl the same distribution terms as the rest of that program.
 
1175
 
 
1176
# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
 
1177
 
 
1178
# This test replaces the one in autoconf.
 
1179
# Currently this macro should have the same name as the autoconf macro
 
1180
# because gettext's gettext.m4 (distributed in the automake package)
 
1181
# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
 
1182
# give these diagnostics:
 
1183
#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
 
1184
#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
 
1185
 
 
1186
undefine([AC_ISC_POSIX])
 
1187
 
 
1188
AC_DEFUN([AC_ISC_POSIX],
 
1189
  [
 
1190
    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
 
1191
    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
 
1192
  ]
 
1193
)
 
1194
 
 
1195
 
 
1196
# serial 1
 
1197
 
 
1198
# @defmac AC_PROG_CC_STDC
 
1199
# @maindex PROG_CC_STDC
 
1200
# @ovindex CC
 
1201
# If the C compiler in not in ANSI C mode by default, try to add an option
 
1202
# to output variable @code{CC} to make it so.  This macro tries various
 
1203
# options that select ANSI C on some system or another.  It considers the
 
1204
# compiler to be in ANSI C mode if it handles function prototypes correctly.
 
1205
#
 
1206
# If you use this macro, you should check after calling it whether the C
 
1207
# compiler has been set to accept ANSI C; if not, the shell variable
 
1208
# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
 
1209
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
 
1210
# program @code{ansi2knr}, which comes with Ghostscript.
 
1211
# @end defmac
 
1212
 
 
1213
AC_DEFUN([AM_PROG_CC_STDC],
 
1214
[AC_REQUIRE([AC_PROG_CC])
 
1215
AC_BEFORE([$0], [AC_C_INLINE])
 
1216
AC_BEFORE([$0], [AC_C_CONST])
 
1217
dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
 
1218
dnl a magic option to avoid problems with ANSI preprocessor commands
 
1219
dnl like #elif.
 
1220
dnl FIXME: can't do this because then AC_AIX won't work due to a
 
1221
dnl circular dependency.
 
1222
dnl AC_BEFORE([$0], [AC_PROG_CPP])
 
1223
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
 
1224
AC_CACHE_VAL(am_cv_prog_cc_stdc,
 
1225
[am_cv_prog_cc_stdc=no
 
1226
ac_save_CC="$CC"
 
1227
# Don't try gcc -ansi; that turns off useful extensions and
 
1228
# breaks some systems' header files.
 
1229
# AIX                   -qlanglvl=ansi
 
1230
# Ultrix and OSF/1      -std1
 
1231
# HP-UX                 -Aa -D_HPUX_SOURCE
 
1232
# SVR4                  -Xc -D__EXTENSIONS__
 
1233
for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 
1234
do
 
1235
  CC="$ac_save_CC $ac_arg"
 
1236
  AC_TRY_COMPILE(
 
1237
[#include <stdarg.h>
 
1238
#include <stdio.h>
 
1239
#include <sys/types.h>
 
1240
#include <sys/stat.h>
 
1241
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 
1242
struct buf { int x; };
 
1243
FILE * (*rcsopen) (struct buf *, struct stat *, int);
 
1244
static char *e (p, i)
 
1245
     char **p;
 
1246
     int i;
 
1247
{
 
1248
  return p[i];
 
1249
}
 
1250
static char *f (char * (*g) (char **, int), char **p, ...)
 
1251
{
 
1252
  char *s;
 
1253
  va_list v;
 
1254
  va_start (v,p);
 
1255
  s = g (p, va_arg (v,int));
 
1256
  va_end (v);
 
1257
  return s;
 
1258
}
 
1259
int test (int i, double x);
 
1260
struct s1 {int (*f) (int a);};
 
1261
struct s2 {int (*f) (double a);};
 
1262
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
 
1263
int argc;
 
1264
char **argv;
 
1265
], [
 
1266
return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
 
1267
],
 
1268
[am_cv_prog_cc_stdc="$ac_arg"; break])
 
1269
done
 
1270
CC="$ac_save_CC"
 
1271
])
 
1272
if test -z "$am_cv_prog_cc_stdc"; then
 
1273
  AC_MSG_RESULT([none needed])
 
1274
else
 
1275
  AC_MSG_RESULT($am_cv_prog_cc_stdc)
 
1276
fi
 
1277
case "x$am_cv_prog_cc_stdc" in
 
1278
  x|xno) ;;
 
1279
  *) CC="$CC $am_cv_prog_cc_stdc" ;;
 
1280
esac
 
1281
])
 
1282
 
 
1283
dnl GNOME_COMPILE_WARNINGS
 
1284
dnl Turn on many useful compiler warnings
 
1285
dnl For now, only works on GCC
 
1286
AC_DEFUN([GNOME_COMPILE_WARNINGS],[
 
1287
    dnl ******************************
 
1288
    dnl More compiler warnings
 
1289
    dnl ******************************
 
1290
 
 
1291
    AC_ARG_ENABLE(compile-warnings, 
 
1292
                  AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
 
1293
                                 [Turn on compiler warnings]),,
 
1294
                  [enable_compile_warnings="m4_default([$1],[yes])"])
 
1295
 
 
1296
    warnCFLAGS=
 
1297
    if test "x$GCC" != xyes; then
 
1298
        enable_compile_warnings=no
 
1299
    fi
 
1300
 
 
1301
    warning_flags=
 
1302
    realsave_CFLAGS="$CFLAGS"
 
1303
 
 
1304
    case "$enable_compile_warnings" in
 
1305
    no)
 
1306
        warning_flags=
 
1307
        ;;
 
1308
    minimum)
 
1309
        warning_flags="-Wall"
 
1310
        ;;
 
1311
    yes)
 
1312
        warning_flags="-Wall -Wmissing-prototypes"
 
1313
        ;;
 
1314
    maximum|error)
 
1315
        warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
 
1316
        CFLAGS="$warning_flags $CFLAGS"
 
1317
        for option in -Wno-sign-compare; do
 
1318
                SAVE_CFLAGS="$CFLAGS"
 
1319
                CFLAGS="$CFLAGS $option"
 
1320
                AC_MSG_CHECKING([whether gcc understands $option])
 
1321
                AC_TRY_COMPILE([], [],
 
1322
                        has_option=yes,
 
1323
                        has_option=no,)
 
1324
                CFLAGS="$SAVE_CFLAGS"
 
1325
                AC_MSG_RESULT($has_option)
 
1326
                if test $has_option = yes; then
 
1327
                  warning_flags="$warning_flags $option"
 
1328
                fi
 
1329
                unset has_option
 
1330
                unset SAVE_CFLAGS
 
1331
        done
 
1332
        unset option
 
1333
        if test "$enable_compile_warnings" = "error" ; then
 
1334
            warning_flags="$warning_flags -Werror"
 
1335
        fi
 
1336
        ;;
 
1337
    *)
 
1338
        AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
 
1339
        ;;
 
1340
    esac
 
1341
    CFLAGS="$realsave_CFLAGS"
 
1342
    AC_MSG_CHECKING(what warning flags to pass to the C compiler)
 
1343
    AC_MSG_RESULT($warning_flags)
 
1344
 
 
1345
    AC_ARG_ENABLE(iso-c,
 
1346
                  AC_HELP_STRING([--enable-iso-c],
 
1347
                                 [Try to warn if code is not ISO C ]),,
 
1348
                  [enable_iso_c=no])
 
1349
 
 
1350
    AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
 
1351
    complCFLAGS=
 
1352
    if test "x$enable_iso_c" != "xno"; then
 
1353
        if test "x$GCC" = "xyes"; then
 
1354
        case " $CFLAGS " in
 
1355
            *[\ \       ]-ansi[\ \      ]*) ;;
 
1356
            *) complCFLAGS="$complCFLAGS -ansi" ;;
 
1357
        esac
 
1358
        case " $CFLAGS " in
 
1359
            *[\ \       ]-pedantic[\ \  ]*) ;;
 
1360
            *) complCFLAGS="$complCFLAGS -pedantic" ;;
 
1361
        esac
 
1362
        fi
 
1363
    fi
 
1364
    AC_MSG_RESULT($complCFLAGS)
 
1365
 
 
1366
    WARN_CFLAGS="$warning_flags $complCFLAGS"
 
1367
    AC_SUBST(WARN_CFLAGS)
 
1368
])
 
1369
 
 
1370
dnl For C++, do basically the same thing.
 
1371
 
 
1372
AC_DEFUN([GNOME_CXX_WARNINGS],[
 
1373
  AC_ARG_ENABLE(cxx-warnings,
 
1374
                AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
 
1375
                               [Turn on compiler warnings.]),,
 
1376
                [enable_cxx_warnings="m4_default([$1],[minimum])"])
 
1377
 
 
1378
  AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
 
1379
  warnCXXFLAGS=
 
1380
  if test "x$GCC" != xyes; then
 
1381
    enable_compile_warnings=no
 
1382
  fi
 
1383
  if test "x$enable_cxx_warnings" != "xno"; then
 
1384
    if test "x$GCC" = "xyes"; then
 
1385
      case " $CXXFLAGS " in
 
1386
      *[\ \     ]-Wall[\ \      ]*) ;;
 
1387
      *) warnCXXFLAGS="-Wall -Wno-unused" ;;
 
1388
      esac
 
1389
 
 
1390
      ## -W is not all that useful.  And it cannot be controlled
 
1391
      ## with individual -Wno-xxx flags, unlike -Wall
 
1392
      if test "x$enable_cxx_warnings" = "xyes"; then
 
1393
        warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
 
1394
      fi
 
1395
    fi
 
1396
  fi
 
1397
  AC_MSG_RESULT($warnCXXFLAGS)
 
1398
 
 
1399
   AC_ARG_ENABLE(iso-cxx,
 
1400
                 AC_HELP_STRING([--enable-iso-cxx],
 
1401
                                [Try to warn if code is not ISO C++ ]),,
 
1402
                 [enable_iso_cxx=no])
 
1403
 
 
1404
   AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
 
1405
   complCXXFLAGS=
 
1406
   if test "x$enable_iso_cxx" != "xno"; then
 
1407
     if test "x$GCC" = "xyes"; then
 
1408
      case " $CXXFLAGS " in
 
1409
      *[\ \     ]-ansi[\ \      ]*) ;;
 
1410
      *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
 
1411
      esac
 
1412
 
 
1413
      case " $CXXFLAGS " in
 
1414
      *[\ \     ]-pedantic[\ \  ]*) ;;
 
1415
      *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
 
1416
      esac
 
1417
     fi
 
1418
   fi
 
1419
  AC_MSG_RESULT($complCXXFLAGS)
 
1420
 
 
1421
  WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
 
1422
  AC_SUBST(WARN_CXXFLAGS)
 
1423
])
 
1424
 
 
1425
 
 
1426
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
 
1427
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
 
1428
dnl also defines GSTUFF_PKG_ERRORS on error
 
1429
AC_DEFUN(PKG_CHECK_MODULES, [
 
1430
  succeeded=no
 
1431
 
 
1432
  if test -z "$PKG_CONFIG"; then
 
1433
    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 
1434
  fi
 
1435
 
 
1436
  if test "$PKG_CONFIG" = "no" ; then
 
1437
     echo "*** The pkg-config script could not be found. Make sure it is"
 
1438
     echo "*** in your path, or set the PKG_CONFIG environment variable"
 
1439
     echo "*** to the full path to pkg-config."
 
1440
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
 
1441
  else
 
1442
     PKG_CONFIG_MIN_VERSION=0.9.0
 
1443
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
 
1444
        AC_MSG_CHECKING(for $2)
 
1445
 
 
1446
        if $PKG_CONFIG --exists "$2" ; then
 
1447
            AC_MSG_RESULT(yes)
 
1448
            succeeded=yes
 
1449
 
 
1450
            AC_MSG_CHECKING($1_CFLAGS)
 
1451
            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
 
1452
            AC_MSG_RESULT($$1_CFLAGS)
 
1453
 
 
1454
            AC_MSG_CHECKING($1_LIBS)
 
1455
            $1_LIBS=`$PKG_CONFIG --libs "$2"`
 
1456
            AC_MSG_RESULT($$1_LIBS)
 
1457
        else
 
1458
            $1_CFLAGS=""
 
1459
            $1_LIBS=""
 
1460
            ## If we have a custom action on failure, don't print errors, but 
 
1461
            ## do set a variable so people can do so.
 
1462
            $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
 
1463
            ifelse([$4], ,echo $$1_PKG_ERRORS,)
 
1464
        fi
 
1465
 
 
1466
        AC_SUBST($1_CFLAGS)
 
1467
        AC_SUBST($1_LIBS)
 
1468
     else
 
1469
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
 
1470
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
 
1471
     fi
 
1472
  fi
 
1473
 
 
1474
  if test $succeeded = yes; then
 
1475
     ifelse([$3], , :, [$3])
 
1476
  else
 
1477
     ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
 
1478
  fi
 
1479
])
 
1480
 
 
1481
 
 
1482
 
 
1483
dnl AM_GCONF_SOURCE_2
 
1484
dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
 
1485
dnl  (i.e. pass to gconftool-2
 
1486
dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
 
1487
dnl  you should install foo.schemas files
 
1488
dnl
 
1489
 
 
1490
AC_DEFUN([AM_GCONF_SOURCE_2],
 
1491
[
 
1492
  if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
 
1493
    GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
 
1494
  else
 
1495
    GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
 
1496
  fi
 
1497
 
 
1498
  AC_ARG_WITH(gconf-source, 
 
1499
  [  --with-gconf-source=sourceaddress      Config database for installing schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",)
 
1500
 
 
1501
  AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
 
1502
  AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
 
1503
 
 
1504
  if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
 
1505
    GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
 
1506
  fi
 
1507
 
 
1508
  AC_ARG_WITH(gconf-schema-file-dir, 
 
1509
  [  --with-gconf-schema-file-dir=dir        Directory for installing schema files.],GCONF_SCHEMA_FILE_DIR="$withval",)
 
1510
 
 
1511
  AC_SUBST(GCONF_SCHEMA_FILE_DIR)
 
1512
  AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
 
1513
 
 
1514
  AC_ARG_ENABLE(schemas-install,
 
1515
     [  --disable-schemas-install       Disable the schemas installation],
 
1516
     [case "${enableval}" in
 
1517
       yes) schemas_install=true ;;
 
1518
       no)  schemas_install=false ;;
 
1519
       *) AC_MSG_ERROR(bad value ${enableval} for --disable-schemas-install) ;;
 
1520
     esac],[schemas_install=true])
 
1521
     AM_CONDITIONAL(GCONF_SCHEMAS_INSTALL, test x$schemas_install = xtrue)
 
1522
])
 
1523
 
 
1524
# Define a conditional.
 
1525
 
 
1526
AC_DEFUN([AM_CONDITIONAL],
 
1527
[AC_SUBST($1_TRUE)
 
1528
AC_SUBST($1_FALSE)
 
1529
if $2; then
 
1530
  $1_TRUE=
 
1531
  $1_FALSE='#'
 
1532
else
 
1533
  $1_TRUE='#'
 
1534
  $1_FALSE=
 
1535
fi])
 
1536
 
 
1537
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
 
1538
# Copyright (C) 2001-2003 Red Hat, Inc.
 
1539
#
 
1540
# This file is free software, distributed under the terms of the GNU
 
1541
# General Public License.  As a special exception to the GNU General
 
1542
# Public License, this file may be distributed as part of a program
 
1543
# that contains a configuration script generated by Autoconf, under
 
1544
# the same distribution terms as the rest of that program.
 
1545
#
 
1546
# This file can be copied and used freely without restrictions.  It can
 
1547
# be used in projects which are not available under the GNU Public License
 
1548
# but which still want to provide support for the GNU gettext functionality.
 
1549
#
 
1550
# Macro to add for using GNU gettext.
 
1551
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
 
1552
#
 
1553
# Modified to never use included libintl. 
 
1554
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
 
1555
#
 
1556
# Major rework to remove unused code
 
1557
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
 
1558
#
 
1559
# Added better handling of ALL_LINGUAS from GNU gettext version 
 
1560
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
 
1561
 
 
1562
#
 
1563
# We need this here as well, since someone might use autoconf-2.5x
 
1564
# to configure GLib then an older version to configure a package
 
1565
# using AM_GLIB_GNU_GETTEXT
 
1566
AC_PREREQ(2.53)
 
1567
 
 
1568
dnl
 
1569
dnl We go to great lengths to make sure that aclocal won't 
 
1570
dnl try to pull in the installed version of these macros
 
1571
dnl when running aclocal in the glib directory.
 
1572
dnl
 
1573
m4_copy([AC_DEFUN],[glib_DEFUN])
 
1574
m4_copy([AC_REQUIRE],[glib_REQUIRE])
 
1575
dnl
 
1576
dnl At the end, if we're not within glib, we'll define the public
 
1577
dnl definitions in terms of our private definitions.
 
1578
dnl
 
1579
 
 
1580
# GLIB_LC_MESSAGES
 
1581
#--------------------
 
1582
glib_DEFUN([GLIB_LC_MESSAGES],
 
1583
  [AC_CHECK_HEADERS([locale.h])
 
1584
    if test $ac_cv_header_locale_h = yes; then
 
1585
    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
 
1586
      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
 
1587
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
 
1588
    if test $am_cv_val_LC_MESSAGES = yes; then
 
1589
      AC_DEFINE(HAVE_LC_MESSAGES, 1,
 
1590
        [Define if your <locale.h> file defines LC_MESSAGES.])
 
1591
    fi
 
1592
  fi])
 
1593
 
 
1594
# GLIB_PATH_PROG_WITH_TEST
 
1595
#----------------------------
 
1596
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
 
1597
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
 
1598
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
 
1599
[# Extract the first word of "$2", so it can be a program name with args.
 
1600
set dummy $2; ac_word=[$]2
 
1601
AC_MSG_CHECKING([for $ac_word])
 
1602
AC_CACHE_VAL(ac_cv_path_$1,
 
1603
[case "[$]$1" in
 
1604
  /*)
 
1605
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
 
1606
  ;;
 
1607
  *)
 
1608
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
 
1609
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
 
1610
    test -z "$ac_dir" && ac_dir=.
 
1611
    if test -f $ac_dir/$ac_word; then
 
1612
      if [$3]; then
 
1613
        ac_cv_path_$1="$ac_dir/$ac_word"
 
1614
        break
 
1615
      fi
 
1616
    fi
 
1617
  done
 
1618
  IFS="$ac_save_ifs"
 
1619
dnl If no 4th arg is given, leave the cache variable unset,
 
1620
dnl so AC_PATH_PROGS will keep looking.
 
1621
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
 
1622
])dnl
 
1623
  ;;
 
1624
esac])dnl
 
1625
$1="$ac_cv_path_$1"
 
1626
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
 
1627
  AC_MSG_RESULT([$]$1)
 
1628
else
 
1629
  AC_MSG_RESULT(no)
 
1630
fi
 
1631
AC_SUBST($1)dnl
 
1632
])
 
1633
 
 
1634
# GLIB_WITH_NLS
 
1635
#-----------------
 
1636
glib_DEFUN([GLIB_WITH_NLS],
 
1637
  dnl NLS is obligatory
 
1638
  [USE_NLS=yes
 
1639
    AC_SUBST(USE_NLS)
 
1640
 
 
1641
    gt_cv_have_gettext=no
 
1642
 
 
1643
    CATOBJEXT=NONE
 
1644
    XGETTEXT=:
 
1645
    INTLLIBS=
 
1646
 
 
1647
    AC_CHECK_HEADER(libintl.h,
 
1648
     [gt_cv_func_dgettext_libintl="no"
 
1649
      libintl_extra_libs=""
 
1650
 
 
1651
      #
 
1652
      # First check in libc
 
1653
      #
 
1654
      AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
 
1655
        [AC_TRY_LINK([
 
1656
#include <libintl.h>
 
1657
],
 
1658
          [return (int) dgettext ("","")],
 
1659
          gt_cv_func_dgettext_libc=yes,
 
1660
          gt_cv_func_dgettext_libc=no)
 
1661
        ])
 
1662
  
 
1663
      if test "$gt_cv_func_dgettext_libc" = "yes" ; then
 
1664
        AC_CHECK_FUNCS(bind_textdomain_codeset)
 
1665
      fi
 
1666
 
 
1667
      #
 
1668
      # If we don't have everything we want, check in libintl
 
1669
      #
 
1670
      if test "$gt_cv_func_dgettext_libc" != "yes" \
 
1671
         || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
 
1672
        
 
1673
        AC_CHECK_LIB(intl, bindtextdomain,
 
1674
            [AC_CHECK_LIB(intl, dgettext,
 
1675
                          gt_cv_func_dgettext_libintl=yes)])
 
1676
 
 
1677
        if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
 
1678
          AC_MSG_CHECKING([if -liconv is needed to use gettext])
 
1679
          AC_MSG_RESULT([])
 
1680
          AC_CHECK_LIB(intl, dcgettext,
 
1681
                       [gt_cv_func_dgettext_libintl=yes
 
1682
                        libintl_extra_libs=-liconv],
 
1683
                        :,-liconv)
 
1684
        fi
 
1685
 
 
1686
        #
 
1687
        # If we found libintl, then check in it for bind_textdomain_codeset();
 
1688
        # we'll prefer libc if neither have bind_textdomain_codeset(),
 
1689
        # and both have dgettext
 
1690
        #
 
1691
        if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
 
1692
          glib_save_LIBS="$LIBS"
 
1693
          LIBS="$LIBS -lintl $libintl_extra_libs"
 
1694
          unset ac_cv_func_bind_textdomain_codeset
 
1695
          AC_CHECK_FUNCS(bind_textdomain_codeset)
 
1696
          LIBS="$glib_save_LIBS"
 
1697
 
 
1698
          if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
 
1699
            gt_cv_func_dgettext_libc=no
 
1700
          else
 
1701
            if test "$gt_cv_func_dgettext_libc" = "yes"; then
 
1702
              gt_cv_func_dgettext_libintl=no
 
1703
            fi
 
1704
          fi
 
1705
        fi
 
1706
      fi
 
1707
 
 
1708
      if test "$gt_cv_func_dgettext_libc" = "yes" \
 
1709
        || test "$gt_cv_func_dgettext_libintl" = "yes"; then
 
1710
        gt_cv_have_gettext=yes
 
1711
      fi
 
1712
  
 
1713
      if test "$gt_cv_func_dgettext_libintl" = "yes"; then
 
1714
        INTLLIBS="-lintl $libintl_extra_libs"
 
1715
      fi
 
1716
  
 
1717
      if test "$gt_cv_have_gettext" = "yes"; then
 
1718
        AC_DEFINE(HAVE_GETTEXT,1,
 
1719
          [Define if the GNU gettext() function is already present or preinstalled.])
 
1720
        GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 
1721
          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
 
1722
        if test "$MSGFMT" != "no"; then
 
1723
          glib_save_LIBS="$LIBS"
 
1724
          LIBS="$LIBS $INTLLIBS"
 
1725
          AC_CHECK_FUNCS(dcgettext)
 
1726
          AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
1727
          GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 
1728
            [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
 
1729
          AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
 
1730
                         return _nl_msg_cat_cntr],
 
1731
            [CATOBJEXT=.gmo 
 
1732
             DATADIRNAME=share],
 
1733
            [case $host in
 
1734
            *-*-solaris*)
 
1735
            dnl On Solaris, if bind_textdomain_codeset is in libc,
 
1736
            dnl GNU format message catalog is always supported,
 
1737
            dnl since both are added to the libc all together.
 
1738
            dnl Hence, we'd like to go with DATADIRNAME=share and
 
1739
            dnl and CATOBJEXT=.gmo in this case.
 
1740
            AC_CHECK_FUNC(bind_textdomain_codeset,
 
1741
              [CATOBJEXT=.gmo 
 
1742
               DATADIRNAME=share],
 
1743
              [CATOBJEXT=.mo
 
1744
               DATADIRNAME=lib])
 
1745
            ;;
 
1746
            *)
 
1747
            CATOBJEXT=.mo
 
1748
            DATADIRNAME=lib
 
1749
            ;;
 
1750
            esac])
 
1751
          LIBS="$glib_save_LIBS"
 
1752
          INSTOBJEXT=.mo
 
1753
        else
 
1754
          gt_cv_have_gettext=no
 
1755
        fi
 
1756
      fi
 
1757
    ])
 
1758
 
 
1759
    if test "$gt_cv_have_gettext" = "yes" ; then
 
1760
      AC_DEFINE(ENABLE_NLS, 1,
 
1761
        [always defined to indicate that i18n is enabled])
 
1762
    fi
 
1763
 
 
1764
    dnl Test whether we really found GNU xgettext.
 
1765
    if test "$XGETTEXT" != ":"; then
 
1766
      dnl If it is not GNU xgettext we define it as : so that the
 
1767
      dnl Makefiles still can work.
 
1768
      if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
 
1769
        : ;
 
1770
      else
 
1771
        AC_MSG_RESULT(
 
1772
          [found xgettext program is not GNU xgettext; ignore it])
 
1773
        XGETTEXT=":"
 
1774
      fi
 
1775
    fi
 
1776
 
 
1777
    # We need to process the po/ directory.
 
1778
    POSUB=po
 
1779
 
 
1780
    AC_OUTPUT_COMMANDS(
 
1781
      [case "$CONFIG_FILES" in *po/Makefile.in*)
 
1782
        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
 
1783
      esac])
 
1784
 
 
1785
    dnl These rules are solely for the distribution goal.  While doing this
 
1786
    dnl we only have to keep exactly one list of the available catalogs
 
1787
    dnl in configure.in.
 
1788
    for lang in $ALL_LINGUAS; do
 
1789
      GMOFILES="$GMOFILES $lang.gmo"
 
1790
      POFILES="$POFILES $lang.po"
 
1791
    done
 
1792
 
 
1793
    dnl Make all variables we use known to autoconf.
 
1794
    AC_SUBST(CATALOGS)
 
1795
    AC_SUBST(CATOBJEXT)
 
1796
    AC_SUBST(DATADIRNAME)
 
1797
    AC_SUBST(GMOFILES)
 
1798
    AC_SUBST(INSTOBJEXT)
 
1799
    AC_SUBST(INTLLIBS)
 
1800
    AC_SUBST(PO_IN_DATADIR_TRUE)
 
1801
    AC_SUBST(PO_IN_DATADIR_FALSE)
 
1802
    AC_SUBST(POFILES)
 
1803
    AC_SUBST(POSUB)
 
1804
  ])
 
1805
 
 
1806
# AM_GLIB_GNU_GETTEXT
 
1807
# -------------------
 
1808
# Do checks necessary for use of gettext. If a suitable implementation 
 
1809
# of gettext is found in either in libintl or in the C library,
 
1810
# it will set INTLLIBS to the libraries needed for use of gettext
 
1811
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
 
1812
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
 
1813
# on various variables needed by the Makefile.in.in installed by 
 
1814
# glib-gettextize.
 
1815
dnl
 
1816
glib_DEFUN([GLIB_GNU_GETTEXT],
 
1817
  [AC_REQUIRE([AC_PROG_CC])dnl
 
1818
   AC_REQUIRE([AC_HEADER_STDC])dnl
 
1819
   
 
1820
   GLIB_LC_MESSAGES
 
1821
   GLIB_WITH_NLS
 
1822
 
 
1823
   if test "$gt_cv_have_gettext" = "yes"; then
 
1824
     if test "x$ALL_LINGUAS" = "x"; then
 
1825
       LINGUAS=
 
1826
     else
 
1827
       AC_MSG_CHECKING(for catalogs to be installed)
 
1828
       NEW_LINGUAS=
 
1829
       for presentlang in $ALL_LINGUAS; do
 
1830
         useit=no
 
1831
         if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
 
1832
           desiredlanguages="$LINGUAS"
 
1833
         else
 
1834
           desiredlanguages="$ALL_LINGUAS"
 
1835
         fi
 
1836
         for desiredlang in $desiredlanguages; do
 
1837
           # Use the presentlang catalog if desiredlang is
 
1838
           #   a. equal to presentlang, or
 
1839
           #   b. a variant of presentlang (because in this case,
 
1840
           #      presentlang can be used as a fallback for messages
 
1841
           #      which are not translated in the desiredlang catalog).
 
1842
           case "$desiredlang" in
 
1843
             "$presentlang"*) useit=yes;;
 
1844
           esac
 
1845
         done
 
1846
         if test $useit = yes; then
 
1847
           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
 
1848
         fi
 
1849
       done
 
1850
       LINGUAS=$NEW_LINGUAS
 
1851
       AC_MSG_RESULT($LINGUAS)
 
1852
     fi
 
1853
 
 
1854
     dnl Construct list of names of catalog files to be constructed.
 
1855
     if test -n "$LINGUAS"; then
 
1856
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
 
1857
     fi
 
1858
   fi
 
1859
 
 
1860
   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
 
1861
   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
 
1862
   dnl Try to locate is.
 
1863
   MKINSTALLDIRS=
 
1864
   if test -n "$ac_aux_dir"; then
 
1865
     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
 
1866
   fi
 
1867
   if test -z "$MKINSTALLDIRS"; then
 
1868
     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
 
1869
   fi
 
1870
   AC_SUBST(MKINSTALLDIRS)
 
1871
 
 
1872
   dnl Generate list of files to be processed by xgettext which will
 
1873
   dnl be included in po/Makefile.
 
1874
   test -d po || mkdir po
 
1875
   if test "x$srcdir" != "x."; then
 
1876
     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
 
1877
       posrcprefix="$srcdir/"
 
1878
     else
 
1879
       posrcprefix="../$srcdir/"
 
1880
     fi
 
1881
   else
 
1882
     posrcprefix="../"
 
1883
   fi
 
1884
   rm -f po/POTFILES
 
1885
   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
 
1886
        < $srcdir/po/POTFILES.in > po/POTFILES
 
1887
  ])
 
1888
 
 
1889
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
 
1890
# -------------------------------
 
1891
# Define VARIABLE to the location where catalog files will
 
1892
# be installed by po/Makefile.
 
1893
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
 
1894
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
 
1895
glib_save_prefix="$prefix"
 
1896
glib_save_exec_prefix="$exec_prefix"
 
1897
test "x$prefix" = xNONE && prefix=$ac_default_prefix
 
1898
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
 
1899
if test "x$CATOBJEXT" = "x.mo" ; then
 
1900
  localedir=`eval echo "${libdir}/locale"`
 
1901
else
 
1902
  localedir=`eval echo "${datadir}/locale"`
 
1903
fi
 
1904
prefix="$glib_save_prefix"
 
1905
exec_prefix="$glib_save_exec_prefix"
 
1906
AC_DEFINE_UNQUOTED($1, "$localedir",
 
1907
  [Define the location where the catalogs will be installed])
 
1908
])
 
1909
 
 
1910
dnl
 
1911
dnl Now the definitions that aclocal will find
 
1912
dnl
 
1913
ifdef(glib_configure_in,[],[
 
1914
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
 
1915
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
 
1916
])dnl
 
1917