1 | dnl aclocal.m4 generated automatically by aclocal 1.4a |
---|
2 | |
---|
3 | dnl Copyright (C) 1994, 1995-9, 2000 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([AC_PROG_INSTALL]) |
---|
47 | dnl We require 2.13 because we rely on SHELL being computed by configure. |
---|
48 | AC_PREREQ([2.13]) |
---|
49 | PACKAGE=[$1] |
---|
50 | AC_SUBST(PACKAGE) |
---|
51 | VERSION=[$2] |
---|
52 | AC_SUBST(VERSION) |
---|
53 | dnl test to see if srcdir already configured |
---|
54 | if test "`CDPATH=: && cd $srcdir && pwd`" != "`pwd`" && |
---|
55 | test -f $srcdir/config.status; then |
---|
56 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) |
---|
57 | fi |
---|
58 | ifelse([$3],, |
---|
59 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) |
---|
60 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) |
---|
61 | AC_REQUIRE([AM_SANITY_CHECK]) |
---|
62 | AC_REQUIRE([AC_ARG_PROGRAM]) |
---|
63 | AM_MISSING_PROG(ACLOCAL, aclocal) |
---|
64 | AM_MISSING_PROG(AUTOCONF, autoconf) |
---|
65 | AM_MISSING_PROG(AUTOMAKE, automake) |
---|
66 | AM_MISSING_PROG(AUTOHEADER, autoheader) |
---|
67 | AM_MISSING_PROG(MAKEINFO, makeinfo) |
---|
68 | AM_MISSING_PROG(AMTAR, tar) |
---|
69 | AM_MISSING_INSTALL_SH |
---|
70 | dnl We need awk for the "check" target. The system "awk" is bad on |
---|
71 | dnl some platforms. |
---|
72 | AC_REQUIRE([AC_PROG_AWK]) |
---|
73 | AC_REQUIRE([AC_PROG_MAKE_SET]) |
---|
74 | AC_REQUIRE([AM_DEP_TRACK]) |
---|
75 | AC_REQUIRE([AM_SET_DEPDIR]) |
---|
76 | ifdef([AC_PROVIDE_AC_PROG_CC], [AM_DEPENDENCIES(CC)], [ |
---|
77 | define([AC_PROG_CC], defn([AC_PROG_CC])[AM_DEPENDENCIES(CC)])]) |
---|
78 | ifdef([AC_PROVIDE_AC_PROG_CXX], [AM_DEPENDENCIES(CXX)], [ |
---|
79 | define([AC_PROG_CXX], defn([AC_PROG_CXX])[AM_DEPENDENCIES(CXX)])]) |
---|
80 | ]) |
---|
81 | |
---|
82 | # |
---|
83 | # Check to make sure that the build environment is sane. |
---|
84 | # |
---|
85 | |
---|
86 | AC_DEFUN(AM_SANITY_CHECK, |
---|
87 | [AC_MSG_CHECKING([whether build environment is sane]) |
---|
88 | # Just in case |
---|
89 | sleep 1 |
---|
90 | echo timestamp > conftestfile |
---|
91 | # Do `set' in a subshell so we don't clobber the current shell's |
---|
92 | # arguments. Must try -L first in case configure is actually a |
---|
93 | # symlink; some systems play weird games with the mod time of symlinks |
---|
94 | # (eg FreeBSD returns the mod time of the symlink's containing |
---|
95 | # directory). |
---|
96 | if ( |
---|
97 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` |
---|
98 | if test "[$]*" = "X"; then |
---|
99 | # -L didn't work. |
---|
100 | set X `ls -t $srcdir/configure conftestfile` |
---|
101 | fi |
---|
102 | if test "[$]*" != "X $srcdir/configure conftestfile" \ |
---|
103 | && test "[$]*" != "X conftestfile $srcdir/configure"; then |
---|
104 | |
---|
105 | # If neither matched, then we have a broken ls. This can happen |
---|
106 | # if, for instance, CONFIG_SHELL is bash and it inherits a |
---|
107 | # broken ls alias from the environment. This has actually |
---|
108 | # happened. Such a system could not be considered "sane". |
---|
109 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken |
---|
110 | alias in your environment]) |
---|
111 | fi |
---|
112 | |
---|
113 | test "[$]2" = conftestfile |
---|
114 | ) |
---|
115 | then |
---|
116 | # Ok. |
---|
117 | : |
---|
118 | else |
---|
119 | AC_MSG_ERROR([newly created file is older than distributed files! |
---|
120 | Check your system clock]) |
---|
121 | fi |
---|
122 | rm -f conftest* |
---|
123 | AC_MSG_RESULT(yes)]) |
---|
124 | |
---|
125 | dnl AM_MISSING_PROG(NAME, PROGRAM) |
---|
126 | AC_DEFUN(AM_MISSING_PROG, [ |
---|
127 | AC_REQUIRE([AM_MISSING_HAS_RUN]) |
---|
128 | $1=${$1-"${am_missing_run}$2"} |
---|
129 | AC_SUBST($1)]) |
---|
130 | |
---|
131 | dnl Like AM_MISSING_PROG, but only looks for install-sh. |
---|
132 | dnl AM_MISSING_INSTALL_SH() |
---|
133 | AC_DEFUN(AM_MISSING_INSTALL_SH, [ |
---|
134 | AC_REQUIRE([AM_MISSING_HAS_RUN]) |
---|
135 | if test -z "$install_sh"; then |
---|
136 | install_sh="$ac_aux_dir/install-sh" |
---|
137 | test -f "$install_sh" || install_sh="$ac_aux_dir/install.sh" |
---|
138 | test -f "$install_sh" || install_sh="${am_missing_run}${ac_auxdir}/install-sh" |
---|
139 | dnl FIXME: an evil hack: we remove the SHELL invocation from |
---|
140 | dnl install_sh because automake adds it back in. Sigh. |
---|
141 | install_sh="`echo $install_sh | sed -e 's/\${SHELL}//'`" |
---|
142 | fi |
---|
143 | AC_SUBST(install_sh)]) |
---|
144 | |
---|
145 | dnl AM_MISSING_HAS_RUN. |
---|
146 | dnl Define MISSING if not defined so far and test if it supports --run. |
---|
147 | dnl If it does, set am_missing_run to use it, otherwise, to nothing. |
---|
148 | AC_DEFUN([AM_MISSING_HAS_RUN], [ |
---|
149 | test x"${MISSING+set}" = xset || \ |
---|
150 | MISSING="\${SHELL} `CDPATH=: && cd $ac_aux_dir && pwd`/missing" |
---|
151 | dnl Use eval to expand $SHELL |
---|
152 | if eval "$MISSING --run :"; then |
---|
153 | am_missing_run="$MISSING --run " |
---|
154 | else |
---|
155 | am_missing_run= |
---|
156 | am_backtick='`' |
---|
157 | AC_MSG_WARN([${am_backtick}missing' script is too old or missing]) |
---|
158 | fi |
---|
159 | ]) |
---|
160 | |
---|
161 | dnl See how the compiler implements dependency checking. |
---|
162 | dnl Usage: |
---|
163 | dnl AM_DEPENDENCIES(NAME) |
---|
164 | dnl NAME is "CC", "CXX" or "OBJC". |
---|
165 | |
---|
166 | dnl We try a few techniques and use that to set a single cache variable. |
---|
167 | |
---|
168 | AC_DEFUN(AM_DEPENDENCIES,[ |
---|
169 | AC_REQUIRE([AM_SET_DEPDIR]) |
---|
170 | AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS]) |
---|
171 | ifelse([$1],CC,[ |
---|
172 | AC_REQUIRE([AC_PROG_CC]) |
---|
173 | AC_REQUIRE([AC_PROG_CPP]) |
---|
174 | depcc="$CC" |
---|
175 | depcpp="$CPP"],[$1],CXX,[ |
---|
176 | AC_REQUIRE([AC_PROG_CXX]) |
---|
177 | AC_REQUIRE([AC_PROG_CXXCPP]) |
---|
178 | depcc="$CXX" |
---|
179 | depcpp="$CXXCPP"],[$1],OBJC,[ |
---|
180 | am_cv_OBJC_dependencies_compiler_type=gcc],[ |
---|
181 | AC_REQUIRE([AC_PROG_][$1]) |
---|
182 | depcc="$[$1]" |
---|
183 | depcpp=""]) |
---|
184 | AC_MSG_CHECKING([dependency style of $depcc]) |
---|
185 | AC_CACHE_VAL(am_cv_[$1]_dependencies_compiler_type,[ |
---|
186 | if test -z "$AMDEP"; then |
---|
187 | echo '#include "conftest.h"' > conftest.c |
---|
188 | echo 'int i;' > conftest.h |
---|
189 | |
---|
190 | am_cv_[$1]_dependencies_compiler_type=none |
---|
191 | for depmode in `sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$am_depcomp"`; do |
---|
192 | case "$depmode" in |
---|
193 | nosideeffect) |
---|
194 | # after this tag, mechanisms are not by side-effect, so they'll |
---|
195 | # only be used when explicitly requested |
---|
196 | if test "x$enable_dependency_tracking" = xyes; then |
---|
197 | continue |
---|
198 | else |
---|
199 | break |
---|
200 | fi |
---|
201 | ;; |
---|
202 | none) break ;; |
---|
203 | esac |
---|
204 | if depmode="$depmode" \ |
---|
205 | source=conftest.c object=conftest.o \ |
---|
206 | depfile=conftest.Po tmpdepfile=conftest.TPo \ |
---|
207 | $SHELL $am_depcomp $depcc -c conftest.c 2>/dev/null && |
---|
208 | grep conftest.h conftest.Po > /dev/null 2>&1; then |
---|
209 | am_cv_[$1]_dependencies_compiler_type="$depmode" |
---|
210 | break |
---|
211 | fi |
---|
212 | done |
---|
213 | |
---|
214 | rm -f conftest.* |
---|
215 | else |
---|
216 | am_cv_[$1]_dependencies_compiler_type=none |
---|
217 | fi |
---|
218 | ]) |
---|
219 | AC_MSG_RESULT($am_cv_[$1]_dependencies_compiler_type) |
---|
220 | [$1]DEPMODE="depmode=$am_cv_[$1]_dependencies_compiler_type" |
---|
221 | AC_SUBST([$1]DEPMODE) |
---|
222 | ]) |
---|
223 | |
---|
224 | dnl Choose a directory name for dependency files. |
---|
225 | dnl This macro is AC_REQUIREd in AM_DEPENDENCIES |
---|
226 | |
---|
227 | AC_DEFUN(AM_SET_DEPDIR,[ |
---|
228 | if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then |
---|
229 | DEPDIR=.deps |
---|
230 | else |
---|
231 | DEPDIR=_deps |
---|
232 | fi |
---|
233 | AC_SUBST(DEPDIR) |
---|
234 | ]) |
---|
235 | |
---|
236 | AC_DEFUN(AM_DEP_TRACK,[ |
---|
237 | AC_ARG_ENABLE(dependency-tracking, |
---|
238 | [ --disable-dependency-tracking Speeds up one-time builds |
---|
239 | --enable-dependency-tracking Do not reject slow dependency extractors]) |
---|
240 | if test "x$enable_dependency_tracking" = xno; then |
---|
241 | AMDEP="#" |
---|
242 | else |
---|
243 | am_depcomp="$ac_aux_dir/depcomp" |
---|
244 | if test ! -f "$am_depcomp"; then |
---|
245 | AMDEP="#" |
---|
246 | else |
---|
247 | AMDEP= |
---|
248 | fi |
---|
249 | fi |
---|
250 | AC_SUBST(AMDEP) |
---|
251 | if test -z "$AMDEP"; then |
---|
252 | AMDEPBACKSLASH='\' |
---|
253 | else |
---|
254 | AMDEPBACKSLASH= |
---|
255 | fi |
---|
256 | pushdef([subst], defn([AC_SUBST])) |
---|
257 | subst(AMDEPBACKSLASH) |
---|
258 | popdef([subst]) |
---|
259 | ]) |
---|
260 | |
---|
261 | dnl Generate code to set up dependency tracking. |
---|
262 | dnl This macro should only be invoked once -- use via AC_REQUIRE. |
---|
263 | dnl Usage: |
---|
264 | dnl AM_OUTPUT_DEPENDENCY_COMMANDS |
---|
265 | |
---|
266 | dnl |
---|
267 | dnl This code is only required when automatic dependency tracking |
---|
268 | dnl is enabled. FIXME. This creates each `.P' file that we will |
---|
269 | dnl need in order to bootstrap the dependency handling code. |
---|
270 | AC_DEFUN(AM_OUTPUT_DEPENDENCY_COMMANDS,[ |
---|
271 | AC_OUTPUT_COMMANDS([ |
---|
272 | test x"$AMDEP" != x"" || |
---|
273 | for mf in $CONFIG_FILES; do |
---|
274 | case "$mf" in |
---|
275 | Makefile) dirpart=.;; |
---|
276 | */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; |
---|
277 | *) continue;; |
---|
278 | esac |
---|
279 | grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue |
---|
280 | # Extract the definition of DEP_FILES from the Makefile without |
---|
281 | # running `make'. |
---|
282 | DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` |
---|
283 | test -z "$DEPDIR" && continue |
---|
284 | # When using ansi2knr, U may be empty or an underscore; expand it |
---|
285 | U=`sed -n -e '/^U = / s///p' < "$mf"` |
---|
286 | test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" |
---|
287 | # We invoke sed twice because it is the simplest approach to |
---|
288 | # changing $(DEPDIR) to its actual value in the expansion. |
---|
289 | for file in `sed -n -e ' |
---|
290 | /^DEP_FILES = .*\\\\$/ { |
---|
291 | s/^DEP_FILES = // |
---|
292 | :loop |
---|
293 | s/\\\\$// |
---|
294 | p |
---|
295 | n |
---|
296 | /\\\\$/ b loop |
---|
297 | p |
---|
298 | } |
---|
299 | /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ |
---|
300 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do |
---|
301 | # Make sure the directory exists. |
---|
302 | test -f "$dirpart/$file" && continue |
---|
303 | fdir=`echo "$file" | sed -e 's|/[^/]*$||'` |
---|
304 | $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1 |
---|
305 | # echo "creating $dirpart/$file" |
---|
306 | echo '# dummy' > "$dirpart/$file" |
---|
307 | done |
---|
308 | done |
---|
309 | ], [AMDEP="$AMDEP" |
---|
310 | ac_aux_dir="$ac_aux_dir"])]) |
---|
311 | |
---|
312 | # Add --enable-maintainer-mode option to configure. |
---|
313 | # From Jim Meyering |
---|
314 | |
---|
315 | # serial 1 |
---|
316 | |
---|
317 | AC_DEFUN(AM_MAINTAINER_MODE, |
---|
318 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) |
---|
319 | dnl maintainer-mode is disabled by default |
---|
320 | AC_ARG_ENABLE(maintainer-mode, |
---|
321 | [ --enable-maintainer-mode enable make rules and dependencies not useful |
---|
322 | (and sometimes confusing) to the casual installer], |
---|
323 | USE_MAINTAINER_MODE=$enableval, |
---|
324 | USE_MAINTAINER_MODE=no) |
---|
325 | AC_MSG_RESULT($USE_MAINTAINER_MODE) |
---|
326 | AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) |
---|
327 | MAINT=$MAINTAINER_MODE_TRUE |
---|
328 | AC_SUBST(MAINT)dnl |
---|
329 | ] |
---|
330 | ) |
---|
331 | |
---|
332 | # Define a conditional. |
---|
333 | |
---|
334 | AC_DEFUN(AM_CONDITIONAL, |
---|
335 | [AC_SUBST($1_TRUE) |
---|
336 | AC_SUBST($1_FALSE) |
---|
337 | if $2; then |
---|
338 | $1_TRUE= |
---|
339 | $1_FALSE='#' |
---|
340 | else |
---|
341 | $1_TRUE='#' |
---|
342 | $1_FALSE= |
---|
343 | fi]) |
---|
344 | |
---|
345 | # aclocal-include.m4 |
---|
346 | # |
---|
347 | # This macro adds the name macrodir to the set of directories |
---|
348 | # that `aclocal' searches for macros. |
---|
349 | |
---|
350 | # serial 1 |
---|
351 | |
---|
352 | dnl AM_ACLOCAL_INCLUDE(macrodir) |
---|
353 | AC_DEFUN([AM_ACLOCAL_INCLUDE], |
---|
354 | [ |
---|
355 | AM_CONDITIONAL(INSIDE_GNOME_COMMON, test x = y) |
---|
356 | |
---|
357 | test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" |
---|
358 | |
---|
359 | for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done |
---|
360 | ]) |
---|
361 | |
---|
362 | |
---|
363 | # serial 40 AC_PROG_LIBTOOL |
---|
364 | AC_DEFUN(AC_PROG_LIBTOOL, |
---|
365 | [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl |
---|
366 | |
---|
367 | # Save cache, so that ltconfig can load it |
---|
368 | AC_CACHE_SAVE |
---|
369 | |
---|
370 | # Actually configure libtool. ac_aux_dir is where install-sh is found. |
---|
371 | CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ |
---|
372 | LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ |
---|
373 | LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ |
---|
374 | DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ |
---|
375 | ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ |
---|
376 | $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ |
---|
377 | || AC_MSG_ERROR([libtool configure failed]) |
---|
378 | |
---|
379 | # Reload cache, that may have been modified by ltconfig |
---|
380 | AC_CACHE_LOAD |
---|
381 | |
---|
382 | # This can be used to rebuild libtool when needed |
---|
383 | LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" |
---|
384 | |
---|
385 | # Always use our own libtool. |
---|
386 | LIBTOOL='$(SHELL) $(top_builddir)/libtool' |
---|
387 | AC_SUBST(LIBTOOL)dnl |
---|
388 | |
---|
389 | # Redirect the config.log output again, so that the ltconfig log is not |
---|
390 | # clobbered by the next message. |
---|
391 | exec 5>>./config.log |
---|
392 | ]) |
---|
393 | |
---|
394 | AC_DEFUN(AC_LIBTOOL_SETUP, |
---|
395 | [AC_PREREQ(2.13)dnl |
---|
396 | AC_REQUIRE([AC_ENABLE_SHARED])dnl |
---|
397 | AC_REQUIRE([AC_ENABLE_STATIC])dnl |
---|
398 | AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl |
---|
399 | AC_REQUIRE([AC_CANONICAL_HOST])dnl |
---|
400 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl |
---|
401 | AC_REQUIRE([AC_PROG_RANLIB])dnl |
---|
402 | AC_REQUIRE([AC_PROG_CC])dnl |
---|
403 | AC_REQUIRE([AC_PROG_LD])dnl |
---|
404 | AC_REQUIRE([AC_PROG_NM])dnl |
---|
405 | AC_REQUIRE([AC_PROG_LN_S])dnl |
---|
406 | dnl |
---|
407 | |
---|
408 | case "$target" in |
---|
409 | NONE) lt_target="$host" ;; |
---|
410 | *) lt_target="$target" ;; |
---|
411 | esac |
---|
412 | |
---|
413 | # Check for any special flags to pass to ltconfig. |
---|
414 | # |
---|
415 | # the following will cause an existing older ltconfig to fail, so |
---|
416 | # we ignore this at the expense of the cache file... Checking this |
---|
417 | # will just take longer ... bummer! |
---|
418 | #libtool_flags="--cache-file=$cache_file" |
---|
419 | # |
---|
420 | test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" |
---|
421 | test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" |
---|
422 | test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" |
---|
423 | test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" |
---|
424 | test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" |
---|
425 | ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], |
---|
426 | [libtool_flags="$libtool_flags --enable-dlopen"]) |
---|
427 | ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], |
---|
428 | [libtool_flags="$libtool_flags --enable-win32-dll"]) |
---|
429 | AC_ARG_ENABLE(libtool-lock, |
---|
430 | [ --disable-libtool-lock avoid locking (might break parallel builds)]) |
---|
431 | test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" |
---|
432 | test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" |
---|
433 | |
---|
434 | # Some flags need to be propagated to the compiler or linker for good |
---|
435 | # libtool support. |
---|
436 | case "$lt_target" in |
---|
437 | *-*-irix6*) |
---|
438 | # Find out which ABI we are using. |
---|
439 | echo '[#]line __oline__ "configure"' > conftest.$ac_ext |
---|
440 | if AC_TRY_EVAL(ac_compile); then |
---|
441 | case "`/usr/bin/file conftest.o`" in |
---|
442 | *32-bit*) |
---|
443 | LD="${LD-ld} -32" |
---|
444 | ;; |
---|
445 | *N32*) |
---|
446 | LD="${LD-ld} -n32" |
---|
447 | ;; |
---|
448 | *64-bit*) |
---|
449 | LD="${LD-ld} -64" |
---|
450 | ;; |
---|
451 | esac |
---|
452 | fi |
---|
453 | rm -rf conftest* |
---|
454 | ;; |
---|
455 | |
---|
456 | *-*-sco3.2v5*) |
---|
457 | # On SCO OpenServer 5, we need -belf to get full-featured binaries. |
---|
458 | SAVE_CFLAGS="$CFLAGS" |
---|
459 | CFLAGS="$CFLAGS -belf" |
---|
460 | AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, |
---|
461 | [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) |
---|
462 | if test x"$lt_cv_cc_needs_belf" != x"yes"; then |
---|
463 | # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf |
---|
464 | CFLAGS="$SAVE_CFLAGS" |
---|
465 | fi |
---|
466 | ;; |
---|
467 | |
---|
468 | ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], |
---|
469 | [*-*-cygwin* | *-*-mingw*) |
---|
470 | AC_CHECK_TOOL(DLLTOOL, dlltool, false) |
---|
471 | AC_CHECK_TOOL(AS, as, false) |
---|
472 | AC_CHECK_TOOL(OBJDUMP, objdump, false) |
---|
473 | ;; |
---|
474 | ]) |
---|
475 | esac |
---|
476 | ]) |
---|
477 | |
---|
478 | # AC_LIBTOOL_DLOPEN - enable checks for dlopen support |
---|
479 | AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) |
---|
480 | |
---|
481 | # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's |
---|
482 | AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) |
---|
483 | |
---|
484 | # AC_ENABLE_SHARED - implement the --enable-shared flag |
---|
485 | # Usage: AC_ENABLE_SHARED[(DEFAULT)] |
---|
486 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to |
---|
487 | # `yes'. |
---|
488 | AC_DEFUN(AC_ENABLE_SHARED, [dnl |
---|
489 | define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl |
---|
490 | AC_ARG_ENABLE(shared, |
---|
491 | changequote(<<, >>)dnl |
---|
492 | << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], |
---|
493 | changequote([, ])dnl |
---|
494 | [p=${PACKAGE-default} |
---|
495 | case "$enableval" in |
---|
496 | yes) enable_shared=yes ;; |
---|
497 | no) enable_shared=no ;; |
---|
498 | *) |
---|
499 | enable_shared=no |
---|
500 | # Look at the argument we got. We use all the common list separators. |
---|
501 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," |
---|
502 | for pkg in $enableval; do |
---|
503 | if test "X$pkg" = "X$p"; then |
---|
504 | enable_shared=yes |
---|
505 | fi |
---|
506 | done |
---|
507 | IFS="$ac_save_ifs" |
---|
508 | ;; |
---|
509 | esac], |
---|
510 | enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl |
---|
511 | ]) |
---|
512 | |
---|
513 | # AC_DISABLE_SHARED - set the default shared flag to --disable-shared |
---|
514 | AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl |
---|
515 | AC_ENABLE_SHARED(no)]) |
---|
516 | |
---|
517 | # AC_ENABLE_STATIC - implement the --enable-static flag |
---|
518 | # Usage: AC_ENABLE_STATIC[(DEFAULT)] |
---|
519 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to |
---|
520 | # `yes'. |
---|
521 | AC_DEFUN(AC_ENABLE_STATIC, [dnl |
---|
522 | define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl |
---|
523 | AC_ARG_ENABLE(static, |
---|
524 | changequote(<<, >>)dnl |
---|
525 | << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], |
---|
526 | changequote([, ])dnl |
---|
527 | [p=${PACKAGE-default} |
---|
528 | case "$enableval" in |
---|
529 | yes) enable_static=yes ;; |
---|
530 | no) enable_static=no ;; |
---|
531 | *) |
---|
532 | enable_static=no |
---|
533 | # Look at the argument we got. We use all the common list separators. |
---|
534 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," |
---|
535 | for pkg in $enableval; do |
---|
536 | if test "X$pkg" = "X$p"; then |
---|
537 | enable_static=yes |
---|
538 | fi |
---|
539 | done |
---|
540 | IFS="$ac_save_ifs" |
---|
541 | ;; |
---|
542 | esac], |
---|
543 | enable_static=AC_ENABLE_STATIC_DEFAULT)dnl |
---|
544 | ]) |
---|
545 | |
---|
546 | # AC_DISABLE_STATIC - set the default static flag to --disable-static |
---|
547 | AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl |
---|
548 | AC_ENABLE_STATIC(no)]) |
---|
549 | |
---|
550 | |
---|
551 | # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag |
---|
552 | # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] |
---|
553 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to |
---|
554 | # `yes'. |
---|
555 | AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl |
---|
556 | define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl |
---|
557 | AC_ARG_ENABLE(fast-install, |
---|
558 | changequote(<<, >>)dnl |
---|
559 | << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], |
---|
560 | changequote([, ])dnl |
---|
561 | [p=${PACKAGE-default} |
---|
562 | case "$enableval" in |
---|
563 | yes) enable_fast_install=yes ;; |
---|
564 | no) enable_fast_install=no ;; |
---|
565 | *) |
---|
566 | enable_fast_install=no |
---|
567 | # Look at the argument we got. We use all the common list separators. |
---|
568 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," |
---|
569 | for pkg in $enableval; do |
---|
570 | if test "X$pkg" = "X$p"; then |
---|
571 | enable_fast_install=yes |
---|
572 | fi |
---|
573 | done |
---|
574 | IFS="$ac_save_ifs" |
---|
575 | ;; |
---|
576 | esac], |
---|
577 | enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl |
---|
578 | ]) |
---|
579 | |
---|
580 | # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install |
---|
581 | AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl |
---|
582 | AC_ENABLE_FAST_INSTALL(no)]) |
---|
583 | |
---|
584 | # AC_PROG_LD - find the path to the GNU or non-GNU linker |
---|
585 | AC_DEFUN(AC_PROG_LD, |
---|
586 | [AC_ARG_WITH(gnu-ld, |
---|
587 | [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], |
---|
588 | test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) |
---|
589 | AC_REQUIRE([AC_PROG_CC])dnl |
---|
590 | AC_REQUIRE([AC_CANONICAL_HOST])dnl |
---|
591 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl |
---|
592 | ac_prog=ld |
---|
593 | if test "$ac_cv_prog_gcc" = yes; then |
---|
594 | # Check if gcc -print-prog-name=ld gives a path. |
---|
595 | AC_MSG_CHECKING([for ld used by GCC]) |
---|
596 | ac_prog=`($CC -print-prog-name=ld) 2>&5` |
---|
597 | case "$ac_prog" in |
---|
598 | # Accept absolute paths. |
---|
599 | changequote(,)dnl |
---|
600 | [\\/]* | [A-Za-z]:[\\/]*) |
---|
601 | re_direlt='/[^/][^/]*/\.\./' |
---|
602 | changequote([,])dnl |
---|
603 | # Canonicalize the path of ld |
---|
604 | ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` |
---|
605 | while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do |
---|
606 | ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` |
---|
607 | done |
---|
608 | test -z "$LD" && LD="$ac_prog" |
---|
609 | ;; |
---|
610 | "") |
---|
611 | # If it fails, then pretend we aren't using GCC. |
---|
612 | ac_prog=ld |
---|
613 | ;; |
---|
614 | *) |
---|
615 | # If it is relative, then search for the first ld in PATH. |
---|
616 | with_gnu_ld=unknown |
---|
617 | ;; |
---|
618 | esac |
---|
619 | elif test "$with_gnu_ld" = yes; then |
---|
620 | AC_MSG_CHECKING([for GNU ld]) |
---|
621 | else |
---|
622 | AC_MSG_CHECKING([for non-GNU ld]) |
---|
623 | fi |
---|
624 | AC_CACHE_VAL(ac_cv_path_LD, |
---|
625 | [if test -z "$LD"; then |
---|
626 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" |
---|
627 | for ac_dir in $PATH; do |
---|
628 | test -z "$ac_dir" && ac_dir=. |
---|
629 | if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then |
---|
630 | ac_cv_path_LD="$ac_dir/$ac_prog" |
---|
631 | # Check to see if the program is GNU ld. I'd rather use --version, |
---|
632 | # but apparently some GNU ld's only accept -v. |
---|
633 | # Break only if it was the GNU/non-GNU ld that we prefer. |
---|
634 | if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then |
---|
635 | test "$with_gnu_ld" != no && break |
---|
636 | else |
---|
637 | test "$with_gnu_ld" != yes && break |
---|
638 | fi |
---|
639 | fi |
---|
640 | done |
---|
641 | IFS="$ac_save_ifs" |
---|
642 | else |
---|
643 | ac_cv_path_LD="$LD" # Let the user override the test with a path. |
---|
644 | fi]) |
---|
645 | LD="$ac_cv_path_LD" |
---|
646 | if test -n "$LD"; then |
---|
647 | AC_MSG_RESULT($LD) |
---|
648 | else |
---|
649 | AC_MSG_RESULT(no) |
---|
650 | fi |
---|
651 | test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) |
---|
652 | AC_PROG_LD_GNU |
---|
653 | ]) |
---|
654 | |
---|
655 | AC_DEFUN(AC_PROG_LD_GNU, |
---|
656 | [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, |
---|
657 | [# I'd rather use --version here, but apparently some GNU ld's only accept -v. |
---|
658 | if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then |
---|
659 | ac_cv_prog_gnu_ld=yes |
---|
660 | else |
---|
661 | ac_cv_prog_gnu_ld=no |
---|
662 | fi]) |
---|
663 | ]) |
---|
664 | |
---|
665 | # AC_PROG_NM - find the path to a BSD-compatible name lister |
---|
666 | AC_DEFUN(AC_PROG_NM, |
---|
667 | [AC_MSG_CHECKING([for BSD-compatible nm]) |
---|
668 | AC_CACHE_VAL(ac_cv_path_NM, |
---|
669 | [if test -n "$NM"; then |
---|
670 | # Let the user override the test. |
---|
671 | ac_cv_path_NM="$NM" |
---|
672 | else |
---|
673 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" |
---|
674 | for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do |
---|
675 | test -z "$ac_dir" && ac_dir=. |
---|
676 | if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then |
---|
677 | # Check to see if the nm accepts a BSD-compat flag. |
---|
678 | # Adding the `sed 1q' prevents false positives on HP-UX, which says: |
---|
679 | # nm: unknown option "B" ignored |
---|
680 | if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then |
---|
681 | ac_cv_path_NM="$ac_dir/nm -B" |
---|
682 | break |
---|
683 | elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then |
---|
684 | ac_cv_path_NM="$ac_dir/nm -p" |
---|
685 | break |
---|
686 | else |
---|
687 | ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but |
---|
688 | continue # so that we can try to find one that supports BSD flags |
---|
689 | fi |
---|
690 | fi |
---|
691 | done |
---|
692 | IFS="$ac_save_ifs" |
---|
693 | test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm |
---|
694 | fi]) |
---|
695 | NM="$ac_cv_path_NM" |
---|
696 | AC_MSG_RESULT([$NM]) |
---|
697 | ]) |
---|
698 | |
---|
699 | # AC_CHECK_LIBM - check for math library |
---|
700 | AC_DEFUN(AC_CHECK_LIBM, |
---|
701 | [AC_REQUIRE([AC_CANONICAL_HOST])dnl |
---|
702 | LIBM= |
---|
703 | case "$lt_target" in |
---|
704 | *-*-beos* | *-*-cygwin*) |
---|
705 | # These system don't have libm |
---|
706 | ;; |
---|
707 | *-ncr-sysv4.3*) |
---|
708 | AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") |
---|
709 | AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") |
---|
710 | ;; |
---|
711 | *) |
---|
712 | AC_CHECK_LIB(m, main, LIBM="-lm") |
---|
713 | ;; |
---|
714 | esac |
---|
715 | ]) |
---|
716 | |
---|
717 | # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for |
---|
718 | # the libltdl convenience library, adds --enable-ltdl-convenience to |
---|
719 | # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor |
---|
720 | # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed |
---|
721 | # to be `${top_builddir}/libltdl'. Make sure you start DIR with |
---|
722 | # '${top_builddir}/' (note the single quotes!) if your package is not |
---|
723 | # flat, and, if you're not using automake, define top_builddir as |
---|
724 | # appropriate in the Makefiles. |
---|
725 | AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl |
---|
726 | case "$enable_ltdl_convenience" in |
---|
727 | no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; |
---|
728 | "") enable_ltdl_convenience=yes |
---|
729 | ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; |
---|
730 | esac |
---|
731 | LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la |
---|
732 | INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) |
---|
733 | ]) |
---|
734 | |
---|
735 | # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for |
---|
736 | # the libltdl installable library, and adds --enable-ltdl-install to |
---|
737 | # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor |
---|
738 | # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed |
---|
739 | # to be `${top_builddir}/libltdl'. Make sure you start DIR with |
---|
740 | # '${top_builddir}/' (note the single quotes!) if your package is not |
---|
741 | # flat, and, if you're not using automake, define top_builddir as |
---|
742 | # appropriate in the Makefiles. |
---|
743 | # In the future, this macro may have to be called after AC_PROG_LIBTOOL. |
---|
744 | AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl |
---|
745 | AC_CHECK_LIB(ltdl, main, |
---|
746 | [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], |
---|
747 | [if test x"$enable_ltdl_install" = xno; then |
---|
748 | AC_MSG_WARN([libltdl not installed, but installation disabled]) |
---|
749 | else |
---|
750 | enable_ltdl_install=yes |
---|
751 | fi |
---|
752 | ]) |
---|
753 | if test x"$enable_ltdl_install" = x"yes"; then |
---|
754 | ac_configure_args="$ac_configure_args --enable-ltdl-install" |
---|
755 | LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la |
---|
756 | INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) |
---|
757 | else |
---|
758 | ac_configure_args="$ac_configure_args --enable-ltdl-install=no" |
---|
759 | LIBLTDL="-lltdl" |
---|
760 | INCLTDL= |
---|
761 | fi |
---|
762 | ]) |
---|
763 | |
---|
764 | dnl old names |
---|
765 | AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl |
---|
766 | AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl |
---|
767 | AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl |
---|
768 | AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl |
---|
769 | AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl |
---|
770 | AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl |
---|
771 | AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl |
---|
772 | |
---|
773 | dnl This is just to silence aclocal about the macro not being used |
---|
774 | ifelse([AC_DISABLE_FAST_INSTALL])dnl |
---|
775 | |
---|
776 | # Configure paths for GTK+ |
---|
777 | # Owen Taylor 97-11-3 |
---|
778 | |
---|
779 | dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) |
---|
780 | dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS |
---|
781 | dnl |
---|
782 | AC_DEFUN(AM_PATH_GTK, |
---|
783 | [dnl |
---|
784 | dnl Get the cflags and libraries from the gtk-config script |
---|
785 | dnl |
---|
786 | AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], |
---|
787 | gtk_config_prefix="$withval", gtk_config_prefix="") |
---|
788 | AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], |
---|
789 | gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") |
---|
790 | AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], |
---|
791 | , enable_gtktest=yes) |
---|
792 | |
---|
793 | for module in . $4 |
---|
794 | do |
---|
795 | case "$module" in |
---|
796 | gthread) |
---|
797 | gtk_config_args="$gtk_config_args gthread" |
---|
798 | ;; |
---|
799 | esac |
---|
800 | done |
---|
801 | |
---|
802 | if test x$gtk_config_exec_prefix != x ; then |
---|
803 | gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" |
---|
804 | if test x${GTK_CONFIG+set} != xset ; then |
---|
805 | GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config |
---|
806 | fi |
---|
807 | fi |
---|
808 | if test x$gtk_config_prefix != x ; then |
---|
809 | gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" |
---|
810 | if test x${GTK_CONFIG+set} != xset ; then |
---|
811 | GTK_CONFIG=$gtk_config_prefix/bin/gtk-config |
---|
812 | fi |
---|
813 | fi |
---|
814 | |
---|
815 | AC_PATH_PROG(GTK_CONFIG, gtk-config, no) |
---|
816 | min_gtk_version=ifelse([$1], ,0.99.7,$1) |
---|
817 | AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) |
---|
818 | no_gtk="" |
---|
819 | if test "$GTK_CONFIG" = "no" ; then |
---|
820 | no_gtk=yes |
---|
821 | else |
---|
822 | GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` |
---|
823 | GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` |
---|
824 | gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ |
---|
825 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
---|
826 | gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ |
---|
827 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
---|
828 | gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ |
---|
829 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
---|
830 | if test "x$enable_gtktest" = "xyes" ; then |
---|
831 | ac_save_CFLAGS="$CFLAGS" |
---|
832 | ac_save_LIBS="$LIBS" |
---|
833 | CFLAGS="$CFLAGS $GTK_CFLAGS" |
---|
834 | LIBS="$GTK_LIBS $LIBS" |
---|
835 | dnl |
---|
836 | dnl Now check if the installed GTK is sufficiently new. (Also sanity |
---|
837 | dnl checks the results of gtk-config to some extent |
---|
838 | dnl |
---|
839 | rm -f conf.gtktest |
---|
840 | AC_TRY_RUN([ |
---|
841 | #include <gtk/gtk.h> |
---|
842 | #include <stdio.h> |
---|
843 | #include <stdlib.h> |
---|
844 | |
---|
845 | int |
---|
846 | main () |
---|
847 | { |
---|
848 | int major, minor, micro; |
---|
849 | char *tmp_version; |
---|
850 | |
---|
851 | system ("touch conf.gtktest"); |
---|
852 | |
---|
853 | /* HP/UX 9 (%@#!) writes to sscanf strings */ |
---|
854 | tmp_version = g_strdup("$min_gtk_version"); |
---|
855 | if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { |
---|
856 | printf("%s, bad version string\n", "$min_gtk_version"); |
---|
857 | exit(1); |
---|
858 | } |
---|
859 | |
---|
860 | if ((gtk_major_version != $gtk_config_major_version) || |
---|
861 | (gtk_minor_version != $gtk_config_minor_version) || |
---|
862 | (gtk_micro_version != $gtk_config_micro_version)) |
---|
863 | { |
---|
864 | printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", |
---|
865 | $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, |
---|
866 | gtk_major_version, gtk_minor_version, gtk_micro_version); |
---|
867 | printf ("*** was found! If gtk-config was correct, then it is best\n"); |
---|
868 | printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); |
---|
869 | printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); |
---|
870 | printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); |
---|
871 | printf("*** required on your system.\n"); |
---|
872 | printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); |
---|
873 | printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); |
---|
874 | printf("*** before re-running configure\n"); |
---|
875 | } |
---|
876 | #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) |
---|
877 | else if ((gtk_major_version != GTK_MAJOR_VERSION) || |
---|
878 | (gtk_minor_version != GTK_MINOR_VERSION) || |
---|
879 | (gtk_micro_version != GTK_MICRO_VERSION)) |
---|
880 | { |
---|
881 | printf("*** GTK+ header files (version %d.%d.%d) do not match\n", |
---|
882 | GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); |
---|
883 | printf("*** library (version %d.%d.%d)\n", |
---|
884 | gtk_major_version, gtk_minor_version, gtk_micro_version); |
---|
885 | } |
---|
886 | #endif /* defined (GTK_MAJOR_VERSION) ... */ |
---|
887 | else |
---|
888 | { |
---|
889 | if ((gtk_major_version > major) || |
---|
890 | ((gtk_major_version == major) && (gtk_minor_version > minor)) || |
---|
891 | ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) |
---|
892 | { |
---|
893 | return 0; |
---|
894 | } |
---|
895 | else |
---|
896 | { |
---|
897 | printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", |
---|
898 | gtk_major_version, gtk_minor_version, gtk_micro_version); |
---|
899 | printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", |
---|
900 | major, minor, micro); |
---|
901 | printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); |
---|
902 | printf("***\n"); |
---|
903 | printf("*** If you have already installed a sufficiently new version, this error\n"); |
---|
904 | printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); |
---|
905 | printf("*** being found. The easiest way to fix this is to remove the old version\n"); |
---|
906 | printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); |
---|
907 | printf("*** correct copy of gtk-config. (In this case, you will have to\n"); |
---|
908 | printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); |
---|
909 | printf("*** so that the correct libraries are found at run-time))\n"); |
---|
910 | } |
---|
911 | } |
---|
912 | return 1; |
---|
913 | } |
---|
914 | ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
---|
915 | CFLAGS="$ac_save_CFLAGS" |
---|
916 | LIBS="$ac_save_LIBS" |
---|
917 | fi |
---|
918 | fi |
---|
919 | if test "x$no_gtk" = x ; then |
---|
920 | AC_MSG_RESULT(yes) |
---|
921 | ifelse([$2], , :, [$2]) |
---|
922 | else |
---|
923 | AC_MSG_RESULT(no) |
---|
924 | if test "$GTK_CONFIG" = "no" ; then |
---|
925 | echo "*** The gtk-config script installed by GTK could not be found" |
---|
926 | echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" |
---|
927 | echo "*** your path, or set the GTK_CONFIG environment variable to the" |
---|
928 | echo "*** full path to gtk-config." |
---|
929 | else |
---|
930 | if test -f conf.gtktest ; then |
---|
931 | : |
---|
932 | else |
---|
933 | echo "*** Could not run GTK test program, checking why..." |
---|
934 | CFLAGS="$CFLAGS $GTK_CFLAGS" |
---|
935 | LIBS="$LIBS $GTK_LIBS" |
---|
936 | AC_TRY_LINK([ |
---|
937 | #include <gtk/gtk.h> |
---|
938 | #include <stdio.h> |
---|
939 | ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], |
---|
940 | [ echo "*** The test program compiled, but did not run. This usually means" |
---|
941 | echo "*** that the run-time linker is not finding GTK or finding the wrong" |
---|
942 | echo "*** version of GTK. If it is not finding GTK, you'll need to set your" |
---|
943 | echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" |
---|
944 | echo "*** to the installed location Also, make sure you have run ldconfig if that" |
---|
945 | echo "*** is required on your system" |
---|
946 | echo "***" |
---|
947 | echo "*** If you have an old version installed, it is best to remove it, although" |
---|
948 | echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" |
---|
949 | echo "***" |
---|
950 | echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" |
---|
951 | echo "*** came with the system with the command" |
---|
952 | echo "***" |
---|
953 | echo "*** rpm --erase --nodeps gtk gtk-devel" ], |
---|
954 | [ echo "*** The test program failed to compile or link. See the file config.log for the" |
---|
955 | echo "*** exact error that occured. This usually means GTK was incorrectly installed" |
---|
956 | echo "*** or that you have moved GTK since it was installed. In the latter case, you" |
---|
957 | echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) |
---|
958 | CFLAGS="$ac_save_CFLAGS" |
---|
959 | LIBS="$ac_save_LIBS" |
---|
960 | fi |
---|
961 | fi |
---|
962 | GTK_CFLAGS="" |
---|
963 | GTK_LIBS="" |
---|
964 | ifelse([$3], , :, [$3]) |
---|
965 | fi |
---|
966 | AC_SUBST(GTK_CFLAGS) |
---|
967 | AC_SUBST(GTK_LIBS) |
---|
968 | rm -f conf.gtktest |
---|
969 | ]) |
---|
970 | |
---|
971 | dnl |
---|
972 | dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag], [additional-inits]) |
---|
973 | dnl |
---|
974 | dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh |
---|
975 | dnl is not found. |
---|
976 | dnl |
---|
977 | |
---|
978 | AC_DEFUN([GNOME_INIT_HOOK],[ |
---|
979 | AC_SUBST(GNOME_LIBS) |
---|
980 | AC_SUBST(GNOMEUI_LIBS) |
---|
981 | AC_SUBST(GNOMEGNORBA_LIBS) |
---|
982 | AC_SUBST(GTKXMHTML_LIBS) |
---|
983 | AC_SUBST(ZVT_LIBS) |
---|
984 | AC_SUBST(GNOME_LIBDIR) |
---|
985 | AC_SUBST(GNOME_INCLUDEDIR) |
---|
986 | |
---|
987 | AC_ARG_WITH(gnome-includes, |
---|
988 | [ --with-gnome-includes Specify location of GNOME headers],[ |
---|
989 | CFLAGS="$CFLAGS -I$withval" |
---|
990 | ]) |
---|
991 | |
---|
992 | AC_ARG_WITH(gnome-libs, |
---|
993 | [ --with-gnome-libs Specify location of GNOME libs],[ |
---|
994 | LDFLAGS="$LDFLAGS -L$withval" |
---|
995 | gnome_prefix=$withval |
---|
996 | ]) |
---|
997 | |
---|
998 | AC_ARG_WITH(gnome, |
---|
999 | [ --with-gnome Specify prefix for GNOME files], |
---|
1000 | if test x$withval = xyes; then |
---|
1001 | want_gnome=yes |
---|
1002 | dnl Note that an empty true branch is not |
---|
1003 | dnl valid sh syntax. |
---|
1004 | ifelse([$1], [], :, [$1]) |
---|
1005 | else |
---|
1006 | if test "x$withval" = xno; then |
---|
1007 | want_gnome=no |
---|
1008 | else |
---|
1009 | want_gnome=yes |
---|
1010 | LDFLAGS="$LDFLAGS -L$withval/lib" |
---|
1011 | CFLAGS="$CFLAGS -I$withval/include" |
---|
1012 | gnome_prefix=$withval/lib |
---|
1013 | fi |
---|
1014 | fi, |
---|
1015 | want_gnome=yes) |
---|
1016 | |
---|
1017 | if test "x$want_gnome" = xyes; then |
---|
1018 | |
---|
1019 | AC_PATH_PROG(GNOME_CONFIG,gnome-config,no) |
---|
1020 | if test "$GNOME_CONFIG" = "no"; then |
---|
1021 | no_gnome_config="yes" |
---|
1022 | else |
---|
1023 | AC_MSG_CHECKING(if $GNOME_CONFIG works) |
---|
1024 | if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then |
---|
1025 | AC_MSG_RESULT(yes) |
---|
1026 | GNOME_GNORBA_HOOK([],$2) |
---|
1027 | GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`" |
---|
1028 | GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`" |
---|
1029 | GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`" |
---|
1030 | GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`" |
---|
1031 | ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`" |
---|
1032 | GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`" |
---|
1033 | GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`" |
---|
1034 | $1 |
---|
1035 | else |
---|
1036 | AC_MSG_RESULT(no) |
---|
1037 | no_gnome_config="yes" |
---|
1038 | fi |
---|
1039 | fi |
---|
1040 | |
---|
1041 | if test x$exec_prefix = xNONE; then |
---|
1042 | if test x$prefix = xNONE; then |
---|
1043 | gnome_prefix=$ac_default_prefix/lib |
---|
1044 | else |
---|
1045 | gnome_prefix=$prefix/lib |
---|
1046 | fi |
---|
1047 | else |
---|
1048 | gnome_prefix=`eval echo \`echo $libdir\`` |
---|
1049 | fi |
---|
1050 | |
---|
1051 | if test "$no_gnome_config" = "yes"; then |
---|
1052 | AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix) |
---|
1053 | if test -f $gnome_prefix/gnomeConf.sh; then |
---|
1054 | AC_MSG_RESULT(found) |
---|
1055 | echo "loading gnome configuration from" \ |
---|
1056 | "$gnome_prefix/gnomeConf.sh" |
---|
1057 | . $gnome_prefix/gnomeConf.sh |
---|
1058 | $1 |
---|
1059 | else |
---|
1060 | AC_MSG_RESULT(not found) |
---|
1061 | if test x$2 = xfail; then |
---|
1062 | AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install) |
---|
1063 | fi |
---|
1064 | fi |
---|
1065 | fi |
---|
1066 | fi |
---|
1067 | |
---|
1068 | if test -n "$3"; then |
---|
1069 | n="$3" |
---|
1070 | for i in $n; do |
---|
1071 | AC_MSG_CHECKING(extra library \"$i\") |
---|
1072 | case $i in |
---|
1073 | applets) |
---|
1074 | AC_SUBST(GNOME_APPLETS_LIBS) |
---|
1075 | GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets` |
---|
1076 | AC_MSG_RESULT($GNOME_APPLETS_LIBS);; |
---|
1077 | docklets) |
---|
1078 | AC_SUBST(GNOME_DOCKLETS_LIBS) |
---|
1079 | GNOME_DOCKLETS_LIBS=`$GNOME_CONFIG --libs-only-l docklets` |
---|
1080 | AC_MSG_RESULT($GNOME_DOCKLETS_LIBS);; |
---|
1081 | capplet) |
---|
1082 | AC_SUBST(GNOME_CAPPLET_LIBS) |
---|
1083 | GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet` |
---|
1084 | AC_MSG_RESULT($GNOME_CAPPLET_LIBS);; |
---|
1085 | *) |
---|
1086 | AC_MSG_RESULT(unknown library) |
---|
1087 | esac |
---|
1088 | done |
---|
1089 | fi |
---|
1090 | ]) |
---|
1091 | |
---|
1092 | dnl |
---|
1093 | dnl GNOME_INIT ([additional-inits]) |
---|
1094 | dnl |
---|
1095 | |
---|
1096 | AC_DEFUN([GNOME_INIT],[ |
---|
1097 | GNOME_INIT_HOOK([],fail,$1) |
---|
1098 | ]) |
---|
1099 | |
---|
1100 | dnl |
---|
1101 | dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag) |
---|
1102 | dnl |
---|
1103 | dnl if failflag is "failure" it aborts if gnorba is not found. |
---|
1104 | dnl |
---|
1105 | |
---|
1106 | AC_DEFUN([GNOME_GNORBA_HOOK],[ |
---|
1107 | GNOME_ORBIT_HOOK([],$2) |
---|
1108 | AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[ |
---|
1109 | gnome_cv_gnorba_found=no |
---|
1110 | if test x$gnome_cv_orbit_found = xyes; then |
---|
1111 | GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`" |
---|
1112 | GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`" |
---|
1113 | if test -n "$GNORBA_LIBS"; then |
---|
1114 | gnome_cv_gnorba_found=yes |
---|
1115 | fi |
---|
1116 | fi |
---|
1117 | ]) |
---|
1118 | AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes) |
---|
1119 | if test x$gnome_cv_orbit_found = xyes; then |
---|
1120 | $1 |
---|
1121 | GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`" |
---|
1122 | GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`" |
---|
1123 | AC_SUBST(GNORBA_CFLAGS) |
---|
1124 | AC_SUBST(GNORBA_LIBS) |
---|
1125 | else |
---|
1126 | if test x$2 = xfailure; then |
---|
1127 | AC_MSG_ERROR(gnorba library not installed or installation problem) |
---|
1128 | fi |
---|
1129 | fi |
---|
1130 | ]) |
---|
1131 | |
---|
1132 | AC_DEFUN([GNOME_GNORBA_CHECK], [ |
---|
1133 | GNOME_GNORBA_HOOK([],failure) |
---|
1134 | ]) |
---|
1135 | |
---|
1136 | dnl |
---|
1137 | dnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag) |
---|
1138 | dnl |
---|
1139 | dnl if failflag is "failure" it aborts if orbit is not found. |
---|
1140 | dnl |
---|
1141 | |
---|
1142 | AC_DEFUN([GNOME_ORBIT_HOOK],[ |
---|
1143 | AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no) |
---|
1144 | AC_PATH_PROG(ORBIT_IDL,orbit-idl,no) |
---|
1145 | AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[ |
---|
1146 | if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then |
---|
1147 | gnome_cv_orbit_found=no |
---|
1148 | else |
---|
1149 | gnome_cv_orbit_found=yes |
---|
1150 | fi |
---|
1151 | ]) |
---|
1152 | AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes) |
---|
1153 | if test x$gnome_cv_orbit_found = xyes; then |
---|
1154 | $1 |
---|
1155 | ORBIT_CFLAGS=`orbit-config --cflags client server` |
---|
1156 | ORBIT_LIBS=`orbit-config --use-service=name --libs client server` |
---|
1157 | AC_SUBST(ORBIT_CFLAGS) |
---|
1158 | AC_SUBST(ORBIT_LIBS) |
---|
1159 | else |
---|
1160 | if test x$2 = xfailure; then |
---|
1161 | AC_MSG_ERROR(ORBit not installed or installation problem) |
---|
1162 | fi |
---|
1163 | fi |
---|
1164 | ]) |
---|
1165 | |
---|
1166 | AC_DEFUN([GNOME_ORBIT_CHECK], [ |
---|
1167 | GNOME_ORBIT_HOOK([],failure) |
---|
1168 | ]) |
---|
1169 | |
---|
1170 | # Configure paths for Bonobo |
---|
1171 | # Miguel de Icaza, 99-04-12 |
---|
1172 | # Stolen from Chris Lahey 99-2-5 |
---|
1173 | # stolen from Manish Singh again |
---|
1174 | # stolen back from Frank Belew |
---|
1175 | # stolen from Manish Singh |
---|
1176 | # Shamelessly stolen from Owen Taylor |
---|
1177 | |
---|
1178 | dnl AM_PATH_BONOBO ([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) |
---|
1179 | dnl Test for Bonobo, and define BONOBO_CFLAGS and BONOBO_LIBS |
---|
1180 | dnl |
---|
1181 | AC_DEFUN([AM_PATH_BONOBO], |
---|
1182 | [ |
---|
1183 | dnl |
---|
1184 | dnl Get the cflags and libraries from the gnome-config script |
---|
1185 | dnl |
---|
1186 | AC_ARG_WITH(bonobo-prefix,[ --with-bonobo-prefix=PFX Prefix where Bonobo is installed (optional)], |
---|
1187 | bonobo_prefix="$withval", bonobo_prefix="") |
---|
1188 | AC_ARG_WITH(bonobo-exec-prefix,[ --with-bonobo-exec-prefix=PFX Exec prefix where Bonobo is installed (optional)], |
---|
1189 | bonobo_exec_prefix="$withval", bonobo_exec_prefix="") |
---|
1190 | AC_ARG_ENABLE(bonobotest, [ --disable-bonobotest Do not try to compile and run a test Bonobo program], |
---|
1191 | , enable_bonobotest=yes) |
---|
1192 | |
---|
1193 | if test x$bonobo_exec_prefix != x ; then |
---|
1194 | bonobo_args="$bonobo_args --exec-prefix=$bonobo_exec_prefix" |
---|
1195 | if test x${GNOME_CONFIG+set} != xset ; then |
---|
1196 | GNOME_CONFIG=$bonobo_exec_prefix/bin/gnome-config |
---|
1197 | fi |
---|
1198 | fi |
---|
1199 | if test x$bonobo_prefix != x ; then |
---|
1200 | bonobo_args="$bonobo_args --prefix=$bonobo_prefix" |
---|
1201 | if test x${GNOME_CONFIG+set} != xset ; then |
---|
1202 | GNOME_CONFIG=$bonobo_prefix/bin/gnome-config |
---|
1203 | fi |
---|
1204 | fi |
---|
1205 | |
---|
1206 | AC_PATH_PROG(GNOME_CONFIG, gnome-config, no) |
---|
1207 | min_bonobo_version=ifelse([$1], ,0.1.0,$1) |
---|
1208 | AC_MSG_CHECKING(for BONOBO - version >= $min_bonobo_version) |
---|
1209 | no_bonobo="" |
---|
1210 | if test "$GNOME_CONFIG" = "no" ; then |
---|
1211 | no_bonobo=yes |
---|
1212 | else |
---|
1213 | BONOBO_CFLAGS=`$GNOME_CONFIG $bonoboconf_args --cflags bonobo bonobox` |
---|
1214 | BONOBO_LIBS=`$GNOME_CONFIG $bonoboconf_args --libs bonobo bonobox` |
---|
1215 | |
---|
1216 | bonobo_major_version=`$GNOME_CONFIG $bonobo_args --version | \ |
---|
1217 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
---|
1218 | bonobo_minor_version=`$GNOME_CONFIG $bonobo_args --version | \ |
---|
1219 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
---|
1220 | bonobo_micro_version=`$GNOME_CONFIG $bonobo_config_args --version | \ |
---|
1221 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
---|
1222 | if test "x$enable_bonobotest" = "xyes" ; then |
---|
1223 | ac_save_CFLAGS="$CFLAGS" |
---|
1224 | ac_save_LIBS="$LIBS" |
---|
1225 | CFLAGS="$CFLAGS $BONOBO_CFLAGS" |
---|
1226 | LIBS="$LIBS $BONOBO_LIBS" |
---|
1227 | dnl |
---|
1228 | dnl Now check if the installed BONOBO is sufficiently new. (Also sanity |
---|
1229 | dnl checks the results of gnome-config to some extent |
---|
1230 | dnl |
---|
1231 | rm -f conf.bonobotest |
---|
1232 | AC_TRY_RUN([ |
---|
1233 | #include <stdio.h> |
---|
1234 | #include <stdlib.h> |
---|
1235 | #include <string.h> |
---|
1236 | #include <bonobo.h> |
---|
1237 | |
---|
1238 | static char* |
---|
1239 | my_strdup (char *str) |
---|
1240 | { |
---|
1241 | char *new_str; |
---|
1242 | |
---|
1243 | if (str) |
---|
1244 | { |
---|
1245 | new_str = malloc ((strlen (str) + 1) * sizeof(char)); |
---|
1246 | strcpy (new_str, str); |
---|
1247 | } |
---|
1248 | else |
---|
1249 | new_str = NULL; |
---|
1250 | |
---|
1251 | return new_str; |
---|
1252 | } |
---|
1253 | |
---|
1254 | int main () |
---|
1255 | { |
---|
1256 | int major, minor, micro; |
---|
1257 | char *tmp_version; |
---|
1258 | |
---|
1259 | system ("touch conf.bonobotest"); |
---|
1260 | bonobo_object_get_type (); |
---|
1261 | return 0; |
---|
1262 | } |
---|
1263 | |
---|
1264 | ],, no_bonobo=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
---|
1265 | CFLAGS="$ac_save_CFLAGS" |
---|
1266 | LIBS="$ac_save_LIBS" |
---|
1267 | fi |
---|
1268 | fi |
---|
1269 | if test "x$no_bonobo" = x ; then |
---|
1270 | AC_MSG_RESULT(yes) |
---|
1271 | ifelse([$2], , :, [$2]) |
---|
1272 | else |
---|
1273 | AC_MSG_RESULT(no) |
---|
1274 | if test "$GNOME_CONFIG" = "no" ; then |
---|
1275 | echo "*** The gnome-config script installed by GNOME-LIBS could not be found" |
---|
1276 | echo "*** If BONOBO was installed in PREFIX, make sure PREFIX/bin is in" |
---|
1277 | echo "*** your path, or set the GNOME_CONFIG environment variable to the" |
---|
1278 | echo "*** full path to gnome-config." |
---|
1279 | else |
---|
1280 | if test -f conf.bonobotest ; then |
---|
1281 | : |
---|
1282 | else |
---|
1283 | echo "*** Could not run BONOBO test program, checking why..." |
---|
1284 | CFLAGS="$CFLAGS $BONOBO_CFLAGS" |
---|
1285 | LIBS="$LIBS $BONOBO_LIBS" |
---|
1286 | AC_TRY_LINK([ |
---|
1287 | #include <stdio.h> |
---|
1288 | #include <bonobo/gnome-object.h> |
---|
1289 | ], [ return 0; ], |
---|
1290 | [ echo "*** The test program compiled, but did not run. This usually means" |
---|
1291 | echo "*** that the run-time linker is not finding BONOBO or finding the wrong" |
---|
1292 | echo "*** version of BONOBO. If it is not finding BONOBO, you'll need to set your" |
---|
1293 | echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" |
---|
1294 | echo "*** to the installed location Also, make sure you have run ldconfig if that" |
---|
1295 | echo "*** is required on your system" |
---|
1296 | echo "***" |
---|
1297 | echo "*** If you have an old version installed, it is best to remove it, although" |
---|
1298 | echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], |
---|
1299 | [ echo "*** The test program failed to compile or link. See the file config.log for the" |
---|
1300 | echo "*** exact error that occured. This usually means BONOBO was incorrectly installed" |
---|
1301 | echo "*** or that you have moved BONOBO since it was installed. In the latter case, you" |
---|
1302 | echo "*** may want to edit the gnome-config script: $GNOME_CONFIG" ]) |
---|
1303 | CFLAGS="$ac_save_CFLAGS" |
---|
1304 | LIBS="$ac_save_LIBS" |
---|
1305 | fi |
---|
1306 | fi |
---|
1307 | BONOBO_CFLAGS="" |
---|
1308 | BONOBO_LIBS="" |
---|
1309 | ifelse([$3], , :, [$3]) |
---|
1310 | fi |
---|
1311 | AC_SUBST(BONOBO_CFLAGS) |
---|
1312 | AC_SUBST(BONOBO_LIBS) |
---|
1313 | rm -f conf.bonobotest |
---|
1314 | ]) |
---|
1315 | |
---|
1316 | AC_DEFUN([BONOBO_CHECK], [ |
---|
1317 | AM_PATH_BONOBO(0.1.0,,[AC_MSG_ERROR(BONOBO not found)]) |
---|
1318 | ]) |
---|
1319 | |
---|
1320 | AC_DEFUN([AM_BONOBO_USES_OAF], |
---|
1321 | [ |
---|
1322 | AC_REQUIRE([AM_PATH_BONOBO]) |
---|
1323 | |
---|
1324 | AC_MSG_CHECKING(if Bonobo uses OAF) |
---|
1325 | if ( gnome-config --libs bonobo | grep oaf ) > /dev/null 2>&1 ; then |
---|
1326 | using_oaf="yes" |
---|
1327 | AC_DEFINE(BONOBO_USES_OAF) |
---|
1328 | else |
---|
1329 | using_oaf="no" |
---|
1330 | fi |
---|
1331 | |
---|
1332 | AC_MSG_RESULT("$using_oaf") |
---|
1333 | |
---|
1334 | AM_CONDITIONAL(BONOBO_USES_OAF, test x"using_oaf" = "xyes") |
---|
1335 | ]) |
---|
1336 | |
---|
1337 | dnl GNOME_COMPILE_WARNINGS |
---|
1338 | dnl Turn on many useful compiler warnings |
---|
1339 | dnl For now, only works on GCC |
---|
1340 | AC_DEFUN([GNOME_COMPILE_WARNINGS],[ |
---|
1341 | AC_ARG_ENABLE(compile-warnings, |
---|
1342 | [ --enable-compile-warnings=[no/minimum/yes] Turn on compiler warnings.],,enable_compile_warnings=minimum) |
---|
1343 | |
---|
1344 | AC_MSG_CHECKING(what warning flags to pass to the C compiler) |
---|
1345 | warnCFLAGS= |
---|
1346 | if test "x$GCC" != xyes; then |
---|
1347 | enable_compile_warnings=no |
---|
1348 | fi |
---|
1349 | |
---|
1350 | if test "x$enable_compile_warnings" != "xno"; then |
---|
1351 | if test "x$GCC" = "xyes"; then |
---|
1352 | case " $CFLAGS " in |
---|
1353 | *[\ \ ]-Wall[\ \ ]*) ;; |
---|
1354 | *) warnCFLAGS="-Wall -Wunused" ;; |
---|
1355 | esac |
---|
1356 | |
---|
1357 | ## -W is not all that useful. And it cannot be controlled |
---|
1358 | ## with individual -Wno-xxx flags, unlike -Wall |
---|
1359 | if test "x$enable_compile_warnings" = "xyes"; then |
---|
1360 | warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wmissing-declarations" |
---|
1361 | fi |
---|
1362 | fi |
---|
1363 | fi |
---|
1364 | AC_MSG_RESULT($warnCFLAGS) |
---|
1365 | |
---|
1366 | AC_ARG_ENABLE(iso-c, |
---|
1367 | [ --enable-iso-c Try to warn if code is not ISO C ],, |
---|
1368 | enable_iso_c=no) |
---|
1369 | |
---|
1370 | AC_MSG_CHECKING(what language compliance flags to pass to the C compiler) |
---|
1371 | complCFLAGS= |
---|
1372 | if test "x$enable_iso_c" != "xno"; then |
---|
1373 | if test "x$GCC" = "xyes"; then |
---|
1374 | case " $CFLAGS " in |
---|
1375 | *[\ \ ]-ansi[\ \ ]*) ;; |
---|
1376 | *) complCFLAGS="$complCFLAGS -ansi" ;; |
---|
1377 | esac |
---|
1378 | |
---|
1379 | case " $CFLAGS " in |
---|
1380 | *[\ \ ]-pedantic[\ \ ]*) ;; |
---|
1381 | *) complCFLAGS="$complCFLAGS -pedantic" ;; |
---|
1382 | esac |
---|
1383 | fi |
---|
1384 | fi |
---|
1385 | AC_MSG_RESULT($complCFLAGS) |
---|
1386 | if test "x$cflags_set" != "xyes"; then |
---|
1387 | CFLAGS="$CFLAGS $warnCFLAGS $complCFLAGS" |
---|
1388 | cflags_set=yes |
---|
1389 | AC_SUBST(cflags_set) |
---|
1390 | fi |
---|
1391 | ]) |
---|
1392 | |
---|
1393 | dnl For C++, do basically the same thing. |
---|
1394 | |
---|
1395 | AC_DEFUN([GNOME_CXX_WARNINGS],[ |
---|
1396 | AC_ARG_ENABLE(cxx-warnings, |
---|
1397 | [ --enable-cxx-warnings=[no/minimum/yes] Turn on compiler warnings.],,enable_cxx_warnings=minimum) |
---|
1398 | |
---|
1399 | AC_MSG_CHECKING(what warning flags to pass to the C++ compiler) |
---|
1400 | warnCXXFLAGS= |
---|
1401 | if test "x$GCC" != xyes; then |
---|
1402 | enable_compile_warnings=no |
---|
1403 | fi |
---|
1404 | if test "x$enable_cxx_warnings" != "xno"; then |
---|
1405 | if test "x$GCC" = "xyes"; then |
---|
1406 | case " $CXXFLAGS " in |
---|
1407 | *[\ \ ]-Wall[\ \ ]*) ;; |
---|
1408 | *) warnCXXFLAGS="-Wall -Wno-unused" ;; |
---|
1409 | esac |
---|
1410 | |
---|
1411 | ## -W is not all that useful. And it cannot be controlled |
---|
1412 | ## with individual -Wno-xxx flags, unlike -Wall |
---|
1413 | if test "x$enable_cxx_warnings" = "xyes"; then |
---|
1414 | warnCXXFLAGS="$warnCXXFLAGS -Wmissing-prototypes -Wmissing-declarations -Wshadow -Woverloaded-virtual" |
---|
1415 | fi |
---|
1416 | fi |
---|
1417 | fi |
---|
1418 | AC_MSG_RESULT($warnCXXFLAGS) |
---|
1419 | |
---|
1420 | AC_ARG_ENABLE(iso-cxx, |
---|
1421 | [ --enable-iso-cxx Try to warn if code is not ISO C++ ],, |
---|
1422 | enable_iso_cxx=no) |
---|
1423 | |
---|
1424 | AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler) |
---|
1425 | complCXXFLAGS= |
---|
1426 | if test "x$enable_iso_cxx" != "xno"; then |
---|
1427 | if test "x$GCC" = "xyes"; then |
---|
1428 | case " $CXXFLAGS " in |
---|
1429 | *[\ \ ]-ansi[\ \ ]*) ;; |
---|
1430 | *) complCXXFLAGS="$complCXXFLAGS -ansi" ;; |
---|
1431 | esac |
---|
1432 | |
---|
1433 | case " $CXXFLAGS " in |
---|
1434 | *[\ \ ]-pedantic[\ \ ]*) ;; |
---|
1435 | *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;; |
---|
1436 | esac |
---|
1437 | fi |
---|
1438 | fi |
---|
1439 | AC_MSG_RESULT($complCXXFLAGS) |
---|
1440 | if test "x$cxxflags_set" != "xyes"; then |
---|
1441 | CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS" |
---|
1442 | cxxflags_set=yes |
---|
1443 | AC_SUBST(cxxflags_set) |
---|
1444 | fi |
---|
1445 | ]) |
---|
1446 | |
---|
1447 | # Macro to add for using GNU gettext. |
---|
1448 | # Ulrich Drepper <drepper@cygnus.com>, 1995. |
---|
1449 | # |
---|
1450 | # Modified to never use included libintl. |
---|
1451 | # Owen Taylor <otaylor@redhat.com>, 12/15/1998 |
---|
1452 | # |
---|
1453 | # |
---|
1454 | # This file can be copied and used freely without restrictions. It can |
---|
1455 | # be used in projects which are not available under the GNU Public License |
---|
1456 | # but which still want to provide support for the GNU gettext functionality. |
---|
1457 | # Please note that the actual code is *not* freely available. |
---|
1458 | |
---|
1459 | # serial 5 |
---|
1460 | |
---|
1461 | AC_DEFUN(AM_GNOME_WITH_NLS, |
---|
1462 | [AC_MSG_CHECKING([whether NLS is requested]) |
---|
1463 | dnl Default is enabled NLS |
---|
1464 | AC_ARG_ENABLE(nls, |
---|
1465 | [ --disable-nls do not use Native Language Support], |
---|
1466 | USE_NLS=$enableval, USE_NLS=yes) |
---|
1467 | AC_MSG_RESULT($USE_NLS) |
---|
1468 | AC_SUBST(USE_NLS) |
---|
1469 | |
---|
1470 | USE_INCLUDED_LIBINTL=no |
---|
1471 | |
---|
1472 | dnl If we use NLS figure out what method |
---|
1473 | if test "$USE_NLS" = "yes"; then |
---|
1474 | AC_DEFINE(ENABLE_NLS) |
---|
1475 | # AC_MSG_CHECKING([whether included gettext is requested]) |
---|
1476 | # AC_ARG_WITH(included-gettext, |
---|
1477 | # [ --with-included-gettext use the GNU gettext library included here], |
---|
1478 | # nls_cv_force_use_gnu_gettext=$withval, |
---|
1479 | # nls_cv_force_use_gnu_gettext=no) |
---|
1480 | # AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) |
---|
1481 | nls_cv_force_use_gnu_gettext="no" |
---|
1482 | |
---|
1483 | nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" |
---|
1484 | if test "$nls_cv_force_use_gnu_gettext" != "yes"; then |
---|
1485 | dnl User does not insist on using GNU NLS library. Figure out what |
---|
1486 | dnl to use. If gettext or catgets are available (in this order) we |
---|
1487 | dnl use this. Else we have to fall back to GNU NLS library. |
---|
1488 | dnl catgets is only used if permitted by option --with-catgets. |
---|
1489 | nls_cv_header_intl= |
---|
1490 | nls_cv_header_libgt= |
---|
1491 | CATOBJEXT=NONE |
---|
1492 | |
---|
1493 | AC_CHECK_HEADER(libintl.h, |
---|
1494 | [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, |
---|
1495 | [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")], |
---|
1496 | gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) |
---|
1497 | |
---|
1498 | if test "$gt_cv_func_gettext_libc" != "yes"; then |
---|
1499 | AC_CHECK_LIB(intl, bindtextdomain, |
---|
1500 | [AC_CACHE_CHECK([for gettext in libintl], |
---|
1501 | gt_cv_func_gettext_libintl, |
---|
1502 | [AC_CHECK_LIB(intl, gettext, |
---|
1503 | gt_cv_func_gettext_libintl=yes, |
---|
1504 | gt_cv_func_gettext_libintl=no)], |
---|
1505 | gt_cv_func_gettext_libintl=no)]) |
---|
1506 | fi |
---|
1507 | |
---|
1508 | if test "$gt_cv_func_gettext_libc" = "yes" \ |
---|
1509 | || test "$gt_cv_func_gettext_libintl" = "yes"; then |
---|
1510 | AC_DEFINE(HAVE_GETTEXT) |
---|
1511 | AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, |
---|
1512 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl |
---|
1513 | if test "$MSGFMT" != "no"; then |
---|
1514 | AC_CHECK_FUNCS(dcgettext) |
---|
1515 | AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) |
---|
1516 | AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, |
---|
1517 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) |
---|
1518 | AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; |
---|
1519 | return _nl_msg_cat_cntr], |
---|
1520 | [CATOBJEXT=.gmo |
---|
1521 | DATADIRNAME=share], |
---|
1522 | [CATOBJEXT=.mo |
---|
1523 | DATADIRNAME=lib]) |
---|
1524 | INSTOBJEXT=.mo |
---|
1525 | fi |
---|
1526 | fi |
---|
1527 | |
---|
1528 | # Added by Martin Baulig 12/15/98 for libc5 systems |
---|
1529 | if test "$gt_cv_func_gettext_libc" != "yes" \ |
---|
1530 | && test "$gt_cv_func_gettext_libintl" = "yes"; then |
---|
1531 | INTLLIBS=-lintl |
---|
1532 | LIBS=`echo $LIBS | sed -e 's/-lintl//'` |
---|
1533 | fi |
---|
1534 | ]) |
---|
1535 | |
---|
1536 | if test "$CATOBJEXT" = "NONE"; then |
---|
1537 | AC_MSG_CHECKING([whether catgets can be used]) |
---|
1538 | AC_ARG_WITH(catgets, |
---|
1539 | [ --with-catgets use catgets functions if available], |
---|
1540 | nls_cv_use_catgets=$withval, nls_cv_use_catgets=no) |
---|
1541 | AC_MSG_RESULT($nls_cv_use_catgets) |
---|
1542 | |
---|
1543 | if test "$nls_cv_use_catgets" = "yes"; then |
---|
1544 | dnl No gettext in C library. Try catgets next. |
---|
1545 | AC_CHECK_LIB(i, main) |
---|
1546 | AC_CHECK_FUNC(catgets, |
---|
1547 | [AC_DEFINE(HAVE_CATGETS) |
---|
1548 | INTLOBJS="\$(CATOBJS)" |
---|
1549 | AC_PATH_PROG(GENCAT, gencat, no)dnl |
---|
1550 | # if test "$GENCAT" != "no"; then |
---|
1551 | # AC_PATH_PROG(GMSGFMT, gmsgfmt, no) |
---|
1552 | # if test "$GMSGFMT" = "no"; then |
---|
1553 | # AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt, |
---|
1554 | # [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no) |
---|
1555 | # fi |
---|
1556 | # AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, |
---|
1557 | # [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) |
---|
1558 | # USE_INCLUDED_LIBINTL=yes |
---|
1559 | # CATOBJEXT=.cat |
---|
1560 | # INSTOBJEXT=.cat |
---|
1561 | # DATADIRNAME=lib |
---|
1562 | # INTLDEPS='$(top_builddir)/intl/libintl.a' |
---|
1563 | # INTLLIBS=$INTLDEPS |
---|
1564 | # LIBS=`echo $LIBS | sed -e 's/-lintl//'` |
---|
1565 | # nls_cv_header_intl=intl/libintl.h |
---|
1566 | # nls_cv_header_libgt=intl/libgettext.h |
---|
1567 | # fi |
---|
1568 | ]) |
---|
1569 | fi |
---|
1570 | fi |
---|
1571 | |
---|
1572 | if test "$CATOBJEXT" = "NONE"; then |
---|
1573 | dnl Neither gettext nor catgets in included in the C library. |
---|
1574 | dnl Fall back on GNU gettext library. |
---|
1575 | nls_cv_use_gnu_gettext=yes |
---|
1576 | fi |
---|
1577 | fi |
---|
1578 | |
---|
1579 | if test "$nls_cv_use_gnu_gettext" != "yes"; then |
---|
1580 | AC_DEFINE(ENABLE_NLS) |
---|
1581 | else |
---|
1582 | # Unset this variable since we use the non-zero value as a flag. |
---|
1583 | CATOBJEXT= |
---|
1584 | # dnl Mark actions used to generate GNU NLS library. |
---|
1585 | # INTLOBJS="\$(GETTOBJS)" |
---|
1586 | # AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, |
---|
1587 | # [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) |
---|
1588 | # AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) |
---|
1589 | # AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, |
---|
1590 | # [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) |
---|
1591 | # AC_SUBST(MSGFMT) |
---|
1592 | # USE_INCLUDED_LIBINTL=yes |
---|
1593 | # CATOBJEXT=.gmo |
---|
1594 | # INSTOBJEXT=.mo |
---|
1595 | # DATADIRNAME=share |
---|
1596 | # INTLDEPS='$(top_builddir)/intl/libintl.a' |
---|
1597 | # INTLLIBS=$INTLDEPS |
---|
1598 | # LIBS=`echo $LIBS | sed -e 's/-lintl//'` |
---|
1599 | # nls_cv_header_intl=intl/libintl.h |
---|
1600 | # nls_cv_header_libgt=intl/libgettext.h |
---|
1601 | fi |
---|
1602 | |
---|
1603 | dnl Test whether we really found GNU xgettext. |
---|
1604 | if test "$XGETTEXT" != ":"; then |
---|
1605 | dnl If it is no GNU xgettext we define it as : so that the |
---|
1606 | dnl Makefiles still can work. |
---|
1607 | if $XGETTEXT --omit-header /dev/null 2> /dev/null; then |
---|
1608 | : ; |
---|
1609 | else |
---|
1610 | AC_MSG_RESULT( |
---|
1611 | [found xgettext program is not GNU xgettext; ignore it]) |
---|
1612 | XGETTEXT=":" |
---|
1613 | fi |
---|
1614 | fi |
---|
1615 | |
---|
1616 | # We need to process the po/ directory. |
---|
1617 | POSUB=po |
---|
1618 | else |
---|
1619 | DATADIRNAME=share |
---|
1620 | nls_cv_header_intl=intl/libintl.h |
---|
1621 | nls_cv_header_libgt=intl/libgettext.h |
---|
1622 | fi |
---|
1623 | AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) |
---|
1624 | AC_OUTPUT_COMMANDS( |
---|
1625 | [case "$CONFIG_FILES" in *po/Makefile.in*) |
---|
1626 | sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile |
---|
1627 | esac]) |
---|
1628 | |
---|
1629 | |
---|
1630 | # # If this is used in GNU gettext we have to set USE_NLS to `yes' |
---|
1631 | # # because some of the sources are only built for this goal. |
---|
1632 | # if test "$PACKAGE" = gettext; then |
---|
1633 | # USE_NLS=yes |
---|
1634 | # USE_INCLUDED_LIBINTL=yes |
---|
1635 | # fi |
---|
1636 | |
---|
1637 | dnl These rules are solely for the distribution goal. While doing this |
---|
1638 | dnl we only have to keep exactly one list of the available catalogs |
---|
1639 | dnl in configure.in. |
---|
1640 | for lang in $ALL_LINGUAS; do |
---|
1641 | GMOFILES="$GMOFILES $lang.gmo" |
---|
1642 | POFILES="$POFILES $lang.po" |
---|
1643 | done |
---|
1644 | |
---|
1645 | dnl Make all variables we use known to autoconf. |
---|
1646 | AC_SUBST(USE_INCLUDED_LIBINTL) |
---|
1647 | AC_SUBST(CATALOGS) |
---|
1648 | AC_SUBST(CATOBJEXT) |
---|
1649 | AC_SUBST(DATADIRNAME) |
---|
1650 | AC_SUBST(GMOFILES) |
---|
1651 | AC_SUBST(INSTOBJEXT) |
---|
1652 | AC_SUBST(INTLDEPS) |
---|
1653 | AC_SUBST(INTLLIBS) |
---|
1654 | AC_SUBST(INTLOBJS) |
---|
1655 | AC_SUBST(POFILES) |
---|
1656 | AC_SUBST(POSUB) |
---|
1657 | ]) |
---|
1658 | |
---|
1659 | AC_DEFUN(AM_GNOME_GETTEXT, |
---|
1660 | [AC_REQUIRE([AC_PROG_MAKE_SET])dnl |
---|
1661 | AC_REQUIRE([AC_PROG_CC])dnl |
---|
1662 | AC_REQUIRE([AC_PROG_RANLIB])dnl |
---|
1663 | AC_REQUIRE([AC_ISC_POSIX])dnl |
---|
1664 | AC_REQUIRE([AC_HEADER_STDC])dnl |
---|
1665 | AC_REQUIRE([AC_C_CONST])dnl |
---|
1666 | AC_REQUIRE([AC_C_INLINE])dnl |
---|
1667 | AC_REQUIRE([AC_TYPE_OFF_T])dnl |
---|
1668 | AC_REQUIRE([AC_TYPE_SIZE_T])dnl |
---|
1669 | AC_REQUIRE([AC_FUNC_ALLOCA])dnl |
---|
1670 | AC_REQUIRE([AC_FUNC_MMAP])dnl |
---|
1671 | |
---|
1672 | AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ |
---|
1673 | unistd.h sys/param.h]) |
---|
1674 | AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ |
---|
1675 | strdup __argz_count __argz_stringify __argz_next]) |
---|
1676 | |
---|
1677 | if test "${ac_cv_func_stpcpy+set}" != "set"; then |
---|
1678 | AC_CHECK_FUNCS(stpcpy) |
---|
1679 | fi |
---|
1680 | if test "${ac_cv_func_stpcpy}" = "yes"; then |
---|
1681 | AC_DEFINE(HAVE_STPCPY) |
---|
1682 | fi |
---|
1683 | |
---|
1684 | AM_LC_MESSAGES |
---|
1685 | AM_GNOME_WITH_NLS |
---|
1686 | |
---|
1687 | if test "x$CATOBJEXT" != "x"; then |
---|
1688 | if test "x$ALL_LINGUAS" = "x"; then |
---|
1689 | LINGUAS= |
---|
1690 | else |
---|
1691 | AC_MSG_CHECKING(for catalogs to be installed) |
---|
1692 | NEW_LINGUAS= |
---|
1693 | if test "x$LINGUAS" = "x"; then |
---|
1694 | LINGUAS=$ALL_LINGUAS |
---|
1695 | fi |
---|
1696 | for lang in $LINGUAS; do |
---|
1697 | case "$ALL_LINGUAS" in |
---|
1698 | *\ $lang\ *|$lang\ *|*\ $lang) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; |
---|
1699 | esac |
---|
1700 | done |
---|
1701 | LINGUAS=$NEW_LINGUAS |
---|
1702 | AC_MSG_RESULT($LINGUAS) |
---|
1703 | fi |
---|
1704 | |
---|
1705 | dnl Construct list of names of catalog files to be constructed. |
---|
1706 | if test -n "$LINGUAS"; then |
---|
1707 | for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done |
---|
1708 | fi |
---|
1709 | fi |
---|
1710 | |
---|
1711 | dnl The reference to <locale.h> in the installed <libintl.h> file |
---|
1712 | dnl must be resolved because we cannot expect the users of this |
---|
1713 | dnl to define HAVE_LOCALE_H. |
---|
1714 | if test $ac_cv_header_locale_h = yes; then |
---|
1715 | INCLUDE_LOCALE_H="#include <locale.h>" |
---|
1716 | else |
---|
1717 | INCLUDE_LOCALE_H="\ |
---|
1718 | /* The system does not provide the header <locale.h>. Take care yourself. */" |
---|
1719 | fi |
---|
1720 | AC_SUBST(INCLUDE_LOCALE_H) |
---|
1721 | |
---|
1722 | dnl Determine which catalog format we have (if any is needed) |
---|
1723 | dnl For now we know about two different formats: |
---|
1724 | dnl Linux libc-5 and the normal X/Open format |
---|
1725 | test -d intl || mkdir intl |
---|
1726 | if test "$CATOBJEXT" = ".cat"; then |
---|
1727 | AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) |
---|
1728 | |
---|
1729 | dnl Transform the SED scripts while copying because some dumb SEDs |
---|
1730 | dnl cannot handle comments. |
---|
1731 | sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed |
---|
1732 | fi |
---|
1733 | dnl po2tbl.sed is always needed. |
---|
1734 | sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ |
---|
1735 | $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed |
---|
1736 | |
---|
1737 | dnl In the intl/Makefile.in we have a special dependency which makes |
---|
1738 | dnl only sense for gettext. We comment this out for non-gettext |
---|
1739 | dnl packages. |
---|
1740 | if test "$PACKAGE" = "gettext"; then |
---|
1741 | GT_NO="#NO#" |
---|
1742 | GT_YES= |
---|
1743 | else |
---|
1744 | GT_NO= |
---|
1745 | GT_YES="#YES#" |
---|
1746 | fi |
---|
1747 | AC_SUBST(GT_NO) |
---|
1748 | AC_SUBST(GT_YES) |
---|
1749 | |
---|
1750 | dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly |
---|
1751 | dnl find the mkinstalldirs script in another subdir but ($top_srcdir). |
---|
1752 | dnl Try to locate is. |
---|
1753 | MKINSTALLDIRS= |
---|
1754 | if test -n "$ac_aux_dir"; then |
---|
1755 | MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" |
---|
1756 | fi |
---|
1757 | if test -z "$MKINSTALLDIRS"; then |
---|
1758 | MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" |
---|
1759 | fi |
---|
1760 | AC_SUBST(MKINSTALLDIRS) |
---|
1761 | |
---|
1762 | dnl *** For now the libtool support in intl/Makefile is not for real. |
---|
1763 | l= |
---|
1764 | AC_SUBST(l) |
---|
1765 | |
---|
1766 | dnl Generate list of files to be processed by xgettext which will |
---|
1767 | dnl be included in po/Makefile. |
---|
1768 | test -d po || mkdir po |
---|
1769 | if test "x$srcdir" != "x."; then |
---|
1770 | if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then |
---|
1771 | posrcprefix="$srcdir/" |
---|
1772 | else |
---|
1773 | posrcprefix="../$srcdir/" |
---|
1774 | fi |
---|
1775 | else |
---|
1776 | posrcprefix="../" |
---|
1777 | fi |
---|
1778 | rm -f po/POTFILES |
---|
1779 | sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ |
---|
1780 | < $srcdir/po/POTFILES.in > po/POTFILES |
---|
1781 | ]) |
---|
1782 | |
---|
1783 | |
---|
1784 | # Search path for a program which passes the given test. |
---|
1785 | # Ulrich Drepper <drepper@cygnus.com>, 1996. |
---|
1786 | # |
---|
1787 | # This file can be copied and used freely without restrictions. It can |
---|
1788 | # be used in projects which are not available under the GNU Public License |
---|
1789 | # but which still want to provide support for the GNU gettext functionality. |
---|
1790 | # Please note that the actual code is *not* freely available. |
---|
1791 | |
---|
1792 | # serial 1 |
---|
1793 | |
---|
1794 | dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, |
---|
1795 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) |
---|
1796 | AC_DEFUN(AM_PATH_PROG_WITH_TEST, |
---|
1797 | [# Extract the first word of "$2", so it can be a program name with args. |
---|
1798 | set dummy $2; ac_word=[$]2 |
---|
1799 | AC_MSG_CHECKING([for $ac_word]) |
---|
1800 | AC_CACHE_VAL(ac_cv_path_$1, |
---|
1801 | [case "[$]$1" in |
---|
1802 | /*) |
---|
1803 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path. |
---|
1804 | ;; |
---|
1805 | *) |
---|
1806 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" |
---|
1807 | for ac_dir in ifelse([$5], , $PATH, [$5]); do |
---|
1808 | test -z "$ac_dir" && ac_dir=. |
---|
1809 | if test -f $ac_dir/$ac_word; then |
---|
1810 | if [$3]; then |
---|
1811 | ac_cv_path_$1="$ac_dir/$ac_word" |
---|
1812 | break |
---|
1813 | fi |
---|
1814 | fi |
---|
1815 | done |
---|
1816 | IFS="$ac_save_ifs" |
---|
1817 | dnl If no 4th arg is given, leave the cache variable unset, |
---|
1818 | dnl so AC_PATH_PROGS will keep looking. |
---|
1819 | ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" |
---|
1820 | ])dnl |
---|
1821 | ;; |
---|
1822 | esac])dnl |
---|
1823 | $1="$ac_cv_path_$1" |
---|
1824 | if test -n "[$]$1"; then |
---|
1825 | AC_MSG_RESULT([$]$1) |
---|
1826 | else |
---|
1827 | AC_MSG_RESULT(no) |
---|
1828 | fi |
---|
1829 | AC_SUBST($1)dnl |
---|
1830 | ]) |
---|
1831 | |
---|
1832 | # Check whether LC_MESSAGES is available in <locale.h>. |
---|
1833 | # Ulrich Drepper <drepper@cygnus.com>, 1995. |
---|
1834 | # |
---|
1835 | # This file can be copied and used freely without restrictions. It can |
---|
1836 | # be used in projects which are not available under the GNU Public License |
---|
1837 | # but which still want to provide support for the GNU gettext functionality. |
---|
1838 | # Please note that the actual code is *not* freely available. |
---|
1839 | |
---|
1840 | # serial 1 |
---|
1841 | |
---|
1842 | AC_DEFUN(AM_LC_MESSAGES, |
---|
1843 | [if test $ac_cv_header_locale_h = yes; then |
---|
1844 | AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, |
---|
1845 | [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], |
---|
1846 | am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) |
---|
1847 | if test $am_cv_val_LC_MESSAGES = yes; then |
---|
1848 | AC_DEFINE(HAVE_LC_MESSAGES) |
---|
1849 | fi |
---|
1850 | fi]) |
---|
1851 | |
---|