Tizen 2.0 Release
[framework/uifw/xorg/util/x11-xserver-utils.git] / xsetmode / 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 # Do all the work for Automake.                            -*- Autoconf -*-
15
16 # This macro actually does too much some checks are only needed if
17 # your package does certain things.  But this isn't really a big deal.
18
19 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
20 # Free Software Foundation, Inc.
21
22 # This program is free software; you can redistribute it and/or modify
23 # it under the terms of the GNU General Public License as published by
24 # the Free Software Foundation; either version 2, or (at your option)
25 # any later version.
26
27 # This program is distributed in the hope that it will be useful,
28 # but WITHOUT ANY WARRANTY; without even the implied warranty of
29 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30 # GNU General Public License for more details.
31
32 # You should have received a copy of the GNU General Public License
33 # along with this program; if not, write to the Free Software
34 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
35 # 02111-1307, USA.
36
37 # serial 10
38
39 AC_PREREQ([2.54])
40
41 # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
42 # the ones we care about.
43 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
44
45 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
46 # AM_INIT_AUTOMAKE([OPTIONS])
47 # -----------------------------------------------
48 # The call with PACKAGE and VERSION arguments is the old style
49 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
50 # and VERSION should now be passed to AC_INIT and removed from
51 # the call to AM_INIT_AUTOMAKE.
52 # We support both call styles for the transition.  After
53 # the next Automake release, Autoconf can make the AC_INIT
54 # arguments mandatory, and then we can depend on a new Autoconf
55 # release and drop the old call support.
56 AC_DEFUN([AM_INIT_AUTOMAKE],
57 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
58  AC_REQUIRE([AC_PROG_INSTALL])dnl
59 # test to see if srcdir already configured
60 if test "`cd $srcdir && pwd`" != "`pwd`" &&
61    test -f $srcdir/config.status; then
62   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
63 fi
64
65 # test whether we have cygpath
66 if test -z "$CYGPATH_W"; then
67   if (cygpath --version) >/dev/null 2>/dev/null; then
68     CYGPATH_W='cygpath -w'
69   else
70     CYGPATH_W=echo
71   fi
72 fi
73 AC_SUBST([CYGPATH_W])
74
75 # Define the identity of the package.
76 dnl Distinguish between old-style and new-style calls.
77 m4_ifval([$2],
78 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
79  AC_SUBST([PACKAGE], [$1])dnl
80  AC_SUBST([VERSION], [$2])],
81 [_AM_SET_OPTIONS([$1])dnl
82  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
83  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
84
85 _AM_IF_OPTION([no-define],,
86 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
87  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
88
89 # Some tools Automake needs.
90 AC_REQUIRE([AM_SANITY_CHECK])dnl
91 AC_REQUIRE([AC_ARG_PROGRAM])dnl
92 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
93 AM_MISSING_PROG(AUTOCONF, autoconf)
94 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
95 AM_MISSING_PROG(AUTOHEADER, autoheader)
96 AM_MISSING_PROG(MAKEINFO, makeinfo)
97 AM_MISSING_PROG(AMTAR, tar)
98 AM_PROG_INSTALL_SH
99 AM_PROG_INSTALL_STRIP
100 # We need awk for the "check" target.  The system "awk" is bad on
101 # some platforms.
102 AC_REQUIRE([AC_PROG_AWK])dnl
103 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
104 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
105
106 _AM_IF_OPTION([no-dependencies],,
107 [AC_PROVIDE_IFELSE([AC_PROG_CC],
108                   [_AM_DEPENDENCIES(CC)],
109                   [define([AC_PROG_CC],
110                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
111 AC_PROVIDE_IFELSE([AC_PROG_CXX],
112                   [_AM_DEPENDENCIES(CXX)],
113                   [define([AC_PROG_CXX],
114                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
115 ])
116 ])
117
118
119 # When config.status generates a header, we must update the stamp-h file.
120 # This file resides in the same directory as the config header
121 # that is generated.  The stamp files are numbered to have different names.
122
123 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
124 # loop where config.status creates the headers, so we can generate
125 # our stamp files there.
126 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
127 [# Compute $1's index in $config_headers.
128 _am_stamp_count=1
129 for _am_header in $config_headers :; do
130   case $_am_header in
131     $1 | $1:* )
132       break ;;
133     * )
134       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
135   esac
136 done
137 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
138
139 # Copyright 2002  Free Software Foundation, Inc.
140
141 # This program is free software; you can redistribute it and/or modify
142 # it under the terms of the GNU General Public License as published by
143 # the Free Software Foundation; either version 2, or (at your option)
144 # any later version.
145
146 # This program is distributed in the hope that it will be useful,
147 # but WITHOUT ANY WARRANTY; without even the implied warranty of
148 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
149 # GNU General Public License for more details.
150
151 # You should have received a copy of the GNU General Public License
152 # along with this program; if not, write to the Free Software
153 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
154
155 # AM_AUTOMAKE_VERSION(VERSION)
156 # ----------------------------
157 # Automake X.Y traces this macro to ensure aclocal.m4 has been
158 # generated from the m4 files accompanying Automake X.Y.
159 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
160
161 # AM_SET_CURRENT_AUTOMAKE_VERSION
162 # -------------------------------
163 # Call AM_AUTOMAKE_VERSION so it can be traced.
164 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
165 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
166          [AM_AUTOMAKE_VERSION([1.7.9])])
167
168 # Helper functions for option handling.                    -*- Autoconf -*-
169
170 # Copyright 2001, 2002  Free Software Foundation, Inc.
171
172 # This program is free software; you can redistribute it and/or modify
173 # it under the terms of the GNU General Public License as published by
174 # the Free Software Foundation; either version 2, or (at your option)
175 # any later version.
176
177 # This program is distributed in the hope that it will be useful,
178 # but WITHOUT ANY WARRANTY; without even the implied warranty of
179 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
180 # GNU General Public License for more details.
181
182 # You should have received a copy of the GNU General Public License
183 # along with this program; if not, write to the Free Software
184 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
185 # 02111-1307, USA.
186
187 # serial 2
188
189 # _AM_MANGLE_OPTION(NAME)
190 # -----------------------
191 AC_DEFUN([_AM_MANGLE_OPTION],
192 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
193
194 # _AM_SET_OPTION(NAME)
195 # ------------------------------
196 # Set option NAME.  Presently that only means defining a flag for this option.
197 AC_DEFUN([_AM_SET_OPTION],
198 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
199
200 # _AM_SET_OPTIONS(OPTIONS)
201 # ----------------------------------
202 # OPTIONS is a space-separated list of Automake options.
203 AC_DEFUN([_AM_SET_OPTIONS],
204 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
205
206 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
207 # -------------------------------------------
208 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
209 AC_DEFUN([_AM_IF_OPTION],
210 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
211
212 #
213 # Check to make sure that the build environment is sane.
214 #
215
216 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
217
218 # This program is free software; you can redistribute it and/or modify
219 # it under the terms of the GNU General Public License as published by
220 # the Free Software Foundation; either version 2, or (at your option)
221 # any later version.
222
223 # This program is distributed in the hope that it will be useful,
224 # but WITHOUT ANY WARRANTY; without even the implied warranty of
225 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
226 # GNU General Public License for more details.
227
228 # You should have received a copy of the GNU General Public License
229 # along with this program; if not, write to the Free Software
230 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
231 # 02111-1307, USA.
232
233 # serial 3
234
235 # AM_SANITY_CHECK
236 # ---------------
237 AC_DEFUN([AM_SANITY_CHECK],
238 [AC_MSG_CHECKING([whether build environment is sane])
239 # Just in case
240 sleep 1
241 echo timestamp > conftest.file
242 # Do `set' in a subshell so we don't clobber the current shell's
243 # arguments.  Must try -L first in case configure is actually a
244 # symlink; some systems play weird games with the mod time of symlinks
245 # (eg FreeBSD returns the mod time of the symlink's containing
246 # directory).
247 if (
248    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
249    if test "$[*]" = "X"; then
250       # -L didn't work.
251       set X `ls -t $srcdir/configure conftest.file`
252    fi
253    rm -f conftest.file
254    if test "$[*]" != "X $srcdir/configure conftest.file" \
255       && test "$[*]" != "X conftest.file $srcdir/configure"; then
256
257       # If neither matched, then we have a broken ls.  This can happen
258       # if, for instance, CONFIG_SHELL is bash and it inherits a
259       # broken ls alias from the environment.  This has actually
260       # happened.  Such a system could not be considered "sane".
261       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
262 alias in your environment])
263    fi
264
265    test "$[2]" = conftest.file
266    )
267 then
268    # Ok.
269    :
270 else
271    AC_MSG_ERROR([newly created file is older than distributed files!
272 Check your system clock])
273 fi
274 AC_MSG_RESULT(yes)])
275
276 #  -*- Autoconf -*-
277
278
279 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
280
281 # This program is free software; you can redistribute it and/or modify
282 # it under the terms of the GNU General Public License as published by
283 # the Free Software Foundation; either version 2, or (at your option)
284 # any later version.
285
286 # This program is distributed in the hope that it will be useful,
287 # but WITHOUT ANY WARRANTY; without even the implied warranty of
288 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
289 # GNU General Public License for more details.
290
291 # You should have received a copy of the GNU General Public License
292 # along with this program; if not, write to the Free Software
293 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
294 # 02111-1307, USA.
295
296 # serial 3
297
298 # AM_MISSING_PROG(NAME, PROGRAM)
299 # ------------------------------
300 AC_DEFUN([AM_MISSING_PROG],
301 [AC_REQUIRE([AM_MISSING_HAS_RUN])
302 $1=${$1-"${am_missing_run}$2"}
303 AC_SUBST($1)])
304
305
306 # AM_MISSING_HAS_RUN
307 # ------------------
308 # Define MISSING if not defined so far and test if it supports --run.
309 # If it does, set am_missing_run to use it, otherwise, to nothing.
310 AC_DEFUN([AM_MISSING_HAS_RUN],
311 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
312 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
313 # Use eval to expand $SHELL
314 if eval "$MISSING --run true"; then
315   am_missing_run="$MISSING --run "
316 else
317   am_missing_run=
318   AC_MSG_WARN([`missing' script is too old or missing])
319 fi
320 ])
321
322 # AM_AUX_DIR_EXPAND
323
324 # Copyright 2001 Free Software Foundation, Inc.
325
326 # This program is free software; you can redistribute it and/or modify
327 # it under the terms of the GNU General Public License as published by
328 # the Free Software Foundation; either version 2, or (at your option)
329 # any later version.
330
331 # This program is distributed in the hope that it will be useful,
332 # but WITHOUT ANY WARRANTY; without even the implied warranty of
333 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
334 # GNU General Public License for more details.
335
336 # You should have received a copy of the GNU General Public License
337 # along with this program; if not, write to the Free Software
338 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
339 # 02111-1307, USA.
340
341 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
342 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
343 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
344 #
345 # Of course, Automake must honor this variable whenever it calls a
346 # tool from the auxiliary directory.  The problem is that $srcdir (and
347 # therefore $ac_aux_dir as well) can be either absolute or relative,
348 # depending on how configure is run.  This is pretty annoying, since
349 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
350 # source directory, any form will work fine, but in subdirectories a
351 # relative path needs to be adjusted first.
352 #
353 # $ac_aux_dir/missing
354 #    fails when called from a subdirectory if $ac_aux_dir is relative
355 # $top_srcdir/$ac_aux_dir/missing
356 #    fails if $ac_aux_dir is absolute,
357 #    fails when called from a subdirectory in a VPATH build with
358 #          a relative $ac_aux_dir
359 #
360 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
361 # are both prefixed by $srcdir.  In an in-source build this is usually
362 # harmless because $srcdir is `.', but things will broke when you
363 # start a VPATH build or use an absolute $srcdir.
364 #
365 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
366 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
367 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
368 # and then we would define $MISSING as
369 #   MISSING="\${SHELL} $am_aux_dir/missing"
370 # This will work as long as MISSING is not called from configure, because
371 # unfortunately $(top_srcdir) has no meaning in configure.
372 # However there are other variables, like CC, which are often used in
373 # configure, and could therefore not use this "fixed" $ac_aux_dir.
374 #
375 # Another solution, used here, is to always expand $ac_aux_dir to an
376 # absolute PATH.  The drawback is that using absolute paths prevent a
377 # configured tree to be moved without reconfiguration.
378
379 # Rely on autoconf to set up CDPATH properly.
380 AC_PREREQ([2.50])
381
382 AC_DEFUN([AM_AUX_DIR_EXPAND], [
383 # expand $ac_aux_dir to an absolute path
384 am_aux_dir=`cd $ac_aux_dir && pwd`
385 ])
386
387 # AM_PROG_INSTALL_SH
388 # ------------------
389 # Define $install_sh.
390
391 # Copyright 2001 Free Software Foundation, Inc.
392
393 # This program is free software; you can redistribute it and/or modify
394 # it under the terms of the GNU General Public License as published by
395 # the Free Software Foundation; either version 2, or (at your option)
396 # any later version.
397
398 # This program is distributed in the hope that it will be useful,
399 # but WITHOUT ANY WARRANTY; without even the implied warranty of
400 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
401 # GNU General Public License for more details.
402
403 # You should have received a copy of the GNU General Public License
404 # along with this program; if not, write to the Free Software
405 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
406 # 02111-1307, USA.
407
408 AC_DEFUN([AM_PROG_INSTALL_SH],
409 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
410 install_sh=${install_sh-"$am_aux_dir/install-sh"}
411 AC_SUBST(install_sh)])
412
413 # AM_PROG_INSTALL_STRIP
414
415 # Copyright 2001 Free Software Foundation, Inc.
416
417 # This program is free software; you can redistribute it and/or modify
418 # it under the terms of the GNU General Public License as published by
419 # the Free Software Foundation; either version 2, or (at your option)
420 # any later version.
421
422 # This program is distributed in the hope that it will be useful,
423 # but WITHOUT ANY WARRANTY; without even the implied warranty of
424 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
425 # GNU General Public License for more details.
426
427 # You should have received a copy of the GNU General Public License
428 # along with this program; if not, write to the Free Software
429 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
430 # 02111-1307, USA.
431
432 # One issue with vendor `install' (even GNU) is that you can't
433 # specify the program used to strip binaries.  This is especially
434 # annoying in cross-compiling environments, where the build's strip
435 # is unlikely to handle the host's binaries.
436 # Fortunately install-sh will honor a STRIPPROG variable, so we
437 # always use install-sh in `make install-strip', and initialize
438 # STRIPPROG with the value of the STRIP variable (set by the user).
439 AC_DEFUN([AM_PROG_INSTALL_STRIP],
440 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
441 # Installed binaries are usually stripped using `strip' when the user
442 # run `make install-strip'.  However `strip' might not be the right
443 # tool to use in cross-compilation environments, therefore Automake
444 # will honor the `STRIP' environment variable to overrule this program.
445 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
446 if test "$cross_compiling" != no; then
447   AC_CHECK_TOOL([STRIP], [strip], :)
448 fi
449 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
450 AC_SUBST([INSTALL_STRIP_PROGRAM])])
451
452 #                                                          -*- Autoconf -*-
453 # Copyright (C) 2003  Free Software Foundation, Inc.
454
455 # This program is free software; you can redistribute it and/or modify
456 # it under the terms of the GNU General Public License as published by
457 # the Free Software Foundation; either version 2, or (at your option)
458 # any later version.
459
460 # This program is distributed in the hope that it will be useful,
461 # but WITHOUT ANY WARRANTY; without even the implied warranty of
462 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
463 # GNU General Public License for more details.
464
465 # You should have received a copy of the GNU General Public License
466 # along with this program; if not, write to the Free Software
467 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
468 # 02111-1307, USA.
469
470 # serial 1
471
472 # Check whether the underlying file-system supports filenames
473 # with a leading dot.  For instance MS-DOS doesn't.
474 AC_DEFUN([AM_SET_LEADING_DOT],
475 [rm -rf .tst 2>/dev/null
476 mkdir .tst 2>/dev/null
477 if test -d .tst; then
478   am__leading_dot=.
479 else
480   am__leading_dot=_
481 fi
482 rmdir .tst 2>/dev/null
483 AC_SUBST([am__leading_dot])])
484
485 # serial 5                                              -*- Autoconf -*-
486
487 # Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
488
489 # This program is free software; you can redistribute it and/or modify
490 # it under the terms of the GNU General Public License as published by
491 # the Free Software Foundation; either version 2, or (at your option)
492 # any later version.
493
494 # This program is distributed in the hope that it will be useful,
495 # but WITHOUT ANY WARRANTY; without even the implied warranty of
496 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
497 # GNU General Public License for more details.
498
499 # You should have received a copy of the GNU General Public License
500 # along with this program; if not, write to the Free Software
501 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
502 # 02111-1307, USA.
503
504
505 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
506 # written in clear, in which case automake, when reading aclocal.m4,
507 # will think it sees a *use*, and therefore will trigger all it's
508 # C support machinery.  Also note that it means that autoscan, seeing
509 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
510
511
512
513 # _AM_DEPENDENCIES(NAME)
514 # ----------------------
515 # See how the compiler implements dependency checking.
516 # NAME is "CC", "CXX", "GCJ", or "OBJC".
517 # We try a few techniques and use that to set a single cache variable.
518 #
519 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
520 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
521 # dependency, and given that the user is not expected to run this macro,
522 # just rely on AC_PROG_CC.
523 AC_DEFUN([_AM_DEPENDENCIES],
524 [AC_REQUIRE([AM_SET_DEPDIR])dnl
525 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
526 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
527 AC_REQUIRE([AM_DEP_TRACK])dnl
528
529 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
530        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
531        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
532        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
533                    [depcc="$$1"   am_compiler_list=])
534
535 AC_CACHE_CHECK([dependency style of $depcc],
536                [am_cv_$1_dependencies_compiler_type],
537 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
538   # We make a subdir and do the tests there.  Otherwise we can end up
539   # making bogus files that we don't know about and never remove.  For
540   # instance it was reported that on HP-UX the gcc test will end up
541   # making a dummy file named `D' -- because `-MD' means `put the output
542   # in D'.
543   mkdir conftest.dir
544   # Copy depcomp to subdir because otherwise we won't find it if we're
545   # using a relative directory.
546   cp "$am_depcomp" conftest.dir
547   cd conftest.dir
548   # We will build objects and dependencies in a subdirectory because
549   # it helps to detect inapplicable dependency modes.  For instance
550   # both Tru64's cc and ICC support -MD to output dependencies as a
551   # side effect of compilation, but ICC will put the dependencies in
552   # the current directory while Tru64 will put them in the object
553   # directory.
554   mkdir sub
555
556   am_cv_$1_dependencies_compiler_type=none
557   if test "$am_compiler_list" = ""; then
558      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
559   fi
560   for depmode in $am_compiler_list; do
561     # Setup a source with many dependencies, because some compilers
562     # like to wrap large dependency lists on column 80 (with \), and
563     # we should not choose a depcomp mode which is confused by this.
564     #
565     # We need to recreate these files for each test, as the compiler may
566     # overwrite some of them when testing with obscure command lines.
567     # This happens at least with the AIX C compiler.
568     : > sub/conftest.c
569     for i in 1 2 3 4 5 6; do
570       echo '#include "conftst'$i'.h"' >> sub/conftest.c
571       : > sub/conftst$i.h
572     done
573     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
574
575     case $depmode in
576     nosideeffect)
577       # after this tag, mechanisms are not by side-effect, so they'll
578       # only be used when explicitly requested
579       if test "x$enable_dependency_tracking" = xyes; then
580         continue
581       else
582         break
583       fi
584       ;;
585     none) break ;;
586     esac
587     # We check with `-c' and `-o' for the sake of the "dashmstdout"
588     # mode.  It turns out that the SunPro C++ compiler does not properly
589     # handle `-M -o', and we need to detect this.
590     if depmode=$depmode \
591        source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
592        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
593        $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
594          >/dev/null 2>conftest.err &&
595        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
596        grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
597        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
598       # icc doesn't choke on unknown options, it will just issue warnings
599       # (even with -Werror).  So we grep stderr for any message
600       # that says an option was ignored.
601       if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
602         am_cv_$1_dependencies_compiler_type=$depmode
603         break
604       fi
605     fi
606   done
607
608   cd ..
609   rm -rf conftest.dir
610 else
611   am_cv_$1_dependencies_compiler_type=none
612 fi
613 ])
614 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
615 AM_CONDITIONAL([am__fastdep$1], [
616   test "x$enable_dependency_tracking" != xno \
617   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
618 ])
619
620
621 # AM_SET_DEPDIR
622 # -------------
623 # Choose a directory name for dependency files.
624 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
625 AC_DEFUN([AM_SET_DEPDIR],
626 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
627 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
628 ])
629
630
631 # AM_DEP_TRACK
632 # ------------
633 AC_DEFUN([AM_DEP_TRACK],
634 [AC_ARG_ENABLE(dependency-tracking,
635 [  --disable-dependency-tracking Speeds up one-time builds
636   --enable-dependency-tracking  Do not reject slow dependency extractors])
637 if test "x$enable_dependency_tracking" != xno; then
638   am_depcomp="$ac_aux_dir/depcomp"
639   AMDEPBACKSLASH='\'
640 fi
641 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
642 AC_SUBST([AMDEPBACKSLASH])
643 ])
644
645 # Generate code to set up dependency tracking.   -*- Autoconf -*-
646
647 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
648
649 # This program is free software; you can redistribute it and/or modify
650 # it under the terms of the GNU General Public License as published by
651 # the Free Software Foundation; either version 2, or (at your option)
652 # any later version.
653
654 # This program is distributed in the hope that it will be useful,
655 # but WITHOUT ANY WARRANTY; without even the implied warranty of
656 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
657 # GNU General Public License for more details.
658
659 # You should have received a copy of the GNU General Public License
660 # along with this program; if not, write to the Free Software
661 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
662 # 02111-1307, USA.
663
664 #serial 2
665
666 # _AM_OUTPUT_DEPENDENCY_COMMANDS
667 # ------------------------------
668 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
669 [for mf in $CONFIG_FILES; do
670   # Strip MF so we end up with the name of the file.
671   mf=`echo "$mf" | sed -e 's/:.*$//'`
672   # Check whether this is an Automake generated Makefile or not.
673   # We used to match only the files named `Makefile.in', but
674   # some people rename them; so instead we look at the file content.
675   # Grep'ing the first line is not enough: some people post-process
676   # each Makefile.in and add a new line on top of each file to say so.
677   # So let's grep whole file.
678   if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
679     dirpart=`AS_DIRNAME("$mf")`
680   else
681     continue
682   fi
683   grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
684   # Extract the definition of DEP_FILES from the Makefile without
685   # running `make'.
686   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
687   test -z "$DEPDIR" && continue
688   # When using ansi2knr, U may be empty or an underscore; expand it
689   U=`sed -n -e '/^U = / s///p' < "$mf"`
690   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
691   # We invoke sed twice because it is the simplest approach to
692   # changing $(DEPDIR) to its actual value in the expansion.
693   for file in `sed -n -e '
694     /^DEP_FILES = .*\\\\$/ {
695       s/^DEP_FILES = //
696       :loop
697         s/\\\\$//
698         p
699         n
700         /\\\\$/ b loop
701       p
702     }
703     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
704        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
705     # Make sure the directory exists.
706     test -f "$dirpart/$file" && continue
707     fdir=`AS_DIRNAME(["$file"])`
708     AS_MKDIR_P([$dirpart/$fdir])
709     # echo "creating $dirpart/$file"
710     echo '# dummy' > "$dirpart/$file"
711   done
712 done
713 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
714
715
716 # AM_OUTPUT_DEPENDENCY_COMMANDS
717 # -----------------------------
718 # This macro should only be invoked once -- use via AC_REQUIRE.
719 #
720 # This code is only required when automatic dependency tracking
721 # is enabled.  FIXME.  This creates each `.P' file that we will
722 # need in order to bootstrap the dependency handling code.
723 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
724 [AC_CONFIG_COMMANDS([depfiles],
725      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
726      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
727 ])
728
729 # Check to see how 'make' treats includes.      -*- Autoconf -*-
730
731 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
732
733 # This program is free software; you can redistribute it and/or modify
734 # it under the terms of the GNU General Public License as published by
735 # the Free Software Foundation; either version 2, or (at your option)
736 # any later version.
737
738 # This program is distributed in the hope that it will be useful,
739 # but WITHOUT ANY WARRANTY; without even the implied warranty of
740 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
741 # GNU General Public License for more details.
742
743 # You should have received a copy of the GNU General Public License
744 # along with this program; if not, write to the Free Software
745 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
746 # 02111-1307, USA.
747
748 # serial 2
749
750 # AM_MAKE_INCLUDE()
751 # -----------------
752 # Check to see how make treats includes.
753 AC_DEFUN([AM_MAKE_INCLUDE],
754 [am_make=${MAKE-make}
755 cat > confinc << 'END'
756 am__doit:
757         @echo done
758 .PHONY: am__doit
759 END
760 # If we don't find an include directive, just comment out the code.
761 AC_MSG_CHECKING([for style of include used by $am_make])
762 am__include="#"
763 am__quote=
764 _am_result=none
765 # First try GNU make style include.
766 echo "include confinc" > confmf
767 # We grep out `Entering directory' and `Leaving directory'
768 # messages which can occur if `w' ends up in MAKEFLAGS.
769 # In particular we don't look at `^make:' because GNU make might
770 # be invoked under some other name (usually "gmake"), in which
771 # case it prints its new name instead of `make'.
772 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
773    am__include=include
774    am__quote=
775    _am_result=GNU
776 fi
777 # Now try BSD make style include.
778 if test "$am__include" = "#"; then
779    echo '.include "confinc"' > confmf
780    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
781       am__include=.include
782       am__quote="\""
783       _am_result=BSD
784    fi
785 fi
786 AC_SUBST([am__include])
787 AC_SUBST([am__quote])
788 AC_MSG_RESULT([$_am_result])
789 rm -f confinc confmf
790 ])
791
792 # AM_CONDITIONAL                                              -*- Autoconf -*-
793
794 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
795
796 # This program is free software; you can redistribute it and/or modify
797 # it under the terms of the GNU General Public License as published by
798 # the Free Software Foundation; either version 2, or (at your option)
799 # any later version.
800
801 # This program is distributed in the hope that it will be useful,
802 # but WITHOUT ANY WARRANTY; without even the implied warranty of
803 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
804 # GNU General Public License for more details.
805
806 # You should have received a copy of the GNU General Public License
807 # along with this program; if not, write to the Free Software
808 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
809 # 02111-1307, USA.
810
811 # serial 5
812
813 AC_PREREQ(2.52)
814
815 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
816 # -------------------------------------
817 # Define a conditional.
818 AC_DEFUN([AM_CONDITIONAL],
819 [ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
820         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
821 AC_SUBST([$1_TRUE])
822 AC_SUBST([$1_FALSE])
823 if $2; then
824   $1_TRUE=
825   $1_FALSE='#'
826 else
827   $1_TRUE='#'
828   $1_FALSE=
829 fi
830 AC_CONFIG_COMMANDS_PRE(
831 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
832   AC_MSG_ERROR([conditional "$1" was never defined.
833 Usually this means the macro was only invoked conditionally.])
834 fi])])
835
836 # Add --enable-maintainer-mode option to configure.
837 # From Jim Meyering
838
839 # Copyright 1996, 1998, 2000, 2001, 2002  Free Software Foundation, Inc.
840
841 # This program is free software; you can redistribute it and/or modify
842 # it under the terms of the GNU General Public License as published by
843 # the Free Software Foundation; either version 2, or (at your option)
844 # any later version.
845
846 # This program is distributed in the hope that it will be useful,
847 # but WITHOUT ANY WARRANTY; without even the implied warranty of
848 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
849 # GNU General Public License for more details.
850
851 # You should have received a copy of the GNU General Public License
852 # along with this program; if not, write to the Free Software
853 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
854 # 02111-1307, USA.
855
856 # serial 2
857
858 AC_DEFUN([AM_MAINTAINER_MODE],
859 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
860   dnl maintainer-mode is disabled by default
861   AC_ARG_ENABLE(maintainer-mode,
862 [  --enable-maintainer-mode enable make rules and dependencies not useful
863                           (and sometimes confusing) to the casual installer],
864       USE_MAINTAINER_MODE=$enableval,
865       USE_MAINTAINER_MODE=no)
866   AC_MSG_RESULT([$USE_MAINTAINER_MODE])
867   AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
868   MAINT=$MAINTAINER_MODE_TRUE
869   AC_SUBST(MAINT)dnl
870 ]
871 )
872
873 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
874
875 # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
876
877 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
878
879 # This program is free software; you can redistribute it and/or modify
880 # it under the terms of the GNU General Public License as published by
881 # the Free Software Foundation; either version 2, or (at your option)
882 # any later version.
883
884 # This program is distributed in the hope that it will be useful,
885 # but WITHOUT ANY WARRANTY; without even the implied warranty of
886 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
887 # GNU General Public License for more details.
888
889 # You should have received a copy of the GNU General Public License
890 # along with this program; if not, write to the Free Software
891 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
892 # 02111-1307, USA.
893
894 AC_PREREQ([2.52])
895
896 # serial 6
897
898 # AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
899 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
900
901 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
902
903 # Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>.
904 #
905 # This program is free software; you can redistribute it and/or modify
906 # it under the terms of the GNU General Public License as published by
907 # the Free Software Foundation; either version 2 of the License, or
908 # (at your option) any later version.
909 #
910 # This program is distributed in the hope that it will be useful, but
911 # WITHOUT ANY WARRANTY; without even the implied warranty of
912 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
913 # General Public License for more details.
914 #
915 # You should have received a copy of the GNU General Public License
916 # along with this program; if not, write to the Free Software
917 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
918 #
919 # As a special exception to the GNU General Public License, if you
920 # distribute this file as part of a program that contains a
921 # configuration script generated by Autoconf, you may include it under
922 # the same distribution terms that you use for the rest of that program.
923
924 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
925 # ----------------------------------
926 AC_DEFUN([PKG_PROG_PKG_CONFIG],
927 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
928 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
929 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
930 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
931         AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
932 fi
933 if test -n "$PKG_CONFIG"; then
934         _pkg_min_version=m4_default([$1], [0.9.0])
935         AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
936         if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
937                 AC_MSG_RESULT([yes])
938         else
939                 AC_MSG_RESULT([no])
940                 PKG_CONFIG=""
941         fi
942                 
943 fi[]dnl
944 ])# PKG_PROG_PKG_CONFIG
945
946 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
947 #
948 # Check to see whether a particular set of modules exists.  Similar
949 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
950 #
951 #
952 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
953 # this or PKG_CHECK_MODULES is called, or make sure to call
954 # PKG_CHECK_EXISTS manually
955 # --------------------------------------------------------------
956 AC_DEFUN([PKG_CHECK_EXISTS],
957 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
958 if test -n "$PKG_CONFIG" && \
959     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
960   m4_ifval([$2], [$2], [:])
961 m4_ifvaln([$3], [else
962   $3])dnl
963 fi])
964
965
966 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
967 # ---------------------------------------------
968 m4_define([_PKG_CONFIG],
969 [if test -n "$PKG_CONFIG"; then
970     if test -n "$$1"; then
971         pkg_cv_[]$1="$$1"
972     else
973         PKG_CHECK_EXISTS([$3],
974                          [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
975                          [pkg_failed=yes])
976     fi
977 else
978         pkg_failed=untried
979 fi[]dnl
980 ])# _PKG_CONFIG
981
982 # _PKG_SHORT_ERRORS_SUPPORTED
983 # -----------------------------
984 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
985 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
986 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
987         _pkg_short_errors_supported=yes
988 else
989         _pkg_short_errors_supported=no
990 fi[]dnl
991 ])# _PKG_SHORT_ERRORS_SUPPORTED
992
993
994 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
995 # [ACTION-IF-NOT-FOUND])
996 #
997 #
998 # Note that if there is a possibility the first call to
999 # PKG_CHECK_MODULES might not happen, you should be sure to include an
1000 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1001 #
1002 #
1003 # --------------------------------------------------------------
1004 AC_DEFUN([PKG_CHECK_MODULES],
1005 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1006 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1007 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1008
1009 pkg_failed=no
1010 AC_MSG_CHECKING([for $1])
1011
1012 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1013 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
1014
1015 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1016 and $1[]_LIBS to avoid the need to call pkg-config.
1017 See the pkg-config man page for more details.])
1018
1019 if test $pkg_failed = yes; then
1020         _PKG_SHORT_ERRORS_SUPPORTED
1021         if test $_pkg_short_errors_supported = yes; then
1022                 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
1023         else 
1024                 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1025         fi
1026         # Put the nasty error message in config.log where it belongs
1027         echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1028
1029         ifelse([$4], , [AC_MSG_ERROR(dnl
1030 [Package requirements ($2) were not met:
1031
1032 $$1_PKG_ERRORS
1033
1034 Consider adjusting the PKG_CONFIG_PATH environment variable if you
1035 installed software in a non-standard prefix.
1036
1037 _PKG_TEXT
1038 ])],
1039                 [$4])
1040 elif test $pkg_failed = untried; then
1041         ifelse([$4], , [AC_MSG_FAILURE(dnl
1042 [The pkg-config script could not be found or is too old.  Make sure it
1043 is in your PATH or set the PKG_CONFIG environment variable to the full
1044 path to pkg-config.
1045
1046 _PKG_TEXT
1047
1048 To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
1049                 [$4])
1050 else
1051         $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1052         $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1053         AC_MSG_RESULT([yes])
1054         ifelse([$3], , :, [$3])
1055 fi[]dnl
1056 ])# PKG_CHECK_MODULES
1057
1058 dnl $Id: xorg-macros.m4,v 1.8 2005/12/09 15:28:41 kem Exp $
1059 dnl
1060 dnl Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
1061 dnl 
1062 dnl Permission to use, copy, modify, distribute, and sell this software and its
1063 dnl documentation for any purpose is hereby granted without fee, provided that
1064 dnl the above copyright notice appear in all copies and that both that
1065 dnl copyright notice and this permission notice appear in supporting
1066 dnl documentation.
1067 dnl 
1068 dnl The above copyright notice and this permission notice shall be included
1069 dnl in all copies or substantial portions of the Software.
1070 dnl 
1071 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1072 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1073 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1074 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1075 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1076 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1077 dnl OTHER DEALINGS IN THE SOFTWARE.
1078 dnl 
1079 dnl Except as contained in this notice, the name of the copyright holders shall
1080 dnl not be used in advertising or otherwise to promote the sale, use or
1081 dnl other dealings in this Software without prior written authorization
1082 dnl from the copyright holders.
1083 dnl 
1084
1085 # XORG_PROG_RAWCPP()
1086 # ------------------
1087 # Find cpp program and necessary flags for use in pre-processing text files
1088 # such as man pages and config files
1089 AC_DEFUN([XORG_PROG_RAWCPP],[
1090 AC_REQUIRE([AC_PROG_CPP])
1091 AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1092    [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1093
1094 # Check for flag to avoid builtin definitions - assumes unix is predefined,
1095 # which is not the best choice for supporting other OS'es, but covers most
1096 # of the ones we need for now.
1097 AC_MSG_CHECKING([if $RAWCPP requires -undef])
1098 AC_LANG_CONFTEST([Does cpp redefine unix ?])
1099 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1100         AC_MSG_RESULT([no])
1101 else
1102         if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1103                 RAWCPPFLAGS=-undef
1104                 AC_MSG_RESULT([yes])
1105         else
1106                 AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1107         fi
1108 fi
1109 rm -f conftest.$ac_ext
1110
1111 AC_MSG_CHECKING([if $RAWCPP requires -traditional])
1112 AC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1113 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1114         AC_MSG_RESULT([no])
1115 else
1116         if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1117                 RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1118                 AC_MSG_RESULT([yes])
1119         else
1120                 AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1121         fi
1122 fi
1123 rm -f conftest.$ac_ext
1124 AC_SUBST(RAWCPPFLAGS)
1125 ]) # XORG_PROG_RAWCPP
1126
1127 # XORG_MANPAGE_SECTIONS()
1128 # -----------------------
1129 # Determine which sections man pages go in for the different man page types
1130 # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1131 # Not sure if there's any better way than just hardcoding by OS name.
1132 # Override default settings by setting environment variables
1133
1134 AC_DEFUN([XORG_MANPAGE_SECTIONS],[
1135 AC_REQUIRE([AC_CANONICAL_HOST])
1136
1137 if test x$APP_MAN_SUFFIX = x    ; then
1138     case $host_os in
1139         linux*) APP_MAN_SUFFIX=1x ;;
1140         *)      APP_MAN_SUFFIX=1  ;;
1141     esac
1142 fi
1143 if test x$APP_MAN_DIR = x    ; then
1144     case $host_os in
1145         linux*) APP_MAN_DIR='$(mandir)/man1' ;;
1146         *)      APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' ;;
1147     esac
1148 fi
1149
1150 if test x$LIB_MAN_SUFFIX = x    ; then
1151     case $host_os in
1152         linux*) LIB_MAN_SUFFIX=3x ;;
1153         *)      LIB_MAN_SUFFIX=3  ;;
1154     esac
1155 fi
1156 if test x$LIB_MAN_DIR = x    ; then
1157     case $host_os in
1158         linux*) LIB_MAN_DIR='$(mandir)/man3' ;;
1159         *)      LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' ;;
1160     esac
1161 fi
1162
1163 if test x$FILE_MAN_SUFFIX = x    ; then
1164     case $host_os in
1165         linux*)         FILE_MAN_SUFFIX=5x ;;
1166         solaris*)       FILE_MAN_SUFFIX=4  ;;
1167         *)              FILE_MAN_SUFFIX=5  ;;
1168     esac
1169 fi
1170 if test x$FILE_MAN_DIR = x    ; then
1171     case $host_os in
1172         linux*) FILE_MAN_DIR='$(mandir)/man5' ;;
1173         *)      FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' ;;
1174     esac
1175 fi
1176
1177 # In Imake's linux.cf, the misc man suffix & dir was only changed for 
1178 # LinuxDebian, not other Linuxes, so we leave it unchanged here
1179 if test x$MISC_MAN_SUFFIX = x    ; then
1180     case $host_os in
1181 #       linux*)         MISC_MAN_SUFFIX=7x ;;
1182         solaris*)       MISC_MAN_SUFFIX=5  ;;
1183         *)              MISC_MAN_SUFFIX=7  ;;
1184     esac
1185 fi
1186 if test x$MISC_MAN_DIR = x    ; then
1187     case $host_os in
1188 #       linux*) MISC_MAN_DIR='$(mandir)/man7' ;;
1189         *)      MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' ;;
1190     esac
1191 fi
1192
1193 # In Imake's linux.cf, the driver man suffix & dir was only changed for 
1194 # LinuxDebian, not other Linuxes, so we leave it unchanged here
1195 if test x$DRIVER_MAN_SUFFIX = x    ; then
1196     case $host_os in
1197 #       linux*)         DRIVER_MAN_SUFFIX=4x ;;
1198         solaris*)       DRIVER_MAN_SUFFIX=7  ;;
1199         *)              DRIVER_MAN_SUFFIX=4  ;;
1200     esac
1201 fi
1202 if test x$DRIVER_MAN_DIR = x    ; then
1203     case $host_os in
1204 #       linux*) DRIVER_MAN_DIR='$(mandir)/man4' ;;
1205         *)      DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' ;;
1206     esac
1207 fi
1208
1209 if test x$ADMIN_MAN_SUFFIX = x    ; then
1210     case $host_os in
1211         solaris*)       ADMIN_MAN_SUFFIX=1m ;;
1212         *)              ADMIN_MAN_SUFFIX=8  ;;
1213     esac
1214 fi
1215 if test x$ADMIN_MAN_DIR = x    ; then
1216     ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1217 fi
1218
1219
1220 AC_SUBST([APP_MAN_SUFFIX])
1221 AC_SUBST([LIB_MAN_SUFFIX])
1222 AC_SUBST([FILE_MAN_SUFFIX])
1223 AC_SUBST([MISC_MAN_SUFFIX])
1224 AC_SUBST([DRIVER_MAN_SUFFIX])
1225 AC_SUBST([ADMIN_MAN_SUFFIX])
1226 AC_SUBST([APP_MAN_DIR])
1227 AC_SUBST([LIB_MAN_DIR])
1228 AC_SUBST([FILE_MAN_DIR])
1229 AC_SUBST([MISC_MAN_DIR])
1230 AC_SUBST([DRIVER_MAN_DIR])
1231 AC_SUBST([ADMIN_MAN_DIR])
1232 ]) # XORG_MANPAGE_SECTIONS
1233
1234 # XORG_CHECK_LINUXDOC
1235 # -------------------
1236 # Defines the variable MAKE_TEXT if the necessary tools and
1237 # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1238 # Whether or not the necessary tools and files are found can be checked
1239 # with the AM_CONDITIONAL "BUILD_LINUXDOC"
1240 AC_DEFUN([XORG_CHECK_LINUXDOC],[
1241 AC_CHECK_FILE(
1242         [$prefix/share/X11/sgml/defs.ent], 
1243         [DEFS_ENT_PATH=$prefix/share/X11/sgml],
1244         [DEFS_ENT_PATH=]
1245 )
1246
1247 AC_PATH_PROG(LINUXDOC, linuxdoc)
1248 AC_PATH_PROG(PS2PDF, ps2pdf)
1249
1250 AC_MSG_CHECKING([Whether to build documentation])
1251
1252 if test x$DEFS_ENT_PATH != x && test x$LINUXDOC != x ; then
1253    BUILDDOC=yes
1254 else
1255    BUILDDOC=no
1256 fi
1257
1258 AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1259
1260 AC_MSG_RESULT([$BUILDDOC])
1261
1262 AC_MSG_CHECKING([Whether to build pdf documentation])
1263
1264 if test x$PS2PDF != x ; then
1265    BUILDPDFDOC=yes
1266 else
1267    BUILDPDFDOC=no
1268 fi
1269
1270 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1271
1272 AC_MSG_RESULT([$BUILDPDFDOC])
1273
1274 MAKE_TEXT="SGML_SEARCH_PATH=$DEFS_ENT_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1275 MAKE_PS="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1276 MAKE_PDF="$PS2PDF"
1277 MAKE_HTML="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC  -B html --split=0"
1278
1279 AC_SUBST(MAKE_TEXT)
1280 AC_SUBST(MAKE_PS)
1281 AC_SUBST(MAKE_PDF)
1282 AC_SUBST(MAKE_HTML)
1283 ]) # XORG_CHECK_LINUXDOC
1284
1285 # XORG_CHECK_MALLOC_ZERO
1286 # ----------------------
1287 # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1288 # malloc(0) returns NULL.  Packages should add one of these cflags to
1289 # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1290 AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1291 AC_ARG_ENABLE(malloc0returnsnull,
1292         AC_HELP_STRING([--enable-malloc0returnsnull],
1293                        [malloc(0) returns NULL (default: auto)]),
1294         [MALLOC_ZERO_RETURNS_NULL=$enableval],
1295         [MALLOC_ZERO_RETURNS_NULL=auto])
1296
1297 AC_MSG_CHECKING([whether malloc(0) returns NULL])
1298 if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1299         AC_RUN_IFELSE([
1300 char *malloc();
1301 char *realloc();
1302 char *calloc();
1303 main() {
1304     char *m0, *r0, *c0, *p;
1305     m0 = malloc(0);
1306     p = malloc(10);
1307     r0 = realloc(p,0);
1308     c0 = calloc(0);
1309     exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1310 }],
1311                 [MALLOC_ZERO_RETURNS_NULL=yes],
1312                 [MALLOC_ZERO_RETURNS_NULL=no])
1313 fi
1314 AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1315
1316 if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1317         MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1318         XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1319         XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1320 else
1321         MALLOC_ZERO_CFLAGS=""
1322         XMALLOC_ZERO_CFLAGS=""
1323         XTMALLOC_ZERO_CFLAGS=""
1324 fi
1325
1326 AC_SUBST([MALLOC_ZERO_CFLAGS])
1327 AC_SUBST([XMALLOC_ZERO_CFLAGS])
1328 AC_SUBST([XTMALLOC_ZERO_CFLAGS])
1329 ]) # XORG_CHECK_MALLOC_ZERO
1330
1331 dnl Copyright 2005 Red Hat, Inc
1332 dnl
1333 dnl Permission to use, copy, modify, distribute, and sell this software and its
1334 dnl documentation for any purpose is hereby granted without fee, provided that
1335 dnl the above copyright notice appear in all copies and that both that
1336 dnl copyright notice and this permission notice appear in supporting
1337 dnl documentation.
1338 dnl
1339 dnl The above copyright notice and this permission notice shall be included
1340 dnl in all copies or substantial portions of the Software.
1341 dnl
1342 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1343 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1344 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1345 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1346 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1347 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1348 dnl OTHER DEALINGS IN THE SOFTWARE.
1349 dnl
1350 dnl Except as contained in this notice, the name of the copyright holders shall
1351 dnl not be used in advertising or otherwise to promote the sale, use or
1352 dnl other dealings in this Software without prior written authorization
1353 dnl from the copyright holders.
1354 dnl
1355
1356 # XORG_RELEASE_VERSION
1357 # --------------------
1358 # Adds --with/without-release-string and changes the PACKAGE and
1359 # PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1360 # no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.
1361  
1362 AC_DEFUN([XORG_RELEASE_VERSION],[
1363         AC_ARG_WITH(release-version,
1364                         AC_HELP_STRING([--with-release-version=STRING],
1365                                 [Use release version string in package name]),
1366                         [RELEASE_VERSION="$withval"],
1367                         [RELEASE_VERSION=""])
1368         if test "x$RELEASE_VERSION" != "x"; then
1369                 PACKAGE="$PACKAGE-$RELEASE_VERSION"
1370                 PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1371                 AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1372         fi
1373 ])
1374