OSDN Git Service

Initial commit
[wordring-tm/wordring-tm.git] / third_party / mecab-ipadic-2.7.0-20070801 / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4-p6
2
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 # lib-prefix.m4 serial 5 (gettext-0.15)
14 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
15 dnl This file is free software; the Free Software Foundation
16 dnl gives unlimited permission to copy and/or distribute it,
17 dnl with or without modifications, as long as this notice is preserved.
18
19 dnl From Bruno Haible.
20
21 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
22 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
23 dnl require excessive bracketing.
24 ifdef([AC_HELP_STRING],
25 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
26 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
27
28 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
29 dnl to access previously installed libraries. The basic assumption is that
30 dnl a user will want packages to use other packages he previously installed
31 dnl with the same --prefix option.
32 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
33 dnl libraries, but is otherwise very convenient.
34 AC_DEFUN([AC_LIB_PREFIX],
35 [
36   AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
37   AC_REQUIRE([AC_PROG_CC])
38   AC_REQUIRE([AC_CANONICAL_HOST])
39   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
40   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
41   dnl By default, look in $includedir and $libdir.
42   use_additional=yes
43   AC_LIB_WITH_FINAL_PREFIX([
44     eval additional_includedir=\"$includedir\"
45     eval additional_libdir=\"$libdir\"
46   ])
47   AC_LIB_ARG_WITH([lib-prefix],
48 [  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
49   --without-lib-prefix    don't search for libraries in includedir and libdir],
50 [
51     if test "X$withval" = "Xno"; then
52       use_additional=no
53     else
54       if test "X$withval" = "X"; then
55         AC_LIB_WITH_FINAL_PREFIX([
56           eval additional_includedir=\"$includedir\"
57           eval additional_libdir=\"$libdir\"
58         ])
59       else
60         additional_includedir="$withval/include"
61         additional_libdir="$withval/$acl_libdirstem"
62       fi
63     fi
64 ])
65   if test $use_additional = yes; then
66     dnl Potentially add $additional_includedir to $CPPFLAGS.
67     dnl But don't add it
68     dnl   1. if it's the standard /usr/include,
69     dnl   2. if it's already present in $CPPFLAGS,
70     dnl   3. if it's /usr/local/include and we are using GCC on Linux,
71     dnl   4. if it doesn't exist as a directory.
72     if test "X$additional_includedir" != "X/usr/include"; then
73       haveit=
74       for x in $CPPFLAGS; do
75         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
76         if test "X$x" = "X-I$additional_includedir"; then
77           haveit=yes
78           break
79         fi
80       done
81       if test -z "$haveit"; then
82         if test "X$additional_includedir" = "X/usr/local/include"; then
83           if test -n "$GCC"; then
84             case $host_os in
85               linux* | gnu* | k*bsd*-gnu) haveit=yes;;
86             esac
87           fi
88         fi
89         if test -z "$haveit"; then
90           if test -d "$additional_includedir"; then
91             dnl Really add $additional_includedir to $CPPFLAGS.
92             CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
93           fi
94         fi
95       fi
96     fi
97     dnl Potentially add $additional_libdir to $LDFLAGS.
98     dnl But don't add it
99     dnl   1. if it's the standard /usr/lib,
100     dnl   2. if it's already present in $LDFLAGS,
101     dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
102     dnl   4. if it doesn't exist as a directory.
103     if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
104       haveit=
105       for x in $LDFLAGS; do
106         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
107         if test "X$x" = "X-L$additional_libdir"; then
108           haveit=yes
109           break
110         fi
111       done
112       if test -z "$haveit"; then
113         if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
114           if test -n "$GCC"; then
115             case $host_os in
116               linux*) haveit=yes;;
117             esac
118           fi
119         fi
120         if test -z "$haveit"; then
121           if test -d "$additional_libdir"; then
122             dnl Really add $additional_libdir to $LDFLAGS.
123             LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
124           fi
125         fi
126       fi
127     fi
128   fi
129 ])
130
131 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
132 dnl acl_final_exec_prefix, containing the values to which $prefix and
133 dnl $exec_prefix will expand at the end of the configure script.
134 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
135 [
136   dnl Unfortunately, prefix and exec_prefix get only finally determined
137   dnl at the end of configure.
138   if test "X$prefix" = "XNONE"; then
139     acl_final_prefix="$ac_default_prefix"
140   else
141     acl_final_prefix="$prefix"
142   fi
143   if test "X$exec_prefix" = "XNONE"; then
144     acl_final_exec_prefix='${prefix}'
145   else
146     acl_final_exec_prefix="$exec_prefix"
147   fi
148   acl_save_prefix="$prefix"
149   prefix="$acl_final_prefix"
150   eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
151   prefix="$acl_save_prefix"
152 ])
153
154 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
155 dnl variables prefix and exec_prefix bound to the values they will have
156 dnl at the end of the configure script.
157 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
158 [
159   acl_save_prefix="$prefix"
160   prefix="$acl_final_prefix"
161   acl_save_exec_prefix="$exec_prefix"
162   exec_prefix="$acl_final_exec_prefix"
163   $1
164   exec_prefix="$acl_save_exec_prefix"
165   prefix="$acl_save_prefix"
166 ])
167
168 dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
169 dnl the basename of the libdir, either "lib" or "lib64".
170 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
171 [
172   dnl There is no formal standard regarding lib and lib64. The current
173   dnl practice is that on a system supporting 32-bit and 64-bit instruction
174   dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
175   dnl libraries go under $prefix/lib. We determine the compiler's default
176   dnl mode by looking at the compiler's library search path. If at least
177   dnl of its elements ends in /lib64 or points to a directory whose absolute
178   dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
179   dnl default, namely "lib".
180   acl_libdirstem=lib
181   searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
182   if test -n "$searchpath"; then
183     acl_save_IFS="${IFS=        }"; IFS=":"
184     for searchdir in $searchpath; do
185       if test -d "$searchdir"; then
186         case "$searchdir" in
187           */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
188           *) searchdir=`cd "$searchdir" && pwd`
189              case "$searchdir" in
190                */lib64 ) acl_libdirstem=lib64 ;;
191              esac ;;
192         esac
193       fi
194     done
195     IFS="$acl_save_IFS"
196   fi
197 ])
198
199 # lib-link.m4 serial 8 (gettext-0.15)
200 dnl Copyright (C) 2001-2006 Free Software Foundation, Inc.
201 dnl This file is free software; the Free Software Foundation
202 dnl gives unlimited permission to copy and/or distribute it,
203 dnl with or without modifications, as long as this notice is preserved.
204
205 dnl From Bruno Haible.
206
207 AC_PREREQ(2.50)
208
209 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
210 dnl the libraries corresponding to explicit and implicit dependencies.
211 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
212 dnl augments the CPPFLAGS variable.
213 AC_DEFUN([AC_LIB_LINKFLAGS],
214 [
215   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
216   AC_REQUIRE([AC_LIB_RPATH])
217   define([Name],[translit([$1],[./-], [___])])
218   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
219                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
220   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
221     AC_LIB_LINKFLAGS_BODY([$1], [$2])
222     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
223     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
224     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
225   ])
226   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
227   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
228   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
229   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
230   AC_SUBST([LIB]NAME)
231   AC_SUBST([LTLIB]NAME)
232   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
233   dnl results of this search when this library appears as a dependency.
234   HAVE_LIB[]NAME=yes
235   undefine([Name])
236   undefine([NAME])
237 ])
238
239 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
240 dnl searches for libname and the libraries corresponding to explicit and
241 dnl implicit dependencies, together with the specified include files and
242 dnl the ability to compile and link the specified testcode. If found, it
243 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
244 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
245 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
246 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
247 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
248 [
249   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
250   AC_REQUIRE([AC_LIB_RPATH])
251   define([Name],[translit([$1],[./-], [___])])
252   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
253                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
254
255   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
256   dnl accordingly.
257   AC_LIB_LINKFLAGS_BODY([$1], [$2])
258
259   dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
260   dnl because if the user has installed lib[]Name and not disabled its use
261   dnl via --without-lib[]Name-prefix, he wants to use it.
262   ac_save_CPPFLAGS="$CPPFLAGS"
263   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
264
265   AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
266     ac_save_LIBS="$LIBS"
267     LIBS="$LIBS $LIB[]NAME"
268     AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
269     LIBS="$ac_save_LIBS"
270   ])
271   if test "$ac_cv_lib[]Name" = yes; then
272     HAVE_LIB[]NAME=yes
273     AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
274     AC_MSG_CHECKING([how to link with lib[]$1])
275     AC_MSG_RESULT([$LIB[]NAME])
276   else
277     HAVE_LIB[]NAME=no
278     dnl If $LIB[]NAME didn't lead to a usable library, we don't need
279     dnl $INC[]NAME either.
280     CPPFLAGS="$ac_save_CPPFLAGS"
281     LIB[]NAME=
282     LTLIB[]NAME=
283   fi
284   AC_SUBST([HAVE_LIB]NAME)
285   AC_SUBST([LIB]NAME)
286   AC_SUBST([LTLIB]NAME)
287   undefine([Name])
288   undefine([NAME])
289 ])
290
291 dnl Determine the platform dependent parameters needed to use rpath:
292 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
293 dnl hardcode_direct, hardcode_minus_L.
294 AC_DEFUN([AC_LIB_RPATH],
295 [
296   dnl Tell automake >= 1.10 to complain if config.rpath is missing.
297   m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
298   AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
299   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
300   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
301   AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
302   AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
303     CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
304     ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
305     . ./conftest.sh
306     rm -f ./conftest.sh
307     acl_cv_rpath=done
308   ])
309   wl="$acl_cv_wl"
310   libext="$acl_cv_libext"
311   shlibext="$acl_cv_shlibext"
312   hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
313   hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
314   hardcode_direct="$acl_cv_hardcode_direct"
315   hardcode_minus_L="$acl_cv_hardcode_minus_L"
316   dnl Determine whether the user wants rpath handling at all.
317   AC_ARG_ENABLE(rpath,
318     [  --disable-rpath         do not hardcode runtime library paths],
319     :, enable_rpath=yes)
320 ])
321
322 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
323 dnl the libraries corresponding to explicit and implicit dependencies.
324 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
325 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
326 [
327   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
328   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
329                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
330   dnl By default, look in $includedir and $libdir.
331   use_additional=yes
332   AC_LIB_WITH_FINAL_PREFIX([
333     eval additional_includedir=\"$includedir\"
334     eval additional_libdir=\"$libdir\"
335   ])
336   AC_LIB_ARG_WITH([lib$1-prefix],
337 [  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
338   --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
339 [
340     if test "X$withval" = "Xno"; then
341       use_additional=no
342     else
343       if test "X$withval" = "X"; then
344         AC_LIB_WITH_FINAL_PREFIX([
345           eval additional_includedir=\"$includedir\"
346           eval additional_libdir=\"$libdir\"
347         ])
348       else
349         additional_includedir="$withval/include"
350         additional_libdir="$withval/$acl_libdirstem"
351       fi
352     fi
353 ])
354   dnl Search the library and its dependencies in $additional_libdir and
355   dnl $LDFLAGS. Using breadth-first-seach.
356   LIB[]NAME=
357   LTLIB[]NAME=
358   INC[]NAME=
359   rpathdirs=
360   ltrpathdirs=
361   names_already_handled=
362   names_next_round='$1 $2'
363   while test -n "$names_next_round"; do
364     names_this_round="$names_next_round"
365     names_next_round=
366     for name in $names_this_round; do
367       already_handled=
368       for n in $names_already_handled; do
369         if test "$n" = "$name"; then
370           already_handled=yes
371           break
372         fi
373       done
374       if test -z "$already_handled"; then
375         names_already_handled="$names_already_handled $name"
376         dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
377         dnl or AC_LIB_HAVE_LINKFLAGS call.
378         uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
379         eval value=\"\$HAVE_LIB$uppername\"
380         if test -n "$value"; then
381           if test "$value" = yes; then
382             eval value=\"\$LIB$uppername\"
383             test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
384             eval value=\"\$LTLIB$uppername\"
385             test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
386           else
387             dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
388             dnl that this library doesn't exist. So just drop it.
389             :
390           fi
391         else
392           dnl Search the library lib$name in $additional_libdir and $LDFLAGS
393           dnl and the already constructed $LIBNAME/$LTLIBNAME.
394           found_dir=
395           found_la=
396           found_so=
397           found_a=
398           if test $use_additional = yes; then
399             if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
400               found_dir="$additional_libdir"
401               found_so="$additional_libdir/lib$name.$shlibext"
402               if test -f "$additional_libdir/lib$name.la"; then
403                 found_la="$additional_libdir/lib$name.la"
404               fi
405             else
406               if test -f "$additional_libdir/lib$name.$libext"; then
407                 found_dir="$additional_libdir"
408                 found_a="$additional_libdir/lib$name.$libext"
409                 if test -f "$additional_libdir/lib$name.la"; then
410                   found_la="$additional_libdir/lib$name.la"
411                 fi
412               fi
413             fi
414           fi
415           if test "X$found_dir" = "X"; then
416             for x in $LDFLAGS $LTLIB[]NAME; do
417               AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
418               case "$x" in
419                 -L*)
420                   dir=`echo "X$x" | sed -e 's/^X-L//'`
421                   if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
422                     found_dir="$dir"
423                     found_so="$dir/lib$name.$shlibext"
424                     if test -f "$dir/lib$name.la"; then
425                       found_la="$dir/lib$name.la"
426                     fi
427                   else
428                     if test -f "$dir/lib$name.$libext"; then
429                       found_dir="$dir"
430                       found_a="$dir/lib$name.$libext"
431                       if test -f "$dir/lib$name.la"; then
432                         found_la="$dir/lib$name.la"
433                       fi
434                     fi
435                   fi
436                   ;;
437               esac
438               if test "X$found_dir" != "X"; then
439                 break
440               fi
441             done
442           fi
443           if test "X$found_dir" != "X"; then
444             dnl Found the library.
445             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
446             if test "X$found_so" != "X"; then
447               dnl Linking with a shared library. We attempt to hardcode its
448               dnl directory into the executable's runpath, unless it's the
449               dnl standard /usr/lib.
450               if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
451                 dnl No hardcoding is needed.
452                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
453               else
454                 dnl Use an explicit option to hardcode DIR into the resulting
455                 dnl binary.
456                 dnl Potentially add DIR to ltrpathdirs.
457                 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
458                 haveit=
459                 for x in $ltrpathdirs; do
460                   if test "X$x" = "X$found_dir"; then
461                     haveit=yes
462                     break
463                   fi
464                 done
465                 if test -z "$haveit"; then
466                   ltrpathdirs="$ltrpathdirs $found_dir"
467                 fi
468                 dnl The hardcoding into $LIBNAME is system dependent.
469                 if test "$hardcode_direct" = yes; then
470                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
471                   dnl resulting binary.
472                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
473                 else
474                   if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
475                     dnl Use an explicit option to hardcode DIR into the resulting
476                     dnl binary.
477                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
478                     dnl Potentially add DIR to rpathdirs.
479                     dnl The rpathdirs will be appended to $LIBNAME at the end.
480                     haveit=
481                     for x in $rpathdirs; do
482                       if test "X$x" = "X$found_dir"; then
483                         haveit=yes
484                         break
485                       fi
486                     done
487                     if test -z "$haveit"; then
488                       rpathdirs="$rpathdirs $found_dir"
489                     fi
490                   else
491                     dnl Rely on "-L$found_dir".
492                     dnl But don't add it if it's already contained in the LDFLAGS
493                     dnl or the already constructed $LIBNAME
494                     haveit=
495                     for x in $LDFLAGS $LIB[]NAME; do
496                       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
497                       if test "X$x" = "X-L$found_dir"; then
498                         haveit=yes
499                         break
500                       fi
501                     done
502                     if test -z "$haveit"; then
503                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
504                     fi
505                     if test "$hardcode_minus_L" != no; then
506                       dnl FIXME: Not sure whether we should use
507                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
508                       dnl here.
509                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
510                     else
511                       dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
512                       dnl here, because this doesn't fit in flags passed to the
513                       dnl compiler. So give up. No hardcoding. This affects only
514                       dnl very old systems.
515                       dnl FIXME: Not sure whether we should use
516                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
517                       dnl here.
518                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
519                     fi
520                   fi
521                 fi
522               fi
523             else
524               if test "X$found_a" != "X"; then
525                 dnl Linking with a static library.
526                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
527               else
528                 dnl We shouldn't come here, but anyway it's good to have a
529                 dnl fallback.
530                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
531               fi
532             fi
533             dnl Assume the include files are nearby.
534             additional_includedir=
535             case "$found_dir" in
536               */$acl_libdirstem | */$acl_libdirstem/)
537                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
538                 additional_includedir="$basedir/include"
539                 ;;
540             esac
541             if test "X$additional_includedir" != "X"; then
542               dnl Potentially add $additional_includedir to $INCNAME.
543               dnl But don't add it
544               dnl   1. if it's the standard /usr/include,
545               dnl   2. if it's /usr/local/include and we are using GCC on Linux,
546               dnl   3. if it's already present in $CPPFLAGS or the already
547               dnl      constructed $INCNAME,
548               dnl   4. if it doesn't exist as a directory.
549               if test "X$additional_includedir" != "X/usr/include"; then
550                 haveit=
551                 if test "X$additional_includedir" = "X/usr/local/include"; then
552                   if test -n "$GCC"; then
553                     case $host_os in
554                       linux* | gnu* | k*bsd*-gnu) haveit=yes;;
555                     esac
556                   fi
557                 fi
558                 if test -z "$haveit"; then
559                   for x in $CPPFLAGS $INC[]NAME; do
560                     AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
561                     if test "X$x" = "X-I$additional_includedir"; then
562                       haveit=yes
563                       break
564                     fi
565                   done
566                   if test -z "$haveit"; then
567                     if test -d "$additional_includedir"; then
568                       dnl Really add $additional_includedir to $INCNAME.
569                       INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
570                     fi
571                   fi
572                 fi
573               fi
574             fi
575             dnl Look for dependencies.
576             if test -n "$found_la"; then
577               dnl Read the .la file. It defines the variables
578               dnl dlname, library_names, old_library, dependency_libs, current,
579               dnl age, revision, installed, dlopen, dlpreopen, libdir.
580               save_libdir="$libdir"
581               case "$found_la" in
582                 */* | *\\*) . "$found_la" ;;
583                 *) . "./$found_la" ;;
584               esac
585               libdir="$save_libdir"
586               dnl We use only dependency_libs.
587               for dep in $dependency_libs; do
588                 case "$dep" in
589                   -L*)
590                     additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
591                     dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
592                     dnl But don't add it
593                     dnl   1. if it's the standard /usr/lib,
594                     dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
595                     dnl   3. if it's already present in $LDFLAGS or the already
596                     dnl      constructed $LIBNAME,
597                     dnl   4. if it doesn't exist as a directory.
598                     if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
599                       haveit=
600                       if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
601                         if test -n "$GCC"; then
602                           case $host_os in
603                             linux* | gnu* | k*bsd*-gnu) haveit=yes;;
604                           esac
605                         fi
606                       fi
607                       if test -z "$haveit"; then
608                         haveit=
609                         for x in $LDFLAGS $LIB[]NAME; do
610                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
611                           if test "X$x" = "X-L$additional_libdir"; then
612                             haveit=yes
613                             break
614                           fi
615                         done
616                         if test -z "$haveit"; then
617                           if test -d "$additional_libdir"; then
618                             dnl Really add $additional_libdir to $LIBNAME.
619                             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
620                           fi
621                         fi
622                         haveit=
623                         for x in $LDFLAGS $LTLIB[]NAME; do
624                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
625                           if test "X$x" = "X-L$additional_libdir"; then
626                             haveit=yes
627                             break
628                           fi
629                         done
630                         if test -z "$haveit"; then
631                           if test -d "$additional_libdir"; then
632                             dnl Really add $additional_libdir to $LTLIBNAME.
633                             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
634                           fi
635                         fi
636                       fi
637                     fi
638                     ;;
639                   -R*)
640                     dir=`echo "X$dep" | sed -e 's/^X-R//'`
641                     if test "$enable_rpath" != no; then
642                       dnl Potentially add DIR to rpathdirs.
643                       dnl The rpathdirs will be appended to $LIBNAME at the end.
644                       haveit=
645                       for x in $rpathdirs; do
646                         if test "X$x" = "X$dir"; then
647                           haveit=yes
648                           break
649                         fi
650                       done
651                       if test -z "$haveit"; then
652                         rpathdirs="$rpathdirs $dir"
653                       fi
654                       dnl Potentially add DIR to ltrpathdirs.
655                       dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
656                       haveit=
657                       for x in $ltrpathdirs; do
658                         if test "X$x" = "X$dir"; then
659                           haveit=yes
660                           break
661                         fi
662                       done
663                       if test -z "$haveit"; then
664                         ltrpathdirs="$ltrpathdirs $dir"
665                       fi
666                     fi
667                     ;;
668                   -l*)
669                     dnl Handle this in the next round.
670                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
671                     ;;
672                   *.la)
673                     dnl Handle this in the next round. Throw away the .la's
674                     dnl directory; it is already contained in a preceding -L
675                     dnl option.
676                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
677                     ;;
678                   *)
679                     dnl Most likely an immediate library name.
680                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
681                     LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
682                     ;;
683                 esac
684               done
685             fi
686           else
687             dnl Didn't find the library; assume it is in the system directories
688             dnl known to the linker and runtime loader. (All the system
689             dnl directories known to the linker should also be known to the
690             dnl runtime loader, otherwise the system is severely misconfigured.)
691             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
692             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
693           fi
694         fi
695       fi
696     done
697   done
698   if test "X$rpathdirs" != "X"; then
699     if test -n "$hardcode_libdir_separator"; then
700       dnl Weird platform: only the last -rpath option counts, the user must
701       dnl pass all path elements in one option. We can arrange that for a
702       dnl single library, but not when more than one $LIBNAMEs are used.
703       alldirs=
704       for found_dir in $rpathdirs; do
705         alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
706       done
707       dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
708       acl_save_libdir="$libdir"
709       libdir="$alldirs"
710       eval flag=\"$hardcode_libdir_flag_spec\"
711       libdir="$acl_save_libdir"
712       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
713     else
714       dnl The -rpath options are cumulative.
715       for found_dir in $rpathdirs; do
716         acl_save_libdir="$libdir"
717         libdir="$found_dir"
718         eval flag=\"$hardcode_libdir_flag_spec\"
719         libdir="$acl_save_libdir"
720         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
721       done
722     fi
723   fi
724   if test "X$ltrpathdirs" != "X"; then
725     dnl When using libtool, the option that works for both libraries and
726     dnl executables is -R. The -R options are cumulative.
727     for found_dir in $ltrpathdirs; do
728       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
729     done
730   fi
731 ])
732
733 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
734 dnl unless already present in VAR.
735 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
736 dnl contains two or three consecutive elements that belong together.
737 AC_DEFUN([AC_LIB_APPENDTOVAR],
738 [
739   for element in [$2]; do
740     haveit=
741     for x in $[$1]; do
742       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
743       if test "X$x" = "X$element"; then
744         haveit=yes
745         break
746       fi
747     done
748     if test -z "$haveit"; then
749       [$1]="${[$1]}${[$1]:+ }$element"
750     fi
751   done
752 ])
753
754 dnl For those cases where a variable contains several -L and -l options
755 dnl referring to unknown libraries and directories, this macro determines the
756 dnl necessary additional linker options for the runtime path.
757 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
758 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
759 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
760 dnl otherwise linking without libtool is assumed.
761 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
762 [
763   AC_REQUIRE([AC_LIB_RPATH])
764   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
765   $1=
766   if test "$enable_rpath" != no; then
767     if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
768       dnl Use an explicit option to hardcode directories into the resulting
769       dnl binary.
770       rpathdirs=
771       next=
772       for opt in $2; do
773         if test -n "$next"; then
774           dir="$next"
775           dnl No need to hardcode the standard /usr/lib.
776           if test "X$dir" != "X/usr/$acl_libdirstem"; then
777             rpathdirs="$rpathdirs $dir"
778           fi
779           next=
780         else
781           case $opt in
782             -L) next=yes ;;
783             -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
784                  dnl No need to hardcode the standard /usr/lib.
785                  if test "X$dir" != "X/usr/$acl_libdirstem"; then
786                    rpathdirs="$rpathdirs $dir"
787                  fi
788                  next= ;;
789             *) next= ;;
790           esac
791         fi
792       done
793       if test "X$rpathdirs" != "X"; then
794         if test -n ""$3""; then
795           dnl libtool is used for linking. Use -R options.
796           for dir in $rpathdirs; do
797             $1="${$1}${$1:+ }-R$dir"
798           done
799         else
800           dnl The linker is used for linking directly.
801           if test -n "$hardcode_libdir_separator"; then
802             dnl Weird platform: only the last -rpath option counts, the user
803             dnl must pass all path elements in one option.
804             alldirs=
805             for dir in $rpathdirs; do
806               alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir"
807             done
808             acl_save_libdir="$libdir"
809             libdir="$alldirs"
810             eval flag=\"$hardcode_libdir_flag_spec\"
811             libdir="$acl_save_libdir"
812             $1="$flag"
813           else
814             dnl The -rpath options are cumulative.
815             for dir in $rpathdirs; do
816               acl_save_libdir="$libdir"
817               libdir="$dir"
818               eval flag=\"$hardcode_libdir_flag_spec\"
819               libdir="$acl_save_libdir"
820               $1="${$1}${$1:+ }$flag"
821             done
822           fi
823         fi
824       fi
825     fi
826   fi
827   AC_SUBST([$1])
828 ])
829
830 # lib-ld.m4 serial 3 (gettext-0.13)
831 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
832 dnl This file is free software; the Free Software Foundation
833 dnl gives unlimited permission to copy and/or distribute it,
834 dnl with or without modifications, as long as this notice is preserved.
835
836 dnl Subroutines of libtool.m4,
837 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
838 dnl with libtool.m4.
839
840 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
841 AC_DEFUN([AC_LIB_PROG_LD_GNU],
842 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
843 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
844 case `$LD -v 2>&1 </dev/null` in
845 *GNU* | *'with BFD'*)
846   acl_cv_prog_gnu_ld=yes ;;
847 *)
848   acl_cv_prog_gnu_ld=no ;;
849 esac])
850 with_gnu_ld=$acl_cv_prog_gnu_ld
851 ])
852
853 dnl From libtool-1.4. Sets the variable LD.
854 AC_DEFUN([AC_LIB_PROG_LD],
855 [AC_ARG_WITH(gnu-ld,
856 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
857 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
858 AC_REQUIRE([AC_PROG_CC])dnl
859 AC_REQUIRE([AC_CANONICAL_HOST])dnl
860 # Prepare PATH_SEPARATOR.
861 # The user is always right.
862 if test "${PATH_SEPARATOR+set}" != set; then
863   echo "#! /bin/sh" >conf$$.sh
864   echo  "exit 0"   >>conf$$.sh
865   chmod +x conf$$.sh
866   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
867     PATH_SEPARATOR=';'
868   else
869     PATH_SEPARATOR=:
870   fi
871   rm -f conf$$.sh
872 fi
873 ac_prog=ld
874 if test "$GCC" = yes; then
875   # Check if gcc -print-prog-name=ld gives a path.
876   AC_MSG_CHECKING([for ld used by GCC])
877   case $host in
878   *-*-mingw*)
879     # gcc leaves a trailing carriage return which upsets mingw
880     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
881   *)
882     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
883   esac
884   case $ac_prog in
885     # Accept absolute paths.
886     [[\\/]* | [A-Za-z]:[\\/]*)]
887       [re_direlt='/[^/][^/]*/\.\./']
888       # Canonicalize the path of ld
889       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
890       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
891         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
892       done
893       test -z "$LD" && LD="$ac_prog"
894       ;;
895   "")
896     # If it fails, then pretend we aren't using GCC.
897     ac_prog=ld
898     ;;
899   *)
900     # If it is relative, then search for the first ld in PATH.
901     with_gnu_ld=unknown
902     ;;
903   esac
904 elif test "$with_gnu_ld" = yes; then
905   AC_MSG_CHECKING([for GNU ld])
906 else
907   AC_MSG_CHECKING([for non-GNU ld])
908 fi
909 AC_CACHE_VAL(acl_cv_path_LD,
910 [if test -z "$LD"; then
911   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
912   for ac_dir in $PATH; do
913     test -z "$ac_dir" && ac_dir=.
914     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
915       acl_cv_path_LD="$ac_dir/$ac_prog"
916       # Check to see if the program is GNU ld.  I'd rather use --version,
917       # but apparently some GNU ld's only accept -v.
918       # Break only if it was the GNU/non-GNU ld that we prefer.
919       case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
920       *GNU* | *'with BFD'*)
921         test "$with_gnu_ld" != no && break ;;
922       *)
923         test "$with_gnu_ld" != yes && break ;;
924       esac
925     fi
926   done
927   IFS="$ac_save_ifs"
928 else
929   acl_cv_path_LD="$LD" # Let the user override the test with a path.
930 fi])
931 LD="$acl_cv_path_LD"
932 if test -n "$LD"; then
933   AC_MSG_RESULT($LD)
934 else
935   AC_MSG_RESULT(no)
936 fi
937 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
938 AC_LIB_PROG_LD_GNU
939 ])
940
941 # Do all the work for Automake.  This macro actually does too much --
942 # some checks are only needed if your package does certain things.
943 # But this isn't really a big deal.
944
945 # serial 1
946
947 dnl Usage:
948 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
949
950 AC_DEFUN([AM_INIT_AUTOMAKE],
951 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
952 AC_REQUIRE([AC_PROG_INSTALL])
953 PACKAGE=[$1]
954 AC_SUBST(PACKAGE)
955 VERSION=[$2]
956 AC_SUBST(VERSION)
957 dnl test to see if srcdir already configured
958 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
959   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
960 fi
961 ifelse([$3],,
962 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
963 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
964 AC_REQUIRE([AM_SANITY_CHECK])
965 AC_REQUIRE([AC_ARG_PROGRAM])
966 dnl FIXME This is truly gross.
967 missing_dir=`cd $ac_aux_dir && pwd`
968 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
969 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
970 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
971 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
972 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
973 AC_REQUIRE([AC_PROG_MAKE_SET])])
974
975 # Copyright 2002  Free Software Foundation, Inc.
976
977 # This program is free software; you can redistribute it and/or modify
978 # it under the terms of the GNU General Public License as published by
979 # the Free Software Foundation; either version 2, or (at your option)
980 # any later version.
981
982 # This program is distributed in the hope that it will be useful,
983 # but WITHOUT ANY WARRANTY; without even the implied warranty of
984 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
985 # GNU General Public License for more details.
986
987 # You should have received a copy of the GNU General Public License
988 # along with this program; if not, write to the Free Software
989 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
990
991 # AM_AUTOMAKE_VERSION(VERSION)
992 # ----------------------------
993 # Automake X.Y traces this macro to ensure aclocal.m4 has been
994 # generated from the m4 files accompanying Automake X.Y.
995 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
996
997 # AM_SET_CURRENT_AUTOMAKE_VERSION
998 # -------------------------------
999 # Call AM_AUTOMAKE_VERSION so it can be traced.
1000 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
1001 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1002          [AM_AUTOMAKE_VERSION([1.4-p6])])
1003
1004 #
1005 # Check to make sure that the build environment is sane.
1006 #
1007
1008 AC_DEFUN([AM_SANITY_CHECK],
1009 [AC_MSG_CHECKING([whether build environment is sane])
1010 # Just in case
1011 sleep 1
1012 echo timestamp > conftestfile
1013 # Do `set' in a subshell so we don't clobber the current shell's
1014 # arguments.  Must try -L first in case configure is actually a
1015 # symlink; some systems play weird games with the mod time of symlinks
1016 # (eg FreeBSD returns the mod time of the symlink's containing
1017 # directory).
1018 if (
1019    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1020    if test "[$]*" = "X"; then
1021       # -L didn't work.
1022       set X `ls -t $srcdir/configure conftestfile`
1023    fi
1024    if test "[$]*" != "X $srcdir/configure conftestfile" \
1025       && test "[$]*" != "X conftestfile $srcdir/configure"; then
1026
1027       # If neither matched, then we have a broken ls.  This can happen
1028       # if, for instance, CONFIG_SHELL is bash and it inherits a
1029       # broken ls alias from the environment.  This has actually
1030       # happened.  Such a system could not be considered "sane".
1031       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1032 alias in your environment])
1033    fi
1034
1035    test "[$]2" = conftestfile
1036    )
1037 then
1038    # Ok.
1039    :
1040 else
1041    AC_MSG_ERROR([newly created file is older than distributed files!
1042 Check your system clock])
1043 fi
1044 rm -f conftest*
1045 AC_MSG_RESULT(yes)])
1046
1047 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
1048 dnl The program must properly implement --version.
1049 AC_DEFUN([AM_MISSING_PROG],
1050 [AC_MSG_CHECKING(for working $2)
1051 # Run test in a subshell; some versions of sh will print an error if
1052 # an executable is not found, even if stderr is redirected.
1053 # Redirect stdin to placate older versions of autoconf.  Sigh.
1054 if ($2 --version) < /dev/null > /dev/null 2>&1; then
1055    $1=$2
1056    AC_MSG_RESULT(found)
1057 else
1058    $1="$3/missing $2"
1059    AC_MSG_RESULT(missing)
1060 fi
1061 AC_SUBST($1)])
1062