~ubuntu-branches/ubuntu/warty/ggz-gtk-client/warty

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Zander
  • Date: 2003-12-01 00:00:00 UTC
  • Revision ID: james.westby@ubuntu.com-20031201000000-ixnk24pwpgigjxa2
Tags: upstream-0.0.7
ImportĀ upstreamĀ versionĀ 0.0.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# generated automatically by aclocal 1.7.4 -*- Autoconf -*-
 
2
 
 
3
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
 
4
# Free Software Foundation, Inc.
 
5
# This file is free software; the Free Software Foundation
 
6
# gives unlimited permission to copy and/or distribute it,
 
7
# with or without modifications, as long as this notice is preserved.
 
8
 
 
9
# This program is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
 
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 
12
# PARTICULAR PURPOSE.
 
13
 
 
14
dnl ======================================
 
15
dnl GGZ Gaming Zone - Configuration Macros
 
16
dnl ======================================
 
17
dnl
 
18
dnl Copyright (C) 2001, 2002 Josef Spillner, dr_maux@users.sourceforge.net
 
19
dnl This file has heavily been inspired by KDE's acinclude :)
 
20
dnl It is published under the conditions of the GNU General Public License.
 
21
dnl
 
22
dnl ======================================
 
23
dnl
 
24
dnl This file is common to most GGZ modules, and should be kept in sync
 
25
dnl between them all.  Currently the following modules use it:
 
26
dnl kde-games, kde-client, gtk-games, gtk-client, utils, grubby,
 
27
dnl ggz-client-libs, ggzd, gnome-client, txt-client.
 
28
dnl See /docs/ggz-project/buildsystem for documentation.
 
29
dnl
 
30
dnl ======================================
 
31
dnl
 
32
dnl History:
 
33
dnl 2001-05-??: first version to find easysock and ggzcore
 
34
dnl 2001-09-09: include libggz[d]mod support, and rename ac_find_file
 
35
dnl 2001-11-05: backport from copenhagen, and more macros
 
36
dnl 2001-12-16: updated for new ggzmod, imported to gtk-games and gtk-client
 
37
dnl 2002-01-12: include libggz support; imported to ggz-client-libs and ggzd
 
38
dnl 2002-01-18: remove easysock functions; look in prefix dirs for
 
39
dnl             includes and libs
 
40
dnl 2002-08-20: change -I<directory> to -isystem<directory> to avoid
 
41
dnl             warnings in gcc3
 
42
dnl 2002-09-25: added AC_GGZ_ERROR, AC_GGZ_REMOVEDUPS, AC_GGZ_INIT, allowing
 
43
dnl             for more control over what is going to happen
 
44
dnl 2002-10-12: added action-if-found and action-if-not-found parameters to
 
45
dnl             all primary macros
 
46
 
 
47
dnl ------------------------------------------------------------------------
 
48
dnl Content of this file:
 
49
dnl ------------------------------------------------------------------------
 
50
dnl AC_GGZ_LIBGGZ - find the libggz headers and libraries
 
51
dnl AC_GGZ_GGZCORE - find the ggzcore headers and libraries
 
52
dnl AC_GGZ_CONFIG - find the ggz-config tool and set up configuration
 
53
dnl AC_GGZ_GGZMOD - find the ggzmod library
 
54
dnl AC_GGZ_GGZDMOD - find the ggzdmod library
 
55
dnl AC_GGZ_SERVER - set up game and room path for ggzd game servers
 
56
dnl AC_GGZ_INTL - ensure proper i18n tools installation
 
57
dnl
 
58
dnl Each macro takes two arguments:
 
59
dnl   1.  Action-if-found (or empty for no action).
 
60
dnl   2.  Action-if-not-found (or empty for error, or "ignore" to ignore).
 
61
dnl ------------------------------------------------------------------------
 
62
dnl Internal functions:
 
63
dnl ------------------------------------------------------------------------
 
64
dnl AC_GGZ_INIT - initialization
 
65
dnl AC_GGZ_ERROR - user-friendly error messages
 
66
dnl AC_GGZ_FIND_FILE - macro for convenience (thanks kde)
 
67
dnl AC_GGZ_REMOVEDUPS - eliminate duplicate list elements
 
68
dnl
 
69
 
 
70
dnl ------------------------------------------------------------------------
 
71
dnl Find a directory containing a single file
 
72
dnl Synopsis: AC_GGZ_FIND_FILE(file, directorylist, <returnvar>)
 
73
dnl ------------------------------------------------------------------------
 
74
dnl
 
75
AC_DEFUN(AC_GGZ_FIND_FILE,
 
76
[
 
77
$3=NO
 
78
for i in $2;
 
79
do
 
80
  for j in $1;
 
81
  do
 
82
    echo "configure: __oline__: $i/$j" >&AC_FD_CC
 
83
    if test -r "$i/$j"; then
 
84
      echo "taking that" >&AC_FD_CC
 
85
      $3=$i
 
86
      break 2
 
87
    fi
 
88
  done
 
89
done
 
90
])
 
91
 
 
92
dnl ------------------------------------------------------------------------
 
93
dnl Remove duplicate entries in a list, and remove all NO's
 
94
dnl Synopsis: AC_GGZ_REMOVEDUPS(list, <returnlist>)
 
95
dnl ------------------------------------------------------------------------
 
96
dnl
 
97
AC_DEFUN(AC_GGZ_REMOVEDUPS,
 
98
[
 
99
ret=""
 
100
for i in $1; do
 
101
  add=yes
 
102
  for j in $ret; do
 
103
    if test "x$i" = "x$j"; then
 
104
      add=no
 
105
    fi
 
106
  done
 
107
  if test "x$i" = "xNO"; then
 
108
    add=no
 
109
  fi
 
110
  if test "x$add" = "xyes"; then
 
111
  ret="$ret $i"
 
112
  fi
 
113
done
 
114
$2=$ret
 
115
])
 
116
 
 
117
dnl ------------------------------------------------------------------------
 
118
dnl User-friendly error messages
 
119
dnl Synopsis: AC_GGZ_ERROR(libraryname, headerdirlist, libdirlist)
 
120
dnl ------------------------------------------------------------------------
 
121
dnl
 
122
AC_DEFUN(AC_GGZ_ERROR,
 
123
[
 
124
  AC_MSG_WARN([no
 
125
  The library '$1' does not seem to be installed correctly.
 
126
  Headers searched in: $2
 
127
  Libraries searched in: $3
 
128
  Please read QuickStart.GGZ in order to fix this.
 
129
  ])
 
130
  exit 1
 
131
])
 
132
 
 
133
dnl ------------------------------------------------------------------------
 
134
dnl Initialization, common values and such
 
135
dnl Synopsis: AC_GGZ_INIT([export], [defaults])
 
136
dnl ------------------------------------------------------------------------
 
137
dnl
 
138
AC_DEFUN(AC_GGZ_INIT,
 
139
[
 
140
if test "x${prefix}" = "xNONE"; then
 
141
   ac_ggz_prefix_incdir="${ac_default_prefix}/include"
 
142
   ac_ggz_prefix_libdir="${ac_default_prefix}/lib"
 
143
   ac_ggz_prefix_bindir="${ac_default_prefix}/bin"
 
144
   ac_ggz_prefix_etcdir="${ac_default_prefix}/etc"
 
145
else
 
146
   ac_ggz_prefix_incdir="${prefix}/include"
 
147
   ac_ggz_prefix_libdir="${prefix}/lib"
 
148
   ac_ggz_prefix_bindir="${prefix}/bin"
 
149
   ac_ggz_prefix_etcdir="${prefix}/etc"
 
150
fi
 
151
ac_ggz_stdinc="$ac_ggz_prefix_incdir"
 
152
ac_ggz_stdlib="$ac_ggz_prefix_libdir"
 
153
ac_ggz_stdbin="$ac_ggz_prefix_bindir"
 
154
ac_ggz_stdetc="$ac_ggz_prefix_etcdir"
 
155
if test "x$1" = "xdefaults" || test "x$2" = "xdefaults"; then
 
156
  ac_ggz_stdinc="$ac_ggz_stdinc /usr/local/include /usr/include"
 
157
  ac_ggz_stdlib="$ac_ggz_stdlib /usr/local/lib /usr/lib"
 
158
  ac_ggz_stdbin="$ac_ggz_stdbin /usr/local/bin /usr/bin"
 
159
  ac_ggz_stdetc="$ac_ggz_stdetc/ggzd /usr/local/etc/ggzd /etc/ggzd"
 
160
fi
 
161
if test "x$1" = "xexport" || test "x$2" = "xexport"; then
 
162
  CPPFLAGS="$CPPFLAGS -isystem${ac_ggz_prefix_incdir}"
 
163
  LDFLAGS="$LDFLAGS -L${ac_ggz_prefix_libdir}"
 
164
fi
 
165
 
 
166
save_cflags=$CFLAGS
 
167
save_cxxflags=$CXXFLAGS
 
168
CFLAGS="-Wall -Werror"
 
169
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
 
170
        [[void signedness(void){char c;if(c==-1)c=0;}]])],
 
171
        [],
 
172
        [save_cflags="$save_cflags -fsigned-char"
 
173
         save_cxxflags="$save_cxxflags -fsigned-char"])
 
174
CFLAGS=$save_cflags
 
175
CXXFLAGS=$save_cxxflags
 
176
])
 
177
 
 
178
dnl ------------------------------------------------------------------------
 
179
dnl Try to find the libggz headers and libraries.
 
180
dnl $(LIBGGZ_LDFLAGS) will be -L ... (if needed)
 
181
dnl and $(LIBGGZ_INCLUDES) will be -I ... (if needed)
 
182
dnl ------------------------------------------------------------------------
 
183
dnl
 
184
AC_DEFUN(AC_GGZ_LIBGGZ,
 
185
[
 
186
AC_MSG_CHECKING([for GGZ library: libggz])
 
187
 
 
188
ac_libggz_includes=NO ac_libggz_libraries=NO
 
189
libggz_libraries=""
 
190
libggz_includes=""
 
191
 
 
192
AC_ARG_WITH(libggz-dir,
 
193
    [  --with-libggz-dir=DIR       libggz installation prefix ],
 
194
    [  ac_libggz_includes="$withval"/include
 
195
       ac_libggz_libraries="$withval"/lib
 
196
    ])
 
197
AC_ARG_WITH(libggz-includes,
 
198
    [  --with-libggz-includes=DIR  where the libggz includes are. ],
 
199
    [  ac_libggz_includes="$withval"
 
200
    ])
 
201
AC_ARG_WITH(libggz-libraries,
 
202
    [  --with-libggz-libraries=DIR where the libggz libs are. ],
 
203
    [  ac_libggz_libraries="$withval"
 
204
    ])
 
205
 
 
206
AC_CACHE_VAL(ac_cv_have_libggz,
 
207
[
 
208
libggz_incdirs="$ac_libggz_includes $ac_ggz_stdinc"
 
209
AC_GGZ_REMOVEDUPS($libggz_incdirs, libggz_incdirs)
 
210
libggz_header=ggz.h
 
211
 
 
212
AC_GGZ_FIND_FILE($libggz_header, $libggz_incdirs, libggz_incdir)
 
213
ac_libggz_includes="$libggz_incdir"
 
214
 
 
215
libggz_libdirs="$ac_libggz_libraries $ac_ggz_stdlib"
 
216
AC_GGZ_REMOVEDUPS($libggz_libdirs, libggz_libdirs)
 
217
 
 
218
test=NONE
 
219
libggz_libdir=NONE
 
220
for dir in $libggz_libdirs; do
 
221
  try="ls -1 $dir/libggz.so"
 
222
  if test -n "`$try 2> /dev/null`"; then libggz_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
 
223
done
 
224
 
 
225
ac_libggz_libraries="$libggz_libdir"
 
226
 
 
227
if test "$ac_libggz_includes" = NO || test "$ac_libggz_libraries" = NO; then
 
228
  ac_cv_have_libggz="have_libggz=no"
 
229
  ac_libggz_notfound=""
 
230
else
 
231
  have_libggz="yes"
 
232
fi
 
233
])
 
234
 
 
235
eval "$ac_cv_have_libggz"
 
236
 
 
237
if test "$have_libggz" != yes; then
 
238
  if test "x$2" = "xignore"; then
 
239
    AC_MSG_RESULT([$have_libggz (ignored)])
 
240
  else
 
241
    AC_MSG_RESULT([$have_libggz])
 
242
    if test "x$2" = "x"; then
 
243
      AC_GGZ_ERROR(libggz, $libggz_incdirs, $libggz_libdirs)
 
244
    fi
 
245
 
 
246
    # perform actions given by argument 2.
 
247
    $2
 
248
  fi
 
249
else
 
250
  ac_cv_have_libggz="have_libggz=yes \
 
251
    ac_libggz_includes=$ac_libggz_includes ac_libggz_libraries=$ac_libggz_libraries"
 
252
  AC_MSG_RESULT([$have_libggz (libraries $ac_libggz_libraries, headers $ac_libggz_includes)])
 
253
 
 
254
  libggz_libraries="$ac_libggz_libraries"
 
255
  libggz_includes="$ac_libggz_includes"
 
256
 
 
257
  AC_SUBST(libggz_libraries)
 
258
  AC_SUBST(libggz_includes)
 
259
 
 
260
  LIBGGZ_INCLUDES="-isystem $libggz_includes"
 
261
  LIBGGZ_LDFLAGS="-L$libggz_libraries"
 
262
 
 
263
  AC_SUBST(LIBGGZ_INCLUDES)
 
264
  AC_SUBST(LIBGGZ_LDFLAGS)
 
265
 
 
266
  LIB_GGZ='-lggz'
 
267
  AC_SUBST(LIB_GGZ)
 
268
 
 
269
  # perform actions given by argument 1.
 
270
  $1
 
271
fi
 
272
 
 
273
])
 
