updated copyright statement
[gpivtools.git] / aclocal.m4
blob5951b3e983af1708e46eb2cf7548e2beeedede59
1 # generated automatically by aclocal 1.9.6 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005  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.
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.
14 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
15
16 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
18 # This program is free software; you can redistribute it and/or modify
19 # it under the terms of the GNU General Public License as published by
20 # the Free Software Foundation; either version 2 of the License, or
21 # (at your option) any later version.
23 # This program is distributed in the hope that it will be useful, but
24 # WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
26 # General Public License for more details.
28 # You should have received a copy of the GNU General Public License
29 # along with this program; if not, write to the Free Software
30 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 # As a special exception to the GNU General Public License, if you
33 # distribute this file as part of a program that contains a
34 # configuration script generated by Autoconf, you may include it under
35 # the same distribution terms that you use for the rest of that program.
37 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
38 # ----------------------------------
39 AC_DEFUN([PKG_PROG_PKG_CONFIG],
40 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
41 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
42 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
43 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
44         AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
46 if test -n "$PKG_CONFIG"; then
47         _pkg_min_version=m4_default([$1], [0.9.0])
48         AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
49         if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
50                 AC_MSG_RESULT([yes])
51         else
52                 AC_MSG_RESULT([no])
53                 PKG_CONFIG=""
54         fi
55                 
56 fi[]dnl
57 ])# PKG_PROG_PKG_CONFIG
59 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
61 # Check to see whether a particular set of modules exists.  Similar
62 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
65 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
66 # this or PKG_CHECK_MODULES is called, or make sure to call
67 # PKG_CHECK_EXISTS manually
68 # --------------------------------------------------------------
69 AC_DEFUN([PKG_CHECK_EXISTS],
70 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
71 if test -n "$PKG_CONFIG" && \
72     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
73   m4_ifval([$2], [$2], [:])
74 m4_ifvaln([$3], [else
75   $3])dnl
76 fi])
79 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
80 # ---------------------------------------------
81 m4_define([_PKG_CONFIG],
82 [if test -n "$PKG_CONFIG"; then
83     if test -n "$$1"; then
84         pkg_cv_[]$1="$$1"
85     else
86         PKG_CHECK_EXISTS([$3],
87                          [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
88                          [pkg_failed=yes])
89     fi
90 else
91         pkg_failed=untried
92 fi[]dnl
93 ])# _PKG_CONFIG
95 # _PKG_SHORT_ERRORS_SUPPORTED
96 # -----------------------------
97 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
98 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
99 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
100         _pkg_short_errors_supported=yes
101 else
102         _pkg_short_errors_supported=no
103 fi[]dnl
104 ])# _PKG_SHORT_ERRORS_SUPPORTED
107 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
108 # [ACTION-IF-NOT-FOUND])
111 # Note that if there is a possibility the first call to
112 # PKG_CHECK_MODULES might not happen, you should be sure to include an
113 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
116 # --------------------------------------------------------------
117 AC_DEFUN([PKG_CHECK_MODULES],
118 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
119 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
120 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
122 pkg_failed=no
123 AC_MSG_CHECKING([for $1])
125 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
126 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
128 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
129 and $1[]_LIBS to avoid the need to call pkg-config.
130 See the pkg-config man page for more details.])
132 if test $pkg_failed = yes; then
133         _PKG_SHORT_ERRORS_SUPPORTED
134         if test $_pkg_short_errors_supported = yes; then
135                 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
136         else 
137                 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
138         fi
139         # Put the nasty error message in config.log where it belongs
140         echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
142         ifelse([$4], , [AC_MSG_ERROR(dnl
143 [Package requirements ($2) were not met:
145 $$1_PKG_ERRORS
147 Consider adjusting the PKG_CONFIG_PATH environment variable if you
148 installed software in a non-standard prefix.
150 _PKG_TEXT
151 ])],
152                 [AC_MSG_RESULT([no])
153                 $4])
154 elif test $pkg_failed = untried; then
155         ifelse([$4], , [AC_MSG_FAILURE(dnl
156 [The pkg-config script could not be found or is too old.  Make sure it
157 is in your PATH or set the PKG_CONFIG environment variable to the full
158 path to pkg-config.
160 _PKG_TEXT
162 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
163                 [$4])
164 else
165         $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
166         $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
167         AC_MSG_RESULT([yes])
168         ifelse([$3], , :, [$3])
169 fi[]dnl
170 ])# PKG_CHECK_MODULES
172 # Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
174 # This file is free software; the Free Software Foundation
175 # gives unlimited permission to copy and/or distribute it,
176 # with or without modifications, as long as this notice is preserved.
178 # AM_AUTOMAKE_VERSION(VERSION)
179 # ----------------------------
180 # Automake X.Y traces this macro to ensure aclocal.m4 has been
181 # generated from the m4 files accompanying Automake X.Y.
182 AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
184 # AM_SET_CURRENT_AUTOMAKE_VERSION
185 # -------------------------------
186 # Call AM_AUTOMAKE_VERSION so it can be traced.
187 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
188 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
189          [AM_AUTOMAKE_VERSION([1.9.6])])
191 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
193 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
195 # This file is free software; the Free Software Foundation
196 # gives unlimited permission to copy and/or distribute it,
197 # with or without modifications, as long as this notice is preserved.
199 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
200 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
201 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
203 # Of course, Automake must honor this variable whenever it calls a
204 # tool from the auxiliary directory.  The problem is that $srcdir (and
205 # therefore $ac_aux_dir as well) can be either absolute or relative,
206 # depending on how configure is run.  This is pretty annoying, since
207 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
208 # source directory, any form will work fine, but in subdirectories a
209 # relative path needs to be adjusted first.
211 # $ac_aux_dir/missing
212 #    fails when called from a subdirectory if $ac_aux_dir is relative
213 # $top_srcdir/$ac_aux_dir/missing
214 #    fails if $ac_aux_dir is absolute,
215 #    fails when called from a subdirectory in a VPATH build with
216 #          a relative $ac_aux_dir
218 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
219 # are both prefixed by $srcdir.  In an in-source build this is usually
220 # harmless because $srcdir is `.', but things will broke when you
221 # start a VPATH build or use an absolute $srcdir.
223 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
224 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
225 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
226 # and then we would define $MISSING as
227 #   MISSING="\${SHELL} $am_aux_dir/missing"
228 # This will work as long as MISSING is not called from configure, because
229 # unfortunately $(top_srcdir) has no meaning in configure.
230 # However there are other variables, like CC, which are often used in
231 # configure, and could therefore not use this "fixed" $ac_aux_dir.
233 # Another solution, used here, is to always expand $ac_aux_dir to an
234 # absolute PATH.  The drawback is that using absolute paths prevent a
235 # configured tree to be moved without reconfiguration.
237 AC_DEFUN([AM_AUX_DIR_EXPAND],
238 [dnl Rely on autoconf to set up CDPATH properly.
239 AC_PREREQ([2.50])dnl
240 # expand $ac_aux_dir to an absolute path
241 am_aux_dir=`cd $ac_aux_dir && pwd`
245 # Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2005
246 # Free Software Foundation, Inc.
248 # This file is free software; the Free Software Foundation
249 # gives unlimited permission to copy and/or distribute it,
250 # with or without modifications, as long as this notice is preserved.
252 # serial 4
254 # This was merged into AC_PROG_CC in Autoconf.
256 AU_DEFUN([AM_PROG_CC_STDC],
257 [AC_PROG_CC
258 AC_DIAGNOSE([obsolete], [$0:
259         your code should no longer depend upon `am_cv_prog_cc_stdc', but upon
260         `ac_cv_prog_cc_stdc'.  Remove this warning and the assignment when
261         you adjust the code.  You can also remove the above call to
262         AC_PROG_CC if you already called it elsewhere.])
263 am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
265 AU_DEFUN([fp_PROG_CC_STDC])
267 # AM_CONDITIONAL                                            -*- Autoconf -*-
269 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
270 # Free Software Foundation, Inc.
272 # This file is free software; the Free Software Foundation
273 # gives unlimited permission to copy and/or distribute it,
274 # with or without modifications, as long as this notice is preserved.
276 # serial 7
278 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
279 # -------------------------------------
280 # Define a conditional.
281 AC_DEFUN([AM_CONDITIONAL],
282 [AC_PREREQ(2.52)dnl
283  ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
284         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
285 AC_SUBST([$1_TRUE])
286 AC_SUBST([$1_FALSE])
287 if $2; then
288   $1_TRUE=
289   $1_FALSE='#'
290 else
291   $1_TRUE='#'
292   $1_FALSE=
294 AC_CONFIG_COMMANDS_PRE(
295 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
296   AC_MSG_ERROR([[conditional "$1" was never defined.
297 Usually this means the macro was only invoked conditionally.]])
298 fi])])
301 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
302 # Free Software Foundation, Inc.
304 # This file is free software; the Free Software Foundation
305 # gives unlimited permission to copy and/or distribute it,
306 # with or without modifications, as long as this notice is preserved.
308 # serial 8
310 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
311 # written in clear, in which case automake, when reading aclocal.m4,
312 # will think it sees a *use*, and therefore will trigger all it's
313 # C support machinery.  Also note that it means that autoscan, seeing
314 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
317 # _AM_DEPENDENCIES(NAME)
318 # ----------------------
319 # See how the compiler implements dependency checking.
320 # NAME is "CC", "CXX", "GCJ", or "OBJC".
321 # We try a few techniques and use that to set a single cache variable.
323 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
324 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
325 # dependency, and given that the user is not expected to run this macro,
326 # just rely on AC_PROG_CC.
327 AC_DEFUN([_AM_DEPENDENCIES],
328 [AC_REQUIRE([AM_SET_DEPDIR])dnl
329 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
330 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
331 AC_REQUIRE([AM_DEP_TRACK])dnl
333 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
334        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
335        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
336        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
337                    [depcc="$$1"   am_compiler_list=])
339 AC_CACHE_CHECK([dependency style of $depcc],
340                [am_cv_$1_dependencies_compiler_type],
341 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
342   # We make a subdir and do the tests there.  Otherwise we can end up
343   # making bogus files that we don't know about and never remove.  For
344   # instance it was reported that on HP-UX the gcc test will end up
345   # making a dummy file named `D' -- because `-MD' means `put the output
346   # in D'.
347   mkdir conftest.dir
348   # Copy depcomp to subdir because otherwise we won't find it if we're
349   # using a relative directory.
350   cp "$am_depcomp" conftest.dir
351   cd conftest.dir
352   # We will build objects and dependencies in a subdirectory because
353   # it helps to detect inapplicable dependency modes.  For instance
354   # both Tru64's cc and ICC support -MD to output dependencies as a
355   # side effect of compilation, but ICC will put the dependencies in
356   # the current directory while Tru64 will put them in the object
357   # directory.
358   mkdir sub
360   am_cv_$1_dependencies_compiler_type=none
361   if test "$am_compiler_list" = ""; then
362      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
363   fi
364   for depmode in $am_compiler_list; do
365     # Setup a source with many dependencies, because some compilers
366     # like to wrap large dependency lists on column 80 (with \), and
367     # we should not choose a depcomp mode which is confused by this.
368     #
369     # We need to recreate these files for each test, as the compiler may
370     # overwrite some of them when testing with obscure command lines.
371     # This happens at least with the AIX C compiler.
372     : > sub/conftest.c
373     for i in 1 2 3 4 5 6; do
374       echo '#include "conftst'$i'.h"' >> sub/conftest.c
375       # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
376       # Solaris 8's {/usr,}/bin/sh.
377       touch sub/conftst$i.h
378     done
379     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
381     case $depmode in
382     nosideeffect)
383       # after this tag, mechanisms are not by side-effect, so they'll
384       # only be used when explicitly requested
385       if test "x$enable_dependency_tracking" = xyes; then
386         continue
387       else
388         break
389       fi
390       ;;
391     none) break ;;
392     esac
393     # We check with `-c' and `-o' for the sake of the "dashmstdout"
394     # mode.  It turns out that the SunPro C++ compiler does not properly
395     # handle `-M -o', and we need to detect this.
396     if depmode=$depmode \
397        source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
398        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
399        $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
400          >/dev/null 2>conftest.err &&
401        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
402        grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
403        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
404       # icc doesn't choke on unknown options, it will just issue warnings
405       # or remarks (even with -Werror).  So we grep stderr for any message
406       # that says an option was ignored or not supported.
407       # When given -MP, icc 7.0 and 7.1 complain thusly:
408       #   icc: Command line warning: ignoring option '-M'; no argument required
409       # The diagnosis changed in icc 8.0:
410       #   icc: Command line remark: option '-MP' not supported
411       if (grep 'ignoring option' conftest.err ||
412           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
413         am_cv_$1_dependencies_compiler_type=$depmode
414         break
415       fi
416     fi
417   done
419   cd ..
420   rm -rf conftest.dir
421 else
422   am_cv_$1_dependencies_compiler_type=none
425 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
426 AM_CONDITIONAL([am__fastdep$1], [
427   test "x$enable_dependency_tracking" != xno \
428   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
432 # AM_SET_DEPDIR
433 # -------------
434 # Choose a directory name for dependency files.
435 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
436 AC_DEFUN([AM_SET_DEPDIR],
437 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
438 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
442 # AM_DEP_TRACK
443 # ------------
444 AC_DEFUN([AM_DEP_TRACK],
445 [AC_ARG_ENABLE(dependency-tracking,
446 [  --disable-dependency-tracking  speeds up one-time build
447   --enable-dependency-tracking   do not reject slow dependency extractors])
448 if test "x$enable_dependency_tracking" != xno; then
449   am_depcomp="$ac_aux_dir/depcomp"
450   AMDEPBACKSLASH='\'
452 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
453 AC_SUBST([AMDEPBACKSLASH])
456 # Generate code to set up dependency tracking.              -*- Autoconf -*-
458 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
459 # Free Software Foundation, Inc.
461 # This file is free software; the Free Software Foundation
462 # gives unlimited permission to copy and/or distribute it,
463 # with or without modifications, as long as this notice is preserved.
465 #serial 3
467 # _AM_OUTPUT_DEPENDENCY_COMMANDS
468 # ------------------------------
469 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
470 [for mf in $CONFIG_FILES; do
471   # Strip MF so we end up with the name of the file.
472   mf=`echo "$mf" | sed -e 's/:.*$//'`
473   # Check whether this is an Automake generated Makefile or not.
474   # We used to match only the files named `Makefile.in', but
475   # some people rename them; so instead we look at the file content.
476   # Grep'ing the first line is not enough: some people post-process
477   # each Makefile.in and add a new line on top of each file to say so.
478   # So let's grep whole file.
479   if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
480     dirpart=`AS_DIRNAME("$mf")`
481   else
482     continue
483   fi
484   # Extract the definition of DEPDIR, am__include, and am__quote
485   # from the Makefile without running `make'.
486   DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
487   test -z "$DEPDIR" && continue
488   am__include=`sed -n 's/^am__include = //p' < "$mf"`
489   test -z "am__include" && continue
490   am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
491   # When using ansi2knr, U may be empty or an underscore; expand it
492   U=`sed -n 's/^U = //p' < "$mf"`
493   # Find all dependency output files, they are included files with
494   # $(DEPDIR) in their names.  We invoke sed twice because it is the
495   # simplest approach to changing $(DEPDIR) to its actual value in the
496   # expansion.
497   for file in `sed -n "
498     s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
499        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
500     # Make sure the directory exists.
501     test -f "$dirpart/$file" && continue
502     fdir=`AS_DIRNAME(["$file"])`
503     AS_MKDIR_P([$dirpart/$fdir])
504     # echo "creating $dirpart/$file"
505     echo '# dummy' > "$dirpart/$file"
506   done
507 done
508 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
511 # AM_OUTPUT_DEPENDENCY_COMMANDS
512 # -----------------------------
513 # This macro should only be invoked once -- use via AC_REQUIRE.
515 # This code is only required when automatic dependency tracking
516 # is enabled.  FIXME.  This creates each `.P' file that we will
517 # need in order to bootstrap the dependency handling code.
518 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
519 [AC_CONFIG_COMMANDS([depfiles],
520      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
521      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
524 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
525 # Free Software Foundation, Inc.
527 # This file is free software; the Free Software Foundation
528 # gives unlimited permission to copy and/or distribute it,
529 # with or without modifications, as long as this notice is preserved.
531 # serial 8
533 # AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
534 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
536 # Do all the work for Automake.                             -*- Autoconf -*-
538 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
539 # Free Software Foundation, Inc.
541 # This file is free software; the Free Software Foundation
542 # gives unlimited permission to copy and/or distribute it,
543 # with or without modifications, as long as this notice is preserved.
545 # serial 12
547 # This macro actually does too much.  Some checks are only needed if
548 # your package does certain things.  But this isn't really a big deal.
550 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
551 # AM_INIT_AUTOMAKE([OPTIONS])
552 # -----------------------------------------------
553 # The call with PACKAGE and VERSION arguments is the old style
554 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
555 # and VERSION should now be passed to AC_INIT and removed from
556 # the call to AM_INIT_AUTOMAKE.
557 # We support both call styles for the transition.  After
558 # the next Automake release, Autoconf can make the AC_INIT
559 # arguments mandatory, and then we can depend on a new Autoconf
560 # release and drop the old call support.
561 AC_DEFUN([AM_INIT_AUTOMAKE],
562 [AC_PREREQ([2.58])dnl
563 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
564 dnl the ones we care about.
565 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
566 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
567 AC_REQUIRE([AC_PROG_INSTALL])dnl
568 # test to see if srcdir already configured
569 if test "`cd $srcdir && pwd`" != "`pwd`" &&
570    test -f $srcdir/config.status; then
571   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
574 # test whether we have cygpath
575 if test -z "$CYGPATH_W"; then
576   if (cygpath --version) >/dev/null 2>/dev/null; then
577     CYGPATH_W='cygpath -w'
578   else
579     CYGPATH_W=echo
580   fi
582 AC_SUBST([CYGPATH_W])
584 # Define the identity of the package.
585 dnl Distinguish between old-style and new-style calls.
586 m4_ifval([$2],
587 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
588  AC_SUBST([PACKAGE], [$1])dnl
589  AC_SUBST([VERSION], [$2])],
590 [_AM_SET_OPTIONS([$1])dnl
591  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
592  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
594 _AM_IF_OPTION([no-define],,
595 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
596  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
598 # Some tools Automake needs.
599 AC_REQUIRE([AM_SANITY_CHECK])dnl
600 AC_REQUIRE([AC_ARG_PROGRAM])dnl
601 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
602 AM_MISSING_PROG(AUTOCONF, autoconf)
603 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
604 AM_MISSING_PROG(AUTOHEADER, autoheader)
605 AM_MISSING_PROG(MAKEINFO, makeinfo)
606 AM_PROG_INSTALL_SH
607 AM_PROG_INSTALL_STRIP
608 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
609 # We need awk for the "check" target.  The system "awk" is bad on
610 # some platforms.
611 AC_REQUIRE([AC_PROG_AWK])dnl
612 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
613 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
614 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
615               [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
616                              [_AM_PROG_TAR([v7])])])
617 _AM_IF_OPTION([no-dependencies],,
618 [AC_PROVIDE_IFELSE([AC_PROG_CC],
619                   [_AM_DEPENDENCIES(CC)],
620                   [define([AC_PROG_CC],
621                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
622 AC_PROVIDE_IFELSE([AC_PROG_CXX],
623                   [_AM_DEPENDENCIES(CXX)],
624                   [define([AC_PROG_CXX],
625                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
630 # When config.status generates a header, we must update the stamp-h file.
631 # This file resides in the same directory as the config header
632 # that is generated.  The stamp files are numbered to have different names.
634 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
635 # loop where config.status creates the headers, so we can generate
636 # our stamp files there.
637 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
638 [# Compute $1's index in $config_headers.
639 _am_stamp_count=1
640 for _am_header in $config_headers :; do
641   case $_am_header in
642     $1 | $1:* )
643       break ;;
644     * )
645       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
646   esac
647 done
648 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
650 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
652 # This file is free software; the Free Software Foundation
653 # gives unlimited permission to copy and/or distribute it,
654 # with or without modifications, as long as this notice is preserved.
656 # AM_PROG_INSTALL_SH
657 # ------------------
658 # Define $install_sh.
659 AC_DEFUN([AM_PROG_INSTALL_SH],
660 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
661 install_sh=${install_sh-"$am_aux_dir/install-sh"}
662 AC_SUBST(install_sh)])
664 # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
666 # This file is free software; the Free Software Foundation
667 # gives unlimited permission to copy and/or distribute it,
668 # with or without modifications, as long as this notice is preserved.
670 # serial 2
672 # Check whether the underlying file-system supports filenames
673 # with a leading dot.  For instance MS-DOS doesn't.
674 AC_DEFUN([AM_SET_LEADING_DOT],
675 [rm -rf .tst 2>/dev/null
676 mkdir .tst 2>/dev/null
677 if test -d .tst; then
678   am__leading_dot=.
679 else
680   am__leading_dot=_
682 rmdir .tst 2>/dev/null
683 AC_SUBST([am__leading_dot])])
685 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
686 # From Jim Meyering
688 # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
689 # Free Software Foundation, Inc.
691 # This file is free software; the Free Software Foundation
692 # gives unlimited permission to copy and/or distribute it,
693 # with or without modifications, as long as this notice is preserved.
695 # serial 4
697 AC_DEFUN([AM_MAINTAINER_MODE],
698 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
699   dnl maintainer-mode is disabled by default
700   AC_ARG_ENABLE(maintainer-mode,
701 [  --enable-maintainer-mode  enable make rules and dependencies not useful
702                           (and sometimes confusing) to the casual installer],
703       USE_MAINTAINER_MODE=$enableval,
704       USE_MAINTAINER_MODE=no)
705   AC_MSG_RESULT([$USE_MAINTAINER_MODE])
706   AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
707   MAINT=$MAINTAINER_MODE_TRUE
708   AC_SUBST(MAINT)dnl
712 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
714 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
716 # Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
718 # This file is free software; the Free Software Foundation
719 # gives unlimited permission to copy and/or distribute it,
720 # with or without modifications, as long as this notice is preserved.
722 # serial 3
724 # AM_MAKE_INCLUDE()
725 # -----------------
726 # Check to see how make treats includes.
727 AC_DEFUN([AM_MAKE_INCLUDE],
728 [am_make=${MAKE-make}
729 cat > confinc << 'END'
730 am__doit:
731         @echo done
732 .PHONY: am__doit
734 # If we don't find an include directive, just comment out the code.
735 AC_MSG_CHECKING([for style of include used by $am_make])
736 am__include="#"
737 am__quote=
738 _am_result=none
739 # First try GNU make style include.
740 echo "include confinc" > confmf
741 # We grep out `Entering directory' and `Leaving directory'
742 # messages which can occur if `w' ends up in MAKEFLAGS.
743 # In particular we don't look at `^make:' because GNU make might
744 # be invoked under some other name (usually "gmake"), in which
745 # case it prints its new name instead of `make'.
746 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
747    am__include=include
748    am__quote=
749    _am_result=GNU
751 # Now try BSD make style include.
752 if test "$am__include" = "#"; then
753    echo '.include "confinc"' > confmf
754    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
755       am__include=.include
756       am__quote="\""
757       _am_result=BSD
758    fi
760 AC_SUBST([am__include])
761 AC_SUBST([am__quote])
762 AC_MSG_RESULT([$_am_result])
763 rm -f confinc confmf
766 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
768 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
769 # Free Software Foundation, Inc.
771 # This file is free software; the Free Software Foundation
772 # gives unlimited permission to copy and/or distribute it,
773 # with or without modifications, as long as this notice is preserved.
775 # serial 4
777 # AM_MISSING_PROG(NAME, PROGRAM)
778 # ------------------------------
779 AC_DEFUN([AM_MISSING_PROG],
780 [AC_REQUIRE([AM_MISSING_HAS_RUN])
781 $1=${$1-"${am_missing_run}$2"}
782 AC_SUBST($1)])
785 # AM_MISSING_HAS_RUN
786 # ------------------
787 # Define MISSING if not defined so far and test if it supports --run.
788 # If it does, set am_missing_run to use it, otherwise, to nothing.
789 AC_DEFUN([AM_MISSING_HAS_RUN],
790 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
791 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
792 # Use eval to expand $SHELL
793 if eval "$MISSING --run true"; then
794   am_missing_run="$MISSING --run "
795 else
796   am_missing_run=
797   AC_MSG_WARN([`missing' script is too old or missing])
801 # Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
803 # This file is free software; the Free Software Foundation
804 # gives unlimited permission to copy and/or distribute it,
805 # with or without modifications, as long as this notice is preserved.
807 # AM_PROG_MKDIR_P
808 # ---------------
809 # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
811 # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
812 # created by `make install' are always world readable, even if the
813 # installer happens to have an overly restrictive umask (e.g. 077).
814 # This was a mistake.  There are at least two reasons why we must not
815 # use `-m 0755':
816 #   - it causes special bits like SGID to be ignored,
817 #   - it may be too restrictive (some setups expect 775 directories).
819 # Do not use -m 0755 and let people choose whatever they expect by
820 # setting umask.
822 # We cannot accept any implementation of `mkdir' that recognizes `-p'.
823 # Some implementations (such as Solaris 8's) are not thread-safe: if a
824 # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
825 # concurrently, both version can detect that a/ is missing, but only
826 # one can create it and the other will error out.  Consequently we
827 # restrict ourselves to GNU make (using the --version option ensures
828 # this.)
829 AC_DEFUN([AM_PROG_MKDIR_P],
830 [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
831   # We used to keeping the `.' as first argument, in order to
832   # allow $(mkdir_p) to be used without argument.  As in
833   #   $(mkdir_p) $(somedir)
834   # where $(somedir) is conditionally defined.  However this is wrong
835   # for two reasons:
836   #  1. if the package is installed by a user who cannot write `.'
837   #     make install will fail,
838   #  2. the above comment should most certainly read
839   #     $(mkdir_p) $(DESTDIR)$(somedir)
840   #     so it does not work when $(somedir) is undefined and
841   #     $(DESTDIR) is not.
842   #  To support the latter case, we have to write
843   #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
844   #  so the `.' trick is pointless.
845   mkdir_p='mkdir -p --'
846 else
847   # On NextStep and OpenStep, the `mkdir' command does not
848   # recognize any option.  It will interpret all options as
849   # directories to create, and then abort because `.' already
850   # exists.
851   for d in ./-p ./--version;
852   do
853     test -d $d && rmdir $d
854   done
855   # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
856   if test -f "$ac_aux_dir/mkinstalldirs"; then
857     mkdir_p='$(mkinstalldirs)'
858   else
859     mkdir_p='$(install_sh) -d'
860   fi
862 AC_SUBST([mkdir_p])])
864 # Helper functions for option handling.                     -*- Autoconf -*-
866 # Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
868 # This file is free software; the Free Software Foundation
869 # gives unlimited permission to copy and/or distribute it,
870 # with or without modifications, as long as this notice is preserved.
872 # serial 3
874 # _AM_MANGLE_OPTION(NAME)
875 # -----------------------
876 AC_DEFUN([_AM_MANGLE_OPTION],
877 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
879 # _AM_SET_OPTION(NAME)
880 # ------------------------------
881 # Set option NAME.  Presently that only means defining a flag for this option.
882 AC_DEFUN([_AM_SET_OPTION],
883 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
885 # _AM_SET_OPTIONS(OPTIONS)
886 # ----------------------------------
887 # OPTIONS is a space-separated list of Automake options.
888 AC_DEFUN([_AM_SET_OPTIONS],
889 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
891 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
892 # -------------------------------------------
893 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
894 AC_DEFUN([_AM_IF_OPTION],
895 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
897 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
899 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
900 # Free Software Foundation, Inc.
902 # This file is free software; the Free Software Foundation
903 # gives unlimited permission to copy and/or distribute it,
904 # with or without modifications, as long as this notice is preserved.
906 # serial 4
908 # AM_SANITY_CHECK
909 # ---------------
910 AC_DEFUN([AM_SANITY_CHECK],
911 [AC_MSG_CHECKING([whether build environment is sane])
912 # Just in case
913 sleep 1
914 echo timestamp > conftest.file
915 # Do `set' in a subshell so we don't clobber the current shell's
916 # arguments.  Must try -L first in case configure is actually a
917 # symlink; some systems play weird games with the mod time of symlinks
918 # (eg FreeBSD returns the mod time of the symlink's containing
919 # directory).
920 if (
921    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
922    if test "$[*]" = "X"; then
923       # -L didn't work.
924       set X `ls -t $srcdir/configure conftest.file`
925    fi
926    rm -f conftest.file
927    if test "$[*]" != "X $srcdir/configure conftest.file" \
928       && test "$[*]" != "X conftest.file $srcdir/configure"; then
930       # If neither matched, then we have a broken ls.  This can happen
931       # if, for instance, CONFIG_SHELL is bash and it inherits a
932       # broken ls alias from the environment.  This has actually
933       # happened.  Such a system could not be considered "sane".
934       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
935 alias in your environment])
936    fi
938    test "$[2]" = conftest.file
939    )
940 then
941    # Ok.
942    :
943 else
944    AC_MSG_ERROR([newly created file is older than distributed files!
945 Check your system clock])
947 AC_MSG_RESULT(yes)])
949 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
951 # This file is free software; the Free Software Foundation
952 # gives unlimited permission to copy and/or distribute it,
953 # with or without modifications, as long as this notice is preserved.
955 # AM_PROG_INSTALL_STRIP
956 # ---------------------
957 # One issue with vendor `install' (even GNU) is that you can't
958 # specify the program used to strip binaries.  This is especially
959 # annoying in cross-compiling environments, where the build's strip
960 # is unlikely to handle the host's binaries.
961 # Fortunately install-sh will honor a STRIPPROG variable, so we
962 # always use install-sh in `make install-strip', and initialize
963 # STRIPPROG with the value of the STRIP variable (set by the user).
964 AC_DEFUN([AM_PROG_INSTALL_STRIP],
965 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
966 # Installed binaries are usually stripped using `strip' when the user
967 # run `make install-strip'.  However `strip' might not be the right
968 # tool to use in cross-compilation environments, therefore Automake
969 # will honor the `STRIP' environment variable to overrule this program.
970 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
971 if test "$cross_compiling" != no; then
972   AC_CHECK_TOOL([STRIP], [strip], :)
974 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
975 AC_SUBST([INSTALL_STRIP_PROGRAM])])
977 # Check how to create a tarball.                            -*- Autoconf -*-
979 # Copyright (C) 2004, 2005  Free Software Foundation, Inc.
981 # This file is free software; the Free Software Foundation
982 # gives unlimited permission to copy and/or distribute it,
983 # with or without modifications, as long as this notice is preserved.
985 # serial 2
987 # _AM_PROG_TAR(FORMAT)
988 # --------------------
989 # Check how to create a tarball in format FORMAT.
990 # FORMAT should be one of `v7', `ustar', or `pax'.
992 # Substitute a variable $(am__tar) that is a command
993 # writing to stdout a FORMAT-tarball containing the directory
994 # $tardir.
995 #     tardir=directory && $(am__tar) > result.tar
997 # Substitute a variable $(am__untar) that extract such
998 # a tarball read from stdin.
999 #     $(am__untar) < result.tar
1000 AC_DEFUN([_AM_PROG_TAR],
1001 [# Always define AMTAR for backward compatibility.
1002 AM_MISSING_PROG([AMTAR], [tar])
1003 m4_if([$1], [v7],
1004      [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1005      [m4_case([$1], [ustar],, [pax],,
1006               [m4_fatal([Unknown tar format])])
1007 AC_MSG_CHECKING([how to create a $1 tar archive])
1008 # Loop over all known methods to create a tar archive until one works.
1009 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1010 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1011 # Do not fold the above two line into one, because Tru64 sh and
1012 # Solaris sh will not grok spaces in the rhs of `-'.
1013 for _am_tool in $_am_tools
1015   case $_am_tool in
1016   gnutar)
1017     for _am_tar in tar gnutar gtar;
1018     do
1019       AM_RUN_LOG([$_am_tar --version]) && break
1020     done
1021     am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1022     am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1023     am__untar="$_am_tar -xf -"
1024     ;;
1025   plaintar)
1026     # Must skip GNU tar: if it does not support --format= it doesn't create
1027     # ustar tarball either.
1028     (tar --version) >/dev/null 2>&1 && continue
1029     am__tar='tar chf - "$$tardir"'
1030     am__tar_='tar chf - "$tardir"'
1031     am__untar='tar xf -'
1032     ;;
1033   pax)
1034     am__tar='pax -L -x $1 -w "$$tardir"'
1035     am__tar_='pax -L -x $1 -w "$tardir"'
1036     am__untar='pax -r'
1037     ;;
1038   cpio)
1039     am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1040     am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1041     am__untar='cpio -i -H $1 -d'
1042     ;;
1043   none)
1044     am__tar=false
1045     am__tar_=false
1046     am__untar=false
1047     ;;
1048   esac
1050   # If the value was cached, stop now.  We just wanted to have am__tar
1051   # and am__untar set.
1052   test -n "${am_cv_prog_tar_$1}" && break
1054   # tar/untar a dummy directory, and stop if the command works
1055   rm -rf conftest.dir
1056   mkdir conftest.dir
1057   echo GrepMe > conftest.dir/file
1058   AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1059   rm -rf conftest.dir
1060   if test -s conftest.tar; then
1061     AM_RUN_LOG([$am__untar <conftest.tar])
1062     grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1063   fi
1064 done
1065 rm -rf conftest.dir
1067 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1068 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1069 AC_SUBST([am__tar])
1070 AC_SUBST([am__untar])
1071 ]) # _AM_PROG_TAR
1073 m4_include([config/acx_mpi.m4])