~ubuntu-branches/ubuntu/lucid/tuxtype/lucid-proposed

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Grawert
  • Date: 2006-10-30 13:48:49 UTC
  • mfrom: (2.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20061030134849-5fdruftday0c02gs
Tags: 1.5.6.dfsg1-3ubuntu1
Merge from debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# aclocal.m4 generated automatically by aclocal 1.5
2
 
 
3
 
# Copyright 1996, 1997, 1998, 1999, 2000, 2001
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
 
# Configure paths for SDL
15
 
# Sam Lantinga 9/21/99
16
 
# stolen from Manish Singh
17
 
# stolen back from Frank Belew
18
 
# stolen from Manish Singh
19
 
# Shamelessly stolen from Owen Taylor
20
 
 
21
 
dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
22
 
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
23
 
dnl
24
 
AC_DEFUN(AM_PATH_SDL,
25
 
[dnl 
26
 
dnl Get the cflags and libraries from the sdl-config script
27
 
dnl
28
 
AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
29
 
            sdl_prefix="$withval", sdl_prefix="")
30
 
AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
31
 
            sdl_exec_prefix="$withval", sdl_exec_prefix="")
32
 
AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
33
 
                    , enable_sdltest=yes)
34
 
 
35
 
  if test x$sdl_exec_prefix != x ; then
36
 
     sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
37
 
     if test x${SDL_CONFIG+set} != xset ; then
38
 
        SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
39
 
     fi
40
 
  fi
41
 
  if test x$sdl_prefix != x ; then
42
 
     sdl_args="$sdl_args --prefix=$sdl_prefix"
43
 
     if test x${SDL_CONFIG+set} != xset ; then
44
 
        SDL_CONFIG=$sdl_prefix/bin/sdl-config
45
 
     fi
46
 
  fi
47
 
 
48
 
  AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
49
 
  min_sdl_version=ifelse([$1], ,0.11.0,$1)
50
 
  AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
51
 
  no_sdl=""
52
 
  if test "$SDL_CONFIG" = "no" ; then
53
 
    no_sdl=yes
54
 
  else
55
 
    SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
56
 
    SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
57
 
 
58
 
    sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
59
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
60
 
    sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
61
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
62
 
    sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
63
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
64
 
    if test "x$enable_sdltest" = "xyes" ; then
65
 
      ac_save_CFLAGS="$CFLAGS"
66
 
      ac_save_LIBS="$LIBS"
67
 
      CFLAGS="$CFLAGS $SDL_CFLAGS"
68
 
      LIBS="$LIBS $SDL_LIBS"
69
 
dnl
70
 
