1 | dnl aclocal.m4 generated automatically by aclocal 1.4 |
---|
2 | |
---|
3 | dnl Copyright (C) 1994, 1995-8, 1999 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 | # Do all the work for Automake. This macro actually does too much -- |
---|
14 | # some checks are only needed if your package does certain things. |
---|
15 | # But this isn't really a big deal. |
---|
16 | |
---|
17 | # serial 1 |
---|
18 | |
---|
19 | dnl Usage: |
---|
20 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) |
---|
21 | |
---|
22 | AC_DEFUN(AM_INIT_AUTOMAKE, |
---|
23 | [AC_REQUIRE([AC_PROG_INSTALL]) |
---|
24 | PACKAGE=[$1] |
---|
25 | AC_SUBST(PACKAGE) |
---|
26 | VERSION=[$2] |
---|
27 | AC_SUBST(VERSION) |
---|
28 | dnl test to see if srcdir already configured |
---|
29 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then |
---|
30 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) |
---|
31 | fi |
---|
32 | ifelse([$3],, |
---|
33 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) |
---|
34 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) |
---|
35 | AC_REQUIRE([AM_SANITY_CHECK]) |
---|
36 | AC_REQUIRE([AC_ARG_PROGRAM]) |
---|
37 | dnl FIXME This is truly gross. |
---|
38 | missing_dir=`cd $ac_aux_dir && pwd` |
---|
39 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) |
---|
40 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) |
---|
41 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) |
---|
42 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) |
---|
43 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) |
---|
44 | AC_REQUIRE([AC_PROG_MAKE_SET])]) |
---|
45 | |
---|
46 | # |
---|
47 | # Check to make sure that the build environment is sane. |
---|
48 | # |
---|
49 | |
---|
50 | AC_DEFUN(AM_SANITY_CHECK, |
---|
51 | [AC_MSG_CHECKING([whether build environment is sane]) |
---|
52 | # Just in case |
---|
53 | sleep 1 |
---|
54 | echo timestamp > conftestfile |
---|
55 | # Do `set' in a subshell so we don't clobber the current shell's |
---|
56 | # arguments. Must try -L first in case configure is actually a |
---|
57 | # symlink; some systems play weird games with the mod time of symlinks |
---|
58 | # (eg FreeBSD returns the mod time of the symlink's containing |
---|
59 | # directory). |
---|
60 | if ( |
---|
61 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` |
---|
62 | if test "[$]*" = "X"; then |
---|
63 | # -L didn't work. |
---|
64 | set X `ls -t $srcdir/configure conftestfile` |
---|
65 | fi |
---|
66 | if test "[$]*" != "X $srcdir/configure conftestfile" \ |
---|
67 | && test "[$]*" != "X conftestfile $srcdir/configure"; then |
---|
68 | |
---|
69 | # If neither matched, then we have a broken ls. This can happen |
---|
70 | # if, for instance, CONFIG_SHELL is bash and it inherits a |
---|
71 | # broken ls alias from the environment. This has actually |
---|
72 | # happened. Such a system could not be considered "sane". |
---|
73 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken |
---|
74 | alias in your environment]) |
---|
75 | fi |
---|
76 | |
---|
77 | test "[$]2" = conftestfile |
---|
78 | ) |
---|
79 | then |
---|
80 | # Ok. |
---|
81 | : |
---|
82 | else |
---|
83 | AC_MSG_ERROR([newly created file is older than distributed files! |
---|
84 | Check your system clock]) |
---|
85 | fi |
---|
86 | rm -f conftest* |
---|
87 | AC_MSG_RESULT(yes)]) |
---|
88 | |
---|
89 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) |
---|
90 | dnl The program must properly implement --version. |
---|
91 | AC_DEFUN(AM_MISSING_PROG, |
---|
92 | [AC_MSG_CHECKING(for working $2) |
---|
93 | # Run test in a subshell; some versions of sh will print an error if |
---|
94 | # an executable is not found, even if stderr is redirected. |
---|
95 | # Redirect stdin to placate older versions of autoconf. Sigh. |
---|
96 | if ($2 --version) < /dev/null > /dev/null 2>&1; then |
---|
97 | $1=$2 |
---|
98 | AC_MSG_RESULT(found) |
---|
99 | else |
---|
100 | $1="$3/missing $2" |
---|
101 | AC_MSG_RESULT(missing) |
---|
102 | fi |
---|
103 | AC_SUBST($1)]) |
---|
104 | |
---|
105 | # Like AC_CONFIG_HEADER, but automatically create stamp file. |
---|
106 | |
---|
107 | AC_DEFUN(AM_CONFIG_HEADER, |
---|
108 | [AC_PREREQ([2.12]) |
---|
109 | AC_CONFIG_HEADER([$1]) |
---|
110 | dnl When config.status generates a header, we must update the stamp-h file. |
---|
111 | dnl This file resides in the same directory as the config header |
---|
112 | dnl that is generated. We must strip everything past the first ":", |
---|
113 | dnl and everything past the last "/". |
---|
114 | AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl |
---|
115 | ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, |
---|
116 | <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, |
---|
117 | <<am_indx=1 |
---|
118 | for am_file in <<$1>>; do |
---|
119 | case " <<$>>CONFIG_HEADERS " in |
---|
120 | *" <<$>>am_file "*<<)>> |
---|
121 | echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx |
---|
122 | ;; |
---|
123 | esac |
---|
124 | am_indx=`expr "<<$>>am_indx" + 1` |
---|
125 | done<<>>dnl>>) |
---|
126 | changequote([,]))]) |
---|
127 | |
---|
128 | # Add --enable-maintainer-mode option to configure. |
---|
129 | # From Jim Meyering |
---|
130 | |
---|
131 | # serial 1 |
---|
132 | |
---|
133 | AC_DEFUN(AM_MAINTAINER_MODE, |
---|
134 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) |
---|
135 | dnl maintainer-mode is disabled by default |
---|
136 | AC_ARG_ENABLE(maintainer-mode, |
---|
137 | [ --enable-maintainer-mode enable make rules and dependencies not useful |
---|
138 | (and sometimes confusing) to the casual installer], |
---|
139 | USE_MAINTAINER_MODE=$enableval, |
---|
140 | USE_MAINTAINER_MODE=no) |
---|
141 | AC_MSG_RESULT($USE_MAINTAINER_MODE) |
---|
142 | AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) |
---|
143 | MAINT=$MAINTAINER_MODE_TRUE |
---|
144 | AC_SUBST(MAINT)dnl |
---|
145 | ] |
---|
146 | ) |
---|
147 | |
---|
148 | # Define a conditional. |
---|
149 | |
---|
150 | AC_DEFUN(AM_CONDITIONAL, |
---|
151 | [AC_SUBST($1_TRUE) |
---|
152 | AC_SUBST($1_FALSE) |
---|
153 | if $2; then |
---|
154 | $1_TRUE= |
---|
155 | $1_FALSE='#' |
---|
156 | else |
---|
157 | $1_TRUE='#' |
---|
158 | $1_FALSE= |
---|
159 | fi]) |
---|
160 | |
---|
161 | |
---|
162 | # serial 40 AC_PROG_LIBTOOL |
---|
163 | AC_DEFUN(AC_PROG_LIBTOOL, |
---|
164 | [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl |
---|
165 | |
---|
166 | # Save cache, so that ltconfig can load it |
---|
167 | AC_CACHE_SAVE |
---|
168 | |
---|
169 | # Actually configure libtool. ac_aux_dir is where install-sh is found. |
---|
170 | CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ |
---|
171 | LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ |
---|
172 | LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ |
---|
173 | DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ |
---|
174 | ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ |
---|
175 | $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ |
---|
176 | || AC_MSG_ERROR([libtool configure failed]) |
---|
177 | |
---|
178 | # Reload cache, that may have been modified by ltconfig |
---|
179 | AC_CACHE_LOAD |
---|
180 | |
---|
181 | # This can be used to rebuild libtool when needed |
---|
182 | LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" |
---|
183 | |
---|
184 | # Always use our own libtool. |
---|
185 | LIBTOOL='$(SHELL) $(top_builddir)/libtool' |
---|
186 | AC_SUBST(LIBTOOL)dnl |
---|
187 | |
---|
188 | # Redirect the config.log output again, so that the ltconfig log is not |
---|
189 | # clobbered by the next message. |
---|
190 | exec 5>>./config.log |
---|
191 | ]) |
---|
192 | |
---|
193 | AC_DEFUN(AC_LIBTOOL_SETUP, |
---|
194 | [AC_PREREQ(2.13)dnl |
---|
195 | AC_REQUIRE([AC_ENABLE_SHARED])dnl |
---|
196 | AC_REQUIRE([AC_ENABLE_STATIC])dnl |
---|
197 | AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl |
---|
198 | AC_REQUIRE([AC_CANONICAL_HOST])dnl |
---|
199 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl |
---|
200 | AC_REQUIRE([AC_PROG_RANLIB])dnl |
---|
201 | AC_REQUIRE([AC_PROG_CC])dnl |
---|
202 | AC_REQUIRE([AC_PROG_LD])dnl |
---|
203 | AC_REQUIRE([AC_PROG_NM])dnl |
---|
204 | AC_REQUIRE([AC_PROG_LN_S])dnl |
---|
205 | dnl |
---|
206 | |
---|
207 | # Check for any special flags to pass to ltconfig. |
---|
208 | # |
---|
209 | # the following will cause an existing older ltconfig to fail, so |
---|
210 | # we ignore this at the expense of the cache file... Checking this |
---|
211 | # will just take longer ... bummer! |
---|
212 | #libtool_flags="--cache-file=$cache_file" |
---|
213 | # |
---|
214 | test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" |
---|
215 | test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" |
---|
216 | test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" |
---|
217 | test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" |
---|
218 | test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" |
---|
219 | ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], |
---|
220 | [libtool_flags="$libtool_flags --enable-dlopen"]) |
---|
221 | ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], |
---|
222 | [libtool_flags="$libtool_flags --enable-win32-dll"]) |
---|
223 | AC_ARG_ENABLE(libtool-lock, |
---|
224 | [ --disable-libtool-lock avoid locking (might break parallel builds)]) |
---|
225 | test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" |
---|
226 | test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" |
---|
227 | |
---|
228 | # Some flags need to be propagated to the compiler or linker for good |
---|
229 | # libtool support. |
---|
230 | case "$host" in |
---|
231 | *-*-irix6*) |
---|
232 | # Find out which ABI we are using. |
---|
233 | echo '[#]line __oline__ "configure"' > conftest.$ac_ext |
---|
234 | if AC_TRY_EVAL(ac_compile); then |
---|
235 | case "`/usr/bin/file conftest.o`" in |
---|
236 | *32-bit*) |
---|
237 | LD="${LD-ld} -32" |
---|
238 | ;; |
---|
239 | *N32*) |
---|
240 | LD="${LD-ld} -n32" |
---|
241 | ;; |
---|
242 | *64-bit*) |
---|
243 | LD="${LD-ld} -64" |
---|
244 | ;; |
---|
245 | esac |
---|
246 | fi |
---|
247 | rm -rf conftest* |
---|
248 | ;; |
---|
249 | |
---|
250 | *-*-sco3.2v5*) |
---|
251 | # On SCO OpenServer 5, we need -belf to get full-featured binaries. |
---|
252 | SAVE_CFLAGS="$CFLAGS" |
---|
253 | CFLAGS="$CFLAGS -belf" |
---|
254 | AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, |
---|
255 | [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) |
---|
256 | if test x"$lt_cv_cc_needs_belf" != x"yes"; then |
---|
257 | # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf |
---|
258 | CFLAGS="$SAVE_CFLAGS" |
---|
259 | fi |
---|
260 | ;; |
---|
261 | |
---|
262 | ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], |
---|
263 | [*-*-cygwin* | *-*-mingw*) |
---|
264 | AC_CHECK_TOOL(DLLTOOL, dlltool, false) |
---|
265 | AC_CHECK_TOOL(AS, as, false) |
---|
266 | AC_CHECK_TOOL(OBJDUMP, objdump, false) |
---|
267 | ;; |
---|
268 | ]) |
---|
269 | esac |
---|
270 | ]) |
---|
271 | |
---|
272 | # AC_LIBTOOL_DLOPEN - enable checks for dlopen support |
---|
273 | AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) |
---|
274 | |
---|
275 | # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's |
---|
276 | AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) |
---|
277 | |
---|
278 | # AC_ENABLE_SHARED - implement the --enable-shared flag |
---|
279 | # Usage: AC_ENABLE_SHARED[(DEFAULT)] |
---|
280 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to |
---|
281 | # `yes'. |
---|
282 | AC_DEFUN(AC_ENABLE_SHARED, [dnl |
---|
283 | define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl |
---|
284 | AC_ARG_ENABLE(shared, |
---|
285 | changequote(<<, >>)dnl |
---|
286 | << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], |
---|
287 | changequote([, ])dnl |
---|
288 | [p=${PACKAGE-default} |
---|
289 | case "$enableval" in |
---|
290 | yes) enable_shared=yes ;; |
---|
291 | no) enable_shared=no ;; |
---|
292 | *) |
---|
293 | enable_shared=no |
---|
294 | # Look at the argument we got. We use all the common list separators. |
---|
295 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," |
---|
296 | for pkg in $enableval; do |
---|
297 | if test "X$pkg" = "X$p"; then |
---|
298 | enable_shared=yes |
---|
299 | fi |
---|
300 | done |
---|
301 | IFS="$ac_save_ifs" |
---|
302 | ;; |
---|
303 | esac], |
---|
304 | enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl |
---|
305 | ]) |
---|
306 | |
---|
307 | # AC_DISABLE_SHARED - set the default shared flag to --disable-shared |
---|
308 | AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl |
---|
309 | AC_ENABLE_SHARED(no)]) |
---|
310 | |
---|
311 | # AC_ENABLE_STATIC - implement the --enable-static flag |
---|
312 | # Usage: AC_ENABLE_STATIC[(DEFAULT)] |
---|
313 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to |
---|
314 | # `yes'. |
---|
315 | AC_DEFUN(AC_ENABLE_STATIC, [dnl |
---|
316 | define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl |
---|
317 | AC_ARG_ENABLE(static, |
---|
318 | changequote(<<, >>)dnl |
---|
319 | << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], |
---|
320 | changequote([, ])dnl |
---|
321 | [p=${PACKAGE-default} |
---|
322 | case "$enableval" in |
---|
323 | yes) enable_static=yes ;; |
---|
324 | no) enable_static=no ;; |
---|
325 | *) |
---|
326 | enable_static=no |
---|
327 | # Look at the argument we got. We use all the common list separators. |
---|
328 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," |
---|
329 | for pkg in $enableval; do |
---|
330 | if test "X$pkg" = "X$p"; then |
---|
331 | enable_static=yes |
---|
332 | fi |
---|
333 | done |
---|
334 | IFS="$ac_save_ifs" |
---|
335 | ;; |
---|
336 | esac], |
---|
337 | enable_static=AC_ENABLE_STATIC_DEFAULT)dnl |
---|
338 | ]) |
---|
339 | |
---|
340 | # AC_DISABLE_STATIC - set the default static flag to --disable-static |
---|
341 | AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl |
---|
342 | AC_ENABLE_STATIC(no)]) |
---|
343 | |
---|
344 | |
---|
345 | # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag |
---|
346 | # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] |
---|
347 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to |
---|
348 | # `yes'. |
---|
349 | AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl |
---|
350 | define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl |
---|
351 | AC_ARG_ENABLE(fast-install, |
---|
352 | changequote(<<, >>)dnl |
---|
353 | << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], |
---|
354 | changequote([, ])dnl |
---|
355 | [p=${PACKAGE-default} |
---|
356 | case "$enableval" in |
---|
357 | yes) enable_fast_install=yes ;; |
---|
358 | no) enable_fast_install=no ;; |
---|
359 | *) |
---|
360 | enable_fast_install=no |
---|
361 | # Look at the argument we got. We use all the common list separators. |
---|
362 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," |
---|
363 | for pkg in $enableval; do |
---|
364 | if test "X$pkg" = "X$p"; then |
---|
365 | enable_fast_install=yes |
---|
366 | fi |
---|
367 | done |
---|
368 | IFS="$ac_save_ifs" |
---|
369 | ;; |
---|
370 | esac], |
---|
371 | enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl |
---|
372 | ]) |
---|
373 | |
---|
374 | # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install |
---|
375 | AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl |
---|
376 | AC_ENABLE_FAST_INSTALL(no)]) |
---|
377 | |
---|
378 | # AC_PROG_LD - find the path to the GNU or non-GNU linker |
---|
379 | AC_DEFUN(AC_PROG_LD, |
---|
380 | [AC_ARG_WITH(gnu-ld, |
---|
381 | [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], |
---|
382 | test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) |
---|
383 | AC_REQUIRE([AC_PROG_CC])dnl |
---|
384 | AC_REQUIRE([AC_CANONICAL_HOST])dnl |
---|
385 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl |
---|
386 | ac_prog=ld |
---|
387 | if test "$ac_cv_prog_gcc" = yes; then |
---|
388 | # Check if gcc -print-prog-name=ld gives a path. |
---|
389 | AC_MSG_CHECKING([for ld used by GCC]) |
---|
390 | ac_prog=`($CC -print-prog-name=ld) 2>&5` |
---|
391 | case "$ac_prog" in |
---|
392 | # Accept absolute paths. |
---|
393 | changequote(,)dnl |
---|
394 | [\\/]* | [A-Za-z]:[\\/]*) |
---|
395 | re_direlt='/[^/][^/]*/\.\./' |
---|
396 | changequote([,])dnl |
---|
397 | # Canonicalize the path of ld |
---|
398 | ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` |
---|
399 | while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do |
---|
400 | ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` |
---|
401 | done |
---|
402 | test -z "$LD" && LD="$ac_prog" |
---|
403 | ;; |
---|
404 | "") |
---|
405 | # If it fails, then pretend we aren't using GCC. |
---|
406 | ac_prog=ld |
---|
407 | ;; |
---|
408 | *) |
---|
409 | # If it is relative, then search for the first ld in PATH. |
---|
410 | with_gnu_ld=unknown |
---|
411 | ;; |
---|
412 | esac |
---|
413 | elif test "$with_gnu_ld" = yes; then |
---|
414 | AC_MSG_CHECKING([for GNU ld]) |
---|
415 | else |
---|
416 | AC_MSG_CHECKING([for non-GNU ld]) |
---|
417 | fi |
---|
418 | AC_CACHE_VAL(ac_cv_path_LD, |
---|
419 | [if test -z "$LD"; then |
---|
420 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" |
---|
421 | for ac_dir in $PATH; do |
---|
422 | test -z "$ac_dir" && ac_dir=. |
---|
423 | if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then |
---|
424 | ac_cv_path_LD="$ac_dir/$ac_prog" |
---|
425 | # Check to see if the program is GNU ld. I'd rather use --version, |
---|
426 | # but apparently some GNU ld's only accept -v. |
---|
427 | # Break only if it was the GNU/non-GNU ld that we prefer. |
---|
428 | if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then |
---|
429 | test "$with_gnu_ld" != no && break |
---|
430 | else |
---|
431 | test "$with_gnu_ld" != yes && break |
---|
432 | fi |
---|
433 | fi |
---|
434 | done |
---|
435 | IFS="$ac_save_ifs" |
---|
436 | else |
---|
437 | ac_cv_path_LD="$LD" # Let the user override the test with a path. |
---|
438 | fi]) |
---|
439 | LD="$ac_cv_path_LD" |
---|
440 | if test -n "$LD"; then |
---|
441 | AC_MSG_RESULT($LD) |
---|
442 | else |
---|
443 | AC_MSG_RESULT(no) |
---|
444 | fi |
---|
445 | test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) |
---|
446 | AC_SUBST(LD) |
---|
447 | AC_PROG_LD_GNU |
---|
448 | ]) |
---|
449 | |
---|
450 | AC_DEFUN(AC_PROG_LD_GNU, |
---|
451 | [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, |
---|
452 | [# I'd rather use --version here, but apparently some GNU ld's only accept -v. |
---|
453 | if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then |
---|
454 | ac_cv_prog_gnu_ld=yes |
---|
455 | else |
---|
456 | ac_cv_prog_gnu_ld=no |
---|
457 | fi]) |
---|
458 | ]) |
---|
459 | |
---|
460 | # AC_PROG_NM - find the path to a BSD-compatible name lister |
---|
461 | AC_DEFUN(AC_PROG_NM, |
---|
462 | [AC_MSG_CHECKING([for BSD-compatible nm]) |
---|
463 | AC_CACHE_VAL(ac_cv_path_NM, |
---|
464 | [if test -n "$NM"; then |
---|
465 | # Let the user override the test. |
---|
466 | ac_cv_path_NM="$NM" |
---|
467 | else |
---|
468 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" |
---|
469 | for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do |
---|
470 | test -z "$ac_dir" && ac_dir=. |
---|
471 | if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then |
---|
472 | # Check to see if the nm accepts a BSD-compat flag. |
---|
473 | # Adding the `sed 1q' prevents false positives on HP-UX, which says: |
---|
474 | # nm: unknown option "B" ignored |
---|
475 | if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then |
---|
476 | ac_cv_path_NM="$ac_dir/nm -B" |
---|
477 | break |
---|
478 | elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then |
---|
479 | ac_cv_path_NM="$ac_dir/nm -p" |
---|
480 | break |
---|
481 | else |
---|
482 | ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but |
---|
483 | continue # so that we can try to find one that supports BSD flags |
---|
484 | fi |
---|
485 | fi |
---|
486 | done |
---|
487 | IFS="$ac_save_ifs" |
---|
488 | test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm |
---|
489 | fi]) |
---|
490 | NM="$ac_cv_path_NM" |
---|
491 | AC_MSG_RESULT([$NM]) |
---|
492 | AC_SUBST(NM) |
---|
493 | ]) |
---|
494 | |
---|
495 | # AC_CHECK_LIBM - check for math library |
---|
496 | AC_DEFUN(AC_CHECK_LIBM, |
---|
497 | [AC_REQUIRE([AC_CANONICAL_HOST])dnl |
---|
498 | LIBM= |
---|
499 | case "$host" in |
---|
500 | *-*-beos* | *-*-cygwin*) |
---|
501 | # These system don't have libm |
---|
502 | ;; |
---|
503 | *-ncr-sysv4.3*) |
---|
504 | AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") |
---|
505 | AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") |
---|
506 | ;; |
---|
507 | *) |
---|
508 | AC_CHECK_LIB(m, main, LIBM="-lm") |
---|
509 | ;; |
---|
510 | esac |
---|
511 | ]) |
---|
512 | |
---|
513 | # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for |
---|
514 | # the libltdl convenience library, adds --enable-ltdl-convenience to |
---|
515 | # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor |
---|
516 | # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed |
---|
517 | # to be `${top_builddir}/libltdl'. Make sure you start DIR with |
---|
518 | # '${top_builddir}/' (note the single quotes!) if your package is not |
---|
519 | # flat, and, if you're not using automake, define top_builddir as |
---|
520 | # appropriate in the Makefiles. |
---|
521 | AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl |
---|
522 | case "$enable_ltdl_convenience" in |
---|
523 | no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; |
---|
524 | "") enable_ltdl_convenience=yes |
---|
525 | ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; |
---|
526 | esac |
---|
527 | LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la |
---|
528 | INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) |
---|
529 | ]) |
---|
530 | |
---|
531 | # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for |
---|
532 | # the libltdl installable library, and adds --enable-ltdl-install to |
---|
533 | # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor |
---|
534 | # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed |
---|
535 | # to be `${top_builddir}/libltdl'. Make sure you start DIR with |
---|
536 | # '${top_builddir}/' (note the single quotes!) if your package is not |
---|
537 | # flat, and, if you're not using automake, define top_builddir as |
---|
538 | # appropriate in the Makefiles. |
---|
539 | # In the future, this macro may have to be called after AC_PROG_LIBTOOL. |
---|
540 | AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl |
---|
541 | AC_CHECK_LIB(ltdl, main, |
---|
542 | [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], |
---|
543 | [if test x"$enable_ltdl_install" = xno; then |
---|
544 | AC_MSG_WARN([libltdl not installed, but installation disabled]) |
---|
545 | else |
---|
546 | enable_ltdl_install=yes |
---|
547 | fi |
---|
548 | ]) |
---|
549 | if test x"$enable_ltdl_install" = x"yes"; then |
---|
550 | ac_configure_args="$ac_configure_args --enable-ltdl-install" |
---|
551 | LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la |
---|
552 | INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) |
---|
553 | else |
---|
554 | ac_configure_args="$ac_configure_args --enable-ltdl-install=no" |
---|
555 | LIBLTDL="-lltdl" |
---|
556 | INCLTDL= |
---|
557 | fi |
---|
558 | ]) |
---|
559 | |
---|
560 | dnl old names |
---|
561 | AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl |
---|
562 | AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl |
---|
563 | AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl |
---|
564 | AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl |
---|
565 | AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl |
---|
566 | AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl |
---|
567 | AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl |
---|
568 | |
---|
569 | dnl This is just to silence aclocal about the macro not being used |
---|
570 | ifelse([AC_DISABLE_FAST_INSTALL])dnl |
---|
571 | |
---|
572 | # Configure paths for GLIB |
---|
573 | # Owen Taylor 97-11-3 |
---|
574 | |
---|
575 | dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) |
---|
576 | dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or |
---|
577 | dnl gthread is specified in MODULES, pass to glib-config |
---|
578 | dnl |
---|
579 | AC_DEFUN(AM_PATH_GLIB, |
---|
580 | [dnl |
---|
581 | dnl Get the cflags and libraries from the glib-config script |
---|
582 | dnl |
---|
583 | AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)], |
---|
584 | glib_config_prefix="$withval", glib_config_prefix="") |
---|
585 | AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)], |
---|
586 | glib_config_exec_prefix="$withval", glib_config_exec_prefix="") |
---|
587 | AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program], |
---|
588 | , enable_glibtest=yes) |
---|
589 | |
---|
590 | if test x$glib_config_exec_prefix != x ; then |
---|
591 | glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" |
---|
592 | if test x${GLIB_CONFIG+set} != xset ; then |
---|
593 | GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config |
---|
594 | fi |
---|
595 | fi |
---|
596 | if test x$glib_config_prefix != x ; then |
---|
597 | glib_config_args="$glib_config_args --prefix=$glib_config_prefix" |
---|
598 | if test x${GLIB_CONFIG+set} != xset ; then |
---|
599 | GLIB_CONFIG=$glib_config_prefix/bin/glib-config |
---|
600 | fi |
---|
601 | fi |
---|
602 | |
---|
603 | for module in . $4 |
---|
604 | do |
---|
605 | case "$module" in |
---|
606 | gmodule) |
---|
607 | glib_config_args="$glib_config_args gmodule" |
---|
608 | ;; |
---|
609 | gthread) |
---|
610 | glib_config_args="$glib_config_args gthread" |
---|
611 | ;; |
---|
612 | esac |
---|
613 | done |
---|
614 | |
---|
615 | AC_PATH_PROG(GLIB_CONFIG, glib-config, no) |
---|
616 | min_glib_version=ifelse([$1], ,0.99.7,$1) |
---|
617 | AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) |
---|
618 | no_glib="" |
---|
619 | if test "$GLIB_CONFIG" = "no" ; then |
---|
620 | no_glib=yes |
---|
621 | else |
---|
622 | GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` |
---|
623 | GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` |
---|
624 | glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ |
---|
625 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
---|
626 | glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ |
---|
627 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
---|
628 | glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ |
---|
629 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
---|
630 | if test "x$enable_glibtest" = "xyes" ; then |
---|
631 | ac_save_CFLAGS="$CFLAGS" |
---|
632 | ac_save_LIBS="$LIBS" |
---|
633 | CFLAGS="$CFLAGS $GLIB_CFLAGS" |
---|
634 | LIBS="$GLIB_LIBS $LIBS" |
---|
635 | dnl |
---|
636 | dnl Now check if the installed GLIB is sufficiently new. (Also sanity |
---|
637 | dnl checks the results of glib-config to some extent |
---|
638 | dnl |
---|
639 | rm -f conf.glibtest |
---|
640 | AC_TRY_RUN([ |
---|
641 | #include <glib.h> |
---|
642 | #include <stdio.h> |
---|
643 | #include <stdlib.h> |
---|
644 | |
---|
645 | int |
---|
646 | main () |
---|
647 | { |
---|
648 | int major, minor, micro; |
---|
649 | char *tmp_version; |
---|
650 | |
---|
651 | system ("touch conf.glibtest"); |
---|
652 | |
---|
653 | /* HP/UX 9 (%@#!) writes to sscanf strings */ |
---|
654 | tmp_version = g_strdup("$min_glib_version"); |
---|
655 | if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { |
---|
656 | printf("%s, bad version string\n", "$min_glib_version"); |
---|
657 | exit(1); |
---|
658 | } |
---|
659 | |
---|
660 | if ((glib_major_version != $glib_config_major_version) || |
---|
661 | (glib_minor_version != $glib_config_minor_version) || |
---|
662 | (glib_micro_version != $glib_config_micro_version)) |
---|
663 | { |
---|
664 | printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", |
---|
665 | $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, |
---|
666 | glib_major_version, glib_minor_version, glib_micro_version); |
---|
667 | printf ("*** was found! If glib-config was correct, then it is best\n"); |
---|
668 | printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); |
---|
669 | printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); |
---|
670 | printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); |
---|
671 | printf("*** required on your system.\n"); |
---|
672 | printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); |
---|
673 | printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); |
---|
674 | printf("*** before re-running configure\n"); |
---|
675 | } |
---|
676 | else if ((glib_major_version != GLIB_MAJOR_VERSION) || |
---|
677 | (glib_minor_version != GLIB_MINOR_VERSION) || |
---|
678 | (glib_micro_version != GLIB_MICRO_VERSION)) |
---|
679 | { |
---|
680 | printf("*** GLIB header files (version %d.%d.%d) do not match\n", |
---|
681 | GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); |
---|
682 | printf("*** library (version %d.%d.%d)\n", |
---|
683 | glib_major_version, glib_minor_version, glib_micro_version); |
---|
684 | } |
---|
685 | else |
---|
686 | { |
---|
687 | if ((glib_major_version > major) || |
---|
688 | ((glib_major_version == major) && (glib_minor_version > minor)) || |
---|
689 | ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) |
---|
690 | { |
---|
691 | return 0; |
---|
692 | } |
---|
693 | else |
---|
694 | { |
---|
695 | printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", |
---|
696 | glib_major_version, glib_minor_version, glib_micro_version); |
---|
697 | printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", |
---|
698 | major, minor, micro); |
---|
699 | printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); |
---|
700 | printf("***\n"); |
---|
701 | printf("*** If you have already installed a sufficiently new version, this error\n"); |
---|
702 | printf("*** probably means that the wrong copy of the glib-config shell script is\n"); |
---|
703 | printf("*** being found. The easiest way to fix this is to remove the old version\n"); |
---|
704 | printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); |
---|
705 | printf("*** correct copy of glib-config. (In this case, you will have to\n"); |
---|
706 | printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); |
---|
707 | printf("*** so that the correct libraries are found at run-time))\n"); |
---|
708 | } |
---|
709 | } |
---|
710 | return 1; |
---|
711 | } |
---|
712 | ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
---|
713 | CFLAGS="$ac_save_CFLAGS" |
---|
714 | LIBS="$ac_save_LIBS" |
---|
715 | fi |
---|
716 | fi |
---|
717 | if test "x$no_glib" = x ; then |
---|
718 | AC_MSG_RESULT(yes) |
---|
719 | ifelse([$2], , :, [$2]) |
---|
720 | else |
---|
721 | AC_MSG_RESULT(no) |
---|
722 | if test "$GLIB_CONFIG" = "no" ; then |
---|
723 | echo "*** The glib-config script installed by GLIB could not be found" |
---|
724 | echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" |
---|
725 | echo "*** your path, or set the GLIB_CONFIG environment variable to the" |
---|
726 | echo "*** full path to glib-config." |
---|
727 | else |
---|
728 | if test -f conf.glibtest ; then |
---|
729 | : |
---|
730 | else |
---|
731 | echo "*** Could not run GLIB test program, checking why..." |
---|
732 | CFLAGS="$CFLAGS $GLIB_CFLAGS" |
---|
733 | LIBS="$LIBS $GLIB_LIBS" |
---|
734 | AC_TRY_LINK([ |
---|
735 | #include <glib.h> |
---|
736 | #include <stdio.h> |
---|
737 | ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], |
---|
738 | [ echo "*** The test program compiled, but did not run. This usually means" |
---|
739 | echo "*** that the run-time linker is not finding GLIB or finding the wrong" |
---|
740 | echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" |
---|
741 | echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" |
---|
742 | echo "*** to the installed location Also, make sure you have run ldconfig if that" |
---|
743 | echo "*** is required on your system" |
---|
744 | echo "***" |
---|
745 | echo "*** If you have an old version installed, it is best to remove it, although" |
---|
746 | echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" |
---|
747 | echo "***" |
---|
748 | echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" |
---|
749 | echo "*** came with the system with the command" |
---|
750 | echo "***" |
---|
751 | echo "*** rpm --erase --nodeps gtk gtk-devel" ], |
---|
752 | [ echo "*** The test program failed to compile or link. See the file config.log for the" |
---|
753 | echo "*** exact error that occured. This usually means GLIB was incorrectly installed" |
---|
754 | echo "*** or that you have moved GLIB since it was installed. In the latter case, you" |
---|
755 | echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ]) |
---|
756 | CFLAGS="$ac_save_CFLAGS" |
---|
757 | LIBS="$ac_save_LIBS" |
---|
758 | fi |
---|
759 | fi |
---|
760 | GLIB_CFLAGS="" |
---|
761 | GLIB_LIBS="" |
---|
762 | ifelse([$3], , :, [$3]) |
---|
763 | fi |
---|
764 | AC_SUBST(GLIB_CFLAGS) |
---|
765 | AC_SUBST(GLIB_LIBS) |
---|
766 | rm -f conf.glibtest |
---|
767 | ]) |
---|
768 | |
---|
769 | # Configure paths for GTK+ |
---|
770 | # Owen Taylor 97-11-3 |
---|
771 | |
---|
772 | dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) |
---|
773 | dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS |
---|
774 | dnl |
---|
775 | AC_DEFUN(AM_PATH_GTK, |
---|
776 | [dnl |
---|
777 | dnl Get the cflags and libraries from the gtk-config script |
---|
778 | dnl |
---|
779 | AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], |
---|
780 | gtk_config_prefix="$withval", gtk_config_prefix="") |
---|
781 | AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], |
---|
782 | gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") |
---|
783 | AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], |
---|
784 | , enable_gtktest=yes) |
---|
785 | |
---|
786 | for module in . $4 |
---|
787 | do |
---|
788 | case "$module" in |
---|
789 | gthread) |
---|
790 | gtk_config_args="$gtk_config_args gthread" |
---|
791 | ;; |
---|
792 | esac |
---|
793 | done |
---|
794 | |
---|
795 | if test x$gtk_config_exec_prefix != x ; then |
---|
796 | gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" |
---|
797 | if test x${GTK_CONFIG+set} != xset ; then |
---|
798 | GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config |
---|
799 | fi |
---|
800 | fi |
---|
801 | if test x$gtk_config_prefix != x ; then |
---|
802 | gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" |
---|
803 | if test x${GTK_CONFIG+set} != xset ; then |
---|
804 | GTK_CONFIG=$gtk_config_prefix/bin/gtk-config |
---|
805 | fi |
---|
806 | fi |
---|
807 | |
---|
808 | AC_PATH_PROG(GTK_CONFIG, gtk-config, no) |
---|
809 | min_gtk_version=ifelse([$1], ,0.99.7,$1) |
---|
810 | AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) |
---|
811 | no_gtk="" |
---|
812 | if test "$GTK_CONFIG" = "no" ; then |
---|
813 | no_gtk=yes |
---|
814 | else |
---|
815 | GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` |
---|
816 | GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` |
---|
817 | gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ |
---|
818 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
---|
819 | gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ |
---|
820 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
---|
821 | gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ |
---|
822 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
---|
823 | if test "x$enable_gtktest" = "xyes" ; then |
---|
824 | ac_save_CFLAGS="$CFLAGS" |
---|
825 | ac_save_LIBS="$LIBS" |
---|
826 | CFLAGS="$CFLAGS $GTK_CFLAGS" |
---|
827 | LIBS="$GTK_LIBS $LIBS" |
---|
828 | dnl |
---|
829 | dnl Now check if the installed GTK is sufficiently new. (Also sanity |
---|
830 | dnl checks the results of gtk-config to some extent |
---|
831 | dnl |
---|
832 | rm -f conf.gtktest |
---|
833 | AC_TRY_RUN([ |
---|
834 | #include <gtk/gtk.h> |
---|
835 | #include <stdio.h> |
---|
836 | #include <stdlib.h> |
---|
837 | |
---|
838 | int |
---|
839 | main () |
---|
840 | { |
---|
841 | int major, minor, micro; |
---|
842 | char *tmp_version; |
---|
843 | |
---|
844 | system ("touch conf.gtktest"); |
---|
845 | |
---|
846 | /* HP/UX 9 (%@#!) writes to sscanf strings */ |
---|
847 | tmp_version = g_strdup("$min_gtk_version"); |
---|
848 | if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { |
---|
849 | printf("%s, bad version string\n", "$min_gtk_version"); |
---|
850 | exit(1); |
---|
851 | } |
---|
852 | |
---|
853 | if ((gtk_major_version != $gtk_config_major_version) || |
---|
854 | (gtk_minor_version != $gtk_config_minor_version) || |
---|
855 | (gtk_micro_version != $gtk_config_micro_version)) |
---|
856 | { |
---|
857 | printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", |
---|
858 | $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, |
---|
859 | gtk_major_version, gtk_minor_version, gtk_micro_version); |
---|
860 | printf ("*** was found! If gtk-config was correct, then it is best\n"); |
---|
861 | printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); |
---|
862 | printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); |
---|
863 | printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); |
---|
864 | printf("*** required on your system.\n"); |
---|
865 | printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); |
---|
866 | printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); |
---|
867 | printf("*** before re-running configure\n"); |
---|
868 | } |
---|
869 | #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) |
---|
870 | else if ((gtk_major_version != GTK_MAJOR_VERSION) || |
---|
871 | (gtk_minor_version != GTK_MINOR_VERSION) || |
---|
872 | (gtk_micro_version != GTK_MICRO_VERSION)) |
---|
873 | { |
---|
874 | printf("*** GTK+ header files (version %d.%d.%d) do not match\n", |
---|
875 | GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); |
---|
876 | printf("*** library (version %d.%d.%d)\n", |
---|
877 | gtk_major_version, gtk_minor_version, gtk_micro_version); |
---|
878 | } |
---|
879 | #endif /* defined (GTK_MAJOR_VERSION) ... */ |
---|
880 | else |
---|
881 | { |
---|
882 | if ((gtk_major_version > major) || |
---|
883 | ((gtk_major_version == major) && (gtk_minor_version > minor)) || |
---|
884 | ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) |
---|
885 | { |
---|
886 | return 0; |
---|
887 | } |
---|
888 | else |
---|
889 | { |
---|
890 | printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", |
---|
891 | gtk_major_version, gtk_minor_version, gtk_micro_version); |
---|
892 | printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", |
---|
893 | major, minor, micro); |
---|
894 | printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); |
---|
895 | printf("***\n"); |
---|
896 | printf("*** If you have already installed a sufficiently new version, this error\n"); |
---|
897 | printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); |
---|
898 | printf("*** being found. The easiest way to fix this is to remove the old version\n"); |
---|
899 | printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); |
---|
900 | printf("*** correct copy of gtk-config. (In this case, you will have to\n"); |
---|
901 | printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); |
---|
902 | printf("*** so that the correct libraries are found at run-time))\n"); |
---|
903 | } |
---|
904 | } |
---|
905 | return 1; |
---|
906 | } |
---|
907 | ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
---|
908 | CFLAGS="$ac_save_CFLAGS" |
---|
909 | LIBS="$ac_save_LIBS" |
---|
910 | fi |
---|
911 | fi |
---|
912 | if test "x$no_gtk" = x ; then |
---|
913 | AC_MSG_RESULT(yes) |
---|
914 | ifelse([$2], , :, [$2]) |
---|
915 | else |
---|
916 | AC_MSG_RESULT(no) |
---|
917 | if test "$GTK_CONFIG" = "no" ; then |
---|
918 | echo "*** The gtk-config script installed by GTK could not be found" |
---|
919 | echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" |
---|
920 | echo "*** your path, or set the GTK_CONFIG environment variable to the" |
---|
921 | echo "*** full path to gtk-config." |
---|
922 | else |
---|
923 | if test -f conf.gtktest ; then |
---|
924 | : |
---|
925 | else |
---|
926 | echo "*** Could not run GTK test program, checking why..." |
---|
927 | CFLAGS="$CFLAGS $GTK_CFLAGS" |
---|
928 | LIBS="$LIBS $GTK_LIBS" |
---|
929 | AC_TRY_LINK([ |
---|
930 | #include <gtk/gtk.h> |
---|
931 | #include <stdio.h> |
---|
932 | ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], |
---|
933 | [ echo "*** The test program compiled, but did not run. This usually means" |
---|
934 | echo "*** that the run-time linker is not finding GTK or finding the wrong" |
---|
935 | echo "*** version of GTK. If it is not finding GTK, you'll need to set your" |
---|
936 | echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" |
---|
937 | echo "*** to the installed location Also, make sure you have run ldconfig if that" |
---|
938 | echo "*** is required on your system" |
---|
939 | echo "***" |
---|
940 | echo "*** If you have an old version installed, it is best to remove it, although" |
---|
941 | echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" |
---|
942 | echo "***" |
---|
943 | echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" |
---|
944 | echo "*** came with the system with the command" |
---|
945 | echo "***" |
---|
946 | echo "*** rpm --erase --nodeps gtk gtk-devel" ], |
---|
947 | [ echo "*** The test program failed to compile or link. See the file config.log for the" |
---|
948 | echo "*** exact error that occured. This usually means GTK was incorrectly installed" |
---|
949 | echo "*** or that you have moved GTK since it was installed. In the latter case, you" |
---|
950 | echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) |
---|
951 | CFLAGS="$ac_save_CFLAGS" |
---|
952 | LIBS="$ac_save_LIBS" |
---|
953 | fi |
---|
954 | fi |
---|
955 | GTK_CFLAGS="" |
---|
956 | GTK_LIBS="" |
---|
957 | ifelse([$3], , :, [$3]) |
---|
958 | fi |
---|
959 | AC_SUBST(GTK_CFLAGS) |
---|
960 | AC_SUBST(GTK_LIBS) |
---|
961 | rm -f conf.gtktest |
---|
962 | ]) |
---|
963 | |
---|
964 | # Macro to add for using GNU gettext. |
---|
965 | # Ulrich Drepper <drepper@cygnus.com>, 1995. |
---|
966 | # |
---|
967 | # Modified to never use included libintl. |
---|
968 | # Owen Taylor <otaylor@redhat.com>, 12/15/1998 |
---|
969 | # |
---|
970 | # |
---|
971 | # This file can be copied and used freely without restrictions. It can |
---|
972 | # be used in projects which are not available under the GNU Public License |
---|
973 | # but which still want to provide support for the GNU gettext functionality. |
---|
974 | # Please note that the actual code is *not* freely available. |
---|
975 | |
---|
976 | # serial 5 |
---|
977 | |
---|
978 | AC_DEFUN(AM_GNOME_WITH_NLS, |
---|
979 | [AC_MSG_CHECKING([whether NLS is requested]) |
---|
980 | dnl Default is enabled NLS |
---|
981 | AC_ARG_ENABLE(nls, |
---|
982 | [ --disable-nls do not use Native Language Support], |
---|
983 | USE_NLS=$enableval, USE_NLS=yes) |
---|
984 | AC_MSG_RESULT($USE_NLS) |
---|
985 | AC_SUBST(USE_NLS) |
---|
986 | |
---|
987 | USE_INCLUDED_LIBINTL=no |
---|
988 | |
---|
989 | dnl If we use NLS figure out what method |
---|
990 | if test "$USE_NLS" = "yes"; then |
---|
991 | AC_DEFINE(ENABLE_NLS) |
---|
992 | # AC_MSG_CHECKING([whether included gettext is requested]) |
---|
993 | # AC_ARG_WITH(included-gettext, |
---|
994 | # [ --with-included-gettext use the GNU gettext library included here], |
---|
995 | # nls_cv_force_use_gnu_gettext=$withval, |
---|
996 | # nls_cv_force_use_gnu_gettext=no) |
---|
997 | # AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) |
---|
998 | nls_cv_force_use_gnu_gettext="no" |
---|
999 | |
---|
1000 | nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" |
---|
1001 | if test "$nls_cv_force_use_gnu_gettext" != "yes"; then |
---|
1002 | dnl User does not insist on using GNU NLS library. Figure out what |
---|
1003 | dnl to use. If gettext or catgets are available (in this order) we |
---|
1004 | dnl use this. Else we have to fall back to GNU NLS library. |
---|
1005 | dnl catgets is only used if permitted by option --with-catgets. |
---|
1006 | nls_cv_header_intl= |
---|
1007 | nls_cv_header_libgt= |
---|
1008 | CATOBJEXT=NONE |
---|
1009 | |
---|
1010 | AC_CHECK_HEADER(libintl.h, |
---|
1011 | [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, |
---|
1012 | [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")], |
---|
1013 | gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) |
---|
1014 | |
---|
1015 | if test "$gt_cv_func_gettext_libc" != "yes"; then |
---|
1016 | AC_CHECK_LIB(intl, bindtextdomain, |
---|
1017 | [AC_CACHE_CHECK([for gettext in libintl], |
---|
1018 | gt_cv_func_gettext_libintl, |
---|
1019 | [AC_CHECK_LIB(intl, gettext, |
---|
1020 | gt_cv_func_gettext_libintl=yes, |
---|
1021 | gt_cv_func_gettext_libintl=no)], |
---|
1022 | gt_cv_func_gettext_libintl=no)]) |
---|
1023 | fi |
---|
1024 | |
---|
1025 | if test "$gt_cv_func_gettext_libc" = "yes" \ |
---|
1026 | || test "$gt_cv_func_gettext_libintl" = "yes"; then |
---|
1027 | AC_DEFINE(HAVE_GETTEXT) |
---|
1028 | AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, |
---|
1029 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl |
---|
1030 | if test "$MSGFMT" != "no"; then |
---|
1031 | AC_CHECK_FUNCS(dcgettext) |
---|
1032 | AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) |
---|
1033 | AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, |
---|
1034 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) |
---|
1035 | AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; |
---|
1036 | return _nl_msg_cat_cntr], |
---|
1037 | [CATOBJEXT=.gmo |
---|
1038 | DATADIRNAME=share], |
---|
1039 | [CATOBJEXT=.mo |
---|
1040 | DATADIRNAME=lib]) |
---|
1041 | INSTOBJEXT=.mo |
---|
1042 | fi |
---|
1043 | fi |
---|
1044 | |
---|
1045 | # Added by Martin Baulig 12/15/98 for libc5 systems |
---|
1046 | if test "$gt_cv_func_gettext_libc" != "yes" \ |
---|
1047 | && test "$gt_cv_func_gettext_libintl" = "yes"; then |
---|
1048 | INTLLIBS=-lintl |
---|
1049 | LIBS=`echo $LIBS | sed -e 's/-lintl//'` |
---|
1050 | fi |
---|
1051 | ]) |
---|
1052 | |
---|
1053 | if test "$CATOBJEXT" = "NONE"; then |
---|
1054 | AC_MSG_CHECKING([whether catgets can be used]) |
---|
1055 | AC_ARG_WITH(catgets, |
---|
1056 | [ --with-catgets use catgets functions if available], |
---|
1057 | nls_cv_use_catgets=$withval, nls_cv_use_catgets=no) |
---|
1058 | AC_MSG_RESULT($nls_cv_use_catgets) |
---|
1059 | |
---|
1060 | if test "$nls_cv_use_catgets" = "yes"; then |
---|
1061 | dnl No gettext in C library. Try catgets next. |
---|
1062 | AC_CHECK_LIB(i, main) |
---|
1063 | AC_CHECK_FUNC(catgets, |
---|
1064 | [AC_DEFINE(HAVE_CATGETS) |
---|
1065 | INTLOBJS="\$(CATOBJS)" |
---|
1066 | AC_PATH_PROG(GENCAT, gencat, no)dnl |
---|
1067 | # if test "$GENCAT" != "no"; then |
---|
1068 | # AC_PATH_PROG(GMSGFMT, gmsgfmt, no) |
---|
1069 | # if test "$GMSGFMT" = "no"; then |
---|
1070 | # AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt, |
---|
1071 | # [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no) |
---|
1072 | # fi |
---|
1073 | # AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, |
---|
1074 | # [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) |
---|
1075 | # USE_INCLUDED_LIBINTL=yes |
---|
1076 | # CATOBJEXT=.cat |
---|
1077 | # INSTOBJEXT=.cat |
---|
1078 | # DATADIRNAME=lib |
---|
1079 | # INTLDEPS='$(top_builddir)/intl/libintl.a' |
---|
1080 | # INTLLIBS=$INTLDEPS |
---|
1081 | # LIBS=`echo $LIBS | sed -e 's/-lintl//'` |
---|
1082 | # nls_cv_header_intl=intl/libintl.h |
---|
1083 | # nls_cv_header_libgt=intl/libgettext.h |
---|
1084 | # fi |
---|
1085 | ]) |
---|
1086 | fi |
---|
1087 | fi |
---|
1088 | |
---|
1089 | if test "$CATOBJEXT" = "NONE"; then |
---|
1090 | dnl Neither gettext nor catgets in included in the C library. |
---|
1091 | dnl Fall back on GNU gettext library. |
---|
1092 | nls_cv_use_gnu_gettext=yes |
---|
1093 | fi |
---|
1094 | fi |
---|
1095 | |
---|
1096 | if test "$nls_cv_use_gnu_gettext" != "yes"; then |
---|
1097 | AC_DEFINE(ENABLE_NLS) |
---|
1098 | else |
---|
1099 | # Unset this variable since we use the non-zero value as a flag. |
---|
1100 | CATOBJEXT= |
---|
1101 | # dnl Mark actions used to generate GNU NLS library. |
---|
1102 | # INTLOBJS="\$(GETTOBJS)" |
---|
1103 | # AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, |
---|
1104 | # [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) |
---|
1105 | # AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) |
---|
1106 | # AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, |
---|
1107 | # [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) |
---|
1108 | # AC_SUBST(MSGFMT) |
---|
1109 | # USE_INCLUDED_LIBINTL=yes |
---|
1110 | # CATOBJEXT=.gmo |
---|
1111 | # INSTOBJEXT=.mo |
---|
1112 | # DATADIRNAME=share |
---|
1113 | # INTLDEPS='$(top_builddir)/intl/libintl.a' |
---|
1114 | # INTLLIBS=$INTLDEPS |
---|
1115 | # LIBS=`echo $LIBS | sed -e 's/-lintl//'` |
---|
1116 | # nls_cv_header_intl=intl/libintl.h |
---|
1117 | # nls_cv_header_libgt=intl/libgettext.h |
---|
1118 | fi |
---|
1119 | |
---|
1120 | dnl Test whether we really found GNU xgettext. |
---|
1121 | if test "$XGETTEXT" != ":"; then |
---|
1122 | dnl If it is no GNU xgettext we define it as : so that the |
---|
1123 | dnl Makefiles still can work. |
---|
1124 | if $XGETTEXT --omit-header /dev/null 2> /dev/null; then |
---|
1125 | : ; |
---|
1126 | else |
---|
1127 | AC_MSG_RESULT( |
---|
1128 | [found xgettext program is not GNU xgettext; ignore it]) |
---|
1129 | XGETTEXT=":" |
---|
1130 | fi |
---|
1131 | fi |
---|
1132 | |
---|
1133 | # We need to process the po/ directory. |
---|
1134 | POSUB=po |
---|
1135 | else |
---|
1136 | DATADIRNAME=share |
---|
1137 | nls_cv_header_intl=intl/libintl.h |
---|
1138 | nls_cv_header_libgt=intl/libgettext.h |
---|
1139 | fi |
---|
1140 | AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) |
---|
1141 | AC_OUTPUT_COMMANDS( |
---|
1142 | [case "$CONFIG_FILES" in *po/Makefile.in*) |
---|
1143 | sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile |
---|
1144 | esac]) |
---|
1145 | |
---|
1146 | |
---|
1147 | # # If this is used in GNU gettext we have to set USE_NLS to `yes' |
---|
1148 | # # because some of the sources are only built for this goal. |
---|
1149 | # if test "$PACKAGE" = gettext; then |
---|
1150 | # USE_NLS=yes |
---|
1151 | # USE_INCLUDED_LIBINTL=yes |
---|
1152 | # fi |
---|
1153 | |
---|
1154 | dnl These rules are solely for the distribution goal. While doing this |
---|
1155 | dnl we only have to keep exactly one list of the available catalogs |
---|
1156 | dnl in configure.in. |
---|
1157 | for lang in $ALL_LINGUAS; do |
---|
1158 | GMOFILES="$GMOFILES $lang.gmo" |
---|
1159 | POFILES="$POFILES $lang.po" |
---|
1160 | done |
---|
1161 | |
---|
1162 | dnl Make all variables we use known to autoconf. |
---|
1163 | AC_SUBST(USE_INCLUDED_LIBINTL) |
---|
1164 | AC_SUBST(CATALOGS) |
---|
1165 | AC_SUBST(CATOBJEXT) |
---|
1166 | AC_SUBST(DATADIRNAME) |
---|
1167 | AC_SUBST(GMOFILES) |
---|
1168 | AC_SUBST(INSTOBJEXT) |
---|
1169 | AC_SUBST(INTLDEPS) |
---|
1170 | AC_SUBST(INTLLIBS) |
---|
1171 | AC_SUBST(INTLOBJS) |
---|
1172 | AC_SUBST(POFILES) |
---|
1173 | AC_SUBST(POSUB) |
---|
1174 | ]) |
---|
1175 | |
---|
1176 | AC_DEFUN(AM_GNOME_GETTEXT, |
---|
1177 | [AC_REQUIRE([AC_PROG_MAKE_SET])dnl |
---|
1178 | AC_REQUIRE([AC_PROG_CC])dnl |
---|
1179 | AC_REQUIRE([AC_PROG_RANLIB])dnl |
---|
1180 | AC_REQUIRE([AC_ISC_POSIX])dnl |
---|
1181 | AC_REQUIRE([AC_HEADER_STDC])dnl |
---|
1182 | AC_REQUIRE([AC_C_CONST])dnl |
---|
1183 | AC_REQUIRE([AC_C_INLINE])dnl |
---|
1184 | AC_REQUIRE([AC_TYPE_OFF_T])dnl |
---|
1185 | AC_REQUIRE([AC_TYPE_SIZE_T])dnl |
---|
1186 | AC_REQUIRE([AC_FUNC_ALLOCA])dnl |
---|
1187 | AC_REQUIRE([AC_FUNC_MMAP])dnl |
---|
1188 | |
---|
1189 | AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ |
---|
1190 | unistd.h sys/param.h]) |
---|
1191 | AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ |
---|
1192 | strdup __argz_count __argz_stringify __argz_next]) |
---|
1193 | |
---|
1194 | if test "${ac_cv_func_stpcpy+set}" != "set"; then |
---|
1195 | AC_CHECK_FUNCS(stpcpy) |
---|
1196 | fi |
---|
1197 | if test "${ac_cv_func_stpcpy}" = "yes"; then |
---|
1198 | AC_DEFINE(HAVE_STPCPY) |
---|
1199 | fi |
---|
1200 | |
---|
1201 | AM_LC_MESSAGES |
---|
1202 | AM_GNOME_WITH_NLS |
---|
1203 | |
---|
1204 | if test "x$CATOBJEXT" != "x"; then |
---|
1205 | if test "x$ALL_LINGUAS" = "x"; then |
---|
1206 | LINGUAS= |
---|
1207 | else |
---|
1208 | AC_MSG_CHECKING(for catalogs to be installed) |
---|
1209 | NEW_LINGUAS= |
---|
1210 | if test "x$LINGUAS" = "x"; then |
---|
1211 | LINGUAS=$ALL_LINGUAS |
---|
1212 | fi |
---|
1213 | for lang in $LINGUAS; do |
---|
1214 | case "$ALL_LINGUAS" in |
---|
1215 | *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; |
---|
1216 | esac |
---|
1217 | done |
---|
1218 | LINGUAS=$NEW_LINGUAS |
---|
1219 | AC_MSG_RESULT($LINGUAS) |
---|
1220 | fi |
---|
1221 | |
---|
1222 | dnl Construct list of names of catalog files to be constructed. |
---|
1223 | if test -n "$LINGUAS"; then |
---|
1224 | for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done |
---|
1225 | fi |
---|
1226 | fi |
---|
1227 | |
---|
1228 | dnl The reference to <locale.h> in the installed <libintl.h> file |
---|
1229 | dnl must be resolved because we cannot expect the users of this |
---|
1230 | dnl to define HAVE_LOCALE_H. |
---|
1231 | if test $ac_cv_header_locale_h = yes; then |
---|
1232 | INCLUDE_LOCALE_H="#include <locale.h>" |
---|
1233 | else |
---|
1234 | INCLUDE_LOCALE_H="\ |
---|
1235 | /* The system does not provide the header <locale.h>. Take care yourself. */" |
---|
1236 | fi |
---|
1237 | AC_SUBST(INCLUDE_LOCALE_H) |
---|
1238 | |
---|
1239 | dnl Determine which catalog format we have (if any is needed) |
---|
1240 | dnl For now we know about two different formats: |
---|
1241 | dnl Linux libc-5 and the normal X/Open format |
---|
1242 | test -d intl || mkdir intl |
---|
1243 | if test "$CATOBJEXT" = ".cat"; then |
---|
1244 | AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) |
---|
1245 | |
---|
1246 | dnl Transform the SED scripts while copying because some dumb SEDs |
---|
1247 | dnl cannot handle comments. |
---|
1248 | sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed |
---|
1249 | fi |
---|
1250 | dnl po2tbl.sed is always needed. |
---|
1251 | sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ |
---|
1252 | $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed |
---|
1253 | |
---|
1254 | dnl In the intl/Makefile.in we have a special dependency which makes |
---|
1255 | dnl only sense for gettext. We comment this out for non-gettext |
---|
1256 | dnl packages. |
---|
1257 | if test "$PACKAGE" = "gettext"; then |
---|
1258 | GT_NO="#NO#" |
---|
1259 | GT_YES= |
---|
1260 | else |
---|
1261 | GT_NO= |
---|
1262 | GT_YES="#YES#" |
---|
1263 | fi |
---|
1264 | AC_SUBST(GT_NO) |
---|
1265 | AC_SUBST(GT_YES) |
---|
1266 | |
---|
1267 | dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly |
---|
1268 | dnl find the mkinstalldirs script in another subdir but ($top_srcdir). |
---|
1269 | dnl Try to locate is. |
---|
1270 | MKINSTALLDIRS= |
---|
1271 | if test -n "$ac_aux_dir"; then |
---|
1272 | MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" |
---|
1273 | fi |
---|
1274 | if test -z "$MKINSTALLDIRS"; then |
---|
1275 | MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" |
---|
1276 | fi |
---|
1277 | AC_SUBST(MKINSTALLDIRS) |
---|
1278 | |
---|
1279 | dnl *** For now the libtool support in intl/Makefile is not for real. |
---|
1280 | l= |
---|
1281 | AC_SUBST(l) |
---|
1282 | |
---|
1283 | dnl Generate list of files to be processed by xgettext which will |
---|
1284 | dnl be included in po/Makefile. |
---|
1285 | test -d po || mkdir po |
---|
1286 | if test "x$srcdir" != "x."; then |
---|
1287 | if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then |
---|
1288 | posrcprefix="$srcdir/" |
---|
1289 | else |
---|
1290 | posrcprefix="../$srcdir/" |
---|
1291 | fi |
---|
1292 | else |
---|
1293 | posrcprefix="../" |
---|
1294 | fi |
---|
1295 | rm -f po/POTFILES |
---|
1296 | sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ |
---|
1297 | < $srcdir/po/POTFILES.in > po/POTFILES |
---|
1298 | ]) |
---|
1299 | |
---|
1300 | |
---|
1301 | AC_DEFUN(AM_PATH_GNOME, |
---|
1302 | [dnl |
---|
1303 | dnl Get the cflags and libraries from the gnome-config script |
---|
1304 | dnl |
---|
1305 | AC_ARG_WITH(gnome-prefix,[ --with-gnome-prefix=PFX Prefix where GNOME is installed (optional)], |
---|
1306 | gnome_config_prefix="$withval", gnome_config_prefix="") |
---|
1307 | AC_ARG_WITH(gnome-exec-prefix,[ --with-gnome-exec-prefix=PFX Exec prefix where GNOME is installed (optional)], |
---|
1308 | gnome_config_exec_prefix="$withval", gnome_config_exec_prefix="") |
---|
1309 | |
---|
1310 | if test x$gnome_config_exec_prefix != x ; then |
---|
1311 | gnome_config_args="$gnome_config_args --exec-prefix=$gnome_config_exec_prefix" |
---|
1312 | if test x${GNOME_CONFIG+set} != xset ; then |
---|
1313 | GNOME_CONFIG=$gnome_config_exec_prefix/bin/gnome-config |
---|
1314 | fi |
---|
1315 | fi |
---|
1316 | if test x$gnome_config_prefix != x ; then |
---|
1317 | gnome_config_args="$gnome_config_args --prefix=$gnome_config_prefix" |
---|
1318 | if test x${GNOME_CONFIG+set} != xset ; then |
---|
1319 | GNOME_CONFIG=$gnome_config_prefix/bin/gnome-config |
---|
1320 | fi |
---|
1321 | fi |
---|
1322 | |
---|
1323 | AC_PATH_PROG(GNOME_CONFIG, gnome-config, no) |
---|
1324 | min_gnome_version=ifelse([$1], , 1.1.0, $1) |
---|
1325 | |
---|
1326 | AC_MSG_CHECKING(for GNOME - version >= $min_gnome_version) |
---|
1327 | no_gnome="" |
---|
1328 | if test "$GNOME_CONFIG" = "no" ; then |
---|
1329 | no_gnome=yes |
---|
1330 | else |
---|
1331 | GNOME_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags gnome`" |
---|
1332 | GNOME_LIBS="`$GNOME_CONFIG $gnome_config_args --libs gnome`" |
---|
1333 | GNOMEUI_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags gnomeui`" |
---|
1334 | GNOMEUI_LIBS="`$GNOME_CONFIG $gnome_config_args --libs gnomeui`" |
---|
1335 | |
---|
1336 | gnome_config_major_version=`$GNOME_CONFIG $gnome_config_args --version | \ |
---|
1337 | sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` |
---|
1338 | gnome_config_minor_version=`$GNOME_CONFIG $gnome_config_args --version | \ |
---|
1339 | sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` |
---|
1340 | gnome_config_micro_version=`$GNOME_CONFIG $gnome_config_args --version | \ |
---|
1341 | sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` |
---|
1342 | needed_major_version=`echo $min_gnome_version | \ |
---|
1343 | sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` |
---|
1344 | needed_minor_version=`echo $min_gnome_version | \ |
---|
1345 | sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` |
---|
1346 | needed_micro_version=`echo $min_gnome_version | \ |
---|
1347 | sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` |
---|
1348 | |
---|
1349 | if test $gnome_config_major_version -lt $needed_major_version; then |
---|
1350 | ifelse([$3], , :, [$3]) |
---|
1351 | no_gnome=yes |
---|
1352 | elif test $gnome_config_major_version = $needed_major_version; then |
---|
1353 | if test -n "$needed_minor_version" -a $gnome_config_minor_version -lt $needed_minor_version; then |
---|
1354 | ifelse([$3], , :, [$3]) |
---|
1355 | no_gnome=yes |
---|
1356 | elif test -n "$needed_minor_version" -a $gnome_config_minor_version = $needed_minor_version; then |
---|
1357 | if test -n "$needed_micro_version" -a $gnome_config_micro_version -lt $needed_micro_version; then |
---|
1358 | ifelse([$3], , :, [$3]) |
---|
1359 | no_gnome=yes |
---|
1360 | fi |
---|
1361 | fi |
---|
1362 | fi |
---|
1363 | fi |
---|
1364 | AC_SUBST(GNOME_CFLAGS) |
---|
1365 | AC_SUBST(GNOME_LIBS) |
---|
1366 | AC_SUBST(GNOMEUI_CFLAGS) |
---|
1367 | AC_SUBST(GNOMEUI_LIBS) |
---|
1368 | |
---|
1369 | if test "x$no_gnome" = x ; then |
---|
1370 | AC_MSG_RESULT(yes) |
---|
1371 | ifelse([$2], , :, [$2]) |
---|
1372 | else |
---|
1373 | AC_MSG_RESULT(no) |
---|
1374 | if test "$GNOME_CONFIG" = "no" ; then |
---|
1375 | echo "*** The gnome-config script installed by GNOME could not be found" |
---|
1376 | echo "*** If GNOME was installed in PREFIX, make sure PREFIX/bin is in" |
---|
1377 | echo "*** your path, or set the GNOME_CONFIG environment variable to the" |
---|
1378 | echo "*** full path to gnome-config." |
---|
1379 | else |
---|
1380 | : |
---|
1381 | fi |
---|
1382 | GNOME_CFLAGS="" |
---|
1383 | GNOME_LIBS="" |
---|
1384 | ifelse([$3], , :, [$3]) |
---|
1385 | fi |
---|
1386 | |
---|
1387 | tmp_gnome_libdir=`$GNOME_CONFIG $gnome_config_args --libdir` |
---|
1388 | if test -n "$4"; then |
---|
1389 | AC_MSG_CHECKING([for additional GNOME modules]) |
---|
1390 | fi |
---|
1391 | for module in $4 ""; do |
---|
1392 | gnome_m4_notfound=no |
---|
1393 | if test "$module" = zvt; then |
---|
1394 | ZVT_LIBS="`$GNOME_CONFIG $gnome_config_args --libs zvt`" |
---|
1395 | AC_SUBST(ZVT_LIBS) |
---|
1396 | elif test "$module" = gtk; then |
---|
1397 | GTK_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags gtk`" |
---|
1398 | GTK_LIBS="`$GNOME_CONFIG $gnome_config_args --libs gtk`" |
---|
1399 | AC_SUBST(GTK_CFLAGS) |
---|
1400 | AC_SUBST(GTK_LIBS) |
---|
1401 | elif test "$module" = "glib"; then |
---|
1402 | GLIB_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags glib`" |
---|
1403 | GLIB_LIBS="`$GNOME_CONFIG $gnome_config_args --libs glib`" |
---|
1404 | AC_SUBST(GLIB_CFLAGS) |
---|
1405 | AC_SUBST(GLIB_LIBS) |
---|
1406 | elif test "$module" = "oaf"; then |
---|
1407 | OAF_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags oaf`" |
---|
1408 | OAF_LIBS="`$GNOME_CONFIG $gnome_config_args --libs oaf`" |
---|
1409 | AC_SUBST(OAF_CFLAGS) |
---|
1410 | AC_SUBST(OAF_LIBS) |
---|
1411 | elif test "$module" = "gnorba"; then |
---|
1412 | GNORBA_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags gnorba`" |
---|
1413 | GNORBA_LIBS="`$GNOME_CONFIG $gnome_config_args --libs gnorba`" |
---|
1414 | AC_SUBST(GNORBA_CFLAGS) |
---|
1415 | AC_SUBST(GNORBA_LIBS) |
---|
1416 | elif test -n "$module"; then |
---|
1417 | if $GNOME_CONFIG $gnome_config_args --cflags $module >/dev/null 2>&1; then |
---|
1418 | tmp_bsnom=`echo $module | tr a-z A-Z` |
---|
1419 | eval $tmp_bsnom'_CFLAGS'=\"`$GNOME_CONFIG $gnome_config_args --cflags $module`\" |
---|
1420 | eval $tmp_bsnom'_LIBS'=\"`$GNOME_CONFIG $gnome_config_args --libs $module`\" |
---|
1421 | else |
---|
1422 | AC_MSG_RESULT([*** $module library is not installed]) |
---|
1423 | ifelse([$3], , :, [$3]) |
---|
1424 | gnome_m4_notfound=yes |
---|
1425 | fi |
---|
1426 | fi |
---|
1427 | if test "$gnome_m4_notfound" = no; then |
---|
1428 | echo $ac_n " $module" 1>&6 |
---|
1429 | fi |
---|
1430 | done |
---|
1431 | if test -n "$4"; then |
---|
1432 | AC_MSG_RESULT([]) |
---|
1433 | fi |
---|
1434 | ]) |
---|
1435 | |
---|
1436 | # Search path for a program which passes the given test. |
---|
1437 | # Ulrich Drepper <drepper@cygnus.com>, 1996. |
---|
1438 | # |
---|
1439 | # This file can be copied and used freely without restrictions. It can |
---|
1440 | # be used in projects which are not available under the GNU Public License |
---|
1441 | # but which still want to provide support for the GNU gettext functionality. |
---|
1442 | # Please note that the actual code is *not* freely available. |
---|
1443 | |
---|
1444 | # serial 1 |
---|
1445 | |
---|
1446 | dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, |
---|
1447 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) |
---|
1448 | AC_DEFUN(AM_PATH_PROG_WITH_TEST, |
---|
1449 | [# Extract the first word of "$2", so it can be a program name with args. |
---|
1450 | set dummy $2; ac_word=[$]2 |
---|
1451 | AC_MSG_CHECKING([for $ac_word]) |
---|
1452 | AC_CACHE_VAL(ac_cv_path_$1, |
---|
1453 | [case "[$]$1" in |
---|
1454 | /*) |
---|
1455 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path. |
---|
1456 | ;; |
---|
1457 | *) |
---|
1458 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" |
---|
1459 | for ac_dir in ifelse([$5], , $PATH, [$5]); do |
---|
1460 | test -z "$ac_dir" && ac_dir=. |
---|
1461 | if test -f $ac_dir/$ac_word; then |
---|
1462 | if [$3]; then |
---|
1463 | ac_cv_path_$1="$ac_dir/$ac_word" |
---|
1464 | break |
---|
1465 | fi |
---|
1466 | fi |
---|
1467 | done |
---|
1468 | IFS="$ac_save_ifs" |
---|
1469 | dnl If no 4th arg is given, leave the cache variable unset, |
---|
1470 | dnl so AC_PATH_PROGS will keep looking. |
---|
1471 | ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" |
---|
1472 | ])dnl |
---|
1473 | ;; |
---|
1474 | esac])dnl |
---|
1475 | $1="$ac_cv_path_$1" |
---|
1476 | if test -n "[$]$1"; then |
---|
1477 | AC_MSG_RESULT([$]$1) |
---|
1478 | else |
---|
1479 | AC_MSG_RESULT(no) |
---|
1480 | fi |
---|
1481 | AC_SUBST($1)dnl |
---|
1482 | ]) |
---|
1483 | |
---|
1484 | # Check whether LC_MESSAGES is available in <locale.h>. |
---|
1485 | # Ulrich Drepper <drepper@cygnus.com>, 1995. |
---|
1486 | # |
---|
1487 | # This file can be copied and used freely without restrictions. It can |
---|
1488 | # be used in projects which are not available under the GNU Public License |
---|
1489 | # but which still want to provide support for the GNU gettext functionality. |
---|
1490 | # Please note that the actual code is *not* freely available. |
---|
1491 | |
---|
1492 | # serial 1 |
---|
1493 | |
---|
1494 | AC_DEFUN(AM_LC_MESSAGES, |
---|
1495 | [if test $ac_cv_header_locale_h = yes; then |
---|
1496 | AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, |
---|
1497 | [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], |
---|
1498 | am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) |
---|
1499 | if test $am_cv_val_LC_MESSAGES = yes; then |
---|
1500 | AC_DEFINE(HAVE_LC_MESSAGES) |
---|
1501 | fi |
---|
1502 | fi]) |
---|
1503 | |
---|