]> rtime.felk.cvut.cz Git - orte.git/blob - aclocal.m4
dc5d34bdf247368a2c3556af83607034ae14ca4e
[orte.git] / aclocal.m4
1 # generated automatically by aclocal 1.7.9 -*- 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 # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
15
16 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
17
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, or (at your option)
21 # any later version.
22
23 # This program is distributed in the hope that it will be useful,
24 # but WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26 # GNU General Public License for more details.
27
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
31 # 02111-1307, USA.
32
33 AC_PREREQ([2.52])
34
35 # serial 6
36
37 # AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
38 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
39
40 # Do all the work for Automake.                            -*- Autoconf -*-
41
42 # This macro actually does too much some checks are only needed if
43 # your package does certain things.  But this isn't really a big deal.
44
45 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
46 # Free Software Foundation, Inc.
47
48 # This program is free software; you can redistribute it and/or modify
49 # it under the terms of the GNU General Public License as published by
50 # the Free Software Foundation; either version 2, or (at your option)
51 # any later version.
52
53 # This program is distributed in the hope that it will be useful,
54 # but WITHOUT ANY WARRANTY; without even the implied warranty of
55 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
56 # GNU General Public License for more details.
57
58 # You should have received a copy of the GNU General Public License
59 # along with this program; if not, write to the Free Software
60 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
61 # 02111-1307, USA.
62
63 # serial 10
64
65 AC_PREREQ([2.54])
66
67 # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
68 # the ones we care about.
69 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
70
71 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
72 # AM_INIT_AUTOMAKE([OPTIONS])
73 # -----------------------------------------------
74 # The call with PACKAGE and VERSION arguments is the old style
75 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
76 # and VERSION should now be passed to AC_INIT and removed from
77 # the call to AM_INIT_AUTOMAKE.
78 # We support both call styles for the transition.  After
79 # the next Automake release, Autoconf can make the AC_INIT
80 # arguments mandatory, and then we can depend on a new Autoconf
81 # release and drop the old call support.
82 AC_DEFUN([AM_INIT_AUTOMAKE],
83 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
84  AC_REQUIRE([AC_PROG_INSTALL])dnl
85 # test to see if srcdir already configured
86 if test "`cd $srcdir && pwd`" != "`pwd`" &&
87    test -f $srcdir/config.status; then
88   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
89 fi
90
91 # test whether we have cygpath
92 if test -z "$CYGPATH_W"; then
93   if (cygpath --version) >/dev/null 2>/dev/null; then
94     CYGPATH_W='cygpath -w'
95   else
96     CYGPATH_W=echo
97   fi
98 fi
99 AC_SUBST([CYGPATH_W])
100
101 # Define the identity of the package.
102 dnl Distinguish between old-style and new-style calls.
103 m4_ifval([$2],
104 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
105  AC_SUBST([PACKAGE], [$1])dnl
106  AC_SUBST([VERSION], [$2])],
107 [_AM_SET_OPTIONS([$1])dnl
108  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
109  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
110
111 _AM_IF_OPTION([no-define],,
112 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
113  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
114
115 # Some tools Automake needs.
116 AC_REQUIRE([AM_SANITY_CHECK])dnl
117 AC_REQUIRE([AC_ARG_PROGRAM])dnl
118 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
119 AM_MISSING_PROG(AUTOCONF, autoconf)
120 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
121 AM_MISSING_PROG(AUTOHEADER, autoheader)
122 AM_MISSING_PROG(MAKEINFO, makeinfo)
123 AM_MISSING_PROG(AMTAR, tar)
124 AM_PROG_INSTALL_SH
125 AM_PROG_INSTALL_STRIP
126 # We need awk for the "check" target.  The system "awk" is bad on
127 # some platforms.
128 AC_REQUIRE([AC_PROG_AWK])dnl
129 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
130 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
131
132 _AM_IF_OPTION([no-dependencies],,
133 [AC_PROVIDE_IFELSE([AC_PROG_CC],
134                   [_AM_DEPENDENCIES(CC)],
135                   [define([AC_PROG_CC],
136                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
137 AC_PROVIDE_IFELSE([AC_PROG_CXX],
138                   [_AM_DEPENDENCIES(CXX)],
139                   [define([AC_PROG_CXX],
140                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
141 ])
142 ])
143
144
145 # When config.status generates a header, we must update the stamp-h file.
146 # This file resides in the same directory as the config header
147 # that is generated.  The stamp files are numbered to have different names.
148
149 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
150 # loop where config.status creates the headers, so we can generate
151 # our stamp files there.
152 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
153 [# Compute $1's index in $config_headers.
154 _am_stamp_count=1
155 for _am_header in $config_headers :; do
156   case $_am_header in
157     $1 | $1:* )
158       break ;;
159     * )
160       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
161   esac
162 done
163 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
164
165 # Copyright 2002  Free Software Foundation, Inc.
166
167 # This program is free software; you can redistribute it and/or modify
168 # it under the terms of the GNU General Public License as published by
169 # the Free Software Foundation; either version 2, or (at your option)
170 # any later version.
171
172 # This program is distributed in the hope that it will be useful,
173 # but WITHOUT ANY WARRANTY; without even the implied warranty of
174 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
175 # GNU General Public License for more details.
176
177 # You should have received a copy of the GNU General Public License
178 # along with this program; if not, write to the Free Software
179 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
180
181 # AM_AUTOMAKE_VERSION(VERSION)
182 # ----------------------------
183 # Automake X.Y traces this macro to ensure aclocal.m4 has been
184 # generated from the m4 files accompanying Automake X.Y.
185 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
186
187 # AM_SET_CURRENT_AUTOMAKE_VERSION
188 # -------------------------------
189 # Call AM_AUTOMAKE_VERSION so it can be traced.
190 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
191 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
192          [AM_AUTOMAKE_VERSION([1.7.9])])
193
194 # Helper functions for option handling.                    -*- Autoconf -*-
195
196 # Copyright 2001, 2002  Free Software Foundation, Inc.
197
198 # This program is free software; you can redistribute it and/or modify
199 # it under the terms of the GNU General Public License as published by
200 # the Free Software Foundation; either version 2, or (at your option)
201 # any later version.
202
203 # This program is distributed in the hope that it will be useful,
204 # but WITHOUT ANY WARRANTY; without even the implied warranty of
205 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
206 # GNU General Public License for more details.
207
208 # You should have received a copy of the GNU General Public License
209 # along with this program; if not, write to the Free Software
210 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
211 # 02111-1307, USA.
212
213 # serial 2
214
215 # _AM_MANGLE_OPTION(NAME)
216 # -----------------------
217 AC_DEFUN([_AM_MANGLE_OPTION],
218 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
219
220 # _AM_SET_OPTION(NAME)
221 # ------------------------------
222 # Set option NAME.  Presently that only means defining a flag for this option.
223 AC_DEFUN([_AM_SET_OPTION],
224 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
225
226 # _AM_SET_OPTIONS(OPTIONS)
227 # ----------------------------------
228 # OPTIONS is a space-separated list of Automake options.
229 AC_DEFUN([_AM_SET_OPTIONS],
230 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
231
232 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
233 # -------------------------------------------
234 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
235 AC_DEFUN([_AM_IF_OPTION],
236 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
237
238 #
239 # Check to make sure that the build environment is sane.
240 #
241
242 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
243
244 # This program is free software; you can redistribute it and/or modify
245 # it under the terms of the GNU General Public License as published by
246 # the Free Software Foundation; either version 2, or (at your option)
247 # any later version.
248
249 # This program is distributed in the hope that it will be useful,
250 # but WITHOUT ANY WARRANTY; without even the implied warranty of
251 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
252 # GNU General Public License for more details.
253
254 # You should have received a copy of the GNU General Public License
255 # along with this program; if not, write to the Free Software
256 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
257 # 02111-1307, USA.
258
259 # serial 3
260
261 # AM_SANITY_CHECK
262 # ---------------
263 AC_DEFUN([AM_SANITY_CHECK],
264 [AC_MSG_CHECKING([whether build environment is sane])
265 # Just in case
266 sleep 1
267 echo timestamp > conftest.file
268 # Do `set' in a subshell so we don't clobber the current shell's
269 # arguments.  Must try -L first in case configure is actually a
270 # symlink; some systems play weird games with the mod time of symlinks
271 # (eg FreeBSD returns the mod time of the symlink's containing
272 # directory).
273 if (
274    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
275    if test "$[*]" = "X"; then
276       # -L didn't work.
277       set X `ls -t $srcdir/configure conftest.file`
278    fi
279    rm -f conftest.file
280    if test "$[*]" != "X $srcdir/configure conftest.file" \
281       && test "$[*]" != "X conftest.file $srcdir/configure"; then
282
283       # If neither matched, then we have a broken ls.  This can happen
284       # if, for instance, CONFIG_SHELL is bash and it inherits a
285       # broken ls alias from the environment.  This has actually
286       # happened.  Such a system could not be considered "sane".
287       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
288 alias in your environment])
289    fi
290
291    test "$[2]" = conftest.file
292    )
293 then
294    # Ok.
295    :
296 else
297    AC_MSG_ERROR([newly created file is older than distributed files!
298 Check your system clock])
299 fi
300 AC_MSG_RESULT(yes)])
301
302 #  -*- Autoconf -*-
303
304
305 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
306
307 # This program is free software; you can redistribute it and/or modify
308 # it under the terms of the GNU General Public License as published by
309 # the Free Software Foundation; either version 2, or (at your option)
310 # any later version.
311
312 # This program is distributed in the hope that it will be useful,
313 # but WITHOUT ANY WARRANTY; without even the implied warranty of
314 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
315 # GNU General Public License for more details.
316
317 # You should have received a copy of the GNU General Public License
318 # along with this program; if not, write to the Free Software
319 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
320 # 02111-1307, USA.
321
322 # serial 3
323
324 # AM_MISSING_PROG(NAME, PROGRAM)
325 # ------------------------------
326 AC_DEFUN([AM_MISSING_PROG],
327 [AC_REQUIRE([AM_MISSING_HAS_RUN])
328 $1=${$1-"${am_missing_run}$2"}
329 AC_SUBST($1)])
330
331
332 # AM_MISSING_HAS_RUN
333 # ------------------
334 # Define MISSING if not defined so far and test if it supports --run.
335 # If it does, set am_missing_run to use it, otherwise, to nothing.
336 AC_DEFUN([AM_MISSING_HAS_RUN],
337 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
338 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
339 # Use eval to expand $SHELL
340 if eval "$MISSING --run true"; then
341   am_missing_run="$MISSING --run "
342 else
343   am_missing_run=
344   AC_MSG_WARN([`missing' script is too old or missing])
345 fi
346 ])
347
348 # AM_AUX_DIR_EXPAND
349
350 # Copyright 2001 Free Software Foundation, Inc.
351
352 # This program is free software; you can redistribute it and/or modify
353 # it under the terms of the GNU General Public License as published by
354 # the Free Software Foundation; either version 2, or (at your option)
355 # any later version.
356
357 # This program is distributed in the hope that it will be useful,
358 # but WITHOUT ANY WARRANTY; without even the implied warranty of
359 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
360 # GNU General Public License for more details.
361
362 # You should have received a copy of the GNU General Public License
363 # along with this program; if not, write to the Free Software
364 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
365 # 02111-1307, USA.
366
367 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
368 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
369 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
370 #
371 # Of course, Automake must honor this variable whenever it calls a
372 # tool from the auxiliary directory.  The problem is that $srcdir (and
373 # therefore $ac_aux_dir as well) can be either absolute or relative,
374 # depending on how configure is run.  This is pretty annoying, since
375 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
376 # source directory, any form will work fine, but in subdirectories a
377 # relative path needs to be adjusted first.
378 #
379 # $ac_aux_dir/missing
380 #    fails when called from a subdirectory if $ac_aux_dir is relative
381 # $top_srcdir/$ac_aux_dir/missing
382 #    fails if $ac_aux_dir is absolute,
383 #    fails when called from a subdirectory in a VPATH build with
384 #          a relative $ac_aux_dir
385 #
386 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
387 # are both prefixed by $srcdir.  In an in-source build this is usually
388 # harmless because $srcdir is `.', but things will broke when you
389 # start a VPATH build or use an absolute $srcdir.
390 #
391 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
392 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
393 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
394 # and then we would define $MISSING as
395 #   MISSING="\${SHELL} $am_aux_dir/missing"
396 # This will work as long as MISSING is not called from configure, because
397 # unfortunately $(top_srcdir) has no meaning in configure.
398 # However there are other variables, like CC, which are often used in
399 # configure, and could therefore not use this "fixed" $ac_aux_dir.
400 #
401 # Another solution, used here, is to always expand $ac_aux_dir to an
402 # absolute PATH.  The drawback is that using absolute paths prevent a
403 # configured tree to be moved without reconfiguration.
404
405 # Rely on autoconf to set up CDPATH properly.
406 AC_PREREQ([2.50])
407
408 AC_DEFUN([AM_AUX_DIR_EXPAND], [
409 # expand $ac_aux_dir to an absolute path
410 am_aux_dir=`cd $ac_aux_dir && pwd`
411 ])
412
413 # AM_PROG_INSTALL_SH
414 # ------------------
415 # Define $install_sh.
416
417 # Copyright 2001 Free Software Foundation, Inc.
418
419 # This program is free software; you can redistribute it and/or modify
420 # it under the terms of the GNU General Public License as published by
421 # the Free Software Foundation; either version 2, or (at your option)
422 # any later version.
423
424 # This program is distributed in the hope that it will be useful,
425 # but WITHOUT ANY WARRANTY; without even the implied warranty of
426 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
427 # GNU General Public License for more details.
428
429 # You should have received a copy of the GNU General Public License
430 # along with this program; if not, write to the Free Software
431 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
432 # 02111-1307, USA.
433
434 AC_DEFUN([AM_PROG_INSTALL_SH],
435 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
436 install_sh=${install_sh-"$am_aux_dir/install-sh"}
437 AC_SUBST(install_sh)])
438
439 # AM_PROG_INSTALL_STRIP
440
441 # Copyright 2001 Free Software Foundation, Inc.
442
443 # This program is free software; you can redistribute it and/or modify
444 # it under the terms of the GNU General Public License as published by
445 # the Free Software Foundation; either version 2, or (at your option)
446 # any later version.
447
448 # This program is distributed in the hope that it will be useful,
449 # but WITHOUT ANY WARRANTY; without even the implied warranty of
450 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
451 # GNU General Public License for more details.
452
453 # You should have received a copy of the GNU General Public License
454 # along with this program; if not, write to the Free Software
455 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
456 # 02111-1307, USA.
457
458 # One issue with vendor `install' (even GNU) is that you can't
459 # specify the program used to strip binaries.  This is especially
460 # annoying in cross-compiling environments, where the build's strip
461 # is unlikely to handle the host's binaries.
462 # Fortunately install-sh will honor a STRIPPROG variable, so we
463 # always use install-sh in `make install-strip', and initialize
464 # STRIPPROG with the value of the STRIP variable (set by the user).
465 AC_DEFUN([AM_PROG_INSTALL_STRIP],
466 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
467 # Installed binaries are usually stripped using `strip' when the user
468 # run `make install-strip'.  However `strip' might not be the right
469 # tool to use in cross-compilation environments, therefore Automake
470 # will honor the `STRIP' environment variable to overrule this program.
471 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
472 if test "$cross_compiling" != no; then
473   AC_CHECK_TOOL([STRIP], [strip], :)
474 fi
475 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
476 AC_SUBST([INSTALL_STRIP_PROGRAM])])
477
478 #                                                          -*- Autoconf -*-
479 # Copyright (C) 2003  Free Software Foundation, Inc.
480
481 # This program is free software; you can redistribute it and/or modify
482 # it under the terms of the GNU General Public License as published by
483 # the Free Software Foundation; either version 2, or (at your option)
484 # any later version.
485
486 # This program is distributed in the hope that it will be useful,
487 # but WITHOUT ANY WARRANTY; without even the implied warranty of
488 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
489 # GNU General Public License for more details.
490
491 # You should have received a copy of the GNU General Public License
492 # along with this program; if not, write to the Free Software
493 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
494 # 02111-1307, USA.
495
496 # serial 1
497
498 # Check whether the underlying file-system supports filenames
499 # with a leading dot.  For instance MS-DOS doesn't.
500 AC_DEFUN([AM_SET_LEADING_DOT],
501 [rm -rf .tst 2>/dev/null
502 mkdir .tst 2>/dev/null
503 if test -d .tst; then
504   am__leading_dot=.
505 else
506   am__leading_dot=_
507 fi
508 rmdir .tst 2>/dev/null
509 AC_SUBST([am__leading_dot])])
510
511 # serial 5                                              -*- Autoconf -*-
512
513 # Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
514
515 # This program is free software; you can redistribute it and/or modify
516 # it under the terms of the GNU General Public License as published by
517 # the Free Software Foundation; either version 2, or (at your option)
518 # any later version.
519
520 # This program is distributed in the hope that it will be useful,
521 # but WITHOUT ANY WARRANTY; without even the implied warranty of
522 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
523 # GNU General Public License for more details.
524
525 # You should have received a copy of the GNU General Public License
526 # along with this program; if not, write to the Free Software
527 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
528 # 02111-1307, USA.
529
530
531 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
532 # written in clear, in which case automake, when reading aclocal.m4,
533 # will think it sees a *use*, and therefore will trigger all it's
534 # C support machinery.  Also note that it means that autoscan, seeing
535 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
536
537
538
539 # _AM_DEPENDENCIES(NAME)
540 # ----------------------
541 # See how the compiler implements dependency checking.
542 # NAME is "CC", "CXX", "GCJ", or "OBJC".
543 # We try a few techniques and use that to set a single cache variable.
544 #
545 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
546 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
547 # dependency, and given that the user is not expected to run this macro,
548 # just rely on AC_PROG_CC.
549 AC_DEFUN([_AM_DEPENDENCIES],
550 [AC_REQUIRE([AM_SET_DEPDIR])dnl
551 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
552 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
553 AC_REQUIRE([AM_DEP_TRACK])dnl
554
555 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
556        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
557        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
558        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
559                    [depcc="$$1"   am_compiler_list=])
560
561 AC_CACHE_CHECK([dependency style of $depcc],
562                [am_cv_$1_dependencies_compiler_type],
563 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
564   # We make a subdir and do the tests there.  Otherwise we can end up
565   # making bogus files that we don't know about and never remove.  For
566   # instance it was reported that on HP-UX the gcc test will end up
567   # making a dummy file named `D' -- because `-MD' means `put the output
568   # in D'.
569   mkdir conftest.dir
570   # Copy depcomp to subdir because otherwise we won't find it if we're
571   # using a relative directory.
572   cp "$am_depcomp" conftest.dir
573   cd conftest.dir
574   # We will build objects and dependencies in a subdirectory because
575   # it helps to detect inapplicable dependency modes.  For instance
576   # both Tru64's cc and ICC support -MD to output dependencies as a
577   # side effect of compilation, but ICC will put the dependencies in
578   # the current directory while Tru64 will put them in the object
579   # directory.
580   mkdir sub
581
582   am_cv_$1_dependencies_compiler_type=none
583   if test "$am_compiler_list" = ""; then
584      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
585   fi
586   for depmode in $am_compiler_list; do
587     # Setup a source with many dependencies, because some compilers
588     # like to wrap large dependency lists on column 80 (with \), and
589     # we should not choose a depcomp mode which is confused by this.
590     #
591     # We need to recreate these files for each test, as the compiler may
592     # overwrite some of them when testing with obscure command lines.
593     # This happens at least with the AIX C compiler.
594     : > sub/conftest.c
595     for i in 1 2 3 4 5 6; do
596       echo '#include "conftst'$i'.h"' >> sub/conftest.c
597       : > sub/conftst$i.h
598     done
599     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
600
601     case $depmode in
602     nosideeffect)
603       # after this tag, mechanisms are not by side-effect, so they'll
604       # only be used when explicitly requested
605       if test "x$enable_dependency_tracking" = xyes; then
606         continue
607       else
608         break
609       fi
610       ;;
611     none) break ;;
612     esac
613     # We check with `-c' and `-o' for the sake of the "dashmstdout"
614     # mode.  It turns out that the SunPro C++ compiler does not properly
615     # handle `-M -o', and we need to detect this.
616     if depmode=$depmode \
617        source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
618        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
619        $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
620          >/dev/null 2>conftest.err &&
621        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
622        grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
623        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
624       # icc doesn't choke on unknown options, it will just issue warnings
625       # (even with -Werror).  So we grep stderr for any message
626       # that says an option was ignored.
627       if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
628         am_cv_$1_dependencies_compiler_type=$depmode
629         break
630       fi
631     fi
632   done
633
634   cd ..
635   rm -rf conftest.dir
636 else
637   am_cv_$1_dependencies_compiler_type=none
638 fi
639 ])
640 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
641 AM_CONDITIONAL([am__fastdep$1], [
642   test "x$enable_dependency_tracking" != xno \
643   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
644 ])
645
646
647 # AM_SET_DEPDIR
648 # -------------
649 # Choose a directory name for dependency files.
650 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
651 AC_DEFUN([AM_SET_DEPDIR],
652 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
653 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
654 ])
655
656
657 # AM_DEP_TRACK
658 # ------------
659 AC_DEFUN([AM_DEP_TRACK],
660 [AC_ARG_ENABLE(dependency-tracking,
661 [  --disable-dependency-tracking Speeds up one-time builds
662   --enable-dependency-tracking  Do not reject slow dependency extractors])
663 if test "x$enable_dependency_tracking" != xno; then
664   am_depcomp="$ac_aux_dir/depcomp"
665   AMDEPBACKSLASH='\'
666 fi
667 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
668 AC_SUBST([AMDEPBACKSLASH])
669 ])
670
671 # Generate code to set up dependency tracking.   -*- Autoconf -*-
672
673 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
674
675 # This program is free software; you can redistribute it and/or modify
676 # it under the terms of the GNU General Public License as published by
677 # the Free Software Foundation; either version 2, or (at your option)
678 # any later version.
679
680 # This program is distributed in the hope that it will be useful,
681 # but WITHOUT ANY WARRANTY; without even the implied warranty of
682 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
683 # GNU General Public License for more details.
684
685 # You should have received a copy of the GNU General Public License
686 # along with this program; if not, write to the Free Software
687 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
688 # 02111-1307, USA.
689
690 #serial 2
691
692 # _AM_OUTPUT_DEPENDENCY_COMMANDS
693 # ------------------------------
694 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
695 [for mf in $CONFIG_FILES; do
696   # Strip MF so we end up with the name of the file.
697   mf=`echo "$mf" | sed -e 's/:.*$//'`
698   # Check whether this is an Automake generated Makefile or not.
699   # We used to match only the files named `Makefile.in', but
700   # some people rename them; so instead we look at the file content.
701   # Grep'ing the first line is not enough: some people post-process
702   # each Makefile.in and add a new line on top of each file to say so.
703   # So let's grep whole file.
704   if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
705     dirpart=`AS_DIRNAME("$mf")`
706   else
707     continue
708   fi
709   grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
710   # Extract the definition of DEP_FILES from the Makefile without
711   # running `make'.
712   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
713   test -z "$DEPDIR" && continue
714   # When using ansi2knr, U may be empty or an underscore; expand it
715   U=`sed -n -e '/^U = / s///p' < "$mf"`
716   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
717   # We invoke sed twice because it is the simplest approach to
718   # changing $(DEPDIR) to its actual value in the expansion.
719   for file in `sed -n -e '
720     /^DEP_FILES = .*\\\\$/ {
721       s/^DEP_FILES = //
722       :loop
723         s/\\\\$//
724         p
725         n
726         /\\\\$/ b loop
727       p
728     }
729     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
730        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
731     # Make sure the directory exists.
732     test -f "$dirpart/$file" && continue
733     fdir=`AS_DIRNAME(["$file"])`
734     AS_MKDIR_P([$dirpart/$fdir])
735     # echo "creating $dirpart/$file"
736     echo '# dummy' > "$dirpart/$file"
737   done
738 done
739 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
740
741
742 # AM_OUTPUT_DEPENDENCY_COMMANDS
743 # -----------------------------
744 # This macro should only be invoked once -- use via AC_REQUIRE.
745 #
746 # This code is only required when automatic dependency tracking
747 # is enabled.  FIXME.  This creates each `.P' file that we will
748 # need in order to bootstrap the dependency handling code.
749 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
750 [AC_CONFIG_COMMANDS([depfiles],
751      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
752      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
753 ])
754
755 # Check to see how 'make' treats includes.      -*- Autoconf -*-
756
757 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
758
759 # This program is free software; you can redistribute it and/or modify
760 # it under the terms of the GNU General Public License as published by
761 # the Free Software Foundation; either version 2, or (at your option)
762 # any later version.
763
764 # This program is distributed in the hope that it will be useful,
765 # but WITHOUT ANY WARRANTY; without even the implied warranty of
766 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
767 # GNU General Public License for more details.
768
769 # You should have received a copy of the GNU General Public License
770 # along with this program; if not, write to the Free Software
771 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
772 # 02111-1307, USA.
773
774 # serial 2
775
776 # AM_MAKE_INCLUDE()
777 # -----------------
778 # Check to see how make treats includes.
779 AC_DEFUN([AM_MAKE_INCLUDE],
780 [am_make=${MAKE-make}
781 cat > confinc << 'END'
782 am__doit:
783         @echo done
784 .PHONY: am__doit
785 END
786 # If we don't find an include directive, just comment out the code.
787 AC_MSG_CHECKING([for style of include used by $am_make])
788 am__include="#"
789 am__quote=
790 _am_result=none
791 # First try GNU make style include.
792 echo "include confinc" > confmf
793 # We grep out `Entering directory' and `Leaving directory'
794 # messages which can occur if `w' ends up in MAKEFLAGS.
795 # In particular we don't look at `^make:' because GNU make might
796 # be invoked under some other name (usually "gmake"), in which
797 # case it prints its new name instead of `make'.
798 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
799    am__include=include
800    am__quote=
801    _am_result=GNU
802 fi
803 # Now try BSD make style include.
804 if test "$am__include" = "#"; then
805    echo '.include "confinc"' > confmf
806    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
807       am__include=.include
808       am__quote="\""
809       _am_result=BSD
810    fi
811 fi
812 AC_SUBST([am__include])
813 AC_SUBST([am__quote])
814 AC_MSG_RESULT([$_am_result])
815 rm -f confinc confmf
816 ])
817
818 # AM_CONDITIONAL                                              -*- Autoconf -*-
819
820 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
821
822 # This program is free software; you can redistribute it and/or modify
823 # it under the terms of the GNU General Public License as published by
824 # the Free Software Foundation; either version 2, or (at your option)
825 # any later version.
826
827 # This program is distributed in the hope that it will be useful,
828 # but WITHOUT ANY WARRANTY; without even the implied warranty of
829 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
830 # GNU General Public License for more details.
831
832 # You should have received a copy of the GNU General Public License
833 # along with this program; if not, write to the Free Software
834 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
835 # 02111-1307, USA.
836
837 # serial 5
838
839 AC_PREREQ(2.52)
840
841 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
842 # -------------------------------------
843 # Define a conditional.
844 AC_DEFUN([AM_CONDITIONAL],
845 [ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
846         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
847 AC_SUBST([$1_TRUE])
848 AC_SUBST([$1_FALSE])
849 if $2; then
850   $1_TRUE=
851   $1_FALSE='#'
852 else
853   $1_TRUE='#'
854   $1_FALSE=
855 fi
856 AC_CONFIG_COMMANDS_PRE(
857 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
858   AC_MSG_ERROR([conditional "$1" was never defined.
859 Usually this means the macro was only invoked conditionally.])
860 fi])])
861
862 # Add --enable-maintainer-mode option to configure.
863 # From Jim Meyering
864
865 # Copyright 1996, 1998, 2000, 2001, 2002  Free Software Foundation, Inc.
866
867 # This program is free software; you can redistribute it and/or modify
868 # it under the terms of the GNU General Public License as published by
869 # the Free Software Foundation; either version 2, or (at your option)
870 # any later version.
871
872 # This program is distributed in the hope that it will be useful,
873 # but WITHOUT ANY WARRANTY; without even the implied warranty of
874 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
875 # GNU General Public License for more details.
876
877 # You should have received a copy of the GNU General Public License
878 # along with this program; if not, write to the Free Software
879 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
880 # 02111-1307, USA.
881
882 # serial 2
883
884 AC_DEFUN([AM_MAINTAINER_MODE],
885 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
886   dnl maintainer-mode is disabled by default
887   AC_ARG_ENABLE(maintainer-mode,
888 [  --enable-maintainer-mode enable make rules and dependencies not useful
889                           (and sometimes confusing) to the casual installer],
890       USE_MAINTAINER_MODE=$enableval,
891       USE_MAINTAINER_MODE=no)
892   AC_MSG_RESULT([$USE_MAINTAINER_MODE])
893   AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
894   MAINT=$MAINTAINER_MODE_TRUE
895   AC_SUBST(MAINT)dnl
896 ]
897 )
898
899 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
900
901
902 AC_DEFUN(DS_LINUX_DIR,
903 [
904         AC_ARG_WITH([linuxdir],
905                 [AC_HELP_STRING([--with-linuxdir=DIR],
906                         [specify path to Linux source directory])],
907                 [LINUX_DIR="${withval}"],
908                 [LINUX_DIR=default])
909
910
911         AC_SUBST(LINUX_DIR)
912 ])
913
914
915 AC_DEFUN(DS_LINUX,
916 [
917
918         DS_LINUX_DIR()
919         
920         AC_MSG_CHECKING([Linux version])
921         
922         if test "${LINUX_DIR}" != "default" ; then
923
924           if [[ ! -f "${LINUX_DIR}/.config" ]];then
925             AC_MSG_ERROR([
926             The kernel source tree at ${LINUX_DIR} is not configured.
927             Fix before continuing.])
928           fi
929
930           if [[ ! -f "${LINUX_DIR}/include/linux/version.h" ]];then
931             AC_MSG_ERROR([The header file include/linux/version.h does not exist.
932             For 2.6 kernels, it can be generated by running 'make prepare' in
933             the kernel source directory.])
934           fi
935
936           LINUX_VERSION=$(grep UTS_RELEASE ${LINUX_DIR}/include/linux/version.h | \
937             sed 's/[[^"]]*"\(.*\)\{1\}"/\1/')
938
939           AC_MSG_RESULT([$LINUX_VERSION])
940
941           LINUX_VERSION_MAJOR=$(echo ${LINUX_VERSION} | cut -d. -f1)
942           LINUX_VERSION_MINOR=$(echo ${LINUX_VERSION} | cut -d. -f2)
943
944           case $LINUX_VERSION_MAJOR.$LINUX_VERSION_MINOR in
945             2.6)
946                 DS_LINUX_2_6()
947                 ;;
948             2.[[01234]])
949                 DS_LINUX_2_4()
950                 ;;
951             *)
952                 AC_MSG_ERROR([Unknown Linux major.minor $LINUX_VERSION_MAJOR.$LINUX_VERSION_MINOR])
953                 ;;
954           esac
955
956           CONFIG_ORTE_KERNEL=yes
957           AC_DEFINE([CONFIG_ORTE_KERNEL],[1],[Define if linux kernel is found])   
958
959         else
960           AC_MSG_RESULT([no])   
961           
962           CONFIG_ORTE_KERNEL=no
963                   
964         fi
965   
966         AC_SUBST(CONFIG_ORTE_KERNEL)    
967         AM_CONDITIONAL([CONFIG_ORTE_KERNEL],[test ${CONFIG_ORTE_KERNEL} == "yes"])
968     
969         DS_RT()
970 ])
971
972 AC_DEFUN(DS_LINUX_2_6,
973 [
974         AC_MSG_CHECKING(for Linux CFLAGS)
975
976         tmpdir="`pwd`/tmp-noicrwa"
977
978         rm -rf ${tmpdir}
979         mkdir ${tmpdir}
980
981         cat >${tmpdir}/Makefile <<EOF
982 obj-m += fake.o
983
984 \$(obj)/fake.c: flags
985         touch \$(obj)/fake.c
986
987 .PHONY: flags
988 flags:
989         echo LINUX_ARCH=\"\$(ARCH)\" >>\$(obj)/flags
990         echo LINUX_AFLAGS=\"\$(AFLAGS)\" | sed 's_Iinclude_I"\$(LINUXDIR)/include"_g'>>\$(obj)/flags
991         echo LINUX_LDFLAGS=\"\" >>\$(obj)/flags
992         echo LINUX_ARFLAGS=\"\$(ARFLAGS)\" >>\$(obj)/flags
993         echo LINUX_CROSS_COMPILE=\"\$(CROSS_COMPILE)\" >>\$(obj)/flags
994         echo LINUX_KERNELRELEASE=\"\$(KERNELRELEASE)\" >>\$(obj)/flags
995         echo LINUX_CFLAGS=\"\$(CFLAGS)\" | sed 's_Iinclude_I"\$(LINUXDIR)/include"_g'>>\$(obj)/flags
996         echo LINUX_CC=\"\$(CC)\" >>\$(obj)/flags
997         echo LINUX_LD=\"\$(LD) \$(LDFLAGS)\" >>\$(obj)/flags
998         echo LINUX_AS=\"\$(AS)\" >>\$(obj)/flags
999 EOF
1000
1001         echo ${MAKE-make} -C ${LINUX_DIR} V=1 SUBDIRS=${tmpdir} LINUXDIR=${LINUX_DIR} MODVERDIR=${tmpdir} modules >&5 2>&5
1002         ${MAKE-make} -C ${LINUX_DIR} V=1 SUBDIRS=${tmpdir} LINUXDIR=${LINUX_DIR} MODVERDIR=${tmpdir} modules >&5 2>&5
1003         . ${tmpdir}/flags
1004         rm -rf ${tmpdir}
1005
1006         LINUX_MODULE_EXT=".ko"
1007
1008         AC_SUBST(LINUX_ARCH)
1009         AC_SUBST(LINUX_AFLAGS)
1010         AC_SUBST(LINUX_LDFLAGS)
1011         AC_SUBST(LINUX_ARFLAGS)
1012         AC_SUBST(LINUX_CROSS_COMPILE)
1013         AC_SUBST(LINUX_KERNELRELEASE)
1014         AC_SUBST(LINUX_CFLAGS)
1015         AC_SUBST(LINUX_CC)
1016         AC_SUBST(LINUX_LD)
1017         AC_SUBST(LINUX_AS)
1018         AC_SUBST(LINUX_MODULE_EXT)
1019
1020         AC_MSG_RESULT([ok])
1021 ])
1022
1023
1024 AC_DEFUN(DS_LINUX_2_4,
1025 [
1026         AC_MSG_CHECKING(for Linux CFLAGS)
1027
1028         if [[ ! -f "${LINUX_DIR}/.hdepend" ]];then
1029                 AC_MSG_ERROR([
1030 You need to run 'make dep' on the kernel source before continuing.])
1031         fi
1032
1033         tmpdir="`pwd`/tmp-noicrwa"
1034
1035         rm -rf ${tmpdir}
1036         mkdir ${tmpdir}
1037
1038         cat >${tmpdir}/Makefile <<EOF
1039
1040 .PHONY: modules
1041 modules:
1042         echo LINUX_ARCH=\"\$(ARCH)\" >>flags
1043         echo LINUX_AFLAGS=\"\$(AFLAGS)\" | sed 's_Iinclude_I\"\$(LINUXDIR)/include\"_g'>>flags
1044         echo LINUX_LDFLAGS=\"\" >>flags
1045         echo LINUX_ARFLAGS=\"\$(ARFLAGS)\" >>flags
1046         echo LINUX_CROSS_COMPILE=\"\$(CROSS_COMPILE)\" >>flags
1047         echo LINUX_KERNELRELEASE=\"\$(KERNELRELEASE)\" >>flags
1048         echo LINUX_CFLAGS=\"\$(CFLAGS)\" | sed 's_Iinclude_I\"\$(LINUXDIR)/include\"_g'>>flags
1049         echo LINUX_CC=\"\$(CC)\" >>flags
1050         echo LINUX_LD=\"\$(LD) \$(LDFLAGS)\" >>flags
1051         echo LINUX_AS=\"\$(AS)\" >>flags
1052 EOF
1053
1054         echo ${MAKE-make} -C ${LINUX_DIR} SUBDIRS=${tmpdir} modules >&5 2>&5
1055         ${MAKE-make} -C ${LINUX_DIR} SUBDIRS=${tmpdir} modules >&5 2>&5
1056         . ${tmpdir}/flags
1057         rm -rf ${tmpdir}
1058
1059         LINUX_MODULE_EXT=".o"
1060
1061         AC_SUBST(LINUX_ARCH)
1062         AC_SUBST(LINUX_AFLAGS)
1063         AC_SUBST(LINUX_LDFLAGS)
1064         AC_SUBST(LINUX_ARFLAGS)
1065         AC_SUBST(LINUX_CROSS_COMPILE)
1066         AC_SUBST(LINUX_KERNELRELEASE)
1067         AC_SUBST(LINUX_CFLAGS)
1068         AC_SUBST(LINUX_CC)
1069         AC_SUBST(LINUX_LD)
1070         AC_SUBST(LINUX_AS)
1071         AC_SUBST(LINUX_MODULE_EXT)
1072
1073         AC_MSG_RESULT([ok])
1074 ])
1075
1076 AC_DEFUN(DS_CHECK_LINUX_CONFIG_OPTION,
1077 [
1078         AC_MSG_CHECKING([Linux config option $1])
1079
1080         if grep '^$1=y$' ${LINUX_DIR}/.config >/dev/null 2>/dev/null; then
1081                 result=yes
1082                 $2
1083         else if grep '^$1=m$' ${LINUX_DIR}/.config >/dev/null 2>/dev/null; then
1084                 result=module
1085                 $3
1086         else
1087                 result=no
1088                 $4
1089         fi
1090         fi
1091
1092         AC_MSG_RESULT([$result])
1093 ])
1094
1095 AC_DEFUN(DS_LINUX_CONFIG_OPTION,
1096 [
1097         DS_CHECK_LINUX_CONFIG_OPTION([$1],
1098                 [$1=yes],
1099                 [$1=module],
1100                 [$1=no])
1101
1102         AM_CONDITIONAL([$1],[test "${$1}" = yes])
1103 ])
1104
1105 AC_DEFUN(DS_LINUX_CONFIG_OPTION_MODULE,
1106 [
1107         DS_CHECK_LINUX_CONFIG_OPTION([$1],
1108                 [$1=yes],
1109                 [$1=module],
1110                 [$1=no])
1111
1112         AM_CONDITIONAL([$1],[test "${$1}" = yes -o "${$1}" = module])
1113 ])
1114
1115 AC_DEFUN(DS_RTAI,
1116 [
1117         AC_ARG_WITH([rtaidir],
1118                 [AC_HELP_STRING([--with-rtaidir=DIR],
1119                     [specify path to RTAI source/installation directory])],
1120                 [RTAI_DIR="${withval}"],
1121                 [RTAI_DIR=/usr/src/rtai])
1122
1123         AC_ARG_WITH([rtnetdir],
1124                 [AC_HELP_STRING([--with-rtnetdir=DIR],
1125                         [specify path to RTnet source/installation directory])],
1126                 [RTNET_DIR="${withval}"],
1127                 [RTNET_DIR=/usr/src/rtnet])
1128
1129         DS_LINUX_CONFIG_OPTION_MODULE([CONFIG_RTHAL])
1130         DS_LINUX_CONFIG_OPTION_MODULE([CONFIG_ADEOS])
1131
1132         if test "${CONFIG_RTHAL}" != "no" -o "${CONFIG_ADEOS}" != "no"; then
1133                 AC_MSG_CHECKING([RTAI directory ${RTAI_DIR}])
1134                 if [[ -d ${RTAI_DIR}/include ]] ; then
1135                         RTAI_CFLAGS="-I${RTAI_DIR}/include"
1136                 else
1137                         if [ -d ${RTAI_DIR}/rtai-core/include ] ; then
1138                                 RTAI_CFLAGS="-I${RTAI_DIR}/rtai-core/include"
1139                         else
1140                                 AC_MSG_ERROR([incorrect RTAI directory?])
1141                         fi
1142                 fi
1143                 AC_MSG_RESULT([found])
1144                 AC_MSG_CHECKING([RTnet directory ${RTNET_DIR}])
1145                 if [[ -d ${RTNET_DIR}/include ]] ; then
1146                         RTAI_CFLAGS="${RTAI_CFLAGS} -I${RTNET_DIR}/include"
1147                 else
1148                         AC_MSG_ERROR([incorrect RTnet directory?])
1149                 fi
1150                 AC_MSG_RESULT([found])
1151                 $1
1152                 RT_GCCLIB_DIR=`gcc -print-search-dirs | sed -n -e 's/^install: \(.*\)$/\1/p'`
1153                 RTAI_CFLAGS="${RTAI_CFLAGS} -idirafter ${RT_GCCLIB_DIR}/include -nostdinc"
1154                 AC_DEFINE([CONFIG_ORTE_RTAI],[1],[Define if kernel is RTAI patched])
1155         else
1156                 $2
1157         fi
1158         AC_SUBST(RTAI_CFLAGS)
1159
1160 ])
1161
1162 AC_DEFUN(DS_RTLINUX,
1163 [
1164         AC_ARG_WITH([rtlinuxdir],
1165                 [AC_HELP_STRING([--with-rtlinuxdir=DIR],
1166                         [specify path to RTLinux source directory])],
1167                 [RTLINUX_DIR="${withval}"],
1168                 [RTLINUX_DIR=/usr/src/rtlinux])
1169                 
1170         AC_ARG_WITH([rtlinuxudpdir],
1171                 [AC_HELP_STRING([--with-rtlinuxudpdir=DIR],
1172                         [specify path to RTLinux UDP source directory])],
1173                 [RTLINUXUDP_DIR="${withval}"],
1174                 [RTLINUXUDP_DIR="${RTLINUX_DIR}"])
1175
1176         DS_LINUX_CONFIG_OPTION_MODULE([CONFIG_RTLINUX])
1177
1178         if test "${CONFIG_RTLINUX}" != "no" ; then
1179                 AC_MSG_CHECKING([RTLinux directory ${RTLINUX_DIR} for rtl.mk])
1180                 if [[ -d ${RTLINUX_DIR}/include ]] ; then
1181                         RTLINUX_CFLAGS=`sed -n -e 's/^CFLAGS *=\(.*\)$/\1/p' ${RTLINUX_DIR}/rtl.mk`
1182                         RTLINUX_CC=`sed -n -e 's/^CC *=\(.*\)$/\1/p' ${RTLINUX_DIR}/rtl.mk`
1183                 else
1184                         AC_MSG_ERROR([incorrect RTLinux directory?])
1185                 fi
1186                 AC_MSG_RESULT([found])
1187                 AC_DEFINE([CONFIG_ORTE_RTL],[1],[Define if kernel is RTLinux patched])
1188                 AC_MSG_CHECKING([RTLinux for UDP])
1189                 if [[ ! -e "${RTLINUXUDP_DIR}/include/udp.h" -o \
1190                       ! -e "${RTLINUXUDP_DIR}/include/nic.h" -o \ 
1191                       ! -e "${RTLINUXUDP_DIR}/include/ip.h" -o \ 
1192                       ! -e "${RTLINUXUDP_DIR}/include/ethernet.h" -o \ 
1193                       ! -e "${RTLINUXUDP_DIR}/include/nictab.h" ]] ; then 
1194                         AC_MSG_ERROR([incorrect RTLinux UDP directory!!!])
1195                 fi
1196                 RT_GCCLIB_DIR=`${RTLINUX_CC} -print-search-dirs | sed -n -e 's/^install: \(.*\)$/\1/p'`
1197                 RTLINUX_CFLAGS="${RTLINUX_CFLAGS} -I${RTLINUXUDP_DIR}/include -idirafter ${RT_GCCLIB_DIR}/include -nostdinc"
1198                 AC_MSG_RESULT([found])
1199                 $1
1200         else
1201                 $2
1202         fi
1203         AC_SUBST(RTLINUX_CFLAGS)
1204         AC_SUBST(RTLINUX_CC)
1205 ])
1206
1207 AC_DEFUN(DS_RT,
1208 [
1209         DS_RTAI([USE_RTAI=yes],[USE_RTAI=no])
1210         DS_RTLINUX([USE_RTLINUX=yes],[USE_RTLINUX=no])
1211         if test ${USE_RTAI} == "yes" -o ${USE_RTLINUX} == "yes" ; then
1212                 AC_DEFINE([CONFIG_ORTE_RT],[1],[Define to enable ORTE's RT support])
1213                 CONFIG_ORTE_RT="yes"
1214         fi
1215         AC_SUBST(CONFIG_ORTE_RT)        
1216         AM_CONDITIONAL([USE_RTAI],[test ${USE_RTAI} == "yes"])
1217         AM_CONDITIONAL([USE_RTLINUX],[test ${USE_RTLINUX} == "yes"])
1218         AM_CONDITIONAL([CONFIG_ORTE_RT],[test ${USE_RTAI} == "yes" -o ${USE_RTLINUX} == "yes"])
1219 ])
1220