dnl Now check if the installed SDL is sufficiently new. (Also sanity
71
 
dnl checks the results of sdl-config to some extent
72
 
dnl
73
 
      rm -f conf.sdltest
74
 
      AC_TRY_RUN([
75
 
#include <stdio.h>
76
 
#include <stdlib.h>
77
 
#include <string.h>
78
 
#include "SDL.h"
79
 
 
80
 
char*
81
 
my_strdup (char *str)
82
 
{
83
 
  char *new_str;
84
 
  
85
 
  if (str)
86
 
    {
87
 
      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
88
 
      strcpy (new_str, str);
89
 
    }
90
 
  else
91
 
    new_str = NULL;
92
 
  
93
 
  return new_str;
94
 
}
95
 
 
96
 
int main (int argc, char *argv[])
97
 
{
98
 
  int major, minor, micro;
99
 
  char *tmp_version;
100
 
 
101
 
  /* This hangs on some systems (?)
102
 
  system ("touch conf.sdltest");
103
 
  */
104
 
  { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
105
 
 
106
 
  /* HP/UX 9 (%@#!) writes to sscanf strings */
107
 
  tmp_version = my_strdup("$min_sdl_version");
108
 
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
109
 
     printf("%s, bad version string\n", "$min_sdl_version");
110
 
     exit(1);
111
 
   }
112
 
 
113
 
   if (($sdl_major_version > major) ||
114
 
      (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
115
 
      (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
116
 
    {
117
 
      return 0;
118
 
    }
119
 
  else
120
 
    {
121
 
      printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
122
 
      printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
123
 
      printf("*** best to upgrade to the required version.\n");
124
 
      printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
125
 
      printf("*** to point to the correct copy of sdl-config, and remove the file\n");
126
 
      printf("*** config.cache before re-running configure\n");
127
 
      return 1;
128
 
    }
129
 
}
130
 
 
131
 
],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
132
 
       CFLAGS="$ac_save_CFLAGS"
133
 
       LIBS="$ac_save_LIBS"
134
 
     fi
135
 
  fi
136
 
  if test "x$no_sdl" = x ; then
137
 
     AC_MSG_RESULT(yes)
138
 
     ifelse([$2], , :, [$2])     
139
 
  else
140
 
     AC_MSG_RESULT(no)
141
 
     if test "$SDL_CONFIG" = "no" ; then
142
 
       echo "*** The sdl-config script installed by SDL could not be found"
143
 
       echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
144
 
       echo "*** your path, or set the SDL_CONFIG environment variable to the"
145
 
       echo "*** full path to sdl-config."
146
 
     else
147
 
       if test -f conf.sdltest ; then
148
 
        :
149
 
       else
150
 
          echo "*** Could not run SDL test program, checking why..."
151
 
          CFLAGS="$CFLAGS $SDL_CFLAGS"
152
 
          LIBS="$LIBS $SDL_LIBS"
153
 
          AC_TRY_LINK([
154
 
#include <stdio.h>
155
 
#include "SDL.h"
156
 
],      [ return 0; ],
157
 
        [ echo "*** The test program compiled, but did not run. This usually means"
158
 
          echo "*** that the run-time linker is not finding SDL or finding the wrong"
159
 
          echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
160
 
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
161
 
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
162
 
          echo "*** is required on your system"
163
 
          echo "***"
164
 
          echo "*** If you have an old version installed, it is best to remove it, although"
165
 
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
166
 
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
167
 
          echo "*** exact error that occured. This usually means SDL was incorrectly installed"
168
 
          echo "*** or that you have moved SDL since it was installed. In the latter case, you"
169
 
          echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
170
 
          CFLAGS="$ac_save_CFLAGS"
171
 
          LIBS="$ac_save_LIBS"
172
 
       fi
173
 
     fi
174
 
     SDL_CFLAGS=""
175
 
     SDL_LIBS=""
176
 
     ifelse([$3], , :, [$3])
177
 
  fi
178
 
  AC_SUBST(SDL_CFLAGS)
179
 
  AC_SUBST(SDL_LIBS)
180
 
  rm -f conf.sdltest
181
 
])
182
 
 
183
 
# Like AC_CONFIG_HEADER, but automatically create stamp file.
184
 
 
185
 
# serial 3
186
 
 
187
 
# When config.status generates a header, we must update the stamp-h file.
188
 
# This file resides in the same directory as the config header
189
 
# that is generated.  We must strip everything past the first ":",
190
 
# and everything past the last "/".
191
 
 
192
 
AC_PREREQ([2.12])
193
 
 
194
 
AC_DEFUN([AM_CONFIG_HEADER],
195
 
[ifdef([AC_FOREACH],dnl
196
 
         [dnl init our file count if it isn't already
197
 
         m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
198
 
         dnl prepare to store our destination file list for use in config.status
199
 
         AC_FOREACH([_AM_File], [$1],
200
 
                    [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
201
 
                    m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
202
 
                    dnl and add it to the list of files AC keeps track of, along
203
 
                    dnl with our hook
204
 
                    AC_CONFIG_HEADERS(_AM_File,
205
 
dnl COMMANDS, [, INIT-CMDS]
206
 
[# update the timestamp
207
 
echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
208
 
][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
209
 
                    m4_popdef([_AM_Dest])])],dnl
210
 
[AC_CONFIG_HEADER([$1])
211
 
  AC_OUTPUT_COMMANDS(
212
 
   ifelse(patsubst([$1], [[^ ]], []),
213
 
          [],
214
 
          [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
215
 
           patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
216
 
[am_indx=1
217
 
for am_file in $1; do
218
 
  case " \$CONFIG_HEADERS " in
219
 
  *" \$am_file "*)
220
 
    am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
221
 
    if test -n "\$am_dir"; then
222
 
      am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
223
 
      for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
224
 
        am_tmpdir=\$am_tmpdir\$am_subdir/
225
 
        if test ! -d \$am_tmpdir; then
226
 
          mkdir \$am_tmpdir
227
 
        fi
228
 
      done
229
 
    fi
230
 
    echo timestamp > "\$am_dir"stamp-h\$am_indx
231
 
    ;;
232
 
  esac
233
 
  am_indx=\`expr \$am_indx + 1\`
234
 
done])
235
 
])]) # AM_CONFIG_HEADER
236
 
 
237
 
# _AM_DIRNAME(PATH)
238
 
# -----------------
239
 
# Like AS_DIRNAME, only do it during macro expansion
240
 
AC_DEFUN([_AM_DIRNAME],
241
 
       [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
242
 
              m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
243
 
                    m4_if(m4_regexp([$1], [^/.*]), -1,
244
 
                          [.],
245
 
                          m4_patsubst([$1], [^\(/\).*], [\1])),
246
 
                    m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
247
 
              m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
248
 
]) # _AM_DIRNAME
249
 
 
250
 
# Do all the work for Automake.  This macro actually does too much --
251
 
# some checks are only needed if your package does certain things.
252
 
# But this isn't really a big deal.
253
 
 
254
 
# serial 5
255
 
 
256
 
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
257
 
# written in clear, in which case automake, when reading aclocal.m4,
258
 
# will think it sees a *use*, and therefore will trigger all it's
259
 
# C support machinery.  Also note that it means that autoscan, seeing
260
 
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
261
 
 
262
 
 
263
 
# We require 2.13 because we rely on SHELL being computed by configure.
264
 
AC_PREREQ([2.13])
265
 
 
266
 
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
267
 
# -----------------------------------------------------------
268
 
# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
269
 
# The purpose of this macro is to provide the user with a means to
270
 
# check macros which are provided without letting her know how the
271
 
# information is coded.
272
 
# If this macro is not defined by Autoconf, define it here.
273
 
ifdef([AC_PROVIDE_IFELSE],
274
 
      [],
275
 
      [define([AC_PROVIDE_IFELSE],
276
 
              [ifdef([AC_PROVIDE_$1],
277
 
                     [$2], [$3])])])
278
 
 
279
 
 
280
 
# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
281
 
# ----------------------------------------------
282
 
AC_DEFUN([AM_INIT_AUTOMAKE],
283
 
[AC_REQUIRE([AC_PROG_INSTALL])dnl
284
 
# test to see if srcdir already configured
285
 
if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
286
 
   test -f $srcdir/config.status; then
287
 
  AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
288
 
fi
289
 
 
290
 
# Define the identity of the package.
291
 
PACKAGE=$1
292
 
AC_SUBST(PACKAGE)dnl
293
 
VERSION=$2
294
 
AC_SUBST(VERSION)dnl
295
 
ifelse([$3],,
296
 
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
297
 
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
298
 
 
299
 
# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
300
 
# the ones we care about.
301
 
ifdef([m4_pattern_allow],
302
 
      [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
303
 
 
304
 
# Autoconf 2.50 always computes EXEEXT.  However we need to be
305
 
# compatible with 2.13, for now.  So we always define EXEEXT, but we
306
 
# don't compute it.
307
 
AC_SUBST(EXEEXT)
308
 
# Similar for OBJEXT -- only we only use OBJEXT if the user actually
309
 
# requests that it be used.  This is a bit dumb.
310
 
: ${OBJEXT=o}
311
 
AC_SUBST(OBJEXT)
312
 
 
313
 
# Some tools Automake needs.
314
 
AC_REQUIRE([AM_SANITY_CHECK])dnl
315
 
AC_REQUIRE([AC_ARG_PROGRAM])dnl
316
 
AM_MISSING_PROG(ACLOCAL, aclocal)
317
 
AM_MISSING_PROG(AUTOCONF, autoconf)
318
 
AM_MISSING_PROG(AUTOMAKE, automake)
319
 
AM_MISSING_PROG(AUTOHEADER, autoheader)
320
 
AM_MISSING_PROG(MAKEINFO, makeinfo)
321
 
AM_MISSING_PROG(AMTAR, tar)
322
 
AM_PROG_INSTALL_SH
323
 
AM_PROG_INSTALL_STRIP
324
 
# We need awk for the "check" target.  The system "awk" is bad on
325
 
# some platforms.
326
 
AC_REQUIRE([AC_PROG_AWK])dnl
327
 
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
328
 
AC_REQUIRE([AM_DEP_TRACK])dnl
329
 
AC_REQUIRE([AM_SET_DEPDIR])dnl
330
 
AC_PROVIDE_IFELSE([AC_PROG_][CC],
331
 
                  [_AM_DEPENDENCIES(CC)],
332
 
                  [define([AC_PROG_][CC],
333
 
                          defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
334
 
AC_PROVIDE_IFELSE([AC_PROG_][CXX],
335
 
                  [_AM_DEPENDENCIES(CXX)],
336
 
                  [define([AC_PROG_][CXX],
337
 
                          defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
338
 
])
339
 
 
340
 
#
341
 
# Check to make sure that the build environment is sane.
342
 
#
343
 
 
344
 
# serial 3
345
 
 
346
 
# AM_SANITY_CHECK
347
 
# ---------------
348
 
AC_DEFUN([AM_SANITY_CHECK],
349
 
[AC_MSG_CHECKING([whether build environment is sane])
350
 
# Just in case
351
 
sleep 1
352
 
echo timestamp > conftest.file
353
 
# Do `set' in a subshell so we don't clobber the current shell's
354
 
# arguments.  Must try -L first in case configure is actually a
355
 
# symlink; some systems play weird games with the mod time of symlinks
356
 
# (eg FreeBSD returns the mod time of the symlink's containing
357
 
# directory).
358
 
if (
359
 
   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
360
 
   if test "$[*]" = "X"; then
361
 
      # -L didn't work.
362
 
      set X `ls -t $srcdir/configure conftest.file`
363
 
   fi
364
 
   rm -f conftest.file
365
 
   if test "$[*]" != "X $srcdir/configure conftest.file" \
366
 
      && test "$[*]" != "X conftest.file $srcdir/configure"; then
367
 
 
368
 
      # If neither matched, then we have a broken ls.  This can happen
369
 
      # if, for instance, CONFIG_SHELL is bash and it inherits a
370
 
      # broken ls alias from the environment.  This has actually
371
 
      # happened.  Such a system could not be considered "sane".
372
 
      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
373
 
alias in your environment])
374
 
   fi
375
 
 
376
 
   test "$[2]" = conftest.file
377
 
   )
378
 
then
379
 
   # Ok.
380
 
   :
381
 
else
382
 
   AC_MSG_ERROR([newly created file is older than distributed files!
383
 
Check your system clock])
384
 
fi
385
 
AC_MSG_RESULT(yes)])
386
 
 
387
 
 
388
 
# serial 2
389
 
 
390
 
# AM_MISSING_PROG(NAME, PROGRAM)
391
 
# ------------------------------
392
 
AC_DEFUN([AM_MISSING_PROG],
393
 
[AC_REQUIRE([AM_MISSING_HAS_RUN])
394
 
$1=${$1-"${am_missing_run}$2"}
395
 
AC_SUBST($1)])
396
 
 
397
 
 
398
 
# AM_MISSING_HAS_RUN
399
 
# ------------------
400
 
# Define MISSING if not defined so far and test if it supports --run.
401
 
# If it does, set am_missing_run to use it, otherwise, to nothing.
402
 
AC_DEFUN([AM_MISSING_HAS_RUN],
403
 
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
404
 
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
405
 
# Use eval to expand $SHELL
406
 
if eval "$MISSING --run true"; then
407
 
  am_missing_run="$MISSING --run "
408
 
else
409
 
  am_missing_run=
410
 
  am_backtick='`'
411
 
  AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
412
 
fi
413
 
])
414
 
 
415
 
# AM_AUX_DIR_EXPAND
416
 
 
417
 
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
418
 
# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
419
 
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
420
 
#
421
 
# Of course, Automake must honor this variable whenever it calls a
422
 
# tool from the auxiliary directory.  The problem is that $srcdir (and
423
 
# therefore $ac_aux_dir as well) can be either absolute or relative,
424
 
# depending on how configure is run.  This is pretty annoying, since
425
 
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
426
 
# source directory, any form will work fine, but in subdirectories a
427
 
# relative path needs to be adjusted first.
428
 
#
429
 
# $ac_aux_dir/missing
430
 
#    fails when called from a subdirectory if $ac_aux_dir is relative
431
 
# $top_srcdir/$ac_aux_dir/missing
432
 
#    fails if $ac_aux_dir is absolute,
433
 
#    fails when called from a subdirectory in a VPATH build with
434
 
#          a relative $ac_aux_dir
435
 
#
436
 
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
437
 
# are both prefixed by $srcdir.  In an in-source build this is usually
438
 
# harmless because $srcdir is `.', but things will broke when you
439
 
# start a VPATH build or use an absolute $srcdir.
440
 
#
441
 
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
442
 
# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
443
 
#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
444
 
# and then we would define $MISSING as
445
 
#   MISSING="\${SHELL} $am_aux_dir/missing"
446
 
# This will work as long as MISSING is not called from configure, because
447
 
# unfortunately $(top_srcdir) has no meaning in configure.
448
 
# However there are other variables, like CC, which are often used in
449
 
# configure, and could therefore not use this "fixed" $ac_aux_dir.
450
 
#
451
 
# Another solution, used here, is to always expand $ac_aux_dir to an
452
 
# absolute PATH.  The drawback is that using absolute paths prevent a
453
 
# configured tree to be moved without reconfiguration.
454
 
 
455
 
AC_DEFUN([AM_AUX_DIR_EXPAND], [
456
 
# expand $ac_aux_dir to an absolute path
457
 
am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
458
 
])
459
 
 
460
 
# AM_PROG_INSTALL_SH
461
 
# ------------------
462
 
# Define $install_sh.
463
 
AC_DEFUN([AM_PROG_INSTALL_SH],
464
 
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
465
 
install_sh=${install_sh-"$am_aux_dir/install-sh"}
466
 
AC_SUBST(install_sh)])
467
 
 
468
 
# One issue with vendor `install' (even GNU) is that you can't
469
 
# specify the program used to strip binaries.  This is especially
470
 
# annoying in cross-compiling environments, where the build's strip
471
 
# is unlikely to handle the host's binaries.
472
 
# Fortunately install-sh will honor a STRIPPROG variable, so we
473
 
# always use install-sh in `make install-strip', and initialize
474
 
# STRIPPROG with the value of the STRIP variable (set by the user).
475
 
AC_DEFUN([AM_PROG_INSTALL_STRIP],
476
 
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
477
 
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
478
 
AC_SUBST([INSTALL_STRIP_PROGRAM])])
479
 
 
480
 
# serial 4                                              -*- Autoconf -*-
481
 
 
482
 
 
483
 
 
484
 
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
485
 
# written in clear, in which case automake, when reading aclocal.m4,
486
 
# will think it sees a *use*, and therefore will trigger all it's
487
 
# C support machinery.  Also note that it means that autoscan, seeing
488
 
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
489
 
 
490
 
 
491
 
 
492
 
# _AM_DEPENDENCIES(NAME)
493
 
# ---------------------
494
 
# See how the compiler implements dependency checking.
495
 
# NAME is "CC", "CXX" or "OBJC".
496
 
# We try a few techniques and use that to set a single cache variable.
497
 
#
498
 
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
499
 
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
500
 
# dependency, and given that the user is not expected to run this macro,
501
 
# just rely on AC_PROG_CC.
502
 
AC_DEFUN([_AM_DEPENDENCIES],
503
 
[AC_REQUIRE([AM_SET_DEPDIR])dnl
504
 
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
505
 
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
506
 
AC_REQUIRE([AM_DEP_TRACK])dnl
507
 
 
508
 
ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
509
 
       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
510
 
       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
511
 
       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
512
 
                   [depcc="$$1"   am_compiler_list=])
513
 
 
514
 
AC_CACHE_CHECK([dependency style of $depcc],
515
 
               [am_cv_$1_dependencies_compiler_type],
516
 
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
517
 
  # We make a subdir and do the tests there.  Otherwise we can end up
518
 
  # making bogus files that we don't know about and never remove.  For
519
 
  # instance it was reported that on HP-UX the gcc test will end up
520
 
  # making a dummy file named `D' -- because `-MD' means `put the output
521
 
  # in D'.
522
 
  mkdir conftest.dir
523
 
  # Copy depcomp to subdir because otherwise we won't find it if we're
524
 
  # using a relative directory.
525
 
  cp "$am_depcomp" conftest.dir
526
 
  cd conftest.dir
527
 
 
528
 
  am_cv_$1_dependencies_compiler_type=none
529
 
  if test "$am_compiler_list" = ""; then
530
 
     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
531
 
  fi
532
 
  for depmode in $am_compiler_list; do
533
 
    # We need to recreate these files for each test, as the compiler may
534
 
    # overwrite some of them when testing with obscure command lines.
535
 
    # This happens at least with the AIX C compiler.
536
 
    echo '#include "conftest.h"' > conftest.c
537
 
    echo 'int i;' > conftest.h
538
 
    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
539
 
 
540
 
    case $depmode in
541
 
    nosideeffect)
542
 
      # after this tag, mechanisms are not by side-effect, so they'll
543
 
      # only be used when explicitly requested
544
 
      if test "x$enable_dependency_tracking" = xyes; then
545
 
        continue
546
 
      else
547
 
        break
548
 
      fi
549
 
      ;;
550
 
    none) break ;;
551
 
    esac
552
 
    # We check with `-c' and `-o' for the sake of the "dashmstdout"
553
 
    # mode.  It turns out that the SunPro C++ compiler does not properly
554
 
    # handle `-M -o', and we need to detect this.
555
 
    if depmode=$depmode \
556
 
       source=conftest.c object=conftest.o \
557
 
       depfile=conftest.Po tmpdepfile=conftest.TPo \
558
 
       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
559
 
       grep conftest.h conftest.Po > /dev/null 2>&1 &&
560
 
       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
561
 
      am_cv_$1_dependencies_compiler_type=$depmode
562
 
      break
563
 
    fi
564
 
  done
565
 
 
566
 
  cd ..
567
 
  rm -rf conftest.dir
568
 
else
569
 
  am_cv_$1_dependencies_compiler_type=none
570
 
fi
571
 
])
572
 
$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
573
 
AC_SUBST([$1DEPMODE])
574
 
])
575
 
 
576
 
 
577
 
# AM_SET_DEPDIR
578
 
# -------------
579
 
# Choose a directory name for dependency files.
580
 
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
581
 
AC_DEFUN([AM_SET_DEPDIR],
582
 
[rm -f .deps 2>/dev/null
583
 
mkdir .deps 2>/dev/null
584
 
if test -d .deps; then
585
 
  DEPDIR=.deps
586
 
else
587
 
  # MS-DOS does not allow filenames that begin with a dot.
588
 
  DEPDIR=_deps
589
 
fi
590
 
rmdir .deps 2>/dev/null
591
 
AC_SUBST(DEPDIR)
592
 
])
593
 
 
594
 
 
595
 
# AM_DEP_TRACK
596
 
# ------------
597
 
AC_DEFUN([AM_DEP_TRACK],
598
 
[AC_ARG_ENABLE(dependency-tracking,
599
 
[  --disable-dependency-tracking Speeds up one-time builds
600
 
  --enable-dependency-tracking  Do not reject slow dependency extractors])
601
 
if test "x$enable_dependency_tracking" != xno; then
602
 
  am_depcomp="$ac_aux_dir/depcomp"
603
 
  AMDEPBACKSLASH='\'
604
 
fi
605
 
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
606
 
pushdef([subst], defn([AC_SUBST]))
607
 
subst(AMDEPBACKSLASH)
608
 
popdef([subst])
609
 
])
610
 
 
611
 
# Generate code to set up dependency tracking.
612
 
# This macro should only be invoked once -- use via AC_REQUIRE.
613
 
# Usage:
614
 
# AM_OUTPUT_DEPENDENCY_COMMANDS
615
 
 
616
 
#
617
 
# This code is only required when automatic dependency tracking
618
 
# is enabled.  FIXME.  This creates each `.P' file that we will
619
 
# need in order to bootstrap the dependency handling code.
620
 
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
621
 
AC_OUTPUT_COMMANDS([
622
 
test x"$AMDEP_TRUE" != x"" ||
623
 
for mf in $CONFIG_FILES; do
624
 
  case "$mf" in
625
 
  Makefile) dirpart=.;;
626
 
  */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
627
 
  *) continue;;
628
 
  esac
629
 
  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
630
 
  # Extract the definition of DEP_FILES from the Makefile without
631
 
  # running `make'.
632
 
  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
633
 
  test -z "$DEPDIR" && continue
634
 
  # When using ansi2knr, U may be empty or an underscore; expand it
635
 
  U=`sed -n -e '/^U = / s///p' < "$mf"`
636
 
  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
637
 
  # We invoke sed twice because it is the simplest approach to
638
 
  # changing $(DEPDIR) to its actual value in the expansion.
639
 
  for file in `sed -n -e '
640
 
    /^DEP_FILES = .*\\\\$/ {
641
 
      s/^DEP_FILES = //
642
 
      :loop
643
 
        s/\\\\$//
644
 
        p
645
 
        n
646
 
        /\\\\$/ b loop
647
 
      p
648
 
    }
649
 
    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
650
 
       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
651
 
    # Make sure the directory exists.
652
 
    test -f "$dirpart/$file" && continue
653
 
    fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
654
 
    $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
655
 
    # echo "creating $dirpart/$file"
656
 
    echo '# dummy' > "$dirpart/$file"
657
 
  done
658
 
done
659
 
], [AMDEP_TRUE="$AMDEP_TRUE"
660
 
ac_aux_dir="$ac_aux_dir"])])
661
 
 
662
 
# AM_MAKE_INCLUDE()
663
 
# -----------------
664
 
# Check to see how make treats includes.
665
 
AC_DEFUN([AM_MAKE_INCLUDE],
666
 
[am_make=${MAKE-make}
667
 
cat > confinc << 'END'
668
 
doit:
669
 
        @echo done
670
 
END
671
 
# If we don't find an include directive, just comment out the code.
672
 
AC_MSG_CHECKING([for style of include used by $am_make])
673
 
am__include='#'
674
 
am__quote=
675
 
_am_result=none
676
 
# First try GNU make style include.
677
 
echo "include confinc" > confmf
678
 
# We grep out `Entering directory' and `Leaving directory'
679
 
# messages which can occur if `w' ends up in MAKEFLAGS.
680
 
# In particular we don't look at `^make:' because GNU make might
681
 
# be invoked under some other name (usually "gmake"), in which
682
 
# case it prints its new name instead of `make'.
683
 
if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
684
 
   am__include=include
685
 
   am__quote=
686
 
   _am_result=GNU
687
 
fi
688
 
# Now try BSD make style include.
689
 
if test "$am__include" = "#"; then
690
 
   echo '.include "confinc"' > confmf
691
 
   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
692
 
      am__include=.include
693
 
      am__quote='"'
694
 
      _am_result=BSD
695
 
   fi
696
 
fi
697
 
AC_SUBST(am__include)
698
 
AC_SUBST(am__quote)
699
 
AC_MSG_RESULT($_am_result)
700
 
rm -f confinc confmf
701
 
])
702
 
 
703
 
# serial 3
704
 
 
705
 
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
706
 
# -------------------------------------
707
 
# Define a conditional.
708
 
#
709
 
# FIXME: Once using 2.50, use this:
710
 
# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
711
 
AC_DEFUN([AM_CONDITIONAL],
712
 
[ifelse([$1], [TRUE],
713
 
        [errprint(__file__:__line__: [$0: invalid condition: $1
714
 
])dnl
715
 
m4exit(1)])dnl
716
 
ifelse([$1], [FALSE],
717
 
       [errprint(__file__:__line__: [$0: invalid condition: $1
718
 
])dnl
719
 
m4exit(1)])dnl
720
 
AC_SUBST([$1_TRUE])
721
 
AC_SUBST([$1_FALSE])
722
 
if $2; then
723
 
  $1_TRUE=
724
 
  $1_FALSE='#'
725
 
else
726
 
  $1_TRUE='#'
727
 
  $1_FALSE=
728
 
fi])
729