274
 
 
275
 
 
276
dnl ------------------------------------------------------------------------
 
277
dnl Try to find the ggzcore headers and libraries.
 
278
dnl $(GGZCORE_LDFLAGS) will be -L ... (if needed)
 
279
dnl and $(GGZCORE_INCLUDES) will be -I ... (if needed)
 
280
dnl ------------------------------------------------------------------------
 
281
dnl
 
282
AC_DEFUN(AC_GGZ_GGZCORE,
 
283
[
 
284
AC_MSG_CHECKING([for GGZ library: ggzcore])
 
285
 
 
286
ac_ggzcore_includes=NO ac_ggzcore_libraries=NO
 
287
ggzcore_libraries=""
 
288
ggzcore_includes=""
 
289
 
 
290
AC_ARG_WITH(ggzcore-dir,
 
291
    [  --with-ggzcore-dir=DIR       ggzcore installation prefix ],
 
292
    [  ac_ggzcore_includes="$withval"/include
 
293
       ac_ggzcore_libraries="$withval"/lib
 
294
    ])
 
295
AC_ARG_WITH(ggzcore-includes,
 
296
    [  --with-ggzcore-includes=DIR  where the ggzcore includes are. ],
 
297
    [  ac_ggzcore_includes="$withval"
 
298
    ])
 
299
AC_ARG_WITH(ggzcore-libraries,
 
300
    [  --with-ggzcore-libraries=DIR where the ggzcore libs are. ],
 
301
    [  ac_ggzcore_libraries="$withval"
 
302
    ])
 
303
 
 
304
AC_CACHE_VAL(ac_cv_have_ggzcore,
 
305
[
 
306
ggzcore_incdirs="$ac_ggzcore_includes $ac_ggz_stdinc"
 
307
AC_GGZ_REMOVEDUPS($ggzcore_incdirs, ggzcore_incdirs)
 
308
ggzcore_header=ggzcore.h
 
309
 
 
310
AC_GGZ_FIND_FILE($ggzcore_header, $ggzcore_incdirs, ggzcore_incdir)
 
311
ac_ggzcore_includes="$ggzcore_incdir"
 
312
 
 
313
ggzcore_libdirs="$ac_ggzcore_libraries $ac_ggz_stdlib"
 
314
AC_GGZ_REMOVEDUPS($ggzcore_libdirs, ggzcore_libdirs)
 
315
 
 
316
test=NONE
 
317
ggzcore_libdir=NONE
 
318
for dir in $ggzcore_libdirs; do
 
319
  try="ls -1 $dir/libggzcore.so"
 
320
  if test -n "`$try 2> /dev/null`"; then ggzcore_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
 
321
done
 
322
 
 
323
ac_ggzcore_libraries="$ggzcore_libdir"
 
324
 
 
325
if test "$ac_ggzcore_includes" = NO || test "$ac_ggzcore_libraries" = NO; then
 
326
  ac_cv_have_ggzcore="have_ggzcore=no"
 
327
  ac_ggzcore_notfound=""
 
328
else
 
329
  have_ggzcore="yes"
 
330
fi
 
331
])
 
332
 
 
333
eval "$ac_cv_have_ggzcore"
 
334
 
 
335
if test "$have_ggzcore" != yes; then
 
336
  if test "x$2" = "xignore"; then
 
337
    AC_MSG_RESULT([$have_ggzcore (intentionally ignored)])
 
338
  else
 
339
    AC_MSG_RESULT([$have_ggzcore])
 
340
    if test "x$2" = "x"; then
 
341
      AC_GGZ_ERROR(ggzcore, $ggzcore_incdirs, $ggzcore_libdirs)
 
342
    fi
 
343
 
 
344
    # Perform actions given by argument 2.
 
345
    $2
 
346
  fi
 
347
else
 
348
  ac_cv_have_ggzcore="have_ggzcore=yes \
 
349
    ac_ggzcore_includes=$ac_ggzcore_includes ac_ggzcore_libraries=$ac_ggzcore_libraries"
 
350
  AC_MSG_RESULT([$have_ggzcore (libraries $ac_ggzcore_libraries, headers $ac_ggzcore_includes)])
 
351
 
 
352
  ggzcore_libraries="$ac_ggzcore_libraries"
 
353
  ggzcore_includes="$ac_ggzcore_includes"
 
354
 
 
355
  AC_SUBST(ggzcore_libraries)
 
356
  AC_SUBST(ggzcore_includes)
 
357
 
 
358
  GGZCORE_INCLUDES="-isystem $ggzcore_includes"
 
359
  GGZCORE_LDFLAGS="-L$ggzcore_libraries"
 
360
 
 
361
  AC_SUBST(GGZCORE_INCLUDES)
 
362
  AC_SUBST(GGZCORE_LDFLAGS)
 
363
 
 
364
  LIB_GGZCORE='-lggzcore'
 
365
  AC_SUBST(LIB_GGZCORE)
 
366
 
 
367
  # Perform actions given by argument 1.
 
368
  $1
 
369
fi
 
370
 
 
371
])
 
372
 
 
373
dnl ------------------------------------------------------------------------
 
374
dnl Try to find the ggz-config binary.
 
375
dnl Sets GGZ_CONFIG to the path/name of the program.
 
376
dnl Sets also: ggz_gamedir, ggz_datadir etc.
 
377
dnl ------------------------------------------------------------------------
 
378
dnl
 
379
AC_DEFUN(AC_GGZ_CONFIG,
 
380
[
 
381
AC_MSG_CHECKING([for GGZ configuration tool: ggz-config])
 
382
 
 
383
ac_ggz_config=NO
 
384
ggz_config=""
 
385
 
 
386
AC_ARG_WITH(ggzconfig,
 
387
    [  --with-ggzconfig=DIR          path to ggz-config ],
 
388
    [  ac_ggz_config="$withval"
 
389
    ])
 
390
 
 
391
AC_CACHE_VAL(ac_cv_have_ggzconfig,
 
392
[
 
393
ggz_config_dirs="$ac_ggz_config $ac_ggz_stdbin"
 
394
 
 
395
AC_GGZ_FIND_FILE(ggz-config, $ggz_config_dirs, ggz_config_dir)
 
396
ac_ggz_config="$ggz_config_dir"
 
397
 
 
398
if test "$ac_ggz_config" = NO; then
 
399
  ac_cv_have_ggzcore="have_ggz_config=no"
 
400
  ac_ggz_config_notfound=""
 
401
  have_ggz_config="no"
 
402
else
 
403
  have_ggz_config="yes"
 
404
fi
 
405
])
 
406
 
 
407
eval "$ac_cv_have_ggz_config"
 
408
 
 
409
if test "$have_ggz_config" != yes; then
 
410
  if test "x$2" = "xignore"; then
 
411
    AC_MSG_RESULT([$have_ggz_config (intentionally ignored)])
 
412
  else
 
413
    AC_MSG_RESULT([$have_ggz_config])
 
414
    if test "x$2" = "x"; then
 
415
      AC_MSG_ERROR([ggz-config not found. Please check your installation! ])
 
416
    fi
 
417
 
 
418
    # Perform actions given by argument 2.
 
419
    $2
 
420
  fi
 
421
else
 
422
  ac_cv_have_ggz_config="have_ggz_config=yes \
 
423
    ac_ggz_config=$ac_ggz_config"
 
424
  AC_MSG_RESULT([$ac_ggz_config/ggz-config])
 
425
 
 
426
  ggz_config="$ac_ggz_config"
 
427
 
 
428
  AC_SUBST(ggz_config)
 
429
 
 
430
  GGZ_CONFIG="${ggz_config}/ggz-config"
 
431
  AC_SUBST(GGZ_CONFIG)
 
432
 
 
433
  ggzmoduleconfdir=`$GGZ_CONFIG --configdir`
 
434
  AC_DEFINE_UNQUOTED(GGZMODULECONFDIR, "${ggzmoduleconfdir}", [Path where the game registry is located])
 
435
  ggzexecmoddir=`$GGZ_CONFIG --gamedir`
 
436
  AC_DEFINE_UNQUOTED(GAMEDIR, "${ggzexecmoddir}", [Path where to install the games])
 
437
  ggzdatadir=`$GGZ_CONFIG --datadir`
 
438
  AC_DEFINE_UNQUOTED(GGZDATADIR, "${ggzdatadir}", [Path where the games should look for their data files])
 
439
  packagesrcdir=`cd $srcdir && pwd`
 
440
  AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [Path where the source is located])
 
441
 
 
442
  AC_SUBST(ggzmoduleconfdir)
 
443
  AC_SUBST(ggzexecmoddir)
 
444
  AC_SUBST(ggzdatadir)
 
445
  AC_SUBST(packagesrcdir)
 
446
 
 
447
  # Perform actions given by argument 1.
 
448
  $1
 
449
fi
 
450
 
 
451
])
 
452
 
 
453
dnl ------------------------------------------------------------------------
 
454
dnl Try to find the ggzmod headers and libraries.
 
455
dnl $(GGZMOD_LDFLAGS) will be -L ... (if needed)
 
456
dnl and $(GGZMOD_INCLUDES) will be -I ... (if needed)
 
457
dnl ------------------------------------------------------------------------
 
458
dnl
 
