diff options
author | David Walter Seikel | 2016-03-29 02:16:55 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-03-29 02:16:55 +1000 |
commit | cb3716ffb584fe0f593b6f1669a8efdba1305104 (patch) | |
tree | 5d1ebc4b6fc17b30f4b34e7e64a2d9514893459b /src/others/mimesh/g3dviewer-0.2.99.4/aclocal.m4 | |
parent | Add Prosody build script. (diff) | |
download | SledjHamr-cb3716ffb584fe0f593b6f1669a8efdba1305104.zip SledjHamr-cb3716ffb584fe0f593b6f1669a8efdba1305104.tar.gz SledjHamr-cb3716ffb584fe0f593b6f1669a8efdba1305104.tar.bz2 SledjHamr-cb3716ffb584fe0f593b6f1669a8efdba1305104.tar.xz |
Added my version of libg3d and friends.
Diffstat (limited to 'src/others/mimesh/g3dviewer-0.2.99.4/aclocal.m4')
-rw-r--r-- | src/others/mimesh/g3dviewer-0.2.99.4/aclocal.m4 | 2064 |
1 files changed, 2064 insertions, 0 deletions
diff --git a/src/others/mimesh/g3dviewer-0.2.99.4/aclocal.m4 b/src/others/mimesh/g3dviewer-0.2.99.4/aclocal.m4 new file mode 100644 index 0000000..998ce92 --- /dev/null +++ b/src/others/mimesh/g3dviewer-0.2.99.4/aclocal.m4 | |||
@@ -0,0 +1,2064 @@ | |||
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 | # Copyright (C) 1995-2002 Free Software Foundation, Inc. | ||
863 | # Copyright (C) 2001-2003,2004 Red Hat, Inc. | ||
864 | # | ||
865 | # This file is free software, distributed under the terms of the GNU | ||
866 | # General Public License. As a special exception to the GNU General | ||
867 | # Public License, this file may be distributed as part of a program | ||
868 | # that contains a configuration script generated by Autoconf, under | ||
869 | # the same distribution terms as the rest of that program. | ||
870 | # | ||
871 | # This file can be copied and used freely without restrictions. It can | ||
872 | # be used in projects which are not available under the GNU Public License | ||
873 | # but which still want to provide support for the GNU gettext functionality. | ||
874 | # | ||
875 | # Macro to add for using GNU gettext. | ||
876 | # Ulrich Drepper <drepper@cygnus.com>, 1995, 1996 | ||
877 | # | ||
878 | # Modified to never use included libintl. | ||
879 | # Owen Taylor <otaylor@redhat.com>, 12/15/1998 | ||
880 | # | ||
881 | # Major rework to remove unused code | ||
882 | # Owen Taylor <otaylor@redhat.com>, 12/11/2002 | ||
883 | # | ||
884 | # Added better handling of ALL_LINGUAS from GNU gettext version | ||
885 | # written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002 | ||
886 | # | ||
887 | # Modified to require ngettext | ||
888 | # Matthias Clasen <mclasen@redhat.com> 08/06/2004 | ||
889 | # | ||
890 | # We need this here as well, since someone might use autoconf-2.5x | ||
891 | # to configure GLib then an older version to configure a package | ||
892 | # using AM_GLIB_GNU_GETTEXT | ||
893 | AC_PREREQ(2.53) | ||
894 | |||
895 | dnl | ||
896 | dnl We go to great lengths to make sure that aclocal won't | ||
897 | dnl try to pull in the installed version of these macros | ||
898 | dnl when running aclocal in the glib directory. | ||
899 | dnl | ||
900 | m4_copy([AC_DEFUN],[glib_DEFUN]) | ||
901 | m4_copy([AC_REQUIRE],[glib_REQUIRE]) | ||
902 | dnl | ||
903 | dnl At the end, if we're not within glib, we'll define the public | ||
904 | dnl definitions in terms of our private definitions. | ||
905 | dnl | ||
906 | |||
907 | # GLIB_LC_MESSAGES | ||
908 | #-------------------- | ||
909 | glib_DEFUN([GLIB_LC_MESSAGES], | ||
910 | [AC_CHECK_HEADERS([locale.h]) | ||
911 | if test $ac_cv_header_locale_h = yes; then | ||
912 | AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, | ||
913 | [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], | ||
914 | am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) | ||
915 | if test $am_cv_val_LC_MESSAGES = yes; then | ||
916 | AC_DEFINE(HAVE_LC_MESSAGES, 1, | ||
917 | [Define if your <locale.h> file defines LC_MESSAGES.]) | ||
918 | fi | ||
919 | fi]) | ||
920 | |||
921 | # GLIB_PATH_PROG_WITH_TEST | ||
922 | #---------------------------- | ||
923 | dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, | ||
924 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) | ||
925 | glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], | ||
926 | [# Extract the first word of "$2", so it can be a program name with args. | ||
927 | set dummy $2; ac_word=[$]2 | ||
928 | AC_MSG_CHECKING([for $ac_word]) | ||
929 | AC_CACHE_VAL(ac_cv_path_$1, | ||
930 | [case "[$]$1" in | ||
931 | /*) | ||
932 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path. | ||
933 | ;; | ||
934 | *) | ||
935 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" | ||
936 | for ac_dir in ifelse([$5], , $PATH, [$5]); do | ||
937 | test -z "$ac_dir" && ac_dir=. | ||
938 | if test -f $ac_dir/$ac_word; then | ||
939 | if [$3]; then | ||
940 | ac_cv_path_$1="$ac_dir/$ac_word" | ||
941 | break | ||
942 | fi | ||
943 | fi | ||
944 | done | ||
945 | IFS="$ac_save_ifs" | ||
946 | dnl If no 4th arg is given, leave the cache variable unset, | ||
947 | dnl so AC_PATH_PROGS will keep looking. | ||
948 | ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" | ||
949 | ])dnl | ||
950 | ;; | ||
951 | esac])dnl | ||
952 | $1="$ac_cv_path_$1" | ||
953 | if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then | ||
954 | AC_MSG_RESULT([$]$1) | ||
955 | else | ||
956 | AC_MSG_RESULT(no) | ||
957 | fi | ||
958 | AC_SUBST($1)dnl | ||
959 | ]) | ||
960 | |||
961 | # GLIB_WITH_NLS | ||
962 | #----------------- | ||
963 | glib_DEFUN([GLIB_WITH_NLS], | ||
964 | dnl NLS is obligatory | ||
965 | [USE_NLS=yes | ||
966 | AC_SUBST(USE_NLS) | ||
967 | |||
968 | gt_cv_have_gettext=no | ||
969 | |||
970 | CATOBJEXT=NONE | ||
971 | XGETTEXT=: | ||
972 | INTLLIBS= | ||
973 | |||
974 | AC_CHECK_HEADER(libintl.h, | ||
975 | [gt_cv_func_dgettext_libintl="no" | ||
976 | libintl_extra_libs="" | ||
977 | |||
978 | # | ||
979 | # First check in libc | ||
980 | # | ||
981 | AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, | ||
982 | [AC_TRY_LINK([ | ||
983 | #include <libintl.h> | ||
984 | ], | ||
985 | [return !ngettext ("","", 1)], | ||
986 | gt_cv_func_ngettext_libc=yes, | ||
987 | gt_cv_func_ngettext_libc=no) | ||
988 | ]) | ||
989 | |||
990 | if test "$gt_cv_func_ngettext_libc" = "yes" ; then | ||
991 | AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, | ||
992 | [AC_TRY_LINK([ | ||
993 | #include <libintl.h> | ||
994 | ], | ||
995 | [return !dgettext ("","")], | ||
996 | gt_cv_func_dgettext_libc=yes, | ||
997 | gt_cv_func_dgettext_libc=no) | ||
998 | ]) | ||
999 | fi | ||
1000 | |||
1001 | if test "$gt_cv_func_ngettext_libc" = "yes" ; then | ||
1002 | AC_CHECK_FUNCS(bind_textdomain_codeset) | ||
1003 | fi | ||
1004 | |||
1005 | # | ||
1006 | # If we don't have everything we want, check in libintl | ||
1007 | # | ||
1008 | if test "$gt_cv_func_dgettext_libc" != "yes" \ | ||
1009 | || test "$gt_cv_func_ngettext_libc" != "yes" \ | ||
1010 | || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then | ||
1011 | |||
1012 | AC_CHECK_LIB(intl, bindtextdomain, | ||
1013 | [AC_CHECK_LIB(intl, ngettext, | ||
1014 | [AC_CHECK_LIB(intl, dgettext, | ||
1015 | gt_cv_func_dgettext_libintl=yes)])]) | ||
1016 | |||
1017 | if test "$gt_cv_func_dgettext_libintl" != "yes" ; then | ||
1018 | AC_MSG_CHECKING([if -liconv is needed to use gettext]) | ||
1019 | AC_MSG_RESULT([]) | ||
1020 | AC_CHECK_LIB(intl, ngettext, | ||
1021 | [AC_CHECK_LIB(intl, dcgettext, | ||
1022 | [gt_cv_func_dgettext_libintl=yes | ||
1023 | libintl_extra_libs=-liconv], | ||
1024 | :,-liconv)], | ||
1025 | :,-liconv) | ||
1026 | fi | ||
1027 | |||
1028 | # | ||
1029 | # If we found libintl, then check in it for bind_textdomain_codeset(); | ||
1030 | # we'll prefer libc if neither have bind_textdomain_codeset(), | ||
1031 | # and both have dgettext and ngettext | ||
1032 | # | ||
1033 | if test "$gt_cv_func_dgettext_libintl" = "yes" ; then | ||
1034 | glib_save_LIBS="$LIBS" | ||
1035 | LIBS="$LIBS -lintl $libintl_extra_libs" | ||
1036 | unset ac_cv_func_bind_textdomain_codeset | ||
1037 | AC_CHECK_FUNCS(bind_textdomain_codeset) | ||
1038 | LIBS="$glib_save_LIBS" | ||
1039 | |||
1040 | if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then | ||
1041 | gt_cv_func_dgettext_libc=no | ||
1042 | else | ||
1043 | if test "$gt_cv_func_dgettext_libc" = "yes" \ | ||
1044 | && test "$gt_cv_func_ngettext_libc" = "yes"; then | ||
1045 | gt_cv_func_dgettext_libintl=no | ||
1046 | fi | ||
1047 | fi | ||
1048 | fi | ||
1049 | fi | ||
1050 | |||
1051 | if test "$gt_cv_func_dgettext_libc" = "yes" \ | ||
1052 | || test "$gt_cv_func_dgettext_libintl" = "yes"; then | ||
1053 | gt_cv_have_gettext=yes | ||
1054 | fi | ||
1055 | |||
1056 | if test "$gt_cv_func_dgettext_libintl" = "yes"; then | ||
1057 | INTLLIBS="-lintl $libintl_extra_libs" | ||
1058 | fi | ||
1059 | |||
1060 | if test "$gt_cv_have_gettext" = "yes"; then | ||
1061 | AC_DEFINE(HAVE_GETTEXT,1, | ||
1062 | [Define if the GNU gettext() function is already present or preinstalled.]) | ||
1063 | GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, | ||
1064 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl | ||
1065 | if test "$MSGFMT" != "no"; then | ||
1066 | glib_save_LIBS="$LIBS" | ||
1067 | LIBS="$LIBS $INTLLIBS" | ||
1068 | AC_CHECK_FUNCS(dcgettext) | ||
1069 | AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) | ||
1070 | GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, | ||
1071 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) | ||
1072 | AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; | ||
1073 | return _nl_msg_cat_cntr], | ||
1074 | [CATOBJEXT=.gmo | ||
1075 | DATADIRNAME=share], | ||
1076 | [case $host in | ||
1077 | *-*-solaris*) | ||
1078 | dnl On Solaris, if bind_textdomain_codeset is in libc, | ||
1079 | dnl GNU format message catalog is always supported, | ||
1080 | dnl since both are added to the libc all together. | ||
1081 | dnl Hence, we'd like to go with DATADIRNAME=share and | ||
1082 | dnl and CATOBJEXT=.gmo in this case. | ||
1083 | AC_CHECK_FUNC(bind_textdomain_codeset, | ||
1084 | [CATOBJEXT=.gmo | ||
1085 | DATADIRNAME=share], | ||
1086 | [CATOBJEXT=.mo | ||
1087 | DATADIRNAME=lib]) | ||
1088 | ;; | ||
1089 | *) | ||
1090 | CATOBJEXT=.mo | ||
1091 | DATADIRNAME=lib | ||
1092 | ;; | ||
1093 | esac]) | ||
1094 | LIBS="$glib_save_LIBS" | ||
1095 | INSTOBJEXT=.mo | ||
1096 | else | ||
1097 | gt_cv_have_gettext=no | ||
1098 | fi | ||
1099 | fi | ||
1100 | ]) | ||
1101 | |||
1102 | if test "$gt_cv_have_gettext" = "yes" ; then | ||
1103 | AC_DEFINE(ENABLE_NLS, 1, | ||
1104 | [always defined to indicate that i18n is enabled]) | ||
1105 | fi | ||
1106 | |||
1107 | dnl Test whether we really found GNU xgettext. | ||
1108 | if test "$XGETTEXT" != ":"; then | ||
1109 | dnl If it is not GNU xgettext we define it as : so that the | ||
1110 | dnl Makefiles still can work. | ||
1111 | if $XGETTEXT --omit-header /dev/null 2> /dev/null; then | ||
1112 | : ; | ||
1113 | else | ||
1114 | AC_MSG_RESULT( | ||
1115 | [found xgettext program is not GNU xgettext; ignore it]) | ||
1116 | XGETTEXT=":" | ||
1117 | fi | ||
1118 | fi | ||
1119 | |||
1120 | # We need to process the po/ directory. | ||
1121 | POSUB=po | ||
1122 | |||
1123 | AC_OUTPUT_COMMANDS( | ||
1124 | [case "$CONFIG_FILES" in *po/Makefile.in*) | ||
1125 | sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile | ||
1126 | esac]) | ||
1127 | |||
1128 | dnl These rules are solely for the distribution goal. While doing this | ||
1129 | dnl we only have to keep exactly one list of the available catalogs | ||
1130 | dnl in configure.in. | ||
1131 | for lang in $ALL_LINGUAS; do | ||
1132 | GMOFILES="$GMOFILES $lang.gmo" | ||
1133 | POFILES="$POFILES $lang.po" | ||
1134 | done | ||
1135 | |||
1136 | dnl Make all variables we use known to autoconf. | ||
1137 | AC_SUBST(CATALOGS) | ||
1138 | AC_SUBST(CATOBJEXT) | ||
1139 | AC_SUBST(DATADIRNAME) | ||
1140 | AC_SUBST(GMOFILES) | ||
1141 | AC_SUBST(INSTOBJEXT) | ||
1142 | AC_SUBST(INTLLIBS) | ||
1143 | AC_SUBST(PO_IN_DATADIR_TRUE) | ||
1144 | AC_SUBST(PO_IN_DATADIR_FALSE) | ||
1145 | AC_SUBST(POFILES) | ||
1146 | AC_SUBST(POSUB) | ||
1147 | ]) | ||
1148 | |||
1149 | # AM_GLIB_GNU_GETTEXT | ||
1150 | # ------------------- | ||
1151 | # Do checks necessary for use of gettext. If a suitable implementation | ||
1152 | # of gettext is found in either in libintl or in the C library, | ||
1153 | # it will set INTLLIBS to the libraries needed for use of gettext | ||
1154 | # and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable | ||
1155 | # gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() | ||
1156 | # on various variables needed by the Makefile.in.in installed by | ||
1157 | # glib-gettextize. | ||
1158 | dnl | ||
1159 | glib_DEFUN([GLIB_GNU_GETTEXT], | ||
1160 | [AC_REQUIRE([AC_PROG_CC])dnl | ||
1161 | AC_REQUIRE([AC_HEADER_STDC])dnl | ||
1162 | |||
1163 | GLIB_LC_MESSAGES | ||
1164 | GLIB_WITH_NLS | ||
1165 | |||
1166 | if test "$gt_cv_have_gettext" = "yes"; then | ||
1167 | if test "x$ALL_LINGUAS" = "x"; then | ||
1168 | LINGUAS= | ||
1169 | else | ||
1170 | AC_MSG_CHECKING(for catalogs to be installed) | ||
1171 | NEW_LINGUAS= | ||
1172 | for presentlang in $ALL_LINGUAS; do | ||
1173 | useit=no | ||
1174 | if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then | ||
1175 | desiredlanguages="$LINGUAS" | ||
1176 | else | ||
1177 | desiredlanguages="$ALL_LINGUAS" | ||
1178 | fi | ||
1179 | for desiredlang in $desiredlanguages; do | ||
1180 | # Use the presentlang catalog if desiredlang is | ||
1181 | # a. equal to presentlang, or | ||
1182 | # b. a variant of presentlang (because in this case, | ||
1183 | # presentlang can be used as a fallback for messages | ||
1184 | # which are not translated in the desiredlang catalog). | ||
1185 | case "$desiredlang" in | ||
1186 | "$presentlang"*) useit=yes;; | ||
1187 | esac | ||
1188 | done | ||
1189 | if test $useit = yes; then | ||
1190 | NEW_LINGUAS="$NEW_LINGUAS $presentlang" | ||
1191 | fi | ||
1192 | done | ||
1193 | LINGUAS=$NEW_LINGUAS | ||
1194 | AC_MSG_RESULT($LINGUAS) | ||
1195 | fi | ||
1196 | |||
1197 | dnl Construct list of names of catalog files to be constructed. | ||
1198 | if test -n "$LINGUAS"; then | ||
1199 | for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done | ||
1200 | fi | ||
1201 | fi | ||
1202 | |||
1203 | dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly | ||
1204 | dnl find the mkinstalldirs script in another subdir but ($top_srcdir). | ||
1205 | dnl Try to locate is. | ||
1206 | MKINSTALLDIRS= | ||
1207 | if test -n "$ac_aux_dir"; then | ||
1208 | MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" | ||
1209 | fi | ||
1210 | if test -z "$MKINSTALLDIRS"; then | ||
1211 | MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" | ||
1212 | fi | ||
1213 | AC_SUBST(MKINSTALLDIRS) | ||
1214 | |||
1215 | dnl Generate list of files to be processed by xgettext which will | ||
1216 | dnl be included in po/Makefile. | ||
1217 | test -d po || mkdir po | ||
1218 | if test "x$srcdir" != "x."; then | ||
1219 | if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then | ||
1220 | posrcprefix="$srcdir/" | ||
1221 | else | ||
1222 | posrcprefix="../$srcdir/" | ||
1223 | fi | ||
1224 | else | ||
1225 | posrcprefix="../" | ||
1226 | fi | ||
1227 | rm -f po/POTFILES | ||
1228 | sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ | ||
1229 | < $srcdir/po/POTFILES.in > po/POTFILES | ||
1230 | ]) | ||
1231 | |||
1232 | # AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) | ||
1233 | # ------------------------------- | ||
1234 | # Define VARIABLE to the location where catalog files will | ||
1235 | # be installed by po/Makefile. | ||
1236 | glib_DEFUN([GLIB_DEFINE_LOCALEDIR], | ||
1237 | [glib_REQUIRE([GLIB_GNU_GETTEXT])dnl | ||
1238 | glib_save_prefix="$prefix" | ||
1239 | glib_save_exec_prefix="$exec_prefix" | ||
1240 | test "x$prefix" = xNONE && prefix=$ac_default_prefix | ||
1241 | test "x$exec_prefix" = xNONE && exec_prefix=$prefix | ||
1242 | if test "x$CATOBJEXT" = "x.mo" ; then | ||
1243 | localedir=`eval echo "${libdir}/locale"` | ||
1244 | else | ||
1245 | localedir=`eval echo "${datadir}/locale"` | ||
1246 | fi | ||
1247 | prefix="$glib_save_prefix" | ||
1248 | exec_prefix="$glib_save_exec_prefix" | ||
1249 | AC_DEFINE_UNQUOTED($1, "$localedir", | ||
1250 | [Define the location where the catalogs will be installed]) | ||
1251 | ]) | ||
1252 | |||
1253 | dnl | ||
1254 | dnl Now the definitions that aclocal will find | ||
1255 | dnl | ||
1256 | ifdef(glib_configure_in,[],[ | ||
1257 | AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) | ||
1258 | AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) | ||
1259 | ])dnl | ||
1260 | |||
1261 | # Configure paths for GLIB | ||
1262 | # Owen Taylor 1997-2001 | ||
1263 | |||
1264 | dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) | ||
1265 | dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or | ||
1266 | dnl gthread is specified in MODULES, pass to pkg-config | ||
1267 | dnl | ||
1268 | AC_DEFUN([AM_PATH_GLIB_2_0], | ||
1269 | [dnl | ||
1270 | dnl Get the cflags and libraries from pkg-config | ||
1271 | dnl | ||
1272 | AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program], | ||
1273 | , enable_glibtest=yes) | ||
1274 | |||
1275 | pkg_config_args=glib-2.0 | ||
1276 | for module in . $4 | ||
1277 | do | ||
1278 | case "$module" in | ||
1279 | gmodule) | ||
1280 | pkg_config_args="$pkg_config_args gmodule-2.0" | ||
1281 | ;; | ||
1282 | gmodule-no-export) | ||
1283 | pkg_config_args="$pkg_config_args gmodule-no-export-2.0" | ||
1284 | ;; | ||
1285 | gobject) | ||
1286 | pkg_config_args="$pkg_config_args gobject-2.0" | ||
1287 | ;; | ||
1288 | gthread) | ||
1289 | pkg_config_args="$pkg_config_args gthread-2.0" | ||
1290 | ;; | ||
1291 | esac | ||
1292 | done | ||
1293 | |||
1294 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) | ||
1295 | |||
1296 | no_glib="" | ||
1297 | |||
1298 | if test x$PKG_CONFIG != xno ; then | ||
1299 | if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then | ||
1300 | : | ||
1301 | else | ||
1302 | echo *** pkg-config too old; version 0.7 or better required. | ||
1303 | no_glib=yes | ||
1304 | PKG_CONFIG=no | ||
1305 | fi | ||
1306 | else | ||
1307 | no_glib=yes | ||
1308 | fi | ||
1309 | |||
1310 | min_glib_version=ifelse([$1], ,2.0.0,$1) | ||
1311 | AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) | ||
1312 | |||
1313 | if test x$PKG_CONFIG != xno ; then | ||
1314 | ## don't try to run the test against uninstalled libtool libs | ||
1315 | if $PKG_CONFIG --uninstalled $pkg_config_args; then | ||
1316 | echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" | ||
1317 | enable_glibtest=no | ||
1318 | fi | ||
1319 | |||
1320 | if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then | ||
1321 | : | ||
1322 | else | ||
1323 | no_glib=yes | ||
1324 | fi | ||
1325 | fi | ||
1326 | |||
1327 | if test x"$no_glib" = x ; then | ||
1328 | GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` | ||
1329 | GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` | ||
1330 | GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` | ||
1331 | |||
1332 | GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` | ||
1333 | GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` | ||
1334 | glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ | ||
1335 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | ||
1336 | glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ | ||
1337 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | ||
1338 | glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ | ||
1339 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | ||
1340 | if test "x$enable_glibtest" = "xyes" ; then | ||
1341 | ac_save_CFLAGS="$CFLAGS" | ||
1342 | ac_save_LIBS="$LIBS" | ||
1343 | CFLAGS="$CFLAGS $GLIB_CFLAGS" | ||
1344 | LIBS="$GLIB_LIBS $LIBS" | ||
1345 | dnl | ||
1346 | dnl Now check if the installed GLIB is sufficiently new. (Also sanity | ||
1347 | dnl checks the results of pkg-config to some extent) | ||
1348 | dnl | ||
1349 | rm -f conf.glibtest | ||
1350 | AC_TRY_RUN([ | ||
1351 | #include <glib.h> | ||
1352 | #include <stdio.h> | ||
1353 | #include <stdlib.h> | ||
1354 | |||
1355 | int | ||
1356 | main () | ||
1357 | { | ||
1358 | int major, minor, micro; | ||
1359 | char *tmp_version; | ||
1360 | |||
1361 | system ("touch conf.glibtest"); | ||
1362 | |||
1363 | /* HP/UX 9 (%@#!) writes to sscanf strings */ | ||
1364 | tmp_version = g_strdup("$min_glib_version"); | ||
1365 | if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | ||
1366 | printf("%s, bad version string\n", "$min_glib_version"); | ||
1367 | exit(1); | ||
1368 | } | ||
1369 | |||
1370 | if ((glib_major_version != $glib_config_major_version) || | ||
1371 | (glib_minor_version != $glib_config_minor_version) || | ||
1372 | (glib_micro_version != $glib_config_micro_version)) | ||
1373 | { | ||
1374 | printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", | ||
1375 | $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, | ||
1376 | glib_major_version, glib_minor_version, glib_micro_version); | ||
1377 | printf ("*** was found! If pkg-config was correct, then it is best\n"); | ||
1378 | printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); | ||
1379 | printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); | ||
1380 | printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); | ||
1381 | printf("*** required on your system.\n"); | ||
1382 | printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); | ||
1383 | printf("*** to point to the correct configuration files\n"); | ||
1384 | } | ||
1385 | else if ((glib_major_version != GLIB_MAJOR_VERSION) || | ||
1386 | (glib_minor_version != GLIB_MINOR_VERSION) || | ||
1387 | (glib_micro_version != GLIB_MICRO_VERSION)) | ||
1388 | { | ||
1389 | printf("*** GLIB header files (version %d.%d.%d) do not match\n", | ||
1390 | GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); | ||
1391 | printf("*** library (version %d.%d.%d)\n", | ||
1392 | glib_major_version, glib_minor_version, glib_micro_version); | ||
1393 | } | ||
1394 | else | ||
1395 | { | ||
1396 | if ((glib_major_version > major) || | ||
1397 | ((glib_major_version == major) && (glib_minor_version > minor)) || | ||
1398 | ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) | ||
1399 | { | ||
1400 | return 0; | ||
1401 | } | ||
1402 | else | ||
1403 | { | ||
1404 | printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", | ||
1405 | glib_major_version, glib_minor_version, glib_micro_version); | ||
1406 | printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", | ||
1407 | major, minor, micro); | ||
1408 | printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); | ||
1409 | printf("***\n"); | ||
1410 | printf("*** If you have already installed a sufficiently new version, this error\n"); | ||
1411 | printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); | ||
1412 | printf("*** being found. The easiest way to fix this is to remove the old version\n"); | ||
1413 | printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); | ||
1414 | printf("*** correct copy of pkg-config. (In this case, you will have to\n"); | ||
1415 | printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); | ||
1416 | printf("*** so that the correct libraries are found at run-time))\n"); | ||
1417 | } | ||
1418 | } | ||
1419 | return 1; | ||
1420 | } | ||
1421 | ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | ||
1422 | CFLAGS="$ac_save_CFLAGS" | ||
1423 | LIBS="$ac_save_LIBS" | ||
1424 | fi | ||
1425 | fi | ||
1426 | if test "x$no_glib" = x ; then | ||
1427 | AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)) | ||
1428 | ifelse([$2], , :, [$2]) | ||
1429 | else | ||
1430 | AC_MSG_RESULT(no) | ||
1431 | if test "$PKG_CONFIG" = "no" ; then | ||
1432 | echo "*** A new enough version of pkg-config was not found." | ||
1433 | echo "*** See http://www.freedesktop.org/software/pkgconfig/" | ||
1434 | else | ||
1435 | if test -f conf.glibtest ; then | ||
1436 | : | ||
1437 | else | ||
1438 | echo "*** Could not run GLIB test program, checking why..." | ||
1439 | ac_save_CFLAGS="$CFLAGS" | ||
1440 | ac_save_LIBS="$LIBS" | ||
1441 | CFLAGS="$CFLAGS $GLIB_CFLAGS" | ||
1442 | LIBS="$LIBS $GLIB_LIBS" | ||
1443 | AC_TRY_LINK([ | ||
1444 | #include <glib.h> | ||
1445 | #include <stdio.h> | ||
1446 | ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], | ||
1447 | [ echo "*** The test program compiled, but did not run. This usually means" | ||
1448 | echo "*** that the run-time linker is not finding GLIB or finding the wrong" | ||
1449 | echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" | ||
1450 | echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | ||
1451 | echo "*** to the installed location Also, make sure you have run ldconfig if that" | ||
1452 | echo "*** is required on your system" | ||
1453 | echo "***" | ||
1454 | echo "*** If you have an old version installed, it is best to remove it, although" | ||
1455 | echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], | ||
1456 | [ echo "*** The test program failed to compile or link. See the file config.log for the" | ||
1457 | echo "*** exact error that occured. This usually means GLIB is incorrectly installed."]) | ||
1458 | CFLAGS="$ac_save_CFLAGS" | ||
1459 | LIBS="$ac_save_LIBS" | ||
1460 | fi | ||
1461 | fi | ||
1462 | GLIB_CFLAGS="" | ||
1463 | GLIB_LIBS="" | ||
1464 | GLIB_GENMARSHAL="" | ||
1465 | GOBJECT_QUERY="" | ||
1466 | GLIB_MKENUMS="" | ||
1467 | ifelse([$3], , :, [$3]) | ||
1468 | fi | ||
1469 | AC_SUBST(GLIB_CFLAGS) | ||
1470 | AC_SUBST(GLIB_LIBS) | ||
1471 | AC_SUBST(GLIB_GENMARSHAL) | ||
1472 | AC_SUBST(GOBJECT_QUERY) | ||
1473 | AC_SUBST(GLIB_MKENUMS) | ||
1474 | rm -f conf.glibtest | ||
1475 | ]) | ||
1476 | |||
1477 | # Configure paths for GTK+ | ||
1478 | # Owen Taylor 1997-2001 | ||
1479 | |||
1480 | dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) | ||
1481 | dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, | ||
1482 | dnl pass to pkg-config | ||
1483 | dnl | ||
1484 | AC_DEFUN([AM_PATH_GTK_2_0], | ||
1485 | [dnl | ||
1486 | dnl Get the cflags and libraries from pkg-config | ||
1487 | dnl | ||
1488 | AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], | ||
1489 | , enable_gtktest=yes) | ||
1490 | |||
1491 | pkg_config_args=gtk+-2.0 | ||
1492 | for module in . $4 | ||
1493 | do | ||
1494 | case "$module" in | ||
1495 | gthread) | ||
1496 | pkg_config_args="$pkg_config_args gthread-2.0" | ||
1497 | ;; | ||
1498 | esac | ||
1499 | done | ||
1500 | |||
1501 | no_gtk="" | ||
1502 | |||
1503 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) | ||
1504 | |||
1505 | if test x$PKG_CONFIG != xno ; then | ||
1506 | if pkg-config --atleast-pkgconfig-version 0.7 ; then | ||
1507 | : | ||
1508 | else | ||
1509 | echo "*** pkg-config too old; version 0.7 or better required." | ||
1510 | no_gtk=yes | ||
1511 | PKG_CONFIG=no | ||
1512 | fi | ||
1513 | else | ||
1514 | no_gtk=yes | ||
1515 | fi | ||
1516 | |||
1517 | min_gtk_version=ifelse([$1], ,2.0.0,$1) | ||
1518 | AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) | ||
1519 | |||
1520 | if test x$PKG_CONFIG != xno ; then | ||
1521 | ## don't try to run the test against uninstalled libtool libs | ||
1522 | if $PKG_CONFIG --uninstalled $pkg_config_args; then | ||
1523 | echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" | ||
1524 | enable_gtktest=no | ||
1525 | fi | ||
1526 | |||
1527 | if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then | ||
1528 | : | ||
1529 | else | ||
1530 | no_gtk=yes | ||
1531 | fi | ||
1532 | fi | ||
1533 | |||
1534 | if test x"$no_gtk" = x ; then | ||
1535 | GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` | ||
1536 | GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` | ||
1537 | gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ | ||
1538 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | ||
1539 | gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ | ||
1540 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | ||
1541 | gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ | ||
1542 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | ||
1543 | if test "x$enable_gtktest" = "xyes" ; then | ||
1544 | ac_save_CFLAGS="$CFLAGS" | ||
1545 | ac_save_LIBS="$LIBS" | ||
1546 | CFLAGS="$CFLAGS $GTK_CFLAGS" | ||
1547 | LIBS="$GTK_LIBS $LIBS" | ||
1548 | dnl | ||
1549 | dnl Now check if the installed GTK+ is sufficiently new. (Also sanity | ||
1550 | dnl checks the results of pkg-config to some extent) | ||
1551 | dnl | ||
1552 | rm -f conf.gtktest | ||
1553 | AC_TRY_RUN([ | ||
1554 | #include <gtk/gtk.h> | ||
1555 | #include <stdio.h> | ||
1556 | #include <stdlib.h> | ||
1557 | |||
1558 | int | ||
1559 | main () | ||
1560 | { | ||
1561 | int major, minor, micro; | ||
1562 | char *tmp_version; | ||
1563 | |||
1564 | system ("touch conf.gtktest"); | ||
1565 | |||
1566 | /* HP/UX 9 (%@#!) writes to sscanf strings */ | ||
1567 | tmp_version = g_strdup("$min_gtk_version"); | ||
1568 | if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | ||
1569 | printf("%s, bad version string\n", "$min_gtk_version"); | ||
1570 | exit(1); | ||
1571 | } | ||
1572 | |||
1573 | if ((gtk_major_version != $gtk_config_major_version) || | ||
1574 | (gtk_minor_version != $gtk_config_minor_version) || | ||
1575 | (gtk_micro_version != $gtk_config_micro_version)) | ||
1576 | { | ||
1577 | printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", | ||
1578 | $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, | ||
1579 | gtk_major_version, gtk_minor_version, gtk_micro_version); | ||
1580 | printf ("*** was found! If pkg-config was correct, then it is best\n"); | ||
1581 | printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); | ||
1582 | printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); | ||
1583 | printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); | ||
1584 | printf("*** required on your system.\n"); | ||
1585 | printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); | ||
1586 | printf("*** to point to the correct configuration files\n"); | ||
1587 | } | ||
1588 | else if ((gtk_major_version != GTK_MAJOR_VERSION) || | ||
1589 | (gtk_minor_version != GTK_MINOR_VERSION) || | ||
1590 | (gtk_micro_version != GTK_MICRO_VERSION)) | ||
1591 | { | ||
1592 | printf("*** GTK+ header files (version %d.%d.%d) do not match\n", | ||
1593 | GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); | ||
1594 | printf("*** library (version %d.%d.%d)\n", | ||
1595 | gtk_major_version, gtk_minor_version, gtk_micro_version); | ||
1596 | } | ||
1597 | else | ||
1598 | { | ||
1599 | if ((gtk_major_version > major) || | ||
1600 | ((gtk_major_version == major) && (gtk_minor_version > minor)) || | ||
1601 | ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) | ||
1602 | { | ||
1603 | return 0; | ||
1604 | } | ||
1605 | else | ||
1606 | { | ||
1607 | printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", | ||
1608 | gtk_major_version, gtk_minor_version, gtk_micro_version); | ||
1609 | printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", | ||
1610 | major, minor, micro); | ||
1611 | printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); | ||
1612 | printf("***\n"); | ||
1613 | printf("*** If you have already installed a sufficiently new version, this error\n"); | ||
1614 | printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); | ||
1615 | printf("*** being found. The easiest way to fix this is to remove the old version\n"); | ||
1616 | printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); | ||
1617 | printf("*** correct copy of pkg-config. (In this case, you will have to\n"); | ||
1618 | printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); | ||
1619 | printf("*** so that the correct libraries are found at run-time))\n"); | ||
1620 | } | ||
1621 | } | ||
1622 | return 1; | ||
1623 | } | ||
1624 | ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | ||
1625 | CFLAGS="$ac_save_CFLAGS" | ||
1626 | LIBS="$ac_save_LIBS" | ||
1627 | fi | ||
1628 | fi | ||
1629 | if test "x$no_gtk" = x ; then | ||
1630 | AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) | ||
1631 | ifelse([$2], , :, [$2]) | ||
1632 | else | ||
1633 | AC_MSG_RESULT(no) | ||
1634 | if test "$PKG_CONFIG" = "no" ; then | ||
1635 | echo "*** A new enough version of pkg-config was not found." | ||
1636 | echo "*** See http://pkgconfig.sourceforge.net" | ||
1637 | else | ||
1638 | if test -f conf.gtktest ; then | ||
1639 | : | ||
1640 | else | ||
1641 | echo "*** Could not run GTK+ test program, checking why..." | ||
1642 | ac_save_CFLAGS="$CFLAGS" | ||
1643 | ac_save_LIBS="$LIBS" | ||
1644 | CFLAGS="$CFLAGS $GTK_CFLAGS" | ||
1645 | LIBS="$LIBS $GTK_LIBS" | ||
1646 | AC_TRY_LINK([ | ||
1647 | #include <gtk/gtk.h> | ||
1648 | #include <stdio.h> | ||
1649 | ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], | ||
1650 | [ echo "*** The test program compiled, but did not run. This usually means" | ||
1651 | echo "*** that the run-time linker is not finding GTK+ or finding the wrong" | ||
1652 | echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" | ||
1653 | echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | ||
1654 | echo "*** to the installed location Also, make sure you have run ldconfig if that" | ||
1655 | echo "*** is required on your system" | ||
1656 | echo "***" | ||
1657 | echo "*** If you have an old version installed, it is best to remove it, although" | ||
1658 | echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], | ||
1659 | [ echo "*** The test program failed to compile or link. See the file config.log for the" | ||
1660 | echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."]) | ||
1661 | CFLAGS="$ac_save_CFLAGS" | ||
1662 | LIBS="$ac_save_LIBS" | ||
1663 | fi | ||
1664 | fi | ||
1665 | GTK_CFLAGS="" | ||
1666 | GTK_LIBS="" | ||
1667 | ifelse([$3], , :, [$3]) | ||
1668 | fi | ||
1669 | AC_SUBST(GTK_CFLAGS) | ||
1670 | AC_SUBST(GTK_LIBS) | ||
1671 | rm -f conf.gtktest | ||
1672 | ]) | ||
1673 | |||
1674 | # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- | ||
1675 | # | ||
1676 | # Copyright © 2004 Scott James Remnant <scott@netsplit.com>. | ||
1677 | # | ||
1678 | # This program is free software; you can redistribute it and/or modify | ||
1679 | # it under the terms of the GNU General Public License as published by | ||
1680 | # the Free Software Foundation; either version 2 of the License, or | ||
1681 | # (at your option) any later version. | ||
1682 | # | ||
1683 | # This program is distributed in the hope that it will be useful, but | ||
1684 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1685 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
1686 | # General Public License for more details. | ||
1687 | # | ||
1688 | # You should have received a copy of the GNU General Public License | ||
1689 | # along with this program; if not, write to the Free Software | ||
1690 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
1691 | # | ||
1692 | # As a special exception to the GNU General Public License, if you | ||
1693 | # distribute this file as part of a program that contains a | ||
1694 | # configuration script generated by Autoconf, you may include it under | ||
1695 | # the same distribution terms that you use for the rest of that program. | ||
1696 | |||
1697 | # PKG_PROG_PKG_CONFIG([MIN-VERSION]) | ||
1698 | # ---------------------------------- | ||
1699 | AC_DEFUN([PKG_PROG_PKG_CONFIG], | ||
1700 | [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) | ||
1701 | m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) | ||
1702 | AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl | ||
1703 | if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then | ||
1704 | AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) | ||
1705 | fi | ||
1706 | if test -n "$PKG_CONFIG"; then | ||
1707 | _pkg_min_version=m4_ifval([$1], [$1], [0.9.0]) | ||
1708 | AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) | ||
1709 | if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then | ||
1710 | AC_MSG_RESULT([yes]) | ||
1711 | else | ||
1712 | AC_MSG_RESULT([no]) | ||
1713 | PKG_CONFIG="" | ||
1714 | fi | ||
1715 | |||
1716 | fi[]dnl | ||
1717 | ])# PKG_PROG_PKG_CONFIG | ||
1718 | |||
1719 | # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) | ||
1720 | # | ||
1721 | # Check to see whether a particular set of modules exists. Similar | ||
1722 | # to PKG_CHECK_MODULES(), but does not set variables or print errors. | ||
1723 | # | ||
1724 | # | ||
1725 | # Similar to PKG_CHECK_MODULES, make sure that the first instance of | ||
1726 | # this or PKG_CHECK_MODULES is called, or make sure to call | ||
1727 | # PKG_CHECK_EXISTS manually | ||
1728 | # -------------------------------------------------------------- | ||
1729 | AC_DEFUN([PKG_CHECK_EXISTS], | ||
1730 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl | ||
1731 | if test -n "$PKG_CONFIG" && \ | ||
1732 | AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then | ||
1733 | m4_ifval([$2], [$2], [:]) | ||
1734 | m4_ifvaln([$3], [else | ||
1735 | $3])dnl | ||
1736 | fi]) | ||
1737 | |||
1738 | |||
1739 | # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) | ||
1740 | # --------------------------------------------- | ||
1741 | m4_define([_PKG_CONFIG], | ||
1742 | [if test -n "$PKG_CONFIG"; then | ||
1743 | PKG_CHECK_EXISTS([$3], | ||
1744 | [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], | ||
1745 | [pkg_failed=yes]) | ||
1746 | else | ||
1747 | pkg_failed=untried | ||
1748 | fi[]dnl | ||
1749 | ])# _PKG_CONFIG | ||
1750 | |||
1751 | # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], | ||
1752 | # [ACTION-IF-NOT-FOUND]) | ||
1753 | # | ||
1754 | # | ||
1755 | # Note that if there is a possibility the first call to | ||
1756 | # PKG_CHECK_MODULES might not happen, you should be sure to include an | ||
1757 | # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac | ||
1758 | # | ||
1759 | # | ||
1760 | # -------------------------------------------------------------- | ||
1761 | AC_DEFUN([PKG_CHECK_MODULES], | ||
1762 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl | ||
1763 | AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl | ||
1764 | AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl | ||
1765 | |||
1766 | pkg_failed=no | ||
1767 | AC_MSG_CHECKING([for $1]) | ||
1768 | |||
1769 | _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) | ||
1770 | _PKG_CONFIG([$1][_LIBS], [libs], [$2]) | ||
1771 | |||
1772 | if test $pkg_failed = yes; then | ||
1773 | $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` | ||
1774 | # Put the nasty error message in config.log where it belongs | ||
1775 | echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD | ||
1776 | |||
1777 | ifelse([$4], , [AC_MSG_ERROR(dnl | ||
1778 | [Package requirements ($2) were not met. | ||
1779 | Consider adjusting the PKG_CONFIG_PATH environment variable if you | ||
1780 | installed software in a non-standard prefix. | ||
1781 | |||
1782 | Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables | ||
1783 | to avoid the need to call pkg-config. See the pkg-config man page for | ||
1784 | more details.])], | ||
1785 | [$4]) | ||
1786 | elif test $pkg_failed = untried; then | ||
1787 | ifelse([$4], , [AC_MSG_FAILURE(dnl | ||
1788 | [The pkg-config script could not be found or is too old. Make sure it | ||
1789 | is in your PATH or set the PKG_CONFIG environment variable to the full | ||
1790 | path to pkg-config. | ||
1791 | |||
1792 | Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables | ||
1793 | to avoid the need to call pkg-config. See the pkg-config man page for | ||
1794 | more details. | ||
1795 | |||
1796 | To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])], | ||
1797 | [$4]) | ||
1798 | else | ||
1799 | $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS | ||
1800 | $1[]_LIBS=$pkg_cv_[]$1[]_LIBS | ||
1801 | AC_MSG_RESULT([yes]) | ||
1802 | ifelse([$3], , :, [$3]) | ||
1803 | fi[]dnl | ||
1804 | ])# PKG_CHECK_MODULES | ||
1805 | |||
1806 | # Configure paths for GtkGLExt | ||
1807 | # Naofumi Yasufuku | ||
1808 | # | ||
1809 | # Shamelessly stolen from gtk-2.0.m4 | ||
1810 | # Configure paths for GTK+ | ||
1811 | # Owen Taylor 1997-2001 | ||
1812 | |||
1813 | dnl AM_PATH_GTKGLEXT_1_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) | ||
1814 | dnl Test for GtkGLExt, and define GTKGLEXT_CFLAGS and GTKGLEXT_LIBS. | ||
1815 | dnl | ||
1816 | AC_DEFUN([AM_PATH_GTKGLEXT_1_0], | ||
1817 | [ no_gtkglext="" | ||
1818 | GTKGLEXT_CFLAGS="" | ||
1819 | GTKGLEXT_LIBS="" | ||
1820 | |||
1821 | # GtkGLExt pkg-config module | ||
1822 | gtkglext_module=gtkglext-1.0 | ||
1823 | |||
1824 | # minimum GtkGLExt version | ||
1825 | gtkglext_min_version=ifelse([$1], ,1.0.0,$1) | ||
1826 | |||
1827 | # minimum pkg-config version | ||
1828 | pkgconfig_min_version=0.7 | ||
1829 | |||
1830 | AC_ARG_ENABLE(gtkglext-test, | ||
1831 | [ --disable-gtkglext-test do not try to compile and run a test GtkGLExt program], | ||
1832 | , enable_gtkglext_test=yes) | ||
1833 | |||
1834 | dnl | ||
1835 | dnl Get the cflags and libraries from pkg-config | ||
1836 | dnl | ||
1837 | pkg_config_modules=$gtkglext_module | ||
1838 | |||
1839 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) | ||
1840 | |||
1841 | if test x$PKG_CONFIG != xno ; then | ||
1842 | if pkg-config --atleast-pkgconfig-version $pkgconfig_min_version ; then | ||
1843 | : | ||
1844 | else | ||
1845 | echo "" | ||
1846 | echo "*** pkg-config too old; version $pkgconfig_min_version or better required." | ||
1847 | no_gtkglext=yes | ||
1848 | PKG_CONFIG=no | ||
1849 | fi | ||
1850 | else | ||
1851 | no_gtkglext=yes | ||
1852 | fi | ||
1853 | |||
1854 | AC_MSG_CHECKING(for GtkGLExt - version >= $gtkglext_min_version) | ||
1855 | |||
1856 | if test x$PKG_CONFIG != xno ; then | ||
1857 | ## don't try to run the test against uninstalled libtool libs | ||
1858 | if $PKG_CONFIG --uninstalled $pkg_config_modules; then | ||
1859 | echo "" | ||
1860 | echo "Will use uninstalled version of GtkGLExt found in PKG_CONFIG_PATH" | ||
1861 | enable_gtkglext_test=no | ||
1862 | fi | ||
1863 | |||
1864 | if $PKG_CONFIG --atleast-version $gtkglext_min_version $pkg_config_modules; then | ||
1865 | : | ||
1866 | else | ||
1867 | echo "" | ||
1868 | echo "*** pkg-config cannot find $gtkglext_module >= $gtkglext_min_version" | ||
1869 | echo "*** Set the environment variable PKG_CONFIG_PATH to point to the correct" | ||
1870 | echo "*** configuration files." | ||
1871 | no_gtkglext=yes | ||
1872 | enable_gtkglext_test=no | ||
1873 | fi | ||
1874 | fi | ||
1875 | |||
1876 | if test x"$no_gtkglext" = x ; then | ||
1877 | GTKGLEXT_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_modules` | ||
1878 | GTKGLEXT_LIBS=`$PKG_CONFIG --libs $pkg_config_modules` | ||
1879 | gtkglext_config_major_version=`$PKG_CONFIG --modversion $gtkglext_module | \ | ||
1880 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | ||
1881 | gtkglext_config_minor_version=`$PKG_CONFIG --modversion $gtkglext_module | \ | ||
1882 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | ||
1883 | gtkglext_config_micro_version=`$PKG_CONFIG --modversion $gtkglext_module | \ | ||
1884 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | ||
1885 | if test "x$enable_gtkglext_test" = "xyes" ; then | ||
1886 | ac_save_CFLAGS="$CFLAGS" | ||
1887 | ac_save_LIBS="$LIBS" | ||
1888 | CFLAGS="$CFLAGS $GTKGLEXT_CFLAGS" | ||
1889 | LIBS="$GTKGLEXT_LIBS $LIBS" | ||
1890 | dnl | ||
1891 | dnl Now check if the installed GtkGLExt is sufficiently new. (Also sanity | ||
1892 | dnl checks the results of pkg-config to some extent) | ||
1893 | dnl | ||
1894 | rm -f conf.gtkgltest | ||
1895 | AC_TRY_RUN([ | ||
1896 | #include <gtk/gtk.h> | ||
1897 | #include <gtk/gtkgl.h> | ||
1898 | #include <stdio.h> | ||
1899 | #include <stdlib.h> | ||
1900 | |||
1901 | int | ||
1902 | main () | ||
1903 | { | ||
1904 | int major, minor, micro; | ||
1905 | char *tmp_version; | ||
1906 | |||
1907 | system ("touch conf.gtkgltest"); | ||
1908 | |||
1909 | /* HP/UX 9 (%@#!) writes to sscanf strings */ | ||
1910 | tmp_version = g_strdup ("$gtkglext_min_version"); | ||
1911 | if (sscanf (tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) | ||
1912 | { | ||
1913 | printf ("%s, bad version string\n", "$gtkglext_min_version"); | ||
1914 | exit (1); | ||
1915 | } | ||
1916 | |||
1917 | if ((gtkglext_major_version != $gtkglext_config_major_version) || | ||
1918 | (gtkglext_minor_version != $gtkglext_config_minor_version) || | ||
1919 | (gtkglext_micro_version != $gtkglext_config_micro_version)) | ||
1920 | { | ||
1921 | printf ("\n*** 'pkg-config --modversion $gtkglext_module' returned %d.%d.%d, but GtkGLExt\n", | ||
1922 | $gtkglext_config_major_version, $gtkglext_config_minor_version, $gtkglext_config_micro_version); | ||
1923 | printf ("*** library %d.%d.%d was found!\n", | ||
1924 | gtkglext_major_version, gtkglext_minor_version, gtkglext_micro_version); | ||
1925 | printf ("***\n"); | ||
1926 | printf ("*** If pkg-config was correct, then it is best to remove the old version\n"); | ||
1927 | printf ("*** of GtkGLExt. You may also be able to fix the error by modifying your\n"); | ||
1928 | printf ("*** LD_LIBRARY_PATH enviroment variable, or by editing /etc/ld.so.conf.\n"); | ||
1929 | printf ("*** Make sure you have run ldconfig if that is required on your system.\n"); | ||
1930 | printf ("***\n"); | ||
1931 | printf ("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); | ||
1932 | printf ("*** to point to the correct configuration files.\n"); | ||
1933 | } | ||
1934 | else if ((gtkglext_major_version != GTKGLEXT_MAJOR_VERSION) || | ||
1935 | (gtkglext_minor_version != GTKGLEXT_MINOR_VERSION) || | ||
1936 | (gtkglext_micro_version != GTKGLEXT_MICRO_VERSION)) | ||
1937 | { | ||
1938 | printf ("\n*** GtkGLExt header files (version %d.%d.%d) do not match library (version %d.%d.%d).\n", | ||
1939 | GTKGLEXT_MAJOR_VERSION, GTKGLEXT_MINOR_VERSION, GTKGLEXT_MICRO_VERSION, | ||
1940 | gtkglext_major_version, gtkglext_minor_version, gtkglext_micro_version); | ||
1941 | } | ||
1942 | else | ||
1943 | { | ||
1944 | if ((gtkglext_major_version > major) || | ||
1945 | ((gtkglext_major_version == major) && (gtkglext_minor_version > minor)) || | ||
1946 | ((gtkglext_major_version == major) && (gtkglext_minor_version == minor) && (gtkglext_micro_version >= micro))) | ||
1947 | { | ||
1948 | return 0; | ||
1949 | } | ||
1950 | else | ||
1951 | { | ||
1952 | printf ("\n*** An old version of GtkGLExt library (%d.%d.%d) was found.\n", | ||
1953 | gtkglext_major_version, gtkglext_minor_version, gtkglext_micro_version); | ||
1954 | printf ("*** You need a version of GtkGLExt newer than %d.%d.%d. The latest version of\n", | ||
1955 | major, minor, micro); | ||
1956 | printf ("*** GtkGLExt is always available from http://gtkglext.sourceforge.net/.\n"); | ||
1957 | printf ("***\n"); | ||
1958 | printf ("*** If you have already installed a sufficiently new version, this error\n"); | ||
1959 | printf ("*** probably means that the wrong copy of the pkg-config shell script is\n"); | ||
1960 | printf ("*** being found. The easiest way to fix this is to remove the old version\n"); | ||
1961 | printf ("*** of GtkGLExt, but you can also set the PKG_CONFIG environment to point\n"); | ||
1962 | printf ("*** to the correct copy of pkg-config. (In this case, you will have to\n"); | ||
1963 | printf ("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); | ||
1964 | printf ("*** so that the correct libraries are found at run-time)\n"); | ||
1965 | } | ||
1966 | } | ||
1967 | return 1; | ||
1968 | } | ||
1969 | ],, no_gtkglext=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | ||
1970 | CFLAGS="$ac_save_CFLAGS" | ||
1971 | LIBS="$ac_save_LIBS" | ||
1972 | fi | ||
1973 | fi | ||
1974 | if test "x$no_gtkglext" = x ; then | ||
1975 | AC_MSG_RESULT(yes (version $gtkglext_config_major_version.$gtkglext_config_minor_version.$gtkglext_config_micro_version)) | ||
1976 | ifelse([$2], , :, [$2]) | ||
1977 | else | ||
1978 | AC_MSG_RESULT(no) | ||
1979 | if test "$PKG_CONFIG" = "no" ; then | ||
1980 | echo "*** A new enough version of pkg-config was not found." | ||
1981 | echo "*** See http://www.freedesktop.org/software/pkgconfig/." | ||
1982 | elif test "x$enable_gtkglext_test" = "xyes" ; then | ||
1983 | if test -f conf.gtkgltest ; then | ||
1984 | : | ||
1985 | else | ||
1986 | echo "*** Could not run GtkGLExt test program, checking why..." | ||
1987 | ac_save_CFLAGS="$CFLAGS" | ||
1988 | ac_save_LIBS="$LIBS" | ||
1989 | CFLAGS="$CFLAGS $GTKGLEXT_CFLAGS" | ||
1990 | LIBS="$LIBS $GTKGLEXT_LIBS" | ||
1991 | AC_TRY_LINK([ | ||
1992 | #include <gtk/gtk.h> | ||
1993 | #include <gtk/gtkgl.h> | ||
1994 | #include <stdio.h> | ||
1995 | ], [ return ((gtkglext_major_version) || (gtkglext_minor_version) || (gtkglext_micro_version)); ], | ||
1996 | [ echo "*** The test program compiled, but did not run. This usually means" | ||
1997 | echo "*** that the run-time linker is not finding GtkGLExt or finding the wrong" | ||
1998 | echo "*** version of GtkGLExt. If it is not finding GtkGLExt, you'll need to set your" | ||
1999 | echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | ||
2000 | echo "*** to the installed location Also, make sure you have run ldconfig if that" | ||
2001 | echo "*** is required on your system" | ||
2002 | echo "***" | ||
2003 | echo "*** If you have an old version installed, it is best to remove it, although" | ||
2004 | echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], | ||
2005 | [ echo "*** The test program failed to compile or link. See the file config.log for the" | ||
2006 | echo "*** exact error that occured. This usually means GtkGLExt is incorrectly installed."]) | ||
2007 | CFLAGS="$ac_save_CFLAGS" | ||
2008 | LIBS="$ac_save_LIBS" | ||
2009 | fi | ||
2010 | fi | ||
2011 | GTKGLEXT_CFLAGS="" | ||
2012 | GTKGLEXT_LIBS="" | ||
2013 | ifelse([$3], , :, [$3]) | ||
2014 | fi | ||
2015 | AC_SUBST(GTKGLEXT_CFLAGS) | ||
2016 | AC_SUBST(GTKGLEXT_LIBS) | ||
2017 | rm -f conf.gtkgltest | ||
2018 | ]) | ||
2019 | |||
2020 | dnl AC_GTKGLEXT_SUPPORTS_MULTIHEAD([ACTION-IF-SUPPORTED [, ACTION-IF-NOT-SUPPORTED]]) | ||
2021 | dnl Checks whether GtkGLExt supports multihead. | ||
2022 | dnl | ||
2023 | AC_DEFUN([AC_GTKGLEXT_SUPPORTS_MULTIHEAD], | ||
2024 | [ AC_CACHE_CHECK([whether GtkGLExt supports multihead], | ||
2025 | [ac_cv_gtkglext_supports_multihead], | ||
2026 | [AC_TRY_LINK([#include <gdk/gdkglquery.h>], | ||
2027 | [gdk_gl_query_extension_for_display(gdk_display_get_default());], | ||
2028 | [ac_cv_gtkglext_supports_multihead=yes], | ||
2029 | [ac_cv_gtkglext_supports_multihead=no])]) | ||
2030 | if test "x$ac_cv_gtkglext_supports_multihead" = "xyes" ; then | ||
2031 | ifelse([$1], , :, [$1]) | ||
2032 | else | ||
2033 | ifelse([$2], , :, [$2]) | ||
2034 | fi | ||
2035 | ]) | ||
2036 | |||
2037 | dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) | ||
2038 | dnl | ||
2039 | dnl This macro _AC_DEFINEs VARNAME to the expansion of the DIR | ||
2040 | dnl variable, taking care of fixing up ${prefix} and such. | ||
2041 | dnl | ||
2042 | dnl Note that the 3 argument form is only supported with autoconf 2.13 and | ||
2043 | dnl later (i.e. only where _AC_DEFINE supports 3 arguments). | ||
2044 | dnl | ||
2045 | dnl Examples: | ||
2046 | dnl | ||
2047 | dnl AC_DEFINE_DIR(DATADIR, datadir) | ||
2048 | dnl AC_DEFINE_DIR(PROG_PATH, bindir, [Location of installed binaries]) | ||
2049 | dnl | ||
2050 | dnl @version $Id: acinclude.m4 25 2006-04-22 17:24:27Z mmmaddd $ | ||
2051 | dnl @author Guido Draheim <guidod@gmx.de>, original by Alexandre Oliva | ||
2052 | |||
2053 | AC_DEFUN([AC_DEFINE_DIR], [ | ||
2054 | test "x$prefix" = xNONE && prefix="$ac_default_prefix" | ||
2055 | test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' | ||
2056 | ac_define_dir=`eval echo [$]$2` | ||
2057 | ac_define_dir=`eval echo [$]ac_define_dir` | ||
2058 | ifelse($3, , | ||
2059 | AC_DEFINE_UNQUOTED($1, "$ac_define_dir"), | ||
2060 | AC_DEFINE_UNQUOTED($1, "$ac_define_dir", $3)) | ||
2061 | ]) | ||
2062 | |||
2063 | |||
2064 | |||