1 | dnl aclocal.m4 generated automatically by aclocal 1.4-p6 |
---|
2 | |
---|
3 | dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. |
---|
4 | dnl This file is free software; the Free Software Foundation |
---|
5 | dnl gives unlimited permission to copy and/or distribute it, |
---|
6 | dnl with or without modifications, as long as this notice is preserved. |
---|
7 | |
---|
8 | dnl This program is distributed in the hope that it will be useful, |
---|
9 | dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without |
---|
10 | dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
---|
11 | dnl PARTICULAR PURPOSE. |
---|
12 | |
---|
13 | # Like AC_CONFIG_HEADER, but automatically create stamp file. |
---|
14 | |
---|
15 | AC_DEFUN([AM_CONFIG_HEADER], |
---|
16 | [AC_PREREQ([2.12]) |
---|
17 | AC_CONFIG_HEADER([$1]) |
---|
18 | dnl When config.status generates a header, we must update the stamp-h file. |
---|
19 | dnl This file resides in the same directory as the config header |
---|
20 | dnl that is generated. We must strip everything past the first ":", |
---|
21 | dnl and everything past the last "/". |
---|
22 | AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl |
---|
23 | ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, |
---|
24 | <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, |
---|
25 | <<am_indx=1 |
---|
26 | for am_file in <<$1>>; do |
---|
27 | case " <<$>>CONFIG_HEADERS " in |
---|
28 | *" <<$>>am_file "*<<)>> |
---|
29 | echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx |
---|
30 | ;; |
---|
31 | esac |
---|
32 | am_indx=`expr "<<$>>am_indx" + 1` |
---|
33 | done<<>>dnl>>) |
---|
34 | changequote([,]))]) |
---|
35 | |
---|
36 | # Do all the work for Automake. This macro actually does too much -- |
---|
37 | # some checks are only needed if your package does certain things. |
---|
38 | # But this isn't really a big deal. |
---|
39 | |
---|
40 | # serial 1 |
---|
41 | |
---|
42 | dnl Usage: |
---|
43 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) |
---|
44 | |
---|
45 | AC_DEFUN([AM_INIT_AUTOMAKE], |
---|
46 | [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl |
---|
47 | AC_REQUIRE([AC_PROG_INSTALL]) |
---|
48 | PACKAGE=[$1] |
---|
49 | AC_SUBST(PACKAGE) |
---|
50 | VERSION=[$2] |
---|
51 | AC_SUBST(VERSION) |
---|
52 | dnl test to see if srcdir already configured |
---|
53 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then |
---|
54 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) |
---|
55 | fi |
---|
56 | ifelse([$3],, |
---|
57 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) |
---|
58 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) |
---|
59 | AC_REQUIRE([AM_SANITY_CHECK]) |
---|
60 | AC_REQUIRE([AC_ARG_PROGRAM]) |
---|
61 | dnl FIXME This is truly gross. |
---|
62 | missing_dir=`cd $ac_aux_dir && pwd` |
---|
63 | AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir) |
---|
64 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) |
---|
65 | AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir) |
---|
66 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) |
---|
67 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) |
---|
68 | AC_REQUIRE([AC_PROG_MAKE_SET])]) |
---|
69 | |
---|
70 | # Copyright 2002 Free Software Foundation, Inc. |
---|
71 | |
---|
72 | # This program is free software; you can redistribute it and/or modify |
---|
73 | # it under the terms of the GNU General Public License as published by |
---|
74 | # the Free Software Foundation; either version 2, or (at your option) |
---|
75 | # any later version. |
---|
76 | |
---|
77 | # This program is distributed in the hope that it will be useful, |
---|
78 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
79 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
80 | # GNU General Public License for more details. |
---|
81 | |
---|
82 | # You should have received a copy of the GNU General Public License |
---|
83 | # along with this program; if not, write to the Free Software |
---|
84 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
---|
85 | |
---|
86 | # AM_AUTOMAKE_VERSION(VERSION) |
---|
87 | # ---------------------------- |
---|
88 | # Automake X.Y traces this macro to ensure aclocal.m4 has been |
---|
89 | # generated from the m4 files accompanying Automake X.Y. |
---|
90 | AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"]) |
---|
91 | |
---|
92 | # AM_SET_CURRENT_AUTOMAKE_VERSION |
---|
93 | # ------------------------------- |
---|
94 | # Call AM_AUTOMAKE_VERSION so it can be traced. |
---|
95 | # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. |
---|
96 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], |
---|
97 | [AM_AUTOMAKE_VERSION([1.4-p6])]) |
---|
98 | |
---|
99 | # |
---|
100 | # Check to make sure that the build environment is sane. |
---|
101 | # |
---|
102 | |
---|
103 | AC_DEFUN([AM_SANITY_CHECK], |
---|
104 | [AC_MSG_CHECKING([whether build environment is sane]) |
---|
105 | # Just in case |
---|
106 | sleep 1 |
---|
107 | echo timestamp > conftestfile |
---|
108 | # Do `set' in a subshell so we don't clobber the current shell's |
---|
109 | # arguments. Must try -L first in case configure is actually a |
---|
110 | # symlink; some systems play weird games with the mod time of symlinks |
---|
111 | # (eg FreeBSD returns the mod time of the symlink's containing |
---|
112 | # directory). |
---|
113 | if ( |
---|
114 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` |
---|
115 | if test "[$]*" = "X"; then |
---|
116 | # -L didn't work. |
---|
117 | set X `ls -t $srcdir/configure conftestfile` |
---|
118 | fi |
---|
119 | if test "[$]*" != "X $srcdir/configure conftestfile" \ |
---|
120 | && test "[$]*" != "X conftestfile $srcdir/configure"; then |
---|
121 | |
---|
122 | # If neither matched, then we have a broken ls. This can happen |
---|
123 | # if, for instance, CONFIG_SHELL is bash and it inherits a |
---|
124 | # broken ls alias from the environment. This has actually |
---|
125 | # happened. Such a system could not be considered "sane". |
---|
126 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken |
---|
127 | alias in your environment]) |
---|
128 | fi |
---|
129 | |
---|
130 | test "[$]2" = conftestfile |
---|
131 | ) |
---|
132 | then |
---|
133 | # Ok. |
---|
134 | : |
---|
135 | else |
---|
136 | AC_MSG_ERROR([newly created file is older than distributed files! |
---|
137 | Check your system clock]) |
---|
138 | fi |
---|
139 | rm -f conftest* |
---|
140 | AC_MSG_RESULT(yes)]) |
---|
141 | |
---|
142 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) |
---|
143 | dnl The program must properly implement --version. |
---|
144 | AC_DEFUN([AM_MISSING_PROG], |
---|
145 | [AC_MSG_CHECKING(for working $2) |
---|
146 | # Run test in a subshell; some versions of sh will print an error if |
---|
147 | # an executable is not found, even if stderr is redirected. |
---|
148 | # Redirect stdin to placate older versions of autoconf. Sigh. |
---|
149 | if ($2 --version) < /dev/null > /dev/null 2>&1; then |
---|
150 | $1=$2 |
---|
151 | AC_MSG_RESULT(found) |
---|
152 | else |
---|
153 | $1="$3/missing $2" |
---|
154 | AC_MSG_RESULT(missing) |
---|
155 | fi |
---|
156 | AC_SUBST($1)]) |
---|
157 | |
---|
158 | # Add --enable-maintainer-mode option to configure. |
---|
159 | # From Jim Meyering |
---|
160 | |
---|
161 | # serial 1 |
---|
162 | |
---|
163 | AC_DEFUN([AM_MAINTAINER_MODE], |
---|
164 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) |
---|
165 | dnl maintainer-mode is disabled by default |
---|
166 | AC_ARG_ENABLE(maintainer-mode, |
---|
167 | [ --enable-maintainer-mode enable make rules and dependencies not useful |
---|
168 | (and sometimes confusing) to the casual installer], |
---|
169 | USE_MAINTAINER_MODE=$enableval, |
---|
170 | USE_MAINTAINER_MODE=no) |
---|
171 | AC_MSG_RESULT($USE_MAINTAINER_MODE) |
---|
172 | AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) |
---|
173 | MAINT=$MAINTAINER_MODE_TRUE |
---|
174 | AC_SUBST(MAINT)dnl |
---|
175 | ] |
---|
176 | ) |
---|
177 | |
---|
178 | # Define a conditional. |
---|
179 | |
---|
180 | AC_DEFUN([AM_CONDITIONAL], |
---|
181 | [AC_SUBST($1_TRUE) |
---|
182 | AC_SUBST($1_FALSE) |
---|
183 | if $2; then |
---|
184 | $1_TRUE= |
---|
185 | $1_FALSE='#' |
---|
186 | else |
---|
187 | $1_TRUE='#' |
---|
188 | $1_FALSE= |
---|
189 | fi]) |
---|
190 | |
---|
191 | # isc-posix.m4 serial 2 (gettext-0.11.2) |
---|
192 | dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. |
---|
193 | dnl This file is free software, distributed under the terms of the GNU |
---|
194 | dnl General Public License. As a special exception to the GNU General |
---|
195 | dnl Public License, this file may be distributed as part of a program |
---|
196 | dnl that contains a configuration script generated by Autoconf, under |
---|
197 | dnl the same distribution terms as the rest of that program. |
---|
198 | |
---|
199 | # This file is not needed with autoconf-2.53 and newer. Remove it in 2005. |
---|
200 | |
---|
201 | # This test replaces the one in autoconf. |
---|
202 | # Currently this macro should have the same name as the autoconf macro |
---|
203 | # because gettext's gettext.m4 (distributed in the automake package) |
---|
204 | # still uses it. Otherwise, the use in gettext.m4 makes autoheader |
---|
205 | # give these diagnostics: |
---|
206 | # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX |
---|
207 | # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX |
---|
208 | |
---|
209 | undefine([AC_ISC_POSIX]) |
---|
210 | |
---|
211 | AC_DEFUN([AC_ISC_POSIX], |
---|
212 | [ |
---|
213 | dnl This test replaces the obsolescent AC_ISC_POSIX kludge. |
---|
214 | AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) |
---|
215 | ] |
---|
216 | ) |
---|
217 | |
---|
218 | # Copyright (C) 1995-2002 Free Software Foundation, Inc. |
---|
219 | # Copyright (C) 2001-2003 Red Hat, Inc. |
---|
220 | # |
---|
221 | # This file is free software, distributed under the terms of the GNU |
---|
222 | # General Public License. As a special exception to the GNU General |
---|
223 | # Public License, this file may be distributed as part of a program |
---|
224 | # that contains a configuration script generated by Autoconf, under |
---|
225 | # the same distribution terms as the rest of that program. |
---|
226 | # |
---|
227 | # This file can be copied and used freely without restrictions. It can |
---|
228 | # be used in projects which are not available under the GNU Public License |
---|
229 | # but which still want to provide support for the GNU gettext functionality. |
---|
230 | # |
---|
231 | # Macro to add for using GNU gettext. |
---|
232 | # Ulrich Drepper <drepper@cygnus.com>, 1995, 1996 |
---|
233 | # |
---|
234 | # Modified to never use included libintl. |
---|
235 | # Owen Taylor <otaylor@redhat.com>, 12/15/1998 |
---|
236 | # |
---|
237 | # Major rework to remove unused code |
---|
238 | # Owen Taylor <otaylor@redhat.com>, 12/11/2002 |
---|
239 | # |
---|
240 | # Added better handling of ALL_LINGUAS from GNU gettext version |
---|
241 | # written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002 |
---|
242 | |
---|
243 | # |
---|
244 | # We need this here as well, since someone might use autoconf-2.5x |
---|
245 | # to configure GLib then an older version to configure a package |
---|
246 | # using AM_GLIB_GNU_GETTEXT |
---|
247 | AC_PREREQ(2.53) |
---|
248 | |
---|
249 | dnl |
---|
250 | dnl We go to great lengths to make sure that aclocal won't |
---|
251 | dnl try to pull in the installed version of these macros |
---|
252 | dnl when running aclocal in the glib directory. |
---|
253 | dnl |
---|
254 | m4_copy([AC_DEFUN],[glib_DEFUN]) |
---|
255 | m4_copy([AC_REQUIRE],[glib_REQUIRE]) |
---|
256 | dnl |
---|
257 | dnl At the end, if we're not within glib, we'll define the public |
---|
258 | dnl definitions in terms of our private definitions. |
---|
259 | dnl |
---|
260 | |
---|
261 | # GLIB_LC_MESSAGES |
---|
262 | #-------------------- |
---|
263 | glib_DEFUN([GLIB_LC_MESSAGES], |
---|
264 | [AC_CHECK_HEADERS([locale.h]) |
---|
265 | if test $ac_cv_header_locale_h = yes; then |
---|
266 | AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, |
---|
267 | [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], |
---|
268 | am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) |
---|
269 | if test $am_cv_val_LC_MESSAGES = yes; then |
---|
270 | AC_DEFINE(HAVE_LC_MESSAGES, 1, |
---|
271 | [Define if your <locale.h> file defines LC_MESSAGES.]) |
---|
272 | fi |
---|
273 | fi]) |
---|
274 | |
---|
275 | # GLIB_PATH_PROG_WITH_TEST |
---|
276 | #---------------------------- |
---|
277 | dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, |
---|
278 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) |
---|
279 | glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], |
---|
280 | [# Extract the first word of "$2", so it can be a program name with args. |
---|
281 | set dummy $2; ac_word=[$]2 |
---|
282 | AC_MSG_CHECKING([for $ac_word]) |
---|
283 | AC_CACHE_VAL(ac_cv_path_$1, |
---|
284 | [case "[$]$1" in |
---|
285 | /*) |
---|
286 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path. |
---|
287 | ;; |
---|
288 | *) |
---|
289 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" |
---|
290 | for ac_dir in ifelse([$5], , $PATH, [$5]); do |
---|
291 | test -z "$ac_dir" && ac_dir=. |
---|
292 | if test -f $ac_dir/$ac_word; then |
---|
293 | if [$3]; then |
---|
294 | ac_cv_path_$1="$ac_dir/$ac_word" |
---|
295 | break |
---|
296 | fi |
---|
297 | fi |
---|
298 | done |
---|
299 | IFS="$ac_save_ifs" |
---|
300 | dnl If no 4th arg is given, leave the cache variable unset, |
---|
301 | dnl so AC_PATH_PROGS will keep looking. |
---|
302 | ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" |
---|
303 | ])dnl |
---|
304 | ;; |
---|
305 | esac])dnl |
---|
306 | $1="$ac_cv_path_$1" |
---|
307 | if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then |
---|
308 | AC_MSG_RESULT([$]$1) |
---|
309 | else |
---|
310 | AC_MSG_RESULT(no) |
---|
311 | fi |
---|
312 | AC_SUBST($1)dnl |
---|
313 | ]) |
---|
314 | |
---|
315 | # GLIB_WITH_NLS |
---|
316 | #----------------- |
---|
317 | glib_DEFUN([GLIB_WITH_NLS], |
---|
318 | dnl NLS is obligatory |
---|
319 | [USE_NLS=yes |
---|
320 | AC_SUBST(USE_NLS) |
---|
321 | |
---|
322 | gt_cv_have_gettext=no |
---|
323 | |
---|
324 | CATOBJEXT=NONE |
---|
325 | XGETTEXT=: |
---|
326 | INTLLIBS= |
---|
327 | |
---|
328 | AC_CHECK_HEADER(libintl.h, |
---|
329 | [gt_cv_func_dgettext_libintl="no" |
---|
330 | libintl_extra_libs="" |
---|
331 | |
---|
332 | # |
---|
333 | # First check in libc |
---|
334 | # |
---|
335 | AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, |
---|
336 | [AC_TRY_LINK([ |
---|
337 | #include <libintl.h> |
---|
338 | ], |
---|
339 | [return (int) dgettext ("","")], |
---|
340 | gt_cv_func_dgettext_libc=yes, |
---|
341 | gt_cv_func_dgettext_libc=no) |
---|
342 | ]) |
---|
343 | |
---|
344 | if test "$gt_cv_func_dgettext_libc" = "yes" ; then |
---|
345 | AC_CHECK_FUNCS(bind_textdomain_codeset) |
---|
346 | fi |
---|
347 | |
---|
348 | # |
---|
349 | # If we don't have everything we want, check in libintl |
---|
350 | # |
---|
351 | if test "$gt_cv_func_dgettext_libc" != "yes" \ |
---|
352 | || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then |
---|
353 | |
---|
354 | AC_CHECK_LIB(intl, bindtextdomain, |
---|
355 | [AC_CHECK_LIB(intl, dgettext, |
---|
356 | gt_cv_func_dgettext_libintl=yes)]) |
---|
357 | |
---|
358 | if test "$gt_cv_func_dgettext_libintl" != "yes" ; then |
---|
359 | AC_MSG_CHECKING([if -liconv is needed to use gettext]) |
---|
360 | AC_MSG_RESULT([]) |
---|
361 | AC_CHECK_LIB(intl, dcgettext, |
---|
362 | [gt_cv_func_dgettext_libintl=yes |
---|
363 | libintl_extra_libs=-liconv], |
---|
364 | :,-liconv) |
---|
365 | fi |
---|
366 | |
---|
367 | # |
---|
368 | # If we found libintl, then check in it for bind_textdomain_codeset(); |
---|
369 | # we'll prefer libc if neither have bind_textdomain_codeset(), |
---|
370 | # and both have dgettext |
---|
371 | # |
---|
372 | if test "$gt_cv_func_dgettext_libintl" = "yes" ; then |
---|
373 | glib_save_LIBS="$LIBS" |
---|
374 | LIBS="$LIBS -lintl $libintl_extra_libs" |
---|
375 | unset ac_cv_func_bind_textdomain_codeset |
---|
376 | AC_CHECK_FUNCS(bind_textdomain_codeset) |
---|
377 | LIBS="$glib_save_LIBS" |
---|
378 | |
---|
379 | if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then |
---|
380 | gt_cv_func_dgettext_libc=no |
---|
381 | else |
---|
382 | if test "$gt_cv_func_dgettext_libc" = "yes"; then |
---|
383 | gt_cv_func_dgettext_libintl=no |
---|
384 | fi |
---|
385 | fi |
---|
386 | fi |
---|
387 | fi |
---|
388 | |
---|
389 | if test "$gt_cv_func_dgettext_libc" = "yes" \ |
---|
390 | || test "$gt_cv_func_dgettext_libintl" = "yes"; then |
---|
391 | gt_cv_have_gettext=yes |
---|
392 | fi |
---|
393 | |
---|
394 | if test "$gt_cv_func_dgettext_libintl" = "yes"; then |
---|
395 | INTLLIBS="-lintl $libintl_extra_libs" |
---|
396 | fi |
---|
397 | |
---|
398 | if test "$gt_cv_have_gettext" = "yes"; then |
---|
399 | AC_DEFINE(HAVE_GETTEXT,1, |
---|
400 | [Define if the GNU gettext() function is already present or preinstalled.]) |
---|
401 | GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, |
---|
402 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl |
---|
403 | if test "$MSGFMT" != "no"; then |
---|
404 | glib_save_LIBS="$LIBS" |
---|
405 | LIBS="$LIBS $INTLLIBS" |
---|
406 | AC_CHECK_FUNCS(dcgettext) |
---|
407 | AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) |
---|
408 | GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, |
---|
409 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) |
---|
410 | AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; |
---|
411 | return _nl_msg_cat_cntr], |
---|
412 | [CATOBJEXT=.gmo |
---|
413 | DATADIRNAME=share], |
---|
414 | [case $host in |
---|
415 | *-*-solaris*) |
---|
416 | dnl On Solaris, if bind_textdomain_codeset is in libc, |
---|
417 | dnl GNU format message catalog is always supported, |
---|
418 | dnl since both are added to the libc all together. |
---|
419 | dnl Hence, we'd like to go with DATADIRNAME=share and |
---|
420 | dnl and CATOBJEXT=.gmo in this case. |
---|
421 | AC_CHECK_FUNC(bind_textdomain_codeset, |
---|
422 | [CATOBJEXT=.gmo |
---|
423 | DATADIRNAME=share], |
---|
424 | [CATOBJEXT=.mo |
---|
425 | DATADIRNAME=lib]) |
---|
426 | ;; |
---|
427 | *) |
---|
428 | CATOBJEXT=.mo |
---|
429 | DATADIRNAME=lib |
---|
430 | ;; |
---|
431 | esac]) |
---|
432 | LIBS="$glib_save_LIBS" |
---|
433 | INSTOBJEXT=.mo |
---|
434 | else |
---|
435 | gt_cv_have_gettext=no |
---|
436 | fi |
---|
437 | fi |
---|
438 | ]) |
---|
439 | |
---|
440 | if test "$gt_cv_have_gettext" = "yes" ; then |
---|
441 | AC_DEFINE(ENABLE_NLS, 1, |
---|
442 | [always defined to indicate that i18n is enabled]) |
---|
443 | fi |
---|
444 | |
---|
445 | dnl Test whether we really found GNU xgettext. |
---|
446 | if test "$XGETTEXT" != ":"; then |
---|
447 | dnl If it is not GNU xgettext we define it as : so that the |
---|
448 | dnl Makefiles still can work. |
---|
449 | if $XGETTEXT --omit-header /dev/null 2> /dev/null; then |
---|
450 | : ; |
---|
451 | else |
---|
452 | AC_MSG_RESULT( |
---|
453 | [found xgettext program is not GNU xgettext; ignore it]) |
---|
454 | XGETTEXT=":" |
---|
455 | fi |
---|
456 | fi |
---|
457 | |
---|
458 | # We need to process the po/ directory. |
---|
459 | POSUB=po |
---|
460 | |
---|
461 | AC_OUTPUT_COMMANDS( |
---|
462 | [case "$CONFIG_FILES" in *po/Makefile.in*) |
---|
463 | sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile |
---|
464 | esac]) |
---|
465 | |
---|
466 | dnl These rules are solely for the distribution goal. While doing this |
---|
467 | dnl we only have to keep exactly one list of the available catalogs |
---|
468 | dnl in configure.in. |
---|
469 | for lang in $ALL_LINGUAS; do |
---|
470 | GMOFILES="$GMOFILES $lang.gmo" |
---|
471 | POFILES="$POFILES $lang.po" |
---|
472 | done |
---|
473 | |
---|
474 | dnl Make all variables we use known to autoconf. |
---|
475 | AC_SUBST(CATALOGS) |
---|
476 | AC_SUBST(CATOBJEXT) |
---|
477 | AC_SUBST(DATADIRNAME) |
---|
478 | AC_SUBST(GMOFILES) |
---|
479 | AC_SUBST(INSTOBJEXT) |
---|
480 | AC_SUBST(INTLLIBS) |
---|
481 | AC_SUBST(PO_IN_DATADIR_TRUE) |
---|
482 | AC_SUBST(PO_IN_DATADIR_FALSE) |
---|
483 | AC_SUBST(POFILES) |
---|
484 | AC_SUBST(POSUB) |
---|
485 | ]) |
---|
486 | |
---|
487 | # AM_GLIB_GNU_GETTEXT |
---|
488 | # ------------------- |
---|
489 | # Do checks necessary for use of gettext. If a suitable implementation |
---|
490 | # of gettext is found in either in libintl or in the C library, |
---|
491 | # it will set INTLLIBS to the libraries needed for use of gettext |
---|
492 | # and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable |
---|
493 | # gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() |
---|
494 | # on various variables needed by the Makefile.in.in installed by |
---|
495 | # glib-gettextize. |
---|
496 | dnl |
---|
497 | glib_DEFUN([GLIB_GNU_GETTEXT], |
---|
498 | [AC_REQUIRE([AC_PROG_CC])dnl |
---|
499 | AC_REQUIRE([AC_HEADER_STDC])dnl |
---|
500 | |
---|
501 | GLIB_LC_MESSAGES |
---|
502 | GLIB_WITH_NLS |
---|
503 | |
---|
504 | if test "$gt_cv_have_gettext" = "yes"; then |
---|
505 | if test "x$ALL_LINGUAS" = "x"; then |
---|
506 | LINGUAS= |
---|
507 | else |
---|
508 | AC_MSG_CHECKING(for catalogs to be installed) |
---|
509 | NEW_LINGUAS= |
---|
510 | for presentlang in $ALL_LINGUAS; do |
---|
511 | useit=no |
---|
512 | if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then |
---|
513 | desiredlanguages="$LINGUAS" |
---|
514 | else |
---|
515 | desiredlanguages="$ALL_LINGUAS" |
---|
516 | fi |
---|
517 | for desiredlang in $desiredlanguages; do |
---|
518 | # Use the presentlang catalog if desiredlang is |
---|
519 | # a. equal to presentlang, or |
---|
520 | # b. a variant of presentlang (because in this case, |
---|
521 | # presentlang can be used as a fallback for messages |
---|
522 | # which are not translated in the desiredlang catalog). |
---|
523 | case "$desiredlang" in |
---|
524 | "$presentlang"*) useit=yes;; |
---|
525 | esac |
---|
526 | done |
---|
527 | if test $useit = yes; then |
---|
528 | NEW_LINGUAS="$NEW_LINGUAS $presentlang" |
---|
529 | fi |
---|
530 | done |
---|
531 | LINGUAS=$NEW_LINGUAS |
---|
532 | AC_MSG_RESULT($LINGUAS) |
---|
533 | fi |
---|
534 | |
---|
535 | dnl Construct list of names of catalog files to be constructed. |
---|
536 | if test -n "$LINGUAS"; then |
---|
537 | for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done |
---|
538 | fi |
---|
539 | fi |
---|
540 | |
---|
541 | dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly |
---|
542 | dnl find the mkinstalldirs script in another subdir but ($top_srcdir). |
---|
543 | dnl Try to locate is. |
---|
544 | MKINSTALLDIRS= |
---|
545 | if test -n "$ac_aux_dir"; then |
---|
546 | MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" |
---|
547 | fi |
---|
548 | if test -z "$MKINSTALLDIRS"; then |
---|
549 | MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" |
---|
550 | fi |
---|
551 | AC_SUBST(MKINSTALLDIRS) |
---|
552 | |
---|
553 | dnl Generate list of files to be processed by xgettext which will |
---|
554 | dnl be included in po/Makefile. |
---|
555 | test -d po || mkdir po |
---|
556 | if test "x$srcdir" != "x."; then |
---|
557 | if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then |
---|
558 | posrcprefix="$srcdir/" |
---|
559 | else |
---|
560 | posrcprefix="../$srcdir/" |
---|
561 | fi |
---|
562 | else |
---|
563 | posrcprefix="../" |
---|
564 | fi |
---|
565 | rm -f po/POTFILES |
---|
566 | sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ |
---|
567 | < $srcdir/po/POTFILES.in > po/POTFILES |
---|
568 | ]) |
---|
569 | |
---|
570 | # AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) |
---|
571 | # ------------------------------- |
---|
572 | # Define VARIABLE to the location where catalog files will |
---|
573 | # be installed by po/Makefile. |
---|
574 | glib_DEFUN([GLIB_DEFINE_LOCALEDIR], |
---|
575 | [glib_REQUIRE([GLIB_GNU_GETTEXT])dnl |
---|
576 | glib_save_prefix="$prefix" |
---|
577 | glib_save_exec_prefix="$exec_prefix" |
---|
578 | test "x$prefix" = xNONE && prefix=$ac_default_prefix |
---|
579 | test "x$exec_prefix" = xNONE && exec_prefix=$prefix |
---|
580 | if test "x$CATOBJEXT" = "x.mo" ; then |
---|
581 | localedir=`eval echo "${libdir}/locale"` |
---|
582 | else |
---|
583 | localedir=`eval echo "${datadir}/locale"` |
---|
584 | fi |
---|
585 | prefix="$glib_save_prefix" |
---|
586 | exec_prefix="$glib_save_exec_prefix" |
---|
587 | AC_DEFINE_UNQUOTED($1, "$localedir", |
---|
588 | [Define the location where the catalogs will be installed]) |
---|
589 | ]) |
---|
590 | |
---|
591 | dnl |
---|
592 | dnl Now the definitions that aclocal will find |
---|
593 | dnl |
---|
594 | ifdef(glib_configure_in,[],[ |
---|
595 | AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) |
---|
596 | AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) |
---|
597 | ])dnl |
---|
598 | |
---|
599 | ll## intltool.m4 - Configure intltool for the target system. -*-Shell-script-*- |
---|
600 | |
---|
601 | dnl AC_PROG_INTLTOOL([MINIMUM-VERSION]) |
---|
602 | # serial 1 AC_PROG_INTLTOOL |
---|
603 | AC_DEFUN([AC_PROG_INTLTOOL], |
---|
604 | [ |
---|
605 | |
---|
606 | if test -n "$1"; then |
---|
607 | AC_MSG_CHECKING(for intltool >= $1) |
---|
608 | |
---|
609 | INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ printf "%d", $[1] * 100 + $[2]; }'` |
---|
610 | INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { printf $[2]; }' < ${ac_aux_dir}/intltool-update.in` |
---|
611 | changequote({{,}}) |
---|
612 | INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split(${{2}}, VERSION, "."); printf "%d\n", VERSION[1] * 100 + VERSION[2];}' < ${ac_aux_dir}/intltool-update.in` |
---|
613 | changequote([,]) |
---|
614 | |
---|
615 | if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT"; then |
---|
616 | AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found]) |
---|
617 | else |
---|
618 | AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found. Your intltool is too old. You need intltool $1 or later.]) |
---|
619 | exit 1 |
---|
620 | fi |
---|
621 | fi |
---|
622 | |
---|
623 | INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -d -u -c $(top_builddir)/po/.intltool-merge-cache' |
---|
624 | INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -d -u -c $(top_builddir)/po/.intltool-merge-cache' |
---|
625 | INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -k -u -c $(top_builddir)/po/.intltool-merge-cache' |
---|
626 | INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -d -u -c $(top_builddir)/po/.intltool-merge-cache' |
---|
627 | INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -o -p' |
---|
628 | INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -x -u -c $(top_builddir)/po/.intltool-merge-cache' |
---|
629 | INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -o -u -c $(top_builddir)/po/.intltool-merge-cache' |
---|
630 | INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -x -u -c $(top_builddir)/po/.intltool-merge-cache' |
---|
631 | INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -d -u -c $(top_builddir)/po/.intltool-merge-cache' |
---|
632 | INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -x -u -c $(top_builddir)/po/.intltool-merge-cache' |
---|
633 | INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -x -u -c $(top_builddir)/po/.intltool-merge-cache' |
---|
634 | INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -x -u -c $(top_builddir)/po/.intltool-merge-cache' |
---|
635 | INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -x -u -m -c $(top_builddir)/po/.intltool-merge-cache' |
---|
636 | INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -d -u -c $(top_builddir)/po/.intltool-merge-cache' |
---|
637 | INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -s -u -c $(top_builddir)/po/.intltool-merge-cache' |
---|
638 | INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -d -u -c $(top_builddir)/po/.intltool-merge-cache' |
---|
639 | |
---|
640 | AC_SUBST(INTLTOOL_DESKTOP_RULE) |
---|
641 | AC_SUBST(INTLTOOL_DIRECTORY_RULE) |
---|
642 | AC_SUBST(INTLTOOL_KEYS_RULE) |
---|
643 | AC_SUBST(INTLTOOL_PROP_RULE) |
---|
644 | AC_SUBST(INTLTOOL_OAF_RULE) |
---|
645 | AC_SUBST(INTLTOOL_PONG_RULE) |
---|
646 | AC_SUBST(INTLTOOL_SERVER_RULE) |
---|
647 | AC_SUBST(INTLTOOL_SHEET_RULE) |
---|
648 | AC_SUBST(INTLTOOL_SOUNDLIST_RULE) |
---|
649 | AC_SUBST(INTLTOOL_UI_RULE) |
---|
650 | AC_SUBST(INTLTOOL_XAM_RULE) |
---|
651 | AC_SUBST(INTLTOOL_KBD_RULE) |
---|
652 | AC_SUBST(INTLTOOL_XML_RULE) |
---|
653 | AC_SUBST(INTLTOOL_CAVES_RULE) |
---|
654 | AC_SUBST(INTLTOOL_SCHEMAS_RULE) |
---|
655 | AC_SUBST(INTLTOOL_THEME_RULE) |
---|
656 | |
---|
657 | # Use the tools built into the package, not the ones that are installed. |
---|
658 | |
---|
659 | INTLTOOL_EXTRACT='$(top_builddir)/intltool-extract' |
---|
660 | INTLTOOL_MERGE='$(top_builddir)/intltool-merge' |
---|
661 | INTLTOOL_UPDATE='$(top_builddir)/intltool-update' |
---|
662 | |
---|
663 | AC_SUBST(INTLTOOL_EXTRACT) |
---|
664 | AC_SUBST(INTLTOOL_MERGE) |
---|
665 | AC_SUBST(INTLTOOL_UPDATE) |
---|
666 | |
---|
667 | AC_PATH_PROG(INTLTOOL_PERL, perl) |
---|
668 | if test -z "$INTLTOOL_PERL"; then |
---|
669 | AC_MSG_ERROR([perl not found; required for intltool]) |
---|
670 | fi |
---|
671 | if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then |
---|
672 | AC_MSG_ERROR([perl 5.x required for intltool]) |
---|
673 | fi |
---|
674 | if `perl -e "require XML::Parser" 2>/dev/null`; then |
---|
675 | : |
---|
676 | else |
---|
677 | AC_MSG_ERROR([XML::Parser perl module is required for intltool]) |
---|
678 | fi |
---|
679 | |
---|
680 | # Remove file type tags (using []) from po/POTFILES. |
---|
681 | |
---|
682 | ifdef([AC_DIVERSION_ICMDS],[ |
---|
683 | AC_DIVERT_PUSH(AC_DIVERSION_ICMDS) |
---|
684 | changequote(,) |
---|
685 | mv -f po/POTFILES po/POTFILES.tmp |
---|
686 | sed -e '/\[encoding.*\]/d' -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES |
---|
687 | rm -f po/POTFILES.tmp |
---|
688 | changequote([,]) |
---|
689 | AC_DIVERT_POP() |
---|
690 | ],[ |
---|
691 | ifdef([AC_CONFIG_COMMANDS_PRE],[ |
---|
692 | AC_CONFIG_COMMANDS_PRE([ |
---|
693 | changequote(,) |
---|
694 | mv -f po/POTFILES po/POTFILES.tmp |
---|
695 | sed -e '/\[encoding.*\]/d' -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES |
---|
696 | rm -f po/POTFILES.tmp |
---|
697 | changequote([,]) |
---|
698 | ]) |
---|
699 | ]) |
---|
700 | ]) |
---|
701 | |
---|
702 | # Manually sed perl in so people don't have to put the intltool scripts in AC_OUTPUT. |
---|
703 | |
---|
704 | AC_OUTPUT_COMMANDS([ |
---|
705 | |
---|
706 | sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${ac_aux_dir}/intltool-extract.in > intltool-extract.out |
---|
707 | if cmp -s intltool-extract intltool-extract.out 2>/dev/null; then |
---|
708 | rm -f intltool-extract.out |
---|
709 | else |
---|
710 | mv -f intltool-extract.out intltool-extract |
---|
711 | fi |
---|
712 | chmod ugo+x intltool-extract |
---|
713 | chmod u+w intltool-extract |
---|
714 | |
---|
715 | sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" \ |
---|
716 | < ${ac_aux_dir}/intltool-merge.in > intltool-merge.out |
---|
717 | if cmp -s intltool-merge intltool-merge.out 2>/dev/null; then |
---|
718 | rm -f intltool-merge.out |
---|
719 | else |
---|
720 | mv -f intltool-merge.out intltool-merge |
---|
721 | fi |
---|
722 | chmod ugo+x intltool-merge |
---|
723 | chmod u+w intltool-merge |
---|
724 | |
---|
725 | sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${ac_aux_dir}/intltool-update.in > intltool-update.out |
---|
726 | if cmp -s intltool-update intltool-update.out 2>/dev/null; then |
---|
727 | rm -f intltool-update.out |
---|
728 | else |
---|
729 | mv -f intltool-update.out intltool-update |
---|
730 | fi |
---|
731 | chmod ugo+x intltool-update |
---|
732 | chmod u+w intltool-update |
---|
733 | |
---|
734 | ], INTLTOOL_PERL=${INTLTOOL_PERL} ac_aux_dir=${ac_aux_dir}) |
---|
735 | |
---|
736 | ]) |
---|
737 | |
---|
738 | dnl GNOME_COMPILE_WARNINGS |
---|
739 | dnl Turn on many useful compiler warnings |
---|
740 | dnl For now, only works on GCC |
---|
741 | AC_DEFUN([GNOME_COMPILE_WARNINGS],[ |
---|
742 | dnl ****************************** |
---|
743 | dnl More compiler warnings |
---|
744 | dnl ****************************** |
---|
745 | |
---|
746 | if test -z "$1" ; then |
---|
747 | default_compile_warnings=no |
---|
748 | else |
---|
749 | default_compile_warnings="$1" |
---|
750 | fi |
---|
751 | |
---|
752 | AC_ARG_ENABLE(compile-warnings, |
---|
753 | [ --enable-compile-warnings=[no/minimum/yes/maximum/error] Turn on compiler warnings.], [enable_compile_warnings="$default_compile_warnings"], enable_compile_warnings=yes) |
---|
754 | |
---|
755 | warnCFLAGS= |
---|
756 | if test "x$GCC" != xyes; then |
---|
757 | enable_compile_warnings=no |
---|
758 | fi |
---|
759 | |
---|
760 | warning_flags= |
---|
761 | realsave_CFLAGS="$CFLAGS" |
---|
762 | |
---|
763 | case "$enable_compile_warnings" in |
---|
764 | no) |
---|
765 | warning_flags= |
---|
766 | ;; |
---|
767 | minimum) |
---|
768 | warning_flags="-Wall -Wunused" |
---|
769 | ;; |
---|
770 | yes) |
---|
771 | warning_flags="-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations" |
---|
772 | ;; |
---|
773 | maximum|error) |
---|
774 | warning_flags="-Wall -Wunused -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith" |
---|
775 | CFLAGS="$warning_flags $CFLAGS" |
---|
776 | for option in -Wsign-promo -Wno-sign-compare; do |
---|
777 | SAVE_CFLAGS="$CFLAGS" |
---|
778 | CFLAGS="$CFLAGS $option" |
---|
779 | AC_MSG_CHECKING([whether gcc understands $option]) |
---|
780 | AC_TRY_COMPILE([], [], |
---|
781 | has_option=yes, |
---|
782 | has_option=no,) |
---|
783 | CFLAGS="$SAVE_CFLAGS" |
---|
784 | AC_MSG_RESULT($has_option) |
---|
785 | if test $has_option = yes; then |
---|
786 | warning_flags="$warning_flags $option" |
---|
787 | fi |
---|
788 | unset has_option |
---|
789 | unset SAVE_CFLAGS |
---|
790 | done |
---|
791 | unset option |
---|
792 | if test "$enable_compile_warnings" = "error" ; then |
---|
793 | warning_flags="$warning_flags -Werror" |
---|
794 | fi |
---|
795 | ;; |
---|
796 | *) |
---|
797 | AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings) |
---|
798 | ;; |
---|
799 | esac |
---|
800 | CFLAGS="$realsave_CFLAGS" |
---|
801 | AC_MSG_CHECKING(what warning flags to pass to the C compiler) |
---|
802 | AC_MSG_RESULT($warning_flags) |
---|
803 | |
---|
804 | AC_ARG_ENABLE(iso-c, |
---|
805 | [ --enable-iso-c Try to warn if code is not ISO C ],, |
---|
806 | enable_iso_c=no) |
---|
807 | |
---|
808 | AC_MSG_CHECKING(what language compliance flags to pass to the C compiler) |
---|
809 | complCFLAGS= |
---|
810 | if test "x$enable_iso_c" != "xno"; then |
---|
811 | if test "x$GCC" = "xyes"; then |
---|
812 | case " $CFLAGS " in |
---|
813 | *[\ \ ]-ansi[\ \ ]*) ;; |
---|
814 | *) complCFLAGS="$complCFLAGS -ansi" ;; |
---|
815 | esac |
---|
816 | case " $CFLAGS " in |
---|
817 | *[\ \ ]-pedantic[\ \ ]*) ;; |
---|
818 | *) complCFLAGS="$complCFLAGS -pedantic" ;; |
---|
819 | esac |
---|
820 | fi |
---|
821 | fi |
---|
822 | AC_MSG_RESULT($complCFLAGS) |
---|
823 | |
---|
824 | WARN_CFLAGS="$warning_flags $complCFLAGS" |
---|
825 | AC_SUBST(WARN_CFLAGS) |
---|
826 | ]) |
---|
827 | |
---|
828 | dnl For C++, do basically the same thing. |
---|
829 | |
---|
830 | AC_DEFUN([GNOME_CXX_WARNINGS],[ |
---|
831 | AC_ARG_ENABLE(cxx-warnings, |
---|
832 | [ --enable-cxx-warnings=[no/minimum/yes] Turn on compiler warnings.],,enable_cxx_warnings=minimum) |
---|
833 | |
---|
834 | AC_MSG_CHECKING(what warning flags to pass to the C++ compiler) |
---|
835 | warnCXXFLAGS= |
---|
836 | if test "x$GCC" != xyes; then |
---|
837 | enable_compile_warnings=no |
---|
838 | fi |
---|
839 | if test "x$enable_cxx_warnings" != "xno"; then |
---|
840 | if test "x$GCC" = "xyes"; then |
---|
841 | case " $CXXFLAGS " in |
---|
842 | *[\ \ ]-Wall[\ \ ]*) ;; |
---|
843 | *) warnCXXFLAGS="-Wall -Wno-unused" ;; |
---|
844 | esac |
---|
845 | |
---|
846 | ## -W is not all that useful. And it cannot be controlled |
---|
847 | ## with individual -Wno-xxx flags, unlike -Wall |
---|
848 | if test "x$enable_cxx_warnings" = "xyes"; then |
---|
849 | warnCXXFLAGS="$warnCXXFLAGS -Wmissing-prototypes -Wmissing-declarations -Wshadow -Woverloaded-virtual" |
---|
850 | fi |
---|
851 | fi |
---|
852 | fi |
---|
853 | AC_MSG_RESULT($warnCXXFLAGS) |
---|
854 | |
---|
855 | AC_ARG_ENABLE(iso-cxx, |
---|
856 | [ --enable-iso-cxx Try to warn if code is not ISO C++ ],, |
---|
857 | enable_iso_cxx=no) |
---|
858 | |
---|
859 | AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler) |
---|
860 | complCXXFLAGS= |
---|
861 | if test "x$enable_iso_cxx" != "xno"; then |
---|
862 | if test "x$GCC" = "xyes"; then |
---|
863 | case " $CXXFLAGS " in |
---|
864 | *[\ \ ]-ansi[\ \ ]*) ;; |
---|
865 | *) complCXXFLAGS="$complCXXFLAGS -ansi" ;; |
---|
866 | esac |
---|
867 | |
---|
868 | case " $CXXFLAGS " in |
---|
869 | *[\ \ ]-pedantic[\ \ ]*) ;; |
---|
870 | *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;; |
---|
871 | esac |
---|
872 | fi |
---|
873 | fi |
---|
874 | AC_MSG_RESULT($complCXXFLAGS) |
---|
875 | if test "x$cxxflags_set" != "xyes"; then |
---|
876 | CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS" |
---|
877 | cxxflags_set=yes |
---|
878 | AC_SUBST(cxxflags_set) |
---|
879 | fi |
---|
880 | ]) |
---|
881 | |
---|
882 | |
---|
883 | dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) |
---|
884 | dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page |
---|
885 | dnl also defines GSTUFF_PKG_ERRORS on error |
---|
886 | AC_DEFUN(PKG_CHECK_MODULES, [ |
---|
887 | succeeded=no |
---|
888 | |
---|
889 | if test -z "$PKG_CONFIG"; then |
---|
890 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
---|
891 | fi |
---|
892 | |
---|
893 | if test "$PKG_CONFIG" = "no" ; then |
---|
894 | echo "*** The pkg-config script could not be found. Make sure it is" |
---|
895 | echo "*** in your path, or set the PKG_CONFIG environment variable" |
---|
896 | echo "*** to the full path to pkg-config." |
---|
897 | echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." |
---|
898 | else |
---|
899 | PKG_CONFIG_MIN_VERSION=0.9.0 |
---|
900 | if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then |
---|
901 | AC_MSG_CHECKING(for $2) |
---|
902 | |
---|
903 | if $PKG_CONFIG --exists "$2" ; then |
---|
904 | AC_MSG_RESULT(yes) |
---|
905 | succeeded=yes |
---|
906 | |
---|
907 | AC_MSG_CHECKING($1_CFLAGS) |
---|
908 | $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` |
---|
909 | AC_MSG_RESULT($$1_CFLAGS) |
---|
910 | |
---|
911 | AC_MSG_CHECKING($1_LIBS) |
---|
912 | $1_LIBS=`$PKG_CONFIG --libs "$2"` |
---|
913 | AC_MSG_RESULT($$1_LIBS) |
---|
914 | else |
---|
915 | $1_CFLAGS="" |
---|
916 | $1_LIBS="" |
---|
917 | ## If we have a custom action on failure, don't print errors, but |
---|
918 | ## do set a variable so people can do so. |
---|
919 | $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` |
---|
920 | ifelse([$4], ,echo $$1_PKG_ERRORS,) |
---|
921 | fi |
---|
922 | |
---|
923 | AC_SUBST($1_CFLAGS) |
---|
924 | AC_SUBST($1_LIBS) |
---|
925 | else |
---|
926 | echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." |
---|
927 | echo "*** See http://www.freedesktop.org/software/pkgconfig" |
---|
928 | fi |
---|
929 | fi |
---|
930 | |
---|
931 | if test $succeeded = yes; then |
---|
932 | ifelse([$3], , :, [$3]) |
---|
933 | else |
---|
934 | ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) |
---|
935 | fi |
---|
936 | ]) |
---|
937 | |
---|
938 | |
---|
939 | |
---|
940 | dnl AM_GCONF_SOURCE_2 |
---|
941 | dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas |
---|
942 | dnl (i.e. pass to gconftool-2 |
---|
943 | dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where |
---|
944 | dnl you should install foo.schemas files |
---|
945 | dnl |
---|
946 | |
---|
947 | AC_DEFUN(AM_GCONF_SOURCE_2, |
---|
948 | [ |
---|
949 | if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then |
---|
950 | GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source` |
---|
951 | else |
---|
952 | GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE |
---|
953 | fi |
---|
954 | |
---|
955 | AC_ARG_WITH(gconf-source, |
---|
956 | [ --with-gconf-source=sourceaddress Config database for installing schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",) |
---|
957 | |
---|
958 | AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE) |
---|
959 | AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation]) |
---|
960 | |
---|
961 | if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then |
---|
962 | GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas/' |
---|
963 | else |
---|
964 | GCONF_SCHEMA_FILE_DIR=$GCONF_SCHEMA_FILE_DIR |
---|
965 | fi |
---|
966 | |
---|
967 | AC_ARG_WITH(gconf-schema-file-dir, |
---|
968 | [ --with-gconf-schema-file-dir=dir Directory for installing schema files.],GCONF_SCHEMA_FILE_DIR="$withval",) |
---|
969 | |
---|
970 | AC_SUBST(GCONF_SCHEMA_FILE_DIR) |
---|
971 | AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files]) |
---|
972 | |
---|
973 | AC_ARG_ENABLE(schemas-install, |
---|
974 | [ --disable-schemas-install Disable the schemas installation], |
---|
975 | [case "${enableval}" in |
---|
976 | yes) schemas_install=true ;; |
---|
977 | no) schemas_install=false ;; |
---|
978 | *) AC_MSG_ERROR(bad value ${enableval} for --disable-schemas-install) ;; |
---|
979 | esac],[schemas_install=true]) |
---|
980 | AM_CONDITIONAL(GCONF_SCHEMAS_INSTALL, test x$schemas_install = xtrue) |
---|
981 | ]) |
---|
982 | |
---|