459
AC_DEFUN(AC_GGZ_GGZMOD,
 
460
[
 
461
AC_MSG_CHECKING([for GGZ library: ggzmod])
 
462
 
 
463
ac_ggzmod_includes=NO ac_ggzmod_libraries=NO
 
464
ggzmod_libraries=""
 
465
ggzmod_includes=""
 
466
 
 
467
AC_ARG_WITH(ggzmod-dir,
 
468
    [  --with-ggzmod-dir=DIR        ggzmod installation prefix ],
 
469
    [  ac_ggzmod_includes="$withval"/include
 
470
       ac_ggzmod_libraries="$withval"/lib
 
471
    ])
 
472
AC_ARG_WITH(ggzmod-includes,
 
473
    [  --with-ggzmod-includes=DIR   where the ggzmod includes are. ],
 
474
    [  ac_ggzmod_includes="$withval"
 
475
    ])
 
476
AC_ARG_WITH(ggzmod-libraries,
 
477
    [  --with-ggzmod-libraries=DIR  where the ggzmod libs are. ],
 
478
    [  ac_ggzmod_libraries="$withval"
 
479
    ])
 
480
 
 
481
AC_CACHE_VAL(ac_cv_have_ggzmod,
 
482
[
 
483
ggzmod_incdirs="$ac_ggzmod_includes $ac_ggz_stdinc"
 
484
AC_GGZ_REMOVEDUPS($ggzmod_incdirs, ggzmod_incdirs)
 
485
ggzmod_header=ggzmod.h
 
486
 
 
487
AC_GGZ_FIND_FILE($ggzmod_header, $ggzmod_incdirs, ggzmod_incdir)
 
488
ac_ggzmod_includes="$ggzmod_incdir"
 
489
 
 
490
ggzmod_libdirs="$ac_ggzmod_libraries $ac_ggz_stdlib"
 
491
AC_GGZ_REMOVEDUPS($ggzmod_libdirs, ggzmod_libdirs)
 
492
 
 
493
test=NONE
 
494
ggzmod_libdir=NONE
 
495
for dir in $ggzmod_libdirs; do
 
496
  try="ls -1 $dir/libggzmod.so"
 
497
  if test -n "`$try 2> /dev/null`"; then ggzmod_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
 
498
done
 
499
 
 
500
ac_ggzmod_libraries="$ggzmod_libdir"
 
501
 
 
502
if test "$ac_ggzmod_includes" = NO || test "$ac_ggzmod_libraries" = NO; then
 
503
  ac_cv_have_ggzmod="have_ggzmod=no"
 
504
  ac_ggzmod_notfound=""
 
505
else
 
506
  have_ggzmod="yes"
 
507
fi
 
508
])
 
509
 
 
510
eval "$ac_cv_have_ggzmod"
 
511
 
 
512
if test "$have_ggzmod" != yes; then
 
513
  if test "x$2" = "xignore"; then
 
514
    AC_MSG_RESULT([$have_ggzmod (intentionally ignored)])
 
515
  else
 
516
    AC_MSG_RESULT([$have_ggzmod])
 
517
    if test "x$2" = "x"; then
 
518
      AC_GGZ_ERROR(ggzmod, $ggzmod_incdirs, $ggzmod_libdirs)
 
519
    fi
 
520
 
 
521
    # Perform actions given by argument 2.
 
522
    $2
 
523
  fi
 
524
else
 
525
  ac_cv_have_ggzmod="have_ggzmod=yes \
 
526
    ac_ggzmod_includes=$ac_ggzmod_includes ac_ggzmod_libraries=$ac_ggzmod_libraries"
 
527
  AC_MSG_RESULT([$have_ggzmod (libraries $ac_ggzmod_libraries, headers $ac_ggzmod_includes)])
 
528
 
 
529
  ggzmod_libraries="$ac_ggzmod_libraries"
 
530
  ggzmod_includes="$ac_ggzmod_includes"
 
531
 
 
532
  AC_SUBST(ggzmod_libraries)
 
533
  AC_SUBST(ggzmod_includes)
 
534
 
 
535
  GGZMOD_INCLUDES="-isystem $ggzmod_includes"
 
536
  GGZMOD_LDFLAGS="-L$ggzmod_libraries"
 
537
 
 
538
  AC_SUBST(GGZMOD_INCLUDES)
 
539
  AC_SUBST(GGZMOD_LDFLAGS)
 
540
 
 
541
  LIB_GGZMOD='-lggzmod'
 
542
  AC_SUBST(LIB_GGZMOD)
 
543
 
 
544
  # Perform actions given by argument 1.
 
545
  $1
 
546
fi
 
547
 
 
548
])
 
549
 
 
550
dnl ------------------------------------------------------------------------
 
551
dnl Try to find the ggzdmod headers and libraries.
 
552
dnl $(GGZDMOD_LDFLAGS) will be -L ... (if needed)
 
553
dnl and $(GGZDMOD_INCLUDES) will be -I ... (if needed)
 
554
dnl ------------------------------------------------------------------------
 
555
dnl
 
556
AC_DEFUN(AC_GGZ_GGZDMOD,
 
557
[
 
558
AC_MSG_CHECKING([for GGZ library: ggzdmod])
 
559
 
 
560
ac_ggzdmod_includes=NO ac_ggzdmod_libraries=NO
 
561
ggzdmod_libraries=""
 
562
ggzdmod_includes=""
 
563
 
 
564
AC_ARG_WITH(ggzdmod-dir,
 
565
    [  --with-ggzdmod-dir=DIR        ggzdmod installation prefix ],
 
566
    [  ac_ggzdmod_includes="$withval"/include
 
567
       ac_ggzdmod_libraries="$withval"/lib
 
568
    ])
 
569
AC_ARG_WITH(ggzdmod-includes,
 
570
    [  --with-ggzdmod-includes=DIR   where the ggzdmod includes are. ],
 
571
    [  ac_ggzdmod_includes="$withval"
 
572
    ])
 
573
AC_ARG_WITH(ggzdmod-libraries,
 
574
    [  --with-ggzdmod-libraries=DIR  where the ggzdmod libs are. ],
 
575
    [  ac_ggzdmod_libraries="$withval"
 
576
    ])
 
577
 
 
578
AC_CACHE_VAL(ac_cv_have_ggzdmod,
 
579
[
 
580
ggzdmod_incdirs="$ac_ggzdmod_includes $ac_ggz_stdinc"
 
581
AC_GGZ_REMOVEDUPS($ggzdmod_incdirs, ggzdmod_incdirs)
 
582
ggzdmod_header=ggzdmod.h
 
583
 
 
584
AC_GGZ_FIND_FILE($ggzdmod_header, $ggzdmod_incdirs, ggzdmod_incdir)
 
585
ac_ggzdmod_includes="$ggzdmod_incdir"
 
586
 
 
587
ggzdmod_libdirs="$ac_ggzdmod_libraries $ac_ggz_stdlib"
 
588
AC_GGZ_REMOVEDUPS($ggzdmod_libdirs, ggzdmod_libdirs)
 
589
 
 
590
test=NONE
 
591
ggzdmod_libdir=NONE
 
592
for dir in $ggzdmod_libdirs; do
 
593
  try="ls -1 $dir/libggzdmod.so"
 
594
  if test -n "`$try 2> /dev/null`"; then ggzdmod_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
 
595
done
 
596
 
 
597
ac_ggzdmod_libraries="$ggzdmod_libdir"
 
598
 
 
599
if test "$ac_ggzdmod_includes" = NO || test "$ac_ggzdmod_libraries" = NO; then
 
600
  ac_cv_have_ggzdmod="have_ggzdmod=no"
 
601
  ac_ggzdmod_notfound=""
 
602
else
 
603
  have_ggzdmod="yes"
 
604
fi
 
605
])
 
606
 
 
607
eval "$ac_cv_have_ggzdmod"
 
608
 
 
609
if test "$have_ggzdmod" != yes; then
 
610
  if test "x$2" = "xignore"; then
 
611
    AC_MSG_RESULT([$have_ggzdmod (intentionally ignored)])
 
612
  else
 
613
    AC_MSG_RESULT([$have_ggzdmod])
 
614
    if test "x$2" = "x"; then
 
615
      AC_GGZ_ERROR(ggzdmod, $ggzdmod_incdirs, $ggzdmod_libdirs)
 
616
    fi
 
617
 
 
618
    # Perform actions given by argument 2.
 
619
    $2
 
620
  fi
 
621
else
 
622
  ac_cv_have_ggzdmod="have_ggzdmod=yes \
 
623
    ac_ggzdmod_includes=$ac_ggzdmod_includes ac_ggzdmod_libraries=$ac_ggzdmod_libraries"
 
624
  AC_MSG_RESULT([$have_ggzdmod (libraries $ac_ggzdmod_libraries, headers $ac_ggzdmod_includes)])
 
625
 
 
626
  ggzdmod_libraries="$ac_ggzdmod_libraries"
 
627
  ggzdmod_includes="$ac_ggzdmod_includes"
 
628
 
 
629
  AC_SUBST(ggzdmod_libraries)
 
630
  AC_SUBST(ggzdmod_includes)
 
631
 
 
632
  GGZDMOD_INCLUDES="-isystem $ggzdmod_includes"
 
633
  GGZDMOD_LDFLAGS="-L$ggzdmod_libraries"
 
634
 
 
635
  AC_SUBST(GGZDMOD_INCLUDES)
 
636
  AC_SUBST(GGZDMOD_LDFLAGS)
 
637
 
 
638
  LIB_GGZDMOD='-lggzdmod'
 
639
  AC_SUBST(LIB_GGZDMOD)
 
640
 
 
641
  # Perform actions given by argument 1.
 
642
  $1
 
643
fi
 
644
 
 
645
])
 
646
 
 
647
dnl ------------------------------------------------------------------------
 
648
dnl Setup the game server configuration.
 
649
dnl Sets ggzdconfdir (ggzd configuration).
 
650
dnl Sets ggzddatadir (for game server data).
 
651
dnl ------------------------------------------------------------------------
 
652
dnl
 
