root/tags/gdal_1_2_4/aclocal.m4

Revision 5878, 221.2 kB (checked in by aamici, 5 years ago)

sync with libtool 1.5.2
move gdal code at the top of the file (and add warnings on keeping it there)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 dnl ---------------------------------------------------------------------------
2 dnl Try to establish a 64 bit integer type.
3 dnl ---------------------------------------------------------------------------
4
5 AC_DEFUN(AC_HAVE_LONG_LONG,
6 [
7   AC_MSG_CHECKING([for 64bit integer type])
8
9   echo 'int main() { long long off=0; }' >> conftest.c
10   if test -z "`${CC} -o conftest conftest.c 2>&1`" ; then
11     AC_DEFINE(HAVE_LONG_LONG, 1, [Define to 1, if your compiler supports long long data type])
12     AC_MSG_RESULT([long long])
13   else
14     AC_MSG_RESULT([no])
15   fi
16   rm -f conftest*
17 ])
18
19 # AC_LANG_FUNC_LINK_TRY_CUSTOM(C++)(FUNCTION,INCLUDE,CODE)
20 # ----------------------------------
21 m4_define([AC_LANG_FUNC_LINK_TRY_CUSTOM],
22 [AC_LANG_PROGRAM(
23 [
24 #include <assert.h>
25 $2
26 void test_f()
27 {
28   $3
29 }
30 ])])
31
32 # -----------------------------------------------------------------
33 # AC_CHECK_FUNC_CUSTOM(FUNCTION, [INCLUDE], [CODE],
34 #                      [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
35 # -----------------------------------------------------------------
36 # This function is primariliy added to facilite testing that
37 # function prototypes are properly found such that functions can
38 # be compiled properly in C++.  In particular, we want to include
39 # the real include file, not internal define prototypes.
40 #
41 # eg.
42 # AC_LANG_PUSH(C++)
43 # AC_CHECK_FUNC_CUSTOM(gmtime_r,[#include <time.h>],[time_t t; struct tm ltime; t = time(0); gmtime_r( &t, &ltime );])
44 # AC_LANG_POP(C++)
45 # -----------------------------------------------------------------
46 AC_DEFUN([AC_CHECK_FUNC_CUSTOM],
47 [AS_VAR_PUSHDEF([ac_var], [ac_cv_func_$1])dnl
48 AC_CACHE_CHECK([for $1], ac_var,
49 [AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY_CUSTOM([$1],[$2],[$3])],
50                 [AS_VAR_SET(ac_var, yes)],
51                 [AS_VAR_SET(ac_var, no)])])
52 AS_IF([test AS_VAR_GET(ac_var) = yes], [$4], [$5])dnl
53 AS_VAR_POPDEF([ac_var])dnl
54 dnl AC_MSG_RESULT([AC_LANG_FUNC_LINK_TRY_CUSTOM([$1],[$2],[$3])])
55 dnl exit
56 ])# AC_CHECK_FUNC
57
58
59 dnl ---------------------------------------------------------------------------
60 dnl Check for Unix 64 bit STDIO API (fseek64, ftell64 like on IRIX).
61 dnl ---------------------------------------------------------------------------
62
63 AC_DEFUN(AC_UNIX_STDIO_64,
64 [
65   AC_ARG_WITH(unix_stdio_64,[  --with-unix-stdio-64[=ARG] Utilize 64 stdio api (yes/no)],,)
66
67   AC_MSG_CHECKING([for 64bit file io])
68
69   if test "$with_unix_stdio_64" = "yes" ; then
70     VSI_FTELL64=ftell64
71     VSI_FSEEK64=fseek64
72   fi
73
74   if test "$with_unix_stdio_64" = "" ; then
75     echo '#include <stdio.h>' > conftest.cpp
76     echo 'int main() { long long off=0; fseek64(NULL, SEEK_SET, off); off = ftell64(NULL); return 0; }' >> conftest.c
77     if test -z "`${CC} -o conftest conftest.c 2>&1`" ; then
78       with_unix_stdio_64=yes
79       VSI_FTELL64=ftell64
80       VSI_FSEEK64=fseek64
81     fi
82     rm -f conftest*
83   fi
84
85   dnl I use CXX in this one, to ensure that the prototypes are available.
86   dnl these functions seem to exist on Linux, but aren't normally defined
87   dnl by stdio.h.  With CXX (C++) this becomes a fatal error.
88
89   if test "$with_unix_stdio_64" = "" ; then
90     echo '#include <stdio.h>' > conftest.c
91     echo 'int main() { long long off=0; fseeko64(NULL, SEEK_SET, off); off = ftello64(NULL); return 0; }' >> conftest.c
92     if test -z "`${CXX} -o conftest conftest.c 2>&1`" ; then
93       with_unix_stdio_64=yes
94       VSI_FTELL64=ftello64
95       VSI_FSEEK64=fseeko64
96     fi
97     rm -f conftest*
98   fi
99
100   dnl This is much like the first test, but we predefine _LARGEFILE64_SOURCE
101   dnl before including stdio.h.  This should work on Linux 2.4 series systems.
102
103   if test "$with_unix_stdio_64" = "" ; then
104     echo '#define _LARGEFILE64_SOURCE' > conftest.c
105     echo '#include <stdio.h>' >> conftest.c
106     echo 'int main() { long long off=0; fseeko64(NULL, SEEK_SET, off); off = ftello64(NULL); return 0; }' >> conftest.c
107     if test -z "`${CXX} -o conftest conftest.c 2>&1`" ; then
108       with_unix_stdio_64=yes
109       VSI_FTELL64=ftello64
110       VSI_FSEEK64=fseeko64
111       AC_DEFINE(VSI_NEED_LARGEFILE64_SOURCE, 1, [Define to 1, if you have
112       LARGEFILE64_SOURCE])
113     fi
114     rm -f conftest*
115   fi
116
117   if test "$with_unix_stdio_64" = "yes" ; then
118     AC_MSG_RESULT([yes])
119
120     AC_DEFINE(UNIX_STDIO_64, 1, [Define to 1 if you have fseek64, ftell64])
121     AC_DEFINE(VSI_LARGE_API_SUPPORTED, 1, [Define to 1, if you have 64 bit
122     STDIO API])
123
124     export VSI_FTELL64 VSI_FSEEK64
125     AC_DEFINE_UNQUOTED(VSI_FTELL64,$VSI_FTELL64, [Define to 1, if you have
126     ftell64])
127     AC_DEFINE_UNQUOTED(VSI_FSEEK64,$VSI_FSEEK64, [Define to 1, if you have
128     fseek64])
129   else
130     AC_MSG_RESULT([no])
131   fi
132
133 ])
134
135 AC_DEFUN(AC_COMPILER_LOCALHACK,
136 [
137   AC_MSG_CHECKING([if local/include already standard])
138
139   rm -f comp.out
140   echo 'int main() { int i = 1; if( *((unsigned char *) &i) == 0 ) printf( "BIGENDIAN"); return 0; }' >> conftest.c
141   ${CC} $CPPFLAGS $EXTRA_INCLUDES -o conftest conftest.c 2> comp.out
142   COMP_CHECK=`grep "system directory" comp.out | grep /usr/local/include`
143   if test -z "$COMP_CHECK" ; then
144      AC_MSG_RESULT([no, everything is ok])
145   else
146      AC_MSG_RESULT([yes, stripping extras])
147      CXXFLAGS=`echo "$CXXFLAGS " | sed "s/-I\/usr\/local\/include //"`
148      CFLAGS=`echo "$CFLAGS " | sed "s/-I\/usr\/local\/include //"`
149      EXTRA_INCLUDES=`echo "$EXTRA_INCLUDES " | sed "s/-I\/usr\/local\/include //"`
150   fi
151   rm -f comp.out
152 ])
153
154 AC_DEFUN(AC_COMPILER_WFLAGS,
155 [
156         # Remove -g from compile flags, we will add via CFG variable if
157         # we need it.
158         CXXFLAGS=`echo "$CXXFLAGS " | sed "s/-g //"`
159         CFLAGS=`echo "$CFLAGS " | sed "s/-g //"`
160
161         # check for GNU compiler, and use -Wall
162         if test "$GCC" = "yes"; then
163                 C_WFLAGS="-Wall"
164                 AC_DEFINE(USE_GNUCC, 1, [Define to 1, if you have GNU C
165                 compiler])
166         fi
167         if test "$GXX" = "yes"; then
168                 CXX_WFLAGS="-Wall"
169                 AC_DEFINE(USE_GNUCC, 1, [Define to 1, if you have GNU C
170                 compiler])
171         fi
172         AC_SUBST(CXX_WFLAGS,$CXX_WFLAGS)
173         AC_SUBST(C_WFLAGS,$C_WFLAGS)
174 ])
175
176 AC_DEFUN(AC_COMPILER_PIC,
177 [
178         echo 'void f(){}' > conftest.c
179         if test -z "`${CC-cc} -fPIC -c conftest.c 2>&1`"; then
180           C_PIC=-fPIC
181         else
182           C_PIC=
183         fi
184         if test -z "`${CXX-g++} -fPIC -c conftest.c 2>&1`"; then
185           CXX_PIC=-fPIC
186         else
187           CXX_PIC=
188         fi
189         rm -f conftest*
190
191         AC_SUBST(CXX_PIC,$CXX_PIC)
192         AC_SUBST(C_PIC,$C_PIC)
193 ])
194
195 dnl
196 dnl Look for OGDI, and verify that we can link and run.
197 dnl
198 AC_DEFUN(AC_TRY_OGDI,
199 [
200   saved_LIBS="$LIBS"
201   OGDI_LIBS=" -logdi -lzlib"
202   LIBS="$saved_LIBS $OGDI_LIBS"
203   AC_TRY_LINK(,[ void *cln_CreateClient(); cln_CreateClient(); ],
204         HAVE_OGDI=yes, HAVE_OGDI=no)
205
206   if test "$HAVE_OGDI" = "no" ; then
207     OGDI_LIBS="-L$TOPDIR/bin/$TARGET -logdi -lzlib"
208     LIBS="$saved_LIBS $OGDI_LIBS"
209     AC_TRY_LINK(,[ void *cln_CreateClient(); cln_CreateClient(); ],
210           HAVE_OGDI=yes, HAVE_OGDI=no)
211   fi
212
213   if test "$HAVE_OGDI" = "yes" ; then
214     AC_CHECK_HEADER(ecs.h,have_ecs_h=yes,have_ecs_h=no)
215
216     if test "$have_ecs_h" = "no"; then
217       if test -f "$TOPDIR/ogdi/include/ecs.h" ; then
218         echo "Found ecs.h in $TOPDIR/include"
219         OGDI_INCLUDE="-I$TOPDIR/ogdi/include -I$TOPDIR/proj"
220       else
221         HAVE_OGDI=no
222       fi
223     fi
224   fi
225
226   if test "$HAVE_OGDI" = "no" ; then
227     OGDI_LIBS=""
228     OGDI_INCLUDE=""
229     echo "checking for OGDI ... no"
230   else
231     echo "checking for OGDI ... yes"
232   fi
233
234   AC_SUBST(HAVE_OGDI,$HAVE_OGDI)
235   AC_SUBST(OGDI_INCLUDE,$OGDI_INCLUDE)
236   AC_SUBST(OGDI_LIBS,$OGDI_LIBS)
237
238   LIBS="$saved_LIBS"
239 ])
240
241 dnl
242 dnl Try to find something to link shared libraries with.  Use "c++ -shared"
243 dnl in preference to "ld -shared" because it will link in required c++
244 dnl run time support for us.
245 dnl
246 AC_DEFUN(AC_LD_SHARED,
247 [
248   echo 'void g(); int main(){ g(); return 0; }' > conftest1.c
249
250   echo '#include <stdio.h>' > conftest2.c
251   echo 'void g(); void g(){printf("");}' >> conftest2.c
252   ${CC} ${C_PIC} -c conftest2.c
253
254   SO_EXT="so"
255   export SO_EXT
256   LD_SHARED="/bin/true"
257   if test ! -z "`uname -a | grep IRIX`" ; then
258     IRIX_ALL=-all
259   else
260     IRIX_ALL=
261   fi
262
263   AC_ARG_WITH(ld-shared,[  --without-ld-shared   Disable shared library support],,)
264
265   if test "$with_ld_shared" != "" ; then
266     if test "$with_ld_shared" = "no" ; then
267       echo "user disabled shared library support."     
268     else
269       echo "using user supplied .so link command ... $with_ld_shared"   
270     fi
271     LD_SHARED="$with_ld_shared"
272   fi
273
274   dnl Check For Cygwin case.  Actually verify that the produced DLL works.
275
276   if test ! -z "`uname -a | grep CYGWIN`" \
277         -a "$LD_SHARED" = "/bin/true" \
278         -a -z "`gcc -shared conftest2.o -o libconftest.dll`" ; then
279     if test -z "`${CC} conftest1.c -L./ -lconftest -o conftest1 2>&1`"; then
280       LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
281       if test -z "$LD_LIBRARY_PATH" ; then
282         LD_LIBRARY_PATH="`pwd`"
283       else
284         LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
285       fi
286       export LD_LIBRARY_PATH
287       if test -z "`./conftest1 2>&1`" ; then
288         echo "checking for Cygwin gcc -shared ... yes"
289         LD_SHARED="c++ -shared"
290         SO_EXT="dll"
291       fi
292       LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
293     fi
294   fi
295
296   dnl Test special MacOS (Darwin) case.
297
298   if test ! -z "`uname | grep Darwin`" \
299           -a "$LD_SHARED" = "/bin/true" \
300           -a -z "`${CXX} -dynamiclib conftest2.o -o libconftest.so 2>&1`" ; then
301     ${CC} -c conftest1.c
302     if test -z "`${CXX} conftest1.o libconftest.so -o conftest1 2>&1`"; then
303       DYLD_LIBRARY_PATH_OLD="$DYLD_LIBRARY_PATH"
304       if test -z "$DYLD_LIBRARY_PATH" ; then
305         DYLD_LIBRARY_PATH="`pwd`"
306       else
307         DYLD_LIBRARY_PATH="`pwd`:$DYLD_LIBRARY_PATH"
308       fi
309       export DYLD_LIBRARY_PATH
310       if test -z "`./conftest1 2>&1`" ; then
311         echo "checking for ${CXX} -dynamiclib ... yes"
312         LD_SHARED="${CXX} -dynamiclib"
313         SO_EXT=dylib
314       fi
315       DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH_OLD"
316     fi
317     rm -f conftest1.o
318   fi
319
320   if test "$LD_SHARED" = "/bin/true" \
321         -a -z "`${CXX} -shared $IRIX_ALL conftest2.o -o libconftest.so 2>&1|grep -v WARNING`" ; then
322     if test -z "`${CC} conftest1.c libconftest.so -o conftest1 2>&1`"; then
323       LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
324       if test -z "$LD_LIBRARY_PATH" ; then
325         LD_LIBRARY_PATH="`pwd`"
326       else
327         LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
328       fi
329       export LD_LIBRARY_PATH
330       if test -z "`./conftest1 2>&1`" ; then
331         echo "checking for ${CXX} -shared ... yes"
332         LD_SHARED="${CXX} -shared $IRIX_ALL"
333       else
334         echo "checking for ${CXX} -shared ... no(3)"
335       fi
336       LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
337     else
338       echo "checking for ${CXX} -shared ... no(2)"
339     fi
340   else
341     if test "$LD_SHARED" = "/bin/true" ; then
342       echo "checking for ${CXX} -shared ... no(1)"
343     fi
344   fi
345
346   if test "$LD_SHARED" = "/bin/true" \
347           -a -z "`ld -shared conftest2.o -o libconftest.so 2>&1`" ; then
348     if test -z "`${CC} conftest1.c libconftest.so -o conftest1 2>&1`"; then
349       LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
350       if test -z "$LD_LIBRARY_PATH" ; then
351         LD_LIBRARY_PATH="`pwd`"
352       else
353         LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
354       fi
355       export LD_LIBRARY_PATH
356       if test -z "`./conftest1 2>&1`" ; then
357         echo "checking for ld -shared ... yes"
358         LD_SHARED="ld -shared"
359       fi
360       LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
361     fi
362   fi
363
364   if test "$LD_SHARED" = "/bin/true" ; then
365     echo "checking for ld -shared ... no"
366     if test ! -x /bin/true ; then
367       LD_SHARED=/usr/bin/true
368     fi
369   fi
370   if test "$LD_SHARED" = "no" ; then
371     if test -x /bin/true ; then
372       LD_SHARED=/bin/true
373     else
374       LD_SHARED=/usr/bin/true
375     fi
376   fi
377
378   rm -f conftest* libconftest*
379
380   AC_SUBST(LD_SHARED,$LD_SHARED)
381   AC_SUBST(SO_EXT,$SO_EXT)
382 ])
383
384 dnl
385 dnl Find Python.
386 dnl
387
388 AC_DEFUN(AM_PATH_PYTHON,
389   [AC_CHECK_PROGS(PYTHON, python python1.5 python1.4 python1.3,no)
390   if test "$with_python" = no ; then
391      echo "python support disabled"
392      PYTHON=no
393   fi
394   if test "$PYTHON" != no ; then
395     AC_MSG_CHECKING([where python Makefiles are])
396 changequote(,)dnl
397     python_prefix="`$PYTHON -c '
398 import sys
399 print sys.prefix'`"
400 changequote([, ])dnl
401 changequote(,)dnl
402     python_execprefix="`$PYTHON -c '
403 import sys
404 print sys.prefix'`"
405 changequote([, ])dnl
406 changequote(,)dnl
407     python_version="`$PYTHON -c '
408 import sys
409 print sys.version[:3]'`"
410 changequote([, ])dnl
411
412     pythondir=$python_prefix/lib/python${python_version}/site-packages
413     pyexecdir=$python_execprefix/lib/python${python_version}/site-packages
414
415     AC_MSG_RESULT(found)
416
417     dnl Verify that we have the makefile needed later.
418    
419     AC_MSG_CHECKING([Python makefile])
420     py_mf=$python_execprefix/lib/python${python_version}/config/Makefile
421     if test -f $py_mf ; then
422       AC_MSG_RESULT(found)
423     else
424       AC_MSG_RESULT([missing, python disabled.])
425       PYTHON=no
426     fi
427   else
428     # these defaults are version independent ...
429     pythondir='$(prefix)/lib/site-python'
430     pyexecdir='$(exec_prefix)/lib/site-python'
431   fi
432
433   AC_ARG_WITH(pymoddir,[  --with-pymoddir=ARG   Override Python package install dir],,)
434
435   if test "$PYTHON" != "no" ; then
436     AC_MSG_CHECKING([where .py files should go])
437
438     if test "$with_pymoddir" = "" ; then
439        pymoddir=$pyexecdir
440     else
441        pymoddir=$with_pymoddir
442     fi
443
444     export pymoddir
445     AC_MSG_RESULT($pymoddir)
446   fi 
447
448   AC_SUBST(pythondir)
449   AC_SUBST(pyexecdir)
450   AC_SUBST(pymoddir)
451 ])
452
453
454 dnl finds information needed for compilation of shared library style python
455 dnl extensions.  AM_PATH_PYTHON should be called before hand.
456 dnl NFW: Modified from original to avoid overridding CC, SO and OPT
457
458 AC_DEFUN(AM_INIT_PYEXEC_MOD,
459   [AC_REQUIRE([AM_PATH_PYTHON])
460
461 PYTHON_LIBS=""
462 if test "$PYTHON" != no ; then
463   AC_MSG_CHECKING([for python headers])
464   AC_CACHE_VAL(am_cv_python_includes,
465     [changequote(,)dnl
466     am_cv_python_includes="`$PYTHON -c '
467 import sys
468 includepy = \"%s/include/python%s\" % (sys.prefix, sys.version[:3])
469 if sys.version[0] > \"1\" or sys.version[2] > \"4\":
470   libpl = \"%s/include/python%s\" % (sys.exec_prefix, sys.version[:3])
471 else:
472   libpl = \"%s/lib/python%s/config\" % (sys.exec_prefix, sys.version[:3])
473 print \"-I%s -I%s\" % (includepy, libpl)'`"
474     changequote([, ])])
475   PYTHON_INCLUDES="$am_cv_python_includes"
476   AC_MSG_RESULT(found)
477   AC_SUBST(PYTHON_INCLUDES)
478
479   AC_MSG_CHECKING([definitions from Python makefile])
480   AC_CACHE_VAL(am_cv_python_makefile,
481     [changequote(,)dnl
482     if test ! -z "`uname -a | grep CYGWIN`" ; then
483       PYTHON_LIBS="`$PYTHON -c '
484 import sys
485 print \"-L%s/lib/python%s/config -lpython%s.dll\" % (sys.prefix, sys.version[:3], sys.version[:3])'`"
486     fi
487     py_makefile="`$PYTHON -c '
488 import sys
489 print \"%s/lib/python%s/config/Makefile\"%(sys.exec_prefix, sys.version[:3])'`"
490     if test ! -f "$py_makefile"; then
491       echo Could not find the python config makefile.  Maybe you are;
492       echo missing the development portion of the python installation;
493       exit;
494     fi
495     eval `sed -n \
496 -e "s/^CC=[     ]*\(.*\)/am_cv_python_CC='\1'/p" \
497 -e "s/^OPT=[    ]*\(.*\)/am_cv_python_OPT='\1'/p" \
498 -e "s/^CCSHARED=[       ]*\(.*\)/am_cv_python_CCSHARED='\1'/p" \
499 -e "s/^LDSHARED=[       ]*\(.*\)/am_cv_python_LDSHARED='\1'/p" \
500 -e "s/^SO=[     ]*\(.*\)/am_cv_python_SO='\1'/p" \
501     $py_makefile`
502     am_cv_python_makefile=found
503     changequote([, ])])
504   AC_MSG_RESULT(done)
505   PYTHON_CC="$am_cv_python_CC"
506   PYTHON_OPT="$am_cv_python_OPT"
507   PYTHON_SO="$am_cv_python_SO"
508   PYTHON_CFLAGS="$am_cv_python_CCSHARED \$(OPT)"
509   PYTHON_LINK="$am_cv_python_LDSHARED -o \[$]@"
510
511 else
512   PYTHON_CC=""
513   PYTHON_OPT=""
514   PYTHON_SO=""
515   PYTHON_CFLAGS=""
516   PYTHON_LINK=""
517 fi
518 AC_SUBST(PYTHON_CC)dnl
519 AC_SUBST(PYTHON_OPT)dnl
520 AC_SUBST(PYTHON_SO)dnl
521 AC_SUBST(PYTHON_CFLAGS)dnl
522 AC_SUBST(PYTHON_LIBS)dnl
523 AC_SUBST(PYTHON_LINK)])
524
525 dnl
526 dnl Check if we have NUMPY include file(s).
527 dnl
528
529 AC_DEFUN(AM_CHECK_NUMPY,
530   [
531   AC_MSG_CHECKING([for NumPy include files])
532   echo '#include "Python.h"' > conftest.c
533   echo '#include "Numeric/arrayobject.h"' >> conftest.c
534   if test -z "`${CC-cc} $PYTHON_INCLUDES -c conftest.c 2>&1`"; then
535     HAVE_NUMPY=yes
536     AC_MSG_RESULT(found)
537   else
538     HAVE_NUMPY=no
539     AC_MSG_RESULT(missing)
540   fi
541   export HAVE_NUMPY
542   rm -f conftest.c
543
544   AC_SUBST(HAVE_NUMPY)
545   if test "$HAVE_NUMPY" = "yes" ; then
546     NUMPY_FLAG=-DHAVE_NUMPY
547   else
548     NUMPY_FLAG=
549   fi
550   export NUMPY_FLAG
551   AC_SUBST(NUMPY_FLAG)])
552
553
554 dnl ---------------------------------------------------------------------------
555 dnl Message output
556 dnl ---------------------------------------------------------------------------
557 AC_DEFUN(LOC_MSG,[
558 echo "$1"
559 ])
560
561 AC_DEFUN(LOC_YES_NO,[if test -n "${$1}" ; then echo yes ; else echo no ; fi])
562
563 AC_DEFUN(LOC_MSG_USE,[
564 [echo "  $1: ]`LOC_YES_NO($2)`"])
565
566
567
568
569 dnl --------------------------------------------------------------------------
570 dnl DO NOT ADD GDAL-SPECIFIC MACROS BELOW THIS LINE!
571 dnl --------------------------------------------------------------------------
572
573
574 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
575 ## Copyright 1996, 1997, 1998, 1999, 2000, 2001
576 ## Free Software Foundation, Inc.
577 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
578 ##
579 ## This program is free software; you can redistribute it and/or modify
580 ## it under the terms of the GNU General Public License as published by
581 ## the Free Software Foundation; either version 2 of the License, or
582 ## (at your option) any later version.
583 ##
584 ## This program is distributed in the hope that it will be useful, but
585 ## WITHOUT ANY WARRANTY; without even the implied warranty of
586 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
587 ## General Public License for more details.
588 ##
589 ## You should have received a copy of the GNU General Public License
590 ## along with this program; if not, write to the Free Software
591 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
592 ##
593 ## As a special exception to the GNU General Public License, if you
594 ## distribute this file as part of a program that contains a
595 ## configuration script generated by Autoconf, you may include it under
596 ## the same distribution terms that you use for the rest of that program.
597
598 # serial 47 AC_PROG_LIBTOOL
599 # Debian $Rev: 192 $
600
601
602 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
603 # -----------------------------------------------------------
604 # If this macro is not defined by Autoconf, define it here.
605 m4_ifdef([AC_PROVIDE_IFELSE],
606          [],
607          [m4_define([AC_PROVIDE_IFELSE],
608                  [m4_ifdef([AC_PROVIDE_$1],
609                            [$2], [$3])])])
610
611
612 # AC_PROG_LIBTOOL
613 # ---------------
614 AC_DEFUN([AC_PROG_LIBTOOL],
615 [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
616 dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
617 dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
618   AC_PROVIDE_IFELSE([AC_PROG_CXX],
619     [AC_LIBTOOL_CXX],
620     [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
621   ])])
622 dnl And a similar setup for Fortran 77 support
623   AC_PROVIDE_IFELSE([AC_PROG_F77],
624     [AC_LIBTOOL_F77],
625     [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
626 ])])
627
628 dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
629 dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
630 dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
631   AC_PROVIDE_IFELSE([AC_PROG_GCJ],
632     [AC_LIBTOOL_GCJ],
633     [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
634       [AC_LIBTOOL_GCJ],
635       [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
636         [AC_LIBTOOL_GCJ],
637       [ifdef([AC_PROG_GCJ],
638              [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
639        ifdef([A][M_PROG_GCJ],
640              [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
641        ifdef([LT_AC_PROG_GCJ],
642              [define([LT_AC_PROG_GCJ],
643                 defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
644 ])])# AC_PROG_LIBTOOL
645
646
647 # _AC_PROG_LIBTOOL
648 # ----------------
649 AC_DEFUN([_AC_PROG_LIBTOOL],
650 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
651 AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
652 AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
653 AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
654
655 # This can be used to rebuild libtool when needed
656 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
657
658 # Always use our own libtool.
659 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
660 AC_SUBST(LIBTOOL)dnl
661
662 # Prevent multiple expansion
663 define([AC_PROG_LIBTOOL], [])
664 ])# _AC_PROG_LIBTOOL
665
666
667 # AC_LIBTOOL_SETUP
668 # ----------------
669 AC_DEFUN([AC_LIBTOOL_SETUP],
670 [AC_PREREQ(2.50)dnl
671 AC_REQUIRE([AC_ENABLE_SHARED])dnl
672 AC_REQUIRE([AC_ENABLE_STATIC])dnl
673 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
674 AC_REQUIRE([AC_CANONICAL_HOST])dnl
675 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
676 AC_REQUIRE([AC_PROG_CC])dnl
677 AC_REQUIRE([AC_PROG_LD])dnl
678 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
679 AC_REQUIRE([AC_PROG_NM])dnl
680
681 AC_REQUIRE([AC_PROG_LN_S])dnl
682 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
683 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
684 AC_REQUIRE([AC_OBJEXT])dnl
685 AC_REQUIRE([AC_EXEEXT])dnl
686 dnl
687
688 AC_LIBTOOL_SYS_MAX_CMD_LEN
689 AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
690 AC_LIBTOOL_OBJDIR
691
692 AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
693 _LT_AC_PROG_ECHO_BACKSLASH
694
695 case $host_os in
696 aix3*)
697   # AIX sometimes has problems with the GCC collect2 program.  For some
698   # reason, if we set the COLLECT_NAMES environment variable, the problems
699   # vanish in a puff of smoke.
700   if test "X${COLLECT_NAMES+set}" != Xset; then
701     COLLECT_NAMES=
702     export COLLECT_NAMES
703   fi
704   ;;
705 esac
706
707 # Sed substitution that helps us do robust quoting.  It backslashifies
708 # metacharacters that are still active within double-quoted strings.
709 Xsed='sed -e s/^X//'
710 [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
711
712 # Same as above, but do not quote variable references.
713 [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
714
715 # Sed substitution to delay expansion of an escaped shell variable in a
716 # double_quote_subst'ed string.
717 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
718
719 # Sed substitution to avoid accidental globbing in evaled expressions
720 no_glob_subst='s/\*/\\\*/g'
721
722 # Constants:
723 rm="rm -f"
724
725 # Global variables:
726 default_ofile=libtool
727 can_build_shared=yes
728
729 # All known linkers require a `.a' archive for static linking (except M$VC,
730 # which needs '.lib').
731 libext=a
732 ltmain="$ac_aux_dir/ltmain.sh"
733 ofile="$default_ofile"
734 with_gnu_ld="$lt_cv_prog_gnu_ld"
735
736 AC_CHECK_TOOL(AR, ar, false)
737 AC_CHECK_TOOL(RANLIB, ranlib, :)
738 AC_CHECK_TOOL(STRIP, strip, :)
739
740 old_CC="$CC"
741 old_CFLAGS="$CFLAGS"
742
743 # Set sane defaults for various variables
744 test -z "$AR" && AR=ar
745 test -z "$AR_FLAGS" && AR_FLAGS=cru
746 test -z "$AS" && AS=as
747 test -z "$CC" && CC=cc
748 test -z "$LTCC" && LTCC=$CC
749 test -z "$DLLTOOL" && DLLTOOL=dlltool
750 test -z "$LD" && LD=ld
751 test -z "$LN_S" && LN_S="ln -s"
752 test -z "$MAGIC_CMD" && MAGIC_CMD=file
753 test -z "$NM" && NM=nm
754 test -z "$SED" && SED=sed
755 test -z "$OBJDUMP" && OBJDUMP=objdump
756 test -z "$RANLIB" && RANLIB=:
757 test -z "$STRIP" && STRIP=:
758 test -z "$ac_objext" && ac_objext=o
759
760 # Determine commands to create old-style static archives.
761 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
762 old_postinstall_cmds='chmod 644 $oldlib'
763 old_postuninstall_cmds=
764
765 if test -n "$RANLIB"; then
766   case $host_os in
767   openbsd*)
768     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
769     ;;
770   *)
771     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
772     ;;
773   esac
774   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
775 fi
776
777 # Only perform the check for file, if the check method requires it
778 case $deplibs_check_method in
779 file_magic*)
780   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
781     AC_PATH_MAGIC
782   fi
783   ;;
784 esac
785
786 AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
787 AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
788 enable_win32_dll=yes, enable_win32_dll=no)
789
790 AC_ARG_ENABLE([libtool-lock],
791     [AC_HELP_STRING([--disable-libtool-lock],
792         [avoid locking (might break parallel builds)])])
793 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
794
795 AC_ARG_WITH([pic],
796     [AC_HELP_STRING([--with-pic],
797         [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
798     [pic_mode="$withval"],
799     [pic_mode=default])
800 test -z "$pic_mode" && pic_mode=default
801
802 # Use C for the default configuration in the libtool script
803 tagname=
804 AC_LIBTOOL_LANG_C_CONFIG
805 _LT_AC_TAGCONFIG
806 ])# AC_LIBTOOL_SETUP
807
808
809 # _LT_AC_SYS_COMPILER
810 # -------------------
811 AC_DEFUN([_LT_AC_SYS_COMPILER],
812 [AC_REQUIRE([AC_PROG_CC])dnl
813
814 # If no C compiler was specified, use CC.
815 LTCC=${LTCC-"$CC"}
816
817 # Allow CC to be a program name with arguments.
818 compiler=$CC
819 ])# _LT_AC_SYS_COMPILER
820
821
822 # _LT_AC_SYS_LIBPATH_AIX
823 # ----------------------
824 # Links a minimal program and checks the executable
825 # for the system default hardcoded library path. In most cases,
826 # this is /usr/lib:/lib, but when the MPI compilers are used
827 # the location of the communication and MPI libs are included too.
828 # If we don't find anything, use the default library path according
829 # to the aix ld manual.
830 AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
831 [AC_LINK_IFELSE(AC_LANG_PROGRAM,[
832 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
833 }'`
834 # Check for a 64-bit object if we didn't find anything.
835 if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
836 }'`; fi],[])
837 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
838 ])# _LT_AC_SYS_LIBPATH_AIX
839
840
841 # _LT_AC_SHELL_INIT(ARG)
842 # ----------------------
843 AC_DEFUN([_LT_AC_SHELL_INIT],
844 [ifdef([AC_DIVERSION_NOTICE],
845              [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
846          [AC_DIVERT_PUSH(NOTICE)])
847 $1
848 AC_DIVERT_POP
849 ])# _LT_AC_SHELL_INIT
850
851
852 # _LT_AC_PROG_ECHO_BACKSLASH
853 # --------------------------
854 # Add some code to the start of the generated configure script which
855 # will find an echo command which doesn't interpret backslashes.
856 AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
857 [_LT_AC_SHELL_INIT([
858 # Check that we are running under the correct shell.
859 SHELL=${CONFIG_SHELL-/bin/sh}
860
861 case X$ECHO in
862 X*--fallback-echo)
863   # Remove one level of quotation (which was required for Make).
864   ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
865   ;;
866 esac
867
868 echo=${ECHO-echo}
869 if test "X[$]1" = X--no-reexec; then
870   # Discard the --no-reexec flag, and continue.
871   shift
872 elif test "X[$]1" = X--fallback-echo; then
873   # Avoid inline document here, it may be left over
874   :
875 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
876   # Yippee, $echo works!
877   :
878 else
879   # Restart under the correct shell.
880   exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
881 fi
882
883 if test "X[$]1" = X--fallback-echo; then
884   # used as fallback echo
885   shift
886   cat <<EOF
887 [$]*
888 EOF
889   exit 0
890 fi
891
892 # The HP-UX ksh and POSIX shell print the target directory to stdout
893 # if CDPATH is set.
894 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
895
896 if test -z "$ECHO"; then
897 if test "X${echo_test_string+set}" != Xset; then
898 # find a string as large as possible, as long as the shell can cope with it
899   for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
900     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
901     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
902        echo_test_string="`eval $cmd`" &&
903        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
904     then
905       break
906     fi
907   done
908 fi
909
910 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
911    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
912    test "X$echo_testing_string" = "X$echo_test_string"; then
913   :
914 else
915   # The Solaris, AIX, and Digital Unix default echo programs unquote
916   # backslashes.  This makes it impossible to quote backslashes using
917   #   echo "$something" | sed 's/\\/\\\\/g'
918   #
919   # So, first we look for a working echo in the user's PATH.
920
921   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
922   for dir in $PATH /usr/ucb; do
923     IFS="$lt_save_ifs"
924     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
925        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
926        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
927        test "X$echo_testing_string" = "X$echo_test_string"; then
928       echo="$dir/echo"
929       break
930     fi
931   done
932   IFS="$lt_save_ifs"
933
934   if test "X$echo" = Xecho; then
935     # We didn't find a better echo, so look for alternatives.
936     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
937        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
938        test "X$echo_testing_string" = "X$echo_test_string"; then
939       # This shell has a builtin print -r that does the trick.
940       echo='print -r'
941     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
942          test "X$CONFIG_SHELL" != X/bin/ksh; then
943       # If we have ksh, try running configure again with it.
944       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
945       export ORIGINAL_CONFIG_SHELL
946       CONFIG_SHELL=/bin/ksh
947       export CONFIG_SHELL
948       exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
949     else
950       # Try using printf.
951       echo='printf %s\n'
952       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
953          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
954          test "X$echo_testing_string" = "X$echo_test_string"; then
955         # Cool, printf works
956         :
957       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
958            test "X$echo_testing_string" = 'X\t' &&
959            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
960            test "X$echo_testing_string" = "X$echo_test_string"; then
961         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
962         export CONFIG_SHELL
963         SHELL="$CONFIG_SHELL"
964         export SHELL
965         echo="$CONFIG_SHELL [$]0 --fallback-echo"
966       elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
967            test "X$echo_testing_string" = 'X\t' &&
968            echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
969            test "X$echo_testing_string" = "X$echo_test_string"; then
970         echo="$CONFIG_SHELL [$]0 --fallback-echo"
971       else
972         # maybe with a smaller string...
973         prev=:
974
975         for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
976           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
977           then
978             break
979           fi
980           prev="$cmd"
981         done
982
983         if test "$prev" != 'sed 50q "[$]0"'; then
984           echo_test_string=`eval $prev`
985           export echo_test_string
986           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
987         else
988           # Oops.  We lost completely, so just stick with echo.
989           echo=echo
990         fi
991       fi
992     fi
993   fi
994 fi
995 fi
996
997 # Copy echo and quote the copy suitably for passing to libtool from
998 # the Makefile, instead of quoting the original, which is used later.
999 ECHO=$echo
1000 if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1001    ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1002 fi
1003
1004 AC_SUBST(ECHO)
1005 ])])# _LT_AC_PROG_ECHO_BACKSLASH
1006
1007
1008 # _LT_AC_LOCK
1009 # -----------
1010 AC_DEFUN([_LT_AC_LOCK],
1011 [AC_ARG_ENABLE([libtool-lock],
1012     [AC_HELP_STRING([--disable-libtool-lock],
1013         [avoid locking (might break parallel builds)])])
1014 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1015
1016 # Some flags need to be propagated to the compiler or linker for good
1017 # libtool support.
1018 case $host in
1019 ia64-*-hpux*)
1020   # Find out which ABI we are using.
1021   echo 'int i;' > conftest.$ac_ext
1022   if AC_TRY_EVAL(ac_compile); then
1023     case `/usr/bin/file conftest.$ac_objext` in
1024     *ELF-32*)
1025       HPUX_IA64_MODE="32"
1026       ;;
1027     *ELF-64*)
1028       HPUX_IA64_MODE="64"
1029       ;;
1030     esac
1031   fi
1032   rm -rf conftest*
1033   ;;
1034 *-*-irix6*)
1035   # Find out which ABI we are using.
1036   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1037   if AC_TRY_EVAL(ac_compile); then
1038    if test "$lt_cv_prog_gnu_ld" = yes; then
1039     case `/usr/bin/file conftest.$ac_objext` in
1040     *32-bit*)
1041       LD="${LD-ld} -melf32bsmip"
1042       ;;
1043     *N32*)
1044       LD="${LD-ld} -melf32bmipn32"
1045       ;;
1046     *64-bit*)
1047       LD="${LD-ld} -melf64bmip"
1048       ;;
1049     esac
1050    else
1051     case `/usr/bin/file conftest.$ac_objext` in
1052     *32-bit*)
1053       LD="${LD-ld} -32"
1054       ;;
1055     *N32*)
1056       LD="${LD-ld} -n32"
1057       ;;
1058     *64-bit*)
1059       LD="${LD-ld} -64"
1060       ;;
1061     esac
1062    fi
1063   fi
1064   rm -rf conftest*
1065   ;;
1066
1067 x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
1068   # Find out which ABI we are using.
1069   echo 'int i;' > conftest.$ac_ext
1070   if AC_TRY_EVAL(ac_compile); then
1071     case "`/usr/bin/file conftest.o`" in
1072     *32-bit*)
1073       case $host in
1074         x86_64-*linux*)
1075           LD="${LD-ld} -m elf_i386"
1076           ;;
1077         ppc64-*linux*|powerpc64-*linux*)
1078           LD="${LD-ld} -m elf32ppclinux"
1079           ;;
1080         s390x-*linux*)
1081           LD="${LD-ld} -m elf_s390"
1082           ;;
1083         sparc64-*linux*)
1084           LD="${LD-ld} -m elf32_sparc"
1085           ;;
1086       esac
1087       ;;
1088     *64-bit*)
1089       case $host in
1090         x86_64-*linux*)
1091           LD="${LD-ld} -m elf_x86_64"
1092           ;;
1093         ppc*-*linux*|powerpc*-*linux*)
1094           LD="${LD-ld} -m elf64ppc"
1095           ;;
1096         s390*-*linux*)
1097           LD="${LD-ld} -m elf64_s390"
1098           ;;
1099         sparc*-*linux*)
1100           LD="${LD-ld} -m elf64_sparc"
1101           ;;
1102       esac
1103       ;;
1104     esac
1105   fi
1106   rm -rf conftest*
1107   ;;
1108
1109 *-*-sco3.2v5*)
1110   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1111   SAVE_CFLAGS="$CFLAGS"
1112   CFLAGS="$CFLAGS -belf"
1113   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1114     [AC_LANG_PUSH(C)
1115      AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1116      AC_LANG_POP])
1117   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1118     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1119     CFLAGS="$SAVE_CFLAGS"
1120   fi
1121   ;;
1122 AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
1123 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
1124   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1125   AC_CHECK_TOOL(AS, as, false)
1126   AC_CHECK_TOOL(OBJDUMP, objdump, false)
1127   ;;
1128   ])
1129 esac
1130
1131 need_locks="$enable_libtool_lock"
1132
1133 ])# _LT_AC_LOCK
1134
1135
1136 # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1137 #               [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1138 # ----------------------------------------------------------------
1139 # Check whether the given compiler option works
1140 AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
1141 [AC_REQUIRE([LT_AC_PROG_SED])
1142 AC_CACHE_CHECK([$1], [$2],
1143   [$2=no
1144   ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1145    printf "$lt_simple_compile_test_code" > conftest.$ac_ext
1146    lt_compiler_flag="$3"
1147    # Insert the option either (1) after the last *FLAGS variable, or
1148    # (2) before a word containing "conftest.", or (3) at the end.
1149    # Note that $ac_compile itself does not contain backslashes and begins
1150    # with a dollar sign (not a hyphen), so the echo should work correctly.
1151    # The option is referenced via a variable to avoid confusing sed.
1152    lt_compile=`echo "$ac_compile" | $SED \
1153    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
1154    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1155    -e 's:$: $lt_compiler_flag:'`
1156    (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1157    (eval "$lt_compile" 2>conftest.err)
1158    ac_status=$?
1159    cat conftest.err >&AS_MESSAGE_LOG_FD
1160    echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1161    if (exit $ac_status) && test -s "$ac_outfile"; then
1162      # The compiler can only warn and ignore the option if not recognized
1163      # So say no if there are warnings
1164      if test ! -s conftest.err; then
1165        $2=yes
1166      fi
1167    fi
1168    $rm conftest*
1169 ])
1170
1171 if test x"[$]$2" = xyes; then
1172     ifelse([$5], , :, [$5])
1173 else
1174     ifelse([$6], , :, [$6])
1175 fi
1176 ])# AC_LIBTOOL_COMPILER_OPTION
1177
1178
1179 # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1180 #                          [ACTION-SUCCESS], [ACTION-FAILURE])
1181 # ------------------------------------------------------------
1182 # Check whether the given compiler option works
1183 AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
1184 [AC_CACHE_CHECK([$1], [$2],
1185   [$2=no
1186    save_LDFLAGS="$LDFLAGS"
1187    LDFLAGS="$LDFLAGS $3"
1188    printf "$lt_simple_link_test_code" > conftest.$ac_ext
1189    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1190      # The compiler can only warn and ignore the option if not recognized
1191      # So say no if there are warnings
1192      if test -s conftest.err; then
1193        # Append any errors to the config.log.
1194        cat conftest.err 1>&AS_MESSAGE_LOG_FD
1195      else
1196        $2=yes
1197      fi
1198    fi
1199    $rm conftest*
1200    LDFLAGS="$save_LDFLAGS"
1201 ])
1202
1203 if test x"[$]$2" = xyes; then
1204     ifelse([$4], , :, [$4])
1205 else
1206     ifelse([$5], , :, [$5])
1207 fi
1208 ])# AC_LIBTOOL_LINKER_OPTION
1209
1210
1211 # AC_LIBTOOL_SYS_MAX_CMD_LEN
1212 # --------------------------
1213 AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
1214 [# find the maximum length of command line arguments
1215 AC_MSG_CHECKING([the maximum length of command line arguments])
1216 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1217   i=0
1218   testring="ABCD"
1219
1220   case $build_os in
1221   msdosdjgpp*)
1222     # On DJGPP, this test can blow up pretty badly due to problems in libc
1223     # (any single argument exceeding 2000 bytes causes a buffer overrun
1224     # during glob expansion).  Even if it were fixed, the result of this
1225     # check would be larger than it should be.
1226     lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1227     ;;
1228
1229   gnu*)
1230     # Under GNU Hurd, this test is not required because there is
1231     # no limit to the length of command line arguments.
1232     # Libtool will interpret -1 as no limit whatsoever
1233     lt_cv_sys_max_cmd_len=-1;
1234     ;;
1235
1236   cygwin* | mingw*)
1237     # On Win9x/ME, this test blows up -- it succeeds, but takes
1238     # about 5 minutes as the teststring grows exponentially.
1239     # Worse, since 9x/ME are not pre-emptively multitasking,
1240     # you end up with a "frozen" computer, even though with patience
1241     # the test eventually succeeds (with a max line length of 256k).
1242     # Instead, let's just punt: use the minimum linelength reported by
1243     # all of the supported platforms: 8192 (on NT/2K/XP).
<