source: OGRE/trunk/ogrenew/aclocal.m4 @ 690

Revision 690, 176.7 KB checked in by mattausch, 18 years ago (diff)

added ogre 1.07 main

Line 
1# generated automatically by aclocal 1.7.5 -*- Autoconf -*-
2
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
4# Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14# Configure paths for FreeType2
15# Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
16
17dnl AC_CHECK_FT2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
18dnl Test for FreeType2, and define FT2_CFLAGS and FT2_LIBS
19dnl
20AC_DEFUN([AC_CHECK_FT2],
21[dnl
22dnl Get the cflags and libraries from the freetype-config script
23dnl
24AC_ARG_WITH(ft-prefix,
25[  --with-ft-prefix=PREFIX
26                          Prefix where FreeType is installed (optional)],
27            ft_config_prefix="$withval", ft_config_prefix="")
28AC_ARG_WITH(ft-exec-prefix,
29[  --with-ft-exec-prefix=PREFIX
30                          Exec prefix where FreeType is installed (optional)],
31            ft_config_exec_prefix="$withval", ft_config_exec_prefix="")
32AC_ARG_ENABLE(freetypetest,
33[  --disable-freetypetest  Do not try to compile and run
34                          a test FreeType program],
35              [], enable_fttest=yes)
36
37if test x$ft_config_exec_prefix != x ; then
38  ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
39  if test x${FT2_CONFIG+set} != xset ; then
40    FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
41  fi
42fi
43if test x$ft_config_prefix != x ; then
44  ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
45  if test x${FT2_CONFIG+set} != xset ; then
46    FT2_CONFIG=$ft_config_prefix/bin/freetype-config
47  fi
48fi
49AC_PATH_PROG(FT2_CONFIG, freetype-config, no)
50
51min_ft_version=ifelse([$1], ,9.1.0,$1)
52AC_MSG_CHECKING(for FreeType - version >= $min_ft_version)
53no_ft=""
54if test "$FT2_CONFIG" = "no" ; then
55  no_ft=yes
56else
57  FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
58  FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
59  ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
60         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
61  ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
62         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
63  ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
64         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
65  ft_min_major_version=`echo $min_ft_version | \
66         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
67  ft_min_minor_version=`echo $min_ft_version | \
68         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
69  ft_min_micro_version=`echo $min_ft_version | \
70         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
71  if test x$enable_fttest = xyes ; then
72    ft_config_is_lt=""
73    if test $ft_config_major_version -lt $ft_min_major_version ; then
74      ft_config_is_lt=yes
75    else
76      if test $ft_config_major_version -eq $ft_min_major_version ; then
77        if test $ft_config_minor_version -lt $ft_min_minor_version ; then
78          ft_config_is_lt=yes
79        else
80          if test $ft_config_minor_version -eq $ft_min_minor_version ; then
81            if test $ft_config_micro_version -lt $ft_min_micro_version ; then
82              ft_config_is_lt=yes
83            fi
84          fi
85        fi
86      fi
87    fi
88    if test x$ft_config_is_lt = xyes ; then
89      no_ft=yes
90    else
91      ac_save_CFLAGS="$CFLAGS"
92      ac_save_LIBS="$LIBS"
93      CFLAGS="$CFLAGS $FT2_CFLAGS"
94      LIBS="$FT2_LIBS $LIBS"
95dnl
96dnl Sanity checks for the results of freetype-config to some extent
97dnl
98      AC_TRY_RUN([
99#include <ft2build.h>
100#include FT_FREETYPE_H
101#include <stdio.h>
102#include <stdlib.h>
103
104int
105main()
106{
107  FT_Library library;
108  FT_Error error;
109
110  error = FT_Init_FreeType(&library);
111
112  if (error)
113    return 1;
114  else
115  {
116    FT_Done_FreeType(library);
117    return 0;
118  }
119}
120],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
121      CFLAGS="$ac_save_CFLAGS"
122      LIBS="$ac_save_LIBS"
123    fi             # test $ft_config_version -lt $ft_min_version
124  fi               # test x$enable_fttest = xyes
125fi                 # test "$FT2_CONFIG" = "no"
126if test x$no_ft = x ; then
127   AC_MSG_RESULT(yes)
128   ifelse([$2], , :, [$2])
129else
130   AC_MSG_RESULT(no)
131   if test "$FT2_CONFIG" = "no" ; then
132     echo "*** The freetype-config script installed by FreeType 2 could not be found."
133     echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in"
134     echo "*** your path, or set the FT2_CONFIG environment variable to the"
135     echo "*** full path to freetype-config."
136   else
137     if test x$ft_config_is_lt = xyes ; then
138       echo "*** Your installed version of the FreeType 2 library is too old."
139       echo "*** If you have different versions of FreeType 2, make sure that"
140       echo "*** correct values for --with-ft-prefix or --with-ft-exec-prefix"
141       echo "*** are used, or set the FT2_CONFIG environment variable to the"
142       echo "*** full path to freetype-config."
143     else
144       echo "*** The FreeType test program failed to run.  If your system uses"
145       echo "*** shared libraries and they are installed outside the normal"
146       echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
147       echo "*** (or whatever is appropiate for your system) is correctly set."
148     fi
149   fi
150   FT2_CFLAGS=""
151   FT2_LIBS=""
152   ifelse([$3], , :, [$3])
153fi
154AC_SUBST(FT2_CFLAGS)
155AC_SUBST(FT2_LIBS)
156])
157
158AC_DEFUN([OGRE_USE_STLPORT],
159[AC_ARG_WITH(stlport,
160             AC_HELP_STRING([--with-stlport=PATH],
161                           [the path to STLPort.]),
162             ac_cv_use_stlport=$withval,
163             ac_cv_use_stlport=no)
164 AC_CACHE_CHECK([whether to use STLPort], ac_cv_use_stlport,
165                ac_cv_use_stlport=no)
166 if test x$ac_cv_use_stlport != xno; then
167     STLPORT_CFLAGS="-I$ac_cv_use_stlport/stlport"
168     STLPORT_LIBS="-L$ac_cv_use_stlport/lib -lstlport"
169 fi
170 AC_SUBST(STLPORT_CFLAGS)
171 AC_SUBST(STLPORT_LIBS)
172])
173
174AC_DEFUN([OGRE_GET_CONFIG_TOOLKIT],
175[OGRE_CFGTK=cli
176 AC_ARG_WITH(cfgtk,
177             AC_HELP_STRING([--with-cfgtk=TOOLKIT],
178                            [the toolkit for the config gui, currently cli or gtk]),
179             OGRE_CFGTK=$withval,
180             OGRE_CFGTK=cli)
181
182 
183  CFGTK_DEPS_CFLAGS=""
184  CFGTK_DEPS_LIBS=""
185
186  dnl Do the extra checks per type here
187  case $OGRE_CFGTK in
188    gtk)
189      PKG_CHECK_MODULES(CFGTK_DEPS, gtkmm-2.0 libglademm-2.0);;
190  esac
191
192  AC_SUBST(CFGTK_DEPS_CFLAGS)
193  AC_SUBST(CFGTK_DEPS_LIBS)
194  AC_SUBST(OGRE_CFGTK)
195])
196
197AC_DEFUN([OGRE_GET_PLATFORM],
198[OGRE_PLATFORM=SDL
199 AC_ARG_WITH(platform,
200             AC_HELP_STRING([--with-platform=PLATFORM],
201                            [the platform to build, currently SDL, GLX, Win32 or gtk]),
202             OGRE_PLATFORM=$withval,
203             OGRE_PLATFORM=SDL)
204
205 
206  if test ! -d ${srcdir}/PlatformManagers/$OGRE_PLATFORM; then
207    OGRE_PLATFORM=SDL
208  fi
209
210  PLATFORM_CFLAGS=""
211  PLATFORM_LIBS=""
212
213  dnl Do the extra checks per type here
214  case $OGRE_PLATFORM in
215    SDL)
216      AM_PATH_SDL(1.2.6,,[AC_MSG_ERROR("--with-platform: SDL > 1.2.6 not found")])
217      PLATFORM_CFLAGS=$SDL_CFLAGS
218      PLATFORM_LIBS=$SDL_LIBS
219      ;;
220    gtk)
221      PKG_CHECK_MODULES(PLATFORM, gtkglextmm-1.0 libglademm-2.0);;
222    GLX)
223      AC_CHECK_HEADERS([X11/Intrinsic.h],, [AC_MSG_ERROR("libxt headers not found")])
224      AC_CHECK_HEADERS([X11/Xaw/Command.h],, [AC_MSG_ERROR("libxaw headers not found")])
225      AC_CHECK_HEADERS([X11/extensions/Xrandr.h],, [AC_MSG_ERROR("libxrandr headers not found")],[#include <X11/Xlib.h>])
226      PLATFORM_CFLAGS="-I/usr/X11R6/include"
227      PLATFORM_LIBS="-L/usr/X11R6/lib -lX11 -lXaw"
228    ;;
229    Win32)
230      PLATFORM_CFLAGS=""
231      PLATFORM_LIBS="-lgdi32 -lwinmm -ldinput8 -ldxguid"
232    ;;
233  esac
234
235  AC_SUBST(PLATFORM_CFLAGS)
236  AC_SUBST(PLATFORM_LIBS)
237  AC_SUBST(OGRE_PLATFORM)
238])
239
240AC_DEFUN([OGRE_GET_GLSUPPORT],
241[OGRE_GLSUPPORT=none
242 AC_ARG_WITH(gl-support,
243             AC_HELP_STRING([--with-gl-support=PLATFORM],
244                            [ The GLsupport to build (SDL, GLX, Win32 or gtk). Defaults to the platform. Only set this if you know what you are doing. Use --with-platform otherwise.]),
245             OGRE_GLSUPPORT=$withval,
246             OGRE_GLSUPPORT=none)
247
248  if test "$OGRE_GLSUPPORT" = "none" ; then
249    OGRE_GLSUPPORT="$OGRE_PLATFORM"
250    AC_MSG_NOTICE([setting gl-support to platform: $OGRE_GLSUPPORT])
251  fi
252  if test "$OGRE_GLSUPPORT" = "Win32" ; then
253    # Uppercase/lowercase
254    OGRE_GLSUPPORT=win32
255  fi
256  if test ! -d ${srcdir}/RenderSystems/GL/src/$OGRE_GLSUPPORT; then
257    OGRE_GLSUPPORT=SDL
258  fi
259
260  GLSUPPORT_CFLAGS=""
261  GLSUPPORT_LIBS=""
262
263  dnl Do the extra checks per type here
264  case $OGRE_GLSUPPORT in
265    SDL) AM_PATH_SDL(1.2.6,,[AC_MSG_ERROR("--with-gl-support: SDL > 1.2.6 not found")])
266      GLSUPPORT_CFLAGS=$SDL_CFLAGS
267      GLSUPPORT_LIBS=$SDL_LIBS;;
268    gtk)
269        PKG_CHECK_MODULES(GLSUPPORT, gtkglextmm-1.0)
270        GLSUPPORT_LIBS="$GLSUPPORT_LIBS"
271    ;;
272    GLX)
273        GLSUPPORT_CFLAGS="-I/usr/X11R6/include"
274        GLSUPPORT_LIBS="-L/usr/X11R6/lib -lX11 -lXext -lGL -lXrandr"
275    ;;
276    win32)
277        GLSUPPORT_CFLAGS=""
278        GLSUPPORT_LIBS="-lgdi32 -lwinmm"
279    ;;
280  esac
281
282  AC_SUBST(GLSUPPORT_CFLAGS)
283  AC_SUBST(GLSUPPORT_LIBS)
284  AC_SUBST(OGRE_GLSUPPORT)
285  AC_CONFIG_FILES([RenderSystems/GL/src/gtk/Makefile
286                   RenderSystems/GL/src/SDL/Makefile
287                   RenderSystems/GL/src/GLX/Makefile
288                   RenderSystems/GL/src/win32/Makefile])
289])
290
291AC_DEFUN([OGRE_SETUP_FOR_TARGET],
292[case $host in
293*-*-cygwin* | *-*-mingw* | *-*-pw32*)
294        AC_SUBST(SHARED_FLAGS, "-shared -no-undefined -Xlinker --export-all-symbols")
295        AC_SUBST(PLUGIN_FLAGS, "-shared -no-undefined -avoid-version")
296        AC_SUBST(GL_LIBS, "-lopengl32 -lglu32")
297        AC_CHECK_TOOL(RC, windres)
298        nt=true
299;;
300*-*-darwin*)
301        AC_SUBST(SHARED_FLAGS, "-shared")
302        AC_SUBST(PLUGIN_FLAGS, "-shared -avoid-version")
303        AC_SUBST(GL_LIBS, "-lGL -lGLU")
304        osx=true
305;;
306 *) dnl default to standard linux
307        AC_SUBST(SHARED_FLAGS, "-shared")
308        AC_SUBST(PLUGIN_FLAGS, "-shared -avoid-version")
309        AC_SUBST(GL_LIBS, "-lGL -lGLU")
310        linux=true
311;;
312esac
313dnl you must arrange for every AM_conditional to run every time configure runs
314AM_CONDITIONAL(OGRE_NT, test x$nt = xtrue)
315AM_CONDITIONAL(OGRE_LINUX, test x$linux = xtrue)
316AM_CONDITIONAL(OGRE_OSX,test x$osx = xtrue )
317])
318
319
320AC_DEFUN([OGRE_DETECT_ENDIAN],
321[AC_TRY_RUN([
322                int main()
323                {
324                        short s = 1;
325                        short* ptr = &s;
326                        unsigned char c = *((char*)ptr);
327                        return c;
328                }
329        ]
330        ,[AC_DEFINE(CONFIG_BIG_ENDIAN,,[Big endian machine])]
331        ,[AC_DEFINE(CONFIG_LITTLE_ENDIAN,,[Little endian machine])])
332])
333
334AC_DEFUN([OGRE_CHECK_OPENEXR],
335[AC_ARG_ENABLE(openexr,
336              AC_HELP_STRING([--enable-openexr],
337                             [Build the OpenEXR plugin]),
338              [build_exr=$enableval],
339              [build_exr=no])
340
341if test "x$build_exr" = "xyes" ; then
342        PKG_CHECK_MODULES(OPENEXR, OpenEXR, [build_exr=yes], [build_exr=no])
343
344        if test "x$build_exr" = "xyes" ; then
345                AC_CONFIG_FILES([ PlugIns/EXRCodec/Makefile \
346                                         PlugIns/EXRCodec/src/Makefile \
347                                         PlugIns/EXRCodec/include/Makefile])
348                AC_SUBST(OPENEXR_CFLAGS)
349                AC_SUBST(OPENEXR_LIBS)
350
351        fi
352
353fi
354
355AM_CONDITIONAL(BUILD_EXRPLUGIN, test x$build_exr = xyes)
356
357])
358
359AC_DEFUN([OGRE_CHECK_CG],
360[AC_ARG_ENABLE(cg,
361              AC_HELP_STRING([--disable-cg],
362                             [Do not build the Cg plugin (recommended you do so!)]),
363              [build_cg=$enableval],
364              [build_cg=yes])
365
366if test "x$build_cg" = "xyes" ; then
367        AC_CHECK_LIB(Cg, cgCreateProgram,,AC_MSG_ERROR([
368        ****************************************************************
369        * You do not have the nVidia Cg libraries installed.           *
370        * Go to http://developer.nvidia.com/object/cg_toolkit.html     *
371        * (Click on Cg_Linux.tar.gz).                                  *
372        * You can disable the building of Cg support by providing      *       
373        * --disable-cg to this configure script but this is highly     *
374        * discouraged as this breaks many of the examples.             *
375        ****************************************************************])
376        )
377fi
378
379AM_CONDITIONAL(BUILD_CGPLUGIN, test x$build_cg = xyes)
380
381])
382
383AC_DEFUN([OGRE_CHECK_CPPUNIT],
384[
385AM_PATH_CPPUNIT([1.9.0], [build_unit_tests=true])
386AM_CONDITIONAL([BUILD_UNIT_TESTS], [test x$build_unit_tests = xtrue])
387])
388
389
390AC_DEFUN([OGRE_CHECK_DX9],
391[AC_ARG_ENABLE(direct3d,
392              AC_HELP_STRING([--enable-direct3d],
393                             [Build the DirectX 9 Render System]),
394              [build_dx9=$enableval],
395              [build_dx9=no])
396
397AM_CONDITIONAL(BUILD_DX9RENDERSYSTEM, test x$build_dx9 = xyes)
398
399])
400
401AC_DEFUN([OGRE_CHECK_DEVIL],
402[AC_ARG_ENABLE(devil,
403              AC_HELP_STRING([--disable-devil],
404                             [Don't use DevIL for image loading. This is not recommended unless you provide your own image loading codecs.]),
405              [build_il=$enableval],
406              [build_il=yes])
407
408AM_CONDITIONAL(USE_DEVIL, test x$build_il = xyes)
409
410if test "x$build_il" = "xyes" ; then
411        AC_CHECK_LIB(IL, ilInit,,AC_MSG_ERROR([
412****************************************************************
413* You do not have DevIL installed.  This is required to build. *
414* You may find it at http://openil.sourceforge.net/.           *
415* Note: You can also provide --disable-devil to the build      *
416* process to build without DevIL. This is an advanced option   *
417* useful only if you provide your own image loading codecs.    *
418****************************************************************]))
419        AC_CHECK_LIB(ILU, iluFlipImage)
420        AC_DEFINE([OGRE_NO_DEVIL], [0], [Build devil])
421else
422        AC_DEFINE([OGRE_NO_DEVIL], [1], [Build devil])
423fi
424
425
426])
427
428
429AC_DEFUN([OGRE_CHECK_PIC],
430[
431AC_MSG_CHECKING([whether -fPIC is needed])
432    case $host in
433        x86_64-*)
434            CXXFLAGS="$CXXFLAGS -fPIC"
435            AC_MSG_RESULT(yes)
436        ;;
437        *)
438            AC_MSG_RESULT(no)
439        ;;
440    esac
441])
442
443AC_DEFUN([OGRE_CHECK_CEGUI], [
444    PKG_CHECK_MODULES(CEGUI, CEGUI >= 0.3.0,
445            [build_cegui_sample=true], [build_cegui_sample=false])
446    if test x$build_cegui_sample = xtrue; then
447        AC_CONFIG_FILES([Samples/Common/CEGUIRenderer/Makefile \
448                         Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc
449                         Samples/Common/CEGUIRenderer/src/Makefile \
450                         Samples/Common/CEGUIRenderer/include/Makefile \
451                         Samples/Gui/Makefile \
452                         Samples/Gui/src/Makefile])
453        AC_SUBST(CEGUI_CFLAGS)
454        AC_SUBST(CEGUI_LIBS)
455        AC_MSG_RESULT([CEGUI available, Gui sample will be built])
456    else
457        AC_MSG_RESULT([CEGUI not available, Gui sample will not be built])
458    fi
459    AM_CONDITIONAL([BUILD_CEGUI_SAMPLE], [test x$build_cegui_sample = xtrue])
460])
461
462AC_DEFUN([OGRE_CHECK_DOUBLE],
463[
464AC_ARG_ENABLE(double,
465              AC_HELP_STRING([--enable-double],
466                             [Build OGRE in double floating point precision mode. This is not recommended for normal use as it is slower.]),
467              [build_double=$enableval],
468              [build_double=no])
469AC_MSG_CHECKING([whether to use double floating point precision])
470        case $build_double in
471        yes)
472                        AC_DEFINE([OGRE_DOUBLE_PRECISION], [1], [Build with double precision])
473                        AC_MSG_RESULT(yes)
474        ;;
475        *)
476                        AC_DEFINE([OGRE_DOUBLE_PRECISION], [0], [Build with double precision])
477            AC_MSG_RESULT(no)
478        ;;
479    esac
480])
481
482AC_DEFUN([OGRE_CHECK_THREADING],
483[
484AC_ARG_ENABLE(threading,
485              AC_HELP_STRING([--enable-threading],
486                             [Indicate general support for multithreading. This will enable threading support in certain parts of the engine, mainly resource loading and SharedPtr handling. WARNING: highly experimental, use with caution.]),
487              [build_threads=$enableval],
488              [build_threads=no])
489AC_MSG_CHECKING([whether to use threaded resource loading])
490        case $build_threads in
491        yes)
492            CXXFLAGS="$CXXFLAGS -pthread"
493            OGRE_THREAD_LIBS="-lboost_thread-mt"
494                        AC_DEFINE([OGRE_THREAD_SUPPORT], [1], [Build with thread support])
495            AC_CHECK_LIB([boost_thread-mt], [main],, AC_MSG_ERROR([cannot find boost_thread-mt library]))
496            AC_MSG_RESULT(yes)
497        ;;
498        *)
499            OGRE_THREAD_LIBS=""
500                        AC_DEFINE([OGRE_THREAD_SUPPORT], [0], [Build with thread support])
501            AC_MSG_RESULT(no)
502        ;;
503    esac
504    AC_SUBST(OGRE_THREAD_LIBS)
505])
506
507
508dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
509dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
510dnl also defines GSTUFF_PKG_ERRORS on error
511AC_DEFUN(PKG_CHECK_MODULES, [
512  succeeded=no
513
514  if test -z "$PKG_CONFIG"; then
515    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
516  fi
517
518  if test "$PKG_CONFIG" = "no" ; then
519     echo "*** The pkg-config script could not be found. Make sure it is"
520     echo "*** in your path, or set the PKG_CONFIG environment variable"
521     echo "*** to the full path to pkg-config."
522     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
523  else
524     PKG_CONFIG_MIN_VERSION=0.9.0
525     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
526        AC_MSG_CHECKING(for $2)
527
528        if $PKG_CONFIG --exists "$2" ; then
529            AC_MSG_RESULT(yes)
530            succeeded=yes
531
532            AC_MSG_CHECKING($1_CFLAGS)
533            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
534            AC_MSG_RESULT($$1_CFLAGS)
535
536            AC_MSG_CHECKING($1_LIBS)
537            $1_LIBS=`$PKG_CONFIG --libs "$2"`
538            AC_MSG_RESULT($$1_LIBS)
539        else
540            $1_CFLAGS=""
541            $1_LIBS=""
542            ## If we have a custom action on failure, don't print errors, but
543            ## do set a variable so people can do so.
544            $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
545            ifelse([$4], ,echo $$1_PKG_ERRORS,)
546        fi
547
548        AC_SUBST($1_CFLAGS)
549        AC_SUBST($1_LIBS)
550     else
551        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
552        echo "*** See http://www.freedesktop.org/software/pkgconfig"
553     fi
554  fi
555
556  if test $succeeded = yes; then
557     ifelse([$3], , :, [$3])
558  else
559     ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
560  fi
561])
562
563
564
565# Configure paths for SDL
566# Sam Lantinga 9/21/99
567# stolen from Manish Singh
568# stolen back from Frank Belew
569# stolen from Manish Singh
570# Shamelessly stolen from Owen Taylor
571
572dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
573dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
574dnl
575AC_DEFUN([AM_PATH_SDL],
576[dnl
577dnl Get the cflags and libraries from the sdl-config script
578dnl
579AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
580            sdl_prefix="$withval", sdl_prefix="")
581AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
582            sdl_exec_prefix="$withval", sdl_exec_prefix="")
583AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
584                    , enable_sdltest=yes)
585
586  if test x$sdl_exec_prefix != x ; then
587     sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
588     if test x${SDL_CONFIG+set} != xset ; then
589        SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
590     fi
591  fi
592  if test x$sdl_prefix != x ; then
593     sdl_args="$sdl_args --prefix=$sdl_prefix"
594     if test x${SDL_CONFIG+set} != xset ; then
595        SDL_CONFIG=$sdl_prefix/bin/sdl-config
596     fi
597  fi
598
599  AC_REQUIRE([AC_CANONICAL_TARGET])
600  PATH="$prefix/bin:$prefix/usr/bin:$PATH"
601  AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
602  min_sdl_version=ifelse([$1], ,0.11.0,$1)
603  AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
604  no_sdl=""
605  if test "$SDL_CONFIG" = "no" ; then
606    no_sdl=yes
607  else
608    SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
609    SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
610
611    sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
612           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
613    sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
614           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
615    sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
616           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
617    if test "x$enable_sdltest" = "xyes" ; then
618      ac_save_CFLAGS="$CFLAGS"
619      ac_save_LIBS="$LIBS"
620      CFLAGS="$CFLAGS $SDL_CFLAGS"
621      LIBS="$LIBS $SDL_LIBS"
622dnl
623dnl Now check if the installed SDL is sufficiently new. (Also sanity
624dnl checks the results of sdl-config to some extent
625dnl
626      rm -f conf.sdltest
627      AC_TRY_RUN([
628#include <stdio.h>
629#include <stdlib.h>
630#include <string.h>
631#include "SDL.h"
632
633char*
634my_strdup (char *str)
635{
636  char *new_str;
637 
638  if (str)
639    {
640      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
641      strcpy (new_str, str);
642    }
643  else
644    new_str = NULL;
645 
646  return new_str;
647}
648
649int main (int argc, char *argv[])
650{
651  int major, minor, micro;
652  char *tmp_version;
653
654  /* This hangs on some systems (?)
655  system ("touch conf.sdltest");
656  */
657  { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
658
659  /* HP/UX 9 (%@#!) writes to sscanf strings */
660  tmp_version = my_strdup("$min_sdl_version");
661  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
662     printf("%s, bad version string\n", "$min_sdl_version");
663     exit(1);
664   }
665
666   if (($sdl_major_version > major) ||
667      (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
668      (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
669    {
670      return 0;
671    }
672  else
673    {
674      printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
675      printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
676      printf("*** best to upgrade to the required version.\n");
677      printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
678      printf("*** to point to the correct copy of sdl-config, and remove the file\n");
679      printf("*** config.cache before re-running configure\n");
680      return 1;
681    }
682}
683
684],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
685       CFLAGS="$ac_save_CFLAGS"
686       LIBS="$ac_save_LIBS"
687     fi
688  fi
689  if test "x$no_sdl" = x ; then
690     AC_MSG_RESULT(yes)
691     ifelse([$2], , :, [$2])     
692  else
693     AC_MSG_RESULT(no)
694     if test "$SDL_CONFIG" = "no" ; then
695       echo "*** The sdl-config script installed by SDL could not be found"
696       echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
697       echo "*** your path, or set the SDL_CONFIG environment variable to the"
698       echo "*** full path to sdl-config."
699     else
700       if test -f conf.sdltest ; then
701        :
702       else
703          echo "*** Could not run SDL test program, checking why..."
704          CFLAGS="$CFLAGS $SDL_CFLAGS"
705          LIBS="$LIBS $SDL_LIBS"
706          AC_TRY_LINK([
707#include <stdio.h>
708#include "SDL.h"
709
710int main(int argc, char *argv[])
711{ return 0; }
712#undef  main
713#define main K_and_R_C_main
714],      [ return 0; ],
715        [ echo "*** The test program compiled, but did not run. This usually means"
716          echo "*** that the run-time linker is not finding SDL or finding the wrong"
717          echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
718          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
719          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
720          echo "*** is required on your system"
721          echo "***"
722          echo "*** If you have an old version installed, it is best to remove it, although"
723          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
724        [ echo "*** The test program failed to compile or link. See the file config.log for the"
725          echo "*** exact error that occured. This usually means SDL was incorrectly installed"
726          echo "*** or that you have moved SDL since it was installed. In the latter case, you"
727          echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
728          CFLAGS="$ac_save_CFLAGS"
729          LIBS="$ac_save_LIBS"
730       fi
731     fi
732     SDL_CFLAGS=""
733     SDL_LIBS=""
734     ifelse([$3], , :, [$3])
735  fi
736  AC_SUBST(SDL_CFLAGS)
737  AC_SUBST(SDL_LIBS)
738  rm -f conf.sdltest
739])
740
741# AM_CONDITIONAL                                              -*- Autoconf -*-
742
743# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
744
745# This program is free software; you can redistribute it and/or modify
746# it under the terms of the GNU General Public License as published by
747# the Free Software Foundation; either version 2, or (at your option)
748# any later version.
749
750# This program is distributed in the hope that it will be useful,
751# but WITHOUT ANY WARRANTY; without even the implied warranty of
752# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
753# GNU General Public License for more details.
754
755# You should have received a copy of the GNU General Public License
756# along with this program; if not, write to the Free Software
757# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
758# 02111-1307, USA.
759
760# serial 5
761
762AC_PREREQ(2.52)
763
764# AM_CONDITIONAL(NAME, SHELL-CONDITION)
765# -------------------------------------
766# Define a conditional.
767AC_DEFUN([AM_CONDITIONAL],
768[ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
769        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
770AC_SUBST([$1_TRUE])
771AC_SUBST([$1_FALSE])
772if $2; then
773  $1_TRUE=
774  $1_FALSE='#'
775else
776  $1_TRUE='#'
777  $1_FALSE=
778fi
779AC_CONFIG_COMMANDS_PRE(
780[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
781  AC_MSG_ERROR([conditional "$1" was never defined.
782Usually this means the macro was only invoked conditionally.])
783fi])])
784
785dnl
786dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
787dnl
788AC_DEFUN([AM_PATH_CPPUNIT],
789[
790
791AC_ARG_WITH(cppunit-prefix,[  --with-cppunit-prefix=PFX   Prefix where CppUnit is installed (optional)],
792            cppunit_config_prefix="$withval", cppunit_config_prefix="")
793AC_ARG_WITH(cppunit-exec-prefix,[  --with-cppunit-exec-prefix=PFX  Exec prefix where CppUnit is installed (optional)],
794            cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="")
795
796  if test x$cppunit_config_exec_prefix != x ; then
797     cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix"
798     if test x${CPPUNIT_CONFIG+set} != xset ; then
799        CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config
800     fi
801  fi
802  if test x$cppunit_config_prefix != x ; then
803     cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix"
804     if test x${CPPUNIT_CONFIG+set} != xset ; then
805        CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config
806     fi
807  fi
808
809  AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no)
810  cppunit_version_min=$1
811
812  AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min)
813  no_cppunit=""
814  if test "$CPPUNIT_CONFIG" = "no" ; then
815    no_cppunit=yes
816  else
817    CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags`
818    CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs`
819    cppunit_version=`$CPPUNIT_CONFIG --version`
820
821    cppunit_major_version=`echo $cppunit_version | \
822           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
823    cppunit_minor_version=`echo $cppunit_version | \
824           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
825    cppunit_micro_version=`echo $cppunit_version | \
826           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
827
828    cppunit_major_min=`echo $cppunit_version_min | \
829           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
830    cppunit_minor_min=`echo $cppunit_version_min | \
831           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
832    cppunit_micro_min=`echo $cppunit_version_min | \
833           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
834
835    cppunit_version_proper=`expr \
836        $cppunit_major_version \> $cppunit_major_min \| \
837        $cppunit_major_version \= $cppunit_major_min \& \
838        $cppunit_minor_version \> $cppunit_minor_min \| \
839        $cppunit_major_version \= $cppunit_major_min \& \
840        $cppunit_minor_version \= $cppunit_minor_min \& \
841        $cppunit_micro_version \>= $cppunit_micro_min `
842
843    if test "$cppunit_version_proper" = "1" ; then
844      AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version])
845    else
846      AC_MSG_RESULT(no)
847      no_cppunit=yes
848    fi
849  fi
850
851  if test "x$no_cppunit" = x ; then
852     ifelse([$2], , :, [$2])     
853  else
854     CPPUNIT_CFLAGS=""
855     CPPUNIT_LIBS=""
856     ifelse([$3], , :, [$3])
857  fi
858
859  AC_SUBST(CPPUNIT_CFLAGS)
860  AC_SUBST(CPPUNIT_LIBS)
861])
862
863
864
865
866# Do all the work for Automake.                            -*- Autoconf -*-
867
868# This macro actually does too much some checks are only needed if
869# your package does certain things.  But this isn't really a big deal.
870
871# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
872# Free Software Foundation, Inc.
873
874# This program is free software; you can redistribute it and/or modify
875# it under the terms of the GNU General Public License as published by
876# the Free Software Foundation; either version 2, or (at your option)
877# any later version.
878
879# This program is distributed in the hope that it will be useful,
880# but WITHOUT ANY WARRANTY; without even the implied warranty of
881# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
882# GNU General Public License for more details.
883
884# You should have received a copy of the GNU General Public License
885# along with this program; if not, write to the Free Software
886# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
887# 02111-1307, USA.
888
889# serial 10
890
891AC_PREREQ([2.54])
892
893# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
894# the ones we care about.
895m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
896
897# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
898# AM_INIT_AUTOMAKE([OPTIONS])
899# -----------------------------------------------
900# The call with PACKAGE and VERSION arguments is the old style
901# call (pre autoconf-2.50), which is being phased out.  PACKAGE
902# and VERSION should now be passed to AC_INIT and removed from
903# the call to AM_INIT_AUTOMAKE.
904# We support both call styles for the transition.  After
905# the next Automake release, Autoconf can make the AC_INIT
906# arguments mandatory, and then we can depend on a new Autoconf
907# release and drop the old call support.
908AC_DEFUN([AM_INIT_AUTOMAKE],
909[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
910 AC_REQUIRE([AC_PROG_INSTALL])dnl
911# test to see if srcdir already configured
912if test "`cd $srcdir && pwd`" != "`pwd`" &&
913   test -f $srcdir/config.status; then
914  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
915fi
916
917# test whether we have cygpath
918if test -z "$CYGPATH_W"; then
919  if (cygpath --version) >/dev/null 2>/dev/null; then
920    CYGPATH_W='cygpath -w'
921  else
922    CYGPATH_W=echo
923  fi
924fi
925AC_SUBST([CYGPATH_W])
926
927# Define the identity of the package.
928dnl Distinguish between old-style and new-style calls.
929m4_ifval([$2],
930[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
931 AC_SUBST([PACKAGE], [$1])dnl
932 AC_SUBST([VERSION], [$2])],
933[_AM_SET_OPTIONS([$1])dnl
934 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
935 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
936
937_AM_IF_OPTION([no-define],,
938[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
939 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
940
941# Some tools Automake needs.
942AC_REQUIRE([AM_SANITY_CHECK])dnl
943AC_REQUIRE([AC_ARG_PROGRAM])dnl
944AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
945AM_MISSING_PROG(AUTOCONF, autoconf)
946AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
947AM_MISSING_PROG(AUTOHEADER, autoheader)
948AM_MISSING_PROG(MAKEINFO, makeinfo)
949AM_MISSING_PROG(AMTAR, tar)
950AM_PROG_INSTALL_SH
951AM_PROG_INSTALL_STRIP
952# We need awk for the "check" target.  The system "awk" is bad on
953# some platforms.
954AC_REQUIRE([AC_PROG_AWK])dnl
955AC_REQUIRE([AC_PROG_MAKE_SET])dnl
956AC_REQUIRE([AM_SET_LEADING_DOT])dnl
957
958_AM_IF_OPTION([no-dependencies],,
959[AC_PROVIDE_IFELSE([AC_PROG_CC],
960                  [_AM_DEPENDENCIES(CC)],
961                  [define([AC_PROG_CC],
962                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
963AC_PROVIDE_IFELSE([AC_PROG_CXX],
964                  [_AM_DEPENDENCIES(CXX)],
965                  [define([AC_PROG_CXX],
966                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
967])
968])
969
970
971# When config.status generates a header, we must update the stamp-h file.
972# This file resides in the same directory as the config header
973# that is generated.  The stamp files are numbered to have different names.
974
975# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
976# loop where config.status creates the headers, so we can generate
977# our stamp files there.
978AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
979[# Compute $1's index in $config_headers.
980_am_stamp_count=1
981for _am_header in $config_headers :; do
982  case $_am_header in
983    $1 | $1:* )
984      break ;;
985    * )
986      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
987  esac
988done
989echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
990
991# Copyright 2002  Free Software Foundation, Inc.
992
993# This program is free software; you can redistribute it and/or modify
994# it under the terms of the GNU General Public License as published by
995# the Free Software Foundation; either version 2, or (at your option)
996# any later version.
997
998# This program is distributed in the hope that it will be useful,
999# but WITHOUT ANY WARRANTY; without even the implied warranty of
1000# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1001# GNU General Public License for more details.
1002
1003# You should have received a copy of the GNU General Public License
1004# along with this program; if not, write to the Free Software
1005# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1006
1007# AM_AUTOMAKE_VERSION(VERSION)
1008# ----------------------------
1009# Automake X.Y traces this macro to ensure aclocal.m4 has been
1010# generated from the m4 files accompanying Automake X.Y.
1011AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
1012
1013# AM_SET_CURRENT_AUTOMAKE_VERSION
1014# -------------------------------
1015# Call AM_AUTOMAKE_VERSION so it can be traced.
1016# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
1017AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1018         [AM_AUTOMAKE_VERSION([1.7.5])])
1019
1020# Helper functions for option handling.                    -*- Autoconf -*-
1021
1022# Copyright 2001, 2002  Free Software Foundation, Inc.
1023
1024# This program is free software; you can redistribute it and/or modify
1025# it under the terms of the GNU General Public License as published by
1026# the Free Software Foundation; either version 2, or (at your option)
1027# any later version.
1028
1029# This program is distributed in the hope that it will be useful,
1030# but WITHOUT ANY WARRANTY; without even the implied warranty of
1031# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1032# GNU General Public License for more details.
1033
1034# You should have received a copy of the GNU General Public License
1035# along with this program; if not, write to the Free Software
1036# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1037# 02111-1307, USA.
1038
1039# serial 2
1040
1041# _AM_MANGLE_OPTION(NAME)
1042# -----------------------
1043AC_DEFUN([_AM_MANGLE_OPTION],
1044[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1045
1046# _AM_SET_OPTION(NAME)
1047# ------------------------------
1048# Set option NAME.  Presently that only means defining a flag for this option.
1049AC_DEFUN([_AM_SET_OPTION],
1050[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1051
1052# _AM_SET_OPTIONS(OPTIONS)
1053# ----------------------------------
1054# OPTIONS is a space-separated list of Automake options.
1055AC_DEFUN([_AM_SET_OPTIONS],
1056[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1057
1058# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1059# -------------------------------------------
1060# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1061AC_DEFUN([_AM_IF_OPTION],
1062[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1063
1064#
1065# Check to make sure that the build environment is sane.
1066#
1067
1068# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
1069
1070# This program is free software; you can redistribute it and/or modify
1071# it under the terms of the GNU General Public License as published by
1072# the Free Software Foundation; either version 2, or (at your option)
1073# any later version.
1074
1075# This program is distributed in the hope that it will be useful,
1076# but WITHOUT ANY WARRANTY; without even the implied warranty of
1077# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1078# GNU General Public License for more details.
1079
1080# You should have received a copy of the GNU General Public License
1081# along with this program; if not, write to the Free Software
1082# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1083# 02111-1307, USA.
1084
1085# serial 3
1086
1087# AM_SANITY_CHECK
1088# ---------------
1089AC_DEFUN([AM_SANITY_CHECK],
1090[AC_MSG_CHECKING([whether build environment is sane])
1091# Just in case
1092sleep 1
1093echo timestamp > conftest.file
1094# Do `set' in a subshell so we don't clobber the current shell's
1095# arguments.  Must try -L first in case configure is actually a
1096# symlink; some systems play weird games with the mod time of symlinks
1097# (eg FreeBSD returns the mod time of the symlink's containing
1098# directory).
1099if (
1100   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
1101   if test "$[*]" = "X"; then
1102      # -L didn't work.
1103      set X `ls -t $srcdir/configure conftest.file`
1104   fi
1105   rm -f conftest.file
1106   if test "$[*]" != "X $srcdir/configure conftest.file" \
1107      && test "$[*]" != "X conftest.file $srcdir/configure"; then
1108
1109      # If neither matched, then we have a broken ls.  This can happen
1110      # if, for instance, CONFIG_SHELL is bash and it inherits a
1111      # broken ls alias from the environment.  This has actually
1112      # happened.  Such a system could not be considered "sane".
1113      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1114alias in your environment])
1115   fi
1116
1117   test "$[2]" = conftest.file
1118   )
1119then
1120   # Ok.
1121   :
1122else
1123   AC_MSG_ERROR([newly created file is older than distributed files!
1124Check your system clock])
1125fi
1126AC_MSG_RESULT(yes)])
1127
1128#  -*- Autoconf -*-
1129
1130
1131# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
1132
1133# This program is free software; you can redistribute it and/or modify
1134# it under the terms of the GNU General Public License as published by
1135# the Free Software Foundation; either version 2, or (at your option)
1136# any later version.
1137
1138# This program is distributed in the hope that it will be useful,
1139# but WITHOUT ANY WARRANTY; without even the implied warranty of
1140# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1141# GNU General Public License for more details.
1142
1143# You should have received a copy of the GNU General Public License
1144# along with this program; if not, write to the Free Software
1145# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1146# 02111-1307, USA.
1147
1148# serial 3
1149
1150# AM_MISSING_PROG(NAME, PROGRAM)
1151# ------------------------------
1152AC_DEFUN([AM_MISSING_PROG],
1153[AC_REQUIRE([AM_MISSING_HAS_RUN])
1154$1=${$1-"${am_missing_run}$2"}
1155AC_SUBST($1)])
1156
1157
1158# AM_MISSING_HAS_RUN
1159# ------------------
1160# Define MISSING if not defined so far and test if it supports --run.
1161# If it does, set am_missing_run to use it, otherwise, to nothing.
1162AC_DEFUN([AM_MISSING_HAS_RUN],
1163[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1164test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
1165# Use eval to expand $SHELL
1166if eval "$MISSING --run true"; then
1167  am_missing_run="$MISSING --run "
1168else
1169  am_missing_run=
1170  AC_MSG_WARN([`missing' script is too old or missing])
1171fi
1172])
1173
1174# AM_AUX_DIR_EXPAND
1175
1176# Copyright 2001 Free Software Foundation, Inc.
1177
1178# This program is free software; you can redistribute it and/or modify
1179# it under the terms of the GNU General Public License as published by
1180# the Free Software Foundation; either version 2, or (at your option)
1181# any later version.
1182
1183# This program is distributed in the hope that it will be useful,
1184# but WITHOUT ANY WARRANTY; without even the implied warranty of
1185# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1186# GNU General Public License for more details.
1187
1188# You should have received a copy of the GNU General Public License
1189# along with this program; if not, write to the Free Software
1190# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1191# 02111-1307, USA.
1192
1193# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1194# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
1195# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
1196#
1197# Of course, Automake must honor this variable whenever it calls a
1198# tool from the auxiliary directory.  The problem is that $srcdir (and
1199# therefore $ac_aux_dir as well) can be either absolute or relative,
1200# depending on how configure is run.  This is pretty annoying, since
1201# it makes $ac_aux_dir quite unusable in subdirectories: in the top
1202# source directory, any form will work fine, but in subdirectories a
1203# relative path needs to be adjusted first.
1204#
1205# $ac_aux_dir/missing
1206#    fails when called from a subdirectory if $ac_aux_dir is relative
1207# $top_srcdir/$ac_aux_dir/missing
1208#    fails if $ac_aux_dir is absolute,
1209#    fails when called from a subdirectory in a VPATH build with
1210#          a relative $ac_aux_dir
1211#
1212# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1213# are both prefixed by $srcdir.  In an in-source build this is usually
1214# harmless because $srcdir is `.', but things will broke when you
1215# start a VPATH build or use an absolute $srcdir.
1216#
1217# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1218# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
1219#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1220# and then we would define $MISSING as
1221#   MISSING="\${SHELL} $am_aux_dir/missing"
1222# This will work as long as MISSING is not called from configure, because
1223# unfortunately $(top_srcdir) has no meaning in configure.
1224# However there are other variables, like CC, which are often used in
1225# configure, and could therefore not use this "fixed" $ac_aux_dir.
1226#
1227# Another solution, used here, is to always expand $ac_aux_dir to an
1228# absolute PATH.  The drawback is that using absolute paths prevent a
1229# configured tree to be moved without reconfiguration.
1230
1231# Rely on autoconf to set up CDPATH properly.
1232AC_PREREQ([2.50])
1233
1234AC_DEFUN([AM_AUX_DIR_EXPAND], [
1235# expand $ac_aux_dir to an absolute path
1236am_aux_dir=`cd $ac_aux_dir && pwd`
1237])
1238
1239# AM_PROG_INSTALL_SH
1240# ------------------
1241# Define $install_sh.
1242
1243# Copyright 2001 Free Software Foundation, Inc.
1244
1245# This program is free software; you can redistribute it and/or modify
1246# it under the terms of the GNU General Public License as published by
1247# the Free Software Foundation; either version 2, or (at your option)
1248# any later version.
1249
1250# This program is distributed in the hope that it will be useful,
1251# but WITHOUT ANY WARRANTY; without even the implied warranty of
1252# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1253# GNU General Public License for more details.
1254
1255# You should have received a copy of the GNU General Public License
1256# along with this program; if not, write to the Free Software
1257# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1258# 02111-1307, USA.
1259
1260AC_DEFUN([AM_PROG_INSTALL_SH],
1261[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1262install_sh=${install_sh-"$am_aux_dir/install-sh"}
1263AC_SUBST(install_sh)])
1264
1265# AM_PROG_INSTALL_STRIP
1266
1267# Copyright 2001 Free Software Foundation, Inc.
1268
1269# This program is free software; you can redistribute it and/or modify
1270# it under the terms of the GNU General Public License as published by
1271# the Free Software Foundation; either version 2, or (at your option)
1272# any later version.
1273
1274# This program is distributed in the hope that it will be useful,
1275# but WITHOUT ANY WARRANTY; without even the implied warranty of
1276# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1277# GNU General Public License for more details.
1278
1279# You should have received a copy of the GNU General Public License
1280# along with this program; if not, write to the Free Software
1281# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1282# 02111-1307, USA.
1283
1284# One issue with vendor `install' (even GNU) is that you can't
1285# specify the program used to strip binaries.  This is especially
1286# annoying in cross-compiling environments, where the build's strip
1287# is unlikely to handle the host's binaries.
1288# Fortunately install-sh will honor a STRIPPROG variable, so we
1289# always use install-sh in `make install-strip', and initialize
1290# STRIPPROG with the value of the STRIP variable (set by the user).
1291AC_DEFUN([AM_PROG_INSTALL_STRIP],
1292[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1293# Installed binaries are usually stripped using `strip' when the user
1294# run `make install-strip'.  However `strip' might not be the right
1295# tool to use in cross-compilation environments, therefore Automake
1296# will honor the `STRIP' environment variable to overrule this program.
1297dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1298if test "$cross_compiling" != no; then
1299  AC_CHECK_TOOL([STRIP], [strip], :)
1300fi
1301INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
1302AC_SUBST([INSTALL_STRIP_PROGRAM])])
1303
1304#                                                          -*- Autoconf -*-
1305# Copyright (C) 2003  Free Software Foundation, Inc.
1306
1307# This program is free software; you can redistribute it and/or modify
1308# it under the terms of the GNU General Public License as published by
1309# the Free Software Foundation; either version 2, or (at your option)
1310# any later version.
1311
1312# This program is distributed in the hope that it will be useful,
1313# but WITHOUT ANY WARRANTY; without even the implied warranty of
1314# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1315# GNU General Public License for more details.
1316
1317# You should have received a copy of the GNU General Public License
1318# along with this program; if not, write to the Free Software
1319# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1320# 02111-1307, USA.
1321
1322# serial 1
1323
1324# Check whether the underlying file-system supports filenames
1325# with a leading dot.  For instance MS-DOS doesn't.
1326AC_DEFUN([AM_SET_LEADING_DOT],
1327[rm -rf .tst 2>/dev/null
1328mkdir .tst 2>/dev/null
1329if test -d .tst; then
1330  am__leading_dot=.
1331else
1332  am__leading_dot=_
1333fi
1334rmdir .tst 2>/dev/null
1335AC_SUBST([am__leading_dot])])
1336
1337# serial 5                                              -*- Autoconf -*-
1338
1339# Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
1340
1341# This program is free software; you can redistribute it and/or modify
1342# it under the terms of the GNU General Public License as published by
1343# the Free Software Foundation; either version 2, or (at your option)
1344# any later version.
1345
1346# This program is distributed in the hope that it will be useful,
1347# but WITHOUT ANY WARRANTY; without even the implied warranty of
1348# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1349# GNU General Public License for more details.
1350
1351# You should have received a copy of the GNU General Public License
1352# along with this program; if not, write to the Free Software
1353# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1354# 02111-1307, USA.
1355
1356
1357# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1358# written in clear, in which case automake, when reading aclocal.m4,
1359# will think it sees a *use*, and therefore will trigger all it's
1360# C support machinery.  Also note that it means that autoscan, seeing
1361# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1362
1363
1364
1365# _AM_DEPENDENCIES(NAME)
1366# ----------------------
1367# See how the compiler implements dependency checking.
1368# NAME is "CC", "CXX", "GCJ", or "OBJC".
1369# We try a few techniques and use that to set a single cache variable.
1370#
1371# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1372# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1373# dependency, and given that the user is not expected to run this macro,
1374# just rely on AC_PROG_CC.
1375AC_DEFUN([_AM_DEPENDENCIES],
1376[AC_REQUIRE([AM_SET_DEPDIR])dnl
1377AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1378AC_REQUIRE([AM_MAKE_INCLUDE])dnl
1379AC_REQUIRE([AM_DEP_TRACK])dnl
1380
1381ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1382       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1383       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1384       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1385                   [depcc="$$1"   am_compiler_list=])
1386
1387AC_CACHE_CHECK([dependency style of $depcc],
1388               [am_cv_$1_dependencies_compiler_type],
1389[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1390  # We make a subdir and do the tests there.  Otherwise we can end up
1391  # making bogus files that we don't know about and never remove.  For
1392  # instance it was reported that on HP-UX the gcc test will end up
1393  # making a dummy file named `D' -- because `-MD' means `put the output
1394  # in D'.
1395  mkdir conftest.dir
1396  # Copy depcomp to subdir because otherwise we won't find it if we're
1397  # using a relative directory.
1398  cp "$am_depcomp" conftest.dir
1399  cd conftest.dir
1400
1401  am_cv_$1_dependencies_compiler_type=none
1402  if test "$am_compiler_list" = ""; then
1403     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1404  fi
1405  for depmode in $am_compiler_list; do
1406    # We need to recreate these files for each test, as the compiler may
1407    # overwrite some of them when testing with obscure command lines.
1408    # This happens at least with the AIX C compiler.
1409    echo '#include "conftest.h"' > conftest.c
1410    echo 'int i;' > conftest.h
1411    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
1412
1413    case $depmode in
1414    nosideeffect)
1415      # after this tag, mechanisms are not by side-effect, so they'll
1416      # only be used when explicitly requested
1417      if test "x$enable_dependency_tracking" = xyes; then
1418        continue
1419      else
1420        break
1421      fi
1422      ;;
1423    none) break ;;
1424    esac
1425    # We check with `-c' and `-o' for the sake of the "dashmstdout"
1426    # mode.  It turns out that the SunPro C++ compiler does not properly
1427    # handle `-M -o', and we need to detect this.
1428    if depmode=$depmode \
1429       source=conftest.c object=conftest.o \
1430       depfile=conftest.Po tmpdepfile=conftest.TPo \
1431       $SHELL ./depcomp $depcc -c -o conftest.o conftest.c \
1432         >/dev/null 2>conftest.err &&
1433       grep conftest.h conftest.Po > /dev/null 2>&1 &&
1434       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1435      # icc doesn't choke on unknown options, it will just issue warnings
1436      # (even with -Werror).  So we grep stderr for any message
1437      # that says an option was ignored.
1438      if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
1439        am_cv_$1_dependencies_compiler_type=$depmode
1440        break
1441      fi
1442    fi
1443  done
1444
1445  cd ..
1446  rm -rf conftest.dir
1447else
1448  am_cv_$1_dependencies_compiler_type=none
1449fi
1450])
1451AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1452AM_CONDITIONAL([am__fastdep$1], [
1453  test "x$enable_dependency_tracking" != xno \
1454  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1455])
1456
1457
1458# AM_SET_DEPDIR
1459# -------------
1460# Choose a directory name for dependency files.
1461# This macro is AC_REQUIREd in _AM_DEPENDENCIES
1462AC_DEFUN([AM_SET_DEPDIR],
1463[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1464AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1465])
1466
1467
1468# AM_DEP_TRACK
1469# ------------
1470AC_DEFUN([AM_DEP_TRACK],
1471[AC_ARG_ENABLE(dependency-tracking,
1472[  --disable-dependency-tracking Speeds up one-time builds
1473  --enable-dependency-tracking  Do not reject slow dependency extractors])
1474if test "x$enable_dependency_tracking" != xno; then
1475  am_depcomp="$ac_aux_dir/depcomp"
1476  AMDEPBACKSLASH='\'
1477fi
1478AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1479AC_SUBST([AMDEPBACKSLASH])
1480])
1481
1482# Generate code to set up dependency tracking.   -*- Autoconf -*-
1483
1484# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
1485
1486# This program is free software; you can redistribute it and/or modify
1487# it under the terms of the GNU General Public License as published by
1488# the Free Software Foundation; either version 2, or (at your option)
1489# any later version.
1490
1491# This program is distributed in the hope that it will be useful,
1492# but WITHOUT ANY WARRANTY; without even the implied warranty of
1493# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1494# GNU General Public License for more details.
1495
1496# You should have received a copy of the GNU General Public License
1497# along with this program; if not, write to the Free Software
1498# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1499# 02111-1307, USA.
1500
1501#serial 2
1502
1503# _AM_OUTPUT_DEPENDENCY_COMMANDS
1504# ------------------------------
1505AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1506[for mf in $CONFIG_FILES; do
1507  # Strip MF so we end up with the name of the file.
1508  mf=`echo "$mf" | sed -e 's/:.*$//'`
1509  # Check whether this is an Automake generated Makefile or not.
1510  # We used to match only the files named `Makefile.in', but
1511  # some people rename them; so instead we look at the file content.
1512  # Grep'ing the first line is not enough: some people post-process
1513  # each Makefile.in and add a new line on top of each file to say so.
1514  # So let's grep whole file.
1515  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
1516    dirpart=`AS_DIRNAME("$mf")`
1517  else
1518    continue
1519  fi
1520  grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
1521  # Extract the definition of DEP_FILES from the Makefile without
1522  # running `make'.
1523  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
1524  test -z "$DEPDIR" && continue
1525  # When using ansi2knr, U may be empty or an underscore; expand it
1526  U=`sed -n -e '/^U = / s///p' < "$mf"`
1527  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
1528  # We invoke sed twice because it is the simplest approach to
1529  # changing $(DEPDIR) to its actual value in the expansion.
1530  for file in `sed -n -e '
1531    /^DEP_FILES = .*\\\\$/ {
1532      s/^DEP_FILES = //
1533      :loop
1534        s/\\\\$//
1535        p
1536        n
1537        /\\\\$/ b loop
1538      p
1539    }
1540    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
1541       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1542    # Make sure the directory exists.
1543    test -f "$dirpart/$file" && continue
1544    fdir=`AS_DIRNAME(["$file"])`
1545    AS_MKDIR_P([$dirpart/$fdir])
1546    # echo "creating $dirpart/$file"
1547    echo '# dummy' > "$dirpart/$file"
1548  done
1549done
1550])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1551
1552
1553# AM_OUTPUT_DEPENDENCY_COMMANDS
1554# -----------------------------
1555# This macro should only be invoked once -- use via AC_REQUIRE.
1556#
1557# This code is only required when automatic dependency tracking
1558# is enabled.  FIXME.  This creates each `.P' file that we will
1559# need in order to bootstrap the dependency handling code.
1560AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1561[AC_CONFIG_COMMANDS([depfiles],
1562     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1563     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1564])
1565
1566# Check to see how 'make' treats includes.      -*- Autoconf -*-
1567
1568# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
1569
1570# This program is free software; you can redistribute it and/or modify
1571# it under the terms of the GNU General Public License as published by
1572# the Free Software Foundation; either version 2, or (at your option)
1573# any later version.
1574
1575# This program is distributed in the hope that it will be useful,
1576# but WITHOUT ANY WARRANTY; without even the implied warranty of
1577# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1578# GNU General Public License for more details.
1579
1580# You should have received a copy of the GNU General Public License
1581# along with this program; if not, write to the Free Software
1582# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1583# 02111-1307, USA.
1584
1585# serial 2
1586
1587# AM_MAKE_INCLUDE()
1588# -----------------
1589# Check to see how make treats includes.
1590AC_DEFUN([AM_MAKE_INCLUDE],
1591[am_make=${MAKE-make}
1592cat > confinc << 'END'
1593am__doit:
1594        @echo done
1595.PHONY: am__doit
1596END
1597# If we don't find an include directive, just comment out the code.
1598AC_MSG_CHECKING([for style of include used by $am_make])
1599am__include="#"
1600am__quote=
1601_am_result=none
1602# First try GNU make style include.
1603echo "include confinc" > confmf
1604# We grep out `Entering directory' and `Leaving directory'
1605# messages which can occur if `w' ends up in MAKEFLAGS.
1606# In particular we don't look at `^make:' because GNU make might
1607# be invoked under some other name (usually "gmake"), in which
1608# case it prints its new name instead of `make'.
1609if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
1610   am__include=include
1611   am__quote=
1612   _am_result=GNU
1613fi
1614# Now try BSD make style include.
1615if test "$am__include" = "#"; then
1616   echo '.include "confinc"' > confmf
1617   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
1618      am__include=.include
1619      am__quote="\""
1620      _am_result=BSD
1621   fi
1622fi
1623AC_SUBST([am__include])
1624AC_SUBST([am__quote])
1625AC_MSG_RESULT([$_am_result])
1626rm -f confinc confmf
1627])
1628
1629# serial 2
1630
1631# AM_PROG_CC_C_O
1632# --------------
1633# Like AC_PROG_CC_C_O, but changed for automake.
1634
1635# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
1636
1637# This program is free software; you can redistribute it and/or modify
1638# it under the terms of the GNU General Public License as published by
1639# the Free Software Foundation; either version 2, or (at your option)
1640# any later version.
1641
1642# This program is distributed in the hope that it will be useful,
1643# but WITHOUT ANY WARRANTY; without even the implied warranty of
1644# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1645# GNU General Public License for more details.
1646
1647# You should have received a copy of the GNU General Public License
1648# along with this program; if not, write to the Free Software
1649# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1650# 02111-1307, USA.
1651
1652AC_DEFUN([AM_PROG_CC_C_O],
1653[AC_REQUIRE([AC_PROG_CC_C_O])dnl
1654AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1655# FIXME: we rely on the cache variable name because
1656# there is no other way.
1657set dummy $CC
1658ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
1659if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
1660   # Losing compiler, so override with the script.
1661   # FIXME: It is wrong to rewrite CC.
1662   # But if we don't then we get into trouble of one sort or another.
1663   # A longer-term fix would be to have automake use am__CC in this case,
1664   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
1665   CC="$am_aux_dir/compile $CC"
1666fi
1667])
1668
1669
1670# Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
1671
1672# This program is free software; you can redistribute it and/or modify
1673# it under the terms of the GNU General Public License as published by
1674# the Free Software Foundation; either version 2, or (at your option)
1675# any later version.
1676
1677# This program is distributed in the hope that it will be useful,
1678# but WITHOUT ANY WARRANTY; without even the implied warranty of
1679# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1680# GNU General Public License for more details.
1681
1682# You should have received a copy of the GNU General Public License
1683# along with this program; if not, write to the Free Software
1684# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1685# 02111-1307, USA.
1686
1687# serial 3
1688
1689AC_PREREQ(2.50)
1690
1691# AM_PROG_LEX
1692# -----------
1693# Autoconf leaves LEX=: if lex or flex can't be found.  Change that to a
1694# "missing" invocation, for better error output.
1695AC_DEFUN([AM_PROG_LEX],
1696[AC_REQUIRE([AM_MISSING_HAS_RUN])dnl
1697AC_REQUIRE([AC_PROG_LEX])dnl
1698if test "$LEX" = :; then
1699  LEX=${am_missing_run}flex
1700fi])
1701
1702# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
1703
1704# serial 46 AC_PROG_LIBTOOL
1705
1706AC_DEFUN([AC_PROG_LIBTOOL],
1707[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
1708
1709# This can be used to rebuild libtool when needed
1710LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
1711
1712# Always use our own libtool.
1713LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1714AC_SUBST(LIBTOOL)dnl
1715
1716# Prevent multiple expansion
1717define([AC_PROG_LIBTOOL], [])
1718])
1719
1720AC_DEFUN([AC_LIBTOOL_SETUP],
1721[AC_PREREQ(2.13)dnl
1722AC_REQUIRE([AC_ENABLE_SHARED])dnl
1723AC_REQUIRE([AC_ENABLE_STATIC])dnl
1724AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
1725AC_REQUIRE([AC_CANONICAL_HOST])dnl
1726AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1727AC_REQUIRE([AC_PROG_CC])dnl
1728AC_REQUIRE([AC_PROG_LD])dnl
1729AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
1730AC_REQUIRE([AC_PROG_NM])dnl
1731AC_REQUIRE([LT_AC_PROG_SED])dnl
1732
1733AC_REQUIRE([AC_PROG_LN_S])dnl
1734AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
1735AC_REQUIRE([AC_OBJEXT])dnl
1736AC_REQUIRE([AC_EXEEXT])dnl
1737dnl
1738
1739_LT_AC_PROG_ECHO_BACKSLASH
1740# Only perform the check for file, if the check method requires it
1741case $deplibs_check_method in
1742file_magic*)
1743  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1744    AC_PATH_MAGIC
1745  fi
1746  ;;
1747esac
1748
1749AC_CHECK_TOOL(RANLIB, ranlib, :)
1750AC_CHECK_TOOL(STRIP, strip, :)
1751
1752ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
1753ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1754enable_win32_dll=yes, enable_win32_dll=no)
1755
1756AC_ARG_ENABLE(libtool-lock,
1757  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
1758test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1759
1760# Some flags need to be propagated to the compiler or linker for good
1761# libtool support.
1762case $host in
1763*-*-irix6*)
1764  # Find out which ABI we are using.
1765  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1766  if AC_TRY_EVAL(ac_compile); then
1767    case `/usr/bin/file conftest.$ac_objext` in
1768    *32-bit*)
1769      LD="${LD-ld} -32"
1770      ;;
1771    *N32*)
1772      LD="${LD-ld} -n32"
1773      ;;
1774    *64-bit*)
1775      LD="${LD-ld} -64"
1776      ;;
1777    esac
1778  fi
1779  rm -rf conftest*
1780  ;;
1781
1782*-*-linux*)
1783  # Test if the compiler is 64bit
1784  echo 'int i;' > conftest.$ac_ext
1785  lt_cv_cc_64bit_output=no
1786  if AC_TRY_EVAL(ac_compile); then
1787    case `/usr/bin/file conftest.$ac_objext` in
1788    *"ELF 64"*)
1789      lt_cv_cc_64bit_output=yes
1790      ;;
1791    esac
1792  fi
1793  rm -rf conftest*
1794  ;;
1795 
1796*-*-sco3.2v5*)
1797  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1798  SAVE_CFLAGS="$CFLAGS"
1799  CFLAGS="$CFLAGS -belf"
1800  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1801    [AC_LANG_SAVE
1802     AC_LANG_C
1803     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1804     AC_LANG_RESTORE])
1805  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1806    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1807    CFLAGS="$SAVE_CFLAGS"
1808  fi
1809  ;;
1810
1811ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1812[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
1813  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1814  AC_CHECK_TOOL(AS, as, false)
1815  AC_CHECK_TOOL(OBJDUMP, objdump, false)
1816
1817  # recent cygwin and mingw systems supply a stub DllMain which the user
1818  # can override, but on older systems we have to supply one
1819  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
1820    [AC_TRY_LINK([],
1821      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
1822      DllMain (0, 0, 0);],
1823      [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
1824
1825  case $host/$CC in
1826  *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
1827    # old mingw systems require "-dll" to link a DLL, while more recent ones
1828    # require "-mdll"
1829    SAVE_CFLAGS="$CFLAGS"
1830    CFLAGS="$CFLAGS -mdll"
1831    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
1832      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
1833    CFLAGS="$SAVE_CFLAGS" ;;
1834  *-*-cygwin* | *-*-pw32*)
1835    # cygwin systems need to pass --dll to the linker, and not link
1836    # crt.o which will require a WinMain@16 definition.
1837    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
1838  esac
1839  ;;
1840  ])
1841esac
1842
1843_LT_AC_LTCONFIG_HACK
1844
1845])
1846
1847# AC_LIBTOOL_HEADER_ASSERT
1848# ------------------------
1849AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
1850[AC_CACHE_CHECK([whether $CC supports assert without backlinking],
1851    [lt_cv_func_assert_works],
1852    [case $host in
1853    *-*-solaris*)
1854      if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
1855        case `$CC --version 2>/dev/null` in
1856        [[12]].*) lt_cv_func_assert_works=no ;;
1857        *)        lt_cv_func_assert_works=yes ;;
1858        esac
1859      fi
1860      ;;
1861    esac])
1862
1863if test "x$lt_cv_func_assert_works" = xyes; then
1864  AC_CHECK_HEADERS(assert.h)
1865fi
1866])# AC_LIBTOOL_HEADER_ASSERT
1867
1868# _LT_AC_CHECK_DLFCN
1869# --------------------
1870AC_DEFUN([_LT_AC_CHECK_DLFCN],
1871[AC_CHECK_HEADERS(dlfcn.h)
1872])# _LT_AC_CHECK_DLFCN
1873
1874# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
1875# ---------------------------------
1876AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
1877[AC_REQUIRE([AC_CANONICAL_HOST])
1878AC_REQUIRE([AC_PROG_NM])
1879AC_REQUIRE([AC_OBJEXT])
1880# Check for command to grab the raw symbol name followed by C symbol from nm.
1881AC_MSG_CHECKING([command to parse $NM output])
1882AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
1883
1884# These are sane defaults that work on at least a few old systems.
1885# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
1886
1887# Character class describing NM global symbol codes.
1888symcode='[[BCDEGRST]]'
1889
1890# Regexp to match symbols that can be accessed directly from C.
1891sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
1892
1893# Transform the above into a raw symbol and a C symbol.
1894symxfrm='\1 \2\3 \3'
1895
1896# Transform an extracted symbol line into a proper C declaration
1897lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
1898
1899# Transform an extracted symbol line into symbol name and symbol address
1900lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
1901
1902# Define system-specific variables.
1903case $host_os in
1904aix*)
1905  symcode='[[BCDT]]'
1906  ;;
1907cygwin* | mingw* | pw32*)
1908  symcode='[[ABCDGISTW]]'
1909  ;;
1910hpux*) # Its linker distinguishes data from code symbols
1911  lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
1912  lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
1913  ;;
1914irix* | nonstopux*)
1915  symcode='[[BCDEGRST]]'
1916  ;;
1917osf*)
1918  symcode='[[BCDEGQRST]]'
1919  ;;
1920solaris* | sysv5*)
1921  symcode='[[BDT]]'
1922  ;;
1923sysv4)
1924  symcode='[[DFNSTU]]'
1925  ;;
1926esac
1927
1928# Handle CRLF in mingw tool chain
1929opt_cr=
1930case $host_os in
1931mingw*)
1932  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
1933  ;;
1934esac
1935
1936# If we're using GNU nm, then use its standard symbol codes.
1937if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1938  symcode='[[ABCDGISTW]]'
1939fi
1940
1941# Try without a prefix undercore, then with it.
1942for ac_symprfx in "" "_"; do
1943
1944  # Write the raw and C identifiers.
1945lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[        ]]\($symcode$symcode*\)[[       ]][[    ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
1946
1947  # Check to see that the pipe works correctly.
1948  pipe_works=no
1949  rm -f conftest*
1950  cat > conftest.$ac_ext <<EOF
1951#ifdef __cplusplus
1952extern "C" {
1953#endif
1954char nm_test_var;
1955void nm_test_func(){}
1956#ifdef __cplusplus
1957}
1958#endif
1959int main(){nm_test_var='a';nm_test_func();return(0);}
1960EOF
1961
1962  if AC_TRY_EVAL(ac_compile); then
1963    # Now try to grab the symbols.
1964    nlist=conftest.nm
1965    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
1966      # Try sorting and uniquifying the output.
1967      if sort "$nlist" | uniq > "$nlist"T; then
1968        mv -f "$nlist"T "$nlist"
1969      else
1970        rm -f "$nlist"T
1971      fi
1972
1973      # Make sure that we snagged all the symbols we need.
1974      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
1975        if egrep ' nm_test_func$' "$nlist" >/dev/null; then
1976          cat <<EOF > conftest.$ac_ext
1977#ifdef __cplusplus
1978extern "C" {
1979#endif
1980
1981EOF
1982          # Now generate the symbol file.
1983          eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
1984
1985          cat <<EOF >> conftest.$ac_ext
1986#if defined (__STDC__) && __STDC__
1987# define lt_ptr void *
1988#else
1989# define lt_ptr char *
1990# define const
1991#endif
1992
1993/* The mapping between symbol names and symbols. */
1994const struct {
1995  const char *name;
1996  lt_ptr address;
1997}
1998lt_preloaded_symbols[[]] =
1999{
2000EOF
2001          sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
2002          cat <<\EOF >> conftest.$ac_ext
2003  {0, (lt_ptr) 0}
2004};
2005
2006#ifdef __cplusplus
2007}
2008#endif
2009EOF
2010          # Now try linking the two files.
2011          mv conftest.$ac_objext conftstm.$ac_objext
2012          save_LIBS="$LIBS"
2013          save_CFLAGS="$CFLAGS"
2014          LIBS="conftstm.$ac_objext"
2015          CFLAGS="$CFLAGS$no_builtin_flag"
2016          if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
2017            pipe_works=yes
2018          fi
2019          LIBS="$save_LIBS"
2020          CFLAGS="$save_CFLAGS"
2021        else
2022          echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
2023        fi
2024      else
2025        echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
2026      fi
2027    else
2028      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
2029    fi
2030  else
2031    echo "$progname: failed program was:" >&AC_FD_CC
2032    cat conftest.$ac_ext >&5
2033  fi
2034  rm -f conftest* conftst*
2035
2036  # Do not use the global_symbol_pipe unless it works.
2037  if test "$pipe_works" = yes; then
2038    break
2039  else
2040    lt_cv_sys_global_symbol_pipe=
2041  fi
2042done
2043])
2044global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
2045if test -z "$lt_cv_sys_global_symbol_pipe"; then
2046  global_symbol_to_cdecl=
2047  global_symbol_to_c_name_address=
2048else
2049  global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
2050  global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
2051fi
2052if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
2053then
2054  AC_MSG_RESULT(failed)
2055else
2056  AC_MSG_RESULT(ok)
2057fi
2058]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
2059
2060# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
2061# ---------------------------------
2062AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
2063[# Find the correct PATH separator.  Usually this is `:', but
2064# DJGPP uses `;' like DOS.
2065if test "X${PATH_SEPARATOR+set}" != Xset; then
2066  UNAME=${UNAME-`uname 2>/dev/null`}
2067  case X$UNAME in
2068    *-DOS) lt_cv_sys_path_separator=';' ;;
2069    *)     lt_cv_sys_path_separator=':' ;;
2070  esac
2071  PATH_SEPARATOR=$lt_cv_sys_path_separator
2072fi
2073])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
2074
2075# _LT_AC_PROG_ECHO_BACKSLASH
2076# --------------------------
2077# Add some code to the start of the generated configure script which
2078# will find an echo command which doesn't interpret backslashes.
2079AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
2080[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
2081                              [AC_DIVERT_PUSH(NOTICE)])
2082_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
2083
2084# Check that we are running under the correct shell.
2085SHELL=${CONFIG_SHELL-/bin/sh}
2086
2087case X$ECHO in
2088X*--fallback-echo)
2089  # Remove one level of quotation (which was required for Make).
2090  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
2091  ;;
2092esac
2093
2094echo=${ECHO-echo}
2095if test "X[$]1" = X--no-reexec; then
2096  # Discard the --no-reexec flag, and continue.
2097  shift
2098elif test "X[$]1" = X--fallback-echo; then
2099  # Avoid inline document here, it may be left over
2100  :
2101elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
2102  # Yippee, $echo works!
2103  :
2104else
2105  # Restart under the correct shell.
2106  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
2107fi
2108
2109if test "X[$]1" = X--fallback-echo; then
2110  # used as fallback echo
2111  shift
2112  cat <<EOF
2113$*
2114EOF
2115  exit 0
2116fi
2117
2118# The HP-UX ksh and POSIX shell print the target directory to stdout
2119# if CDPATH is set.
2120if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
2121
2122if test -z "$ECHO"; then
2123if test "X${echo_test_string+set}" != Xset; then
2124# find a string as large as possible, as long as the shell can cope with it
2125  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
2126    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
2127    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
2128       echo_test_string="`eval $cmd`" &&
2129       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
2130    then
2131      break
2132    fi
2133  done
2134fi
2135
2136if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
2137   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
2138   test "X$echo_testing_string" = "X$echo_test_string"; then
2139  :
2140else
2141  # The Solaris, AIX, and Digital Unix default echo programs unquote
2142  # backslashes.  This makes it impossible to quote backslashes using
2143  #   echo "$something" | sed 's/\\/\\\\/g'
2144  #
2145  # So, first we look for a working echo in the user's PATH.
2146
2147  IFS="${IFS=   }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2148  for dir in $PATH /usr/ucb; do
2149    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
2150       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
2151       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
2152       test "X$echo_testing_string" = "X$echo_test_string"; then
2153      echo="$dir/echo"
2154      break
2155    fi
2156  done
2157  IFS="$save_ifs"
2158
2159  if test "X$echo" = Xecho; then
2160    # We didn't find a better echo, so look for alternatives.
2161    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
2162       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
2163       test "X$echo_testing_string" = "X$echo_test_string"; then
2164      # This shell has a builtin print -r that does the trick.
2165      echo='print -r'
2166    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
2167         test "X$CONFIG_SHELL" != X/bin/ksh; then
2168      # If we have ksh, try running configure again with it.
2169      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
2170      export ORIGINAL_CONFIG_SHELL
2171      CONFIG_SHELL=/bin/ksh
2172      export CONFIG_SHELL
2173      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
2174    else
2175      # Try using printf.
2176      echo='printf %s\n'
2177      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
2178         echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
2179         test "X$echo_testing_string" = "X$echo_test_string"; then
2180        # Cool, printf works
2181        :
2182      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
2183           test "X$echo_testing_string" = 'X\t' &&
2184           echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
2185           test "X$echo_testing_string" = "X$echo_test_string"; then
2186        CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
2187        export CONFIG_SHELL
2188        SHELL="$CONFIG_SHELL"
2189        export SHELL
2190        echo="$CONFIG_SHELL [$]0 --fallback-echo"
2191      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
2192           test "X$echo_testing_string" = 'X\t' &&
2193           echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
2194           test "X$echo_testing_string" = "X$echo_test_string"; then
2195        echo="$CONFIG_SHELL [$]0 --fallback-echo"
2196      else
2197        # maybe with a smaller string...
2198        prev=:
2199
2200        for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
2201          if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
2202          then
2203            break
2204          fi
2205          prev="$cmd"
2206        done
2207
2208        if test "$prev" != 'sed 50q "[$]0"'; then
2209          echo_test_string=`eval $prev`
2210          export echo_test_string
2211          exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
2212        else
2213          # Oops.  We lost completely, so just stick with echo.
2214          echo=echo
2215        fi
2216      fi
2217    fi
2218  fi
2219fi
2220fi
2221
2222# Copy echo and quote the copy suitably for passing to libtool from
2223# the Makefile, instead of quoting the original, which is used later.
2224ECHO=$echo
2225if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
2226   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
2227fi
2228
2229AC_SUBST(ECHO)
2230AC_DIVERT_POP
2231])# _LT_AC_PROG_ECHO_BACKSLASH
2232
2233# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
2234#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
2235# ------------------------------------------------------------------
2236AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
2237[if test "$cross_compiling" = yes; then :
2238  [$4]
2239else
2240  AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
2241  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2242  lt_status=$lt_dlunknown
2243  cat > conftest.$ac_ext <<EOF
2244[#line __oline__ "configure"
2245#include "confdefs.h"
2246
2247#if HAVE_DLFCN_H
2248#include <dlfcn.h>
2249#endif
2250
2251#include <stdio.h>
2252
2253#ifdef RTLD_GLOBAL
2254#  define LT_DLGLOBAL           RTLD_GLOBAL
2255#else
2256#  ifdef DL_GLOBAL
2257#    define LT_DLGLOBAL         DL_GLOBAL
2258#  else
2259#    define LT_DLGLOBAL         0
2260#  endif
2261#endif
2262
2263/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
2264   find out it does not work in some platform. */
2265#ifndef LT_DLLAZY_OR_NOW
2266#  ifdef RTLD_LAZY
2267#    define LT_DLLAZY_OR_NOW            RTLD_LAZY
2268#  else
2269#    ifdef DL_LAZY
2270#      define LT_DLLAZY_OR_NOW          DL_LAZY
2271#    else
2272#      ifdef RTLD_NOW
2273#        define LT_DLLAZY_OR_NOW        RTLD_NOW
2274#      else
2275#        ifdef DL_NOW
2276#          define LT_DLLAZY_OR_NOW      DL_NOW
2277#        else
2278#          define LT_DLLAZY_OR_NOW      0
2279#        endif
2280#      endif
2281#    endif
2282#  endif
2283#endif
2284
2285#ifdef __cplusplus
2286extern "C" void exit (int);
2287#endif
2288
2289void fnord() { int i=42;}
2290int main ()
2291{
2292  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2293  int status = $lt_dlunknown;
2294
2295  if (self)
2296    {
2297      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
2298      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
2299      /* dlclose (self); */
2300    }
2301
2302    exit (status);
2303}]
2304EOF
2305  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2306    (./conftest; exit; ) 2>/dev/null
2307    lt_status=$?
2308    case x$lt_status in
2309      x$lt_dlno_uscore) $1 ;;
2310      x$lt_dlneed_uscore) $2 ;;
2311      x$lt_unknown|x*) $3 ;;
2312    esac
2313  else :
2314    # compilation failed
2315    $3
2316  fi
2317fi
2318rm -fr conftest*
2319])# _LT_AC_TRY_DLOPEN_SELF
2320
2321# AC_LIBTOOL_DLOPEN_SELF
2322# -------------------
2323AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
2324[if test "x$enable_dlopen" != xyes; then
2325  enable_dlopen=unknown
2326  enable_dlopen_self=unknown
2327  enable_dlopen_self_static=unknown
2328else
2329  lt_cv_dlopen=no
2330  lt_cv_dlopen_libs=
2331
2332  case $host_os in
2333  beos*)
2334    lt_cv_dlopen="load_add_on"
2335    lt_cv_dlopen_libs=
2336    lt_cv_dlopen_self=yes
2337    ;;
2338
2339  cygwin* | mingw* | pw32*)
2340    lt_cv_dlopen="LoadLibrary"
2341    lt_cv_dlopen_libs=
2342   ;;
2343
2344  *)
2345    AC_CHECK_FUNC([shl_load],
2346          [lt_cv_dlopen="shl_load"],
2347      [AC_CHECK_LIB([dld], [shl_load],
2348            [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
2349        [AC_CHECK_FUNC([dlopen],
2350              [lt_cv_dlopen="dlopen"],
2351          [AC_CHECK_LIB([dl], [dlopen],
2352                [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
2353            [AC_CHECK_LIB([svld], [dlopen],
2354                  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
2355              [AC_CHECK_LIB([dld], [dld_link],
2356                    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
2357              ])
2358            ])
2359          ])
2360        ])
2361      ])
2362    ;;
2363  esac
2364
2365  if test "x$lt_cv_dlopen" != xno; then
2366    enable_dlopen=yes
2367  else
2368    enable_dlopen=no
2369  fi
2370
2371  case $lt_cv_dlopen in
2372  dlopen)
2373    save_CPPFLAGS="$CPPFLAGS"
2374    AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
2375    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2376
2377    save_LDFLAGS="$LDFLAGS"
2378    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2379
2380    save_LIBS="$LIBS"
2381    LIBS="$lt_cv_dlopen_libs $LIBS"
2382
2383    AC_CACHE_CHECK([whether a program can dlopen itself],
2384          lt_cv_dlopen_self, [dnl
2385          _LT_AC_TRY_DLOPEN_SELF(
2386            lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2387            lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2388    ])
2389
2390    if test "x$lt_cv_dlopen_self" = xyes; then
2391      LDFLAGS="$LDFLAGS $link_static_flag"
2392      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2393          lt_cv_dlopen_self_static, [dnl
2394          _LT_AC_TRY_DLOPEN_SELF(
2395            lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2396            lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2397      ])
2398    fi
2399
2400    CPPFLAGS="$save_CPPFLAGS"
2401    LDFLAGS="$save_LDFLAGS"
2402    LIBS="$save_LIBS"
2403    ;;
2404  esac
2405
2406  case $lt_cv_dlopen_self in
2407  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2408  *) enable_dlopen_self=unknown ;;
2409  esac
2410
2411  case $lt_cv_dlopen_self_static in
2412  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2413  *) enable_dlopen_self_static=unknown ;;
2414  esac
2415fi
2416])# AC_LIBTOOL_DLOPEN_SELF
2417
2418AC_DEFUN([_LT_AC_LTCONFIG_HACK],
2419[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
2420# Sed substitution that helps us do robust quoting.  It backslashifies
2421# metacharacters that are still active within double-quoted strings.
2422Xsed='sed -e s/^X//'
2423sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
2424
2425# Same as above, but do not quote variable references.
2426double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
2427
2428# Sed substitution to delay expansion of an escaped shell variable in a
2429# double_quote_subst'ed string.
2430delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
2431
2432# Constants:
2433rm="rm -f"
2434
2435# Global variables:
2436default_ofile=libtool
2437can_build_shared=yes
2438
2439# All known linkers require a `.a' archive for static linking (except M$VC,
2440# which needs '.lib').
2441libext=a
2442ltmain="$ac_aux_dir/ltmain.sh"
2443ofile="$default_ofile"
2444with_gnu_ld="$lt_cv_prog_gnu_ld"
2445need_locks="$enable_libtool_lock"
2446
2447old_CC="$CC"
2448old_CFLAGS="$CFLAGS"
2449
2450# Set sane defaults for various variables
2451test -z "$AR" && AR=ar
2452test -z "$AR_FLAGS" && AR_FLAGS=cru
2453test -z "$AS" && AS=as
2454test -z "$CC" && CC=cc
2455test -z "$DLLTOOL" && DLLTOOL=dlltool
2456test -z "$LD" && LD=ld
2457test -z "$LN_S" && LN_S="ln -s"
2458test -z "$MAGIC_CMD" && MAGIC_CMD=file
2459test -z "$NM" && NM=nm
2460test -z "$OBJDUMP" && OBJDUMP=objdump
2461test -z "$RANLIB" && RANLIB=:
2462test -z "$STRIP" && STRIP=:
2463test -z "$ac_objext" && ac_objext=o
2464
2465if test x"$host" != x"$build"; then
2466  ac_tool_prefix=${host_alias}-
2467else
2468  ac_tool_prefix=
2469fi
2470
2471# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
2472case $host_os in
2473linux-gnu*) ;;
2474linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
2475esac
2476
2477case $host_os in
2478aix3*)
2479  # AIX sometimes has problems with the GCC collect2 program.  For some
2480  # reason, if we set the COLLECT_NAMES environment variable, the problems
2481  # vanish in a puff of smoke.
2482  if test "X${COLLECT_NAMES+set}" != Xset; then
2483    COLLECT_NAMES=
2484    export COLLECT_NAMES
2485  fi
2486  ;;
2487esac
2488
2489# Determine commands to create old-style static archives.
2490old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
2491old_postinstall_cmds='chmod 644 $oldlib'
2492old_postuninstall_cmds=
2493
2494if test -n "$RANLIB"; then
2495  case $host_os in
2496  openbsd*)
2497    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
2498    ;;
2499  *)
2500    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
2501    ;;
2502  esac
2503  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
2504fi
2505
2506# Allow CC to be a program name with arguments.
2507set dummy $CC
2508compiler="[$]2"
2509
2510AC_MSG_CHECKING([for objdir])
2511rm -f .libs 2>/dev/null
2512mkdir .libs 2>/dev/null
2513if test -d .libs; then
2514  objdir=.libs
2515else
2516  # MS-DOS does not allow filenames that begin with a dot.
2517  objdir=_libs
2518fi
2519rmdir .libs 2>/dev/null
2520AC_MSG_RESULT($objdir)
2521
2522
2523AC_ARG_WITH(pic,
2524[  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
2525pic_mode="$withval", pic_mode=default)
2526test -z "$pic_mode" && pic_mode=default
2527
2528# We assume here that the value for lt_cv_prog_cc_pic will not be cached
2529# in isolation, and that seeing it set (from the cache) indicates that
2530# the associated values are set (in the cache) correctly too.
2531AC_MSG_CHECKING([for $compiler option to produce PIC])
2532AC_CACHE_VAL(lt_cv_prog_cc_pic,
2533[ lt_cv_prog_cc_pic=
2534  lt_cv_prog_cc_shlib=
2535  lt_cv_prog_cc_wl=
2536  lt_cv_prog_cc_static=
2537  lt_cv_prog_cc_no_builtin=
2538  lt_cv_prog_cc_can_build_shared=$can_build_shared
2539
2540  if test "$GCC" = yes; then
2541    lt_cv_prog_cc_wl='-Wl,'
2542    lt_cv_prog_cc_static='-static'
2543
2544    case $host_os in
2545    aix*)
2546      # Below there is a dirty hack to force normal static linking with -ldl
2547      # The problem is because libdl dynamically linked with both libc and
2548      # libC (AIX C++ library), which obviously doesn't included in libraries
2549      # list by gcc. This cause undefined symbols with -static flags.
2550      # This hack allows C programs to be linked with "-static -ldl", but
2551      # not sure about C++ programs.
2552      lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
2553      ;;
2554    amigaos*)
2555      # FIXME: we need at least 68020 code to build shared libraries, but
2556      # adding the `-m68020' flag to GCC prevents building anything better,
2557      # like `-m68040'.
2558      lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
2559      ;;
2560    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
2561      # PIC is the default for these OSes.
2562      ;;
2563    darwin* | rhapsody*)
2564      # PIC is the default on this platform
2565      # Common symbols not allowed in MH_DYLIB files
2566      lt_cv_prog_cc_pic='-fno-common'
2567      ;;
2568    cygwin* | mingw* | pw32* | os2*)
2569      # This hack is so that the source file can tell whether it is being
2570      # built for inclusion in a dll (and should export symbols for example).
2571      lt_cv_prog_cc_pic='-DDLL_EXPORT'
2572      ;;
2573    sysv4*MP*)
2574      if test -d /usr/nec; then
2575         lt_cv_prog_cc_pic=-Kconform_pic
2576      fi
2577      ;;
2578    *)
2579      lt_cv_prog_cc_pic='-fPIC'
2580      ;;
2581    esac
2582  else
2583    # PORTME Check for PIC flags for the system compiler.
2584    case $host_os in
2585    aix3* | aix4* | aix5*)
2586      lt_cv_prog_cc_wl='-Wl,'
2587      # All AIX code is PIC.
2588      if test "$host_cpu" = ia64; then
2589        # AIX 5 now supports IA64 processor
2590        lt_cv_prog_cc_static='-Bstatic'
2591      else
2592        lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
2593      fi
2594      ;;
2595
2596    hpux9* | hpux10* | hpux11*)
2597      # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
2598      lt_cv_prog_cc_wl='-Wl,'
2599      lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
2600      lt_cv_prog_cc_pic='+Z'
2601      ;;
2602
2603    irix5* | irix6* | nonstopux*)
2604      lt_cv_prog_cc_wl='-Wl,'
2605      lt_cv_prog_cc_static='-non_shared'
2606      # PIC (with -KPIC) is the default.
2607      ;;
2608
2609    cygwin* | mingw* | pw32* | os2*)
2610      # This hack is so that the source file can tell whether it is being
2611      # built for inclusion in a dll (and should export symbols for example).
2612      lt_cv_prog_cc_pic='-DDLL_EXPORT'
2613      ;;
2614
2615    newsos6)
2616      lt_cv_prog_cc_pic='-KPIC'
2617      lt_cv_prog_cc_static='-Bstatic'
2618      ;;
2619
2620    osf3* | osf4* | osf5*)
2621      # All OSF/1 code is PIC.
2622      lt_cv_prog_cc_wl='-Wl,'
2623      lt_cv_prog_cc_static='-non_shared'
2624      ;;
2625
2626    sco3.2v5*)
2627      lt_cv_prog_cc_pic='-Kpic'
2628      lt_cv_prog_cc_static='-dn'
2629      lt_cv_prog_cc_shlib='-belf'
2630      ;;
2631
2632    solaris*)
2633      lt_cv_prog_cc_pic='-KPIC'
2634      lt_cv_prog_cc_static='-Bstatic'
2635      lt_cv_prog_cc_wl='-Wl,'
2636      ;;
2637
2638    sunos4*)
2639      lt_cv_prog_cc_pic='-PIC'
2640      lt_cv_prog_cc_static='-Bstatic'
2641      lt_cv_prog_cc_wl='-Qoption ld '
2642      ;;
2643
2644    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
2645      lt_cv_prog_cc_pic='-KPIC'
2646      lt_cv_prog_cc_static='-Bstatic'
2647      lt_cv_prog_cc_wl='-Wl,'
2648      ;;
2649
2650    uts4*)
2651      lt_cv_prog_cc_pic='-pic'
2652      lt_cv_prog_cc_static='-Bstatic'
2653      ;;
2654
2655    sysv4*MP*)
2656      if test -d /usr/nec ;then
2657        lt_cv_prog_cc_pic='-Kconform_pic'
2658        lt_cv_prog_cc_static='-Bstatic'
2659      fi
2660      ;;
2661
2662    *)
2663      lt_cv_prog_cc_can_build_shared=no
2664      ;;
2665    esac
2666  fi
2667])
2668if test -z "$lt_cv_prog_cc_pic"; then
2669  AC_MSG_RESULT([none])
2670else
2671  AC_MSG_RESULT([$lt_cv_prog_cc_pic])
2672
2673  # Check to make sure the pic_flag actually works.
2674  AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
2675  AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
2676    save_CFLAGS="$CFLAGS"
2677    CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
2678    AC_TRY_COMPILE([], [], [dnl
2679      case $host_os in
2680      hpux9* | hpux10* | hpux11*)
2681        # On HP-UX, both CC and GCC only warn that PIC is supported... then
2682        # they create non-PIC objects.  So, if there were any warnings, we
2683        # assume that PIC is not supported.
2684        if test -s conftest.err; then
2685          lt_cv_prog_cc_pic_works=no
2686        else
2687          lt_cv_prog_cc_pic_works=yes
2688        fi
2689        ;;
2690      *)
2691        lt_cv_prog_cc_pic_works=yes
2692        ;;
2693      esac
2694    ], [dnl
2695      lt_cv_prog_cc_pic_works=no
2696    ])
2697    CFLAGS="$save_CFLAGS"
2698  ])
2699
2700  if test "X$lt_cv_prog_cc_pic_works" = Xno; then
2701    lt_cv_prog_cc_pic=
2702    lt_cv_prog_cc_can_build_shared=no
2703  else
2704    lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
2705  fi
2706
2707  AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
2708fi
2709
2710# Check for any special shared library compilation flags.
2711if test -n "$lt_cv_prog_cc_shlib"; then
2712  AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
2713  if echo "$old_CC $old_CFLAGS " | egrep -e "[[         ]]$lt_cv_prog_cc_shlib[[        ]]" >/dev/null; then :
2714  else
2715   AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
2716    lt_cv_prog_cc_can_build_shared=no
2717  fi
2718fi
2719
2720AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
2721AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
2722  lt_cv_prog_cc_static_works=no
2723  save_LDFLAGS="$LDFLAGS"
2724  LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
2725  AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
2726  LDFLAGS="$save_LDFLAGS"
2727])
2728
2729# Belt *and* braces to stop my trousers falling down:
2730test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
2731AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
2732
2733pic_flag="$lt_cv_prog_cc_pic"
2734special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
2735wl="$lt_cv_prog_cc_wl"
2736link_static_flag="$lt_cv_prog_cc_static"
2737no_builtin_flag="$lt_cv_prog_cc_no_builtin"
2738can_build_shared="$lt_cv_prog_cc_can_build_shared"
2739
2740
2741# Check to see if options -o and -c are simultaneously supported by compiler
2742AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
2743AC_CACHE_VAL([lt_cv_compiler_c_o], [
2744$rm -r conftest 2>/dev/null
2745mkdir conftest
2746cd conftest
2747echo "int some_variable = 0;" > conftest.$ac_ext
2748mkdir out
2749# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
2750# that will create temporary files in the current directory regardless of
2751# the output directory.  Thus, making CWD read-only will cause this test
2752# to fail, enabling locking or at least warning the user not to do parallel
2753# builds.
2754chmod -w .
2755save_CFLAGS="$CFLAGS"
2756CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
2757compiler_c_o=no
2758if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
2759  # The compiler can only warn and ignore the option if not recognized
2760  # So say no if there are warnings
2761  if test -s out/conftest.err; then
2762    lt_cv_compiler_c_o=no
2763  else
2764    lt_cv_compiler_c_o=yes
2765  fi
2766else
2767  # Append any errors to the config.log.
2768  cat out/conftest.err 1>&AC_FD_CC
2769  lt_cv_compiler_c_o=no
2770fi
2771CFLAGS="$save_CFLAGS"
2772chmod u+w .
2773$rm conftest* out/*
2774rmdir out
2775cd ..
2776rmdir conftest
2777$rm -r conftest 2>/dev/null
2778])
2779compiler_c_o=$lt_cv_compiler_c_o
2780AC_MSG_RESULT([$compiler_c_o])
2781
2782if test x"$compiler_c_o" = x"yes"; then
2783  # Check to see if we can write to a .lo
2784  AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
2785  AC_CACHE_VAL([lt_cv_compiler_o_lo], [
2786  lt_cv_compiler_o_lo=no
2787  save_CFLAGS="$CFLAGS"
2788  CFLAGS="$CFLAGS -c -o conftest.lo"
2789  save_objext="$ac_objext"
2790  ac_objext=lo
2791  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
2792    # The compiler can only warn and ignore the option if not recognized
2793    # So say no if there are warnings
2794    if test -s conftest.err; then
2795      lt_cv_compiler_o_lo=no
2796    else
2797      lt_cv_compiler_o_lo=yes
2798    fi
2799  ])
2800  ac_objext="$save_objext"
2801  CFLAGS="$save_CFLAGS"
2802  ])
2803  compiler_o_lo=$lt_cv_compiler_o_lo
2804  AC_MSG_RESULT([$compiler_o_lo])
2805else
2806  compiler_o_lo=no
2807fi
2808
2809# Check to see if we can do hard links to lock some files if needed
2810hard_links="nottested"
2811if test "$compiler_c_o" = no && test "$need_locks" != no; then
2812  # do not overwrite the value of need_locks provided by the user
2813  AC_MSG_CHECKING([if we can lock with hard links])
2814  hard_links=yes
2815  $rm conftest*
2816  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2817  touch conftest.a
2818  ln conftest.a conftest.b 2>&5 || hard_links=no
2819  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2820  AC_MSG_RESULT([$hard_links])
2821  if test "$hard_links" = no; then
2822    AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
2823    need_locks=warn
2824  fi
2825else
2826  need_locks=no
2827fi
2828
2829if test "$GCC" = yes; then
2830  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
2831  AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
2832  echo "int some_variable = 0;" > conftest.$ac_ext
2833  save_CFLAGS="$CFLAGS"
2834  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
2835  compiler_rtti_exceptions=no
2836  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
2837    # The compiler can only warn and ignore the option if not recognized
2838    # So say no if there are warnings
2839    if test -s conftest.err; then
2840      compiler_rtti_exceptions=no
2841    else
2842      compiler_rtti_exceptions=yes
2843    fi
2844  ])
2845  CFLAGS="$save_CFLAGS"
2846  AC_MSG_RESULT([$compiler_rtti_exceptions])
2847
2848  if test "$compiler_rtti_exceptions" = "yes"; then
2849    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
2850  else
2851    no_builtin_flag=' -fno-builtin'
2852  fi
2853fi
2854
2855# See if the linker supports building shared libraries.
2856AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
2857
2858allow_undefined_flag=
2859no_undefined_flag=
2860need_lib_prefix=unknown
2861need_version=unknown
2862# when you set need_version to no, make sure it does not cause -set_version
2863# flags to be left without arguments
2864archive_cmds=
2865archive_expsym_cmds=
2866old_archive_from_new_cmds=
2867old_archive_from_expsyms_cmds=
2868export_dynamic_flag_spec=
2869whole_archive_flag_spec=
2870thread_safe_flag_spec=
2871hardcode_into_libs=no
2872hardcode_libdir_flag_spec=
2873hardcode_libdir_separator=
2874hardcode_direct=no
2875hardcode_minus_L=no
2876hardcode_shlibpath_var=unsupported
2877runpath_var=
2878link_all_deplibs=unknown
2879always_export_symbols=no
2880export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
2881# include_expsyms should be a list of space-separated symbols to be *always*
2882# included in the symbol list
2883include_expsyms=
2884# exclude_expsyms can be an egrep regular expression of symbols to exclude
2885# it will be wrapped by ` (' and `)$', so one must not match beginning or
2886# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
2887# as well as any symbol that contains `d'.
2888exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
2889# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
2890# platforms (ab)use it in PIC code, but their linkers get confused if
2891# the symbol is explicitly referenced.  Since portable code cannot
2892# rely on this symbol name, it's probably fine to never include it in
2893# preloaded symbol tables.
2894extract_expsyms_cmds=
2895
2896case $host_os in
2897cygwin* | mingw* | pw32*)
2898  # FIXME: the MSVC++ port hasn't been tested in a loooong time
2899  # When not using gcc, we currently assume that we are using
2900  # Microsoft Visual C++.
2901  if test "$GCC" != yes; then
2902    with_gnu_ld=no
2903  fi
2904  ;;
2905openbsd*)
2906  with_gnu_ld=no
2907  ;;
2908esac
2909
2910ld_shlibs=yes
2911if test "$with_gnu_ld" = yes; then
2912  # If archive_cmds runs LD, not CC, wlarc should be empty
2913  wlarc='${wl}'
2914
2915  # See if GNU ld supports shared libraries.
2916  case $host_os in
2917  aix3* | aix4* | aix5*)
2918    # On AIX, the GNU linker is very broken
2919    # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
2920    ld_shlibs=no
2921    cat <<EOF 1>&2
2922
2923*** Warning: the GNU linker, at least up to release 2.9.1, is reported
2924*** to be unable to reliably create shared libraries on AIX.
2925*** Therefore, libtool is disabling shared libraries support.  If you
2926*** really care for shared libraries, you may want to modify your PATH
2927*** so that a non-GNU linker is found, and then restart.
2928
2929EOF
2930    ;;
2931
2932  amigaos*)
2933    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
2934    hardcode_libdir_flag_spec='-L$libdir'
2935    hardcode_minus_L=yes
2936
2937    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
2938    # that the semantics of dynamic libraries on AmigaOS, at least up
2939    # to version 4, is to share data among multiple programs linked
2940    # with the same dynamic library.  Since this doesn't match the
2941    # behavior of shared libraries on other platforms, we can use
2942    # them.
2943    ld_shlibs=no
2944    ;;
2945
2946  beos*)
2947    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
2948      allow_undefined_flag=unsupported
2949      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
2950      # support --undefined.  This deserves some investigation.  FIXME
2951      archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2952    else
2953      ld_shlibs=no
2954    fi
2955    ;;
2956
2957  cygwin* | mingw* | pw32*)
2958    # hardcode_libdir_flag_spec is actually meaningless, as there is
2959    # no search path for DLLs.
2960    hardcode_libdir_flag_spec='-L$libdir'
2961    allow_undefined_flag=unsupported
2962    always_export_symbols=yes
2963
2964    extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
2965      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
2966      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
2967      if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
2968      else $CC -o impgen impgen.c ; fi)~
2969      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
2970
2971    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
2972
2973    # cygwin and mingw dlls have different entry points and sets of symbols
2974    # to exclude.
2975    # FIXME: what about values for MSVC?
2976    dll_entry=__cygwin_dll_entry@12
2977    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
2978    case $host_os in
2979    mingw*)
2980      # mingw values
2981      dll_entry=_DllMainCRTStartup@12
2982      dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
2983      ;;
2984    esac
2985
2986    # mingw and cygwin differ, and it's simplest to just exclude the union
2987    # of the two symbol sets.
2988    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
2989
2990    # recent cygwin and mingw systems supply a stub DllMain which the user
2991    # can override, but on older systems we have to supply one (in ltdll.c)
2992    if test "x$lt_cv_need_dllmain" = "xyes"; then
2993      ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
2994      ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
2995        test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
2996    else
2997      ltdll_obj=
2998      ltdll_cmds=
2999    fi
3000
3001    # Extract the symbol export list from an `--export-all' def file,
3002    # then regenerate the def file from the symbol export list, so that
3003    # the compiled dll only exports the symbol export list.
3004    # Be careful not to strip the DATA tag left be newer dlltools.
3005    export_symbols_cmds="$ltdll_cmds"'
3006      $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
3007      sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
3008
3009    # If the export-symbols file already is a .def file (1st line
3010    # is EXPORTS), use it as is.
3011    # If DATA tags from a recent dlltool are present, honour them!
3012    archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
3013        cp $export_symbols $output_objdir/$soname-def;
3014      else
3015        echo EXPORTS > $output_objdir/$soname-def;
3016        _lt_hint=1;
3017        cat $export_symbols | while read symbol; do
3018         set dummy \$symbol;
3019         case \[$]# in
3020           2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
3021           4) echo "   \[$]2 \[$]3 \[$]4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
3022           *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
3023         esac;
3024         _lt_hint=`expr 1 + \$_lt_hint`;
3025        done;
3026      fi~
3027      '"$ltdll_cmds"'
3028      $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
3029      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
3030      $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
3031      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
3032      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
3033    ;;
3034
3035  netbsd*)
3036    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
3037      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
3038      wlarc=
3039    else
3040      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
3041      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
3042    fi
3043    ;;
3044
3045  solaris* | sysv5*)
3046    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
3047      ld_shlibs=no
3048      cat <<EOF 1>&2
3049
3050*** Warning: The releases 2.8.* of the GNU linker cannot reliably
3051*** create shared libraries on Solaris systems.  Therefore, libtool
3052*** is disabling shared libraries support.  We urge you to upgrade GNU
3053*** binutils to release 2.9.1 or newer.  Another option is to modify
3054*** your PATH or compiler configuration so that the native linker is
3055*** used, and then restart.
3056
3057EOF
3058    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
3059      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
3060      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
3061    else
3062      ld_shlibs=no
3063    fi
3064    ;;
3065
3066  sunos4*)
3067    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
3068    wlarc=
3069    hardcode_direct=yes
3070    hardcode_shlibpath_var=no
3071    ;;
3072
3073  *)
3074    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
3075      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
3076      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
3077    else
3078      ld_shlibs=no
3079    fi
3080    ;;
3081  esac
3082
3083  if test "$ld_shlibs" = yes; then
3084    runpath_var=LD_RUN_PATH
3085    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
3086    export_dynamic_flag_spec='${wl}--export-dynamic'
3087    case $host_os in
3088    cygwin* | mingw* | pw32*)
3089      # dlltool doesn't understand --whole-archive et. al.
3090      whole_archive_flag_spec=
3091      ;;
3092    *)
3093      # ancient GNU ld didn't support --whole-archive et. al.
3094      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
3095        whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
3096      else
3097        whole_archive_flag_spec=
3098      fi
3099      ;;
3100    esac
3101  fi
3102else
3103  # PORTME fill in a description of your system's linker (not GNU ld)
3104  case $host_os in
3105  aix3*)
3106    allow_undefined_flag=unsupported
3107    always_export_symbols=yes
3108    archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
3109    # Note: this linker hardcodes the directories in LIBPATH if there
3110    # are no directories specified by -L.
3111    hardcode_minus_L=yes
3112    if test "$GCC" = yes && test -z "$link_static_flag"; then
3113      # Neither direct hardcoding nor static linking is supported with a
3114      # broken collect2.
3115      hardcode_direct=unsupported
3116    fi
3117    ;;
3118
3119  aix4* | aix5*)
3120    if test "$host_cpu" = ia64; then
3121      # On IA64, the linker does run time linking by default, so we don't
3122      # have to do anything special.
3123      aix_use_runtimelinking=no
3124      exp_sym_flag='-Bexport'
3125      no_entry_flag=""
3126    else
3127      aix_use_runtimelinking=no
3128
3129      # Test if we are trying to use run time linking or normal
3130      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
3131      # need to do runtime linking.
3132      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
3133        for ld_flag in $LDFLAGS; do
3134          case $ld_flag in
3135          *-brtl*)
3136            aix_use_runtimelinking=yes
3137            break
3138          ;;
3139          esac
3140        done
3141      esac
3142
3143      exp_sym_flag='-bexport'
3144      no_entry_flag='-bnoentry'
3145    fi
3146
3147    # When large executables or shared objects are built, AIX ld can
3148    # have problems creating the table of contents.  If linking a library
3149    # or program results in "error TOC overflow" add -mminimal-toc to
3150    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
3151    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
3152
3153    hardcode_direct=yes
3154    archive_cmds=''
3155    hardcode_libdir_separator=':'
3156    if test "$GCC" = yes; then
3157      case $host_os in aix4.[[012]]|aix4.[[012]].*)
3158        collect2name=`${CC} -print-prog-name=collect2`
3159        if test -f "$collect2name" && \
3160          strings "$collect2name" | grep resolve_lib_name >/dev/null
3161        then
3162          # We have reworked collect2
3163          hardcode_direct=yes
3164        else
3165          # We have old collect2
3166          hardcode_direct=unsupported
3167          # It fails to find uninstalled libraries when the uninstalled
3168          # path is not listed in the libpath.  Setting hardcode_minus_L
3169          # to unsupported forces relinking
3170          hardcode_minus_L=yes
3171          hardcode_libdir_flag_spec='-L$libdir'
3172          hardcode_libdir_separator=
3173        fi
3174      esac
3175
3176      shared_flag='-shared'
3177    else
3178      # not using gcc
3179      if test "$host_cpu" = ia64; then
3180        shared_flag='${wl}-G'
3181      else
3182        if test "$aix_use_runtimelinking" = yes; then
3183          shared_flag='${wl}-G'
3184        else
3185          shared_flag='${wl}-bM:SRE'
3186        fi
3187      fi
3188    fi
3189
3190    # It seems that -bexpall can do strange things, so it is better to
3191    # generate a list of symbols to export.
3192    always_export_symbols=yes
3193    if test "$aix_use_runtimelinking" = yes; then
3194      # Warning - without using the other runtime loading flags (-brtl),
3195      # -berok will link without error, but may produce a broken library.
3196      allow_undefined_flag='-berok'
3197      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
3198      archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
3199    else
3200      if test "$host_cpu" = ia64; then
3201        hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
3202        allow_undefined_flag="-z nodefs"
3203        archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
3204      else
3205        hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
3206        # Warning - without using the other run time loading flags,
3207        # -berok will link without error, but may produce a broken library.
3208        allow_undefined_flag='${wl}-berok'
3209        # This is a bit strange, but is similar to how AIX traditionally builds
3210        # it's shared libraries.
3211        archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
3212      fi
3213    fi
3214    ;;
3215
3216  amigaos*)
3217    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
3218    hardcode_libdir_flag_spec='-L$libdir'
3219    hardcode_minus_L=yes
3220    # see comment about different semantics on the GNU ld section
3221    ld_shlibs=no
3222    ;;
3223
3224  cygwin* | mingw* | pw32*)
3225    # When not using gcc, we currently assume that we are using
3226    # Microsoft Visual C++.
3227    # hardcode_libdir_flag_spec is actually meaningless, as there is
3228    # no search path for DLLs.
3229    hardcode_libdir_flag_spec=' '
3230    allow_undefined_flag=unsupported
3231    # Tell ltmain to make .lib files, not .a files.
3232    libext=lib
3233    # FIXME: Setting linknames here is a bad hack.
3234    archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
3235    # The linker will automatically build a .lib file if we build a DLL.
3236    old_archive_from_new_cmds='true'
3237    # FIXME: Should let the user specify the lib program.
3238    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
3239    fix_srcfile_path='`cygpath -w "$srcfile"`'
3240    ;;
3241
3242  darwin* | rhapsody*)
3243    case "$host_os" in
3244    rhapsody* | darwin1.[[012]])
3245      allow_undefined_flag='-undefined suppress'
3246      ;;
3247    *) # Darwin 1.3 on
3248      allow_undefined_flag='-flat_namespace -undefined suppress'
3249      ;;
3250    esac
3251    # FIXME: Relying on posixy $() will cause problems for
3252    #        cross-compilation, but unfortunately the echo tests do not
3253    #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
3254    #        `"' quotes if we put them in here... so don't!
3255    archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
3256    # We need to add '_' to the symbols in $export_symbols first
3257    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
3258    hardcode_direct=yes
3259    hardcode_shlibpath_var=no
3260    whole_archive_flag_spec='-all_load $convenience'
3261    ;;
3262
3263  freebsd1*)
3264    ld_shlibs=no
3265    ;;
3266
3267  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
3268  # support.  Future versions do this automatically, but an explicit c++rt0.o
3269  # does not break anything, and helps significantly (at the cost of a little
3270  # extra space).
3271  freebsd2.2*)
3272    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
3273    hardcode_libdir_flag_spec='-R$libdir'
3274    hardcode_direct=yes
3275    hardcode_shlibpath_var=no
3276    ;;
3277
3278  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
3279  freebsd2*)
3280    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
3281    hardcode_direct=yes
3282    hardcode_minus_L=yes
3283    hardcode_shlibpath_var=no
3284    ;;
3285
3286  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
3287  freebsd*)
3288    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
3289    hardcode_libdir_flag_spec='-R$libdir'
3290    hardcode_direct=yes
3291    hardcode_shlibpath_var=no
3292    ;;
3293
3294  hpux9* | hpux10* | hpux11*)
3295    case $host_os in
3296    hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
3297    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
3298    esac
3299    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
3300    hardcode_libdir_separator=:
3301    hardcode_direct=yes
3302    hardcode_minus_L=yes # Not in the search PATH, but as the default
3303                         # location of the library.
3304    export_dynamic_flag_spec='${wl}-E'
3305    ;;
3306
3307  irix5* | irix6* | nonstopux*)
3308    if test "$GCC" = yes; then
3309      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
3310      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
3311    else
3312      archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
3313      hardcode_libdir_flag_spec='-rpath $libdir'
3314    fi
3315    hardcode_libdir_separator=:
3316    link_all_deplibs=yes
3317    ;;
3318
3319  netbsd*)
3320    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
3321      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
3322    else
3323      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
3324    fi
3325    hardcode_libdir_flag_spec='-R$libdir'
3326    hardcode_direct=yes
3327    hardcode_shlibpath_var=no
3328    ;;
3329
3330  newsos6)
3331    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
3332    hardcode_direct=yes
3333    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
3334    hardcode_libdir_separator=:
3335    hardcode_shlibpath_var=no
3336    ;;
3337
3338  openbsd*)
3339    hardcode_direct=yes
3340    hardcode_shlibpath_var=no
3341    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3342      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
3343      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
3344      export_dynamic_flag_spec='${wl}-E'
3345    else
3346      case "$host_os" in
3347      openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
3348        archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
3349        hardcode_libdir_flag_spec='-R$libdir'
3350        ;;
3351      *)
3352        archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
3353        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
3354        ;;
3355      esac
3356    fi
3357    ;;
3358
3359  os2*)
3360    hardcode_libdir_flag_spec='-L$libdir'
3361    hardcode_minus_L=yes
3362    allow_undefined_flag=unsupported
3363    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
3364    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
3365    ;;
3366
3367  osf3*)
3368    if test "$GCC" = yes; then
3369      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
3370      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
3371    else
3372      allow_undefined_flag=' -expect_unresolved \*'
3373      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
3374    fi
3375    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
3376    hardcode_libdir_separator=:
3377    ;;
3378
3379  osf4* | osf5*)        # as osf3* with the addition of -msym flag
3380    if test "$GCC" = yes; then
3381      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
3382      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
3383      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
3384    else
3385      allow_undefined_flag=' -expect_unresolved \*'
3386      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
3387      archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
3388      $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
3389
3390      #Both c and cxx compiler support -rpath directly
3391      hardcode_libdir_flag_spec='-rpath $libdir'
3392    fi
3393    hardcode_libdir_separator=:
3394    ;;
3395
3396  sco3.2v5*)
3397    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
3398    hardcode_shlibpath_var=no
3399    runpath_var=LD_RUN_PATH
3400    hardcode_runpath_var=yes
3401    export_dynamic_flag_spec='${wl}-Bexport'
3402    ;;
3403
3404  solaris*)
3405    # gcc --version < 3.0 without binutils cannot create self contained
3406    # shared libraries reliably, requiring libgcc.a to resolve some of
3407    # the object symbols generated in some cases.  Libraries that use
3408    # assert need libgcc.a to resolve __eprintf, for example.  Linking
3409    # a copy of libgcc.a into every shared library to guarantee resolving
3410    # such symbols causes other problems:  According to Tim Van Holder
3411    # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
3412    # (to the application) exception stack for one thing.
3413    no_undefined_flag=' -z defs'
3414    if test "$GCC" = yes; then
3415      case `$CC --version 2>/dev/null` in
3416      [[12]].*)
3417        cat <<EOF 1>&2
3418
3419*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
3420*** create self contained shared libraries on Solaris systems, without
3421*** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
3422*** -no-undefined support, which will at least allow you to build shared
3423*** libraries.  However, you may find that when you link such libraries
3424*** into an application without using GCC, you have to manually add
3425*** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
3426*** upgrade to a newer version of GCC.  Another option is to rebuild your
3427*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
3428
3429EOF
3430        no_undefined_flag=
3431        ;;
3432      esac
3433    fi
3434    # $CC -shared without GNU ld will not create a library from C++
3435    # object files and a static libstdc++, better avoid it by now
3436    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
3437    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3438                $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
3439    hardcode_libdir_flag_spec='-R$libdir'
3440    hardcode_shlibpath_var=no
3441    case $host_os in
3442    solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
3443    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
3444      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
3445    esac
3446    link_all_deplibs=yes
3447    ;;
3448
3449  sunos4*)
3450    if test "x$host_vendor" = xsequent; then
3451      # Use $CC to link under sequent, because it throws in some extra .o
3452      # files that make .init and .fini sections work.
3453      archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
3454    else
3455      archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
3456    fi
3457    hardcode_libdir_flag_spec='-L$libdir'
3458    hardcode_direct=yes
3459    hardcode_minus_L=yes
3460    hardcode_shlibpath_var=no
3461    ;;
3462
3463  sysv4)
3464    case $host_vendor in
3465      sni)
3466        archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
3467        hardcode_direct=yes # is this really true???
3468        ;;
3469      siemens)
3470        ## LD is ld it makes a PLAMLIB
3471        ## CC just makes a GrossModule.
3472        archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
3473        reload_cmds='$CC -r -o $output$reload_objs'
3474        hardcode_direct=no
3475        ;;
3476      motorola)
3477        archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
3478        hardcode_direct=no #Motorola manual says yes, but my tests say they lie
3479        ;;
3480    esac
3481    runpath_var='LD_RUN_PATH'
3482    hardcode_shlibpath_var=no
3483    ;;
3484
3485  sysv4.3*)
3486    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
3487    hardcode_shlibpath_var=no
3488    export_dynamic_flag_spec='-Bexport'
3489    ;;
3490
3491  sysv5*)
3492    no_undefined_flag=' -z text'
3493    # $CC -shared without GNU ld will not create a library from C++
3494    # object files and a static libstdc++, better avoid it by now
3495    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
3496    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3497                $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
3498    hardcode_libdir_flag_spec=
3499    hardcode_shlibpath_var=no
3500    runpath_var='LD_RUN_PATH'
3501    ;;
3502
3503  uts4*)
3504    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
3505    hardcode_libdir_flag_spec='-L$libdir'
3506    hardcode_shlibpath_var=no
3507    ;;
3508
3509  dgux*)
3510    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
3511    hardcode_libdir_flag_spec='-L$libdir'
3512    hardcode_shlibpath_var=no
3513    ;;
3514
3515  sysv4*MP*)
3516    if test -d /usr/nec; then
3517      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
3518      hardcode_shlibpath_var=no
3519      runpath_var=LD_RUN_PATH
3520      hardcode_runpath_var=yes
3521      ld_shlibs=yes
3522    fi
3523    ;;
3524
3525  sysv4.2uw2*)
3526    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
3527    hardcode_direct=yes
3528    hardcode_minus_L=no
3529    hardcode_shlibpath_var=no
3530    hardcode_runpath_var=yes
3531    runpath_var=LD_RUN_PATH
3532    ;;
3533
3534  sysv5uw7* | unixware7*)
3535    no_undefined_flag='${wl}-z ${wl}text'
3536    if test "$GCC" = yes; then
3537      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
3538    else
3539      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
3540    fi
3541    runpath_var='LD_RUN_PATH'
3542    hardcode_shlibpath_var=no
3543    ;;
3544
3545  *)
3546    ld_shlibs=no
3547    ;;
3548  esac
3549fi
3550AC_MSG_RESULT([$ld_shlibs])
3551test "$ld_shlibs" = no && can_build_shared=no
3552
3553# Check hardcoding attributes.
3554AC_MSG_CHECKING([how to hardcode library paths into programs])
3555hardcode_action=
3556if test -n "$hardcode_libdir_flag_spec" || \
3557   test -n "$runpath_var"; then
3558
3559  # We can hardcode non-existant directories.
3560  if test "$hardcode_direct" != no &&
3561     # If the only mechanism to avoid hardcoding is shlibpath_var, we
3562     # have to relink, otherwise we might link with an installed library
3563     # when we should be linking with a yet-to-be-installed one
3564     ## test "$hardcode_shlibpath_var" != no &&
3565     test "$hardcode_minus_L" != no; then
3566    # Linking always hardcodes the temporary library directory.
3567    hardcode_action=relink
3568  else
3569    # We can link without hardcoding, and we can hardcode nonexisting dirs.
3570    hardcode_action=immediate
3571  fi
3572else
3573  # We cannot hardcode anything, or else we can only hardcode existing
3574  # directories.
3575  hardcode_action=unsupported
3576fi
3577AC_MSG_RESULT([$hardcode_action])
3578
3579striplib=
3580old_striplib=
3581AC_MSG_CHECKING([whether stripping libraries is possible])
3582if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
3583  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
3584  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
3585  AC_MSG_RESULT([yes])
3586else
3587  AC_MSG_RESULT([no])
3588fi
3589
3590reload_cmds='$LD$reload_flag -o $output$reload_objs'
3591test -z "$deplibs_check_method" && deplibs_check_method=unknown
3592
3593# PORTME Fill in your ld.so characteristics
3594AC_MSG_CHECKING([dynamic linker characteristics])
3595library_names_spec=
3596libname_spec='lib$name'
3597soname_spec=
3598postinstall_cmds=
3599postuninstall_cmds=
3600finish_cmds=
3601finish_eval=
3602shlibpath_var=
3603shlibpath_overrides_runpath=unknown
3604version_type=none
3605dynamic_linker="$host_os ld.so"
3606sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib"
3607sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib /usr/X11R6/lib"
3608
3609case $host_os in
3610aix3*)
3611  version_type=linux
3612  library_names_spec='${libname}${release}.so$versuffix $libname.a'
3613  shlibpath_var=LIBPATH
3614
3615  # AIX has no versioning support, so we append a major version to the name.
3616  soname_spec='${libname}${release}.so$major'
3617  ;;
3618
3619aix4* | aix5*)
3620  version_type=linux
3621  need_lib_prefix=no
3622  need_version=no
3623  hardcode_into_libs=yes
3624  if test "$host_cpu" = ia64; then
3625    # AIX 5 supports IA64
3626    library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
3627    shlibpath_var=LD_LIBRARY_PATH
3628  else
3629    # With GCC up to 2.95.x, collect2 would create an import file
3630    # for dependence libraries.  The import file would start with
3631    # the line `#! .'.  This would cause the generated library to
3632    # depend on `.', always an invalid library.  This was fixed in
3633    # development snapshots of GCC prior to 3.0.
3634    case $host_os in
3635      aix4 | aix4.[[01]] | aix4.[[01]].*)
3636        if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
3637             echo ' yes '
3638             echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
3639          :
3640        else
3641          can_build_shared=no
3642        fi
3643        ;;
3644    esac
3645    # AIX (on Power*) has no versioning support, so currently we can
3646    # not hardcode correct soname into executable. Probably we can
3647    # add versioning support to collect2, so additional links can
3648    # be useful in future.
3649    if test "$aix_use_runtimelinking" = yes; then
3650      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
3651      # instead of lib<name>.a to let people know that these are not
3652      # typical AIX shared libraries.
3653      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3654    else
3655      # We preserve .a as extension for shared libraries through AIX4.2
3656      # and later when we are not doing run time linking.
3657      library_names_spec='${libname}${release}.a $libname.a'
3658      soname_spec='${libname}${release}.so$major'
3659    fi
3660    shlibpath_var=LIBPATH
3661  fi
3662  hardcode_into_libs=yes
3663  ;;
3664
3665amigaos*)
3666  library_names_spec='$libname.ixlibrary $libname.a'
3667  # Create ${libname}_ixlibrary.a entries in /sys/libs.
3668  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
3669  ;;
3670
3671beos*)
3672  library_names_spec='${libname}.so'
3673  dynamic_linker="$host_os ld.so"
3674  shlibpath_var=LIBRARY_PATH
3675  ;;
3676
3677bsdi4*)
3678  version_type=linux
3679  need_version=no
3680  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3681  soname_spec='${libname}${release}.so$major'
3682  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3683  shlibpath_var=LD_LIBRARY_PATH
3684  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3685  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
3686  export_dynamic_flag_spec=-rdynamic
3687  # the default ld.so.conf also contains /usr/contrib/lib and
3688  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3689  # libtool to hard-code these into programs
3690  ;;
3691
3692cygwin* | mingw* | pw32*)
3693  version_type=windows
3694  need_version=no
3695  need_lib_prefix=no
3696  case $GCC,$host_os in
3697  yes,cygwin*)
3698    library_names_spec='$libname.dll.a'
3699    soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
3700    postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
3701      dldir=$destdir/`dirname \$dlpath`~
3702      test -d \$dldir || mkdir -p \$dldir~
3703      $install_prog .libs/$dlname \$dldir/$dlname'
3704    postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
3705      dlpath=$dir/\$dldll~
3706       $rm \$dlpath'
3707    ;;
3708  yes,mingw*)
3709    library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
3710    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
3711    ;;
3712  yes,pw32*)
3713    library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
3714    ;;
3715  *)
3716    library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
3717    ;;
3718  esac
3719  dynamic_linker='Win32 ld.exe'
3720  # FIXME: first we should search . and the directory the executable is in
3721  shlibpath_var=PATH
3722  ;;
3723
3724darwin* | rhapsody*)
3725  dynamic_linker="$host_os dyld"
3726  version_type=darwin
3727  need_lib_prefix=no
3728  need_version=no
3729  # FIXME: Relying on posixy $() will cause problems for
3730  #        cross-compilation, but unfortunately the echo tests do not
3731  #        yet detect zsh echo's removal of \ escapes.
3732  library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
3733  soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
3734  shlibpath_overrides_runpath=yes
3735  shlibpath_var=DYLD_LIBRARY_PATH
3736  ;;
3737
3738freebsd1*)
3739  dynamic_linker=no
3740  ;;
3741
3742freebsd*)
3743  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
3744  version_type=freebsd-$objformat
3745  case $version_type in
3746    freebsd-elf*)
3747      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
3748      need_version=no
3749      need_lib_prefix=no
3750      ;;
3751    freebsd-*)
3752      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
3753      need_version=yes
3754      ;;
3755  esac
3756  shlibpath_var=LD_LIBRARY_PATH
3757  case $host_os in
3758  freebsd2*)
3759    shlibpath_overrides_runpath=yes
3760    ;;
3761  *)
3762    shlibpath_overrides_runpath=no
3763    hardcode_into_libs=yes
3764    ;;
3765  esac
3766  ;;
3767
3768gnu*)
3769  version_type=linux
3770  need_lib_prefix=no
3771  need_version=no
3772  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
3773  soname_spec='${libname}${release}.so$major'
3774  shlibpath_var=LD_LIBRARY_PATH
3775  hardcode_into_libs=yes
3776  ;;
3777
3778hpux9* | hpux10* | hpux11*)
3779  # Give a soname corresponding to the major version so that dld.sl refuses to
3780  # link against other versions.
3781  dynamic_linker="$host_os dld.sl"
3782  version_type=sunos
3783  need_lib_prefix=no
3784  need_version=no
3785  shlibpath_var=SHLIB_PATH
3786  shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3787  library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
3788  soname_spec='${libname}${release}.sl$major'
3789  # HP-UX runs *really* slowly unless shared libraries are mode 555.
3790  postinstall_cmds='chmod 555 $lib'
3791  ;;
3792
3793irix5* | irix6* | nonstopux*)
3794  case $host_os in
3795    nonstopux*) version_type=nonstopux ;;
3796    *)          version_type=irix ;;
3797  esac
3798  need_lib_prefix=no
3799  need_version=no
3800  soname_spec='${libname}${release}.so$major'
3801  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
3802  case $host_os in
3803  irix5* | nonstopux*)
3804    libsuff= shlibsuff=
3805    ;;
3806  *)
3807    case $LD in # libtool.m4 will add one of these switches to LD
3808    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
3809    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
3810    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
3811    *) libsuff= shlibsuff= libmagic=never-match;;
3812    esac
3813    ;;
3814  esac
3815  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3816  shlibpath_overrides_runpath=no
3817  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3818  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3819  ;;
3820
3821# No shared lib support for Linux oldld, aout, or coff.
3822linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
3823  dynamic_linker=no
3824  ;;
3825
3826# This must be Linux ELF.
3827linux-gnu*)
3828  version_type=linux
3829  need_lib_prefix=no
3830  need_version=no
3831  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3832  soname_spec='${libname}${release}.so$major'
3833  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3834  shlibpath_var=LD_LIBRARY_PATH
3835  shlibpath_overrides_runpath=no
3836  # This implies no fast_install, which is unacceptable.
3837  # Some rework will be needed to allow for fast_install
3838  # before this can be enabled.
3839  hardcode_into_libs=yes
3840
3841  case $host_cpu:$lt_cv_cc_64bit_output in
3842  powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
3843    sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64"
3844    sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64"
3845    ;;
3846  esac
3847
3848  # We used to test for /lib/ld.so.1 and disable shared libraries on
3849  # powerpc, because MkLinux only supported shared libraries with the
3850  # GNU dynamic linker.  Since this was broken with cross compilers,
3851  # most powerpc-linux boxes support dynamic linking these days and
3852  # people can always --disable-shared, the test was removed, and we
3853  # assume the GNU/Linux dynamic linker is in use.
3854  dynamic_linker='GNU/Linux ld.so'
3855
3856  # Find out which ABI we are using (multilib Linux x86_64 hack).
3857  libsuff=
3858  case "$host_cpu" in
3859  x86_64*)
3860    echo '[#]line __oline__ "configure"' > conftest.$ac_ext
3861    if AC_TRY_EVAL(ac_compile); then
3862      case `/usr/bin/file conftest.$ac_objext` in
3863      *64-bit*)
3864        libsuff=64
3865        ;;
3866      esac
3867    fi
3868    rm -rf conftest*
3869    ;;
3870  *)
3871    ;;
3872  esac
3873  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
3874  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
3875  ;;
3876
3877netbsd*)
3878  version_type=sunos
3879  need_lib_prefix=no
3880  need_version=no
3881  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
3882    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
3883    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3884    dynamic_linker='NetBSD (a.out) ld.so'
3885  else
3886    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
3887    soname_spec='${libname}${release}.so$major'
3888    dynamic_linker='NetBSD ld.elf_so'
3889  fi
3890  shlibpath_var=LD_LIBRARY_PATH
3891  shlibpath_overrides_runpath=yes
3892  hardcode_into_libs=yes
3893  ;;
3894
3895newsos6)
3896  version_type=linux
3897  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3898  shlibpath_var=LD_LIBRARY_PATH
3899  shlibpath_overrides_runpath=yes
3900  ;;
3901
3902openbsd*)
3903  version_type=sunos
3904  need_lib_prefix=no
3905  need_version=no
3906  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3907    case "$host_os" in
3908    openbsd2.[[89]] | openbsd2.[[89]].*)
3909      shlibpath_overrides_runpath=no
3910      ;;
3911    *)
3912      shlibpath_overrides_runpath=yes
3913      ;;
3914    esac
3915  else
3916    shlibpath_overrides_runpath=yes
3917  fi
3918  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
3919  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3920  shlibpath_var=LD_LIBRARY_PATH
3921  ;;
3922
3923os2*)
3924  libname_spec='$name'
3925  need_lib_prefix=no
3926  library_names_spec='$libname.dll $libname.a'
3927  dynamic_linker='OS/2 ld.exe'
3928  shlibpath_var=LIBPATH
3929  ;;
3930
3931osf3* | osf4* | osf5*)
3932  version_type=osf
3933  need_version=no
3934  soname_spec='${libname}${release}.so$major'
3935  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3936  shlibpath_var=LD_LIBRARY_PATH
3937  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3938  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3939  hardcode_into_libs=yes
3940  ;;
3941
3942sco3.2v5*)
3943  version_type=osf
3944  soname_spec='${libname}${release}.so$major'
3945  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3946  shlibpath_var=LD_LIBRARY_PATH
3947  ;;
3948
3949solaris*)
3950  version_type=linux
3951  need_lib_prefix=no
3952  need_version=no
3953  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3954  soname_spec='${libname}${release}.so$major'
3955  shlibpath_var=LD_LIBRARY_PATH
3956  shlibpath_overrides_runpath=yes
3957  hardcode_into_libs=yes
3958  # ldd complains unless libraries are executable
3959  postinstall_cmds='chmod +x $lib'
3960  ;;
3961
3962sunos4*)
3963  version_type=sunos
3964  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
3965  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3966  shlibpath_var=LD_LIBRARY_PATH
3967  shlibpath_overrides_runpath=yes
3968  if test "$with_gnu_ld" = yes; then
3969    need_lib_prefix=no
3970  fi
3971  need_version=yes
3972  ;;
3973
3974sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3975  version_type=linux
3976  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3977  soname_spec='${libname}${release}.so$major'
3978  shlibpath_var=LD_LIBRARY_PATH
3979  case $host_vendor in
3980    sni)
3981      shlibpath_overrides_runpath=no
3982      need_lib_prefix=no
3983      export_dynamic_flag_spec='${wl}-Blargedynsym'
3984      runpath_var=LD_RUN_PATH
3985      ;;
3986    siemens)
3987      need_lib_prefix=no
3988      ;;
3989    motorola)
3990      need_lib_prefix=no
3991      need_version=no
3992      shlibpath_overrides_runpath=no
3993      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3994      ;;
3995  esac
3996  ;;
3997
3998uts4*)
3999  version_type=linux
4000  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
4001  soname_spec='${libname}${release}.so$major'
4002  shlibpath_var=LD_LIBRARY_PATH
4003  ;;
4004
4005dgux*)
4006  version_type=linux
4007  need_lib_prefix=no
4008  need_version=no
4009  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
4010  soname_spec='${libname}${release}.so$major'
4011  shlibpath_var=LD_LIBRARY_PATH
4012  ;;
4013
4014sysv4*MP*)
4015  if test -d /usr/nec ;then
4016    version_type=linux
4017    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
4018    soname_spec='$libname.so.$major'
4019    shlibpath_var=LD_LIBRARY_PATH
4020  fi
4021  ;;
4022
4023*)
4024  dynamic_linker=no
4025  ;;
4026esac
4027AC_MSG_RESULT([$dynamic_linker])
4028test "$dynamic_linker" = no && can_build_shared=no
4029
4030# Report the final consequences.
4031AC_MSG_CHECKING([if libtool supports shared libraries])
4032AC_MSG_RESULT([$can_build_shared])
4033
4034AC_MSG_CHECKING([whether to build shared libraries])
4035test "$can_build_shared" = "no" && enable_shared=no
4036
4037# On AIX, shared libraries and static libraries use the same namespace, and
4038# are all built from PIC.
4039case "$host_os" in
4040aix3*)
4041  test "$enable_shared" = yes && enable_static=no
4042  if test -n "$RANLIB"; then
4043    archive_cmds="$archive_cmds~\$RANLIB \$lib"
4044    postinstall_cmds='$RANLIB $lib'
4045  fi
4046  ;;
4047
4048aix4*)
4049  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
4050    test "$enable_shared" = yes && enable_static=no
4051  fi
4052  ;;
4053esac
4054AC_MSG_RESULT([$enable_shared])
4055
4056AC_MSG_CHECKING([whether to build static libraries])
4057# Make sure either enable_shared or enable_static is yes.
4058test "$enable_shared" = yes || enable_static=yes
4059AC_MSG_RESULT([$enable_static])
4060
4061if test "$hardcode_action" = relink; then
4062  # Fast installation is not supported
4063  enable_fast_install=no
4064elif test "$shlibpath_overrides_runpath" = yes ||
4065     test "$enable_shared" = no; then
4066  # Fast installation is not necessary
4067  enable_fast_install=needless
4068fi
4069
4070variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
4071if test "$GCC" = yes; then
4072  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
4073fi
4074
4075AC_LIBTOOL_DLOPEN_SELF
4076
4077if test "$enable_shared" = yes && test "$GCC" = yes; then
4078  case $archive_cmds in
4079  *'~'*)
4080    # FIXME: we may have to deal with multi-command sequences.
4081    ;;
4082  '$CC '*)
4083    # Test whether the compiler implicitly links with -lc since on some
4084    # systems, -lgcc has to come before -lc. If gcc already passes -lc
4085    # to ld, don't add -lc before -lgcc.
4086    AC_MSG_CHECKING([whether -lc should be explicitly linked in])
4087    AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
4088    [$rm conftest*
4089    echo 'static int dummy;' > conftest.$ac_ext
4090
4091    if AC_TRY_EVAL(ac_compile); then
4092      soname=conftest
4093      lib=conftest
4094      libobjs=conftest.$ac_objext
4095      deplibs=
4096      wl=$lt_cv_prog_cc_wl
4097      compiler_flags=-v
4098      linker_flags=-v
4099      verstring=
4100      output_objdir=.
4101      libname=conftest
4102      save_allow_undefined_flag=$allow_undefined_flag
4103      allow_undefined_flag=
4104      if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
4105      then
4106        lt_cv_archive_cmds_need_lc=no
4107      else
4108        lt_cv_archive_cmds_need_lc=yes
4109      fi
4110      allow_undefined_flag=$save_allow_undefined_flag
4111    else
4112      cat conftest.err 1>&5
4113    fi])
4114    AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
4115    ;;
4116  esac
4117fi
4118need_lc=${lt_cv_archive_cmds_need_lc-yes}
4119
4120# The second clause should only fire when bootstrapping the
4121# libtool distribution, otherwise you forgot to ship ltmain.sh
4122# with your package, and you will get complaints that there are
4123# no rules to generate ltmain.sh.
4124if test -f "$ltmain"; then
4125  :
4126else
4127  # If there is no Makefile yet, we rely on a make rule to execute
4128  # `config.status --recheck' to rerun these tests and create the
4129  # libtool script then.
4130  test -f Makefile && make "$ltmain"
4131fi
4132
4133if test -f "$ltmain"; then
4134  trap "$rm \"${ofile}T\"; exit 1" 1 2 15
4135  $rm -f "${ofile}T"
4136
4137  echo creating $ofile
4138
4139  # Now quote all the things that may contain metacharacters while being
4140  # careful not to overquote the AC_SUBSTed values.  We take copies of the
4141  # variables and quote the copies for generation of the libtool script.
4142  for var in echo old_CC old_CFLAGS SED \
4143    AR AR_FLAGS CC LD LN_S NM SHELL \
4144    reload_flag reload_cmds wl \
4145    pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
4146    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
4147    library_names_spec soname_spec \
4148    RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
4149    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
4150    postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
4151    old_striplib striplib file_magic_cmd export_symbols_cmds \
4152    deplibs_check_method allow_undefined_flag no_undefined_flag \
4153    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
4154    global_symbol_to_c_name_address \
4155    hardcode_libdir_flag_spec hardcode_libdir_separator  \
4156    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
4157    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
4158
4159    case $var in
4160    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
4161    old_postinstall_cmds | old_postuninstall_cmds | \
4162    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
4163    extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
4164    postinstall_cmds | postuninstall_cmds | \
4165    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
4166      # Double-quote double-evaled strings.
4167      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
4168      ;;
4169    *)
4170      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
4171      ;;
4172    esac
4173  done
4174
4175  cat <<__EOF__ > "${ofile}T"
4176#! $SHELL
4177
4178# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
4179# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
4180# NOTE: Changes made to this file will be lost: look at ltmain.sh.
4181#
4182# Copyright (C) 1996-2000 Free Software Foundation, Inc.
4183# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4184#
4185# This program is free software; you can redistribute it and/or modify
4186# it under the terms of the GNU General Public License as published by
4187# the Free Software Foundation; either version 2 of the License, or
4188# (at your option) any later version.
4189#
4190# This program is distributed in the hope that it will be useful, but
4191# WITHOUT ANY WARRANTY; without even the implied warranty of
4192# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4193# General Public License for more details.
4194#
4195# You should have received a copy of the GNU General Public License
4196# along with this program; if not, write to the Free Software
4197# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
4198#
4199# As a special exception to the GNU General Public License, if you
4200# distribute this file as part of a program that contains a
4201# configuration script generated by Autoconf, you may include it under
4202# the same distribution terms that you use for the rest of that program.
4203
4204# A sed that does not truncate output.
4205SED=$lt_SED
4206
4207# Sed that helps us avoid accidentally triggering echo(1) options like -n.
4208Xsed="${SED} -e s/^X//"
4209
4210# The HP-UX ksh and POSIX shell print the target directory to stdout
4211# if CDPATH is set.
4212if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
4213
4214# ### BEGIN LIBTOOL CONFIG
4215
4216# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
4217
4218# Shell to use when invoking shell scripts.
4219SHELL=$lt_SHELL
4220
4221# Whether or not to build shared libraries.
4222build_libtool_libs=$enable_shared
4223
4224# Whether or not to build static libraries.
4225build_old_libs=$enable_static
4226
4227# Whether or not to add -lc for building shared libraries.
4228build_libtool_need_lc=$need_lc
4229
4230# Whether or not to optimize for fast installation.
4231fast_install=$enable_fast_install
4232
4233# The host system.
4234host_alias=$host_alias
4235host=$host
4236
4237# An echo program that does not interpret backslashes.
4238echo=$lt_echo
4239
4240# The archiver.
4241AR=$lt_AR
4242AR_FLAGS=$lt_AR_FLAGS
4243
4244# The default C compiler.
4245CC=$lt_CC
4246
4247# Is the compiler the GNU C compiler?
4248with_gcc=$GCC
4249
4250# The linker used to build libraries.
4251LD=$lt_LD
4252
4253# Whether we need hard or soft links.
4254LN_S=$lt_LN_S
4255
4256# A BSD-compatible nm program.
4257NM=$lt_NM
4258
4259# A symbol stripping program
4260STRIP=$STRIP
4261
4262# Used to examine libraries when file_magic_cmd begins "file"
4263MAGIC_CMD=$MAGIC_CMD
4264
4265# Used on cygwin: DLL creation program.
4266DLLTOOL="$DLLTOOL"
4267
4268# Used on cygwin: object dumper.
4269OBJDUMP="$OBJDUMP"
4270
4271# Used on cygwin: assembler.
4272AS="$AS"
4273
4274# The name of the directory that contains temporary libtool files.
4275objdir=$objdir
4276
4277# How to create reloadable object files.
4278reload_flag=$lt_reload_flag
4279reload_cmds=$lt_reload_cmds
4280
4281# How to pass a linker flag through the compiler.
4282wl=$lt_wl
4283
4284# Object file suffix (normally "o").
4285objext="$ac_objext"
4286
4287# Old archive suffix (normally "a").
4288libext="$libext"
4289
4290# Executable file suffix (normally "").
4291exeext="$exeext"
4292
4293# Additional compiler flags for building library objects.
4294pic_flag=$lt_pic_flag
4295pic_mode=$pic_mode
4296
4297# Does compiler simultaneously support -c and -o options?
4298compiler_c_o=$lt_compiler_c_o
4299
4300# Can we write directly to a .lo ?
4301compiler_o_lo=$lt_compiler_o_lo
4302
4303# Must we lock files when doing compilation ?
4304need_locks=$lt_need_locks
4305
4306# Do we need the lib prefix for modules?
4307need_lib_prefix=$need_lib_prefix
4308
4309# Do we need a version for libraries?
4310need_version=$need_version
4311
4312# Whether dlopen is supported.
4313dlopen_support=$enable_dlopen
4314
4315# Whether dlopen of programs is supported.
4316dlopen_self=$enable_dlopen_self
4317
4318# Whether dlopen of statically linked programs is supported.
4319dlopen_self_static=$enable_dlopen_self_static
4320
4321# Compiler flag to prevent dynamic linking.
4322link_static_flag=$lt_link_static_flag
4323
4324# Compiler flag to turn off builtin functions.
4325no_builtin_flag=$lt_no_builtin_flag
4326
4327# Compiler flag to allow reflexive dlopens.
4328export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
4329
4330# Compiler flag to generate shared objects directly from archives.
4331whole_archive_flag_spec=$lt_whole_archive_flag_spec
4332
4333# Compiler flag to generate thread-safe objects.
4334thread_safe_flag_spec=$lt_thread_safe_flag_spec
4335
4336# Library versioning type.
4337version_type=$version_type
4338
4339# Format of library name prefix.
4340libname_spec=$lt_libname_spec
4341
4342# List of archive names.  First name is the real one, the rest are links.
4343# The last name is the one that the linker finds with -lNAME.
4344library_names_spec=$lt_library_names_spec
4345
4346# The coded name of the library, if different from the real name.
4347soname_spec=$lt_soname_spec
4348
4349# Commands used to build and install an old-style archive.
4350RANLIB=$lt_RANLIB
4351old_archive_cmds=$lt_old_archive_cmds
4352old_postinstall_cmds=$lt_old_postinstall_cmds
4353old_postuninstall_cmds=$lt_old_postuninstall_cmds
4354
4355# Create an old-style archive from a shared archive.
4356old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
4357
4358# Create a temporary old-style archive to link instead of a shared archive.
4359old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
4360
4361# Commands used to build and install a shared archive.
4362archive_cmds=$lt_archive_cmds
4363archive_expsym_cmds=$lt_archive_expsym_cmds
4364postinstall_cmds=$lt_postinstall_cmds
4365postuninstall_cmds=$lt_postuninstall_cmds
4366
4367# Commands to strip libraries.
4368old_striplib=$lt_old_striplib
4369striplib=$lt_striplib
4370
4371# Method to check whether dependent libraries are shared objects.
4372deplibs_check_method=$lt_deplibs_check_method
4373
4374# Command to use when deplibs_check_method == file_magic.
4375file_magic_cmd=$lt_file_magic_cmd
4376
4377# Flag that allows shared libraries with undefined symbols to be built.
4378allow_undefined_flag=$lt_allow_undefined_flag
4379
4380# Flag that forces no undefined symbols.
4381no_undefined_flag=$lt_no_undefined_flag
4382
4383# Commands used to finish a libtool library installation in a directory.
4384finish_cmds=$lt_finish_cmds
4385
4386# Same as above, but a single script fragment to be evaled but not shown.
4387finish_eval=$lt_finish_eval
4388
4389# Take the output of nm and produce a listing of raw symbols and C names.
4390global_symbol_pipe=$lt_global_symbol_pipe
4391
4392# Transform the output of nm in a proper C declaration
4393global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
4394
4395# Transform the output of nm in a C name address pair
4396global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
4397
4398# This is the shared library runtime path variable.
4399runpath_var=$runpath_var
4400
4401# This is the shared library path variable.
4402shlibpath_var=$shlibpath_var
4403
4404# Is shlibpath searched before the hard-coded library search path?
4405shlibpath_overrides_runpath=$shlibpath_overrides_runpath
4406
4407# How to hardcode a shared library path into an executable.
4408hardcode_action=$hardcode_action
4409
4410# Whether we should hardcode library paths into libraries.
4411hardcode_into_libs=$hardcode_into_libs
4412
4413# Flag to hardcode \$libdir into a binary during linking.
4414# This must work even if \$libdir does not exist.
4415hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
4416
4417# Whether we need a single -rpath flag with a separated argument.
4418hardcode_libdir_separator=$lt_hardcode_libdir_separator
4419
4420# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
4421# resulting binary.
4422hardcode_direct=$hardcode_direct
4423
4424# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
4425# resulting binary.
4426hardcode_minus_L=$hardcode_minus_L
4427
4428# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
4429# the resulting binary.
4430hardcode_shlibpath_var=$hardcode_shlibpath_var
4431
4432# Variables whose values should be saved in libtool wrapper scripts and
4433# restored at relink time.
4434variables_saved_for_relink="$variables_saved_for_relink"
4435
4436# Whether libtool must link a program against all its dependency libraries.
4437link_all_deplibs=$link_all_deplibs
4438
4439# Compile-time system search path for libraries
4440sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
4441
4442# Run-time system search path for libraries
4443sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
4444
4445# Fix the shell variable \$srcfile for the compiler.
4446fix_srcfile_path="$fix_srcfile_path"
4447
4448# Set to yes if exported symbols are required.
4449always_export_symbols=$always_export_symbols
4450
4451# The commands to list exported symbols.
4452export_symbols_cmds=$lt_export_symbols_cmds
4453
4454# The commands to extract the exported symbol list from a shared archive.
4455extract_expsyms_cmds=$lt_extract_expsyms_cmds
4456
4457# Symbols that should not be listed in the preloaded symbols.
4458exclude_expsyms=$lt_exclude_expsyms
4459
4460# Symbols that must always be exported.
4461include_expsyms=$lt_include_expsyms
4462
4463# ### END LIBTOOL CONFIG
4464
4465__EOF__
4466
4467  case $host_os in
4468  aix3*)
4469    cat <<\EOF >> "${ofile}T"
4470
4471# AIX sometimes has problems with the GCC collect2 program.  For some
4472# reason, if we set the COLLECT_NAMES environment variable, the problems
4473# vanish in a puff of smoke.
4474if test "X${COLLECT_NAMES+set}" != Xset; then
4475  COLLECT_NAMES=
4476  export COLLECT_NAMES
4477fi
4478EOF
4479    ;;
4480  esac
4481
4482  case $host_os in
4483  cygwin* | mingw* | pw32* | os2*)
4484    cat <<'EOF' >> "${ofile}T"
4485      # This is a source program that is used to create dlls on Windows
4486      # Don't remove nor modify the starting and closing comments
4487# /* ltdll.c starts here */
4488# #define WIN32_LEAN_AND_MEAN
4489# #include <windows.h>
4490# #undef WIN32_LEAN_AND_MEAN
4491# #include <stdio.h>
4492#
4493# #ifndef __CYGWIN__
4494# #  ifdef __CYGWIN32__
4495# #    define __CYGWIN__ __CYGWIN32__
4496# #  endif
4497# #endif
4498#
4499# #ifdef __cplusplus
4500# extern "C" {
4501# #endif
4502# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
4503# #ifdef __cplusplus
4504# }
4505# #endif
4506#
4507# #ifdef __CYGWIN__
4508# #include <cygwin/cygwin_dll.h>
4509# DECLARE_CYGWIN_DLL( DllMain );
4510# #endif
4511# HINSTANCE __hDllInstance_base;
4512#
4513# BOOL APIENTRY
4514# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
4515# {
4516#   __hDllInstance_base = hInst;
4517#   return TRUE;
4518# }
4519# /* ltdll.c ends here */
4520        # This is a source program that is used to create import libraries
4521        # on Windows for dlls which lack them. Don't remove nor modify the
4522        # starting and closing comments
4523# /* impgen.c starts here */
4524# /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
4525#
4526#  This file is part of GNU libtool.
4527#
4528#  This program is free software; you can redistribute it and/or modify
4529#  it under the terms of the GNU General Public License as published by
4530#  the Free Software Foundation; either version 2 of the License, or
4531#  (at your option) any later version.
4532#
4533#  This program is distributed in the hope that it will be useful,
4534#  but WITHOUT ANY WARRANTY; without even the implied warranty of
4535#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4536#  GNU General Public License for more details.
4537#
4538#  You should have received a copy of the GNU General Public License
4539#  along with this program; if not, write to the Free Software
4540#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
4541#  */
4542#
4543# #include <stdio.h>            /* for printf() */
4544# #include <unistd.h>           /* for open(), lseek(), read() */
4545# #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
4546# #include <string.h>           /* for strdup() */
4547#
4548# /* O_BINARY isn't required (or even defined sometimes) under Unix */
4549# #ifndef O_BINARY
4550# #define O_BINARY 0
4551# #endif
4552#
4553# static unsigned int
4554# pe_get16 (fd, offset)
4555#      int fd;
4556#      int offset;
4557# {
4558#   unsigned char b[2];
4559#   lseek (fd, offset, SEEK_SET);
4560#   read (fd, b, 2);
4561#   return b[0] + (b[1]<<8);
4562# }
4563#
4564# static unsigned int
4565# pe_get32 (fd, offset)
4566#     int fd;
4567#     int offset;
4568# {
4569#   unsigned char b[4];
4570#   lseek (fd, offset, SEEK_SET);
4571#   read (fd, b, 4);
4572#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
4573# }
4574#
4575# static unsigned int
4576# pe_as32 (ptr)
4577#      void *ptr;
4578# {
4579#   unsigned char *b = ptr;
4580#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
4581# }
4582#
4583# int
4584# main (argc, argv)
4585#     int argc;
4586#     char *argv[];
4587# {
4588#     int dll;
4589#     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
4590#     unsigned long export_rva, export_size, nsections, secptr, expptr;
4591#     unsigned long name_rvas, nexp;
4592#     unsigned char *expdata, *erva;
4593#     char *filename, *dll_name;
4594#
4595#     filename = argv[1];
4596#
4597#     dll = open(filename, O_RDONLY|O_BINARY);
4598#     if (dll < 1)
4599#       return 1;
4600#
4601#     dll_name = filename;
4602#
4603#     for (i=0; filename[i]; i++)
4604#       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
4605#           dll_name = filename + i +1;
4606#
4607#     pe_header_offset = pe_get32 (dll, 0x3c);
4608#     opthdr_ofs = pe_header_offset + 4 + 20;
4609#     num_entries = pe_get32 (dll, opthdr_ofs + 92);
4610#
4611#     if (num_entries < 1) /* no exports */
4612#       return 1;
4613#
4614#     export_rva = pe_get32 (dll, opthdr_ofs + 96);
4615#     export_size = pe_get32 (dll, opthdr_ofs + 100);
4616#     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
4617#     secptr = (pe_header_offset + 4 + 20 +
4618#             pe_get16 (dll, pe_header_offset + 4 + 16));
4619#
4620#     expptr = 0;
4621#     for (i = 0; i < nsections; i++)
4622#     {
4623#       char sname[8];
4624#       unsigned long secptr1 = secptr + 40 * i;
4625#       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
4626#       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
4627#       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
4628#       lseek(dll, secptr1, SEEK_SET);
4629#       read(dll, sname, 8);
4630#       if (vaddr <= export_rva && vaddr+vsize > export_rva)
4631#       {
4632#           expptr = fptr + (export_rva - vaddr);
4633#           if (export_rva + export_size > vaddr + vsize)
4634#               export_size = vsize - (export_rva - vaddr);
4635#           break;
4636#       }
4637#     }
4638#
4639#     expdata = (unsigned char*)malloc(export_size);
4640#     lseek (dll, expptr, SEEK_SET);
4641#     read (dll, expdata, export_size);
4642#     erva = expdata - export_rva;
4643#
4644#     nexp = pe_as32 (expdata+24);
4645#     name_rvas = pe_as32 (expdata+32);
4646#
4647#     printf ("EXPORTS\n");
4648#     for (i = 0; i<nexp; i++)
4649#     {
4650#       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
4651#       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
4652#     }
4653#
4654#     return 0;
4655# }
4656# /* impgen.c ends here */
4657
4658EOF
4659    ;;
4660  esac
4661
4662  # We use sed instead of cat because bash on DJGPP gets confused if
4663  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
4664  # text mode, it properly converts lines to CR/LF.  This bash problem
4665  # is reportedly fixed, but why not run on old versions too?
4666  sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
4667
4668  mv -f "${ofile}T" "$ofile" || \
4669    (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
4670  chmod +x "$ofile"
4671fi
4672
4673])# _LT_AC_LTCONFIG_HACK
4674
4675# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
4676AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
4677
4678# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
4679AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
4680
4681# AC_ENABLE_SHARED - implement the --enable-shared flag
4682# Usage: AC_ENABLE_SHARED[(DEFAULT)]
4683#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
4684#   `yes'.
4685AC_DEFUN([AC_ENABLE_SHARED],
4686[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
4687AC_ARG_ENABLE(shared,
4688changequote(<<, >>)dnl
4689<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
4690changequote([, ])dnl
4691[p=${PACKAGE-default}
4692case $enableval in
4693yes) enable_shared=yes ;;
4694no) enable_shared=no ;;
4695*)
4696  enable_shared=no
4697  # Look at the argument we got.  We use all the common list separators.
4698  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
4699  for pkg in $enableval; do
4700    if test "X$pkg" = "X$p"; then
4701      enable_shared=yes
4702    fi
4703  done
4704  IFS="$ac_save_ifs"
4705  ;;
4706esac],
4707enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
4708])
4709
4710# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
4711AC_DEFUN([AC_DISABLE_SHARED],
4712[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4713AC_ENABLE_SHARED(no)])
4714
4715# AC_ENABLE_STATIC - implement the --enable-static flag
4716# Usage: AC_ENABLE_STATIC[(DEFAULT)]
4717#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
4718#   `yes'.
4719AC_DEFUN([AC_ENABLE_STATIC],
4720[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
4721AC_ARG_ENABLE(static,
4722changequote(<<, >>)dnl
4723<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
4724changequote([, ])dnl
4725[p=${PACKAGE-default}
4726case $enableval in
4727yes) enable_static=yes ;;
4728no) enable_static=no ;;
4729*)
4730  enable_static=no
4731  # Look at the argument we got.  We use all the common list separators.
4732  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
4733  for pkg in $enableval; do
4734    if test "X$pkg" = "X$p"; then
4735      enable_static=yes
4736    fi
4737  done
4738  IFS="$ac_save_ifs"
4739  ;;
4740esac],
4741enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
4742])
4743
4744# AC_DISABLE_STATIC - set the default static flag to --disable-static
4745AC_DEFUN([AC_DISABLE_STATIC],
4746[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4747AC_ENABLE_STATIC(no)])
4748
4749
4750# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
4751# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
4752#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
4753#   `yes'.
4754AC_DEFUN([AC_ENABLE_FAST_INSTALL],
4755[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
4756AC_ARG_ENABLE(fast-install,
4757changequote(<<, >>)dnl
4758<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
4759changequote([, ])dnl
4760[p=${PACKAGE-default}
4761case $enableval in
4762yes) enable_fast_install=yes ;;
4763no) enable_fast_install=no ;;
4764*)
4765  enable_fast_install=no
4766  # Look at the argument we got.  We use all the common list separators.
4767  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
4768  for pkg in $enableval; do
4769    if test "X$pkg" = "X$p"; then
4770      enable_fast_install=yes
4771    fi
4772  done
4773  IFS="$ac_save_ifs"
4774  ;;
4775esac],
4776enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
4777])
4778
4779# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
4780AC_DEFUN([AC_DISABLE_FAST_INSTALL],
4781[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4782AC_ENABLE_FAST_INSTALL(no)])
4783
4784# AC_LIBTOOL_PICMODE - implement the --with-pic flag
4785# Usage: AC_LIBTOOL_PICMODE[(MODE)]
4786#   Where MODE is either `yes' or `no'.  If omitted, it defaults to
4787#   `both'.
4788AC_DEFUN([AC_LIBTOOL_PICMODE],
4789[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4790pic_mode=ifelse($#,1,$1,default)])
4791
4792
4793# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
4794AC_DEFUN([AC_PATH_TOOL_PREFIX],
4795[AC_MSG_CHECKING([for $1])
4796AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
4797[case $MAGIC_CMD in
4798  /*)
4799  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4800  ;;
4801  ?:/*)
4802  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4803  ;;
4804  *)
4805  ac_save_MAGIC_CMD="$MAGIC_CMD"
4806  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4807dnl $ac_dummy forces splitting on constant user-supplied paths.
4808dnl POSIX.2 word splitting is done only on the output of word expansions,
4809dnl not every word.  This closes a longstanding sh security hole.
4810  ac_dummy="ifelse([$2], , $PATH, [$2])"
4811  for ac_dir in $ac_dummy; do
4812    test -z "$ac_dir" && ac_dir=.
4813    if test -f $ac_dir/$1; then
4814      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
4815      if test -n "$file_magic_test_file"; then
4816        case $deplibs_check_method in
4817        "file_magic "*)
4818          file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4819          MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4820          if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4821            egrep "$file_magic_regex" > /dev/null; then
4822            :
4823          else
4824            cat <<EOF 1>&2
4825
4826*** Warning: the command libtool uses to detect shared libraries,
4827*** $file_magic_cmd, produces output that libtool cannot recognize.
4828*** The result is that libtool may fail to recognize shared libraries
4829*** as such.  This will affect the creation of libtool libraries that
4830*** depend on shared libraries, but programs linked with such libtool
4831*** libraries will work regardless of this problem.  Nevertheless, you
4832*** may want to report the problem to your system manager and/or to
4833*** bug-libtool@gnu.org
4834
4835EOF
4836          fi ;;
4837        esac
4838      fi
4839      break
4840    fi
4841  done
4842  IFS="$ac_save_ifs"
4843  MAGIC_CMD="$ac_save_MAGIC_CMD"
4844  ;;
4845esac])
4846MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4847if test -n "$MAGIC_CMD"; then
4848  AC_MSG_RESULT($MAGIC_CMD)
4849else
4850  AC_MSG_RESULT(no)
4851fi
4852])
4853
4854
4855# AC_PATH_MAGIC - find a file program which can recognise a shared library
4856AC_DEFUN([AC_PATH_MAGIC],
4857[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
4858AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
4859if test -z "$lt_cv_path_MAGIC_CMD"; then
4860  if test -n "$ac_tool_prefix"; then
4861    AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
4862  else
4863    MAGIC_CMD=:
4864  fi
4865fi
4866])
4867
4868
4869# AC_PROG_LD - find the path to the GNU or non-GNU linker
4870AC_DEFUN([AC_PROG_LD],
4871[AC_ARG_WITH(gnu-ld,
4872[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
4873test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
4874AC_REQUIRE([AC_PROG_CC])dnl
4875AC_REQUIRE([AC_CANONICAL_HOST])dnl
4876AC_REQUIRE([AC_CANONICAL_BUILD])dnl
4877AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
4878ac_prog=ld
4879if test "$GCC" = yes; then
4880  # Check if gcc -print-prog-name=ld gives a path.
4881  AC_MSG_CHECKING([for ld used by GCC])
4882  case $host in
4883  *-*-mingw*)
4884    # gcc leaves a trailing carriage return which upsets mingw
4885    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4886  *)
4887    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4888  esac
4889  case $ac_prog in
4890    # Accept absolute paths.
4891    [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
4892      re_direlt='/[[^/]][[^/]]*/\.\./'
4893      # Canonicalize the path of ld
4894      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
4895      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
4896        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4897      done
4898      test -z "$LD" && LD="$ac_prog"
4899      ;;
4900  "")
4901    # If it fails, then pretend we aren't using GCC.
4902    ac_prog=ld
4903    ;;
4904  *)
4905    # If it is relative, then search for the first ld in PATH.
4906    with_gnu_ld=unknown
4907    ;;
4908  esac
4909elif test "$with_gnu_ld" = yes; then
4910  AC_MSG_CHECKING([for GNU ld])
4911else
4912  AC_MSG_CHECKING([for non-GNU ld])
4913fi
4914AC_CACHE_VAL(lt_cv_path_LD,
4915[if test -z "$LD"; then
4916  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4917  for ac_dir in $PATH; do
4918    test -z "$ac_dir" && ac_dir=.
4919    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4920      lt_cv_path_LD="$ac_dir/$ac_prog"
4921      # Check to see if the program is GNU ld.  I'd rather use --version,
4922      # but apparently some GNU ld's only accept -v.
4923      # Break only if it was the GNU/non-GNU ld that we prefer.
4924      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
4925        test "$with_gnu_ld" != no && break
4926      else
4927        test "$with_gnu_ld" != yes && break
4928      fi
4929    fi
4930  done
4931  IFS="$ac_save_ifs"
4932else
4933  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4934fi])
4935LD="$lt_cv_path_LD"
4936if test -n "$LD"; then
4937  AC_MSG_RESULT($LD)
4938else
4939  AC_MSG_RESULT(no)
4940fi
4941test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4942AC_PROG_LD_GNU
4943])
4944
4945# AC_PROG_LD_GNU -
4946AC_DEFUN([AC_PROG_LD_GNU],
4947[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4948[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
4949if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
4950  lt_cv_prog_gnu_ld=yes
4951else
4952  lt_cv_prog_gnu_ld=no
4953fi])
4954with_gnu_ld=$lt_cv_prog_gnu_ld
4955])
4956
4957# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
4958#   -- PORTME Some linkers may need a different reload flag.
4959AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
4960[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
4961[lt_cv_ld_reload_flag='-r'])
4962reload_flag=$lt_cv_ld_reload_flag
4963test -n "$reload_flag" && reload_flag=" $reload_flag"
4964])
4965
4966# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
4967#  -- PORTME fill in with the dynamic library characteristics
4968AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
4969[AC_CACHE_CHECK([how to recognise dependent libraries],
4970lt_cv_deplibs_check_method,
4971[lt_cv_file_magic_cmd='$MAGIC_CMD'
4972lt_cv_file_magic_test_file=
4973lt_cv_deplibs_check_method='unknown'
4974# Need to set the preceding variable on all platforms that support
4975# interlibrary dependencies.
4976# 'none' -- dependencies not supported.
4977# `unknown' -- same as none, but documents that we really don't know.
4978# 'pass_all' -- all dependencies passed with no checks.
4979# 'test_compile' -- check by making test program.
4980# 'file_magic [[regex]]' -- check by looking for files in library path
4981# which responds to the $file_magic_cmd with a given egrep regex.
4982# If you have `file' or equivalent on your system and you're not sure
4983# whether `pass_all' will *always* work, you probably want this one.
4984
4985case $host_os in
4986aix4* | aix5*)
4987  lt_cv_deplibs_check_method=pass_all
4988  ;;
4989
4990beos*)
4991  lt_cv_deplibs_check_method=pass_all
4992  ;;
4993
4994bsdi4*)
4995  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4996  lt_cv_file_magic_cmd='/usr/bin/file -L'
4997  lt_cv_file_magic_test_file=/shlib/libc.so
4998  ;;
4999
5000cygwin* | mingw* | pw32*)
5001  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
5002  lt_cv_file_magic_cmd='$OBJDUMP -f'
5003  ;;
5004
5005darwin* | rhapsody*)
5006  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
5007  lt_cv_file_magic_cmd='/usr/bin/file -L'
5008  case "$host_os" in
5009  rhapsody* | darwin1.[[012]])
5010    lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
5011    ;;
5012  *) # Darwin 1.3 on
5013    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
5014    ;;
5015  esac
5016  ;;
5017
5018freebsd*)
5019  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
5020    case $host_cpu in
5021    i*86 )
5022      # Not sure whether the presence of OpenBSD here was a mistake.
5023      # Let's accept both of them until this is cleared up.
5024      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
5025      lt_cv_file_magic_cmd=/usr/bin/file
5026      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
5027      ;;
5028    esac
5029  else
5030    lt_cv_deplibs_check_method=pass_all
5031  fi
5032  ;;
5033
5034gnu*)
5035  lt_cv_deplibs_check_method=pass_all
5036  ;;
5037
5038hpux10.20*|hpux11*)
5039  lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
5040  lt_cv_file_magic_cmd=/usr/bin/file
5041  lt_cv_file_magic_test_file=/usr/lib/libc.sl
5042  ;;
5043
5044irix5* | irix6* | nonstopux*)
5045  case $host_os in
5046  irix5* | nonstopux*)
5047    # this will be overridden with pass_all, but let us keep it just in case
5048    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
5049    ;;
5050  *)
5051    case $LD in
5052    *-32|*"-32 ") libmagic=32-bit;;
5053    *-n32|*"-n32 ") libmagic=N32;;
5054    *-64|*"-64 ") libmagic=64-bit;;
5055    *) libmagic=never-match;;
5056    esac
5057    # this will be overridden with pass_all, but let us keep it just in case
5058    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
5059    ;;
5060  esac
5061  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
5062  lt_cv_deplibs_check_method=pass_all
5063  ;;
5064
5065# This must be Linux ELF.
5066linux-gnu*)
5067  case $host_cpu in
5068  alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64* | s390* | x86_64*)
5069    lt_cv_deplibs_check_method=pass_all ;;
5070  *)
5071    # glibc up to 2.1.1 does not perform some relocations on ARM
5072    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
5073  esac
5074  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
5075  ;;
5076
5077netbsd*)
5078  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
5079    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
5080  else
5081    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
5082  fi
5083  ;;
5084
5085newos6*)
5086  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
5087  lt_cv_file_magic_cmd=/usr/bin/file
5088  lt_cv_file_magic_test_file=/usr/lib/libnls.so
5089  ;;
5090
5091openbsd*)
5092  lt_cv_file_magic_cmd=/usr/bin/file
5093  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
5094  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5095    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
5096  else
5097    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
5098  fi
5099  ;;
5100
5101osf3* | osf4* | osf5*)
5102  # this will be overridden with pass_all, but let us keep it just in case
5103  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
5104  lt_cv_file_magic_test_file=/shlib/libc.so
5105  lt_cv_deplibs_check_method=pass_all
5106  ;;
5107
5108sco3.2v5*)
5109  lt_cv_deplibs_check_method=pass_all
5110  ;;
5111
5112solaris*)
5113  lt_cv_deplibs_check_method=pass_all
5114  lt_cv_file_magic_test_file=/lib/libc.so
5115  ;;
5116
5117sysv5uw[[78]]* | sysv4*uw2*)
5118  lt_cv_deplibs_check_method=pass_all
5119  ;;
5120
5121sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5122  case $host_vendor in
5123  motorola)
5124    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
5125    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
5126    ;;
5127  ncr)
5128    lt_cv_deplibs_check_method=pass_all
5129    ;;
5130  sequent)
5131    lt_cv_file_magic_cmd='/bin/file'
5132    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
5133    ;;
5134  sni)
5135    lt_cv_file_magic_cmd='/bin/file'
5136    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
5137    lt_cv_file_magic_test_file=/lib/libc.so
5138    ;;
5139  siemens)
5140    lt_cv_deplibs_check_method=pass_all
5141    ;;
5142  esac
5143  ;;
5144esac
5145])
5146file_magic_cmd=$lt_cv_file_magic_cmd
5147deplibs_check_method=$lt_cv_deplibs_check_method
5148])
5149
5150
5151# AC_PROG_NM - find the path to a BSD-compatible name lister
5152AC_DEFUN([AC_PROG_NM],
5153[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
5154AC_MSG_CHECKING([for BSD-compatible nm])
5155AC_CACHE_VAL(lt_cv_path_NM,
5156[if test -n "$NM"; then
5157  # Let the user override the test.
5158  lt_cv_path_NM="$NM"
5159else
5160  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
5161  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
5162    test -z "$ac_dir" && ac_dir=.
5163    tmp_nm=$ac_dir/${ac_tool_prefix}nm
5164    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
5165      # Check to see if the nm accepts a BSD-compat flag.
5166      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
5167      #   nm: unknown option "B" ignored
5168      # Tru64's nm complains that /dev/null is an invalid object file
5169      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
5170        lt_cv_path_NM="$tmp_nm -B"
5171        break
5172      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
5173        lt_cv_path_NM="$tmp_nm -p"
5174        break
5175      else
5176        lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
5177        continue # so that we can try to find one that supports BSD flags
5178      fi
5179    fi
5180  done
5181  IFS="$ac_save_ifs"
5182  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
5183fi])
5184NM="$lt_cv_path_NM"
5185AC_MSG_RESULT([$NM])
5186])
5187
5188# AC_CHECK_LIBM - check for math library
5189AC_DEFUN([AC_CHECK_LIBM],
5190[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5191LIBM=
5192case $host in
5193*-*-beos* | *-*-cygwin* | *-*-pw32*)
5194  # These system don't have libm
5195  ;;
5196*-ncr-sysv4.3*)
5197  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
5198  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
5199  ;;
5200*)
5201  AC_CHECK_LIB(m, main, LIBM="-lm")
5202  ;;
5203esac
5204])
5205
5206# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
5207# the libltdl convenience library and LTDLINCL to the include flags for
5208# the libltdl header and adds --enable-ltdl-convenience to the
5209# configure arguments.  Note that LIBLTDL and LTDLINCL are not
5210# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
5211# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
5212# with '${top_builddir}/' and LTDLINCL will be prefixed with
5213# '${top_srcdir}/' (note the single quotes!).  If your package is not
5214# flat and you're not using automake, define top_builddir and
5215# top_srcdir appropriately in the Makefiles.
5216AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
5217[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
5218  case $enable_ltdl_convenience in
5219  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
5220  "") enable_ltdl_convenience=yes
5221      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
5222  esac
5223  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
5224  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
5225  # For backwards non-gettext consistent compatibility...
5226  INCLTDL="$LTDLINCL"
5227])
5228
5229# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
5230# the libltdl installable library and LTDLINCL to the include flags for
5231# the libltdl header and adds --enable-ltdl-install to the configure
5232# arguments.  Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is
5233# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
5234# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
5235# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed
5236# with '${top_srcdir}/' (note the single quotes!).  If your package is
5237# not flat and you're not using automake, define top_builddir and
5238# top_srcdir appropriately in the Makefiles.
5239# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
5240AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
5241[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
5242  AC_CHECK_LIB(ltdl, main,
5243  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
5244  [if test x"$enable_ltdl_install" = xno; then
5245     AC_MSG_WARN([libltdl not installed, but installation disabled])
5246   else
5247     enable_ltdl_install=yes
5248   fi
5249  ])
5250  if test x"$enable_ltdl_install" = x"yes"; then
5251    ac_configure_args="$ac_configure_args --enable-ltdl-install"
5252    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
5253    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
5254  else
5255    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
5256    LIBLTDL="-lltdl"
5257    LTDLINCL=
5258  fi
5259  # For backwards non-gettext consistent compatibility...
5260  INCLTDL="$LTDLINCL"
5261])
5262
5263# old names
5264AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
5265AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
5266AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
5267AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
5268AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
5269AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
5270AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
5271
5272# This is just to silence aclocal about the macro not being used
5273ifelse([AC_DISABLE_FAST_INSTALL])
5274
5275# NOTE: This macro has been submitted for inclusion into   #
5276#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
5277#  a released version of Autoconf we should remove this    #
5278#  macro and use it instead.                               #
5279# LT_AC_PROG_SED
5280# --------------
5281# Check for a fully-functional sed program, that truncates
5282# as few characters as possible.  Prefer GNU sed if found.
5283AC_DEFUN([LT_AC_PROG_SED],
5284[AC_MSG_CHECKING([for a sed that does not truncate output])
5285AC_CACHE_VAL(lt_cv_path_SED,
5286[# Loop through the user's path and test for sed and gsed.
5287# Then use that list of sed's as ones to test for truncation.
5288as_executable_p="test -f"
5289as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5290for as_dir in $PATH
5291do
5292  IFS=$as_save_IFS
5293  test -z "$as_dir" && as_dir=.
5294  for ac_prog in sed gsed; do
5295    for ac_exec_ext in '' $ac_executable_extensions; do
5296      if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
5297        _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
5298      fi
5299    done
5300  done
5301done
5302
5303  # Create a temporary directory, and hook for its removal unless debugging.
5304$debug ||
5305{
5306  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
5307  trap '{ (exit 1); exit 1; }' 1 2 13 15
5308}
5309
5310# Create a (secure) tmp directory for tmp files.
5311: ${TMPDIR=/tmp}
5312{
5313  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
5314  test -n "$tmp" && test -d "$tmp"
5315}  ||
5316{
5317  tmp=$TMPDIR/sed$$-$RANDOM
5318  (umask 077 && mkdir $tmp)
5319} ||
5320{
5321   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
5322   { (exit 1); exit 1; }
5323}
5324  _max=0
5325  _count=0
5326  # Add /usr/xpg4/bin/sed as it is typically found on Solaris
5327  # along with /bin/sed that truncates output.
5328  for _sed in $_sed_list /usr/xpg4/bin/sed; do
5329    test ! -f ${_sed} && break
5330    cat /dev/null > "$tmp/sed.in"
5331    _count=0
5332    echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
5333    # Check for GNU sed and select it if it is found.
5334    if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
5335      lt_cv_path_SED=${_sed}
5336      break
5337    fi
5338    while true; do
5339      cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
5340      mv "$tmp/sed.tmp" "$tmp/sed.in"
5341      cp "$tmp/sed.in" "$tmp/sed.nl"
5342      echo >>"$tmp/sed.nl"
5343      ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
5344      cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
5345      # 40000 chars as input seems more than enough
5346      test $_count -gt 10 && break
5347      _count=`expr $_count + 1`
5348      if test $_count -gt $_max; then
5349        _max=$_count
5350        lt_cv_path_SED=$_sed
5351      fi
5352    done
5353  done
5354  rm -rf "$tmp"
5355])
5356if test "X$SED" != "X"; then
5357  lt_cv_path_SED=$SED
5358else
5359  SED=$lt_cv_path_SED
5360fi
5361AC_MSG_RESULT([$SED])
5362])
5363
Note: See TracBrowser for help on using the repository browser.