653
AC_DEFUN(AC_GGZ_SERVER,
 
654
[
 
655
AC_MSG_CHECKING([for GGZ server: ggzd])
 
656
AC_ARG_WITH(ggzd-confdir,
 
657
[  --with-ggzd-confdir=DIR       directory for room/game data],
 
658
[ ac_ggzd_confdir="$withval"
 
659
])
 
660
 
 
661
AC_CACHE_VAL(ac_cv_have_ggzdconf,
 
662
[
 
663
        if test "x$1" = "xforce"; then
 
664
                if test "x$ac_ggzd_confdir" = "x"; then
 
665
                        ggzdconfdirs="$ac_ggz_stdetc"
 
666
                else
 
667
                        ggzdconfdirs="$ac_ggzd_confdir"
 
668
                fi
 
669
        else
 
670
                ggzdconfdirs="$ac_ggzd_confdir $ac_ggz_stdetc"
 
671
        fi
 
672
 
 
673
        ggzdconfdir=NONE
 
674
        for dir in $ggzdconfdirs; do
 
675
                if test -n "`ls -d $dir/rooms 2> /dev/null`"; then
 
676
                        if test -n "`ls -d $dir/rooms 2> /dev/null`"; then
 
677
                                ggzdconfdir=$dir; break;
 
678
                        else
 
679
                                echo "tried $dir" >&AC_FD_CC;
 
680
                        fi
 
681
                else
 
682
                        echo "tried $dir" >&AC_FD_CC;
 
683
                fi
 
684
        done
 
685
 
 
686
        if test "x$ggzdconfdir" = "xNONE"; then
 
687
                have_ggzdconf="no"
 
688
        else
 
689
                have_ggzdconf="yes"
 
690
        fi
 
691
])
 
692
 
 
693
eval "$ac_cv_have_ggzdconf"
 
694
 
 
695
if test "$have_ggzdconf" != yes; then
 
696
        if test "x$2" = "xignore"; then
 
697
          AC_MSG_RESULT([$have_ggzdconf (intentionally ignored)])
 
698
        elif test "x$2" = "xforce"; then
 
699
          if test "x$ac_ggzd_confdir" = "x"; then
 
700
            ggzdconfdir="\${prefix}/etc/ggzd"
 
701
          else
 
702
            ggzdconfdir=$ac_ggzd_confdir
 
703
          fi
 
704
          AC_MSG_RESULT([$have_ggzdconf (but forced to ${ggzdconfdir})])
 
705
        else
 
706
          AC_MSG_RESULT([$have_ggzdconf])
 
707
      if test "x$2" = "x"; then
 
708
            AC_MSG_ERROR([GGZ server configuration not found. Please check your installation! ])
 
709
      fi
 
710
 
 
711
          # Perform actions given by argument 2.
 
712
          $2
 
713
        fi
 
714
else
 
715
        prefixed=0
 
716
        if test "x${prefix}" != "xNONE" && test "x${prefix}" != "x${ac_default_prefix}"; then
 
717
                prefixed=1
 
718
        fi
 
719
        if test "x$ggzconfdir" != "x${prefix}/etc/ggzd" && test "x$prefixed" = "x1"; then
 
720
                AC_MSG_RESULT([$have_ggzdconf ($ggzdconfdir, but using ${prefix}/etc/ggzd nevertheless)])
 
721
                ggzdconfdir="\${prefix}/etc/ggzd"
 
722
        else
 
723
                AC_MSG_RESULT([$have_ggzdconf ($ggzdconfdir)])
 
724
        fi
 
725
fi
 
726
 
 
727
if test "$have_ggzdconf" = yes || test "x$2" = "xforce"; then
 
728
        AC_SUBST(ggzdconfdir)
 
729
 
 
730
        ggzddatadir=${prefix}/share/${PACKAGE}
 
731
        AC_DEFINE_UNQUOTED(GGZDDATADIR, "${ggzddatadir}", [Game server data directory])
 
732
        AC_SUBST(ggzddatadir)
 
733
 
 
734
        if test "x${libdir}" = 'x${exec_prefix}/lib'; then
 
735
          if test "x${exec_prefix}" = "xNONE"; then
 
736
            if test "x${prefix}" = "xNONE"; then
 
737
              ggzdexecmoddir="\${ac_default_prefix}/lib/ggzd"
 
738
                  ggzdexecmodpath="${ac_default_prefix}/lib/ggzd"
 
739
            else
 
740
              ggzdexecmoddir="\${prefix}/lib/ggzd"
 
741
                  ggzdexecmodpath="${prefix}/lib/ggzd"
 
742
            fi
 
743
          else
 
744
            ggzdexecmoddir="\${exec_prefix}/lib/ggzd"
 
745
                ggzdexecmodpath="${exec_prefix}/lib/ggzd"
 
746
          fi
 
747
        else
 
748
          ggzdexecmoddir="\${libdir}/ggzd"
 
749
          ggzdexecmodpath="${libdir}/ggzd"
 
750
        fi
 
751
        AC_SUBST(ggzdexecmoddir)
 
752
        AC_SUBST(ggzdexecmodpath)
 
753
 
 
754
        # Perform actions given by argument 1.
 
755
        $1
 
756
fi
 
757
 
 
758
])
 
759
 
 
760
dnl ------------------------------------------------------------------------
 
761
dnl Find internationalization tools
 
762
dnl ------------------------------------------------------------------------
 
763
dnl
 
764
AC_DEFUN(AC_GGZ_INTL,
 
765
[
 
766
AC_PATH_PROG(GETTEXT, xgettext)
 
767
AC_PATH_PROG(MSGFMT, msgfmt)
 
768
AC_PATH_PROG(MSGMERGE, msgmerge)
 
769
 
 
770
intl=1
 
771
if test "x$GETTEXT" = "x"; then intl=0; fi
 
772
if test "x$MSGFMT" = "x"; then intl=0; fi
 
773
if test "x$MSGMERGE" = "x"; then intl=0; fi
 
774
if test "$intl" = 0; then
 
775
  if test "x$2" = "xignore"; then
 
776
    AC_MSG_WARN([Internationalization tools missing. (ignored)])
 
777
  else
 
778
    AC_MSG_RESULT([Internationalization tools missing.])
 
779
    if test "x$2" = "x"; then
 
780
      AC_MSG_ERROR([Internationalization tools missing.])
 
781
    fi
 
782
 
 
783
    # Perform actions given by argument 2.
 
784
    $2
 
785
  fi
 
786
else
 
787
  AC_MSG_RESULT([Internationalization tools found.])
 
788
 
 
789
  XGETTEXT=$GETTEXT
 
790
  GMSGFMT=$MSGFMT
 
791
 
 
792
  AC_SUBST(XGETTEXT)
 
793
  AC_SUBST(GETTEXT)
 
794
  AC_SUBST(GMSGFMT)
 
795
  AC_SUBST(MSGFMT)
 
796
  AC_SUBST(MSGMERGE)
 
797
 
 
798
  # Perform actions given by argument 1.
 
799
  $1
 
800
fi
 
801
 
 
802
])
 
803
# Configure paths for GTK+
 
804
# Owen Taylor     1997-2001
 
805
 
 
806
dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
 
807
dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, 
 
808
dnl pass to pkg-config
 
809
dnl
 
810
AC_DEFUN(AM_PATH_GTK_2_0,
 
811
[dnl 
 
812
dnl Get the cflags and libraries from pkg-config
 
813
dnl
 
814
AC_ARG_ENABLE(gtktest, [  --disable-gtktest       do not try to compile and run a test GTK+ program],
 
815
                    , enable_gtktest=yes)
 
816
 
 
817
  pkg_config_args=gtk+-2.0
 
818
  for module in . $4
 
819
  do
 
820
      case "$module" in
 
821
         gthread) 
 
822
             pkg_config_args="$pkg_config_args gthread-2.0"
 
823
         ;;
 
824
      esac
 
825
  done
 
826
 
 
827
  no_gtk=""
 
828
 
 
829
  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 
830
 
 
831
  if test x$PKG_CONFIG != xno ; then
 
832
    if pkg-config --atleast-pkgconfig-version 0.7 ; then
 
833
      :
 
834
    else
 
835
      echo *** pkg-config too old; version 0.7 or better required.
 
836
      no_gtk=yes
 
837
      PKG_CONFIG=no
 
838
    fi
 
839
  else
 
840
    no_gtk=yes
 
841
  fi
 
842
 
 
843
  min_gtk_version=ifelse([$1], ,2.0.0,$1)
 
844
  AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
 
845
 
 
846
  if test x$PKG_CONFIG != xno ; then
 
847
    ## don't try to run the test against uninstalled libtool libs
 
848
    if $PKG_CONFIG --uninstalled $pkg_config_args; then
 
849
          echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
 
850
          enable_gtktest=no
 
851
    fi
 
852
 
 
853
    if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
 
854
          :
 
855
    else
 
856
          no_gtk=yes
 
857
    fi
 
858
  fi
 
859
 
 
860
  if test x"$no_gtk" = x ; then
 
861
    GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
 
862
    GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
 
863
    gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
 
864
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
 
865
    gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
 
866
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
 
867
    gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
 
868
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
 
869
    if test "x$enable_gtktest" = "xyes" ; then
 
870
      ac_save_CFLAGS="$CFLAGS"
 
871
      ac_save_LIBS="$LIBS"
 
872
      CFLAGS="$CFLAGS $GTK_CFLAGS"
 
873
      LIBS="$GTK_LIBS $LIBS"
 
874
dnl
 
875
dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
 
876
dnl checks the results of pkg-config to some extent)
 
877
dnl
 
878
      rm -f conf.gtktest
 
879
      AC_TRY_RUN([
 
880
#include <gtk/gtk.h>
 
881
#include <stdio.h>
 
882
#include <stdlib.h>
 
883
 
 
884
int 
 
885
main ()
 
886
{
 
887
  int major, minor, micro;
 
888
  char *tmp_version;
 
889
 
 
890
  system ("touch conf.gtktest");
 
891
 
 
892
  /* HP/UX 9 (%@#!) writes to sscanf strings */
 
893
  tmp_version = g_strdup("$min_gtk_version");
 
894
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
 
895
     printf("%s, bad version string\n", "$min_gtk_version");
 
896
     exit(1);
 
897
   }
 
898
 
 
899
  if ((gtk_major_version != $gtk_config_major_version) ||
 
900
      (gtk_minor_version != $gtk_config_minor_version) ||
 
901
      (gtk_micro_version != $gtk_config_micro_version))
 
902
    {
 
903
      printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
 
904
             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
 
905
             gtk_major_version, gtk_minor_version, gtk_micro_version);
 
906
      printf ("*** was found! If pkg-config was correct, then it is best\n");
 
907
      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
 
908
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
 
909
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
 
910
      printf("*** required on your system.\n");
 
911
      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
 
912
      printf("*** to point to the correct configuration files\n");
 
913
    } 
 
914
  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
 
915
           (gtk_minor_version != GTK_MINOR_VERSION) ||
 
916
           (gtk_micro_version != GTK_MICRO_VERSION))
 
917
    {
 
918
      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
 
919
             GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
 
920
      printf("*** library (version %d.%d.%d)\n",
 
921
             gtk_major_version, gtk_minor_version, gtk_micro_version);
 
922
    }
 
923
  else
 
924
    {
 
925
      if ((gtk_major_version > major) ||
 
926
        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
 
927
        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
 
928
      {
 
929
        return 0;
 
930
       }
 
931
     else
 
932
      {
 
933
        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
 
934
               gtk_major_version, gtk_minor_version, gtk_micro_version);
 
935
        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
 
936
               major, minor, micro);
 
937
        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
 
938
        printf("***\n");
 
939
        printf("*** If you have already installed a sufficiently new version, this error\n");
 
940
        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
 
941
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
 
942
        printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
 
943
        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
 
944
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
 
945
        printf("*** so that the correct libraries are found at run-time))\n");
 
946
      }
 
947
    }
 
948
  return 1;
 
949
}
 
950
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
 
951
       CFLAGS="$ac_save_CFLAGS"
 
952
       LIBS="$ac_save_LIBS"
 
953
     fi
 
954
  fi
 
955
  if test "x$no_gtk" = x ; then
 
956
     AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
 
957
     ifelse([$2], , :, [$2])     
 
958
  else
 
959
     AC_MSG_RESULT(no)
 
960
     if test "$PKG_CONFIG" = "no" ; then
 
961
       echo "*** A new enough version of pkg-config was not found."
 
962
       echo "*** See http://pkgconfig.sourceforge.net"
 
963
     else
 
964
       if test -f conf.gtktest ; then
 
965
        :
 
966
       else
 
967
          echo "*** Could not run GTK+ test program, checking why..."
 
968
          ac_save_CFLAGS="$CFLAGS"
 
969
          ac_save_LIBS="$LIBS"
 
970
          CFLAGS="$CFLAGS $GTK_CFLAGS"
 
971
          LIBS="$LIBS $GTK_LIBS"
 
972
          AC_TRY_LINK([
 
973
#include <gtk/gtk.h>
 
974
#include <stdio.h>
 
975
],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
 
976
        [ echo "*** The test program compiled, but did not run. This usually means"
 
977
          echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
 
978
          echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
 
979
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
 
980
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
 
981
          echo "*** is required on your system"
 
982
          echo "***"
 
983
          echo "*** If you have an old version installed, it is best to remove it, although"
 
984
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
 
985
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
 
986
          echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
 
987
          CFLAGS="$ac_save_CFLAGS"
 
988
          LIBS="$ac_save_LIBS"
 
989
       fi
 
990
     fi
 
991
     GTK_CFLAGS=""
 
992
     GTK_LIBS=""
 
993
     ifelse([$3], , :, [$3])
 
994
  fi
 
995
  AC_SUBST(GTK_CFLAGS)
 
996
  AC_SUBST(GTK_LIBS)
 
997
  rm -f conf.gtktest
 
998
])
 
999
# Configure paths for GTK+
 
1000
# Owen Taylor     97-11-3
 
1001
 
 
1002
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
 
1003
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
 
1004
dnl
 
1005
AC_DEFUN(AM_PATH_GTK,
 
1006
[dnl 
 
1007
dnl Get the cflags and libraries from the gtk-config script
 
1008
dnl
 
1009
AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
 
1010
            gtk_config_prefix="$withval", gtk_config_prefix="")
 
1011
AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
 
1012
            gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
 
1013
AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
 
1014
                    , enable_gtktest=yes)
 
1015
 
 
1016
  for module in . $4
 
1017
  do
 
1018
      case "$module" in
 
1019
         gthread) 
 
1020
             gtk_config_args="$gtk_config_args gthread"
 
1021
         ;;
 
1022
      esac
 
1023
  done
 
1024
 
 
1025
  if test x$gtk_config_exec_prefix != x ; then
 
1026
     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
 
1027
     if test x${GTK_CONFIG+set} != xset ; then
 
1028
        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
 
1029
     fi
 
1030
  fi
 
1031
  if test x$gtk_config_prefix != x ; then
 
1032
     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
 
1033
     if test x${GTK_CONFIG+set} != xset ; then
 
1034
        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
 
1035
     fi
 
1036
  fi
 
1037
 
 
1038
  AC_PATH_PROGS(GTK_CONFIG, gtk-config gtk12-config gtk13-config, no)
 
1039
  min_gtk_version=ifelse([$1], ,0.99.7,$1)
 
1040
  AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
 
1041
  no_gtk=""
 
1042
  if test "$GTK_CONFIG" = "no" ; then
 
1043
    no_gtk=yes
 
1044
  else
 
1045
    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
 
1046
    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
 
1047
    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
 
1048
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
 
1049
    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
 
1050
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
 
1051
    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
 
1052
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
 
1053
    if test "x$enable_gtktest" = "xyes" ; then
 
1054
      ac_save_CFLAGS="$CFLAGS"
 
1055
      ac_save_LIBS="$LIBS"
 
1056
      CFLAGS="$CFLAGS $GTK_CFLAGS"
 
1057
      LIBS="$GTK_LIBS $LIBS"
 
1058
dnl
 
1059
dnl Now check if the installed GTK is sufficiently new. (Also sanity
 
1060
dnl checks the results of gtk-config to some extent
 
1061
dnl
 
1062
      rm -f conf.gtktest
 
1063
      AC_TRY_RUN([
 
1064
#include <gtk/gtk.h>
 
1065
#include <stdio.h>
 
1066
#include <stdlib.h>
 
1067
 
 
1068
int 
 
1069
main ()
 
1070
{
 
1071
  int major, minor, micro;
 
1072
  char *tmp_version;
 
1073
 
 
1074
  system ("touch conf.gtktest");
 
1075
 
 
1076
  /* HP/UX 9 (%@#!) writes to sscanf strings */
 
1077
  tmp_version = g_strdup("$min_gtk_version");
 
1078
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
 
1079
     printf("%s, bad version string\n", "$min_gtk_version");
 
1080
     exit(1);
 
1081
   }
 
1082
 
 
1083
  if ((gtk_major_version != $gtk_config_major_version) ||
 
1084
      (gtk_minor_version != $gtk_config_minor_version) ||
 
1085
      (gtk_micro_version != $gtk_config_micro_version))
 
1086
    {
 
1087
      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
 
1088
             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
 
1089
             gtk_major_version, gtk_minor_version, gtk_micro_version);
 
1090
      printf ("*** was found! If gtk-config was correct, then it is best\n");
 
1091
      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
 
1092
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
 
1093
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
 
1094
      printf("*** required on your system.\n");
 
1095
      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
 
1096
      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
 
1097
      printf("*** before re-running configure\n");
 
1098
    } 
 
1099
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
 
1100
  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
 
1101
           (gtk_minor_version != GTK_MINOR_VERSION) ||
 
1102
           (gtk_micro_version != GTK_MICRO_VERSION))
 
1103
    {
 
1104
      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
 
1105
             GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
 
1106
      printf("*** library (version %d.%d.%d)\n",
 
1107
             gtk_major_version, gtk_minor_version, gtk_micro_version);
 
1108
    }
 
1109
#endif /* defined (GTK_MAJOR_VERSION) ... */
 
1110
  else
 
1111
    {
 
1112
      if ((gtk_major_version > major) ||
 
1113
        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
 
1114
        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
 
1115
      {
 
1116
        return 0;
 
1117
       }
 
1118
     else
 
1119
      {
 
1120
        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
 
1121
               gtk_major_version, gtk_minor_version, gtk_micro_version);
 
1122
        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
 
1123
               major, minor, micro);
 
1124
        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
 
1125
        printf("***\n");
 
1126
        printf("*** If you have already installed a sufficiently new version, this error\n");
 
1127
        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
 
1128
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
 
1129
        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
 
1130
        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
 
1131
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
 
1132
        printf("*** so that the correct libraries are found at run-time))\n");
 
1133
      }
 
1134
    }
 
1135
  return 1;
 
1136
}
 
1137
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
 
1138
       CFLAGS="$ac_save_CFLAGS"
 
1139
       LIBS="$ac_save_LIBS"
 
1140
     fi
 
1141
  fi
 
1142
  if test "x$no_gtk" = x ; then
 
1143
     AC_MSG_RESULT(yes)
 
1144
     ifelse([$2], , :, [$2])     
 
1145
  else
 
1146
     AC_MSG_RESULT(no)
 
1147
     if test "$GTK_CONFIG" = "no" ; then
 
1148
       echo "*** The gtk-config script installed by GTK could not be found"
 
1149
       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
 
1150
       echo "*** your path, or set the GTK_CONFIG environment variable to the"
 
1151
       echo "*** full path to gtk-config."
 
1152
     else
 
1153
       if test -f conf.gtktest ; then
 
1154
        :
 
1155
       else
 
1156
          echo "*** Could not run GTK test program, checking why..."
 
1157
          CFLAGS="$CFLAGS $GTK_CFLAGS"
 
1158
          LIBS="$LIBS $GTK_LIBS"
 
1159
          AC_TRY_LINK([
 
1160
#include <gtk/gtk.h>
 
1161
#include <stdio.h>
 
1162
],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
 
1163
        [ echo "*** The test program compiled, but did not run. This usually means"
 
1164
          echo "*** that the run-time linker is not finding GTK or finding the wrong"
 
1165
          echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
 
1166
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
 
1167
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
 
1168
          echo "*** is required on your system"
 
1169
          echo "***"
 
1170
          echo "*** If you have an old version installed, it is best to remove it, although"
 
1171
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
 
1172
          echo "***"
 
1173
          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
 
1174
          echo "*** came with the system with the command"
 
1175
          echo "***"
 
1176
          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
 
1177
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
 
1178
          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
 
1179
          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
 
1180
          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
 
1181
          CFLAGS="$ac_save_CFLAGS"
 
1182
          LIBS="$ac_save_LIBS"
 
1183
       fi
 
1184
     fi
 
1185
     GTK_CFLAGS=""
 
1186
     GTK_LIBS=""
 
1187
     ifelse([$3], , :, [$3])
 
1188
  fi
 
1189
  AC_SUBST(GTK_CFLAGS)
 
1190
  AC_SUBST(GTK_LIBS)
 
1191
  rm -f conf.gtktest
 
1192
])
 
1193
 
 
1194
# Do all the work for Automake.                            -*- Autoconf -*-
 
1195
 
 
1196
# This macro actually does too much some checks are only needed if
 
1197
# your package does certain things.  But this isn't really a big deal.
 
1198
 
 
1199
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
 
1200
# Free Software Foundation, Inc.
 
1201
 
 
1202
# This program is free software; you can redistribute it and/or modify
 
1203
# it under the terms of the GNU General Public License as published by
 
1204
# the Free Software Foundation; either version 2, or (at your option)
 
1205
# any later version.
 
1206
 
 
1207
# This program is distributed in the hope that it will be useful,
 
1208
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1209
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1210
# GNU General Public License for more details.
 
1211
 
 
1212
# You should have received a copy of the GNU General Public License
 
1213
# along with this program; if not, write to the Free Software
 
1214
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1215
# 02111-1307, USA.
 
1216
 
 
1217
# serial 10
 
1218
 
 
1219
AC_PREREQ([2.54])
 
1220
 
 
1221
# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
 
1222
# the ones we care about.
 
1223
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
 
1224
 
 
1225
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
 
1226
# AM_INIT_AUTOMAKE([OPTIONS])
 
1227
# -----------------------------------------------
 
1228
# The call with PACKAGE and VERSION arguments is the old style
 
1229
# call (pre autoconf-2.50), which is being phased out.  PACKAGE
 
1230
# and VERSION should now be passed to AC_INIT and removed from
 
1231
# the call to AM_INIT_AUTOMAKE.
 
1232
# We support both call styles for the transition.  After
 
1233
# the next Automake release, Autoconf can make the AC_INIT
 
1234
# arguments mandatory, and then we can depend on a new Autoconf
 
1235
# release and drop the old call support.
 
1236
AC_DEFUN([AM_INIT_AUTOMAKE],
 
1237
[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
 
1238
 AC_REQUIRE([AC_PROG_INSTALL])dnl
 
1239
# test to see if srcdir already configured
 
1240
if test "`cd $srcdir && pwd`" != "`pwd`" &&
 
1241
   test -f $srcdir/config.status; then
 
1242
  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
 
1243
fi
 
1244
 
 
1245
# test whether we have cygpath
 
1246
if test -z "$CYGPATH_W"; then
 
1247
  if (cygpath --version) >/dev/null 2>/dev/null; then
 
1248
    CYGPATH_W='cygpath -w'
 
1249
  else
 
1250
    CYGPATH_W=echo
 
1251
  fi
 
1252
fi
 
1253
AC_SUBST([CYGPATH_W])
 
1254
 
 
1255
# Define the identity of the package.
 
1256
dnl Distinguish between old-style and new-style calls.
 
1257
m4_ifval([$2],
 
1258
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
 
1259
 AC_SUBST([PACKAGE], [$1])dnl
 
1260
 AC_SUBST([VERSION], [$2])],
 
1261
[_AM_SET_OPTIONS([$1])dnl
 
1262
 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
 
1263
 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
 
1264
 
 
1265
_AM_IF_OPTION([no-define],,
 
1266
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
 
1267
 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
 
1268
 
 
1269
# Some tools Automake needs.
 
1270
AC_REQUIRE([AM_SANITY_CHECK])dnl
 
1271
AC_REQUIRE([AC_ARG_PROGRAM])dnl
 
1272
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
 
1273
AM_MISSING_PROG(AUTOCONF, autoconf)
 
1274
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
 
1275
AM_MISSING_PROG(AUTOHEADER, autoheader)
 
1276
AM_MISSING_PROG(MAKEINFO, makeinfo)
 
1277
AM_MISSING_PROG(AMTAR, tar)
 
1278
AM_PROG_INSTALL_SH
 
1279
AM_PROG_INSTALL_STRIP
 
1280
# We need awk for the "check" target.  The system "awk" is bad on
 
1281
# some platforms.
 
1282
AC_REQUIRE([AC_PROG_AWK])dnl
 
1283
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 
1284
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 
1285
 
 
1286
_AM_IF_OPTION([no-dependencies],,
 
1287
[AC_PROVIDE_IFELSE([AC_PROG_CC],
 
1288
                  [_AM_DEPENDENCIES(CC)],
 
1289
                  [define([AC_PROG_CC],
 
1290
                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
 
1291
AC_PROVIDE_IFELSE([AC_PROG_CXX],
 
1292
                  [_AM_DEPENDENCIES(CXX)],
 
1293
                  [define([AC_PROG_CXX],
 
1294
                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
 
1295
])
 
1296
])
 
1297
 
 
1298
 
 
1299
# When config.status generates a header, we must update the stamp-h file.
 
1300
# This file resides in the same directory as the config header
 
1301
# that is generated.  The stamp files are numbered to have different names.
 
1302
 
 
1303
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
 
1304
# loop where config.status creates the headers, so we can generate
 
1305
# our stamp files there.
 
1306
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
 
1307
[# Compute $1's index in $config_headers.
 
1308
_am_stamp_count=1
 
1309
for _am_header in $config_headers :; do
 
1310
  case $_am_header in
 
1311
    $1 | $1:* )
 
1312
      break ;;
 
1313
    * )
 
1314
      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
 
1315
  esac
 
1316
done
 
1317
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
 
1318
 
 
1319
# Copyright 2002  Free Software Foundation, Inc.
 
1320
 
 
1321
# This program is free software; you can redistribute it and/or modify
 
1322
# it under the terms of the GNU General Public License as published by
 
1323
# the Free Software Foundation; either version 2, or (at your option)
 
1324
# any later version.
 
1325
 
 
1326
# This program is distributed in the hope that it will be useful,
 
1327
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1328
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1329
# GNU General Public License for more details.
 
1330
 
 
1331
# You should have received a copy of the GNU General Public License
 
1332
# along with this program; if not, write to the Free Software
 
1333
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1334
 
 
1335
# AM_AUTOMAKE_VERSION(VERSION)
 
1336
# ----------------------------
 
1337
# Automake X.Y traces this macro to ensure aclocal.m4 has been
 
1338
# generated from the m4 files accompanying Automake X.Y.
 
1339
AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
 
1340
 
 
1341
# AM_SET_CURRENT_AUTOMAKE_VERSION
 
1342
# -------------------------------
 
1343
# Call AM_AUTOMAKE_VERSION so it can be traced.
 
1344
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
 
1345
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
 
1346
         [AM_AUTOMAKE_VERSION([1.7.4])])
 
1347
 
 
1348
# Helper functions for option handling.                    -*- Autoconf -*-
 
1349
 
 
1350
# Copyright 2001, 2002  Free Software Foundation, Inc.
 
1351
 
 
1352
# This program is free software; you can redistribute it and/or modify
 
1353
# it under the terms of the GNU General Public License as published by
 
1354
# the Free Software Foundation; either version 2, or (at your option)
 
1355
# any later version.
 
1356
 
 
1357
# This program is distributed in the hope that it will be useful,
 
1358
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1359
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1360
# GNU General Public License for more details.
 
1361
 
 
1362
# You should have received a copy of the GNU General Public License
 
1363
# along with this program; if not, write to the Free Software
 
1364
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1365
# 02111-1307, USA.
 
1366
 
 
1367
# serial 2
 
1368
 
 
1369
# _AM_MANGLE_OPTION(NAME)
 
1370
# -----------------------
 
1371
AC_DEFUN([_AM_MANGLE_OPTION],
 
1372
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
 
1373
 
 
1374
# _AM_SET_OPTION(NAME)
 
1375
# ------------------------------
 
1376
# Set option NAME.  Presently that only means defining a flag for this option.
 
1377
AC_DEFUN([_AM_SET_OPTION],
 
1378
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
 
1379
 
 
1380
# _AM_SET_OPTIONS(OPTIONS)
 
1381
# ----------------------------------
 
1382
# OPTIONS is a space-separated list of Automake options.
 
1383
AC_DEFUN([_AM_SET_OPTIONS],
 
1384
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
 
1385
 
 
1386
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
 
1387
# -------------------------------------------
 
1388
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
 
1389
AC_DEFUN([_AM_IF_OPTION],
 
1390
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
1391
 
 
1392
#
 
1393
# Check to make sure that the build environment is sane.
 
1394
#
 
1395
 
 
1396
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
 
1397
 
 
1398
# This program is free software; you can redistribute it and/or modify
 
1399
# it under the terms of the GNU General Public License as published by
 
1400
# the Free Software Foundation; either version 2, or (at your option)
 
1401
# any later version.
 
1402
 
 
1403
# This program is distributed in the hope that it will be useful,
 
1404
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1405
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1406
# GNU General Public License for more details.
 
1407
 
 
1408
# You should have received a copy of the GNU General Public License
 
1409
# along with this program; if not, write to the Free Software
 
1410
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1411
# 02111-1307, USA.
 
1412
 
 
1413
# serial 3
 
1414
 
 
1415
# AM_SANITY_CHECK
 
1416
# ---------------
 
1417
AC_DEFUN([AM_SANITY_CHECK],
 
1418
[AC_MSG_CHECKING([whether build environment is sane])
 
1419
# Just in case
 
1420
sleep 1
 
1421
echo timestamp > conftest.file
 
1422
# Do `set' in a subshell so we don't clobber the current shell's
 
1423
# arguments.  Must try -L first in case configure is actually a
 
1424
# symlink; some systems play weird games with the mod time of symlinks
 
1425
# (eg FreeBSD returns the mod time of the symlink's containing
 
1426
# directory).
 
1427
if (
 
1428
   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
 
1429
   if test "$[*]" = "X"; then
 
1430
      # -L didn't work.
 
1431
      set X `ls -t $srcdir/configure conftest.file`
 
1432
   fi
 
1433
   rm -f conftest.file
 
1434
   if test "$[*]" != "X $srcdir/configure conftest.file" \
 
1435
      && test "$[*]" != "X conftest.file $srcdir/configure"; then
 
1436
 
 
1437
      # If neither matched, then we have a broken ls.  This can happen
 
1438
      # if, for instance, CONFIG_SHELL is bash and it inherits a
 
1439
      # broken ls alias from the environment.  This has actually
 
1440
      # happened.  Such a system could not be considered "sane".
 
1441
      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
 
1442
alias in your environment])
 
1443
   fi
 
1444
 
 
1445
   test "$[2]" = conftest.file
 
1446
   )
 
1447
then
 
1448
   # Ok.
 
1449
   :
 
1450
else
 
1451
   AC_MSG_ERROR([newly created file is older than distributed files!
 
1452
Check your system clock])
 
1453
fi
 
1454
AC_MSG_RESULT(yes)])
 
1455
 
 
1456
#  -*- Autoconf -*-
 
1457
 
 
1458
 
 
1459
# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
 
1460
 
 
1461
# This program is free software; you can redistribute it and/or modify
 
1462
# it under the terms of the GNU General Public License as published by
 
1463
# the Free Software Foundation; either version 2, or (at your option)
 
1464
# any later version.
 
1465
 
 
1466
# This program is distributed in the hope that it will be useful,
 
1467
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1468
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1469
# GNU General Public License for more details.
 
1470
 
 
1471
# You should have received a copy of the GNU General Public License
 
1472
# along with this program; if not, write to the Free Software
 
1473
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1474
# 02111-1307, USA.
 
1475
 
 
1476
# serial 3
 
1477
 
 
1478
# AM_MISSING_PROG(NAME, PROGRAM)
 
1479
# ------------------------------
 
1480
AC_DEFUN([AM_MISSING_PROG],
 
1481
[AC_REQUIRE([AM_MISSING_HAS_RUN])
 
1482
$1=${$1-"${am_missing_run}$2"}
 
1483
AC_SUBST($1)])
 
1484
 
 
1485
 
 
1486
# AM_MISSING_HAS_RUN
 
1487
# ------------------
 
1488
# Define MISSING if not defined so far and test if it supports --run.
 
1489
# If it does, set am_missing_run to use it, otherwise, to nothing.
 
1490
AC_DEFUN([AM_MISSING_HAS_RUN],
 
1491
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 
1492
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
 
1493
# Use eval to expand $SHELL
 
1494
if eval "$MISSING --run true"; then
 
1495
  am_missing_run="$MISSING --run "
 
1496
else
 
1497
  am_missing_run=
 
1498
  AC_MSG_WARN([`missing' script is too old or missing])
 
1499
fi
 
1500
])
 
1501
 
 
1502
# AM_AUX_DIR_EXPAND
 
1503
 
 
1504
# Copyright 2001 Free Software Foundation, Inc.
 
1505
 
 
1506
# This program is free software; you can redistribute it and/or modify
 
1507
# it under the terms of the GNU General Public License as published by
 
1508
# the Free Software Foundation; either version 2, or (at your option)
 
1509
# any later version.
 
1510
 
 
1511
# This program is distributed in the hope that it will be useful,
 
1512
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1513
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1514
# GNU General Public License for more details.
 
1515
 
 
1516
# You should have received a copy of the GNU General Public License
 
1517
# along with this program; if not, write to the Free Software
 
1518
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1519
# 02111-1307, USA.
 
1520
 
 
1521
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
 
1522
# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
 
1523
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
 
1524
#
 
1525
# Of course, Automake must honor this variable whenever it calls a
 
1526
# tool from the auxiliary directory.  The problem is that $srcdir (and
 
1527
# therefore $ac_aux_dir as well) can be either absolute or relative,
 
1528
# depending on how configure is run.  This is pretty annoying, since
 
1529
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
 
1530
# source directory, any form will work fine, but in subdirectories a
 
1531
# relative path needs to be adjusted first.
 
1532
#
 
1533
# $ac_aux_dir/missing
 
1534
#    fails when called from a subdirectory if $ac_aux_dir is relative
 
1535
# $top_srcdir/$ac_aux_dir/missing
 
1536
#    fails if $ac_aux_dir is absolute,
 
1537
#    fails when called from a subdirectory in a VPATH build with
 
1538
#          a relative $ac_aux_dir
 
1539
#
 
1540
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
 
1541
# are both prefixed by $srcdir.  In an in-source build this is usually
 
1542
# harmless because $srcdir is `.', but things will broke when you
 
1543
# start a VPATH build or use an absolute $srcdir.
 
1544
#
 
1545
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
 
1546
# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
 
1547
#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
 
1548
# and then we would define $MISSING as
 
1549
#   MISSING="\${SHELL} $am_aux_dir/missing"
 
1550
# This will work as long as MISSING is not called from configure, because
 
1551
# unfortunately $(top_srcdir) has no meaning in configure.
 
1552
# However there are other variables, like CC, which are often used in
 
1553
# configure, and could therefore not use this "fixed" $ac_aux_dir.
 
1554
#
 
1555
# Another solution, used here, is to always expand $ac_aux_dir to an
 
1556
# absolute PATH.  The drawback is that using absolute paths prevent a
 
1557
# configured tree to be moved without reconfiguration.
 
1558
 
 
1559
# Rely on autoconf to set up CDPATH properly.
 
1560
AC_PREREQ([2.50])
 
1561
 
 
1562
AC_DEFUN([AM_AUX_DIR_EXPAND], [
 
1563
# expand $ac_aux_dir to an absolute path
 
1564
am_aux_dir=`cd $ac_aux_dir && pwd`
 
1565
])
 
1566
 
 
1567
# AM_PROG_INSTALL_SH
 
1568
# ------------------
 
1569
# Define $install_sh.
 
1570
 
 
1571
# Copyright 2001 Free Software Foundation, Inc.
 
1572
 
 
1573
# This program is free software; you can redistribute it and/or modify
 
1574
# it under the terms of the GNU General Public License as published by
 
1575
# the Free Software Foundation; either version 2, or (at your option)
 
1576
# any later version.
 
1577
 
 
1578
# This program is distributed in the hope that it will be useful,
 
1579
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1580
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1581
# GNU General Public License for more details.
 
1582
 
 
1583
# You should have received a copy of the GNU General Public License
 
1584
# along with this program; if not, write to the Free Software
 
1585
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1586
# 02111-1307, USA.
 
1587
 
 
1588
AC_DEFUN([AM_PROG_INSTALL_SH],
 
1589
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 
1590
install_sh=${install_sh-"$am_aux_dir/install-sh"}
 
1591
AC_SUBST(install_sh)])
 
1592
 
 
1593
# AM_PROG_INSTALL_STRIP
 
1594
 
 
1595
# Copyright 2001 Free Software Foundation, Inc.
 
1596
 
 
1597
# This program is free software; you can redistribute it and/or modify
 
1598
# it under the terms of the GNU General Public License as published by
 
1599
# the Free Software Foundation; either version 2, or (at your option)
 
1600
# any later version.
 
1601
 
 
1602
# This program is distributed in the hope that it will be useful,
 
1603
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1604
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1605
# GNU General Public License for more details.
 
1606
 
 
1607
# You should have received a copy of the GNU General Public License
 
1608
# along with this program; if not, write to the Free Software
 
1609
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1610
# 02111-1307, USA.
 
1611
 
 
1612
# One issue with vendor `install' (even GNU) is that you can't
 
1613
# specify the program used to strip binaries.  This is especially
 
1614
# annoying in cross-compiling environments, where the build's strip
 
1615
# is unlikely to handle the host's binaries.
 
1616
# Fortunately install-sh will honor a STRIPPROG variable, so we
 
1617
# always use install-sh in `make install-strip', and initialize
 
1618
# STRIPPROG with the value of the STRIP variable (set by the user).
 
1619
AC_DEFUN([AM_PROG_INSTALL_STRIP],
 
1620
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
 
1621
# Installed binaries are usually stripped using `strip' when the user
 
1622
# run `make install-strip'.  However `strip' might not be the right
 
1623
# tool to use in cross-compilation environments, therefore Automake
 
1624
# will honor the `STRIP' environment variable to overrule this program.
 
1625
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
 
1626
if test "$cross_compiling" != no; then
 
1627
  AC_CHECK_TOOL([STRIP], [strip], :)
 
1628
fi
 
1629
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
 
1630
AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
1631
 
 
1632
#                                                          -*- Autoconf -*-
 
1633
# Copyright (C) 2003  Free Software Foundation, Inc.
 
1634
 
 
1635
# This program is free software; you can redistribute it and/or modify
 
1636
# it under the terms of the GNU General Public License as published by
 
1637
# the Free Software Foundation; either version 2, or (at your option)
 
1638
# any later version.
 
1639
 
 
1640
# This program is distributed in the hope that it will be useful,
 
1641
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1642
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1643
# GNU General Public License for more details.
 
1644
 
 
1645
# You should have received a copy of the GNU General Public License
 
1646
# along with this program; if not, write to the Free Software
 
1647
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1648
# 02111-1307, USA.
 
1649
 
 
1650
# serial 1
 
1651
 
 
1652
# Check whether the underlying file-system supports filenames
 
1653
# with a leading dot.  For instance MS-DOS doesn't.
 
1654
AC_DEFUN([AM_SET_LEADING_DOT],
 
1655
[rm -rf .tst 2>/dev/null
 
1656
mkdir .tst 2>/dev/null
 
1657
if test -d .tst; then
 
1658
  am__leading_dot=.
 
1659
else
 
1660
  am__leading_dot=_
 
1661
fi
 
1662
rmdir .tst 2>/dev/null
 
1663
AC_SUBST([am__leading_dot])])
 
1664
 
 
1665
# serial 5                                              -*- Autoconf -*-
 
1666
 
 
1667
# Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
 
1668
 
 
1669
# This program is free software; you can redistribute it and/or modify
 
1670
# it under the terms of the GNU General Public License as published by
 
1671
# the Free Software Foundation; either version 2, or (at your option)
 
1672
# any later version.
 
1673
 
 
1674
# This program is distributed in the hope that it will be useful,
 
1675
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1676
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1677
# GNU General Public License for more details.
 
1678
 
 
1679
# You should have received a copy of the GNU General Public License
 
1680
# along with this program; if not, write to the Free Software
 
1681
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1682
# 02111-1307, USA.
 
1683
 
 
1684
 
 
1685
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 
1686
# written in clear, in which case automake, when reading aclocal.m4,
 
1687
# will think it sees a *use*, and therefore will trigger all it's
 
1688
# C support machinery.  Also note that it means that autoscan, seeing
 
1689
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
 
1690
 
 
1691
 
 
1692
 
 
1693
# _AM_DEPENDENCIES(NAME)
 
1694
# ----------------------
 
1695
# See how the compiler implements dependency checking.
 
1696
# NAME is "CC", "CXX", "GCJ", or "OBJC".
 
1697
# We try a few techniques and use that to set a single cache variable.
 
1698
#
 
1699
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
 
1700
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
 
1701
# dependency, and given that the user is not expected to run this macro,
 
1702
# just rely on AC_PROG_CC.
 
1703
AC_DEFUN([_AM_DEPENDENCIES],
 
1704
[AC_REQUIRE([AM_SET_DEPDIR])dnl
 
1705
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
 
1706
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
 
1707
AC_REQUIRE([AM_DEP_TRACK])dnl
 
1708
 
 
1709
ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
 
1710
       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
 
1711
       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
 
1712
       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
 
1713
                   [depcc="$$1"   am_compiler_list=])
 
1714
 
 
1715
AC_CACHE_CHECK([dependency style of $depcc],
 
1716
               [am_cv_$1_dependencies_compiler_type],
 
1717
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
 
1718
  # We make a subdir and do the tests there.  Otherwise we can end up
 
1719
  # making bogus files that we don't know about and never remove.  For
 
1720
  # instance it was reported that on HP-UX the gcc test will end up
 
1721
  # making a dummy file named `D' -- because `-MD' means `put the output
 
1722
  # in D'.
 
1723
  mkdir conftest.dir
 
1724
  # Copy depcomp to subdir because otherwise we won't find it if we're
 
1725
  # using a relative directory.
 
1726
  cp "$am_depcomp" conftest.dir
 
1727
  cd conftest.dir
 
1728
 
 
1729
  am_cv_$1_dependencies_compiler_type=none
 
1730
  if test "$am_compiler_list" = ""; then
 
1731
     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
 
1732
  fi
 
1733
  for depmode in $am_compiler_list; do
 
1734
    # We need to recreate these files for each test, as the compiler may
 
1735
    # overwrite some of them when testing with obscure command lines.
 
1736
    # This happens at least with the AIX C compiler.
 
1737
    echo '#include "conftest.h"' > conftest.c
 
1738
    echo 'int i;' > conftest.h
 
1739
    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
 
1740
 
 
1741
    case $depmode in
 
1742
    nosideeffect)
 
1743
      # after this tag, mechanisms are not by side-effect, so they'll
 
1744
      # only be used when explicitly requested
 
1745
      if test "x$enable_dependency_tracking" = xyes; then
 
1746
        continue
 
1747
      else
 
1748
        break
 
1749
      fi
 
1750
      ;;
 
1751
    none) break ;;
 
1752
    esac
 
1753
    # We check with `-c' and `-o' for the sake of the "dashmstdout"
 
1754
    # mode.  It turns out that the SunPro C++ compiler does not properly
 
1755
    # handle `-M -o', and we need to detect this.
 
1756
    if depmode=$depmode \
 
1757
       source=conftest.c object=conftest.o \
 
1758
       depfile=conftest.Po tmpdepfile=conftest.TPo \
 
1759
       $SHELL ./depcomp $depcc -c -o conftest.o conftest.c \
 
1760
         >/dev/null 2>conftest.err &&
 
1761
       grep conftest.h conftest.Po > /dev/null 2>&1 &&
 
1762
       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
 
1763
      # icc doesn't choke on unknown options, it will just issue warnings
 
1764
      # (even with -Werror).  So we grep stderr for any message
 
1765
      # that says an option was ignored.
 
1766
      if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
 
1767
        am_cv_$1_dependencies_compiler_type=$depmode
 
1768
        break
 
1769
      fi
 
1770
    fi
 
1771
  done
 
1772
 
 
1773
  cd ..
 
1774
  rm -rf conftest.dir
 
1775
else
 
1776
  am_cv_$1_dependencies_compiler_type=none
 
1777
fi
 
1778
])
 
1779
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
 
1780
AM_CONDITIONAL([am__fastdep$1], [
 
1781
  test "x$enable_dependency_tracking" != xno \
 
1782
  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
 
1783
])
 
1784
 
 
1785
 
 
1786
# AM_SET_DEPDIR
 
1787
# -------------
 
1788
# Choose a directory name for dependency files.
 
1789
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
 
1790
AC_DEFUN([AM_SET_DEPDIR],
 
1791
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 
1792
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
 
1793
])
 
1794
 
 
1795
 
 
1796
# AM_DEP_TRACK
 
1797
# ------------
 
1798
AC_DEFUN([AM_DEP_TRACK],
 
1799
[AC_ARG_ENABLE(dependency-tracking,
 
1800
[  --disable-dependency-tracking Speeds up one-time builds
 
1801
  --enable-dependency-tracking  Do not reject slow dependency extractors])
 
1802
if test "x$enable_dependency_tracking" != xno; then
 
1803
  am_depcomp="$ac_aux_dir/depcomp"
 
1804
  AMDEPBACKSLASH='\'
 
1805
fi
 
1806
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
 
1807
AC_SUBST([AMDEPBACKSLASH])
 
1808
])
 
1809
 
 
1810
# Generate code to set up dependency tracking.   -*- Autoconf -*-
 
1811
 
 
1812
# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 
1813
 
 
1814
# This program is free software; you can redistribute it and/or modify
 
1815
# it under the terms of the GNU General Public License as published by
 
1816
# the Free Software Foundation; either version 2, or (at your option)
 
1817
# any later version.
 
1818
 
 
1819
# This program is distributed in the hope that it will be useful,
 
1820
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1821
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1822
# GNU General Public License for more details.
 
1823
 
 
1824
# You should have received a copy of the GNU General Public License
 
1825
# along with this program; if not, write to the Free Software
 
1826
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1827
# 02111-1307, USA.
 
1828
 
 
1829
#serial 2
 
1830
 
 
1831
# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
1832
# ------------------------------
 
1833
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 
1834
[for mf in $CONFIG_FILES; do
 
1835
  # Strip MF so we end up with the name of the file.
 
1836
  mf=`echo "$mf" | sed -e 's/:.*$//'`
 
1837
  # Check whether this is an Automake generated Makefile or not.
 
1838
  # We used to match only the files named `Makefile.in', but
 
1839
  # some people rename them; so instead we look at the file content.
 
1840
  # Grep'ing the first line is not enough: some people post-process
 
1841
  # each Makefile.in and add a new line on top of each file to say so.
 
1842
  # So let's grep whole file.
 
1843
  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
 
1844
    dirpart=`AS_DIRNAME("$mf")`
 
1845
  else
 
1846
    continue
 
1847
  fi
 
1848
  grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
 
1849
  # Extract the definition of DEP_FILES from the Makefile without
 
1850
  # running `make'.
 
1851
  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
 
1852
  test -z "$DEPDIR" && continue
 
1853
  # When using ansi2knr, U may be empty or an underscore; expand it
 
1854
  U=`sed -n -e '/^U = / s///p' < "$mf"`
 
1855
  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
 
1856
  # We invoke sed twice because it is the simplest approach to
 
1857
  # changing $(DEPDIR) to its actual value in the expansion.
 
1858
  for file in `sed -n -e '
 
1859
    /^DEP_FILES = .*\\\\$/ {
 
1860
      s/^DEP_FILES = //
 
1861
      :loop
 
1862
        s/\\\\$//
 
1863
        p
 
1864
        n
 
1865
        /\\\\$/ b loop
 
1866
      p
 
1867
    }
 
1868
    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
 
1869
       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
 
1870
    # Make sure the directory exists.
 
1871
    test -f "$dirpart/$file" && continue
 
1872
    fdir=`AS_DIRNAME(["$file"])`
 
1873
    AS_MKDIR_P([$dirpart/$fdir])
 
1874
    # echo "creating $dirpart/$file"
 
1875
    echo '# dummy' > "$dirpart/$file"
 
1876
  done
 
1877
done
 
1878
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
1879
 
 
1880
 
 
1881
# AM_OUTPUT_DEPENDENCY_COMMANDS
 
1882
# -----------------------------
 
1883
# This macro should only be invoked once -- use via AC_REQUIRE.
 
1884
#
 
1885
# This code is only required when automatic dependency tracking
 
1886
# is enabled.  FIXME.  This creates each `.P' file that we will
 
1887
# need in order to bootstrap the dependency handling code.
 
1888
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
1889
[AC_CONFIG_COMMANDS([depfiles],
 
1890
     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
 
1891
     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
 
1892
])
 
1893
 
 
1894
# Check to see how 'make' treats includes.      -*- Autoconf -*-
 
1895
 
 
1896
# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 
1897
 
 
1898
# This program is free software; you can redistribute it and/or modify
 
1899
# it under the terms of the GNU General Public License as published by
 
1900
# the Free Software Foundation; either version 2, or (at your option)
 
1901
# any later version.
 
1902
 
 
1903
# This program is distributed in the hope that it will be useful,
 
1904
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1905
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1906
# GNU General Public License for more details.
 
1907
 
 
1908
# You should have received a copy of the GNU General Public License
 
1909
# along with this program; if not, write to the Free Software
 
1910
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1911
# 02111-1307, USA.
 
1912
 
 
1913
# serial 2
 
1914
 
 
1915
# AM_MAKE_INCLUDE()
 
1916
# -----------------
 
1917
# Check to see how make treats includes.
 
1918
AC_DEFUN([AM_MAKE_INCLUDE],
 
1919
[am_make=${MAKE-make}
 
1920
cat > confinc << 'END'
 
1921
doit:
 
1922
        @echo done
 
1923
END
 
1924
# If we don't find an include directive, just comment out the code.
 
1925
AC_MSG_CHECKING([for style of include used by $am_make])
 
1926
am__include="#"
 
1927
am__quote=
 
1928
_am_result=none
 
1929
# First try GNU make style include.
 
1930
echo "include confinc" > confmf
 
1931
# We grep out `Entering directory' and `Leaving directory'
 
1932
# messages which can occur if `w' ends up in MAKEFLAGS.
 
1933
# In particular we don't look at `^make:' because GNU make might
 
1934
# be invoked under some other name (usually "gmake"), in which
 
1935
# case it prints its new name instead of `make'.
 
1936
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
 
1937
   am__include=include
 
1938
   am__quote=
 
1939
   _am_result=GNU
 
1940
fi
 
1941
# Now try BSD make style include.
 
1942
if test "$am__include" = "#"; then
 
1943
   echo '.include "confinc"' > confmf
 
1944
   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
 
1945
      am__include=.include
 
1946
      am__quote="\""
 
1947
      _am_result=BSD
 
1948
   fi
 
1949
fi
 
1950
AC_SUBST(am__include)
 
1951
AC_SUBST(am__quote)
 
1952
AC_MSG_RESULT($_am_result)
 
1953
rm -f confinc confmf
 
1954
])
 
1955
 
 
1956
# AM_CONDITIONAL                                              -*- Autoconf -*-
 
1957
 
 
1958
# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
 
1959
 
 
1960
# This program is free software; you can redistribute it and/or modify
 
1961
# it under the terms of the GNU General Public License as published by
 
1962
# the Free Software Foundation; either version 2, or (at your option)
 
1963
# any later version.
 
1964
 
 
1965
# This program is distributed in the hope that it will be useful,
 
1966
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1967
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1968
# GNU General Public License for more details.
 
1969
 
 
1970
# You should have received a copy of the GNU General Public License
 
1971
# along with this program; if not, write to the Free Software
 
1972
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1973
# 02111-1307, USA.
 
1974
 
 
1975
# serial 5
 
1976
 
 
1977
AC_PREREQ(2.52)
 
1978
 
 
1979
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
 
1980
# -------------------------------------
 
1981
# Define a conditional.
 
1982
AC_DEFUN([AM_CONDITIONAL],
 
1983
[ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
 
1984
        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
 
1985
AC_SUBST([$1_TRUE])
 
1986
AC_SUBST([$1_FALSE])
 
1987
if $2; then
 
1988
  $1_TRUE=
 
1989
  $1_FALSE='#'
 
1990
else
 
1991
  $1_TRUE='#'
 
1992
  $1_FALSE=
 
1993
fi
 
1994
AC_CONFIG_COMMANDS_PRE(
 
1995
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
 
1996
  AC_MSG_ERROR([conditional "$1" was never defined.
 
1997
Usually this means the macro was only invoked conditionally.])
 
1998
fi])])
 
1999
 
 
2000
# Add --enable-maintainer-mode option to configure.
 
2001
# From Jim Meyering
 
2002
 
 
2003
# Copyright 1996, 1998, 2000, 2001, 2002  Free Software Foundation, Inc.
 
2004
 
 
2005
# This program is free software; you can redistribute it and/or modify
 
2006
# it under the terms of the GNU General Public License as published by
 
2007
# the Free Software Foundation; either version 2, or (at your option)
 
2008
# any later version.
 
2009
 
 
2010
# This program is distributed in the hope that it will be useful,
 
2011
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
2012
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
2013
# GNU General Public License for more details.
 
2014
 
 
2015
# You should have received a copy of the GNU General Public License
 
2016
# along with this program; if not, write to the Free Software
 
2017
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
2018
# 02111-1307, USA.
 
2019
 
 
2020
# serial 2
 
2021
 
 
2022
AC_DEFUN([AM_MAINTAINER_MODE],
 
2023
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
 
2024
  dnl maintainer-mode is disabled by default
 
2025
  AC_ARG_ENABLE(maintainer-mode,
 
2026
[  --enable-maintainer-mode enable make rules and dependencies not useful
 
2027
                          (and sometimes confusing) to the casual installer],
 
2028
      USE_MAINTAINER_MODE=$enableval,
 
2029
      USE_MAINTAINER_MODE=no)
 
2030
  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
 
2031
  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
 
2032
  MAINT=$MAINTAINER_MODE_TRUE
 
2033
  AC_SUBST(MAINT)dnl
 
2034
]
 
2035
)
 
2036
 
 
2037
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
 
2038
 
 
2039
# isc-posix.m4 serial 2 (gettext-0.11.2)
 
2040
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
 
2041
dnl This file is free software, distributed under the terms of the GNU
 
2042
dnl General Public License.  As a special exception to the GNU General
 
2043
dnl Public License, this file may be distributed as part of a program
 
2044
dnl that contains a configuration script generated by Autoconf, under
 
2045
dnl the same distribution terms as the rest of that program.
 
2046
 
 
2047
# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
 
2048
 
 
2049
# This test replaces the one in autoconf.
 
2050
# Currently this macro should have the same name as the autoconf macro
 
2051
# because gettext's gettext.m4 (distributed in the automake package)
 
2052
# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
 
2053
# give these diagnostics:
 
2054
#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
 
2055
#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
 
2056
 
 
2057
undefine([AC_ISC_POSIX])
 
2058
 
 
2059
AC_DEFUN([AC_ISC_POSIX],
 
2060
  [
 
2061
    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
 
2062
    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
 
2063
  ]
 
2064
)
 
2065
 
 
2066
 
 
2067
# Copyright 1996, 1997, 1999, 2000, 2001, 2002  Free Software Foundation, Inc.
 
2068
 
 
2069
# This program is free software; you can redistribute it and/or modify
 
2070
# it under the terms of the GNU General Public License as published by
 
2071
# the Free Software Foundation; either version 2, or (at your option)
 
2072
# any later version.
 
2073
 
 
2074
# This program is distributed in the hope that it will be useful,
 
2075
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
2076
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
2077
# GNU General Public License for more details.
 
2078
 
 
2079
# You should have received a copy of the GNU General Public License
 
2080
# along with this program; if not, write to the Free Software
 
2081
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
2082
# 02111-1307, USA.
 
2083
 
 
2084
# serial 2
 
2085
 
 
2086
# @defmac AC_PROG_CC_STDC
 
2087
# @maindex PROG_CC_STDC
 
2088
# @ovindex CC
 
2089
# If the C compiler in not in ANSI C mode by default, try to add an option
 
2090
# to output variable @code{CC} to make it so.  This macro tries various
 
2091
# options that select ANSI C on some system or another.  It considers the
 
2092
# compiler to be in ANSI C mode if it handles function prototypes correctly.
 
2093
#
 
2094
# If you use this macro, you should check after calling it whether the C
 
2095
# compiler has been set to accept ANSI C; if not, the shell variable
 
2096
# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
 
2097
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
 
2098
# program @code{ansi2knr}, which comes with Ghostscript.
 
2099
# @end defmac
 
2100
 
 
2101
AC_DEFUN([AM_PROG_CC_STDC],
 
2102
[AC_REQUIRE([AC_PROG_CC])
 
2103
AC_BEFORE([$0], [AC_C_INLINE])
 
2104
AC_BEFORE([$0], [AC_C_CONST])
 
2105
dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
 
2106
dnl a magic option to avoid problems with ANSI preprocessor commands
 
2107
dnl like #elif.
 
2108
dnl FIXME: can't do this because then AC_AIX won't work due to a
 
2109
dnl circular dependency.
 
2110
dnl AC_BEFORE([$0], [AC_PROG_CPP])
 
2111
AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
 
2112
AC_CACHE_VAL(am_cv_prog_cc_stdc,
 
2113
[am_cv_prog_cc_stdc=no
 
2114
ac_save_CC="$CC"
 
2115
# Don't try gcc -ansi; that turns off useful extensions and
 
2116
# breaks some systems' header files.
 
2117
# AIX                   -qlanglvl=ansi
 
2118
# Ultrix and OSF/1      -std1
 
2119
# HP-UX 10.20 and later -Ae
 
2120
# HP-UX older versions  -Aa -D_HPUX_SOURCE
 
2121
# SVR4                  -Xc -D__EXTENSIONS__
 
2122
for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 
2123
do
 
2124
  CC="$ac_save_CC $ac_arg"
 
2125
  AC_TRY_COMPILE(
 
2126
[#include <stdarg.h>
 
2127
#include <stdio.h>
 
2128
#include <sys/types.h>
 
2129
#include <sys/stat.h>
 
2130
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 
2131
struct buf { int x; };
 
2132
FILE * (*rcsopen) (struct buf *, struct stat *, int);
 
2133
static char *e (p, i)
 
2134
     char **p;
 
2135
     int i;
 
2136
{
 
2137
  return p[i];
 
2138
}
 
2139
static char *f (char * (*g) (char **, int), char **p, ...)
 
2140
{
 
2141
  char *s;
 
2142
  va_list v;
 
2143
  va_start (v,p);
 
2144
  s = g (p, va_arg (v,int));
 
2145
  va_end (v);
 
2146
  return s;
 
2147
}
 
2148
int test (int i, double x);
 
2149
struct s1 {int (*f) (int a);};
 
2150
struct s2 {int (*f) (double a);};
 
2151
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
 
2152
int argc;
 
2153
char **argv;
 
2154
], [
 
2155
return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
 
2156
],
 
2157
[am_cv_prog_cc_stdc="$ac_arg"; break])
 
2158
done
 
2159
CC="$ac_save_CC"
 
2160
])
 
2161
if test -z "$am_cv_prog_cc_stdc"; then
 
2162
  AC_MSG_RESULT([none needed])
 
2163
else
 
2164
  AC_MSG_RESULT([$am_cv_prog_cc_stdc])
 
2165
fi
 
2166
case "x$am_cv_prog_cc_stdc" in
 
2167
  x|xno) ;;
 
2168
  *) CC="$CC $am_cv_prog_cc_stdc" ;;
 
2169
esac
 
2170
])
 
2171
 
 
2172
AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
 
2173