libftdi: (gerd) add a real libftdi with autoconf stuff, remove include of usb.h in...
[libftdi] / aclocal.m4
1 # aclocal.m4 generated automatically by aclocal 1.5
2
3 # Copyright 1996, 1997, 1998, 1999, 2000, 2001
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
15 dnl    This file is part of the KDE libraries/packages
16 dnl    Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
17 dnl              (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
18
19 dnl    This file is free software; you can redistribute it and/or
20 dnl    modify it under the terms of the GNU Library General Public
21 dnl    License as published by the Free Software Foundation; either
22 dnl    version 2 of the License, or (at your option) any later version.
23
24 dnl    This library is distributed in the hope that it will be useful,
25 dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
26 dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27 dnl    Library General Public License for more details.
28
29 dnl    You should have received a copy of the GNU Library General Public License
30 dnl    along with this library; see the file COPYING.LIB.  If not, write to
31 dnl    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
32 dnl    Boston, MA 02111-1307, USA.
33
34 dnl IMPORTANT NOTE:
35 dnl Please do not modify this file unless you expect your modifications to be
36 dnl carried into every other module in the repository. 
37 dnl
38 dnl Single-module modifications are best placed in configure.in for kdelibs
39 dnl and kdebase or configure.in.in if present.
40
41 dnl ------------------------------------------------------------------------
42 dnl Forward compatibility macros (make autoconf 2.13 look like 2.50),
43 dnl thanks to Raja R Harinath.
44 dnl ------------------------------------------------------------------------
45 dnl
46 ifdef([_AC_PATH_X_XMKMF],[],
47    [AC_DEFUN([_AC_PATH_X_XMKMF],[AC_PATH_X_XMKMF])])
48 ifdef([AC_OUTPUT_SUBDIRS],[],
49    [AC_DEFUN([AC_OUTPUT_SUBDIRS],[subdirs=$1; _AC_OUTPUT_SUBDIRS])])
50
51 # KDE_PATH_X_DIRECT
52 dnl Internal subroutine of AC_PATH_X.
53 dnl Set ac_x_includes and/or ac_x_libraries.
54 AC_DEFUN(KDE_PATH_X_DIRECT,
55 [
56 AC_REQUIRE([KDE_CHECK_LIB64])
57
58 if test "$ac_x_includes" = NO; then
59   # Guess where to find include files, by looking for this one X11 .h file.
60   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
61
62   # First, try using that file with no special directory specified.
63 AC_TRY_CPP([#include <$x_direct_test_include>],
64 [# We can compile using X headers with no special include directory.
65 ac_x_includes=],
66 [# Look for the header file in a standard set of common directories.
67 # Check X11 before X11Rn because it is often a symlink to the current release.
68   for ac_dir in               \
69     /usr/X11/include          \
70     /usr/X11R6/include        \
71     /usr/X11R5/include        \
72     /usr/X11R4/include        \
73                               \
74     /usr/include/X11          \
75     /usr/include/X11R6        \
76     /usr/include/X11R5        \
77     /usr/include/X11R4        \
78                               \
79     /usr/local/X11/include    \
80     /usr/local/X11R6/include  \
81     /usr/local/X11R5/include  \
82     /usr/local/X11R4/include  \
83                               \
84     /usr/local/include/X11    \
85     /usr/local/include/X11R6  \
86     /usr/local/include/X11R5  \
87     /usr/local/include/X11R4  \
88                               \
89     /usr/X386/include         \
90     /usr/x386/include         \
91     /usr/XFree86/include/X11  \
92                               \
93     /usr/include              \
94     /usr/local/include        \
95     /usr/unsupported/include  \
96     /usr/athena/include       \
97     /usr/local/x11r5/include  \
98     /usr/lpp/Xamples/include  \
99                               \
100     /usr/openwin/include      \
101     /usr/openwin/share/include \
102     ; \
103   do
104     if test -r "$ac_dir/$x_direct_test_include"; then
105       ac_x_includes=$ac_dir
106       break
107     fi
108   done])
109 fi # $ac_x_includes = NO
110
111 if test "$ac_x_libraries" = NO; then
112   # Check for the libraries.
113
114   test -z "$x_direct_test_library" && x_direct_test_library=Xt
115   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
116
117   # See if we find them without any special options.
118   # Don't add to $LIBS permanently.
119   ac_save_LIBS="$LIBS"
120   LIBS="-l$x_direct_test_library $LIBS"
121 AC_TRY_LINK(, [${x_direct_test_function}()],
122 [LIBS="$ac_save_LIBS"
123 # We can link X programs with no special library path.
124 ac_x_libraries=],
125 [LIBS="$ac_save_LIBS"
126 # First see if replacing the include by lib works.
127 # Check X11 before X11Rn because it is often a symlink to the current release.
128 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \
129     /usr/X11/lib${kdelibsuff}           \
130     /usr/X11R6/lib${kdelibsuff}         \
131     /usr/X11R5/lib${kdelibsuff}         \
132     /usr/X11R4/lib${kdelibsuff}         \
133                                         \
134     /usr/lib${kdelibsuff}/X11           \
135     /usr/lib${kdelibsuff}/X11R6         \
136     /usr/lib${kdelibsuff}/X11R5         \
137     /usr/lib${kdelibsuff}/X11R4         \
138                                         \
139     /usr/local/X11/lib${kdelibsuff}     \
140     /usr/local/X11R6/lib${kdelibsuff}   \
141     /usr/local/X11R5/lib${kdelibsuff}   \
142     /usr/local/X11R4/lib${kdelibsuff}   \
143                                         \
144     /usr/local/lib${kdelibsuff}/X11     \
145     /usr/local/lib${kdelibsuff}/X11R6   \
146     /usr/local/lib${kdelibsuff}/X11R5   \
147     /usr/local/lib${kdelibsuff}/X11R4   \
148                                         \
149     /usr/X386/lib${kdelibsuff}          \
150     /usr/x386/lib${kdelibsuff}          \
151     /usr/XFree86/lib${kdelibsuff}/X11   \
152                                         \
153     /usr/lib${kdelibsuff}               \
154     /usr/local/lib${kdelibsuff}         \
155     /usr/unsupported/lib${kdelibsuff}   \
156     /usr/athena/lib${kdelibsuff}        \
157     /usr/local/x11r5/lib${kdelibsuff}   \
158     /usr/lpp/Xamples/lib${kdelibsuff}   \
159     /lib/usr/lib${kdelibsuff}/X11       \
160                                         \
161     /usr/openwin/lib${kdelibsuff}       \
162     /usr/openwin/share/lib${kdelibsuff} \
163     ; \
164 do
165 dnl Don't even attempt the hair of trying to link an X program!
166   for ac_extension in a so sl; do
167     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
168       ac_x_libraries=$ac_dir
169       break 2
170     fi
171   done
172 done])
173 fi # $ac_x_libraries = NO
174 ])
175
176
177 dnl ------------------------------------------------------------------------
178 dnl Find a file (or one of more files in a list of dirs)
179 dnl ------------------------------------------------------------------------
180 dnl
181 AC_DEFUN(AC_FIND_FILE,
182 [
183 $3=NO
184 for i in $2;
185 do
186   for j in $1;
187   do
188     echo "configure: __oline__: $i/$j" >&AC_FD_CC
189     if test -r "$i/$j"; then
190       echo "taking that" >&AC_FD_CC
191       $3=$i
192       break 2
193     fi
194   done
195 done
196 ])
197
198 dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,
199 dnl     if-not-found, test-parameter)
200 AC_DEFUN(KDE_FIND_PATH,
201 [
202    AC_MSG_CHECKING([for $1])
203    if test -n "$$2"; then
204         kde_cv_path="$$2";
205    else
206         kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
207
208         AC_CACHE_VAL(kde_cv_path_$kde_cache,
209         [
210         kde_cv_path="NONE"
211         dirs="$3"
212         kde_save_IFS=$IFS
213         IFS=':'
214         for dir in $PATH; do
215           dirs="$dirs $dir"
216         done
217         IFS=$kde_save_IFS
218
219         for dir in $dirs; do
220           if test -x "$dir/$1"; then
221             if test -n "$5"
222             then
223               evalstr="$dir/$1 $5 2>&1 "
224               if eval $evalstr; then
225                 kde_cv_path="$dir/$1"
226                 break
227               fi
228             else
229                 kde_cv_path="$dir/$1"
230                 break
231             fi
232           fi
233         done
234
235         eval "kde_cv_path_$kde_cache=$kde_cv_path"
236
237         ])
238
239       eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
240
241    fi
242
243    if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
244       AC_MSG_RESULT(not found)
245       $4
246    else
247       AC_MSG_RESULT($kde_cv_path)
248       $2=$kde_cv_path
249
250    fi
251 ])
252
253 AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
254 [
255     AC_MSG_ERROR([No Qt meta object compiler (moc) found!
256 Please check whether you installed Qt correctly.
257 You need to have a running moc binary.
258 configure tried to run $ac_cv_path_moc and the test didn't
259 succeed. If configure shouldn't have tried this one, set
260 the environment variable MOC to the right one before running
261 configure.
262 ])
263 ])
264
265 AC_DEFUN(KDE_UIC_ERROR_MESSAGE,
266 [
267     AC_MSG_WARN([No Qt ui compiler (uic) found!
268 Please check whether you installed Qt correctly.
269 You need to have a running uic binary.
270 configure tried to run $ac_cv_path_uic and the test didn't
271 succeed. If configure shouldn't have tried this one, set
272 the environment variable UIC to the right one before running
273 configure.
274 ])
275 ])
276
277
278 AC_DEFUN(KDE_CHECK_UIC_FLAG,
279 [
280     AC_MSG_CHECKING([whether uic supports -$1 ])
281     kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
282     AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
283     [
284         cat >conftest.ui <<EOT
285         <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
286 EOT
287         ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
288         if AC_TRY_EVAL(ac_uic_testrun); then
289             eval "kde_cv_prog_uic_$kde_cache=yes"
290         else
291             eval "kde_cv_prog_uic_$kde_cache=no"
292         fi
293         rm -f conftest*
294     ])
295
296     if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
297         AC_MSG_RESULT([yes])
298         :
299         $3
300     else
301         AC_MSG_RESULT([no])
302         :
303         $4
304     fi
305 ])
306
307
308 dnl ------------------------------------------------------------------------
309 dnl Find the meta object compiler and the ui compiler in the PATH,
310 dnl in $QTDIR/bin, and some more usual places
311 dnl ------------------------------------------------------------------------
312 dnl
313 AC_DEFUN(AC_PATH_QT_MOC_UIC,
314 [
315    qt_bindirs=""
316    for dir in $kde_qt_dirs; do
317       qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
318    done
319    qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
320    if test ! "$ac_qt_bindir" = "NO"; then
321       qt_bindirs="$ac_qt_bindir $qt_bindirs"
322    fi
323
324    KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
325    if test -z "$UIC_NOT_NEEDED"; then
326      KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
327      if test -z "$UIC_PATH" ; then
328        KDE_UIC_ERROR_MESSAGE
329        exit 1
330      elif test $kde_qtver = 3; then
331        KDE_CHECK_UIC_FLAG(L,[/nonexistant],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
332        KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
333
334        UIC=$UIC_PATH
335        if test x$ac_uic_supports_libpath = xyes; then
336            UIC="$UIC -L \$(kde_widgetdir)"
337        fi
338        if test x$ac_uic_supports_nounload = xyes; then
339            UIC="$UIC -nounload"
340        fi
341      fi
342    else
343      UIC="echo uic not available: "
344    fi
345
346    AC_SUBST(MOC)
347    AC_SUBST(UIC)
348
349    UIC_TR="i18n"
350    if test $kde_qtver = 3; then
351      UIC_TR="tr2i18n"
352    fi
353
354    AC_SUBST(UIC_TR)
355 ])
356
357 AC_DEFUN(KDE_1_CHECK_PATHS,
358 [
359   KDE_1_CHECK_PATH_HEADERS
360
361   KDE_TEST_RPATH=
362
363   if test -n "$USE_RPATH"; then
364
365      if test -n "$kde_libraries"; then
366        KDE_TEST_RPATH="-R $kde_libraries"
367      fi
368
369      if test -n "$qt_libraries"; then
370        KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
371      fi
372
373      if test -n "$x_libraries"; then
374        KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
375      fi
376
377      KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
378   fi
379
380 AC_MSG_CHECKING([for KDE libraries installed])
381 ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
382
383 if AC_TRY_EVAL(ac_link) && test -s conftest; then
384   AC_MSG_RESULT(yes)
385 else
386   AC_MSG_ERROR([your system fails at linking a small KDE application!
387 Check, if your compiler is installed correctly and if you have used the
388 same compiler to compile Qt and kdelibs as you did use now.
389 For more details about this problem, look at the end of config.log.])
390 fi
391
392 if eval `KDEDIR= ./conftest 2>&5`; then
393   kde_result=done
394 else
395   kde_result=problems
396 fi
397
398 KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
399 kde_have_all_paths=yes
400
401 KDE_SET_PATHS($kde_result)
402
403 ])
404
405 AC_DEFUN(KDE_SET_PATHS,
406 [
407   kde_cv_all_paths="kde_have_all_paths=\"yes\" \
408         kde_htmldir=\"$kde_htmldir\" \
409         kde_appsdir=\"$kde_appsdir\" \
410         kde_icondir=\"$kde_icondir\" \
411         kde_sounddir=\"$kde_sounddir\" \
412         kde_datadir=\"$kde_datadir\" \
413         kde_locale=\"$kde_locale\" \
414         kde_cgidir=\"$kde_cgidir\" \
415         kde_confdir=\"$kde_confdir\" \
416         kde_mimedir=\"$kde_mimedir\" \
417         kde_toolbardir=\"$kde_toolbardir\" \
418         kde_wallpaperdir=\"$kde_wallpaperdir\" \
419         kde_templatesdir=\"$kde_templatesdir\" \
420         kde_bindir=\"$kde_bindir\" \
421         kde_servicesdir=\"$kde_servicesdir\" \
422         kde_servicetypesdir=\"$kde_servicetypesdir\" \
423         kde_moduledir=\"$kde_moduledir\" \
424    kde_styledir=\"$kde_styledir\" \
425         kde_widgetdir=\"$kde_widgetdir\" \
426         kde_result=$1"
427 ])
428
429 AC_DEFUN(KDE_SET_DEFAULT_PATHS,
430 [
431 if test "$1" = "default"; then
432
433   if test -z "$kde_htmldir"; then
434     kde_htmldir='\${prefix}/share/doc/HTML'
435   fi
436   if test -z "$kde_appsdir"; then
437     kde_appsdir='\${prefix}/share/applnk'
438   fi
439   if test -z "$kde_icondir"; then
440     kde_icondir='\${prefix}/share/icons'
441   fi
442   if test -z "$kde_sounddir"; then
443     kde_sounddir='\${prefix}/share/sounds'
444   fi
445   if test -z "$kde_datadir"; then
446     kde_datadir='\${prefix}/share/apps'
447   fi
448   if test -z "$kde_locale"; then
449     kde_locale='\${prefix}/share/locale'
450   fi
451   if test -z "$kde_cgidir"; then
452     kde_cgidir='\${exec_prefix}/cgi-bin'
453   fi
454   if test -z "$kde_confdir"; then
455     kde_confdir='\${prefix}/share/config'
456   fi
457   if test -z "$kde_mimedir"; then
458     kde_mimedir='\${prefix}/share/mimelnk'
459   fi
460   if test -z "$kde_toolbardir"; then
461     kde_toolbardir='\${prefix}/share/toolbar'
462   fi
463   if test -z "$kde_wallpaperdir"; then
464     kde_wallpaperdir='\${prefix}/share/wallpapers'
465   fi
466   if test -z "$kde_templatesdir"; then
467     kde_templatesdir='\${prefix}/share/templates'
468   fi
469   if test -z "$kde_bindir"; then
470     kde_bindir='\${exec_prefix}/bin'
471   fi
472   if test -z "$kde_servicesdir"; then
473     kde_servicesdir='\${prefix}/share/services'
474   fi
475   if test -z "$kde_servicetypesdir"; then
476     kde_servicetypesdir='\${prefix}/share/servicetypes'
477   fi
478   if test -z "$kde_moduledir"; then
479     if test "$kde_qtver" = "2"; then
480       kde_moduledir='\${libdir}/kde2'
481     else
482       kde_moduledir='\${libdir}/kde3'
483     fi
484   fi
485   if test -z "$kde_styledir"; then
486     kde_styledir='\${libdir}/kde3/plugins/styles'
487   fi
488   if test -z "$kde_widgetdir"; then
489     kde_widgetdir='\${libdir}/kde3/plugins/designer'
490   fi
491
492   KDE_SET_PATHS(defaults)
493
494 else
495
496   if test $kde_qtver = 1; then
497      AC_MSG_RESULT([compiling])
498      KDE_1_CHECK_PATHS
499   else
500      AC_MSG_ERROR([path checking not yet supported for KDE 2])
501   fi
502
503 fi
504 ])
505
506 AC_DEFUN(KDE_CHECK_PATHS_FOR_COMPLETENESS,
507 [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
508    test -z "$kde_icondir" || test -z "$kde_sounddir" ||
509    test -z "$kde_datadir" || test -z "$kde_locale"  ||
510    test -z "$kde_cgidir"  || test -z "$kde_confdir" ||
511    test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
512    test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
513    test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
514    test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
515    test -z "$kde_styledir" || test -z "kde_widgetdir" 
516    test "x$kde_have_all_paths" != "xyes"; then
517      kde_have_all_paths=no
518   fi
519 ])
520
521 AC_DEFUN(KDE_MISSING_PROG_ERROR,
522 [
523     AC_MSG_ERROR([The important program $1 was not found!
524 Please check whether you installed KDE correctly.
525 ])
526 ])
527
528 AC_DEFUN(KDE_MISSING_ARTS_ERROR,
529 [
530     AC_MSG_ERROR([The important program $1 was not found!
531 Please check whether you installed aRts correctly.
532 ])
533 ])
534
535 AC_DEFUN(KDE_SUBST_PROGRAMS,
536 [
537
538         kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin"
539         test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
540         if test -n "$KDEDIRS"; then
541            kde_save_IFS=$IFS
542            IFS=:
543            for dir in $KDEDIRS; do
544                 kde_default_bindirs="$dir/bin $kde_default_bindirs "
545            done
546            IFS=$kde_save_IFS
547         fi
548         kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
549         KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
550         KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
551         KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
552         KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
553         KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs])
554         KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
555       
556         if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then  
557             kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
558             test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
559             AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
560             if test "$KDE_XSL_STYLESHEET" = "NO"; then
561                 KDE_XSL_STYLESHEET=""
562             else
563                 KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
564             fi
565         fi
566
567         DCOP_DEPENDENCIES='$(DCOPIDL)'
568         AC_SUBST(DCOPIDL)
569         AC_SUBST(DCOPIDL2CPP)
570         AC_SUBST(DCOP_DEPENDENCIES)
571         AC_SUBST(MCOPIDL)
572         AC_SUBST(ARTSCCONFIG)
573         AC_SUBST(KDECONFIG)
574         AC_SUBST(MEINPROC)
575         AC_SUBST(KDE_XSL_STYLESHEET)
576
577         if test -x "$KDECONFIG"; then # it can be "compiled"
578           kde_libs_prefix=`$KDECONFIG --prefix`
579           if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
580                AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
581                           This means it has been moved since you installed it.
582                           This won't work. Please recompile kdelibs for the new prefix.
583                           ])
584            fi
585            kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
586         else
587            kde_libs_prefix='$(prefix)'
588            kde_libs_htmldir='$(kde_htmldir)'
589         fi
590         AC_SUBST(kde_libs_prefix)
591         AC_SUBST(kde_libs_htmldir)
592 ])dnl
593
594 AC_DEFUN(AC_CREATE_KFSSTND,
595 [
596 AC_REQUIRE([AC_CHECK_RPATH])
597
598 AC_MSG_CHECKING([for KDE paths])
599 kde_result=""
600 kde_cached_paths=yes
601 AC_CACHE_VAL(kde_cv_all_paths,
602 [
603   KDE_SET_DEFAULT_PATHS($1)
604   kde_cached_paths=no
605 ])
606 eval "$kde_cv_all_paths"
607 KDE_CHECK_PATHS_FOR_COMPLETENESS
608 if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
609   # wrong values were cached, may be, we can set better ones
610   kde_result=
611   kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
612   kde_datadir= kde_locale=  kde_cgidir=  kde_confdir=
613   kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
614   kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
615   kde_have_all_paths=
616   kde_styledir=
617   kde_widgetdir=
618   KDE_SET_DEFAULT_PATHS($1)
619   eval "$kde_cv_all_paths"
620   KDE_CHECK_PATHS_FOR_COMPLETENESS
621   kde_result="$kde_result (cache overridden)"
622 fi
623 if test "$kde_have_all_paths" = "no"; then
624   AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
625 Since it had compiled and linked before, it must be a strange problem on your system.
626 Look at config.log for details. If you are not able to fix this, look at
627 http://www.kde.org/faq/installation.html or any www.kde.org mirror.
628 (If you're using an egcs version on Linux, you may update binutils!)
629 ])
630 else
631   rm -f conftest*
632   AC_MSG_RESULT($kde_result)
633 fi
634
635 bindir=$kde_bindir
636
637 KDE_SUBST_PROGRAMS
638
639 ])
640
641 AC_DEFUN(AC_SUBST_KFSSTND,
642 [
643 AC_SUBST(kde_htmldir)
644 AC_SUBST(kde_appsdir)
645 AC_SUBST(kde_icondir)
646 AC_SUBST(kde_sounddir)
647 AC_SUBST(kde_datadir)
648 AC_SUBST(kde_locale)
649 AC_SUBST(kde_confdir)
650 AC_SUBST(kde_mimedir)
651 AC_SUBST(kde_wallpaperdir)
652 AC_SUBST(kde_bindir)
653 dnl for KDE 2
654 AC_SUBST(kde_templatesdir)
655 AC_SUBST(kde_servicesdir)
656 AC_SUBST(kde_servicetypesdir)
657 AC_SUBST(kde_moduledir)
658 AC_SUBST(kde_styledir)
659 AC_SUBST(kde_widgetdir)
660 if test "$kde_qtver" = 1; then
661   kde_minidir="$kde_icondir/mini"
662 else
663 # for KDE 1 - this breaks KDE2 apps using minidir, but
664 # that's the plan ;-/
665   kde_minidir="/dev/null"
666 fi
667 dnl AC_SUBST(kde_minidir)
668 dnl AC_SUBST(kde_cgidir)
669 dnl AC_SUBST(kde_toolbardir)
670 ])
671
672 AC_DEFUN(KDE_MISC_TESTS,
673 [
674    AC_LANG_C
675    dnl Checks for libraries.
676    AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD 
677    AC_SUBST(LIBUTIL)
678    AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
679    AC_SUBST(LIBCOMPAT)
680    kde_have_crypt=
681    AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
682       AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
683         AC_MSG_WARN([you have no crypt in either libcrypt or libc.
684 You should install libcrypt from another source or configure with PAM
685 support])
686         kde_have_crypt=no
687       ]))
688    AC_SUBST(LIBCRYPT)
689    if test $kde_have_crypt = yes; then
690       AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
691    fi
692    AC_CHECK_SOCKLEN_T
693    AC_LANG_C
694    AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
695    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
696       AC_CHECK_LIB(dnet_stub, dnet_ntoa,
697         [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
698    fi
699    AC_CHECK_FUNC(inet_ntoa)
700    if test $ac_cv_func_inet_ntoa = no; then
701      AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
702    fi
703    AC_CHECK_FUNC(connect)
704    if test $ac_cv_func_connect = no; then
705       AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
706         $X_EXTRA_LIBS)
707    fi
708
709    AC_CHECK_FUNC(remove)
710    if test $ac_cv_func_remove = no; then
711       AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
712    fi
713
714    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
715    AC_CHECK_FUNC(shmat, ,
716      AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
717    
718    # darwin needs this to initialize the environment
719    AC_CHECK_HEADERS(crt_externs.h)
720    AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
721  
722    # more headers that need to be explicitly included on darwin
723    AC_CHECK_HEADERS(sys/types.h stdint.h)
724
725    # darwin requires a poll emulation library
726    AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
727
728    # CoreAudio framework
729    AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
730      AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
731      FRAMEWORK_COREAUDIO="-framework CoreAudio"
732    ])
733
734    AC_CHECK_RES_INIT
735    AC_SUBST(LIB_POLL)
736    AC_SUBST(FRAMEWORK_COREAUDIO)
737    LIBSOCKET="$X_EXTRA_LIBS"
738    AC_SUBST(LIBSOCKET)
739    AC_SUBST(X_EXTRA_LIBS)
740    AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
741    AC_SUBST(LIBUCB)
742
743    case $host in  dnl this *is* LynxOS specific
744    *-*-lynxos* )
745         AC_MSG_CHECKING([LynxOS header file wrappers])
746         [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
747         AC_MSG_RESULT(disabled)
748         AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
749          ;;
750     esac
751
752    KDE_CHECK_TYPES
753    KDE_CHECK_LIBDL
754
755 AH_VERBATIM(_AIX_STRINGS_H_BZERO,
756 [
757 /*
758  * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
759  * that defines bzero.
760  */
761
762 #if defined(_AIX)
763 #include <strings.h>
764 #endif
765 ])
766
767 AC_CHECK_FUNCS([vsnprintf snprintf])
768
769 AH_VERBATIM(_TRU64,[
770 /*
771  * On HP-UX, the declaration of vsnprintf() is needed every time !
772  */
773
774 #if !defined(HAVE_VSNPRINTF) || defined(hpux)
775 #if __STDC__
776 #include <stdarg.h>
777 #include <stdlib.h>
778 #else
779 #include <varargs.h>
780 #endif
781 #ifdef __cplusplus
782 extern "C"
783 #endif
784 int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
785 #ifdef __cplusplus
786 extern "C"
787 #endif
788 int snprintf(char *str, size_t n, char const *fmt, ...);
789 #endif
790 ])
791
792 ])
793
794 dnl ------------------------------------------------------------------------
795 dnl Find the header files and libraries for X-Windows. Extended the
796 dnl macro AC_PATH_X
797 dnl ------------------------------------------------------------------------
798 dnl
799 AC_DEFUN(K_PATH_X,
800 [
801 AC_REQUIRE([KDE_MISC_TESTS])dnl
802 AC_REQUIRE([KDE_CHECK_LIB64])
803
804 AC_ARG_ENABLE(
805   embedded,
806   [  --enable-embedded       link to Qt-embedded, don't use X],
807   kde_use_qt_emb=$enableval,
808   kde_use_qt_emb=no
809 )
810
811 AC_ARG_ENABLE(
812   qtopia,
813   [  --enable-qtopia         link to Qt-embedded, link to the Qtopia Environment],
814   kde_use_qt_emb_palm=$enableval,
815   kde_use_qt_emb_palm=no
816 )
817
818 if test "$kde_use_qt_emb" = "no"; then
819
820 AC_MSG_CHECKING(for X)
821 AC_LANG_SAVE
822 AC_LANG_C
823 AC_CACHE_VAL(kde_cv_have_x,
824 [# One or both of the vars are not set, and there is no cached value.
825 if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
826    kde_x_includes=NO
827 else
828    kde_x_includes=$x_includes
829 fi
830 if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
831    kde_x_libraries=NO
832 else
833    kde_x_libraries=$x_libraries
834 fi
835
836 # below we use the standard autoconf calls
837 ac_x_libraries=$kde_x_libraries
838 ac_x_includes=$kde_x_includes
839
840 KDE_PATH_X_DIRECT
841 dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
842 dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
843 dnl location. The correct location is /usr/lib32 or an undefined value
844 dnl (the linker is smart enough to pick the correct default library).
845 dnl Things work just fine if you use just AC_PATH_X_DIRECT.
846 dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
847 dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
848 dnl x_includes should be left alone.
849 case "$host" in
850 mips-sgi-irix6*)
851   ;;
852 *-*-solaris*)
853   ;;
854 *)
855   _AC_PATH_X_XMKMF
856   if test -z "$ac_x_includes"; then
857     ac_x_includes="."
858   fi
859   if test -z "$ac_x_libraries"; then
860     ac_x_libraries="/usr/lib${kdelibsuff}"
861   fi
862 esac
863 #from now on we use our own again
864
865 # when the user already gave --x-includes, we ignore
866 # what the standard autoconf macros told us.
867 if test "$kde_x_includes" = NO; then
868   kde_x_includes=$ac_x_includes
869 fi
870
871 # for --x-libraries too
872 if test "$kde_x_libraries" = NO; then
873   kde_x_libraries=$ac_x_libraries
874 fi
875
876 if test "$kde_x_includes" = NO; then
877   AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
878 fi
879
880 if test "$kde_x_libraries" = NO; then
881   AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
882 fi
883
884 # Record where we found X for the cache.
885 kde_cv_have_x="have_x=yes \
886          kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
887 ])dnl
888
889 eval "$kde_cv_have_x"
890
891 if test "$have_x" != yes; then
892   AC_MSG_RESULT($have_x)
893   no_x=yes
894 else
895   AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
896 fi
897
898 if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
899   X_INCLUDES=""
900   x_includes="."; dnl better than nothing :-
901  else
902   x_includes=$kde_x_includes
903   X_INCLUDES="-I$x_includes"
904 fi
905
906 if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
907   X_LDFLAGS=""
908   x_libraries="/usr/lib"; dnl better than nothing :-
909  else
910   x_libraries=$kde_x_libraries
911   X_LDFLAGS="-L$x_libraries"
912 fi
913 all_includes="$X_INCLUDES"
914 all_libraries="$X_LDFLAGS"
915
916 AC_SUBST(X_INCLUDES)
917 AC_SUBST(X_LDFLAGS)
918 AC_SUBST(x_libraries)
919 AC_SUBST(x_includes)
920
921 # Check for libraries that X11R6 Xt/Xaw programs need.
922 ac_save_LDFLAGS="$LDFLAGS"
923 LDFLAGS="$LDFLAGS $X_LDFLAGS"
924 # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
925 # check for ICE first), but we must link in the order -lSM -lICE or
926 # we get undefined symbols.  So assume we have SM if we have ICE.
927 # These have to be linked with before -lX11, unlike the other
928 # libraries we check for below, so use a different variable.
929 #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
930 AC_CHECK_LIB(ICE, IceConnectionNumber,
931   [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
932 AC_SUBST(LIBSM)
933 LDFLAGS="$ac_save_LDFLAGS"
934
935 AC_SUBST(X_PRE_LIBS)
936
937 LIB_X11='-lX11 $(LIBSOCKET)'
938 AC_SUBST(LIB_X11)
939
940 AC_MSG_CHECKING(for libXext)
941 AC_CACHE_VAL(kde_cv_have_libXext,
942 [
943 kde_ldflags_safe="$LDFLAGS"
944 kde_libs_safe="$LIBS"
945
946 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
947 LIBS="-lXext -lX11 $LIBSOCKET"
948
949 AC_TRY_LINK([
950 #include <stdio.h>
951 #ifdef STDC_HEADERS
952 # include <stdlib.h>
953 #endif
954 ],
955 [
956 printf("hello Xext\n");
957 ],
958 kde_cv_have_libXext=yes,
959 kde_cv_have_libXext=no
960    )
961
962 LDFLAGS=$kde_ldflags_safe
963 LIBS=$kde_libs_safe
964  ])
965
966 AC_MSG_RESULT($kde_cv_have_libXext)
967
968 if test "$kde_cv_have_libXext" = "no"; then
969   AC_MSG_ERROR([We need a working libXext to proceed. Since configure
970 can't find it itself, we stop here assuming that make wouldn't find
971 them either.])
972 fi
973
974 AC_MSG_CHECKING(for Xinerama)
975
976  AC_ARG_WITH(xinerama,
977   [  --with-xinerama         enable support for Xinerama ],
978   [
979     no_xinerama=no
980   ], [
981     no_xinerama=yes
982   ]
983 )
984
985 kde_save_LDFLAGS="$LDFLAGS"
986 kde_save_CFLAGS="$CFLAGS"
987 kde_save_LIBS="$LIBS"
988 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
989 CFLAGS="$CFLAGS -I$x_includes"
990 LIBS="-lXinerama -lXext"
991
992 if test "x$no_xinerama" = "xno"; then
993
994   AC_CACHE_VAL(ac_cv_have_xinerama,
995   [
996           AC_TRY_LINK([#include <X11/Xlib.h>
997                         #include <X11/extensions/Xinerama.h>],
998                   [XineramaIsActive(NULL);],
999                   [ac_cv_have_xinerama="yes"],
1000                   [ac_cv_have_xinerama="no"])
1001   ])
1002 else
1003   ac_cv_have_xinerama=no;
1004 fi
1005
1006 AC_MSG_RESULT($ac_cv_have_xinerama)
1007
1008 LIBXINERAMA=""
1009
1010 if test "$ac_cv_have_xinerama" = "yes"; then
1011   AC_DEFINE(HAVE_XINERAMA, 1, [Define if you want Xinerama support])
1012   LIBXINERAMA="-lXinerama"
1013 fi
1014
1015 AC_SUBST(LIBXINERAMA)
1016
1017 LDFLAGS="$kde_save_LDFLAGS"
1018 CFLAGS="$kde_save_CFLAGS"
1019 LIBS="$kde_save_LIBS"
1020
1021 LIB_XEXT="-lXext"
1022 QTE_NORTTI=""
1023
1024 else
1025   dnl We're using QT Embedded
1026   CPPFLAGS=-DQWS
1027   CXXFLAGS="$CXXFLAGS -fno-rtti"
1028   QTE_NORTTI="-fno-rtti -DQWS"
1029   X_PRE_LIBS=""
1030   LIB_X11=""
1031   LIB_XEXT=""
1032   LIBSM=""
1033   X_INCLUDES=""
1034   X_LDFLAGS=""
1035   x_includes=""
1036   x_libraries=""
1037   AC_SUBST(X_PRE_LIBS)
1038   AC_SUBST(LIB_X11)
1039   AC_SUBST(LIBSM)
1040   AC_SUBST(X_INCLUDES)
1041   AC_SUBST(X_LDFLAGS)
1042   AC_SUBST(x_includes)
1043   AC_SUBST(x_libraries)
1044 fi
1045 AC_SUBST(QTE_NORTTI)
1046 AC_SUBST(LIB_XEXT)
1047
1048
1049 AC_LANG_RESTORE
1050
1051 ])
1052
1053 AC_DEFUN(KDE_PRINT_QT_PROGRAM,
1054 [
1055 AC_REQUIRE([KDE_USE_QT])
1056 cat > conftest.$ac_ext <<EOF
1057 #include "confdefs.h"
1058 #include <qglobal.h>
1059 #include <qapplication.h>
1060 EOF
1061 if test "$kde_qtver" = "2"; then
1062 cat >> conftest.$ac_ext <<EOF
1063 #include <qevent.h>
1064 #include <qstring.h>
1065 #include <qstyle.h>
1066 EOF
1067
1068 if test $kde_qtsubver -gt 0; then
1069 cat >> conftest.$ac_ext <<EOF
1070 #if QT_VERSION < 210
1071 #error 1
1072 #endif
1073 EOF
1074 fi
1075 fi
1076
1077 if test "$kde_qtver" = "3"; then
1078 cat >> conftest.$ac_ext <<EOF
1079 #include <qcursor.h>
1080 #include <qstylefactory.h>
1081 #include <private/qucomextra_p.h>
1082 EOF
1083 fi
1084
1085 echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
1086 cat >> conftest.$ac_ext <<EOF
1087 #error 1
1088 #endif
1089
1090 int main() {
1091 EOF
1092 if test "$kde_qtver" = "2"; then
1093 cat >> conftest.$ac_ext <<EOF
1094     QStringList *t = new QStringList();
1095     Q_UNUSED(t);
1096 EOF
1097 if test $kde_qtsubver -gt 0; then
1098 cat >> conftest.$ac_ext <<EOF
1099     QString s;
1100     s.setLatin1("Elvis is alive", 14);
1101 EOF
1102 fi
1103 fi
1104 if test "$kde_qtver" = "3"; then
1105 cat >> conftest.$ac_ext <<EOF
1106     (void)QStyleFactory::create(QString::null);
1107     QCursor c(Qt::WhatsThisCursor);
1108 EOF
1109 fi
1110 cat >> conftest.$ac_ext <<EOF
1111     return 0;
1112 }
1113 EOF
1114 ])
1115
1116 AC_DEFUN(KDE_USE_QT,
1117 [
1118 if test -z "$1"; then
1119   # Current default Qt version: 3.1
1120   kde_qtver=3
1121   kde_qtsubver=1
1122 else
1123   kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
1124   # following is the check if subversion isnt found in passed argument
1125   if test "$kde_qtsubver" = "$1"; then
1126     kde_qtsubver=1
1127   fi
1128   kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
1129   if test "$kde_qtver" = "1"; then
1130     kde_qtsubver=42
1131   fi
1132 fi
1133
1134 if test -z "$2"; then
1135   if test "$kde_qtver" = "2"; then
1136     if test $kde_qtsubver -gt 0; then
1137       kde_qt_minversion=">= Qt 2.2.2"
1138     else
1139       kde_qt_minversion=">= Qt 2.0.2"
1140     fi
1141   fi
1142   if test "$kde_qtver" = "3"; then
1143     if test $kde_qtsubver -gt 0; then
1144       kde_qt_minversion=">= Qt 3.1 (20021021)"
1145     else
1146       kde_qt_minversion=">= Qt 3.0"
1147     fi
1148   fi
1149   if test "$kde_qtver" = "1"; then
1150     kde_qt_minversion=">= 1.42 and < 2.0"
1151   fi
1152 else
1153    kde_qt_minversion=$2
1154 fi
1155
1156 if test -z "$3"; then
1157    if test $kde_qtver = 3; then
1158      if test $kde_qtsubver -gt 0; then
1159        kde_qt_verstring="QT_VERSION >= 0x030100"
1160      else
1161        kde_qt_verstring="QT_VERSION >= 300"
1162      fi
1163    fi
1164    if test $kde_qtver = 2; then
1165      if test $kde_qtsubver -gt 0; then
1166        kde_qt_verstring="QT_VERSION >= 222"
1167      else
1168        kde_qt_verstring="QT_VERSION >= 200"
1169      fi
1170    fi
1171    if test $kde_qtver = 1; then
1172     kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
1173    fi
1174 else
1175    kde_qt_verstring=$3
1176 fi
1177
1178 if test $kde_qtver = 3; then
1179   kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt"
1180 fi
1181 if test $kde_qtver = 2; then
1182    kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
1183 fi
1184 if test $kde_qtver = 1; then
1185    kde_qt_dirs="$QTDIR /usr/lib/qt"
1186 fi
1187 ])
1188
1189 AC_DEFUN(KDE_CHECK_QT_DIRECT,
1190 [
1191 AC_REQUIRE([KDE_USE_QT])
1192 AC_MSG_CHECKING([if Qt compiles without flags])
1193 AC_CACHE_VAL(kde_cv_qt_direct,
1194 [
1195 AC_LANG_SAVE
1196 AC_LANG_CPLUSPLUS
1197 ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
1198 ac_LIBRARY_PATH="$LIBRARY_PATH"
1199 ac_cxxflags_safe="$CXXFLAGS"
1200 ac_ldflags_safe="$LDFLAGS"
1201 ac_libs_safe="$LIBS"
1202
1203 CXXFLAGS="$CXXFLAGS -I$qt_includes"
1204 LDFLAGS="$LDFLAGS $X_LDFLAGS"
1205 if test "x$kde_use_qt_emb" != "xyes"; then
1206 LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
1207 else
1208 LIBS="$LIBQT $LIBSOCKET"
1209 fi
1210 LD_LIBRARY_PATH=
1211 export LD_LIBRARY_PATH
1212 LIBRARY_PATH=
1213 export LIBRARY_PATH
1214
1215 KDE_PRINT_QT_PROGRAM
1216
1217 if AC_TRY_EVAL(ac_link) && test -s conftest; then
1218   kde_cv_qt_direct="yes"
1219 else
1220   kde_cv_qt_direct="no"
1221   echo "configure: failed program was:" >&AC_FD_CC
1222   cat conftest.$ac_ext >&AC_FD_CC
1223 fi
1224
1225 rm -f conftest*
1226 CXXFLAGS="$ac_cxxflags_safe"
1227 LDFLAGS="$ac_ldflags_safe"
1228 LIBS="$ac_libs_safe"
1229
1230 LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
1231 export LD_LIBRARY_PATH
1232 LIBRARY_PATH="$ac_LIBRARY_PATH"
1233 export LIBRARY_PATH
1234 AC_LANG_RESTORE
1235 ])
1236
1237 if test "$kde_cv_qt_direct" = "yes"; then
1238   AC_MSG_RESULT(yes)
1239   $1
1240 else
1241   AC_MSG_RESULT(no)
1242   $2
1243 fi
1244 ])
1245
1246 dnl ------------------------------------------------------------------------
1247 dnl Try to find the Qt headers and libraries.
1248 dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
1249 dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
1250 dnl ------------------------------------------------------------------------
1251 dnl
1252 AC_DEFUN(AC_PATH_QT_1_3,
1253 [
1254 AC_REQUIRE([K_PATH_X])
1255 AC_REQUIRE([KDE_USE_QT])
1256 AC_REQUIRE([KDE_CHECK_LIB64])
1257
1258 dnl ------------------------------------------------------------------------
1259 dnl Add configure flag to enable linking to MT version of Qt library.
1260 dnl ------------------------------------------------------------------------
1261
1262 AC_ARG_ENABLE(
1263   mt,
1264   [  --disable-mt            link to non-threaded Qt (deprecated)],
1265   kde_use_qt_mt=$enableval,
1266   [
1267     if test $kde_qtver = 3; then
1268       kde_use_qt_mt=yes
1269     else
1270       kde_use_qt_mt=no
1271     fi
1272   ]
1273 )
1274
1275 USING_QT_MT=""
1276
1277 dnl ------------------------------------------------------------------------
1278 dnl If we not get --disable-qt-mt then adjust some vars for the host.
1279 dnl ------------------------------------------------------------------------
1280
1281 KDE_MT_LDFLAGS=
1282 KDE_MT_LIBS=
1283 if test "x$kde_use_qt_mt" = "xyes"; then
1284   KDE_CHECK_THREADING
1285   if test "x$kde_use_threading" = "xyes"; then
1286     CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
1287     KDE_MT_LDFLAGS="$USE_THREADS"
1288     KDE_MT_LIBS="$LIBPTHREAD"
1289   else
1290     kde_use_qt_mt=no
1291   fi
1292 fi
1293 AC_SUBST(KDE_MT_LDFLAGS)
1294 AC_SUBST(KDE_MT_LIBS)
1295
1296 kde_qt_was_given=yes
1297
1298 dnl ------------------------------------------------------------------------
1299 dnl If we haven't been told how to link to Qt, we work it out for ourselves.
1300 dnl ------------------------------------------------------------------------
1301 if test -z "$LIBQT_GLOB"; then
1302   if test "x$kde_use_qt_emb" = "xyes"; then
1303     LIBQT_GLOB="libqte.*"
1304   else
1305     LIBQT_GLOB="libqt.*"
1306   fi
1307 fi
1308
1309 if test -z "$LIBQT"; then
1310 dnl ------------------------------------------------------------
1311 dnl If we got --enable-embedded then adjust the Qt library name.
1312 dnl ------------------------------------------------------------
1313   if test "x$kde_use_qt_emb" = "xyes"; then
1314     qtlib="qte"
1315   else
1316     qtlib="qt"
1317   fi
1318
1319   kde_int_qt="-l$qtlib"
1320 else
1321   kde_int_qt="$LIBQT"
1322   kde_lib_qt_set=yes
1323 fi
1324
1325 if test -z "$LIBQPE"; then
1326 dnl ------------------------------------------------------------
1327 dnl If we got --enable-palmtop then add -lqpe to the link line
1328 dnl ------------------------------------------------------------
1329   if test "x$kde_use_qt_emb" = "xyes"; then
1330     if test "x$kde_use_qt_emb_palm" = "xyes"; then
1331       LIB_QPE="-lqpe"
1332     else
1333       LIB_QPE=""
1334     fi
1335   else
1336     LIB_QPE=""
1337   fi
1338 fi
1339
1340 dnl ------------------------------------------------------------------------
1341 dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
1342 dnl ------------------------------------------------------------------------
1343
1344 if test "x$kde_use_qt_mt" = "xyes"; then
1345   if test -z "$LIBQT"; then
1346     LIBQT="-l$qtlib-mt"
1347     kde_int_qt="-l$qtlib-mt"
1348   else
1349     LIBQT="$qtlib-mt"
1350     kde_int_qt="$qtlib-mt"
1351   fi
1352   LIBQT_GLOB="lib$qtlib-mt.*"
1353   USING_QT_MT="using -mt"
1354 else
1355   LIBQT="-l$qtlib"
1356 fi
1357
1358 if test $kde_qtver != 1; then
1359
1360   AC_REQUIRE([AC_FIND_PNG])
1361   AC_REQUIRE([AC_FIND_JPEG])
1362   LIBQT="$LIBQT $LIBPNG $LIBJPEG"
1363 fi
1364
1365 if test $kde_qtver = 3; then
1366   AC_REQUIRE([KDE_CHECK_LIBDL])
1367   LIBQT="$LIBQT $LIBDL"
1368 fi
1369
1370 AC_MSG_CHECKING([for Qt])
1371
1372 if test "x$kde_use_qt_emb" != "xyes"; then
1373 LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
1374 fi
1375 ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
1376 qt_libraries=""
1377 qt_includes=""
1378 AC_ARG_WITH(qt-dir,
1379     [  --with-qt-dir=DIR       where the root of Qt is installed ],
1380     [  ac_qt_includes="$withval"/include
1381        ac_qt_libraries="$withval"/lib${kdelibsuff}
1382        ac_qt_bindir="$withval"/bin
1383     ])
1384
1385 AC_ARG_WITH(qt-includes,
1386     [  --with-qt-includes=DIR  where the Qt includes are. ],
1387     [
1388        ac_qt_includes="$withval"
1389     ])
1390
1391 kde_qt_libs_given=no
1392
1393 AC_ARG_WITH(qt-libraries,
1394     [  --with-qt-libraries=DIR where the Qt library is installed.],
1395     [  ac_qt_libraries="$withval"
1396        kde_qt_libs_given=yes
1397     ])
1398
1399 AC_CACHE_VAL(ac_cv_have_qt,
1400 [#try to guess Qt locations
1401
1402 qt_incdirs=""
1403 for dir in $kde_qt_dirs; do
1404    qt_incdirs="$qt_incdirs $dir/include $dir"
1405 done
1406 qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 $x_includes"
1407 if test ! "$ac_qt_includes" = "NO"; then
1408    qt_incdirs="$ac_qt_includes $qt_incdirs"
1409 fi
1410
1411 if test "$kde_qtver" != "1"; then
1412   kde_qt_header=qstyle.h
1413 else
1414   kde_qt_header=qglobal.h
1415 fi
1416
1417 AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
1418 ac_qt_includes="$qt_incdir"
1419
1420 qt_libdirs=""
1421 for dir in $kde_qt_dirs; do
1422    qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir"
1423 done
1424 qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
1425 if test ! "$ac_qt_libraries" = "NO"; then
1426   qt_libdir=$ac_qt_libraries
1427 else
1428   qt_libdirs="$ac_qt_libraries $qt_libdirs"
1429   # if the Qt was given, the chance is too big that libqt.* doesn't exist
1430   qt_libdir=NONE
1431   for dir in $qt_libdirs; do
1432     try="ls -1 $dir/${LIBQT_GLOB}"
1433     if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
1434   done
1435 fi
1436
1437 ac_qt_libraries="$qt_libdir"
1438
1439 AC_LANG_SAVE
1440 AC_LANG_CPLUSPLUS
1441
1442 ac_cxxflags_safe="$CXXFLAGS"
1443 ac_ldflags_safe="$LDFLAGS"
1444 ac_libs_safe="$LIBS"
1445
1446 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
1447 LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
1448 LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
1449
1450 KDE_PRINT_QT_PROGRAM
1451
1452 if AC_TRY_EVAL(ac_link) && test -s conftest; then
1453   rm -f conftest*
1454 else
1455   echo "configure: failed program was:" >&AC_FD_CC
1456   cat conftest.$ac_ext >&AC_FD_CC
1457   ac_qt_libraries="NO"
1458 fi
1459 rm -f conftest*
1460 CXXFLAGS="$ac_cxxflags_safe"
1461 LDFLAGS="$ac_ldflags_safe"
1462 LIBS="$ac_libs_safe"
1463
1464 AC_LANG_RESTORE
1465 if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
1466   ac_cv_have_qt="have_qt=no"
1467   ac_qt_notfound=""
1468   missing_qt_mt=""
1469   if test "$ac_qt_includes" = NO; then
1470     if test "$ac_qt_libraries" = NO; then
1471       ac_qt_notfound="(headers and libraries)";
1472     else
1473       ac_qt_notfound="(headers)";
1474     fi
1475   else
1476     if test "x$kde_use_qt_mt" = "xyes"; then
1477        missing_qt_mt="
1478 Make sure that you have compiled Qt with thread support!"
1479        ac_qt_notfound="(library $qtlib-mt)";
1480     else
1481        ac_qt_notfound="(library $qtlib)";
1482     fi
1483   fi
1484
1485   AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
1486 For more details about this problem, look at the end of config.log.$missing_qt_mt])
1487 else
1488   have_qt="yes"
1489 fi
1490 ])
1491
1492 eval "$ac_cv_have_qt"
1493
1494 if test "$have_qt" != yes; then
1495   AC_MSG_RESULT([$have_qt]);
1496 else
1497   ac_cv_have_qt="have_qt=yes \
1498     ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
1499   AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
1500
1501   qt_libraries="$ac_qt_libraries"
1502   qt_includes="$ac_qt_includes"
1503 fi
1504
1505 if test ! "$kde_qt_libs_given" = "yes"; then
1506 KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
1507 fi
1508
1509 AC_SUBST(qt_libraries)
1510 AC_SUBST(qt_includes)
1511
1512 if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
1513  QT_INCLUDES=""
1514 else
1515  QT_INCLUDES="-I$qt_includes"
1516  all_includes="$QT_INCLUDES $all_includes"
1517 fi
1518
1519 if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
1520  QT_LDFLAGS=""
1521 else
1522  QT_LDFLAGS="-L$qt_libraries"
1523  all_libraries="$all_libraries $QT_LDFLAGS"
1524 fi
1525 test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
1526
1527 AC_SUBST(QT_INCLUDES)
1528 AC_SUBST(QT_LDFLAGS)
1529 AC_PATH_QT_MOC_UIC
1530
1531 KDE_CHECK_QT_JPEG
1532
1533 if test "x$kde_use_qt_emb" != "xyes"; then
1534 LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
1535 else
1536 LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG)'
1537 fi
1538 test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
1539
1540 AC_SUBST(LIB_QT)
1541 AC_SUBST(LIB_QPE)
1542
1543 AC_SUBST(kde_qtver)
1544 ])
1545
1546 AC_DEFUN(AC_PATH_QT,
1547 [
1548 AC_PATH_QT_1_3
1549 ])
1550
1551 AC_DEFUN(KDE_CHECK_UIC_PLUGINS,
1552 [
1553 AC_REQUIRE([AC_PATH_QT_MOC_UIC])
1554
1555 if test x$ac_uic_supports_libpath = xyes; then
1556
1557 AC_MSG_CHECKING([if UIC has KDE plugins available])
1558 AC_CACHE_VAL(kde_cv_uic_plugins,
1559 [
1560 cat > actest.ui << EOF
1561 <!DOCTYPE UI><UI version="3.0" stdsetdef="1">
1562 <class>NewConnectionDialog</class>
1563 <widget class="QDialog">
1564    <widget class="KLineEdit">
1565         <property name="name">
1566            <cstring>testInput</cstring>
1567         </property>
1568    </widget>
1569 </widget>
1570 </UI>
1571 EOF
1572        
1573
1574
1575 kde_cv_uic_plugins=no
1576 kde_line="$UIC_PATH -L $kde_widgetdir"
1577 if test x$ac_uic_supports_nounload = xyes; then
1578    kde_line="$kde_line -nounload"
1579 fi
1580 kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
1581 if AC_TRY_EVAL(kde_line); then
1582         if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
1583                 kde_cv_uic_plugins=yes
1584         fi
1585 fi
1586 rm -f actest.ui actest.cpp
1587 ])
1588
1589 if test "$kde_cv_uic_plugins" = yes; then
1590         AC_MSG_RESULT([yes])
1591 else
1592         AC_MSG_ERROR([not found - you need to install kdelibs first.])
1593 fi
1594 fi
1595 ])
1596
1597 AC_DEFUN(KDE_CHECK_FINAL,
1598 [
1599   AC_ARG_ENABLE(final, [  --enable-final          build size optimized apps (experimental - needs lots of memory)],
1600         kde_use_final=$enableval, kde_use_final=no)
1601
1602   KDE_COMPILER_REPO
1603   if test "x$kde_use_final" = "xyes"; then
1604       KDE_USE_FINAL_TRUE=""
1605       KDE_USE_FINAL_FALSE="#"
1606    else
1607       KDE_USE_FINAL_TRUE="#"
1608       KDE_USE_FINAL_FALSE=""
1609   fi
1610   AC_SUBST(KDE_USE_FINAL_TRUE)
1611   AC_SUBST(KDE_USE_FINAL_FALSE)
1612
1613   AC_ARG_ENABLE(closure, [  --disable-closure       don't delay template instantiation],
1614         kde_use_closure=$enableval, kde_use_closure=yes)
1615
1616   if test "x$kde_use_closure" = "xyes"; then
1617        KDE_USE_CLOSURE_TRUE=""
1618        KDE_USE_CLOSURE_FALSE="#"
1619 #       CXXFLAGS="$CXXFLAGS $REPO"
1620   else
1621        KDE_USE_CLOSURE_TRUE="#"
1622        KDE_USE_CLOSURE_FALSE=""
1623   fi
1624   AC_SUBST(KDE_USE_CLOSURE_TRUE)
1625   AC_SUBST(KDE_USE_CLOSURE_FALSE)
1626 ])
1627
1628 dnl ------------------------------------------------------------------------
1629 dnl Now, the same with KDE
1630 dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
1631 dnl and $(kde_includes) will be the kdehdrlocation (if needed)
1632 dnl ------------------------------------------------------------------------
1633 dnl
1634 AC_DEFUN(AC_BASE_PATH_KDE,
1635 [
1636 AC_PREREQ([2.13])
1637 AC_REQUIRE([AC_PATH_QT])dnl
1638 AC_REQUIRE([KDE_CHECK_LIB64])
1639
1640 AC_CHECK_RPATH
1641 AC_MSG_CHECKING([for KDE])
1642
1643 if test "${prefix}" != NONE; then
1644   kde_includes=${prefix}/include
1645   ac_kde_includes=$prefix/include
1646
1647   if test "${exec_prefix}" != NONE; then
1648      kde_libraries=${libdir}
1649      ac_kde_libraries=$libdir
1650      if test "$ac_kde_libraries" = '${exec_prefix}/lib'${kdelibsuff}; then
1651         ac_kde_libraries=$exec_prefix/lib${kdelibsuff}
1652      fi
1653   else
1654      kde_libraries=${prefix}/lib${kdelibsuff}
1655      ac_kde_libraries=$prefix/lib${kdelibsuff}
1656   fi
1657 else
1658   ac_kde_includes=
1659   ac_kde_libraries=
1660   kde_libraries=""
1661   kde_includes=""
1662 fi
1663
1664 AC_CACHE_VAL(ac_cv_have_kde,
1665 [#try to guess kde locations
1666
1667 if test "$kde_qtver" = 1; then
1668   kde_check_header="ksock.h"
1669   kde_check_lib="libkdecore.la"
1670 else
1671   kde_check_header="ksharedptr.h"
1672   kde_check_lib="libkio.la"
1673 fi
1674
1675 if test -z "$1"; then
1676
1677 kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes"
1678 test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
1679 kde_incdirs="$ac_kde_includes $kde_incdirs"
1680 AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
1681 ac_kde_includes="$kde_incdir"
1682
1683 if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
1684   AC_MSG_ERROR([
1685 in the prefix, you've chosen, are no KDE headers installed. This will fail.
1686 So, check this please and use another prefix!])
1687 fi
1688
1689 kde_libdirs="/usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}"
1690 test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
1691 kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
1692 AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
1693 ac_kde_libraries="$kde_libdir"
1694
1695 kde_widgetdir=NO
1696 dnl this might be somewhere else
1697 AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
1698
1699 if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
1700 AC_MSG_ERROR([
1701 in the prefix, you've chosen, are no KDE libraries installed. This will fail.
1702 So, check this please and use another prefix!])
1703 fi
1704
1705 if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
1706 AC_MSG_ERROR([
1707 I can't find the designer plugins. These are required and should have been installed
1708 by kdelibs])
1709 fi
1710
1711 if test -n "$kde_widgetdir"; then
1712     kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
1713 fi
1714
1715
1716 if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
1717   ac_cv_have_kde="have_kde=no"
1718 else
1719   ac_cv_have_kde="have_kde=yes \
1720     ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1721 fi
1722
1723 else dnl test -z $1
1724
1725   ac_cv_have_kde="have_kde=no"
1726
1727 fi
1728 ])dnl
1729
1730 eval "$ac_cv_have_kde"
1731
1732 if test "$have_kde" != "yes"; then
1733  if test "${prefix}" = NONE; then
1734   ac_kde_prefix="$ac_default_prefix"
1735  else
1736   ac_kde_prefix="$prefix"
1737  fi
1738  if test "$exec_prefix" = NONE; then
1739   ac_kde_exec_prefix="$ac_kde_prefix"
1740   AC_MSG_RESULT([will be installed in $ac_kde_prefix])
1741  else
1742   ac_kde_exec_prefix="$exec_prefix"
1743   AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
1744  fi
1745
1746  kde_libraries="${libdir}"
1747  kde_includes=${ac_kde_prefix}/include
1748
1749 else
1750   ac_cv_have_kde="have_kde=yes \
1751     ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1752   AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
1753
1754   kde_libraries="$ac_kde_libraries"
1755   kde_includes="$ac_kde_includes"
1756 fi
1757 AC_SUBST(kde_libraries)
1758 AC_SUBST(kde_includes)
1759
1760 if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes"  || test "$kde_includes" = "/usr/include"; then
1761  KDE_INCLUDES=""
1762 else
1763  KDE_INCLUDES="-I$kde_includes"
1764  all_includes="$KDE_INCLUDES $all_includes"
1765 fi
1766  
1767 KDE_LDFLAGS="-L$kde_libraries"
1768 if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then 
1769  all_libraries="$all_libraries $KDE_LDFLAGS"
1770 fi
1771
1772 AC_SUBST(KDE_LDFLAGS)
1773 AC_SUBST(KDE_INCLUDES)
1774
1775 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1776
1777 all_libraries="$all_libraries $USER_LDFLAGS"
1778 all_includes="$all_includes $USER_INCLUDES"
1779 AC_SUBST(all_includes)
1780 AC_SUBST(all_libraries)
1781
1782 if test -z "$1"; then
1783 KDE_CHECK_UIC_PLUGINS
1784 fi
1785
1786 ac_kde_libraries="$kde_libdir"
1787
1788 AC_SUBST(AUTODIRS)
1789
1790
1791 ])
1792
1793 AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
1794 [
1795 AC_MSG_CHECKING(for extra includes)
1796 AC_ARG_WITH(extra-includes, [  --with-extra-includes=DIR
1797                           adds non standard include paths],
1798   kde_use_extra_includes="$withval",
1799   kde_use_extra_includes=NONE
1800 )
1801 kde_extra_includes=
1802 if test -n "$kde_use_extra_includes" && \
1803    test "$kde_use_extra_includes" != "NONE"; then
1804
1805    ac_save_ifs=$IFS
1806    IFS=':'
1807    for dir in $kde_use_extra_includes; do
1808      kde_extra_includes="$kde_extra_includes $dir"
1809      USER_INCLUDES="$USER_INCLUDES -I$dir"
1810    done
1811    IFS=$ac_save_ifs
1812    kde_use_extra_includes="added"
1813 else
1814    kde_use_extra_includes="no"
1815 fi
1816 AC_SUBST(USER_INCLUDES)
1817
1818 AC_MSG_RESULT($kde_use_extra_includes)
1819
1820 kde_extra_libs=
1821 AC_MSG_CHECKING(for extra libs)
1822 AC_ARG_WITH(extra-libs, [  --with-extra-libs=DIR   adds non standard library paths],
1823   kde_use_extra_libs=$withval,
1824   kde_use_extra_libs=NONE
1825 )
1826 if test -n "$kde_use_extra_libs" && \
1827    test "$kde_use_extra_libs" != "NONE"; then
1828
1829    ac_save_ifs=$IFS
1830    IFS=':'
1831    for dir in $kde_use_extra_libs; do
1832      kde_extra_libs="$kde_extra_libs $dir"
1833      KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
1834      USER_LDFLAGS="$USER_LDFLAGS -L$dir"
1835    done
1836    IFS=$ac_save_ifs
1837    kde_use_extra_libs="added"
1838 else
1839    kde_use_extra_libs="no"
1840 fi
1841
1842 AC_SUBST(USER_LDFLAGS)
1843
1844 AC_MSG_RESULT($kde_use_extra_libs)
1845
1846 ])
1847
1848 AC_DEFUN(KDE_1_CHECK_PATH_HEADERS,
1849 [
1850     AC_MSG_CHECKING([for KDE headers installed])
1851     AC_LANG_SAVE
1852     AC_LANG_CPLUSPLUS
1853 cat > conftest.$ac_ext <<EOF
1854 #ifdef STDC_HEADERS
1855 # include <stdlib.h>
1856 #endif
1857 #include <stdio.h>
1858 #include "confdefs.h"
1859 #include <kapp.h>
1860
1861 int main() {
1862     printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
1863     printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
1864     printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
1865     printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
1866     printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
1867     printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
1868     printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
1869     printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
1870     printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
1871     printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
1872     printf("kde_wallpaperdir=\\"%s\\"\n",
1873         KApplication::kde_wallpaperdir().data());
1874     printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
1875     printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
1876     printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
1877     printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
1878     printf("kde_moduledir=\\"/tmp/dummy\\"\n");
1879     printf("kde_styledir=\\"/tmp/dummy\\"\n");
1880     printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
1881     return 0;
1882     }
1883 EOF
1884
1885  ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
1886  if AC_TRY_EVAL(ac_compile); then
1887    AC_MSG_RESULT(yes)
1888  else
1889    AC_MSG_ERROR([your system is not able to compile a small KDE application!
1890 Check, if you installed the KDE header files correctly.
1891 For more details about this problem, look at the end of config.log.])
1892   fi
1893
1894   AC_LANG_RESTORE
1895 ])
1896
1897 AC_DEFUN(KDE_CHECK_KDEQTADDON,
1898 [
1899 AC_MSG_CHECKING(for kde-qt-addon)
1900 AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
1901 [
1902  kde_ldflags_safe="$LDFLAGS"
1903  kde_libs_safe="$LIBS"
1904  kde_cxxflags_safe="$CXXFLAGS"
1905
1906  LIBS="-lkde-qt-addon $LIBQT $LIBS"
1907  CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
1908  LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
1909
1910  AC_TRY_LINK([
1911    #include <qdom.h>
1912  ],
1913  [
1914    QDomDocument doc;
1915  ],
1916   kde_cv_have_kdeqtaddon=yes,
1917   kde_cv_have_kdeqtaddon=no
1918  )
1919
1920  LDFLAGS=$kde_ldflags_safe
1921  LIBS=$kde_libs_safe
1922  CXXFLAGS=$kde_cxxflags_safe
1923 ])
1924
1925 AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
1926
1927 if test "$kde_cv_have_kdeqtaddon" = "no"; then
1928   AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
1929 It is a separate package (and CVS module) named kde-qt-addon.])
1930 fi
1931 ])
1932
1933 AC_DEFUN(KDE_CHECK_KIMGIO,
1934 [
1935    AC_REQUIRE([AC_BASE_PATH_KDE])
1936    AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1937    AC_REQUIRE([AC_FIND_TIFF])
1938    AC_REQUIRE([AC_FIND_JPEG])
1939    AC_REQUIRE([AC_FIND_PNG])
1940    AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
1941
1942    if test "$1" = "existance"; then
1943      AC_LANG_SAVE
1944      AC_LANG_CPLUSPLUS
1945      kde_save_LIBS="$LIBS"
1946      LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
1947      AC_CHECK_LIB(kimgio, kimgioRegister, [
1948       LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
1949      LIBS="$kde_save_LIBS"
1950      AC_LANG_RESTORE
1951    else
1952      LIBKIMGIO_EXISTS=yes
1953    fi
1954
1955    if test "$LIBKIMGIO_EXISTS" = "yes"; then
1956      LIB_KIMGIO='-lkimgio'
1957    else
1958      LIB_KIMGIO=''
1959    fi
1960    AC_SUBST(LIB_KIMGIO)
1961 ])
1962
1963 AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
1964 [
1965    AC_REQUIRE([KDE_MISC_TESTS])
1966    AC_REQUIRE([KDE_CHECK_LIBDL])
1967    AC_REQUIRE([K_PATH_X])
1968
1969 if test $kde_qtver = 3; then
1970    AC_SUBST(LIB_KDECORE, "-lkdecore")
1971    AC_SUBST(LIB_KDEUI, "-lkdeui")
1972    AC_SUBST(LIB_KIO, "-lkio")
1973    AC_SUBST(LIB_SMB, "-lsmb")
1974    AC_SUBST(LIB_KAB, "-lkab")
1975    AC_SUBST(LIB_KABC, "-lkabc")
1976    AC_SUBST(LIB_KHTML, "-lkhtml")
1977    AC_SUBST(LIB_KSPELL, "-lkspell")
1978    AC_SUBST(LIB_KPARTS, "-lkparts")
1979    AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
1980 # these are for backward compatibility
1981    AC_SUBST(LIB_KSYCOCA, "-lkio")
1982    AC_SUBST(LIB_KFILE, "-lkio")
1983 elif test $kde_qtver = 2; then
1984    AC_SUBST(LIB_KDECORE, "-lkdecore")
1985    AC_SUBST(LIB_KDEUI, "-lkdeui")
1986    AC_SUBST(LIB_KIO, "-lkio")
1987    AC_SUBST(LIB_KSYCOCA, "-lksycoca")
1988    AC_SUBST(LIB_SMB, "-lsmb")
1989    AC_SUBST(LIB_KFILE, "-lkfile")
1990    AC_SUBST(LIB_KAB, "-lkab")
1991    AC_SUBST(LIB_KHTML, "-lkhtml")
1992    AC_SUBST(LIB_KSPELL, "-lkspell")
1993    AC_SUBST(LIB_KPARTS, "-lkparts")
1994    AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
1995 else
1996    AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
1997    AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
1998    AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
1999    AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
2000    AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
2001 fi
2002 ])
2003
2004 AC_DEFUN(AC_PATH_KDE,
2005 [
2006   AC_BASE_PATH_KDE
2007   AC_ARG_ENABLE(path-check, [  --disable-path-check    don't try to find out, where to install],
2008   [
2009   if test "$enableval" = "no";
2010     then ac_use_path_checking="default"
2011     else ac_use_path_checking=""
2012   fi
2013   ],
2014   [
2015   if test "$kde_qtver" = 1;
2016     then ac_use_path_checking=""
2017     else ac_use_path_checking="default"
2018   fi
2019   ]
2020   )
2021
2022   AC_CREATE_KFSSTND($ac_use_path_checking)
2023
2024   AC_SUBST_KFSSTND
2025   KDE_CREATE_LIBS_ALIASES
2026 ])
2027
2028 dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
2029 AC_DEFUN(KDE_CHECK_FUNC_EXT,
2030 [
2031 AC_MSG_CHECKING(for $1)
2032 AC_CACHE_VAL(kde_cv_func_$1,
2033 [
2034 AC_LANG_SAVE
2035 AC_LANG_CPLUSPLUS
2036 save_CXXFLAGS="$CXXFLAGS"
2037 kde_safe_LIBS="$LIBS"
2038 LIBS="$LIBS $X_EXTRA_LIBS"
2039 if test "$GXX" = "yes"; then
2040   CXXFLAGS="$CXXFLAGS -pedantic-errors"
2041 fi
2042 AC_TRY_COMPILE([
2043 $2
2044 ],
2045 [
2046 $3
2047 ],
2048 kde_cv_func_$1=yes,
2049 kde_cv_func_$1=no)
2050 CXXFLAGS="$save_CXXFLAGS"
2051 LIBS=$kde_safe_LIBS
2052 AC_LANG_RESTORE
2053 ])
2054
2055 AC_MSG_RESULT($kde_cv_func_$1)
2056
2057 AC_MSG_CHECKING([if $1 needs custom prototype])
2058 AC_CACHE_VAL(kde_cv_proto_$1,
2059 [
2060 if test "x$kde_cv_func_$1" = xyes; then
2061   kde_cv_proto_$1=no
2062 else
2063   case "$1" in
2064         setenv|unsetenv|usleep|getdomainname|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
2065                 kde_cv_proto_$1="yes - in libkdefakes"
2066                 ;;
2067         *)
2068                 kde_cv_proto_$1=unknown
2069                 ;;
2070   esac
2071 fi
2072
2073 if test "x$kde_cv_proto_$1" = xunknown; then
2074
2075 AC_LANG_SAVE
2076 AC_LANG_CPLUSPLUS
2077   kde_safe_libs=$LIBS
2078   LIBS="$LIBS $X_EXTRA_LIBS"
2079   AC_TRY_LINK([
2080 $2
2081
2082 extern "C" $4;
2083 ],
2084 [
2085 $3
2086 ],
2087 [ kde_cv_func_$1=yes
2088   kde_cv_proto_$1=yes ],
2089   [kde_cv_proto_$1="$1 unavailable"]
2090 )
2091 LIBS=$kde_safe_libs
2092 AC_LANG_RESTORE
2093 fi
2094 ])
2095 AC_MSG_RESULT($kde_cv_proto_$1)
2096
2097 if test "x$kde_cv_func_$1" = xyes; then
2098   AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
2099   $6
2100 fi
2101 if test "x$kde_cv_proto_$1" = xno; then
2102   AC_DEFINE(HAVE_$5_PROTO, 1,
2103   [Define if you have the $1 prototype])
2104 fi
2105
2106 AH_VERBATIM([_HAVE_$5_PROTO],
2107 [
2108 #if !defined(HAVE_$5_PROTO)
2109 #ifdef __cplusplus
2110 extern "C"
2111 #endif
2112 $4;
2113 #endif
2114 ])
2115 ])
2116
2117 AC_DEFUN(AC_CHECK_SETENV,
2118 [
2119         KDE_CHECK_FUNC_EXT(setenv, [
2120 #include <stdlib.h>
2121 ], 
2122                 [setenv("VAR", "VALUE", 1);],
2123                 [int setenv (const char *, const char *, int)],
2124                 [SETENV])
2125 ])
2126
2127 AC_DEFUN(AC_CHECK_UNSETENV,
2128 [
2129         KDE_CHECK_FUNC_EXT(unsetenv, [
2130 #include <stdlib.h>
2131 ], 
2132                 [unsetenv("VAR");],
2133                 [void unsetenv (const char *)],
2134                 [UNSETENV])
2135 ])
2136
2137 AC_DEFUN(AC_CHECK_GETDOMAINNAME,
2138 [
2139         KDE_CHECK_FUNC_EXT(getdomainname, [
2140 #include <stdlib.h>
2141 #include <unistd.h>
2142 ], 
2143                 [
2144 char buffer[200];
2145 getdomainname(buffer, 200);
2146 ],      
2147                 [int getdomainname (char *, unsigned int)],
2148                 [GETDOMAINNAME])
2149 ])
2150
2151 AC_DEFUN(AC_CHECK_GETHOSTNAME,
2152 [
2153         KDE_CHECK_FUNC_EXT(gethostname, [
2154 #include <stdlib.h>
2155 #include <unistd.h>
2156 ], 
2157                 [
2158 char buffer[200];
2159 gethostname(buffer, 200);
2160 ],      
2161                 [int gethostname (char *, unsigned int)],
2162                 [GETHOSTNAME])
2163 ])
2164
2165 AC_DEFUN(AC_CHECK_USLEEP,
2166 [
2167         KDE_CHECK_FUNC_EXT(usleep, [
2168 #include <unistd.h>
2169 ], 
2170                 [
2171 usleep(200);
2172 ],      
2173                 [int usleep (unsigned int)],
2174                 [USLEEP])
2175 ])
2176
2177
2178 AC_DEFUN(AC_CHECK_RANDOM,
2179 [
2180         KDE_CHECK_FUNC_EXT(random, [
2181 #include <stdlib.h>
2182 ], 
2183                 [
2184 random();
2185 ],      
2186                 [long int random(void)],
2187                 [RANDOM])
2188
2189         KDE_CHECK_FUNC_EXT(srandom, [
2190 #include <stdlib.h>
2191 ], 
2192                 [
2193 srandom(27);
2194 ],      
2195                 [void srandom(unsigned int)],
2196                 [SRANDOM])
2197
2198 ])
2199
2200 AC_DEFUN(AC_CHECK_INITGROUPS,
2201 [
2202         KDE_CHECK_FUNC_EXT(initgroups, [
2203 #include <sys/types.h>
2204 #include <unistd.h>
2205 #include <grp.h>
2206 ],
2207         [
2208 char buffer[200];
2209 initgroups(buffer, 27);
2210 ],
2211         [int initgroups(const char *, gid_t)],
2212         [INITGROUPS])
2213 ])
2214
2215 AC_DEFUN(AC_CHECK_MKSTEMP,
2216 [
2217         KDE_CHECK_FUNC_EXT(mkstemp, [
2218 #include <stdlib.h>
2219 ],
2220         [
2221 mkstemp("/tmp/aaaXXXXXX");
2222 ],
2223         [int mkstemp(char *)],
2224         [MKSTEMP])
2225 ])
2226
2227 AC_DEFUN(AC_CHECK_MKSTEMPS,
2228 [
2229         KDE_CHECK_FUNC_EXT(mkstemps, [
2230 #include <stdlib.h>
2231 #include <unistd.h>
2232 ],
2233         [
2234 mkstemps("/tmp/aaaXXXXXX", 6);
2235 ],
2236         [int mkstemps(char *, int)],
2237         [MKSTEMPS])
2238 ])
2239
2240 AC_DEFUN(AC_CHECK_RES_INIT,
2241 [
2242   AC_MSG_CHECKING([if res_init needs -lresolv])
2243   kde_libs_safe="$LIBS"
2244   LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
2245   AC_TRY_LINK(
2246     [
2247 #include <sys/types.h>
2248 #include <netinet/in.h>
2249 #include <arpa/nameser.h>
2250 #include <resolv.h>
2251     ],
2252     [
2253       res_init(); 
2254     ],
2255     [
2256       LIBRESOLV="-lresolv"
2257       AC_MSG_RESULT(yes)
2258       AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2259     ],
2260     [ AC_MSG_RESULT(no) ]
2261   )
2262   LIBS=$kde_libs_safe
2263   AC_SUBST(LIBRESOLV)
2264
2265   AC_MSG_CHECKING([if res_init is available])
2266   AC_TRY_COMPILE(
2267     [
2268 #include <sys/types.h>
2269 #include <netinet/in.h>
2270 #include <arpa/nameser.h>
2271 #include <resolv.h>
2272     ],
2273     [
2274       res_init();
2275     ],
2276     [
2277       AC_MSG_RESULT(yes)
2278       AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2279     ],
2280     [ AC_MSG_RESULT(no) ]
2281   )
2282 ])
2283
2284 AC_DEFUN(AC_CHECK_STRLCPY,
2285 [
2286         KDE_CHECK_FUNC_EXT(strlcpy, [
2287 #include <string.h>
2288 ],
2289 [ char buf[20];
2290   strlcpy(buf, "KDE function test", sizeof(buf));
2291 ],
2292         [unsigned long strlcpy(char*, const char*, unsigned long)],
2293         [STRLCPY])
2294 ])
2295
2296 AC_DEFUN(AC_CHECK_STRLCAT,
2297 [
2298         KDE_CHECK_FUNC_EXT(strlcat, [
2299 #include <string.h>
2300 ],
2301 [ char buf[20];
2302   buf[0]='\0';
2303   strlcat(buf, "KDE function test", sizeof(buf));
2304 ],
2305         [unsigned long strlcat(char*, const char*, unsigned long)],
2306         [STRLCAT])
2307 ])
2308
2309 AC_DEFUN(AC_FIND_GIF,
2310    [AC_MSG_CHECKING([for giflib])
2311 AC_CACHE_VAL(ac_cv_lib_gif,
2312 [ac_save_LIBS="$LIBS"
2313 if test "x$kde_use_qt_emb" != "xyes"; then
2314 LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
2315 else
2316 LIBS="$all_libraries -lgif"
2317 fi
2318 AC_TRY_LINK(dnl
2319 [
2320 #ifdef __cplusplus
2321 extern "C" {
2322 #endif
2323 int GifLastError(void);
2324 #ifdef __cplusplus
2325 }
2326 #endif
2327 /* We use char because int might match the return type of a gcc2
2328     builtin and then its argument prototype would still apply.  */
2329 ],
2330             [return GifLastError();],
2331             eval "ac_cv_lib_gif=yes",
2332             eval "ac_cv_lib_gif=no")
2333 LIBS="$ac_save_LIBS"
2334 ])dnl
2335 if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
2336   AC_MSG_RESULT(yes)
2337   AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
2338 else
2339   AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
2340 fi
2341 ])
2342
2343 AC_DEFUN(KDE_FIND_JPEG_HELPER,
2344 [
2345 AC_MSG_CHECKING([for libjpeg$2])
2346 AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
2347 [
2348 AC_LANG_C
2349 ac_save_LIBS="$LIBS"
2350 LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
2351 ac_save_CFLAGS="$CFLAGS"
2352 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2353 AC_TRY_LINK(
2354 [/* Override any gcc2 internal prototype to avoid an error.  */
2355 struct jpeg_decompress_struct;
2356 typedef struct jpeg_decompress_struct * j_decompress_ptr;
2357 typedef int size_t;
2358 #ifdef __cplusplus
2359 extern "C" {
2360 #endif
2361     void jpeg_CreateDecompress(j_decompress_ptr cinfo,
2362                                     int version, size_t structsize);
2363 #ifdef __cplusplus
2364 }
2365 #endif
2366 /* We use char because int might match the return type of a gcc2
2367     builtin and then its argument prototype would still apply.  */
2368 ],
2369             [jpeg_CreateDecompress(0L, 0, 0);],
2370             eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
2371             eval "ac_cv_lib_jpeg_$1=no")
2372 LIBS="$ac_save_LIBS"
2373 CFLAGS="$ac_save_CFLAGS"
2374 ])
2375
2376 if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
2377   LIBJPEG="$ac_cv_lib_jpeg_$1"
2378   AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
2379 else
2380   AC_MSG_RESULT(no)
2381   $3
2382 fi
2383
2384 ])
2385
2386 AC_DEFUN(AC_FIND_JPEG,
2387 [
2388 dnl first look for libraries
2389 KDE_FIND_JPEG_HELPER(6b, 6b,
2390    KDE_FIND_JPEG_HELPER(normal, [],
2391     [
2392        LIBJPEG=
2393     ]
2394    )
2395 )
2396
2397 dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
2398 dnl requires system dependent includes loaded before it)
2399 jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
2400 AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
2401 test "x$jpeg_incdir" = xNO && jpeg_incdir=
2402
2403 dnl if headers _and_ libraries are missing, this is no error, and we
2404 dnl continue with a warning (the user will get no jpeg support in khtml)
2405 dnl if only one is missing, it means a configuration error, but we still
2406 dnl only warn
2407 if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
2408   AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
2409 else
2410   if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
2411     AC_MSG_WARN([
2412 There is an installation error in jpeg support. You seem to have only one
2413 of either the headers _or_ the libraries installed. You may need to either
2414 provide correct --with-extra-... options, or the development package of
2415 libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
2416 Disabling JPEG support.
2417 ])
2418   else
2419     AC_MSG_WARN([libjpeg not found. disable JPEG support.])
2420   fi
2421   jpeg_incdir=
2422   LIBJPEG=
2423 fi
2424
2425 AC_SUBST(LIBJPEG)
2426 AH_VERBATIM(_AC_CHECK_JPEG,
2427 [/*
2428  * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
2429  * headers and I'm too lazy to write a configure test as long as only
2430  * unixware is related
2431  */
2432 #ifdef _UNIXWARE
2433 #define HAVE_BOOLEAN
2434 #endif
2435 ])
2436 ])
2437
2438 AC_DEFUN(KDE_CHECK_QT_JPEG,
2439 [
2440 AC_MSG_CHECKING([if Qt needs $LIBJPEG])
2441 AC_CACHE_VAL(kde_cv_qt_jpeg,
2442 [
2443 AC_LANG_SAVE
2444 AC_LANG_CPLUSPLUS
2445 ac_save_LIBS="$LIBS"
2446 LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
2447 LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
2448 ac_save_CXXFLAGS="$CXXFLAGS"
2449 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2450 AC_TRY_LINK(
2451 [#include <qapplication.h>],
2452             [
2453             int argc;
2454             char** argv;
2455             QApplication app(argc, argv);],
2456             eval "kde_cv_qt_jpeg=no",
2457             eval "kde_cv_qt_jpeg=yes")
2458 LIBS="$ac_save_LIBS"
2459 CXXFLAGS="$ac_save_CXXFLAGS"
2460 AC_LANG_RESTORE
2461 ])
2462
2463 if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
2464   AC_MSG_RESULT(yes)
2465   LIBJPEG_QT='$(LIBJPEG)'
2466 else
2467   AC_MSG_RESULT(no)
2468   LIBJPEG_QT=
2469 fi
2470
2471 ])
2472
2473 AC_DEFUN(AC_FIND_ZLIB,
2474 [
2475 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2476 AC_MSG_CHECKING([for libz])
2477 AC_CACHE_VAL(ac_cv_lib_z,
2478 [
2479 AC_LANG_C
2480 kde_save_LIBS="$LIBS"
2481 LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
2482 kde_save_CFLAGS="$CFLAGS"
2483 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2484 AC_TRY_LINK(dnl
2485 [
2486 #include<zlib.h>
2487 ],
2488             [return (zlibVersion() == ZLIB_VERSION); ],
2489             eval "ac_cv_lib_z='-lz'",
2490             eval "ac_cv_lib_z=no")
2491 LIBS="$kde_save_LIBS"
2492 CFLAGS="$kde_save_CFLAGS"
2493 ])dnl
2494 if test ! "$ac_cv_lib_z" = no; then
2495   AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
2496   LIBZ="$ac_cv_lib_z"
2497   AC_SUBST(LIBZ)
2498   AC_MSG_RESULT($ac_cv_lib_z)
2499 else
2500   AC_MSG_ERROR(not found. Check your installation and look into config.log)
2501   LIBZ=""
2502   AC_SUBST(LIBZ)
2503 fi
2504 ])
2505
2506 AC_DEFUN(KDE_TRY_TIFFLIB,
2507 [
2508 AC_MSG_CHECKING([for libtiff $1])
2509
2510 AC_CACHE_VAL(kde_cv_libtiff_$1,
2511 [
2512 AC_LANG_SAVE
2513 AC_LANG_CPLUSPLUS
2514 kde_save_LIBS="$LIBS"
2515 if test "x$kde_use_qt_emb" != "xyes"; then
2516 LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
2517 else
2518 LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
2519 fi
2520 kde_save_CXXFLAGS="$CXXFLAGS"
2521 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2522
2523 AC_TRY_LINK(dnl
2524 [
2525 #include<tiffio.h>
2526 ],
2527     [return (TIFFOpen( "", "r") == 0); ],
2528 [
2529     kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
2530 ], [
2531     kde_cv_libtiff_$1=no
2532 ])
2533
2534 LIBS="$kde_save_LIBS"
2535 CXXFLAGS="$kde_save_CXXFLAGS"
2536 AC_LANG_RESTORE
2537 ])
2538
2539 if test "$kde_cv_libtiff_$1" = "no"; then
2540     AC_MSG_RESULT(no)
2541     LIBTIFF=""
2542     $3
2543 else
2544     LIBTIFF="$kde_cv_libtiff_$1"
2545     AC_MSG_RESULT(yes)
2546     AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
2547     $2
2548 fi
2549
2550 ])
2551
2552 AC_DEFUN(AC_FIND_TIFF,
2553 [
2554 AC_REQUIRE([K_PATH_X])
2555 AC_REQUIRE([AC_FIND_ZLIB])
2556 AC_REQUIRE([AC_FIND_JPEG])
2557 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2558
2559 KDE_TRY_TIFFLIB(tiff, [],
2560    KDE_TRY_TIFFLIB(tiff34))
2561
2562 AC_SUBST(LIBTIFF)
2563 ])
2564
2565
2566 AC_DEFUN(AC_FIND_PNG,
2567 [
2568 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2569 AC_REQUIRE([AC_FIND_ZLIB])
2570 AC_MSG_CHECKING([for libpng])
2571 AC_CACHE_VAL(ac_cv_lib_png,
2572 [
2573 kde_save_LIBS="$LIBS"
2574 if test "x$kde_use_qt_emb" != "xyes"; then
2575 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
2576 else
2577 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
2578 fi
2579 kde_save_CFLAGS="$CFLAGS"
2580 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2581 AC_LANG_C
2582 AC_TRY_LINK(dnl
2583     [
2584     #include<png.h>
2585     ],
2586     [
2587     png_structp png_ptr = png_create_read_struct(  /* image ptr */
2588                 PNG_LIBPNG_VER_STRING, 0, 0, 0 );
2589     return( png_ptr != 0 );
2590     ],
2591     eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
2592     eval "ac_cv_lib_png=no"
2593 )
2594 LIBS="$kde_save_LIBS"
2595 CFLAGS="$kde_save_CFLAGS"
2596 ])dnl
2597 if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
2598   AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
2599   LIBPNG="$ac_cv_lib_png"
2600   AC_SUBST(LIBPNG)
2601   AC_MSG_RESULT($ac_cv_lib_png)
2602 else
2603   AC_MSG_RESULT(no)
2604   LIBPNG=""
2605   AC_SUBST(LIBPNG)
2606 fi
2607 ])
2608
2609 AC_DEFUN(AC_CHECK_BOOL,
2610 [
2611   AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
2612 ])
2613
2614 AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
2615 [
2616 AC_MSG_CHECKING(if you need GNU extensions)
2617 AC_CACHE_VAL(ac_cv_gnu_extensions,
2618 [
2619 cat > conftest.c << EOF
2620 #include <features.h>
2621
2622 #ifdef __GNU_LIBRARY__
2623 yes
2624 #endif
2625 EOF
2626
2627 if (eval "$ac_cpp conftest.c") 2>&5 |
2628   egrep "yes" >/dev/null 2>&1; then
2629   rm -rf conftest*
2630   ac_cv_gnu_extensions=yes
2631 else
2632   ac_cv_gnu_extensions=no
2633 fi
2634 ])
2635
2636 AC_MSG_RESULT($ac_cv_gnu_extensions)
2637 if test "$ac_cv_gnu_extensions" = "yes"; then
2638   AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
2639 fi
2640 ])
2641
2642 AC_DEFUN(KDE_CHECK_COMPILER_FLAG,
2643 [
2644 AC_MSG_CHECKING(whether $CXX supports -$1)
2645 kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
2646 AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
2647 [
2648   AC_LANG_SAVE
2649   AC_LANG_CPLUSPLUS
2650   save_CXXFLAGS="$CXXFLAGS"
2651   CXXFLAGS="$CXXFLAGS -$1"
2652   AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
2653   CXXFLAGS="$save_CXXFLAGS"
2654   AC_LANG_RESTORE
2655 ])
2656 if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
2657  AC_MSG_RESULT(yes)
2658  :
2659  $2
2660 else
2661  AC_MSG_RESULT(no)
2662  :
2663  $3
2664 fi
2665 ])
2666
2667 dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
2668 dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
2669 dnl it's all white-space separated
2670 AC_DEFUN(AC_REMOVE_FORBIDDEN,
2671 [ __val=$$1
2672   __forbid=" $2 "
2673   if test -n "$__val"; then
2674     __new=""
2675     ac_save_IFS=$IFS
2676     IFS="       "
2677     for i in $__val; do
2678       case "$__forbid" in
2679         *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
2680         *) # Careful to not add spaces, where there were none, because otherwise
2681            # libtool gets confused, if we change e.g. CXX
2682            if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
2683       esac
2684     done
2685     IFS=$ac_save_IFS
2686     $1=$__new
2687   fi
2688 ])
2689
2690 dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
2691 AC_DEFUN(AC_VALIDIFY_CXXFLAGS,
2692 [dnl
2693 if test "x$kde_use_qt_emb" != "xyes"; then
2694  AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
2695  AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
2696 else
2697  AC_REMOVE_FORBIDDEN(CXX, [-rpath])
2698  AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
2699 fi
2700 ])
2701
2702 AC_DEFUN(AC_CHECK_COMPILERS,
2703 [
2704   AC_ARG_ENABLE(debug,[  --enable-debug[=ARG]    enables debug symbols (yes|no|full) [default=no]],
2705   [
2706     case $enableval in
2707       yes)
2708         kde_use_debug_code="yes"
2709         kde_use_debug_define=no
2710         ;;
2711       full)
2712         kde_use_debug_code="full"
2713         kde_use_debug_define=no
2714         ;;
2715       *)
2716         kde_use_debug_code="no"
2717         kde_use_debug_define=yes
2718         ;;
2719     esac
2720   ], 
2721     [kde_use_debug_code="no"
2722       kde_use_debug_define=no
2723   ])
2724
2725   dnl Just for configure --help
2726   AC_ARG_ENABLE(dummyoption,[  --disable-debug         disables debug output and debug symbols [default=no]],[],[])
2727
2728   AC_ARG_ENABLE(strict,[  --enable-strict         compiles with strict compiler options (may not work!)],
2729    [
2730     if test $enableval = "no"; then
2731          kde_use_strict_options="no"
2732        else
2733          kde_use_strict_options="yes"
2734     fi
2735    ], [kde_use_strict_options="no"])
2736
2737   AC_ARG_ENABLE(warnings,[  --disable-warnings      disables compilation with -Wall and similiar],
2738    [
2739     if test $enableval = "no"; then
2740          kde_use_warnings="no"
2741        else
2742          kde_use_warnings="yes"
2743     fi
2744    ], [kde_use_warnings="yes"])
2745
2746   dnl enable warnings for debug build
2747   if test "$kde_use_debug_code" != "no"; then
2748     kde_use_warnings=yes
2749   fi
2750
2751   AC_ARG_ENABLE(profile,[  --enable-profile        creates profiling infos [default=no]],
2752     [kde_use_profiling=$enableval],
2753     [kde_use_profiling="no"]
2754   )
2755
2756   dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
2757   CFLAGS=" $CFLAGS"
2758
2759   AC_PROG_CC 
2760
2761   AC_PROG_CPP
2762
2763   if test "$GCC" = "yes"; then
2764     if test "$kde_use_debug_code" != "no"; then
2765       if test $kde_use_debug_code = "full"; then
2766         CFLAGS="-g3 $CFLAGS"
2767       else
2768         CFLAGS="-g -O2 $CFLAGS"
2769       fi
2770     else
2771       CFLAGS="-O2 $CFLAGS"
2772     fi
2773   fi
2774
2775   if test "$kde_use_debug_define" = "yes"; then
2776     CFLAGS="-DNDEBUG $CFLAGS"
2777   fi
2778
2779
2780   case "$host" in
2781   *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
2782   *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
2783   esac
2784
2785   if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
2786      LDFLAGS=""
2787   fi
2788
2789   CXXFLAGS=" $CXXFLAGS"
2790
2791   AC_PROG_CXX
2792
2793   if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
2794     if test "$kde_use_debug_code" != "no"; then
2795       if test "$CXX" = "KCC"; then
2796         CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
2797       else
2798         if test "$kde_use_debug_code" = "full"; then
2799           CXXFLAGS="-g3 $CXXFLAGS"
2800         else
2801           CXXFLAGS="-g -O2 $CXXFLAGS"
2802         fi
2803       fi
2804       KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
2805
2806       dnl convenience compiler flags
2807       KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
2808       AC_SUBST(WOVERLOADED_VIRTUAL)
2809     else
2810       if test "$CXX" = "KCC"; then
2811         CXXFLAGS="+K3 $CXXFLAGS"
2812       else
2813         CXXFLAGS="-O2 $CXXFLAGS"
2814       fi  
2815     fi
2816   fi
2817
2818   if test "$kde_use_debug_define" = "yes"; then
2819     CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
2820   fi  
2821
2822   if test "$kde_use_profiling" = "yes"; then
2823     KDE_CHECK_COMPILER_FLAG(pg,
2824     [
2825       CFLAGS="-pg $CFLAGS"
2826       CXXFLAGS="-pg $CXXFLAGS"
2827     ])
2828   fi
2829
2830   if test "$kde_use_warnings" = "yes"; then
2831       if test "$GCC" = "yes"; then
2832         case $host in
2833           *-*-linux-gnu)        
2834             CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
2835             CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion $CXXFLAGS"
2836           ;;
2837         esac
2838         CXXFLAGS="-Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
2839         KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
2840         KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
2841         KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
2842      fi
2843   fi
2844
2845   if test "$GCC" = "yes" && test "$kde_use_strict_options" = "yes"; then
2846     CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
2847   fi
2848     
2849   if test "$GXX" = "yes"; then
2850     KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
2851     KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
2852     KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS=       )
2853   fi
2854   if test "$CXX" = "KCC"; then
2855     dnl unfortunately we currently cannot disable exception support in KCC
2856     dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
2857     dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
2858     dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS=   )
2859
2860     AC_ARG_ENABLE(pch,[  --enable-pch            enables precompiled header support (currently only KCC) [default=no]],
2861     [
2862       kde_use_pch=$enableval
2863     ],[kde_use_pch=no])
2864  
2865     if test "$kde_use_pch" = "yes"; then
2866       dnl TODO: support --pch-dir!
2867       KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
2868       dnl the below works (but the dir must exist), but it's
2869       dnl useless for a whole package.
2870       dnl The are precompiled headers for each source file, so when compiling
2871       dnl from scratch, it doesn't make a difference, and they take up
2872       dnl around ~5Mb _per_ sourcefile.
2873       dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
2874       dnl   [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
2875     fi
2876     dnl this flag controls inlining. by default KCC inlines in optimisation mode
2877     dnl all implementations that are defined inside the class {} declaration. 
2878     dnl because of templates-compatibility with broken gcc compilers, this
2879     dnl can cause excessive inlining. This flag limits it to a sane level
2880     KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
2881     KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
2882     KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
2883     KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
2884     dnl Some source files are shared between multiple executables
2885     dnl (or libraries) and some of those need template instantiations.
2886     dnl In that case KCC needs to compile those sources with
2887     dnl --one_instantiation_per_object.  To make it easy for us we compile
2888     dnl _all_ objects with that flag (--one_per is a shorthand).
2889     KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
2890   fi
2891   AC_SUBST(USE_EXCEPTIONS)
2892   dnl obsolete macro - provided to keep things going
2893   USE_RTTI=
2894   AC_SUBST(USE_RTTI)
2895
2896   case "$host" in
2897       *-*-irix*)  test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
2898       *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
2899       *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
2900       *-*-solaris*) 
2901         if test "$GXX" = yes; then
2902           libstdcpp=`$CXX -print-file-name=libstdc++.so`
2903           if test ! -f $libstdcpp; then
2904              AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so])
2905           fi
2906         fi
2907         ;;
2908   esac
2909
2910   AC_VALIDIFY_CXXFLAGS
2911
2912   AC_PROG_CXXCPP
2913
2914   if test "$GCC" = yes; then
2915      NOOPT_CXXFLAGS=-O0
2916      NOOPT_CFLAGS=-O0
2917   fi
2918
2919   AC_SUBST(NOOPT_CXXFLAGS)
2920   AC_SUBST(NOOPT_CFLAGS)
2921
2922   KDE_CHECK_FINAL
2923
2924   ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
2925 ])
2926
2927 AC_DEFUN(KDE_ADD_DEPENDENCIES,
2928 [
2929    [A]M_DEPENDENCIES(CC)
2930    [A]M_DEPENDENCIES(CXX)
2931 ])
2932
2933 dnl just a wrapper to clean up configure.in
2934 AC_DEFUN(KDE_PROG_LIBTOOL,
2935 [
2936 AC_REQUIRE([AC_CHECK_COMPILERS])
2937 AC_REQUIRE([AC_ENABLE_SHARED])
2938 AC_REQUIRE([AC_ENABLE_STATIC])
2939
2940 AC_REQUIRE([AC_LIBTOOL_DLOPEN])
2941 AC_REQUIRE([KDE_CHECK_LIB64])
2942
2943 AC_LANG_SAVE
2944 AC_LANG_C
2945 AC_OBJEXT
2946 AC_EXEEXT
2947 AC_LANG_RESTORE
2948
2949 AM_PROG_LIBTOOL
2950 AC_LIBTOOL_CXX
2951
2952 LIBTOOL_SHELL="/bin/sh ./libtool"
2953 #  LIBTOOL="$LIBTOOL --silent"
2954 KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
2955 AC_SUBST(KDE_PLUGIN)
2956
2957 AC_ARG_ENABLE(objprelink, [  --enable-objprelink     prelink apps using objprelink (obsolete)],
2958        kde_use_objprelink=$enableval, kde_use_objprelink=no)
2959   if test "x$kde_use_objprelink" = "xyes"; then 
2960         AC_MSG_WARN([
2961 ------------------------------------------------------------
2962 Configuration option --enable-objprelink is no longer useful.
2963 See http:://objprelink.sourceforge.net for details:
2964 1- Recent binutils are fast enough to do without objprelink.
2965 2- Newer versions of objprelink do not need this option.
2966 ------------------------------------------------------------
2967 ])
2968   fi
2969 ])
2970
2971 AC_DEFUN(KDE_CHECK_LIB64,
2972 [
2973     kdelibsuff=none
2974     AC_ARG_ENABLE(libsuffix,
2975         AC_HELP_STRING([--enable-libsuffix],
2976             [/lib directory suffix (64,32,none)]),
2977             kdelibsuff=$enableval)
2978     if test "$kdelibsuff" = "none"; then
2979         if test -d /lib64 ; then
2980             kdelibsuff=64
2981         else
2982             kdelibsuff=
2983         fi
2984     fi
2985     if test -z "$kdelibsuff"; then
2986         AC_MSG_RESULT([not using lib directory suffix])
2987         AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
2988     else
2989         if test "$libdir" = '${exec_prefix}/lib'; then
2990             libdir="$libdir${kdelibsuff}"
2991             AC_SUBST([libdir], ["$libdir"])  dnl ugly hack for lib64 platforms
2992         fi
2993         AC_DEFINE_UNQUOTED(KDELIBSUFF, ["\"${kdelibsuff}\""], Suffix for lib directories)
2994         AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
2995     fi
2996 ])
2997
2998 AC_DEFUN(KDE_CHECK_TYPES,
2999 [  AC_CHECK_SIZEOF(int, 4)dnl
3000   AC_CHECK_SIZEOF(long, 4)dnl
3001   AC_CHECK_SIZEOF(char *, 4)dnl
3002   AC_CHECK_SIZEOF(char, 1)dnl
3003 ])dnl
3004
3005 AC_DEFUN(KDE_DO_IT_ALL,
3006 [
3007 AC_CANONICAL_SYSTEM
3008 AC_ARG_PROGRAM
3009 AM_INIT_AUTOMAKE($1, $2)
3010 AM_DISABLE_LIBRARIES
3011 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
3012 AC_CHECK_COMPILERS
3013 KDE_PROG_LIBTOOL
3014 AM_KDE_WITH_NLS
3015 AC_PATH_KDE
3016 ])
3017
3018 AC_DEFUN(AC_CHECK_RPATH,
3019 [
3020 AC_MSG_CHECKING(for rpath)
3021 AC_ARG_ENABLE(rpath,
3022       [  --disable-rpath         do not use the rpath feature of ld],
3023       USE_RPATH=$enableval, USE_RPATH=yes)
3024
3025 if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
3026
3027   KDE_RPATH="-R \$(kde_libraries)"
3028
3029   if test -n "$qt_libraries"; then
3030     KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
3031   fi
3032   dnl $x_libraries is set to /usr/lib in case
3033   if test -n "$X_LDFLAGS"; then
3034     KDE_RPATH="$KDE_RPATH -R \$(x_libraries)"
3035   fi
3036   if test -n "$KDE_EXTRA_RPATH"; then
3037     KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
3038   fi
3039 fi
3040 AC_SUBST(KDE_EXTRA_RPATH)
3041 AC_SUBST(KDE_RPATH)
3042 AC_MSG_RESULT($USE_RPATH)
3043 ])
3044
3045 dnl Check for the type of the third argument of getsockname
3046 AC_DEFUN(AC_CHECK_SOCKLEN_T, [
3047   AC_MSG_CHECKING(for socklen_t)
3048   AC_CACHE_VAL(ac_cv_socklen_t, [
3049     AC_LANG_SAVE
3050     AC_LANG_CPLUSPLUS
3051     AC_TRY_COMPILE([
3052 #include <sys/types.h>
3053 #include <sys/socket.h>
3054       ],[
3055 socklen_t a=0;
3056 getsockname(0,(struct sockaddr*)0, &a);
3057       ],
3058       ac_cv_socklen_t=socklen_t,
3059       AC_TRY_COMPILE([
3060 #include <sys/types.h>
3061 #include <sys/socket.h>
3062         ],[
3063 int a=0;
3064 getsockname(0,(struct sockaddr*)0, &a);
3065         ],
3066         ac_cv_socklen_t=int,
3067         ac_cv_socklen_t=size_t
3068       )
3069     )
3070     AC_LANG_RESTORE
3071   ])
3072
3073   AC_MSG_RESULT($ac_cv_socklen_t)
3074   if test "$ac_cv_socklen_t" != "socklen_t"; then
3075     AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t,
3076         [Define the real type of socklen_t])
3077   fi
3078   AC_DEFINE_UNQUOTED(ksize_t, socklen_t, [Compatibility define])
3079
3080 ])
3081
3082 dnl This is a merge of some macros out of the gettext aclocal.m4
3083 dnl since we don't need anything, I took the things we need
3084 dnl the copyright for them is:
3085 dnl >
3086 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3087 dnl This Makefile.in is free software; the Free Software Foundation
3088 dnl gives unlimited permission to copy and/or distribute it,
3089 dnl with or without modifications, as long as this notice is preserved.
3090
3091 dnl This program is distributed in the hope that it will be useful,
3092 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
3093 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
3094 dnl PARTICULAR PURPOSE.
3095 dnl >
3096 dnl for this file it is relicensed under LGPL
3097
3098 AC_DEFUN(AM_KDE_WITH_NLS,
3099   [
3100     dnl If we use NLS figure out what method
3101
3102     AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
3103         [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
3104     AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
3105
3106      if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
3107         AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
3108         GMSGFMT=":"
3109       fi
3110       MSGFMT=$GMSGFMT
3111       AC_SUBST(GMSGFMT)
3112       AC_SUBST(MSGFMT)
3113
3114       AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
3115         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
3116
3117       dnl Test whether we really found GNU xgettext.
3118       if test "$XGETTEXT" != ":"; then
3119         dnl If it is no GNU xgettext we define it as : so that the
3120         dnl Makefiles still can work.
3121         if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
3122           : ;
3123         else
3124           AC_MSG_RESULT(
3125             [found xgettext programs is not GNU xgettext; ignore it])
3126           XGETTEXT=":"
3127         fi
3128       fi
3129      AC_SUBST(XGETTEXT)
3130
3131   ])
3132
3133 # Search path for a program which passes the given test.
3134 # Ulrich Drepper <drepper@cygnus.com>, 1996.
3135
3136 # serial 1
3137 # Stephan Kulow: I appended a _KDE against name conflicts
3138
3139 dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
3140 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3141 AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
3142 [# Extract the first word of "$2", so it can be a program name with args.
3143 set dummy $2; ac_word=[$]2
3144 AC_MSG_CHECKING([for $ac_word])
3145 AC_CACHE_VAL(ac_cv_path_$1,
3146 [case "[$]$1" in
3147   /*)
3148   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3149   ;;
3150   *)
3151   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3152   for ac_dir in ifelse([$5], , $PATH, [$5]); do
3153     test -z "$ac_dir" && ac_dir=.
3154     if test -f $ac_dir/$ac_word; then
3155       if [$3]; then
3156         ac_cv_path_$1="$ac_dir/$ac_word"
3157         break
3158       fi
3159     fi
3160   done
3161   IFS="$ac_save_ifs"
3162 dnl If no 4th arg is given, leave the cache variable unset,
3163 dnl so AC_PATH_PROGS will keep looking.
3164 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3165 ])dnl
3166   ;;
3167 esac])dnl
3168 $1="$ac_cv_path_$1"
3169 if test -n "[$]$1"; then
3170   AC_MSG_RESULT([$]$1)
3171 else
3172   AC_MSG_RESULT(no)
3173 fi
3174 AC_SUBST($1)dnl
3175 ])
3176
3177
3178 # Check whether LC_MESSAGES is available in <locale.h>.
3179 # Ulrich Drepper <drepper@cygnus.com>, 1995.
3180
3181 # serial 1
3182
3183 AC_DEFUN(AM_LC_MESSAGES,
3184   [if test $ac_cv_header_locale_h = yes; then
3185     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
3186       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
3187        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
3188     if test $am_cv_val_LC_MESSAGES = yes; then
3189       AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
3190     fi
3191   fi])
3192
3193 dnl From Jim Meyering.
3194 dnl FIXME: migrate into libit.
3195
3196 AC_DEFUN([AM_FUNC_OBSTACK],
3197 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
3198  [AC_TRY_LINK([#include "obstack.h"],
3199               [struct obstack *mem;obstack_free(mem,(char *) 0)],
3200               am_cv_func_obstack=yes,
3201               am_cv_func_obstack=no)])
3202  if test $am_cv_func_obstack = yes; then
3203    AC_DEFINE(HAVE_OBSTACK)
3204  else
3205    LIBOBJS="$LIBOBJS obstack.o"
3206  fi
3207 ])
3208
3209 dnl From Jim Meyering.  Use this if you use the GNU error.[ch].
3210 dnl FIXME: Migrate into libit
3211
3212 AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
3213 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
3214  [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
3215               am_cv_lib_error_at_line=yes,
3216               am_cv_lib_error_at_line=no)])
3217  if test $am_cv_lib_error_at_line = no; then
3218    LIBOBJS="$LIBOBJS error.o"
3219  fi
3220  AC_SUBST(LIBOBJS)dnl
3221 ])
3222
3223 # Macro to add for using GNU gettext.
3224 # Ulrich Drepper <drepper@cygnus.com>, 1995.
3225
3226 # serial 1
3227 # Stephan Kulow: I put a KDE in it to avoid name conflicts
3228
3229 AC_DEFUN(AM_KDE_GNU_GETTEXT,
3230   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3231    AC_REQUIRE([AC_PROG_RANLIB])dnl
3232    AC_REQUIRE([AC_HEADER_STDC])dnl
3233    AC_REQUIRE([AC_TYPE_OFF_T])dnl
3234    AC_REQUIRE([AC_TYPE_SIZE_T])dnl
3235    AC_REQUIRE([AC_FUNC_ALLOCA])dnl
3236    AC_REQUIRE([AC_FUNC_MMAP])dnl
3237    AC_REQUIRE([AM_KDE_WITH_NLS])dnl
3238    AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
3239    AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
3240 __argz_count __argz_stringify __argz_next])
3241
3242    AC_MSG_CHECKING(for stpcpy)
3243    AC_CACHE_VAL(kde_cv_func_stpcpy,
3244    [
3245    kde_safe_cxxflags=$CXXFLAGS
3246    CXXFLAGS="-Wmissing-prototypes -Werror"
3247    AC_LANG_SAVE
3248    AC_LANG_CPLUSPLUS
3249    AC_TRY_COMPILE([
3250    #include <string.h>
3251    ],
3252    [
3253    char buffer[200];
3254    stpcpy(buffer, buffer);
3255    ],
3256    kde_cv_func_stpcpy=yes,
3257    kde_cv_func_stpcpy=no)
3258    AC_LANG_RESTORE
3259    CXXFLAGS=$kde_safe_cxxflags
3260    ])
3261    AC_MSG_RESULT($kde_cv_func_stpcpy)
3262    if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
3263      AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
3264    fi
3265
3266    AM_LC_MESSAGES
3267
3268    if test "x$CATOBJEXT" != "x"; then
3269      if test "x$ALL_LINGUAS" = "x"; then
3270        LINGUAS=
3271      else
3272        AC_MSG_CHECKING(for catalogs to be installed)
3273        NEW_LINGUAS=
3274        for lang in ${LINGUAS=$ALL_LINGUAS}; do
3275          case "$ALL_LINGUAS" in
3276           *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
3277          esac
3278        done
3279        LINGUAS=$NEW_LINGUAS
3280        AC_MSG_RESULT($LINGUAS)
3281      fi
3282
3283      dnl Construct list of names of catalog files to be constructed.
3284      if test -n "$LINGUAS"; then
3285        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
3286      fi
3287    fi
3288
3289   ])
3290
3291 AC_DEFUN(AC_HAVE_XPM,
3292  [AC_REQUIRE_CPP()dnl
3293   AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3294
3295  test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
3296  test -z "$XPM_INCLUDE" && XPM_INCLUDE=
3297
3298  AC_ARG_WITH(xpm, [  --without-xpm           disable color pixmap XPM tests],
3299         xpm_test=$withval, xpm_test="yes")
3300  if test "x$xpm_test" = xno; then
3301    ac_cv_have_xpm=no
3302  else
3303    AC_MSG_CHECKING(for XPM)
3304    AC_CACHE_VAL(ac_cv_have_xpm,
3305    [
3306     AC_LANG_C
3307     ac_save_ldflags="$LDFLAGS"
3308     ac_save_cflags="$CFLAGS"
3309     if test "x$kde_use_qt_emb" != "xyes"; then
3310       LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
3311     else
3312       LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
3313     fi
3314     CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
3315     test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
3316     AC_TRY_LINK([#include <X11/xpm.h>],[],
3317         ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
3318     LDFLAGS="$ac_save_ldflags"
3319     CFLAGS="$ac_save_cflags"
3320    ])dnl
3321
3322   if test "$ac_cv_have_xpm" = no; then
3323     AC_MSG_RESULT(no)
3324     XPM_LDFLAGS=""
3325     XPMINC=""
3326     $2
3327   else
3328     AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
3329     if test "$XPM_LDFLAGS" = ""; then
3330        XPMLIB='-lXpm $(LIB_X11)'
3331     else
3332        XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
3333     fi
3334     if test "$XPM_INCLUDE" = ""; then
3335        XPMINC=""
3336     else
3337        XPMINC="-I$XPM_INCLUDE"
3338     fi
3339     AC_MSG_RESULT(yes)
3340     $1
3341   fi
3342  fi
3343  AC_SUBST(XPMINC)
3344  AC_SUBST(XPMLIB)
3345 ])
3346
3347 AC_DEFUN(AC_HAVE_DPMS,
3348  [AC_REQUIRE_CPP()dnl
3349   AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3350
3351  test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
3352  test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
3353  DPMS_LIB=
3354
3355  AC_ARG_WITH(dpms, [  --without-dpms          disable DPMS power saving],
3356         dpms_test=$withval, dpms_test="yes")
3357  if test "x$dpms_test" = xno; then
3358    ac_cv_have_dpms=no
3359  else
3360    AC_MSG_CHECKING(for DPMS)
3361    dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
3362    dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
3363    AC_CACHE_VAL(ac_cv_have_dpms,
3364    [
3365     if test "x$kde_use_qt_emb" = "xyes"; then
3366       AC_MSG_RESULT(no)
3367       ac_cv_have_dpms="no"
3368     else
3369       AC_LANG_C
3370       ac_save_ldflags="$LDFLAGS"
3371       ac_save_cflags="$CFLAGS"
3372       ac_save_libs="$LIBS"
3373       LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
3374       CFLAGS="$CFLAGS $X_INCLUDES"
3375       test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3376       AC_TRY_LINK([
3377           #include <X11/Xproto.h>
3378           #include <X11/X.h>
3379           #include <X11/Xlib.h>
3380           #include <X11/extensions/dpms.h>
3381           int foo_test_dpms()
3382           { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3383           ac_cv_have_dpms="yes", [
3384               LDFLAGS="$ac_save_ldflags"
3385               CFLAGS="$ac_save_cflags"
3386               LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
3387               LIBS="$LIBS -lXdpms"
3388               CFLAGS="$CFLAGS $X_INCLUDES"
3389               test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3390               AC_TRY_LINK([
3391                   #include <X11/Xproto.h>
3392                   #include <X11/X.h>
3393                   #include <X11/Xlib.h>
3394                   #include <X11/extensions/dpms.h>
3395                   int foo_test_dpms()
3396                   { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3397                   [
3398                   ac_cv_have_dpms="-lXdpms"
3399                   ],ac_cv_have_dpms="no")
3400               ])
3401       LDFLAGS="$ac_save_ldflags"
3402       CFLAGS="$ac_save_cflags"
3403       LIBS="$ac_save_libs"
3404     fi
3405    ])dnl
3406
3407   if test "$ac_cv_have_dpms" = no; then
3408     AC_MSG_RESULT(no)
3409     DPMS_LDFLAGS=""
3410     DPMSINC=""
3411     $2
3412   else
3413     AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
3414     if test "$ac_cv_have_dpms" = "-lXdpms"; then
3415        DPMS_LIB="-lXdpms"
3416     fi
3417     if test "$DPMS_LDFLAGS" = ""; then
3418        DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
3419     else
3420        DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
3421     fi
3422     if test "$DPMS_INCLUDE" = ""; then
3423        DPMSINC=""
3424     else
3425        DPMSINC="-I$DPMS_INCLUDE"
3426     fi
3427     AC_MSG_RESULT(yes)
3428     $1
3429   fi
3430  fi
3431  AC_SUBST(DPMSINC)
3432  AC_SUBST(DPMSLIB)
3433 ])
3434
3435 AC_DEFUN(AC_HAVE_GL,
3436  [AC_REQUIRE_CPP()dnl
3437   AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3438
3439  test -z "$GL_LDFLAGS" && GL_LDFLAGS=
3440  test -z "$GL_INCLUDE" && GL_INCLUDE=
3441
3442  AC_ARG_WITH(gl, [  --without-gl            disable 3D GL modes],
3443         gl_test=$withval, gl_test="yes")
3444  if test "x$kde_use_qt_emb" = "xyes"; then
3445    # GL and Qt Embedded is a no-go for now.
3446    ac_cv_have_gl=no
3447  elif test "x$gl_test" = xno; then
3448    ac_cv_have_gl=no
3449  else
3450    AC_MSG_CHECKING(for GL)
3451    AC_CACHE_VAL(ac_cv_have_gl,
3452    [
3453     AC_LANG_SAVE
3454     AC_LANG_CPLUSPLUS
3455     ac_save_ldflags="$LDFLAGS"
3456     ac_save_cxxflags="$CXXFLAGS"
3457     LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU"
3458     test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3459     LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3460     CXXFLAGS="$CFLAGS $X_INCLUDES"
3461     test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3462     AC_TRY_LINK([#include <GL/gl.h>
3463 #include <GL/glu.h>
3464 ], [],
3465         ac_cv_have_gl="mesa", ac_cv_have_gl="no")
3466     if test "x$ac_cv_have_gl" = "xno"; then
3467       LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGLU -lGL"
3468       test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3469       LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3470       CXXFLAGS="$ac_save_cflags $X_INCLUDES"
3471       test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3472       AC_TRY_LINK([#include <GL/gl.h>
3473 #include <GL/glu.h>
3474 ], [],
3475           ac_cv_have_gl="yes", ac_cv_have_gl="no")
3476     fi
3477     AC_LANG_RESTORE
3478     LDFLAGS="$ac_save_ldflags"
3479     CXXFLAGS="$ac_save_cxxflags"
3480    ])dnl
3481
3482   if test "$ac_cv_have_gl" = "no"; then
3483     AC_MSG_RESULT(no)
3484     GL_LDFLAGS=""
3485     GLINC=""
3486     $2
3487   else
3488     AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
3489     if test "$GL_LDFLAGS" = ""; then
3490        if test "$ac_cv_have_gl" = "mesa"; then
3491           GLLIB='-lMesaGLU -lMesaGL $(LIB_X11)'
3492        else
3493           GLLIB='-lGLU -lGL $(LIB_X11)'
3494        fi
3495     else
3496        if test "$ac_cv_have_gl" = "mesa"; then
3497           GLLIB="$GL_LDFLAGS -lMesaGLU -lMesaGL "'$(LIB_X11)'
3498        else
3499           GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
3500        fi
3501     fi
3502     if test "$GL_INCLUDE" = ""; then
3503        GLINC=""
3504     else
3505        GLINC="-I$GL_INCLUDE"
3506     fi
3507     AC_MSG_RESULT($ac_cv_have_gl)
3508     $1
3509   fi
3510  fi
3511  AC_SUBST(GLINC)
3512  AC_SUBST(GLLIB)
3513 ])
3514
3515
3516  dnl shadow password and PAM magic - maintained by ossi@kde.org
3517
3518 AC_DEFUN(KDE_PAM, [
3519   AC_REQUIRE([KDE_CHECK_LIBDL])
3520
3521   AC_ARG_WITH(pam,
3522     [  --with-pam[=ARG]        enable support for PAM: ARG=[yes|no|service name]],
3523     [ if test "x$withval" = "xyes"; then
3524         use_pam=yes
3525         pam_service=kde
3526       elif test "x$withval" = "xno"; then
3527         use_pam=no
3528       else
3529         use_pam=yes
3530         pam_service=$withval
3531       fi
3532       ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
3533     ], [
3534       AC_CACHE_VAL(ac_cv_path_pam,
3535         [ use_pam=no
3536           AC_CHECK_LIB(pam, pam_start,
3537             [ AC_CHECK_HEADER(security/pam_appl.h,
3538                 [ use_pam=yes
3539                   pam_service=kde ]) 
3540             ], , $LIBDL)
3541           ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
3542         ])
3543     ])
3544   eval "$ac_cv_path_pam"
3545
3546   AC_MSG_CHECKING(for PAM)
3547   if test "x$use_pam" = xno; then
3548     AC_MSG_RESULT(no)
3549     PAMLIBS=""
3550   else
3551     AC_MSG_RESULT(yes)
3552     AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
3553     PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
3554
3555     dnl test whether struct pam_message is const (Linux) or not (Sun)
3556     AC_MSG_CHECKING(for const pam_message)
3557     AC_EGREP_HEADER([struct pam_message], security/pam_appl.h,
3558       [ AC_EGREP_HEADER([const struct pam_message], security/pam_appl.h,
3559                         [AC_MSG_RESULT([const: Linux-type PAM])],
3560                         [AC_MSG_RESULT([nonconst: Sun-type PAM])
3561                         AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
3562                         )],
3563       [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
3564   fi
3565
3566   AC_SUBST(PAMLIBS)
3567 ])
3568
3569 dnl DEF_PAM_SERVICE(arg name, full name, define name)
3570 AC_DEFUN(DEF_PAM_SERVICE, [
3571   AC_ARG_WITH($1-pam,
3572     [  --with-$1-pam=[val]    override PAM service from --with-pam for $2],
3573     [ if test "x$use_pam" = xyes; then
3574         $3_PAM_SERVICE="$withval"
3575       else
3576         AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
3577 You may want to enforce it by using --with-pam.])
3578       fi
3579     ], 
3580     [ if test "x$use_pam" = xyes; then
3581         $3_PAM_SERVICE="$pam_service"
3582       fi
3583     ])
3584     if test -n "$$3_PAM_SERVICE"; then
3585       AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
3586       AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
3587     fi
3588     AC_SUBST($3_PAM_SERVICE)
3589 ])
3590
3591 AC_DEFUN(KDE_SHADOWPASSWD, [
3592   AC_REQUIRE([KDE_PAM])
3593
3594   AC_CHECK_LIB(shadow, getspent,
3595     [ LIBSHADOW="-lshadow"
3596       ac_use_shadow=yes
3597     ],
3598     [ dnl for UnixWare
3599       AC_CHECK_LIB(gen, getspent, 
3600         [ LIBGEN="-lgen"
3601           ac_use_shadow=yes
3602         ], 
3603         [ AC_CHECK_FUNC(getspent, 
3604             [ ac_use_shadow=yes ],
3605             [ ac_use_shadow=no ])
3606         ])
3607     ])
3608   AC_SUBST(LIBSHADOW)
3609   AC_SUBST(LIBGEN)
3610   
3611   AC_MSG_CHECKING([for shadow passwords])
3612
3613   AC_ARG_WITH(shadow,
3614     [  --with-shadow              If you want shadow password support ],
3615     [ if test "x$withval" != "xno"; then
3616         use_shadow=yes
3617       else
3618         use_shadow=no
3619       fi
3620     ], [
3621       use_shadow="$ac_use_shadow"
3622     ])
3623
3624   if test "x$use_shadow" = xyes; then
3625     AC_MSG_RESULT(yes)
3626     AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
3627   else
3628     AC_MSG_RESULT(no)
3629     LIBSHADOW=
3630     LIBGEN=
3631   fi
3632
3633   dnl finally make the relevant binaries setuid root, if we have shadow passwds.
3634   dnl this still applies, if we could use it indirectly through pam.
3635   if test "x$use_shadow" = xyes || 
3636      ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
3637       case $host in
3638       *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
3639         SETUIDFLAGS="-m 4755 -o root";;
3640       *)
3641         SETUIDFLAGS="-m 4755";;
3642       esac
3643   fi
3644   AC_SUBST(SETUIDFLAGS)
3645
3646 ])
3647
3648 AC_DEFUN(KDE_PASSWDLIBS, [
3649   AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
3650   AC_REQUIRE([KDE_PAM])
3651   AC_REQUIRE([KDE_SHADOWPASSWD])
3652
3653   if test "x$use_pam" = "xyes"; then 
3654     PASSWDLIBS="$PAMLIBS"
3655   else
3656     PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
3657   fi
3658
3659   dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
3660   dnl /etc/master.passwd holds the actual passwords.  /etc/master.passwd requires
3661   dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
3662   dnl may need to read /etc/master.passwd).
3663   case $host in
3664   *-*-freebsd*)
3665     SETUIDFLAGS="-m 4755 -o root"
3666     ;;
3667   *)
3668     ;;
3669   esac
3670
3671   AC_SUBST(PASSWDLIBS)
3672 ])
3673
3674 AC_DEFUN(KDE_CHECK_LIBDL,
3675 [
3676 AC_CHECK_LIB(dl, dlopen, [
3677 LIBDL="-ldl"
3678 ac_cv_have_dlfcn=yes
3679 ])
3680
3681 AC_CHECK_LIB(dld, shl_unload, [
3682 LIBDL="-ldld"
3683 ac_cv_have_shload=yes
3684 ])
3685
3686 AC_SUBST(LIBDL)
3687 ])
3688
3689 AC_DEFUN(KDE_CHECK_DLOPEN,
3690 [
3691 KDE_CHECK_LIBDL
3692 AC_CHECK_HEADERS(dlfcn.h dl.h)
3693 if test "$ac_cv_header_dlfcn_h" = "no"; then
3694   ac_cv_have_dlfcn=no
3695 fi
3696
3697 if test "$ac_cv_header_dl_h" = "no"; then
3698   ac_cv_have_shload=no
3699 fi
3700
3701 dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
3702 dnl (MM)
3703 AC_ARG_ENABLE(dlopen,
3704 [  --disable-dlopen        link statically [default=no]] ,
3705 enable_dlopen=$enableval,
3706 enable_dlopen=yes)
3707
3708 # override the user's opinion, if we know it better ;)
3709 if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
3710   enable_dlopen=no
3711 fi
3712
3713 if test "$ac_cv_have_dlfcn" = "yes"; then
3714   AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
3715 fi
3716
3717 if test "$ac_cv_have_shload" = "yes"; then
3718   AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
3719 fi
3720
3721 if test "$enable_dlopen" = no ; then
3722   test -n "$1" && eval $1
3723 else
3724   test -n "$2" && eval $2
3725 fi
3726
3727 ])
3728
3729 AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
3730 [
3731 KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
3732 KDE_PROG_LIBTOOL
3733 AC_MSG_CHECKING([dynamic loading])
3734 eval "`egrep '^build_libtool_libs=' libtool`"
3735 if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
3736   dynamic_loading=yes
3737   AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
3738 else
3739   dynamic_loading=no
3740 fi
3741 AC_MSG_RESULT($dynamic_loading)
3742 if test "$dynamic_loading" = "yes"; then
3743   $1
3744 else
3745   $2
3746 fi
3747 ])
3748
3749 AC_DEFUN(KDE_ADD_INCLUDES,
3750 [
3751 if test -z "$1"; then
3752   test_include="Pix.h"
3753 else
3754   test_include="$1"
3755 fi
3756
3757 AC_MSG_CHECKING([for libg++ ($test_include)])
3758
3759 AC_CACHE_VAL(kde_cv_libgpp_includes,
3760 [
3761 kde_cv_libgpp_includes=no
3762
3763    for ac_dir in               \
3764                                \
3765      /usr/include/g++          \
3766      /usr/include              \
3767      /usr/unsupported/include  \
3768      /opt/include              \
3769      $extra_include            \
3770      ; \
3771    do
3772      if test -r "$ac_dir/$test_include"; then
3773        kde_cv_libgpp_includes=$ac_dir
3774        break
3775      fi
3776    done
3777 ])
3778
3779 AC_MSG_RESULT($kde_cv_libgpp_includes)
3780 if test "$kde_cv_libgpp_includes" != "no"; then
3781   all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
3782 fi
3783 ])
3784 ])
3785
3786
3787 AC_DEFUN(KDE_CHECK_MICO,
3788 [
3789 AC_REQUIRE([KDE_CHECK_LIBDL])
3790 AC_REQUIRE([KDE_MISC_TESTS])
3791 AC_MSG_CHECKING(for MICO)
3792
3793 if test -z "$MICODIR"; then
3794     kde_micodir=/usr/local
3795  else
3796     kde_micodir="$MICODIR"
3797 fi
3798
3799 AC_ARG_WITH(micodir,
3800   [  --with-micodir=micodir  where mico is installed ],
3801   kde_micodir=$withval,
3802   kde_micodir=$kde_micodir
3803 )
3804
3805 AC_CACHE_VAL(kde_cv_mico_incdir,
3806 [
3807   mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes"
3808 AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir)
3809
3810 ])
3811 kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'`
3812
3813 if test ! -r  $kde_micodir/include/CORBA.h; then
3814   AC_MSG_ERROR([No CORBA.h found, specify another micodir])
3815 fi
3816
3817 AC_MSG_RESULT($kde_micodir)
3818
3819 MICO_INCLUDES=-I$kde_micodir/include
3820 AC_SUBST(MICO_INCLUDES)
3821 MICO_LDFLAGS=-L$kde_micodir/lib
3822 AC_SUBST(MICO_LDFLAGS)
3823 micodir=$kde_micodir
3824 AC_SUBST(micodir)
3825
3826 AC_MSG_CHECKING([for MICO version])
3827 AC_CACHE_VAL(kde_cv_mico_version,
3828 [
3829 AC_LANG_C
3830 cat >conftest.$ac_ext <<EOF
3831 #include <stdio.h>
3832 #include <mico/version.h>
3833 int main() {
3834
3835    printf("MICO_VERSION=%s\n",MICO_VERSION);
3836    return (0);
3837 }
3838 EOF
3839 ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
3840 if AC_TRY_EVAL(ac_compile); then
3841   if eval `./conftest 2>&5`; then
3842     kde_cv_mico_version=$MICO_VERSION
3843   else
3844     AC_MSG_ERROR([your system is not able to execute a small application to
3845     find MICO version! Check $kde_micodir/include/mico/version.h])
3846   fi
3847 else
3848   AC_MSG_ERROR([your system is not able to compile a small application to
3849   find MICO version! Check $kde_micodir/include/mico/version.h])
3850 fi
3851 ])
3852
3853 dnl installed MICO version
3854 mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
3855 mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
3856 mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
3857
3858 if test "x$1" = "x"; then
3859  req_version="2.3.0"
3860 else
3861  req_version=$1
3862 fi
3863
3864 dnl required MICO version
3865 req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
3866 req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
3867 req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
3868
3869 if test "$mico_v_maj" -lt "$req_v_maj" || \
3870    ( test "$mico_v_maj" -eq "$req_v_maj" && \
3871         test "$mico_v_mid" -lt "$req_v_mid" ) || \
3872    ( test "$mico_v_mid" -eq "$req_v_mid" && \
3873         test "$mico_v_min" -lt "$req_v_min" )
3874
3875 then
3876   AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \
3877 at least is required. You should upgrade MICO.])
3878 else
3879   AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)])
3880 fi
3881
3882 LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL"
3883 AC_SUBST(LIBMICO)
3884 if test -z "$IDL"; then
3885   IDL='$(kde_bindir)/cuteidl'
3886 fi
3887 AC_SUBST(IDL)
3888 IDL_DEPENDENCIES='$(kde_includes)/CUTE.h'
3889 AC_SUBST(IDL_DEPENDENCIES)
3890
3891 idldir="\$(includedir)/idl"
3892 AC_SUBST(idldir)
3893
3894 ])
3895
3896 AC_DEFUN(KDE_CHECK_MINI_STL,
3897 [
3898 AC_REQUIRE([KDE_CHECK_MICO])
3899
3900 AC_MSG_CHECKING(if we use mico's mini-STL)
3901 AC_CACHE_VAL(kde_cv_have_mini_stl,
3902 [
3903 AC_LANG_SAVE
3904 AC_LANG_CPLUSPLUS
3905 kde_save_cxxflags="$CXXFLAGS"
3906 CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
3907 AC_TRY_COMPILE(
3908 [
3909 #include <mico/config.h>
3910 ],
3911 [
3912 #ifdef HAVE_MINI_STL
3913 #error "nothing"
3914 #endif
3915 ],
3916 kde_cv_have_mini_stl=no,
3917 kde_cv_have_mini_stl=yes)
3918 CXXFLAGS="$kde_save_cxxflags"
3919 AC_LANG_RESTORE
3920 ])
3921
3922 if test "x$kde_cv_have_mini_stl" = "xyes"; then
3923    AC_MSG_RESULT(yes)
3924    $1
3925 else
3926    AC_MSG_RESULT(no)
3927    $2
3928 fi
3929 ])
3930
3931 ])
3932
3933
3934 AC_DEFUN(KDE_CHECK_LIBPTHREAD,
3935 [
3936 AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
3937 AC_SUBST(LIBPTHREAD)
3938 ])
3939
3940 AC_DEFUN(KDE_CHECK_PTHREAD_OPTION,
3941 [
3942     AC_ARG_ENABLE(kernel-threads, [  --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.],
3943         kde_use_kernthreads=$enableval, kde_use_kernthreads=no)
3944
3945     if test "$kde_use_kernthreads" = "yes"; then
3946       ac_save_CXXFLAGS="$CXXFLAGS"
3947       ac_save_CFLAGS="$CFLAGS"
3948       CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
3949       CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
3950       AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
3951       CXXFLAGS="$ac_save_CXXFLAGS"
3952       CFLAGS="$ac_save_CFLAGS"
3953       if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then
3954         kde_use_kernthreads=no
3955       else
3956         dnl Add proper -I and -l statements
3957         AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD
3958         if test "x$LIBPTHREAD" = "x"; then
3959           kde_use_kernthreads=no
3960         else
3961           USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
3962         fi
3963       fi
3964     else 
3965       USE_THREADS=""
3966       if test -z "$LIBPTHREAD"; then
3967         KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] )
3968       fi
3969     fi
3970
3971     AH_VERBATIM(__svr_define, [
3972 #if defined(__SVR4) && !defined(__svr4__)
3973 #define __svr4__ 1
3974 #endif
3975 ])
3976     case $host_os in
3977         solaris*)
3978                 KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
3979                 CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
3980                 ;;
3981         freebsd*)
3982                 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
3983                 ;;
3984         aix*)
3985                 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
3986                 LIBPTHREAD="$LIBPTHREAD -lc_r"
3987                 ;;
3988         linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
3989                 if test "$CXX" = "KCC"; then
3990                   CXXFLAGS="$CXXFLAGS --thread_safe"
3991                   NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
3992                 fi
3993                 ;;
3994         *)
3995                 ;;
3996     esac
3997     AC_SUBST(USE_THREADS)
3998     AC_SUBST(LIBPTHREAD)
3999 ])
4000
4001 AC_DEFUN(KDE_CHECK_THREADING,
4002 [
4003   AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4004   AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
4005   dnl default is yes if libpthread is found and no if no libpthread is available
4006   if test -z "$LIBPTHREAD"; then
4007     if test -z "$USE_THREADS"; then
4008       kde_check_threading_default=no
4009     else
4010       kde_check_threading_default=yes
4011     fi
4012   else
4013     kde_check_threading_default=yes
4014   fi
4015   AC_ARG_ENABLE(threading, [  --disable-threading     disables threading even if libpthread found ],
4016    kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
4017   if test "x$kde_use_threading" = "xyes"; then
4018     AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
4019   fi
4020 ])
4021
4022 AC_DEFUN(KDE_TRY_LINK_PYTHON,
4023 [
4024 if test "$kde_python_link_found" = no; then
4025
4026 if test "$1" = normal; then
4027   AC_MSG_CHECKING(if a Python application links)
4028 else
4029   AC_MSG_CHECKING(if Python depends on $2)
4030 fi
4031
4032 AC_CACHE_VAL(kde_cv_try_link_python_$1,
4033 [
4034 AC_LANG_SAVE
4035 AC_LANG_C
4036 kde_save_cflags="$CFLAGS"
4037 CFLAGS="$CFLAGS $PYTHONINC"
4038 kde_save_libs="$LIBS"
4039 LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
4040 kde_save_ldflags="$LDFLAGS"
4041 LDFLAGS="$LDFLAGS $PYTHONLIB"
4042
4043 AC_TRY_LINK(
4044 [
4045 #include <Python.h>
4046 ],[
4047         PySys_SetArgv(1, 0);
4048 ],
4049         [kde_cv_try_link_python_$1=yes],
4050         [kde_cv_try_link_python_$1=no]
4051 )
4052 CFLAGS="$kde_save_cflags"
4053 LIBS="$kde_save_libs"
4054 LDFLAGS="$kde_save_ldflags"
4055 ])
4056
4057 if test "$kde_cv_try_link_python_$1" = "yes"; then
4058   AC_MSG_RESULT(yes)
4059   kde_python_link_found=yes
4060   if test ! "$1" = normal; then
4061     LIBPYTHON="$LIBPYTHON $2"
4062   fi
4063   $3
4064 else
4065   AC_MSG_RESULT(no)
4066   $4
4067 fi
4068 AC_LANG_RESTORE
4069
4070 fi
4071
4072 ])
4073
4074 AC_DEFUN(KDE_CHECK_PYTHON_DIR,
4075 [
4076 AC_MSG_CHECKING([for Python directory])
4077  
4078 AC_CACHE_VAL(kde_cv_pythondir,
4079 [
4080   if test -z "$PYTHONDIR"; then
4081     kde_cv_pythondir=/usr/local
4082   else
4083     kde_cv_pythondir="$PYTHONDIR"
4084   fi
4085 ])
4086  
4087 AC_ARG_WITH(pythondir,
4088 [  --with-pythondir=pythondir   use python installed in pythondir ],
4089 [
4090   ac_python_dir=$withval
4091 ], ac_python_dir=$kde_cv_pythondir
4092 )
4093  
4094 AC_MSG_RESULT($ac_python_dir)
4095 ])
4096
4097 AC_DEFUN(KDE_CHECK_PYTHON_INTERN,
4098 [
4099 AC_REQUIRE([KDE_CHECK_LIBDL])
4100 AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4101 AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
4102
4103 if test -z "$1"; then
4104   version="1.5"
4105 else
4106   version="$1"
4107 fi
4108
4109 AC_MSG_CHECKING([for Python$version])
4110
4111 python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
4112 AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
4113 if test ! -r $python_incdir/Python.h; then
4114   AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
4115   python_incdir=$python_incdir/python$version
4116   if test ! -r $python_incdir/Python.h; then
4117     python_incdir=no
4118   fi
4119 fi
4120
4121 PYTHONINC=-I$python_incdir
4122
4123 python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
4124 AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
4125 if test ! -r $python_libdir/libpython$version.a; then
4126   AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
4127   python_libdir=$python_libdir/python$version/config
4128   if test ! -r $python_libdir/libpython$version.a; then
4129     python_libdir=no
4130   fi
4131 fi
4132
4133 PYTHONLIB=-L$python_libdir
4134 kde_orig_LIBPYTHON=$LIBPYTHON
4135 if test -z "$LIBPYTHON"; then
4136   LIBPYTHON=-lpython$version
4137 fi
4138
4139 python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
4140 AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
4141 python_moddir=$python_moddir/python$version
4142 if test ! -r $python_moddir/copy.py; then
4143   python_moddir=no
4144 fi
4145
4146 PYTHONMODDIR=$python_moddir
4147
4148 AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
4149
4150 if test x$python_incdir = xno ||  test x$python_libdir = xno ||  test x$python_moddir = xno; then
4151    LIBPYTHON=$kde_orig_LIBPYTHON
4152    test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
4153    test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
4154    $2
4155 else 
4156   dnl Note: this test is very weak
4157   kde_python_link_found=no
4158   KDE_TRY_LINK_PYTHON(normal)
4159   KDE_TRY_LINK_PYTHON(m, -lm)
4160   KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
4161   KDE_TRY_LINK_PYTHON(tcl, -ltcl)
4162   KDE_TRY_LINK_PYTHON(db2, -ldb2)
4163   KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
4164   KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
4165   KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
4166   KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
4167   KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
4168   KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
4169   KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
4170         [AC_MSG_WARN([it seems, Python depends on another library.
4171     Pleae set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
4172     and contact the authors to let them know about this problem])
4173         ])
4174
4175   LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
4176   AC_SUBST(PYTHONINC)
4177   AC_SUBST(PYTHONLIB)
4178   AC_SUBST(LIBPYTHON)
4179   AC_SUBST(PYTHONMODDIR)
4180   AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
4181 fi
4182
4183 ])
4184
4185
4186 AC_DEFUN(KDE_CHECK_PYTHON,
4187 [
4188   KDE_CHECK_PYTHON_INTERN("2.2", 
4189     [KDE_CHECK_PYTHON_INTERN("2.1", 
4190       [KDE_CHECK_PYTHON_INTERN("2.0", [ KDE_CHECK_PYTHON_INTERN($1, $2) ])
4191   ])])
4192 ])
4193
4194 AC_DEFUN(KDE_CHECK_STL_SGI,
4195 [
4196     AC_MSG_CHECKING([if STL implementation is SGI like])
4197     AC_CACHE_VAL(kde_cv_stl_type_sgi,
4198     [
4199       AC_TRY_COMPILE([
4200 #include <string>
4201 using namespace std;
4202 ],[
4203   string astring="Hallo Welt.";
4204   astring.erase(0, 6); // now astring is "Welt"
4205   return 0;
4206 ], kde_cv_stl_type_sgi=yes,
4207    kde_cv_stl_type_sgi=no)
4208 ])
4209
4210    AC_MSG_RESULT($kde_cv_stl_type_sgi)
4211
4212    if test "$kde_cv_stl_type_sgi" = "yes"; then
4213         AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
4214    fi
4215 ])
4216
4217 AC_DEFUN(KDE_CHECK_STL_HP,
4218 [
4219     AC_MSG_CHECKING([if STL implementation is HP like])
4220     AC_CACHE_VAL(kde_cv_stl_type_hp,
4221     [
4222       AC_TRY_COMPILE([
4223 #include <string>
4224 using namespace std;
4225 ],[
4226   string astring="Hello World";
4227   astring.remove(0, 6); // now astring is "World"
4228   return 0;
4229 ], kde_cv_stl_type_hp=yes,
4230    kde_cv_stl_type_hp=no)
4231 ])
4232    AC_MSG_RESULT($kde_cv_stl_type_hp)
4233
4234    if test "$kde_cv_stl_type_hp" = "yes"; then
4235         AC_DEFINE_UNQUOTED(HAVE_HP_STL, 1, [Define if you have a STL implementation by HP])
4236    fi
4237 ])
4238
4239 AC_DEFUN(KDE_CHECK_STL,
4240 [
4241     AC_LANG_SAVE
4242     AC_LANG_CPLUSPLUS
4243     ac_save_CXXFLAGS="$CXXFLAGS"
4244     CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
4245     KDE_CHECK_STL_SGI
4246
4247     if test "$kde_cv_stl_type_sgi" = "no"; then
4248        KDE_CHECK_STL_HP
4249
4250        if test "$kde_cv_stl_type_hp" = "no"; then
4251          AC_MSG_ERROR("no known STL type found - did you forget to install libstdc++[-devel] ?")
4252        fi
4253     fi
4254
4255     CXXFLAGS="$ac_save_CXXFLAGS"
4256     AC_LANG_RESTORE
4257 ])
4258
4259 AC_DEFUN(AC_FIND_QIMGIO,
4260    [AC_REQUIRE([AC_FIND_JPEG])
4261 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
4262 AC_MSG_CHECKING([for qimgio])
4263 AC_CACHE_VAL(ac_cv_lib_qimgio,
4264 [
4265 AC_LANG_SAVE
4266 AC_LANG_CPLUSPLUS
4267 ac_save_LIBS="$LIBS"
4268 ac_save_CXXFLAGS="$CXXFLAGS"
4269 LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
4270 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
4271 AC_TRY_RUN(dnl
4272 [
4273 #include <qimageio.h>
4274 #include <qstring.h>
4275 int main() {
4276                 QString t = "hallo";
4277                 t.fill('t');
4278                 qInitImageIO();
4279 }
4280 ],
4281             ac_cv_lib_qimgio=yes,
4282             ac_cv_lib_qimgio=no,
4283             ac_cv_lib_qimgio=no)
4284 LIBS="$ac_save_LIBS"
4285 CXXFLAGS="$ac_save_CXXFLAGS"
4286 AC_LANG_RESTORE
4287 ])dnl
4288 if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
4289   LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
4290   AC_MSG_RESULT(yes)
4291   AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
4292   AC_SUBST(LIBQIMGIO)
4293 else
4294   AC_MSG_RESULT(not found)
4295 fi
4296 ])
4297
4298 AC_DEFUN(KDE_CHECK_ANSI,
4299 [
4300 ])
4301
4302 AC_DEFUN(KDE_CHECK_INSURE,
4303 [
4304   AC_ARG_ENABLE(insure, [  --enable-insure             use insure++ for debugging [default=no]],
4305   [
4306   if test $enableval = "no"; dnl
4307         then ac_use_insure="no"
4308         else ac_use_insure="yes"
4309    fi
4310   ], [ac_use_insure="no"])
4311
4312   AC_MSG_CHECKING(if we will use Insure++ to debug)
4313   AC_MSG_RESULT($ac_use_insure)
4314   if test "$ac_use_insure" = "yes"; dnl
4315        then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
4316    fi
4317 ])
4318
4319 AC_DEFUN(AM_DISABLE_LIBRARIES,
4320 [
4321     AC_PROVIDE([AM_ENABLE_STATIC])
4322     AC_PROVIDE([AM_ENABLE_SHARED])
4323     enable_static=no
4324     enable_shared=yes
4325 ])
4326
4327
4328 AC_DEFUN(AC_CHECK_UTMP_FILE,
4329 [
4330     AC_MSG_CHECKING([for utmp file])
4331
4332     AC_CACHE_VAL(kde_cv_utmp_file,
4333     [
4334     kde_cv_utmp_file=no
4335
4336     for ac_file in    \
4337                       \
4338         /var/run/utmp \
4339         /var/adm/utmp \
4340         /etc/utmp     \
4341      ; \
4342     do
4343      if test -r "$ac_file"; then
4344        kde_cv_utmp_file=$ac_file
4345        break
4346      fi
4347     done
4348     ])
4349
4350     if test "$kde_cv_utmp_file" != "no"; then
4351         AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
4352         $1
4353         AC_MSG_RESULT($kde_cv_utmp_file)
4354     else
4355         $2
4356         AC_MSG_RESULT([non found])
4357     fi
4358 ])
4359
4360
4361 AC_DEFUN(KDE_CREATE_SUBDIRSLIST,
4362 [
4363
4364 DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
4365
4366 if test ! -s $srcdir/subdirs; then
4367   dnl Note: Makefile.common creates subdirs, so this is just a fallback
4368   TOPSUBDIRS=""
4369   files=`cd $srcdir && ls -1`
4370   dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
4371   for i in $dirs; do
4372     echo $i >> $srcdir/subdirs
4373   done
4374 fi
4375
4376 if test -s $srcdir/inst-apps; then
4377   ac_topsubdirs="`cat $srcdir/inst-apps`"
4378 else
4379   ac_topsubdirs="`cat $srcdir/subdirs`"
4380 fi
4381
4382 for i in $ac_topsubdirs; do
4383   AC_MSG_CHECKING([if $i should be compiled])
4384   if test -d $srcdir/$i; then
4385     install_it="yes"
4386     for j in $DO_NOT_COMPILE; do
4387       if test $i = $j; then
4388         install_it="no"
4389       fi
4390     done
4391   else
4392     install_it="no"
4393   fi
4394   AC_MSG_RESULT($install_it)
4395   vari=`echo $i | sed -e 's,[[-+.]],_,g'`
4396   if test $install_it = "yes"; then
4397     TOPSUBDIRS="$TOPSUBDIRS $i"
4398     eval "$vari""_SUBDIR_included=yes"
4399   else
4400     eval "$vari""_SUBDIR_included=no"
4401   fi
4402 done
4403
4404 AC_SUBST(TOPSUBDIRS)
4405 ])
4406
4407 AC_DEFUN(KDE_CHECK_NAMESPACES,
4408 [
4409 AC_MSG_CHECKING(whether C++ compiler supports namespaces)
4410 AC_LANG_SAVE
4411 AC_LANG_CPLUSPLUS
4412 AC_TRY_COMPILE([
4413 ],
4414 [
4415 namespace Foo {
4416   extern int i;
4417   namespace Bar {
4418     extern int i;
4419   }
4420 }
4421
4422 int Foo::i = 0;
4423 int Foo::Bar::i = 1;
4424 ],[
4425   AC_MSG_RESULT(yes)
4426   AC_DEFINE(HAVE_NAMESPACES)
4427 ], [
4428 AC_MSG_RESULT(no)
4429 ])
4430 AC_LANG_RESTORE
4431 ])
4432
4433 AC_DEFUN(KDE_CHECK_NEWLIBS,
4434 [
4435
4436 ])
4437
4438 dnl ------------------------------------------------------------------------
4439 dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
4440 dnl ------------------------------------------------------------------------
4441 dnl
4442 AC_DEFUN(AC_CHECK_S_ISSOCK,
4443 [
4444 AC_MSG_CHECKING(for S_ISSOCK)
4445 AC_CACHE_VAL(ac_cv_have_s_issock,
4446 [
4447 AC_LANG_SAVE
4448 AC_LANG_C
4449 AC_TRY_LINK(
4450 [
4451 #include <sys/stat.h>
4452 ],
4453 [
4454 struct stat buff;
4455 int b = S_ISSOCK( buff.st_mode );
4456 ],
4457 ac_cv_have_s_issock=yes,
4458 ac_cv_have_s_issock=no)
4459 AC_LANG_RESTORE
4460 ])
4461 AC_MSG_RESULT($ac_cv_have_s_issock)
4462 if test "$ac_cv_have_s_issock" = "yes"; then
4463   AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
4464 fi
4465
4466 AH_VERBATIM(_ISSOCK,
4467 [
4468 #ifndef HAVE_S_ISSOCK
4469 #define HAVE_S_ISSOCK
4470 #define S_ISSOCK(mode) (1==0)
4471 #endif
4472 ])
4473
4474 ])
4475
4476 dnl ------------------------------------------------------------------------
4477 dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
4478 dnl ------------------------------------------------------------------------
4479 dnl
4480 AC_DEFUN(AC_CHECK_KDEMAXPATHLEN,
4481 [
4482 AC_MSG_CHECKING(for MAXPATHLEN)
4483 AC_CACHE_VAL(ac_cv_maxpathlen,
4484 [
4485 AC_LANG_C
4486 cat > conftest.$ac_ext <<EOF
4487 #ifdef STDC_HEADERS
4488 # include <stdlib.h>
4489 #endif
4490 #include <stdio.h>
4491 #include <sys/param.h>
4492 #ifndef MAXPATHLEN
4493 #define MAXPATHLEN 1024
4494 #endif
4495
4496 KDE_HELLO MAXPATHLEN
4497
4498 EOF
4499
4500 ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
4501
4502 if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
4503     ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
4504 else
4505     ac_cv_maxpathlen=1024
4506 fi
4507
4508 rm conftest.*
4509
4510 ])
4511 AC_MSG_RESULT($ac_cv_maxpathlen)
4512 AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
4513 ])
4514
4515 dnl -------------------------------------------------------------------------
4516 dnl See if the compiler supports a template repository         bero@redhat.de
4517 dnl -------------------------------------------------------------------------
4518 AC_DEFUN(KDE_COMPILER_REPO,
4519 [
4520   REPO=""
4521   NOREPO=""
4522
4523   KDE_CHECK_COMPILER_FLAG(frepo,
4524    [
4525      REPO="-frepo"
4526      NOREPO="-fno-repo"
4527    ])
4528
4529   if test -z "$REPO"; then
4530   KDE_CHECK_COMPILER_FLAG(instances=explicit,
4531   [
4532      REPO="-instances=explicit"
4533      NOREPO="-instances=extern"
4534   ])
4535   fi
4536
4537   if test -n "$REPO"; then
4538      AC_DEFINE_UNQUOTED(HAVE_TEMPLATE_REPOSITORY, 1,
4539                 [C++ compiler supports template repository])
4540      $1
4541   fi
4542
4543   AC_SUBST(REPO)
4544   AC_SUBST(NOREPO)
4545 ])
4546
4547 AC_DEFUN(KDE_CHECK_HEADER,
4548 [
4549    AC_LANG_SAVE
4550    kde_safe_cppflags=$CPPFLAGS
4551    CPPFLAGS="$CPPFLAGS $all_includes"
4552    AC_LANG_CPLUSPLUS
4553    AC_CHECK_HEADER($1, $2, $3)
4554    CPPFLAGS=$kde_safe_cppflags
4555    AC_LANG_RESTORE
4556 ])
4557
4558 AC_DEFUN(KDE_CHECK_HEADERS,
4559 [
4560    AH_CHECK_HEADERS([$1])
4561    AC_LANG_SAVE
4562    kde_safe_cppflags=$CPPFLAGS
4563    CPPFLAGS="$CPPFLAGS $all_includes"
4564    AC_LANG_CPLUSPLUS
4565    AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
4566    CPPFLAGS=$kde_safe_cppflags
4567    AC_LANG_RESTORE
4568 ])
4569
4570 AC_DEFUN(KDE_FAST_CONFIGURE,
4571 [
4572   dnl makes configure fast (needs perl)
4573   AC_ARG_ENABLE(fast-perl, [  --disable-fast-perl     disable fast Makefile generation (needs perl)],
4574       with_fast_perl=$enableval, with_fast_perl=yes)
4575 ])
4576
4577 AC_DEFUN(KDE_CONF_FILES,
4578 [
4579   val=
4580   if test -f $srcdir/configure.files ; then
4581     val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
4582   fi
4583   CONF_FILES=
4584   if test -n "$val" ; then
4585     for i in $val ; do
4586       CONF_FILES="$CONF_FILES $i"
4587     done
4588   fi
4589   AC_SUBST(CONF_FILES)
4590 ])dnl
4591
4592 AC_DEFUN(KDE_SET_PREFIX,
4593 [
4594   unset CDPATH
4595   dnl make $KDEDIR the default for the installation
4596   AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
4597
4598   if test "x$prefix" = "xNONE"; then
4599     prefix=$ac_default_prefix
4600     ac_configure_args="$ac_configure_args --prefix=$prefix"
4601   fi
4602   # And delete superflous '/' to make compares easier
4603   prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4604   exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4605   KDE_FAST_CONFIGURE
4606   KDE_CONF_FILES
4607 ])
4608
4609 pushdef([AC_PROG_INSTALL],
4610 [
4611   dnl our own version, testing for a -p flag
4612   popdef([AC_PROG_INSTALL])
4613   dnl as AC_PROG_INSTALL works as it works we first have
4614   dnl to save if the user didn't specify INSTALL, as the
4615   dnl autoconf one overwrites INSTALL and we have no chance to find
4616   dnl out afterwards
4617   test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
4618   test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
4619   test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
4620   AC_PROG_INSTALL
4621
4622   if test -z "$kde_save_INSTALL_given" ; then
4623     # OK, user hasn't given any INSTALL, autoconf found one for us
4624     # now we test, if it supports the -p flag
4625     AC_MSG_CHECKING(for -p flag to install)
4626     rm -f confinst.$$.* > /dev/null 2>&1
4627     echo "Testtest" > confinst.$$.orig
4628     ac_res=no
4629     if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
4630       if test -f confinst.$$.new ; then
4631         # OK, -p seems to do no harm to install
4632         INSTALL="${INSTALL} -p"
4633         ac_res=yes
4634       fi
4635     fi
4636     rm -f confinst.$$.*
4637     AC_MSG_RESULT($ac_res)
4638   fi
4639   dnl the following tries to resolve some signs and wonders coming up
4640   dnl with different autoconf/automake versions
4641   dnl e.g.:
4642   dnl  *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
4643   dnl   and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
4644   dnl   it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
4645   dnl  *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
4646   dnl   INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
4647   dnl   install-@DIR@PROGRAMS targets to explicitly use that flag
4648   dnl  *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
4649   dnl   INSTALL_SCRIPT, which breaks with automake <= 1.4
4650   dnl  *autoconf >2.13 (since 10.Apr 1999) has not that failure
4651   dnl  *sometimes KDE does not use the install-@DIR@PROGRAM targets from
4652   dnl   automake (due to broken Makefile.am or whatever) to install programs,
4653   dnl   and so does not see the -s flag in automake > 1.4
4654   dnl to clean up that mess we:
4655   dnl  +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
4656   dnl   which cleans KDE's program with automake > 1.4;
4657   dnl  +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
4658   dnl   with automake<=1.4
4659   dnl  note that dues to this sometimes two '-s' flags are used (if KDE
4660   dnl   properly uses install-@DIR@PROGRAMS, but I don't care
4661   dnl
4662   dnl And to all this comes, that I even can't write in comments variable
4663   dnl  names used by automake, because it is so stupid to think I wanted to
4664   dnl  _use_ them, therefor I have written A_M_... instead of AM_
4665   dnl hmm, I wanted to say something ... ahh yes: Arghhh.
4666
4667   if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
4668     INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
4669   fi
4670   if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
4671     INSTALL_SCRIPT='${INSTALL}'
4672   fi
4673 ])dnl
4674
4675 AC_DEFUN(KDE_LANG_CPLUSPLUS,
4676 [AC_LANG_CPLUSPLUS
4677 ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
4678 pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
4679 ])
4680
4681 pushdef([AC_LANG_CPLUSPLUS],
4682 [popdef([AC_LANG_CPLUSPLUS])
4683 KDE_LANG_CPLUSPLUS
4684 ])
4685
4686 AC_DEFUN(KDE_CHECK_LONG_LONG,
4687 [
4688 AC_MSG_CHECKING(for long long)
4689 AC_CACHE_VAL(kde_cv_c_long_long,
4690 [
4691   AC_LANG_SAVE
4692   AC_LANG_CPLUSPLUS
4693   AC_TRY_LINK([], [
4694   long long foo = 0;
4695   foo = foo+1;
4696   ],
4697   kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
4698   AC_LANG_RESTORE
4699 ])
4700 AC_MSG_RESULT($kde_cv_c_long_long)
4701 if test "$kde_cv_c_long_long" = yes; then
4702    AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
4703 fi
4704 ])
4705
4706 AC_DEFUN(KDE_CHECK_LIB,
4707 [
4708      kde_save_LDFLAGS="$LDFLAGS"
4709      dnl AC_CHECK_LIB modifies LIBS, so save it here
4710      kde_save_LIBS="$LIBS"
4711      LDFLAGS="$LDFLAGS $all_libraries"
4712      case $host_os in
4713       aix*) LDFLAGS="-brtl $LDFLAGS"
4714         test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
4715         ;;
4716      esac
4717      AC_CHECK_LIB($1, $2, $3, $4, $5)
4718      LDFLAGS="$kde_save_LDFLAGS"
4719      LIBS="$kde_save_LIBS"
4720 ])
4721
4722 AC_DEFUN(KDE_JAVA_PREFIX,
4723 [
4724         dir=`dirname "$1"`
4725         base=`basename "$1"`
4726         list=`ls -1 $dir 2> /dev/null`
4727         for entry in $list; do 
4728                 if test -d $dir/$entry/bin; then
4729                         case $entry in
4730                            $base)
4731                                 javadirs="$javadirs $dir/$entry/bin"
4732                                 ;;
4733                         esac
4734                 elif test -d $dir/$entry/jre/bin; then
4735                         case $entry in
4736                            $base)
4737                                 javadirs="$javadirs $dir/$entry/jre/bin"
4738                                 ;;
4739                         esac
4740                 fi
4741         done
4742 ])
4743
4744 dnl KDE_CHEC_JAVA_DIR(onlyjre)
4745 AC_DEFUN(KDE_CHECK_JAVA_DIR,
4746 [
4747
4748 AC_ARG_WITH(java,
4749 [  --with-java=javadir     use java installed in javadir, --without-java disables ],
4750 [  ac_java_dir=$withval
4751 ], ac_java_dir=""
4752 )
4753
4754 AC_MSG_CHECKING([for Java])
4755
4756 dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
4757 if test "x$ac_java_dir" = "xno"; then
4758    kde_java_bindir=no
4759    kde_java_includedir=no
4760    kde_java_libjvmdir=no
4761    kde_java_libhpidir=no
4762 else
4763   if test "x$ac_java_dir" = "x"; then
4764      
4765      
4766       dnl No option set -> look in $PATH
4767       KDE_JAVA_PREFIX(/usr/j2se)
4768       KDE_JAVA_PREFIX(/usr/j*dk*)
4769       KDE_JAVA_PREFIX(/usr/lib/j*dk*)
4770       KDE_JAVA_PREFIX(/opt/j*sdk*)
4771       KDE_JAVA_PREFIX(/usr/lib/java*)
4772       KDE_JAVA_PREFIX(/usr/java*)
4773       KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
4774       KDE_JAVA_PREFIX(/usr/lib/SunJava*)
4775       KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
4776       KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
4777       KDE_JAVA_PREFIX(/opt/java*)
4778     
4779       kde_cv_path="NONE"
4780       kde_save_IFS=$IFS
4781       IFS=':'
4782       for dir in $PATH; do
4783           javadirs="$javadirs $dir"
4784       done
4785       IFS=$kde_save_IFS
4786       jredirs=
4787
4788       for dir in $javadirs; do
4789           if test ! -d $dir; then break; fi
4790           if test -x "$dir/java"; then
4791                 libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4792                 if test ! -f $libjvmdir/libjvm.so; then continue; fi
4793                 jredirs="$jredirs $dir"
4794           fi
4795       done
4796
4797       JAVAC=
4798       JAVA=
4799       kde_java_bindir=no
4800       for dir in $jredirs; do
4801           JAVA="$dir/java"
4802           kde_java_bindir=$dir
4803           if test -x "$dir/javac"; then
4804                 JAVAC="$dir/javac"
4805                 break
4806           fi
4807       done
4808
4809       if test -n "$JAVAC"; then
4810           dnl this substitution might not work - well, we test for jni.h below
4811           kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
4812       else
4813           kde_java_includedir=no
4814       fi
4815   else
4816     dnl config option set
4817     kde_java_bindir=$ac_java_dir/bin
4818     if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
4819         kde_java_includedir=no
4820     else
4821         kde_java_includedir=$ac_java_dir/include
4822     fi
4823   fi
4824 fi
4825
4826 dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
4827 if test "x$kde_java_bindir" != "xno"; then
4828
4829   dnl Look for libjvm.so
4830   kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4831   dnl Look for libhpi.so and avoid green threads
4832   kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
4833
4834   dnl Now check everything's fine under there
4835   dnl the include dir is our flag for having the JDK
4836   if test -d "$kde_java_includedir"; then
4837     if test ! -x "$kde_java_bindir/javac"; then
4838       AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
4839     fi
4840     if test ! -x "$kde_java_bindir/javah"; then
4841       AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
4842     fi
4843     if test ! -x "$kde_java_bindir/jar"; then
4844       AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
4845     fi
4846     if test ! -r "$kde_java_includedir/jni.h"; then
4847       AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
4848     fi
4849
4850     jni_includes="-I$kde_java_includedir"
4851     dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
4852     dnl and under linux here..
4853     test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
4854     test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
4855     test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
4856
4857   else
4858     JAVAC=
4859     jni_includes=
4860   fi
4861
4862   if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
4863      AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
4864   fi 
4865
4866   if test ! -x "$kde_java_bindir/java"; then
4867       AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
4868   fi
4869
4870   if test ! -r "$kde_java_libhpidir/libhpi.so"; then
4871     AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
4872   fi
4873
4874   if test -n "$jni_includes"; then
4875     dnl Check for JNI version
4876     AC_LANG_SAVE
4877     AC_LANG_CPLUSPLUS
4878     ac_cxxflags_safe="$CXXFLAGS"
4879     CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
4880
4881     AC_TRY_COMPILE([
4882   #include <jni.h>
4883               ],
4884               [
4885   #ifndef JNI_VERSION_1_2
4886   Syntax Error
4887   #endif
4888               ],[ kde_jni_works=yes ],
4889               [ kde_jni_works=no ])
4890
4891     if test $kde_jni_works = no; then
4892       AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
4893                     You need to have Java Development Kit (JDK) version 1.2. 
4894
4895                     Use --with-java to specify another location.
4896                     Use --without-java to configure without java support.
4897                     Or download a newer JDK and try again. 
4898                     See e.g. http://java.sun.com/products/jdk/1.2 ])
4899     fi
4900
4901     CXXFLAGS="$ac_cxxflags_safe"    
4902     AC_LANG_RESTORE
4903
4904     dnl All tests ok, inform and subst the variables
4905
4906     JAVAC=$kde_java_bindir/javac
4907     JAVAH=$kde_java_bindir/javah
4908     JAR=$kde_java_bindir/jar
4909     AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
4910     JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
4911     AC_MSG_RESULT([java JDK in $kde_java_bindir])
4912
4913   else
4914       AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
4915       AC_MSG_RESULT([java JRE in $kde_java_bindir])
4916   fi
4917 else # no
4918   AC_MSG_RESULT([none found])
4919 fi
4920
4921 AC_SUBST(JAVAC)
4922 AC_SUBST(JAVAH)
4923 AC_SUBST(JAR)
4924 AC_SUBST(JVMLIBS)
4925 AC_SUBST(jni_includes)
4926
4927 # for backward compat
4928 kde_cv_java_includedir=$kde_java_includedir
4929 kde_cv_java_bindir=$kde_java_bindir
4930 ])
4931
4932 dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
4933 dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
4934 dnl big packages, m4_foreach is dog-slow.  So use our own version of
4935 dnl it.  (matz@kde.org)
4936 m4_define([mm_foreach],
4937 [m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
4938 m4_define([mm_car], [[$1]])
4939 m4_define([mm_car2], [[$@]])
4940 m4_define([_mm_foreach],
4941 [m4_if(m4_quote($2), [], [],
4942        [m4_define([$1], [mm_car($2)])$3[]_mm_foreach([$1],
4943                                                      mm_car2(m4_shift($2)),
4944                                                      [$3])])])
4945 m4_define([AC_FOREACH],
4946 [mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
4947
4948 AC_DEFUN(KDE_NEED_FLEX,
4949 [
4950 kde_libs_safe=$LIBS
4951 LIBS="$LIBS $USER_LDFLAGS"
4952 AM_PROG_LEX
4953 LIBS=$kde_libs_safe
4954 if test -z "$LEXLIB"; then
4955     AC_MSG_ERROR([You need to have flex installed.])
4956 fi
4957 AC_SUBST(LEXLIB)
4958 ])
4959
4960 AC_DEFUN(AC_PATH_QTOPIA,
4961 [
4962   dnl TODO: use AC_CACHE_VAL
4963
4964   if test -z "$1"; then
4965     qtopia_minver_maj=1
4966     qtopia_minver_min=5
4967     qtopia_minver_pat=0
4968   else
4969     qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
4970     qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
4971     qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
4972   fi
4973
4974   qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
4975   qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
4976
4977   AC_REQUIRE([AC_PATH_QT])
4978
4979   AC_MSG_CHECKING([for Qtopia])
4980
4981   LIB_QTOPIA="-lqpe"
4982   AC_SUBST(LIB_QTOPIA)
4983
4984   kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
4985
4986   ac_qtopia_incdir=NO
4987
4988   AC_ARG_WITH(qtopia-dir,
4989               [  --with-qtopia-dir=DIR   where the root of Qtopia is installed ],
4990               [  ac_qtopia_incdir="$withval"/include] ) 
4991   
4992   qtopia_incdirs=""
4993   for dir in $kde_qtopia_dirs; do
4994     qtopia_incdirs="$qtopia_incdirs $dir/include"
4995   done
4996
4997   if test ! "$ac_qtopia_incdir" = "NO"; then
4998     qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
4999   fi
5000
5001   qtopia_incdir=""
5002   AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
5003   ac_qtopia_incdir="$qtopia_incdir"
5004
5005   if test -z "$qtopia_incdir"; then
5006     AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
5007   fi
5008
5009   qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
5010   qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
5011   qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
5012
5013   qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
5014   qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
5015   if test "$qtopia_ver" -lt "$qtopia_minver"; then
5016     AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
5017 is required.])
5018   fi
5019
5020   AC_LANG_SAVE
5021   AC_LANG_CPLUSPLUS
5022
5023   ac_cxxflags_safe="$CXXFLAGS"
5024   ac_ldflags_safe="$LDFLAGS"
5025   ac_libs_safe="$LIBS"
5026
5027   CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
5028   LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
5029   LIBS="$LIBS $LIB_QTOPIA $LIBQT"
5030
5031   cat > conftest.$ac_ext <<EOF
5032 #include "confdefs.h"
5033 #include <qpe/qpeapplication.h>
5034 #include <qpe/version.h>
5035
5036 int main( int argc, char **argv )
5037 {
5038     QPEApplication app( argc, argv );
5039     return 0;
5040 }
5041 EOF
5042
5043   if AC_TRY_EVAL(ac_link) && test -s conftest; then
5044     rm -f conftest*
5045   else
5046     rm -f conftest*
5047     AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
5048 the end of config.log])
5049   fi
5050
5051   CXXFLAGS="$ac_cxxflags_safe"
5052   LDFLAGS="$ac_ldflags_safe"
5053   LIBS="$ac_libs_safe"
5054
5055   AC_LANG_RESTORE
5056
5057   QTOPIA_INCLUDES="-I$qtopia_incdir"
5058   AC_SUBST(QTOPIA_INCLUDES)
5059
5060   AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
5061 ])
5062
5063
5064 AC_DEFUN(KDE_INIT_DOXYGEN,
5065 [
5066 AC_MSG_CHECKING([for Qt docs])
5067 kde_qtdir=
5068 if test "${with_qt_dir+set}" = set; then
5069   kde_qtdir="$with_qt_dir"
5070 fi
5071
5072 AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc], QTDOCDIR)
5073 AC_MSG_RESULT($QTDOCDIR)
5074
5075 AC_SUBST(QTDOCDIR)
5076
5077 KDE_FIND_PATH(dot, DOT, [], [])
5078 if test -n "$DOT"; then
5079   KDE_HAVE_DOT="YES"
5080 else
5081   KDE_HAVE_DOT="NO"
5082 fi
5083 AC_SUBST(KDE_HAVE_DOT)
5084 KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
5085 AC_SUBST(DOXYGEN)
5086
5087 DOXYGEN_PROJECT_NAME="$1"
5088 DOXYGEN_PROJECT_NUMBER="$2"
5089 AC_SUBST(DOXYGEN_PROJECT_NAME)
5090 AC_SUBST(DOXYGEN_PROJECT_NUMBER)
5091
5092 KDE_HAS_DOXYGEN=no
5093 if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
5094   KDE_HAS_DOXYGEN=yes
5095 fi
5096 AC_SUBST(KDE_HAS_DOXYGEN)
5097
5098 ])
5099
5100
5101 AC_DEFUN(AC_FIND_BZIP2,
5102 [
5103 AC_MSG_CHECKING([for bzDecompress in libbz2])
5104 AC_CACHE_VAL(ac_cv_lib_bzip2,
5105 [
5106 AC_LANG_C
5107 kde_save_LIBS="$LIBS"
5108 LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
5109 kde_save_CFLAGS="$CFLAGS"
5110 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
5111 AC_TRY_LINK(dnl
5112 [
5113 #define BZ_NO_STDIO
5114 #include<bzlib.h>
5115 ],
5116             [ bz_stream s; (void) bzDecompress(&s); ],
5117             eval "ac_cv_lib_bzip2='-lbz2'",
5118             eval "ac_cv_lib_bzip2=no")
5119 LIBS="$kde_save_LIBS"
5120 CFLAGS="$kde_save_CFLAGS"
5121 ])dnl
5122 AC_MSG_RESULT($ac_cv_lib_bzip2)
5123
5124 if test ! "$ac_cv_lib_bzip2" = no; then
5125   BZIP2DIR=bzip2
5126
5127   LIBBZ2="$ac_cv_lib_bzip2"
5128   AC_SUBST(LIBBZ2)
5129
5130 else
5131
5132    cxx_shared_flags=
5133    KDE_CHECK_COMPILER_FLAG(shared, [
5134         cxx_shared_flag="-shared"
5135    ])
5136
5137    AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
5138    AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
5139    [
5140    AC_LANG_C
5141    kde_save_LIBS="$LIBS"
5142    LIBS="$all_libraries $USER_LDFLAGS $cxx_shared_flag -lbz2 $LIBSOCKET"
5143    kde_save_CFLAGS="$CFLAGS"
5144    CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
5145
5146    AC_TRY_LINK(dnl
5147    [
5148    #define BZ_NO_STDIO
5149    #include<bzlib.h>
5150    ],
5151                [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
5152                eval "ac_cv_lib_bzip2_prefix='-lbz2'",
5153                eval "ac_cv_lib_bzip2_prefix=no")
5154    LIBS="$kde_save_LIBS"
5155    CFLAGS="$kde_save_CFLAGS"
5156    ])dnl
5157
5158    AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
5159    
5160
5161
5162    if test ! "$ac_cv_lib_bzip2_prefix" = no; then
5163      BZIP2DIR=bzip2
5164     
5165      LIBBZ2="$ac_cv_lib_bzip2_prefix"
5166      AC_SUBST(LIBBZ2)
5167
5168      AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
5169    dnl else, we just ignore this
5170    fi
5171
5172 fi
5173 AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
5174 ])
5175
5176 dnl ------------------------------------------------------------------------
5177 dnl Try to find the SSL headers and libraries.
5178 dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
5179 dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
5180 dnl ------------------------------------------------------------------------
5181 dnl
5182 AC_DEFUN(KDE_CHECK_SSL,
5183 [
5184 LIBSSL="-lssl -lcrypto"
5185 AC_REQUIRE([KDE_CHECK_LIB64])
5186
5187 ac_ssl_includes=NO ac_ssl_libraries=NO
5188 ssl_libraries=""
5189 ssl_includes=""
5190 AC_ARG_WITH(ssl-dir,
5191     [  --with-ssl-dir=DIR      where the root of OpenSSL is installed],
5192     [  ac_ssl_includes="$withval"/include
5193        ac_ssl_libraries="$withval"/lib$kdelibsuff
5194     ])
5195
5196 want_ssl=yes
5197 AC_ARG_WITH(ssl,
5198     [  --without-ssl           disable SSL checks],
5199     [want_ssl=$withval])
5200
5201 if test $want_ssl = yes; then
5202
5203 AC_MSG_CHECKING(for OpenSSL)
5204
5205 AC_CACHE_VAL(ac_cv_have_ssl,
5206 [#try to guess OpenSSL locations
5207   
5208   ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
5209   ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
5210   AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
5211   ac_ssl_includes="$ssl_incdir"
5212
5213   ssl_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/ssl/lib$kdelibsuff /usr/local/ssl/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs"
5214   if test ! "$ac_ssl_libraries" = "NO"; then
5215     ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
5216   fi
5217
5218   test=NONE
5219   ssl_libdir=NONE
5220   for dir in $ssl_libdirs; do
5221     try="ls -1 $dir/libssl*"
5222     if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
5223   done
5224
5225   ac_ssl_libraries="$ssl_libdir"
5226
5227   AC_LANG_SAVE
5228   AC_LANG_C
5229
5230   ac_cflags_safe="$CFLAGS"
5231   ac_ldflags_safe="$LDFLAGS"
5232   ac_libs_safe="$LIBS"
5233
5234   CFLAGS="$CFLAGS -I$ssl_incdir $all_includes"
5235   LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
5236   LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
5237
5238   AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
5239   ac_ssl_rsaref="yes"
5240   ,
5241   ac_ssl_rsaref="no"
5242   )
5243
5244   CFLAGS="$ac_cflags_safe"
5245   LDFLAGS="$ac_ldflags_safe"
5246   LIBS="$ac_libs_safe"
5247
5248   AC_LANG_RESTORE
5249
5250   if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
5251     have_ssl=no
5252   else
5253     have_ssl=yes;
5254   fi
5255
5256   ])
5257
5258   eval "$ac_cv_have_ssl"
5259
5260   AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
5261
5262   AC_MSG_CHECKING([whether OpenSSL uses rsaref])
5263   AC_MSG_RESULT($ac_ssl_rsaref)
5264
5265   AC_MSG_CHECKING([for easter eggs])
5266   AC_MSG_RESULT([none found])
5267
5268 else
5269   have_ssl=no
5270 fi
5271
5272 if test "$have_ssl" = yes; then
5273   AC_MSG_CHECKING(for OpenSSL version)
5274   dnl Check for SSL version
5275   AC_CACHE_VAL(ac_cv_ssl_version,
5276   [
5277     AC_LANG_SAVE
5278     AC_LANG_C 
5279
5280     cat >conftest.$ac_ext <<EOF
5281 #include <openssl/opensslv.h>
5282 #include <stdio.h>
5283     int main() {
5284  
5285 #ifndef OPENSSL_VERSION_NUMBER
5286       printf("ssl_version=\\"error\\"\n");
5287 #else
5288       if (OPENSSL_VERSION_NUMBER < 0x00906000)
5289         printf("ssl_version=\\"old\\"\n");
5290       else
5291         printf("ssl_version=\\"ok\\"\n");
5292 #endif
5293      return (0);
5294     }
5295 EOF
5296
5297     ac_compile='${CC-gcc} $CFLAGS -I$ac_ssl_includes conftest.$ac_ext -o conftest'
5298     if AC_TRY_EVAL(ac_compile); then 
5299
5300       if eval `./conftest 2>&5`; then
5301         if test $ssl_version = error; then
5302           AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
5303         else
5304           if test $ssl_version = old; then
5305             AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
5306             have_ssl=no
5307           fi
5308         fi
5309         ac_cv_ssl_version="ssl_version=$ssl_version"
5310       else
5311         AC_MSG_ERROR([Your system couldn't run a small SSL test program.
5312         Check config.log, and if you can't figure it out, send a mail to 
5313         David Faure <faure@kde.org>, attaching your config.log])
5314       fi
5315
5316     else
5317       AC_MSG_ERROR([Your system couldn't link a small SSL test program.
5318       Check config.log, and if you can't figure it out, send a mail to 
5319       David Faure <faure@kde.org>, attaching your config.log])
5320     fi 
5321
5322     AC_LANG_RESTORE
5323
5324   ])
5325
5326   eval "$ac_cv_ssl_version"
5327   AC_MSG_RESULT($ssl_version)
5328 fi
5329
5330 if test "$have_ssl" != yes; then
5331   LIBSSL="";
5332 else
5333   AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
5334   ac_cv_have_ssl="have_ssl=yes \
5335     ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
5336   
5337   
5338   ssl_libraries="$ac_ssl_libraries"
5339   ssl_includes="$ac_ssl_includes"
5340
5341   if test "$ac_ssl_rsaref" = yes; then
5342     LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref" 
5343   fi
5344
5345   if test $ssl_version = "old"; then
5346     AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
5347   fi
5348 fi
5349
5350 if test "$ssl_includes" = "/usr/include" || test  "$ssl_includes" = "/usr/local/include" || test -z "$ssl_includes"; then
5351  SSL_INCLUDES="";
5352 else
5353  SSL_INCLUDES="-I$ssl_includes"
5354 fi
5355
5356 if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries"; then
5357  SSL_LDFLAGS=""
5358 else
5359  SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
5360 fi
5361
5362 AC_SUBST(SSL_INCLUDES)
5363 AC_SUBST(SSL_LDFLAGS)
5364 AC_SUBST(LIBSSL)
5365 ])
5366
5367 AC_DEFUN(KDE_CHECK_STRLCPY,
5368 [
5369   AC_CHECK_STRLCPY
5370   AC_CHECK_STRLCAT
5371   AC_CHECK_SIZEOF(size_t)
5372   AC_CHECK_SIZEOF(unsigned long)
5373
5374   AC_MSG_CHECKING([sizeof(size_t) == sizeof(unsigned long)])
5375   AC_TRY_COMPILE(,[
5376     #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
5377        choke me
5378     #endif
5379     ],[AC_MSG_RESULT([yes])],[
5380       AC_MSG_RESULT([no])
5381       AC_MSG_ERROR([
5382        Apparently on your system our assumption sizeof(size_t) == sizeof(unsigned long)
5383        does not apply. Please mail kde-devel@kde.org with a description of your system!
5384       ])
5385   ])
5386 ])
5387
5388 AC_DEFUN(AC_CHECK_C_COMPILER,
5389 [
5390   AC_ARG_ENABLE(debug,[  --enable-debug          enables debug symbols [default=no]],
5391   [
5392    if test $enableval = "no"; dnl
5393      then
5394        kde_use_debug_code="no"
5395        kde_use_debug_define=yes
5396      else
5397        kde_use_debug_code="yes"
5398        kde_use_debug_define=no
5399    fi
5400   ],
5401     [kde_use_debug_code="no"
5402       kde_use_debug_define=no
5403   ])
5404
5405   dnl Just for configure --help
5406   AC_ARG_ENABLE(dummyoption,[  --disable-debug         disables debug output and debug symbols [default=no]],[],[])
5407
5408   AC_ARG_ENABLE(strict,[  --enable-strict         compiles with strict compiler options (may not work!)],
5409    [
5410     if test $enableval = "no"; then
5411          kde_use_strict_options="no"
5412        else
5413          kde_use_strict_options="yes"
5414     fi
5415    ], [kde_use_strict_options="no"])
5416
5417   AC_ARG_ENABLE(profile,[  --enable-profile        creates profiling infos [default=no]],
5418     [kde_use_profiling=$enableval],
5419     [kde_use_profiling="no"]
5420   )
5421
5422   dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
5423   CFLAGS=" $CFLAGS"
5424
5425   AC_PROG_CC
5426
5427   if test "$GCC" = "yes"; then
5428     if test "$kde_use_debug_code" = "yes"; then
5429       CFLAGS="-g -O2 $CFLAGS"
5430       case $host in
5431         *-*-linux-gnu)  
5432           CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
5433         ;;
5434       esac
5435     else
5436       CFLAGS="-O2 $CFLAGS"
5437     fi
5438   fi
5439
5440   if test "$kde_use_debug_define" = "yes"; then
5441     CFLAGS="-DNDEBUG $CFLAGS"
5442   fi
5443
5444   case "$host" in
5445   *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
5446   *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
5447   esac
5448
5449   if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
5450      LDFLAGS=""
5451   fi
5452
5453   if test "$kde_use_profiling" = "yes"; then
5454     KDE_CHECK_COMPILER_FLAG(pg,
5455     [
5456       CFLAGS="-pg $CFLAGS"
5457     ])
5458   fi
5459
5460   USE_EXCEPTIONS=
5461   AC_SUBST(USE_EXCEPTIONS)
5462   dnl obsolete macro - provided to keep things going
5463   USE_RTTI=
5464   AC_SUBST(USE_RTTI)
5465
5466   AC_PROG_CPP
5467
5468   # the following is to allow programs, that are known to
5469   # have problems when compiled with -O2
5470   if test -n "$CFLAGS"; then
5471       kde_safe_IFS=$IFS
5472       IFS=" "
5473       NOOPT_CFLAGS=""
5474       for i in $CFLAGS; do
5475         case $i in
5476           -O*)
5477                 ;;
5478           *)
5479                 NOOPT_CFLAGS="$NOOPT_CFLAGS $i"
5480                 ;;
5481         esac
5482       done
5483       IFS=$kde_safe_IFS
5484   fi
5485
5486   AC_SUBST(NOOPT_CFLAGS)
5487
5488   KDE_CHECK_FINAL
5489
5490   ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDEV_ADD_DEPENDENCIES]), [])
5491
5492   KDE_CXXFLAGS=
5493   AC_SUBST(KDE_CXXFLAGS)
5494 ])
5495
5496 AC_DEFUN(KDEV_ADD_DEPENDENCIES,
5497 [
5498    [A]M_DEPENDENCIES(CC)
5499 ])
5500
5501
5502 dnl just a wrapper to clean up configure.in only for c projects
5503 AC_DEFUN(KDEV_PROG_LIBTOOL,
5504 [
5505 AC_REQUIRE([AC_CHECK_C_COMPILER])
5506 AC_REQUIRE([AC_ENABLE_SHARED])
5507 AC_REQUIRE([AC_ENABLE_STATIC])
5508
5509 AC_REQUIRE([AC_LIBTOOL_DLOPEN])
5510
5511 AC_LANG_SAVE
5512 AC_LANG_C
5513 AC_OBJEXT
5514 AC_EXEEXT
5515 AC_LANG_RESTORE
5516
5517 AM_PROG_LIBTOOL
5518 AC_LIBTOOL_SETUP
5519
5520 LIBTOOL_SHELL="/bin/sh ./libtool"
5521 #  LIBTOOL="$LIBTOOL --silent"
5522 ])
5523
5524 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
5525
5526 # serial 47 AC_PROG_LIBTOOL
5527
5528 # AC_PROG_LIBTOOL
5529 # ---------------
5530 AC_DEFUN([AC_PROG_LIBTOOL],
5531 [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
5532 dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
5533 dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
5534   AC_PROVIDE_IFELSE([AC_PROG_CXX],
5535     [AC_LIBTOOL_CXX],
5536     [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
5537   ])])
5538
5539 dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
5540 dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
5541 dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
5542   AC_PROVIDE_IFELSE([AC_PROG_GCJ],
5543     [AC_LIBTOOL_GCJ],
5544     [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
5545       [AC_LIBTOOL_GCJ],
5546       [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
5547         [AC_LIBTOOL_GCJ],
5548       [ifdef([AC_PROG_GCJ],
5549              [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
5550        ifdef([A][M_PROG_GCJ],
5551              [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
5552        ifdef([LT_AC_PROG_GCJ],
5553              [define([LT_AC_PROG_GCJ],
5554                 defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
5555 ])])# AC_PROG_LIBTOOL
5556
5557
5558 # _AC_PROG_LIBTOOL
5559 # ----------------
5560 AC_DEFUN([_AC_PROG_LIBTOOL],
5561 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
5562 AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
5563 AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
5564
5565 # This can be used to rebuild libtool when needed
5566 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
5567
5568 # Always use our own libtool.
5569 LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'
5570 AC_SUBST(LIBTOOL)dnl
5571
5572 # Prevent multiple expansion
5573 define([AC_PROG_LIBTOOL], [])
5574 ])# _AC_PROG_LIBTOOL
5575
5576
5577 # AC_LIBTOOL_SETUP
5578 # ----------------
5579 AC_DEFUN([AC_LIBTOOL_SETUP],
5580 [AC_PREREQ(2.50)dnl
5581 AC_REQUIRE([AC_ENABLE_SHARED])dnl
5582 AC_REQUIRE([AC_ENABLE_STATIC])dnl
5583 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
5584 AC_REQUIRE([AC_CANONICAL_HOST])dnl
5585 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
5586 AC_REQUIRE([AC_PROG_CC])dnl
5587 AC_REQUIRE([AC_PROG_LD])dnl
5588 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
5589 AC_REQUIRE([AC_PROG_NM])dnl
5590 AC_REQUIRE([LT_AC_PROG_SED])dnl
5591
5592 AC_REQUIRE([AC_PROG_LN_S])dnl
5593 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
5594 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
5595 AC_REQUIRE([AC_OBJEXT])dnl
5596 AC_REQUIRE([AC_EXEEXT])dnl
5597 dnl
5598
5599 AC_LIBTOOL_SYS_MAX_CMD_LEN
5600 AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
5601 AC_LIBTOOL_OBJDIR
5602
5603 AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
5604 _LT_AC_PROG_ECHO_BACKSLASH
5605
5606 case $host_os in
5607 aix3*)
5608   # AIX sometimes has problems with the GCC collect2 program.  For some
5609   # reason, if we set the COLLECT_NAMES environment variable, the problems
5610   # vanish in a puff of smoke.
5611   if test "X${COLLECT_NAMES+set}" != Xset; then
5612     COLLECT_NAMES=
5613     export COLLECT_NAMES
5614   fi
5615   ;;
5616 esac
5617
5618 # Sed substitution that helps us do robust quoting.  It backslashifies
5619 # metacharacters that are still active within double-quoted strings.
5620 Xsed='sed -e s/^X//'
5621 [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
5622
5623 # Same as above, but do not quote variable references.
5624 [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
5625
5626 # Sed substitution to delay expansion of an escaped shell variable in a
5627 # double_quote_subst'ed string.
5628 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
5629
5630 # Sed substitution to avoid accidental globbing in evaled expressions
5631 no_glob_subst='s/\*/\\\*/g'
5632
5633 # Constants:
5634 rm="rm -f"
5635
5636 # Global variables:
5637 default_ofile=libtool
5638 can_build_shared=yes
5639
5640 # All known linkers require a `.a' archive for static linking (except M$VC,
5641 # which needs '.lib').
5642 libext=a
5643 ltmain="$ac_aux_dir/ltmain.sh"
5644 ofile="$default_ofile"
5645 with_gnu_ld="$lt_cv_prog_gnu_ld"
5646
5647 AC_CHECK_TOOL(RANLIB, ranlib, :)
5648 AC_CHECK_TOOL(STRIP, strip, :)
5649
5650 old_CC="$CC"
5651 old_CFLAGS="$CFLAGS"
5652
5653 # Set sane defaults for various variables
5654 test -z "$AR" && AR=ar
5655 test -z "$AR_FLAGS" && AR_FLAGS=cru
5656 test -z "$AS" && AS=as
5657 test -z "$CC" && CC=cc
5658 test -z "$LTCC" && LTCC=$CC
5659 test -z "$DLLTOOL" && DLLTOOL=dlltool
5660 test -z "$LD" && LD=ld
5661 test -z "$LN_S" && LN_S="ln -s"
5662 test -z "$MAGIC_CMD" && MAGIC_CMD=file
5663 test -z "$NM" && NM=nm
5664 test -z "$SED" && SED=sed
5665 test -z "$OBJDUMP" && OBJDUMP=objdump
5666 test -z "$RANLIB" && RANLIB=:
5667 test -z "$STRIP" && STRIP=:
5668 test -z "$ac_objext" && ac_objext=o
5669
5670 # Determine commands to create old-style static archives.
5671 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
5672 old_postinstall_cmds='chmod 644 $oldlib'
5673 old_postuninstall_cmds=
5674
5675 if test -n "$RANLIB"; then
5676   case $host_os in
5677   openbsd*)
5678     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
5679     ;;
5680   *)
5681     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
5682     ;;
5683   esac
5684   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
5685 fi
5686
5687 # Only perform the check for file, if the check method requires it
5688 case $deplibs_check_method in
5689 file_magic*)
5690   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
5691     AC_PATH_MAGIC
5692   fi
5693   ;;
5694 esac
5695
5696 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
5697 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
5698 enable_win32_dll=yes, enable_win32_dll=no)
5699
5700 AC_ARG_ENABLE([libtool-lock],
5701     [AC_HELP_STRING([--disable-libtool-lock],
5702         [avoid locking (might break parallel builds)])])
5703 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
5704
5705 AC_ARG_WITH([pic],
5706     [AC_HELP_STRING([--with-pic],
5707         [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
5708     [pic_mode="$withval"],
5709     [pic_mode=default])
5710 test -z "$pic_mode" && pic_mode=default
5711
5712 # Use C for the default configuration in the libtool script
5713 tagname=
5714 AC_LIBTOOL_LANG_C_CONFIG
5715 _LT_AC_TAGCONFIG
5716 ])# AC_LIBTOOL_SETUP
5717
5718
5719 # _LT_AC_SYS_COMPILER
5720 # -------------------
5721 AC_DEFUN([_LT_AC_SYS_COMPILER],
5722 [AC_REQUIRE([AC_PROG_CC])dnl
5723
5724 # If no C compiler was specified, use CC.
5725 LTCC=${LTCC-"$CC"}
5726
5727 # Allow CC to be a program name with arguments.
5728 set dummy $CC
5729 compiler="[$]2"
5730 ])# _LT_AC_SYS_COMPILER
5731
5732
5733 # _LT_AC_SYS_LIBPATH_AIX
5734 # ----------------------
5735 # Links a minimal program and checks the executable
5736 # for the system default hardcoded library path. In most cases,
5737 # this is /usr/lib:/lib, but when the MPI compilers are used
5738 # the location of the communication and MPI libs are included too.
5739 # If we don't find anything, use the default library path according
5740 # to the aix ld manual.
5741 AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
5742 [AC_LINK_IFELSE(AC_LANG_PROGRAM,[
5743 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
5744 }'`
5745 # Check for a 64-bit object if we didn't find anything.
5746 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; }
5747 }'`; fi],[])
5748 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
5749 ])# _LT_AC_SYS_LIBPATH_AIX
5750
5751
5752 # _LT_AC_PROG_ECHO_BACKSLASH
5753 # --------------------------
5754 # Add some code to the start of the generated configure script which
5755 # will find an echo command which doesn't interpret backslashes.
5756 AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
5757 [ifdef([AC_DIVERSION_NOTICE],
5758              [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
5759          [AC_DIVERT_PUSH(NOTICE)])
5760
5761 # Check that we are running under the correct shell.
5762 SHELL=${CONFIG_SHELL-/bin/sh}
5763
5764 case X$ECHO in
5765 X*--fallback-echo)
5766   # Remove one level of quotation (which was required for Make).
5767   ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
5768   ;;
5769 esac
5770
5771 echo=${ECHO-echo}
5772 if test "X[$]1" = X--no-reexec; then
5773   # Discard the --no-reexec flag, and continue.
5774   shift
5775 elif test "X[$]1" = X--fallback-echo; then
5776   # Avoid inline document here, it may be left over
5777   :
5778 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
5779   # Yippee, $echo works!
5780   :
5781 else
5782   # Restart under the correct shell.
5783   exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
5784 fi
5785
5786 if test "X[$]1" = X--fallback-echo; then
5787   # used as fallback echo
5788   shift
5789   cat <<EOF
5790 [$]*
5791 EOF
5792   exit 0
5793 fi
5794
5795 # The HP-UX ksh and POSIX shell print the target directory to stdout
5796 # if CDPATH is set.
5797 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
5798
5799 if test -z "$ECHO"; then
5800 if test "X${echo_test_string+set}" != Xset; then
5801 # find a string as large as possible, as long as the shell can cope with it
5802   for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
5803     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
5804     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
5805        echo_test_string="`eval $cmd`" &&
5806        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
5807     then
5808       break
5809     fi
5810   done
5811 fi
5812
5813 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
5814    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
5815    test "X$echo_testing_string" = "X$echo_test_string"; then
5816   :
5817 else
5818   # The Solaris, AIX, and Digital Unix default echo programs unquote
5819   # backslashes.  This makes it impossible to quote backslashes using
5820   #   echo "$something" | sed 's/\\/\\\\/g'
5821   #
5822   # So, first we look for a working echo in the user's PATH.
5823
5824   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
5825   for dir in $PATH /usr/ucb; do
5826     IFS="$lt_save_ifs"
5827     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
5828        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
5829        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
5830        test "X$echo_testing_string" = "X$echo_test_string"; then
5831       echo="$dir/echo"
5832       break
5833     fi
5834   done
5835   IFS="$lt_save_ifs"
5836
5837   if test "X$echo" = Xecho; then
5838     # We didn't find a better echo, so look for alternatives.
5839     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
5840        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
5841        test "X$echo_testing_string" = "X$echo_test_string"; then
5842       # This shell has a builtin print -r that does the trick.
5843       echo='print -r'
5844     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
5845          test "X$CONFIG_SHELL" != X/bin/ksh; then
5846       # If we have ksh, try running configure again with it.
5847       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
5848       export ORIGINAL_CONFIG_SHELL
5849       CONFIG_SHELL=/bin/ksh
5850       export CONFIG_SHELL
5851       exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
5852     else
5853       # Try using printf.
5854       echo='printf %s\n'
5855       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
5856          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
5857          test "X$echo_testing_string" = "X$echo_test_string"; then
5858         # Cool, printf works
5859         :
5860       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
5861            test "X$echo_testing_string" = 'X\t' &&
5862            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
5863            test "X$echo_testing_string" = "X$echo_test_string"; then
5864         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
5865         export CONFIG_SHELL
5866         SHELL="$CONFIG_SHELL"
5867         export SHELL
5868         echo="$CONFIG_SHELL [$]0 --fallback-echo"
5869       elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
5870            test "X$echo_testing_string" = 'X\t' &&
5871            echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
5872            test "X$echo_testing_string" = "X$echo_test_string"; then
5873         echo="$CONFIG_SHELL [$]0 --fallback-echo"
5874       else
5875         # maybe with a smaller string...
5876         prev=:
5877
5878         for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
5879           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
5880           then
5881             break
5882           fi
5883           prev="$cmd"
5884         done
5885
5886         if test "$prev" != 'sed 50q "[$]0"'; then
5887           echo_test_string=`eval $prev`
5888           export echo_test_string
5889           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
5890         else
5891           # Oops.  We lost completely, so just stick with echo.
5892           echo=echo
5893         fi
5894       fi
5895     fi
5896   fi
5897 fi
5898 fi
5899
5900 # Copy echo and quote the copy suitably for passing to libtool from
5901 # the Makefile, instead of quoting the original, which is used later.
5902 ECHO=$echo
5903 if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
5904    ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
5905 fi
5906
5907 AC_SUBST(ECHO)
5908 AC_DIVERT_POP
5909 ])# _LT_AC_PROG_ECHO_BACKSLASH
5910
5911
5912 # _LT_AC_LOCK
5913 # -----------
5914 AC_DEFUN([_LT_AC_LOCK],
5915 [AC_ARG_ENABLE([libtool-lock],
5916     [AC_HELP_STRING([--disable-libtool-lock],
5917         [avoid locking (might break parallel builds)])])
5918 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
5919
5920 # Some flags need to be propagated to the compiler or linker for good
5921 # libtool support.
5922 case $host in
5923 ia64-*-hpux*)
5924   # Find out which ABI we are using.
5925   echo 'int i;' > conftest.$ac_ext
5926   if AC_TRY_EVAL(ac_compile); then
5927     case `/usr/bin/file conftest.$ac_objext` in
5928     *ELF-32*)
5929       HPUX_IA64_MODE="32"
5930       ;;
5931     *ELF-64*)
5932       HPUX_IA64_MODE="64"
5933       ;;
5934     esac
5935   fi
5936   rm -rf conftest*
5937   ;;
5938 *-*-irix6*)
5939   # Find out which ABI we are using.
5940   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
5941   if AC_TRY_EVAL(ac_compile); then
5942     case `/usr/bin/file conftest.$ac_objext` in
5943     *32-bit*)
5944       LD="${LD-ld} -32"
5945       ;;
5946     *N32*)
5947       LD="${LD-ld} -n32"
5948       ;;
5949     *64-bit*)
5950       LD="${LD-ld} -64"
5951       ;;
5952     esac
5953   fi
5954   rm -rf conftest*
5955   ;;
5956
5957 *-*-linux*)
5958   # Test if the compiler is 64bit
5959   echo 'int i;' > conftest.$ac_ext
5960   if AC_TRY_EVAL(ac_compile); then
5961     case `/usr/bin/file conftest.$ac_objext` in
5962     *"ELF 32"*)
5963       LINUX_64_MODE="32"
5964       ;;
5965     *"ELF 64"*)
5966       LINUX_64_MODE="64"
5967       ;;
5968     esac
5969   fi
5970   rm -rf conftest*
5971   ;;
5972   
5973 *-*-sco3.2v5*)
5974   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
5975   SAVE_CFLAGS="$CFLAGS"
5976   CFLAGS="$CFLAGS -belf"
5977   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
5978     [AC_LANG_PUSH(C)
5979      AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
5980      AC_LANG_POP])
5981   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
5982     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
5983     CFLAGS="$SAVE_CFLAGS"
5984   fi
5985   ;;
5986 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
5987 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
5988   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
5989   AC_CHECK_TOOL(AS, as, false)
5990   AC_CHECK_TOOL(OBJDUMP, objdump, false)
5991
5992   # recent cygwin and mingw systems supply a stub DllMain which the user
5993   # can override, but on older systems we have to supply one
5994   AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
5995     [AC_TRY_LINK([],
5996       [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
5997       DllMain (0, 0, 0);],
5998       [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
5999
6000   case $host/$CC in
6001   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
6002     # old mingw systems require "-dll" to link a DLL, while more recent ones
6003     # require "-mdll"
6004     SAVE_CFLAGS="$CFLAGS"
6005     CFLAGS="$CFLAGS -mdll"
6006     AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
6007       [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
6008     CFLAGS="$SAVE_CFLAGS" ;;
6009   *-*-cygwin* | *-*-pw32*)
6010     # cygwin systems need to pass --dll to the linker, and not link
6011     # crt.o which will require a WinMain@16 definition.
6012     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
6013   esac
6014   ;;
6015   ])
6016 esac
6017
6018 need_locks="$enable_libtool_lock"
6019
6020 ])# _LT_AC_LOCK
6021
6022
6023 # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
6024 #               [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
6025 # ----------------------------------------------------------------
6026 # Check whether the given compiler option works
6027 AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
6028 [AC_CACHE_CHECK([$1], [$2],
6029   [$2=no
6030   ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
6031    save_CFLAGS="$CFLAGS"
6032    CFLAGS="$CFLAGS $3"
6033    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6034    if (eval $ac_compile 2>conftest.err) && test -s $ac_outfile; then
6035      # The compiler can only warn and ignore the option if not recognized
6036      # So say no if there are warnings
6037      if test -s conftest.err; then
6038        # Append any errors to the config.log.
6039        cat conftest.err 1>&AS_MESSAGE_LOG_FD
6040      else
6041        $2=yes
6042      fi
6043    fi
6044    $rm conftest*
6045    CFLAGS="$save_CFLAGS"
6046 ])
6047
6048 if test x"[$]$2" = xyes; then
6049     ifelse([$5], , :, [$5])
6050 else
6051     ifelse([$6], , :, [$6])
6052 fi
6053 ])# AC_LIBTOOL_COMPILER_OPTION
6054
6055
6056 # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
6057 #                          [ACTION-SUCCESS], [ACTION-FAILURE])
6058 # ------------------------------------------------------------
6059 # Check whether the given compiler option works
6060 AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
6061 [AC_CACHE_CHECK([$1], [$2],
6062   [$2=no
6063    save_LDFLAGS="$LDFLAGS"
6064    LDFLAGS="$LDFLAGS $3"
6065    echo "$lt_simple_link_test_code" > conftest.$ac_ext
6066    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
6067      # The compiler can only warn and ignore the option if not recognized
6068      # So say no if there are warnings
6069      if test -s conftest.err; then
6070        # Append any errors to the config.log.
6071        cat conftest.err 1>&AS_MESSAGE_LOG_FD
6072      else
6073        $2=yes
6074      fi
6075    fi
6076    $rm conftest*
6077    LDFLAGS="$save_LDFLAGS"
6078 ])
6079
6080 if test x"[$]$2" = xyes; then
6081     ifelse([$4], , :, [$4])
6082 else
6083     ifelse([$5], , :, [$5])
6084 fi
6085 ])# AC_LIBTOOL_LINKER_OPTION
6086
6087
6088 # AC_LIBTOOL_SYS_MAX_CMD_LEN
6089 # --------------------------
6090 AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
6091 [# find the maximum length of command line arguments
6092 AC_MSG_CHECKING([the maximum length of command line arguments])
6093 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
6094   i=0
6095   testring="ABCD"
6096
6097   case $host_os in
6098   msdosdjgpp*)
6099     # On DJGPP, this test can blow up pretty badly due to problems in libc
6100     # (any single argument exceeding 2000 bytes causes a buffer overrun
6101     # during glob expansion).  Even if it were fixed, the result of this
6102     # check would be larger than it should be.
6103     lt_cv_sys_max_cmd_len=12288;    # 12K is about right
6104     ;;
6105
6106   gnu*)
6107     # Under GNU Hurd, this test is not required because there is
6108     # no limit to the length of command line arguments.
6109     # Libtool will interpret -1 as no limit whatsoever
6110     lt_cv_sys_max_cmd_len=-1;
6111     ;;
6112
6113   *)
6114     # If test is not a shell built-in, we'll probably end up computing a
6115     # maximum length that is only half of the actual maximum length, but
6116     # we can't tell.
6117     while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
6118                = "XX$testring") >/dev/null 2>&1 &&
6119             new_result=`expr "X$testring" : ".*" 2>&1` &&
6120             lt_cv_sys_max_cmd_len=$new_result &&
6121             test $i != 17 # 1/2 MB should be enough
6122     do
6123       i=`expr $i + 1`
6124       testring=$testring$testring
6125     done
6126     testring=
6127     # Add a significant safety factor because C++ compilers can tack on massive
6128     # amounts of additional arguments before passing them to the linker.
6129     # It appears as though 1/2 is a usable value.
6130     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
6131     ;;
6132   esac
6133 ])
6134 if test -n $lt_cv_sys_max_cmd_len ; then
6135   AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
6136 else
6137   AC_MSG_RESULT(none)
6138 fi
6139 ])# AC_LIBTOOL_SYS_MAX_CMD_LEN
6140
6141
6142 # _LT_AC_CHECK_DLFCN
6143 # --------------------
6144 AC_DEFUN([_LT_AC_CHECK_DLFCN],
6145 [AC_CHECK_HEADERS(dlfcn.h)dnl
6146 ])# _LT_AC_CHECK_DLFCN
6147
6148
6149 # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
6150 #                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
6151 # ------------------------------------------------------------------
6152 AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
6153 [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
6154 if test "$cross_compiling" = yes; then :
6155   [$4]
6156 else
6157   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
6158   lt_status=$lt_dlunknown
6159   cat > conftest.$ac_ext <<EOF
6160 [#line __oline__ "configure"
6161 #include "confdefs.h"
6162
6163 #if HAVE_DLFCN_H
6164 #include <dlfcn.h>
6165 #endif
6166
6167 #include <stdio.h>
6168
6169 #ifdef RTLD_GLOBAL
6170 #  define LT_DLGLOBAL           RTLD_GLOBAL
6171 #else
6172 #  ifdef DL_GLOBAL
6173 #    define LT_DLGLOBAL         DL_GLOBAL
6174 #  else
6175 #    define LT_DLGLOBAL         0
6176 #  endif
6177 #endif
6178
6179 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
6180    find out it does not work in some platform. */
6181 #ifndef LT_DLLAZY_OR_NOW
6182 #  ifdef RTLD_LAZY
6183 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
6184 #  else
6185 #    ifdef DL_LAZY
6186 #      define LT_DLLAZY_OR_NOW          DL_LAZY
6187 #    else
6188 #      ifdef RTLD_NOW
6189 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
6190 #      else
6191 #        ifdef DL_NOW
6192 #          define LT_DLLAZY_OR_NOW      DL_NOW
6193 #        else
6194 #          define LT_DLLAZY_OR_NOW      0
6195 #        endif
6196 #      endif
6197 #    endif
6198 #  endif
6199 #endif
6200
6201 #ifdef __cplusplus
6202 extern "C" void exit (int);
6203 #endif
6204
6205 void fnord() { int i=42;}
6206 int main ()
6207 {
6208   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
6209   int status = $lt_dlunknown;
6210
6211   if (self)
6212     {
6213       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
6214       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
6215       /* dlclose (self); */
6216     }
6217
6218     exit (status);
6219 }]
6220 EOF
6221   if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
6222     (./conftest; exit; ) 2>/dev/null
6223     lt_status=$?
6224     case x$lt_status in
6225       x$lt_dlno_uscore) $1 ;;
6226       x$lt_dlneed_uscore) $2 ;;
6227       x$lt_unknown|x*) $3 ;;
6228     esac
6229   else :
6230     # compilation failed
6231     $3
6232   fi
6233 fi
6234 rm -fr conftest*
6235 ])# _LT_AC_TRY_DLOPEN_SELF
6236
6237
6238 # AC_LIBTOOL_DLOPEN_SELF
6239 # -------------------
6240 AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
6241 [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
6242 if test "x$enable_dlopen" != xyes; then
6243   enable_dlopen=unknown
6244   enable_dlopen_self=unknown
6245   enable_dlopen_self_static=unknown
6246 else
6247   lt_cv_dlopen=no
6248   lt_cv_dlopen_libs=
6249
6250   case $host_os in
6251   beos*)
6252     lt_cv_dlopen="load_add_on"
6253     lt_cv_dlopen_libs=
6254     lt_cv_dlopen_self=yes
6255     ;;
6256
6257   cygwin* | mingw* | pw32*)
6258     lt_cv_dlopen="LoadLibrary"
6259     lt_cv_dlopen_libs=
6260    ;;
6261
6262   *)
6263     AC_CHECK_FUNC([shl_load],
6264           [lt_cv_dlopen="shl_load"],
6265       [AC_CHECK_LIB([dld], [shl_load],
6266             [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
6267         [AC_CHECK_FUNC([dlopen],
6268               [lt_cv_dlopen="dlopen"],
6269           [AC_CHECK_LIB([dl], [dlopen],
6270                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
6271             [AC_CHECK_LIB([svld], [dlopen],
6272                   [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
6273               [AC_CHECK_LIB([dld], [dld_link],
6274                     [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
6275               ])
6276             ])
6277           ])
6278         ])
6279       ])
6280     ;;
6281   esac
6282
6283   if test "x$lt_cv_dlopen" != xno; then
6284     enable_dlopen=yes
6285   else
6286     enable_dlopen=no
6287   fi
6288
6289   case $lt_cv_dlopen in
6290   dlopen)
6291     save_CPPFLAGS="$CPPFLAGS"
6292     test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
6293
6294     save_LDFLAGS="$LDFLAGS"
6295     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
6296
6297     save_LIBS="$LIBS"
6298     LIBS="$lt_cv_dlopen_libs $LIBS"
6299
6300     AC_CACHE_CHECK([whether a program can dlopen itself],
6301           lt_cv_dlopen_self, [dnl
6302           _LT_AC_TRY_DLOPEN_SELF(
6303             lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
6304             lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
6305     ])
6306
6307     if test "x$lt_cv_dlopen_self" = xyes; then
6308       LDFLAGS="$LDFLAGS $link_static_flag"
6309       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
6310           lt_cv_dlopen_self_static, [dnl
6311           _LT_AC_TRY_DLOPEN_SELF(
6312             lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
6313             lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
6314       ])
6315     fi
6316
6317     CPPFLAGS="$save_CPPFLAGS"
6318     LDFLAGS="$save_LDFLAGS"
6319     LIBS="$save_LIBS"
6320     ;;
6321   esac
6322
6323   case $lt_cv_dlopen_self in
6324   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
6325   *) enable_dlopen_self=unknown ;;
6326   esac
6327
6328   case $lt_cv_dlopen_self_static in
6329   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
6330   *) enable_dlopen_self_static=unknown ;;
6331   esac
6332 fi
6333 ])# AC_LIBTOOL_DLOPEN_SELF
6334
6335
6336 # AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
6337 # ---------------------------------
6338 # Check to see if options -c and -o are simultaneously supported by compiler
6339 AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
6340 [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
6341 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
6342   [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
6343   [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
6344    $rm -r conftest 2>/dev/null
6345    mkdir conftest
6346    cd conftest
6347    mkdir out
6348    ifelse([$1],[],[save_CFLAGS="$CFLAGS"
6349                    CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"],
6350           [$1],[CXX],[save_CXXFLAGS="$CXXFLAGS"
6351                    CXXFLAGS="$CXXFLAGS -o out/conftest2.$ac_objext"],
6352           [$1],[GCJ],[save_GCJFLAGS="$GCJFLAGS"
6353                    GCJFLAGS="$GCJFLAGS -o out/conftest2.$ac_objext"])
6354    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6355
6356    # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
6357    # that will create temporary files in the current directory regardless of
6358    # the output directory.  Thus, making CWD read-only will cause this test
6359    # to fail, enabling locking or at least warning the user not to do parallel
6360    # builds.
6361    chmod -w .
6362
6363    if (eval $ac_compile 2>out/conftest.err) && test -s out/conftest2.$ac_objext
6364    then
6365      # The compiler can only warn and ignore the option if not recognized
6366      # So say no if there are warnings
6367      if test -s out/conftest.err; then
6368        # Append any errors to the config.log.
6369        cat out/conftest.err 1>&AS_MESSAGE_LOG_FD
6370      else
6371        _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
6372      fi
6373    fi
6374    ifelse([$1],[],[CFLAGS="$save_CFLAGS"],
6375           [$1],[CXX],[CXXFLAGS="$save_CXXFLAGS"],
6376           [$1],[GCJ],[GCJFLAGS="$save_GCJFLAGS"])
6377    chmod u+w .
6378    $rm conftest* out/*
6379    rmdir out
6380    cd ..
6381    rmdir conftest
6382    $rm conftest*
6383 ])
6384 ])# AC_LIBTOOL_PROG_CC_C_O
6385
6386
6387 # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
6388 # -----------------------------------------
6389 # Check to see if we can do hard links to lock some files if needed
6390 AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
6391 [AC_REQUIRE([_LT_AC_LOCK])dnl
6392
6393 hard_links="nottested"
6394 if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
6395   # do not overwrite the value of need_locks provided by the user
6396   AC_MSG_CHECKING([if we can lock with hard links])
6397   hard_links=yes
6398   $rm conftest*
6399   ln conftest.a conftest.b 2>/dev/null && hard_links=no
6400   touch conftest.a
6401   ln conftest.a conftest.b 2>&5 || hard_links=no
6402   ln conftest.a conftest.b 2>/dev/null && hard_links=no
6403   AC_MSG_RESULT([$hard_links])
6404   if test "$hard_links" = no; then
6405     AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
6406     need_locks=warn
6407   fi
6408 else
6409   need_locks=no
6410 fi
6411 ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
6412
6413
6414 # AC_LIBTOOL_OBJDIR
6415 # -----------------
6416 AC_DEFUN([AC_LIBTOOL_OBJDIR],
6417 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
6418 [rm -f .libs 2>/dev/null
6419 mkdir .libs 2>/dev/null
6420 if test -d .libs; then
6421   lt_cv_objdir=.libs
6422 else
6423   # MS-DOS does not allow filenames that begin with a dot.
6424   lt_cv_objdir=_libs
6425 fi
6426 rmdir .libs 2>/dev/null])
6427 objdir=$lt_cv_objdir
6428 ])# AC_LIBTOOL_OBJDIR
6429
6430
6431 # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
6432 # ----------------------------------------------
6433 # Check hardcoding attributes.
6434 AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
6435 [AC_MSG_CHECKING([how to hardcode library paths into programs])
6436 _LT_AC_TAGVAR(hardcode_action, $1)=
6437 if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
6438    test -n "$_LT_AC_TAGVAR(runpath_var $1)"; then
6439
6440   # We can hardcode non-existant directories.
6441   if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
6442      # If the only mechanism to avoid hardcoding is shlibpath_var, we
6443      # have to relink, otherwise we might link with an installed library
6444      # when we should be linking with a yet-to-be-installed one
6445      ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
6446      test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
6447     # Linking always hardcodes the temporary library directory.
6448     _LT_AC_TAGVAR(hardcode_action, $1)=relink
6449   else
6450     # We can link without hardcoding, and we can hardcode nonexisting dirs.
6451     _LT_AC_TAGVAR(hardcode_action, $1)=immediate
6452   fi
6453 else
6454   # We cannot hardcode anything, or else we can only hardcode existing
6455   # directories.
6456   _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
6457 fi
6458 AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
6459
6460 if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
6461   # Fast installation is not supported
6462   enable_fast_install=no
6463 elif test "$shlibpath_overrides_runpath" = yes ||
6464      test "$enable_shared" = no; then
6465   # Fast installation is not necessary
6466   enable_fast_install=needless
6467 fi
6468 ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
6469
6470
6471 # AC_LIBTOOL_SYS_LIB_STRIP
6472 # ------------------------
6473 AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
6474 [striplib=
6475 old_striplib=
6476 AC_MSG_CHECKING([whether stripping libraries is possible])
6477 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
6478   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
6479   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
6480   AC_MSG_RESULT([yes])
6481 else
6482   AC_MSG_RESULT([no])
6483 fi
6484 ])# AC_LIBTOOL_SYS_LIB_STRIP
6485
6486
6487 # AC_LIBTOOL_SYS_DYNAMIC_LINKER
6488 # -----------------------------
6489 # PORTME Fill in your ld.so characteristics
6490 AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
6491 [AC_MSG_CHECKING([dynamic linker characteristics])
6492 library_names_spec=
6493 libname_spec='lib$name'
6494 soname_spec=
6495 postinstall_cmds=
6496 postuninstall_cmds=
6497 finish_cmds=
6498 finish_eval=
6499 shlibpath_var=
6500 shlibpath_overrides_runpath=unknown
6501 version_type=none
6502 dynamic_linker="$host_os ld.so"
6503 sys_lib_dlsearch_path_spec="/lib /usr/lib"
6504 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
6505 need_lib_prefix=unknown
6506 hardcode_into_libs=no
6507
6508 # when you set need_version to no, make sure it does not cause -set_version
6509 # flags to be left without arguments
6510 need_version=unknown
6511
6512 case $host_os in
6513 aix3*)
6514   version_type=linux
6515   library_names_spec='${libname}${release}.so$versuffix $libname.a'
6516   shlibpath_var=LIBPATH
6517
6518   # AIX 3 has no versioning support, so we append a major version to the name.
6519   soname_spec='${libname}${release}.so$major'
6520   ;;
6521
6522 aix4* | aix5*)
6523   version_type=linux
6524   if test "$host_cpu" = ia64; then
6525     # AIX 5 supports IA64
6526     library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
6527     shlibpath_var=LD_LIBRARY_PATH
6528   else
6529     # With GCC up to 2.95.x, collect2 would create an import file
6530     # for dependence libraries.  The import file would start with
6531     # the line `#! .'.  This would cause the generated library to
6532     # depend on `.', always an invalid library.  This was fixed in
6533     # development snapshots of GCC prior to 3.0.
6534     case $host_os in
6535       aix4 | aix4.[[01]] | aix4.[[01]].*)
6536       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
6537            echo ' yes '
6538            echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
6539         :
6540       else
6541         can_build_shared=no
6542       fi
6543       ;;
6544     esac
6545     # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
6546     # soname into executable. Probably we can add versioning support to
6547     # collect2, so additional links can be useful in future.
6548     if test "$aix_use_runtimelinking" = yes; then
6549       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
6550       # instead of lib<name>.a to let people know that these are not
6551       # typical AIX shared libraries.
6552       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6553     else
6554       # We preserve .a as extension for shared libraries through AIX4.2
6555       # and later when we are not doing run time linking.
6556       library_names_spec='${libname}${release}.a $libname.a'
6557       soname_spec='${libname}${release}.so$major'
6558     fi
6559     shlibpath_var=LIBPATH
6560   fi
6561   ;;
6562
6563 amigaos*)
6564   library_names_spec='$libname.ixlibrary $libname.a'
6565   # Create ${libname}_ixlibrary.a entries in /sys/libs.
6566   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'
6567   ;;
6568
6569 beos*)
6570   library_names_spec='${libname}.so'
6571   dynamic_linker="$host_os ld.so"
6572   shlibpath_var=LIBRARY_PATH
6573   ;;
6574
6575 bsdi4*)
6576   version_type=linux
6577   need_version=no
6578   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6579   soname_spec='${libname}${release}.so$major'
6580   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
6581   shlibpath_var=LD_LIBRARY_PATH
6582   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
6583   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
6584   # the default ld.so.conf also contains /usr/contrib/lib and
6585   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
6586   # libtool to hard-code these into programs
6587   ;;
6588
6589 cygwin* | mingw* | pw32*)
6590   version_type=windows
6591   need_version=no
6592   need_lib_prefix=no
6593   case $GCC,$host_os in
6594   yes,cygwin*)
6595     library_names_spec='$libname.dll.a'
6596     sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib"
6597     soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
6598     postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
6599       dldir=$destdir/`dirname \$dlpath`~
6600       test -d \$dldir || mkdir -p \$dldir~
6601       $install_prog .libs/$dlname \$dldir/$dlname'
6602     postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
6603       dlpath=$dir/\$dldll~
6604        $rm \$dlpath'
6605     ;;
6606   yes,mingw*)
6607     library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
6608     sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://"`
6609     if echo "$sys_lib_search_path_spec" | [egrep ';[C-Z]:/' >/dev/null]; then
6610       # It is most probably a Windows format PATH printed by
6611       # mingw gcc, but we are running on Cygwin. Gcc prints its search
6612       # path with ; separators, and with drive letters. We can handle the
6613       # drive letters (cygwin fileutils understands them), so leave them,
6614       # especially as we might pass files found there to a mingw objdump,
6615       # which wouldn't understand a cygwinified path. Ahh.
6616       sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed -e 's/;/ /g'`
6617     else
6618       sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed  -e "s/$PATH_SEPARATOR/ /g"`
6619     fi
6620     ;;
6621   yes,pw32*)
6622     library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6623     ;;
6624   *)
6625     library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
6626     ;;
6627   esac
6628   dynamic_linker='Win32 ld.exe'
6629   # FIXME: first we should search . and the directory the executable is in
6630   shlibpath_var=PATH
6631   ;;
6632
6633 darwin* | rhapsody*)
6634   dynamic_linker="$host_os dyld"
6635   version_type=darwin
6636   need_lib_prefix=no
6637   need_version=no
6638   # FIXME: Relying on posixy $() will cause problems for
6639   #        cross-compilation, but unfortunately the echo tests do not
6640   #        yet detect zsh echo's removal of \ escapes.
6641   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)'
6642   soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
6643   shlibpath_overrides_runpath=yes
6644   shlibpath_var=DYLD_LIBRARY_PATH
6645   ;;
6646
6647 dgux*)
6648   version_type=linux
6649   need_lib_prefix=no
6650   need_version=no
6651   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6652   soname_spec='${libname}${release}.so$major'
6653   shlibpath_var=LD_LIBRARY_PATH
6654   ;;
6655
6656 freebsd1*)
6657   dynamic_linker=no
6658   ;;
6659
6660 freebsd*)
6661   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
6662   version_type=freebsd-$objformat
6663   case $version_type in
6664     freebsd-elf*)
6665       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
6666       need_version=no
6667       need_lib_prefix=no
6668       ;;
6669     freebsd-*)
6670       library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
6671       need_version=yes
6672       ;;
6673   esac
6674   shlibpath_var=LD_LIBRARY_PATH
6675   case $host_os in
6676   freebsd2*)
6677     shlibpath_overrides_runpath=yes
6678     ;;
6679   freebsd3.[01]* | freebsdelf3.[01]*)
6680     shlibpath_overrides_runpath=yes
6681     hardcode_into_libs=yes
6682     ;;
6683   *) # from 3.2 on
6684     shlibpath_overrides_runpath=no
6685     hardcode_into_libs=yes
6686     ;;
6687   esac
6688   ;;
6689
6690 gnu*)
6691   version_type=linux
6692   need_lib_prefix=no
6693   need_version=no
6694   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
6695   soname_spec='${libname}${release}.so$major'
6696   shlibpath_var=LD_LIBRARY_PATH
6697   hardcode_into_libs=yes
6698   ;;
6699
6700 hpux9* | hpux10* | hpux11*)
6701   # Give a soname corresponding to the major version so that dld.sl refuses to
6702   # link against other versions.
6703   version_type=sunos
6704   need_lib_prefix=no
6705   need_version=no
6706   if test "$host_cpu" = ia64; then
6707     hardcode_into_libs=yes
6708     dynamic_linker="$host_os dld.so"
6709     shlibpath_var=LD_LIBRARY_PATH
6710     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
6711     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6712     soname_spec='${libname}${release}.so$major'
6713     if test "X$HPUX_IA64_MODE" = X32; then
6714       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
6715     else
6716       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
6717     fi
6718     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
6719   else
6720     dynamic_linker="$host_os dld.sl"
6721     shlibpath_var=SHLIB_PATH
6722     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6723     library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
6724     soname_spec='${libname}${release}.sl$major'
6725   fi
6726   # HP-UX runs *really* slowly unless shared libraries are mode 555.
6727   postinstall_cmds='chmod 555 $lib'
6728   ;;
6729
6730 irix5* | irix6* | nonstopux*)
6731   case $host_os in
6732     nonstopux*) version_type=nonstopux ;;
6733     *)          version_type=irix ;;
6734   esac
6735   need_lib_prefix=no
6736   need_version=no
6737   soname_spec='${libname}${release}.so$major'
6738   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
6739   case $host_os in
6740   irix5* | nonstopux*)
6741     libsuff= shlibsuff=
6742     ;;
6743   *)
6744     case $LD in # libtool.m4 will add one of these switches to LD
6745     *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
6746     *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
6747     *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
6748     *) libsuff= shlibsuff= libmagic=never-match;;
6749     esac
6750     ;;
6751   esac
6752   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6753   shlibpath_overrides_runpath=no
6754   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
6755   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
6756   ;;
6757
6758 # No shared lib support for Linux oldld, aout, or coff.
6759 linux*oldld* | linux*aout* | linux*coff*)
6760   dynamic_linker=no
6761   ;;
6762
6763 # This must be Linux ELF.
6764 linux*)
6765   version_type=linux
6766   need_lib_prefix=no
6767   need_version=no
6768   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6769   soname_spec='${libname}${release}.so$major'
6770   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6771   libsuff=
6772   if test "x$LINUX_64_MODE" = x64; then
6773     # Some platforms are per default 64-bit, so there's no /lib64
6774     if test -d /lib64; then
6775       libsuff=64
6776     fi
6777   fi
6778   shlibpath_var=LD_LIBRARY_PATH
6779   shlibpath_overrides_runpath=no
6780   sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
6781   sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
6782   # This implies no fast_install, which is unacceptable.
6783   # Some rework will be needed to allow for fast_install
6784   # before this can be enabled.
6785   hardcode_into_libs=yes
6786
6787   # We used to test for /lib/ld.so.1 and disable shared libraries on
6788   # powerpc, because MkLinux only supported shared libraries with the
6789   # GNU dynamic linker.  Since this was broken with cross compilers,
6790   # most powerpc-linux boxes support dynamic linking these days and
6791   # people can always --disable-shared, the test was removed, and we
6792   # assume the GNU/Linux dynamic linker is in use.
6793   dynamic_linker='GNU/Linux ld.so'
6794   ;;
6795
6796 netbsd*)
6797   version_type=sunos
6798   need_lib_prefix=no
6799   need_version=no
6800   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6801     library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6802     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6803     dynamic_linker='NetBSD (a.out) ld.so'
6804   else
6805     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
6806     soname_spec='${libname}${release}.so$major'
6807     dynamic_linker='NetBSD ld.elf_so'
6808   fi
6809   shlibpath_var=LD_LIBRARY_PATH
6810   shlibpath_overrides_runpath=yes
6811   hardcode_into_libs=yes
6812   ;;
6813
6814 newsos6)
6815   version_type=linux
6816   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6817   shlibpath_var=LD_LIBRARY_PATH
6818   shlibpath_overrides_runpath=yes
6819   ;;
6820
6821 nto-qnx)
6822   version_type=linux
6823   need_lib_prefix=no
6824   need_version=no
6825   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6826   soname_spec='${libname}${release}.so$major'
6827   shlibpath_var=LD_LIBRARY_PATH
6828   shlibpath_overrides_runpath=yes
6829   ;;
6830
6831 openbsd*)
6832   version_type=sunos
6833   need_lib_prefix=no
6834   need_version=no
6835   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6836   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6837   shlibpath_var=LD_LIBRARY_PATH
6838   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6839     case $host_os in
6840       openbsd2.[[89]] | openbsd2.[[89]].*)
6841         shlibpath_overrides_runpath=no
6842         ;;
6843       *)
6844         shlibpath_overrides_runpath=yes
6845         ;;
6846       esac
6847   else
6848     shlibpath_overrides_runpath=yes
6849   fi
6850   ;;
6851
6852 os2*)
6853   libname_spec='$name'
6854   need_lib_prefix=no
6855   library_names_spec='$libname.dll $libname.a'
6856   dynamic_linker='OS/2 ld.exe'
6857   shlibpath_var=LIBPATH
6858   ;;
6859
6860 osf3* | osf4* | osf5*)
6861   version_type=osf
6862   need_lib_prefix=no
6863   need_version=no
6864   soname_spec='${libname}${release}.so'
6865   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
6866   shlibpath_var=LD_LIBRARY_PATH
6867   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
6868   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
6869   ;;
6870
6871 sco3.2v5*)
6872   version_type=osf
6873   soname_spec='${libname}${release}.so$major'
6874   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6875   shlibpath_var=LD_LIBRARY_PATH
6876   ;;
6877
6878 solaris*)
6879   version_type=linux
6880   need_lib_prefix=no
6881   need_version=no
6882   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6883   soname_spec='${libname}${release}.so$major'
6884   shlibpath_var=LD_LIBRARY_PATH
6885   shlibpath_overrides_runpath=yes
6886   hardcode_into_libs=yes
6887   # ldd complains unless libraries are executable
6888   postinstall_cmds='chmod +x $lib'
6889   ;;
6890
6891 sunos4*)
6892   version_type=sunos
6893   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6894   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
6895   shlibpath_var=LD_LIBRARY_PATH
6896   shlibpath_overrides_runpath=yes
6897   if test "$with_gnu_ld" = yes; then
6898     need_lib_prefix=no
6899   fi
6900   need_version=yes
6901   ;;
6902
6903 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6904   version_type=linux
6905   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6906   soname_spec='${libname}${release}.so$major'
6907   shlibpath_var=LD_LIBRARY_PATH
6908   case $host_vendor in
6909     sni)
6910       shlibpath_overrides_runpath=no
6911       ;;
6912     motorola)
6913       need_lib_prefix=no
6914       need_version=no
6915       shlibpath_overrides_runpath=no
6916       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
6917       ;;
6918   esac
6919   ;;
6920
6921 sysv4*MP*)
6922   if test -d /usr/nec ;then
6923     version_type=linux
6924     library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
6925     soname_spec='$libname.so.$major'
6926     shlibpath_var=LD_LIBRARY_PATH
6927   fi
6928   ;;
6929
6930 uts4*)
6931   version_type=linux
6932   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6933   soname_spec='${libname}${release}.so$major'
6934   shlibpath_var=LD_LIBRARY_PATH
6935   ;;
6936
6937 *)
6938   dynamic_linker=no
6939   ;;
6940 esac
6941 AC_MSG_RESULT([$dynamic_linker])
6942 test "$dynamic_linker" = no && can_build_shared=no
6943 ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
6944
6945
6946 # _LT_AC_TAGCONFIG
6947 # ----------------
6948 AC_DEFUN([_LT_AC_TAGCONFIG],
6949 [AC_ARG_WITH([tags],
6950     [AC_HELP_STRING([--with-tags=TAGS],
6951         [include additional configurations @<:@CXX,GCJ@:>@])],
6952     [tagnames="$withval"],
6953     [tagnames="CXX,GCJ"
6954     case $host_os in
6955       mingw*|cygwin*) tagnames="$tagnames,RC" ;;
6956     esac])
6957
6958 if test -f "$ltmain" && test -n "$tagnames"; then
6959   if test ! -f "${ofile}"; then
6960     AC_MSG_WARN([output file `$ofile' does not exist])
6961   fi
6962
6963   if test -z "$LTCC"; then
6964     eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
6965     if test -z "$LTCC"; then
6966       AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
6967     else
6968       AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
6969     fi
6970   fi
6971
6972   # Extract list of available tagged configurations in $ofile.
6973   # Note that this assumes the entire list is on one line.
6974   available_tags=`grep "^available_tags=" "${ofile}" | sed -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
6975
6976   lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
6977   for tagname in $tagnames; do
6978     IFS="$lt_save_ifs"
6979     # Check whether tagname contains only valid characters
6980     case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
6981     "") ;;
6982     *)  AC_MSG_ERROR([invalid tag name: $tagname])
6983         ;;
6984     esac
6985
6986     if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
6987     then
6988       AC_MSG_ERROR([tag name \"$tagname\" already exists])
6989     fi
6990
6991     # Update the list of available tags.
6992     if test -n "$tagname"; then
6993       echo appending configuration tag \"$tagname\" to $ofile
6994
6995       case $tagname in
6996       CXX)
6997         AC_LIBTOOL_LANG_CXX_CONFIG
6998         ;;
6999
7000       GCJ)
7001         AC_LIBTOOL_LANG_GCJ_CONFIG
7002         ;;
7003
7004       RC)
7005         AC_LIBTOOL_LANG_RC_CONFIG
7006         ;;
7007
7008       *)
7009         AC_MSG_ERROR([Unsupported tag name: $tagname])
7010         ;;
7011       esac
7012
7013       # Append the new tag name to the list of available tags.
7014       available_tags="$available_tags $tagname"
7015     fi
7016   done
7017   IFS="$lt_save_ifs"
7018
7019   # Now substitute the updated list of available tags.
7020   if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
7021     mv "${ofile}T" "$ofile"
7022     chmod +x "$ofile"
7023   else
7024     rm -f "${ofile}T"
7025     AC_MSG_ERROR([unable to update list of available tagged configurations.])
7026   fi
7027 fi
7028 ])# _LT_AC_TAGCONFIG
7029
7030
7031 # AC_LIBTOOL_DLOPEN
7032 # -----------------
7033 # enable checks for dlopen support
7034 AC_DEFUN([AC_LIBTOOL_DLOPEN],
7035  [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
7036 ])# AC_LIBTOOL_DLOPEN
7037
7038
7039 # AC_LIBTOOL_WIN32_DLL
7040 # --------------------
7041 # declare package support for building win32 dll's
7042 AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
7043 [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
7044 ])# AC_LIBTOOL_WIN32_DLL
7045
7046
7047 # AC_ENABLE_SHARED([DEFAULT])
7048 # ---------------------------
7049 # implement the --enable-shared flag
7050 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7051 AC_DEFUN([AC_ENABLE_SHARED],
7052 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
7053 AC_ARG_ENABLE([shared],
7054     [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
7055         [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
7056     [p=${PACKAGE-default}
7057     case $enableval in
7058     yes) enable_shared=yes ;;
7059     no) enable_shared=no ;;
7060     *)
7061       enable_shared=no
7062       # Look at the argument we got.  We use all the common list separators.
7063       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7064       for pkg in $enableval; do
7065         IFS="$lt_save_ifs"
7066         if test "X$pkg" = "X$p"; then
7067           enable_shared=yes
7068         fi
7069       done
7070       IFS="$lt_save_ifs"
7071       ;;
7072     esac],
7073     [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
7074 ])# AC_ENABLE_SHARED
7075
7076
7077 # AC_DISABLE_SHARED
7078 # -----------------
7079 #- set the default shared flag to --disable-shared
7080 AC_DEFUN([AC_DISABLE_SHARED],
7081 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7082 AC_ENABLE_SHARED(no)
7083 ])# AC_DISABLE_SHARED
7084
7085
7086 # AC_ENABLE_STATIC([DEFAULT])
7087 # ---------------------------
7088 # implement the --enable-static flag
7089 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7090 AC_DEFUN([AC_ENABLE_STATIC],
7091 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
7092 AC_ARG_ENABLE([static],
7093     [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
7094         [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
7095     [p=${PACKAGE-default}
7096     case $enableval in
7097     yes) enable_static=yes ;;
7098     no) enable_static=no ;;
7099     *)
7100      enable_static=no
7101       # Look at the argument we got.  We use all the common list separators.
7102       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7103       for pkg in $enableval; do
7104         IFS="$lt_save_ifs"
7105         if test "X$pkg" = "X$p"; then
7106           enable_static=yes
7107         fi
7108       done
7109       IFS="$lt_save_ifs"
7110       ;;
7111     esac],
7112     [enable_static=]AC_ENABLE_STATIC_DEFAULT)
7113 ])# AC_ENABLE_STATIC
7114
7115
7116 # AC_DISABLE_STATIC
7117 # -----------------
7118 # set the default static flag to --disable-static
7119 AC_DEFUN([AC_DISABLE_STATIC],
7120 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7121 AC_ENABLE_STATIC(no)
7122 ])# AC_DISABLE_STATIC
7123
7124
7125 # AC_ENABLE_FAST_INSTALL([DEFAULT])
7126 # ---------------------------------
7127 # implement the --enable-fast-install flag
7128 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7129 AC_DEFUN([AC_ENABLE_FAST_INSTALL],
7130 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
7131 AC_ARG_ENABLE([fast-install],
7132     [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
7133     [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
7134     [p=${PACKAGE-default}
7135     case $enableval in
7136     yes) enable_fast_install=yes ;;
7137     no) enable_fast_install=no ;;
7138     *)
7139       enable_fast_install=no
7140       # Look at the argument we got.  We use all the common list separators.
7141       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7142       for pkg in $enableval; do
7143         IFS="$lt_save_ifs"
7144         if test "X$pkg" = "X$p"; then
7145           enable_fast_install=yes
7146         fi
7147       done
7148       IFS="$lt_save_ifs"
7149       ;;
7150     esac],
7151     [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
7152 ])# AC_ENABLE_FAST_INSTALL
7153
7154
7155 # AC_DISABLE_FAST_INSTALL
7156 # -----------------------
7157 # set the default to --disable-fast-install
7158 AC_DEFUN([AC_DISABLE_FAST_INSTALL],
7159 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7160 AC_ENABLE_FAST_INSTALL(no)
7161 ])# AC_DISABLE_FAST_INSTALL
7162
7163
7164 # AC_LIBTOOL_PICMODE([MODE])
7165 # --------------------------
7166 # implement the --with-pic flag
7167 # MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
7168 AC_DEFUN([AC_LIBTOOL_PICMODE],
7169 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7170 pic_mode=ifelse($#,1,$1,default)
7171 ])# AC_LIBTOOL_PICMODE
7172
7173
7174 # AC_PATH_TOOL_PREFIX
7175 # -------------------
7176 # find a file program which can recognise shared library
7177 AC_DEFUN([AC_PATH_TOOL_PREFIX],
7178 [AC_MSG_CHECKING([for $1])
7179 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
7180 [case $MAGIC_CMD in
7181 [[\\/*] |  ?:[\\/]*])
7182   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
7183   ;;
7184 *)
7185   lt_save_MAGIC_CMD="$MAGIC_CMD"
7186   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7187 dnl $ac_dummy forces splitting on constant user-supplied paths.
7188 dnl POSIX.2 word splitting is done only on the output of word expansions,
7189 dnl not every word.  This closes a longstanding sh security hole.
7190   ac_dummy="ifelse([$2], , $PATH, [$2])"
7191   for ac_dir in $ac_dummy; do
7192     IFS="$lt_save_ifs"
7193     test -z "$ac_dir" && ac_dir=.
7194     if test -f $ac_dir/$1; then
7195       lt_cv_path_MAGIC_CMD="$ac_dir/$1"
7196       if test -n "$file_magic_test_file"; then
7197         case $deplibs_check_method in
7198         "file_magic "*)
7199           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
7200           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7201           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
7202             egrep "$file_magic_regex" > /dev/null; then
7203             :
7204           else
7205             cat <<EOF 1>&2
7206
7207 *** Warning: the command libtool uses to detect shared libraries,
7208 *** $file_magic_cmd, produces output that libtool cannot recognize.
7209 *** The result is that libtool may fail to recognize shared libraries
7210 *** as such.  This will affect the creation of libtool libraries that
7211 *** depend on shared libraries, but programs linked with such libtool
7212 *** libraries will work regardless of this problem.  Nevertheless, you
7213 *** may want to report the problem to your system manager and/or to
7214 *** bug-libtool@gnu.org
7215
7216 EOF
7217           fi ;;
7218         esac
7219       fi
7220       break
7221     fi
7222   done
7223   IFS="$lt_save_ifs"
7224   MAGIC_CMD="$lt_save_MAGIC_CMD"
7225   ;;
7226 esac])
7227 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7228 if test -n "$MAGIC_CMD"; then
7229   AC_MSG_RESULT($MAGIC_CMD)
7230 else
7231   AC_MSG_RESULT(no)
7232 fi
7233 ])# AC_PATH_TOOL_PREFIX
7234
7235
7236 # AC_PATH_MAGIC
7237 # -------------
7238 # find a file program which can recognise a shared library
7239 AC_DEFUN([AC_PATH_MAGIC],
7240 [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
7241 if test -z "$lt_cv_path_MAGIC_CMD"; then
7242   if test -n "$ac_tool_prefix"; then
7243     AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
7244   else
7245     MAGIC_CMD=:
7246   fi
7247 fi
7248 ])# AC_PATH_MAGIC
7249
7250
7251 # AC_PROG_LD
7252 # ----------
7253 # find the path to the GNU or non-GNU linker
7254 AC_DEFUN([AC_PROG_LD],
7255 [AC_ARG_WITH([gnu-ld],
7256     [AC_HELP_STRING([--with-gnu-ld],
7257         [assume the C compiler uses GNU ld @<:@default=no@:>@])],
7258     [test "$withval" = no || with_gnu_ld=yes],
7259     [with_gnu_ld=no])
7260 AC_REQUIRE([AC_PROG_CC])dnl
7261 AC_REQUIRE([AC_CANONICAL_HOST])dnl
7262 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
7263 ac_prog=ld
7264 if test "$GCC" = yes; then
7265   # Check if gcc -print-prog-name=ld gives a path.
7266   AC_MSG_CHECKING([for ld used by GCC])
7267   case $host in
7268   *-*-mingw*)
7269     # gcc leaves a trailing carriage return which upsets mingw
7270     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
7271   *)
7272     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
7273   esac
7274   case $ac_prog in
7275     # Accept absolute paths.
7276     [[\\/]]* | ?:[[\\/]]*)
7277       re_direlt='/[[^/]][[^/]]*/\.\./'
7278       # Canonicalize the path of ld
7279       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
7280       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
7281         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
7282       done
7283       test -z "$LD" && LD="$ac_prog"
7284       ;;
7285   "")
7286     # If it fails, then pretend we aren't using GCC.
7287     ac_prog=ld
7288     ;;
7289   *)
7290     # If it is relative, then search for the first ld in PATH.
7291     with_gnu_ld=unknown
7292     ;;
7293   esac
7294 elif test "$with_gnu_ld" = yes; then
7295   AC_MSG_CHECKING([for GNU ld])
7296 else
7297   AC_MSG_CHECKING([for non-GNU ld])
7298 fi
7299 AC_CACHE_VAL(lt_cv_path_LD,
7300 [if test -z "$LD"; then
7301   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7302   for ac_dir in $PATH; do
7303     IFS="$lt_save_ifs"
7304     test -z "$ac_dir" && ac_dir=.
7305     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
7306       lt_cv_path_LD="$ac_dir/$ac_prog"
7307       # Check to see if the program is GNU ld.  I'd rather use --version,
7308       # but apparently some GNU ld's only accept -v.
7309       # Break only if it was the GNU/non-GNU ld that we prefer.
7310       if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
7311         test "$with_gnu_ld" != no && break
7312       else
7313         test "$with_gnu_ld" != yes && break
7314       fi
7315     fi
7316   done
7317   IFS="$lt_save_ifs"
7318 else
7319   lt_cv_path_LD="$LD" # Let the user override the test with a path.
7320 fi])
7321 LD="$lt_cv_path_LD"
7322 if test -n "$LD"; then
7323   AC_MSG_RESULT($LD)
7324 else
7325   AC_MSG_RESULT(no)
7326 fi
7327 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
7328 AC_PROG_LD_GNU
7329 ])# AC_PROG_LD
7330
7331
7332 # AC_PROG_LD_GNU
7333 # --------------
7334 AC_DEFUN([AC_PROG_LD_GNU],
7335 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
7336 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
7337 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
7338   lt_cv_prog_gnu_ld=yes
7339 else
7340   lt_cv_prog_gnu_ld=no
7341 fi])
7342 with_gnu_ld=$lt_cv_prog_gnu_ld
7343 ])# AC_PROG_LD_GNU
7344
7345
7346 # AC_PROG_LD_RELOAD_FLAG
7347 # ----------------------
7348 # find reload flag for linker
7349 #   -- PORTME Some linkers may need a different reload flag.
7350 AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
7351 [AC_CACHE_CHECK([for $LD option to reload object files],
7352   lt_cv_ld_reload_flag,
7353   [lt_cv_ld_reload_flag='-r'])
7354 reload_flag=$lt_cv_ld_reload_flag
7355 case $reload_flag in
7356 "" | " "*) ;;
7357 *) reload_flag=" $reload_flag" ;;
7358 esac
7359 reload_cmds='$LD$reload_flag -o $output$reload_objs'
7360 ])# AC_PROG_LD_RELOAD_FLAG
7361
7362
7363 # AC_DEPLIBS_CHECK_METHOD
7364 # -----------------------
7365 # how to check for library dependencies
7366 #  -- PORTME fill in with the dynamic library characteristics
7367 AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
7368 [AC_CACHE_CHECK([how to recognise dependant libraries],
7369 lt_cv_deplibs_check_method,
7370 [lt_cv_file_magic_cmd='$MAGIC_CMD'
7371 lt_cv_file_magic_test_file=
7372 lt_cv_deplibs_check_method='unknown'
7373 # Need to set the preceding variable on all platforms that support
7374 # interlibrary dependencies.
7375 # 'none' -- dependencies not supported.
7376 # `unknown' -- same as none, but documents that we really don't know.
7377 # 'pass_all' -- all dependencies passed with no checks.
7378 # 'test_compile' -- check by making test program.
7379 # 'file_magic [[regex]]' -- check by looking for files in library path
7380 # which responds to the $file_magic_cmd with a given egrep regex.
7381 # If you have `file' or equivalent on your system and you're not sure
7382 # whether `pass_all' will *always* work, you probably want this one.
7383
7384 case $host_os in
7385 aix4* | aix5*)
7386   lt_cv_deplibs_check_method=pass_all
7387   ;;
7388
7389 beos*)
7390   lt_cv_deplibs_check_method=pass_all
7391   ;;
7392
7393 bsdi4*)
7394   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
7395   lt_cv_file_magic_cmd='/usr/bin/file -L'
7396   lt_cv_file_magic_test_file=/shlib/libc.so
7397   ;;
7398
7399 cygwin* | mingw* | pw32*)
7400   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
7401   lt_cv_file_magic_cmd='$OBJDUMP -f'
7402   ;;
7403
7404 darwin* | rhapsody*)
7405   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
7406   lt_cv_file_magic_cmd='/usr/bin/file -L'
7407   case "$host_os" in
7408   rhapsody* | darwin1.[[012]])
7409     lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
7410     ;;
7411   *) # Darwin 1.3 on
7412     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
7413     ;;
7414   esac
7415   ;;
7416
7417 freebsd*)
7418   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
7419     case $host_cpu in
7420     i*86 )
7421       # Not sure whether the presence of OpenBSD here was a mistake.
7422       # Let's accept both of them until this is cleared up.
7423       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
7424       lt_cv_file_magic_cmd=/usr/bin/file
7425       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
7426       ;;
7427     esac
7428   else
7429     lt_cv_deplibs_check_method=pass_all
7430   fi
7431   ;;
7432
7433 gnu*)
7434   lt_cv_deplibs_check_method=pass_all
7435   ;;
7436
7437 hpux10.20* | hpux11*)
7438   lt_cv_file_magic_cmd=/usr/bin/file
7439   if test "$host_cpu" = ia64; then
7440     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
7441     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
7442   else
7443     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
7444     lt_cv_file_magic_test_file=/usr/lib/libc.sl
7445   fi
7446   ;;
7447
7448 irix5* | irix6* | nonstopux*)
7449   case $host_os in
7450   irix5* | nonstopux*)
7451     # this will be overridden with pass_all, but let us keep it just in case
7452     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
7453     ;;
7454   *)
7455     case $LD in
7456     *-32|*"-32 ") libmagic=32-bit;;
7457     *-n32|*"-n32 ") libmagic=N32;;
7458     *-64|*"-64 ") libmagic=64-bit;;
7459     *) libmagic=never-match;;
7460     esac
7461     # this will be overridden with pass_all, but let us keep it just in case
7462     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
7463     ;;
7464   esac
7465   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
7466   lt_cv_deplibs_check_method=pass_all
7467   ;;
7468
7469 # This must be Linux ELF.
7470 linux*)
7471   case $host_cpu in
7472   alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh* | x86_64* )
7473     lt_cv_deplibs_check_method=pass_all ;;
7474   *)
7475     # glibc up to 2.1.1 does not perform some relocations on ARM
7476     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
7477   esac
7478   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
7479   ;;
7480
7481 netbsd*)
7482   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
7483     lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
7484   else
7485     lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
7486   fi
7487   ;;
7488
7489 newos6*)
7490   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
7491   lt_cv_file_magic_cmd=/usr/bin/file
7492   lt_cv_file_magic_test_file=/usr/lib/libnls.so
7493   ;;
7494
7495 nto-qnx)
7496   lt_cv_deplibs_check_method=unknown
7497   ;;
7498
7499 openbsd*)
7500   lt_cv_file_magic_cmd=/usr/bin/file
7501   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
7502   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7503     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
7504   else
7505     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
7506   fi
7507   ;;
7508
7509 osf3* | osf4* | osf5*)
7510   # this will be overridden with pass_all, but let us keep it just in case
7511   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
7512   lt_cv_file_magic_test_file=/shlib/libc.so
7513   lt_cv_deplibs_check_method=pass_all
7514   ;;
7515
7516 sco3.2v5*)
7517   lt_cv_deplibs_check_method=pass_all
7518   ;;
7519
7520 solaris*)
7521   lt_cv_deplibs_check_method=pass_all
7522   lt_cv_file_magic_test_file=/lib/libc.so
7523   ;;
7524
7525 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
7526   case $host_vendor in
7527   motorola)
7528     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]]'
7529     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
7530     ;;
7531   ncr)
7532     lt_cv_deplibs_check_method=pass_all
7533     ;;
7534   sequent)
7535     lt_cv_file_magic_cmd='/bin/file'
7536     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
7537     ;;
7538   sni)
7539     lt_cv_file_magic_cmd='/bin/file'
7540     lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
7541     lt_cv_file_magic_test_file=/lib/libc.so
7542     ;;
7543   esac
7544   ;;
7545
7546 sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
7547   lt_cv_deplibs_check_method=pass_all
7548   ;;
7549 esac
7550 ])
7551 file_magic_cmd=$lt_cv_file_magic_cmd
7552 deplibs_check_method=$lt_cv_deplibs_check_method
7553 test -z "$deplibs_check_method" && deplibs_check_method=unknown
7554 ])# AC_DEPLIBS_CHECK_METHOD
7555
7556
7557 # AC_PROG_NM
7558 # ----------
7559 # find the path to a BSD-compatible name lister
7560 AC_DEFUN([AC_PROG_NM],
7561 [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
7562 [if test -n "$NM"; then
7563   # Let the user override the test.
7564   lt_cv_path_NM="$NM"
7565 else
7566   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7567   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
7568     IFS="$lt_save_ifs"
7569     test -z "$ac_dir" && ac_dir=.
7570     tmp_nm="$ac_dir/${ac_tool_prefix}nm"
7571     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
7572       # Check to see if the nm accepts a BSD-compat flag.
7573       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
7574       #   nm: unknown option "B" ignored
7575       # Tru64's nm complains that /dev/null is an invalid object file
7576       if ("$tmp_nm" -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
7577         lt_cv_path_NM="$tmp_nm -B"
7578         break
7579       elif ("$tmp_nm" -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
7580         lt_cv_path_NM="$tmp_nm -p"
7581         break
7582       else
7583         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
7584         continue # so that we can try to find one that supports BSD flags
7585       fi
7586     fi
7587   done
7588   IFS="$lt_save_ifs"
7589   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
7590 fi])
7591 NM="$lt_cv_path_NM"
7592 ])# AC_PROG_NM
7593
7594
7595 # AC_CHECK_LIBM
7596 # -------------
7597 # check for math library
7598 AC_DEFUN([AC_CHECK_LIBM],
7599 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
7600 LIBM=
7601 case $host in
7602 *-*-beos* | *-*-cygwin* | *-*-pw32*)
7603   # These system don't have libm
7604   ;;
7605 *-ncr-sysv4.3*)
7606   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
7607   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
7608   ;;
7609 *)
7610   AC_CHECK_LIB(m, main, LIBM="-lm")
7611   ;;
7612 esac
7613 ])# AC_CHECK_LIBM
7614
7615
7616 # AC_LIBLTDL_CONVENIENCE([DIRECTORY])
7617 # -----------------------------------
7618 # sets LIBLTDL to the link flags for the libltdl convenience library and
7619 # LTDLINCL to the include flags for the libltdl header and adds
7620 # --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
7621 # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
7622 # DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
7623 # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
7624 # '${top_srcdir}/' (note the single quotes!).  If your package is not
7625 # flat and you're not using automake, define top_builddir and
7626 # top_srcdir appropriately in the Makefiles.
7627 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
7628 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7629   case $enable_ltdl_convenience in
7630   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
7631   "") enable_ltdl_convenience=yes
7632       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
7633   esac
7634   LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
7635   LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
7636   # For backwards non-gettext consistent compatibility...
7637   INCLTDL="$LTDLINCL"
7638 ])# AC_LIBLTDL_CONVENIENCE
7639
7640
7641 # AC_LIBLTDL_INSTALLABLE([DIRECTORY])
7642 # -----------------------------------
7643 # sets LIBLTDL to the link flags for the libltdl installable library and
7644 # LTDLINCL to the include flags for the libltdl header and adds
7645 # --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
7646 # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
7647 # DIRECTORY is not provided and an installed libltdl is not found, it is
7648 # assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
7649 # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
7650 # quotes!).  If your package is not flat and you're not using automake,
7651 # define top_builddir and top_srcdir appropriately in the Makefiles.
7652 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
7653 AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
7654 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7655   AC_CHECK_LIB(ltdl, main,
7656   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
7657   [if test x"$enable_ltdl_install" = xno; then
7658      AC_MSG_WARN([libltdl not installed, but installation disabled])
7659    else
7660      enable_ltdl_install=yes
7661    fi
7662   ])
7663   if test x"$enable_ltdl_install" = x"yes"; then
7664     ac_configure_args="$ac_configure_args --enable-ltdl-install"
7665     LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
7666     LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
7667   else
7668     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
7669     LIBLTDL="-lltdl"
7670     LTDLINCL=
7671   fi
7672   # For backwards non-gettext consistent compatibility...
7673   INCLTDL="$LTDLINCL"
7674 ])# AC_LIBLTDL_INSTALLABLE
7675
7676
7677 # If this macro is not defined by Autoconf, define it here.
7678 ifdef([AC_PROVIDE_IFELSE],
7679       [],
7680       [define([AC_PROVIDE_IFELSE],
7681               [ifdef([AC_PROVIDE_$1],
7682                      [$2], [$3])])])
7683
7684
7685 # AC_LIBTOOL_CXX
7686 # --------------
7687 # enable support for C++ libraries
7688 AC_DEFUN([AC_LIBTOOL_CXX],
7689 [AC_REQUIRE([_LT_AC_LANG_CXX])
7690 ])# AC_LIBTOOL_CXX
7691
7692
7693 # _LT_AC_LANG_CXX
7694 # ---------------
7695 AC_DEFUN([_LT_AC_LANG_CXX],
7696 [AC_REQUIRE([AC_PROG_CXX])
7697 AC_REQUIRE([AC_PROG_CXXCPP])
7698 ])# _LT_AC_LANG_CXX
7699
7700
7701 # AC_LIBTOOL_GCJ
7702 # --------------
7703 # enable support for GCJ libraries
7704 AC_DEFUN([AC_LIBTOOL_GCJ],
7705 [AC_REQUIRE([_LT_AC_LANG_GCJ])
7706 ])# AC_LIBTOOL_GCJ
7707
7708
7709 # _LT_AC_LANG_GCJ
7710 # ---------------
7711 AC_DEFUN([_LT_AC_LANG_GCJ],
7712 [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
7713   [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
7714     [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
7715       [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
7716          [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
7717            [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
7718 ])# _LT_AC_LANG_GCJ
7719
7720
7721 # AC_LIBTOOL_RC
7722 # --------------
7723 # enable support for Windows resource files
7724 AC_DEFUN([AC_LIBTOOL_RC],
7725 [AC_REQUIRE([AC_PROG_RC])
7726 ])# AC_LIBTOOL_RC
7727
7728
7729 # AC_LIBTOOL_LANG_C_CONFIG
7730 # ------------------------
7731 # Ensure that the configuration vars for the C compiler are
7732 # suitably defined.  Those variables are subsequently used by
7733 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
7734 AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
7735 AC_DEFUN([_LT_AC_LANG_C_CONFIG],
7736 [lt_save_CC="$CC"
7737 AC_LANG_PUSH(C)
7738
7739 # Source file extension for C test sources.
7740 ac_ext=c
7741
7742 # Object file extension for compiled C test sources.
7743 objext=o
7744 _LT_AC_TAGVAR(objext, $1)=$objext
7745
7746 # Code to be used in simple compile tests
7747 lt_simple_compile_test_code="int some_variable = 0;"
7748
7749 # Code to be used in simple link tests
7750 lt_simple_link_test_code='main(){return(0);}'
7751
7752 _LT_AC_SYS_COMPILER
7753
7754 #
7755 # Check for any special shared library compilation flags.
7756 #
7757 _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
7758 if test "$GCC" = no; then
7759   case $host_os in
7760   sco3.2v5*)
7761     _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
7762     ;;
7763   esac
7764 fi
7765 if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
7766   AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
7767   if echo "$old_CC $old_CFLAGS " | egrep -e "[[         ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[      ]]" >/dev/null; then :
7768   else
7769     AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
7770     _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
7771   fi
7772 fi
7773
7774
7775 #
7776 # Check to make sure the static flag actually works.
7777 #
7778 AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
7779   _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
7780   $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
7781   [],
7782   [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
7783
7784
7785 AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
7786 AC_LIBTOOL_PROG_COMPILER_PIC($1)
7787 AC_LIBTOOL_PROG_CC_C_O($1)
7788 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
7789 AC_LIBTOOL_PROG_LD_SHLIBS($1)
7790 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
7791 AC_LIBTOOL_SYS_LIB_STRIP
7792 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
7793 AC_LIBTOOL_DLOPEN_SELF($1)
7794
7795 # Report which librarie types wil actually be built
7796 AC_MSG_CHECKING([if libtool supports shared libraries])
7797 AC_MSG_RESULT([$can_build_shared])
7798
7799 AC_MSG_CHECKING([whether to build shared libraries])
7800 test "$can_build_shared" = "no" && enable_shared=no
7801
7802 # On AIX, shared libraries and static libraries use the same namespace, and
7803 # are all built from PIC.
7804 case "$host_os" in
7805 aix3*)
7806   test "$enable_shared" = yes && enable_static=no
7807   if test -n "$RANLIB"; then
7808     archive_cmds="$archive_cmds~\$RANLIB \$lib"
7809     postinstall_cmds='$RANLIB $lib'
7810   fi
7811   ;;
7812
7813 aix4*)
7814   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7815     test "$enable_shared" = yes && enable_static=no
7816   fi
7817   ;;
7818 esac
7819 AC_MSG_RESULT([$enable_shared])
7820
7821 AC_MSG_CHECKING([whether to build static libraries])
7822 # Make sure either enable_shared or enable_static is yes.
7823 test "$enable_shared" = yes || enable_static=yes
7824 AC_MSG_RESULT([$enable_static])
7825
7826 AC_LIBTOOL_CONFIG($1)
7827
7828 AC_LANG_POP
7829 CC="$lt_save_CC"
7830 ])# AC_LIBTOOL_LANG_C_CONFIG
7831
7832
7833 # AC_LIBTOOL_LANG_CXX_CONFIG
7834 # --------------------------
7835 # Ensure that the configuration vars for the C compiler are
7836 # suitably defined.  Those variables are subsequently used by
7837 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
7838 AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
7839 AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
7840 [AC_LANG_PUSH(C++)
7841 AC_REQUIRE([AC_PROG_CXX])
7842 AC_REQUIRE([AC_PROG_CXXCPP])
7843
7844 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
7845 _LT_AC_TAGVAR(allow_undefined_flag, $1)=
7846 _LT_AC_TAGVAR(always_export_symbols, $1)=no
7847 _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
7848 _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
7849 _LT_AC_TAGVAR(hardcode_direct, $1)=no
7850 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
7851 _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
7852 _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
7853 _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
7854 _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7855 _LT_AC_TAGVAR(no_undefined_flag, $1)=
7856 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
7857
7858 # Dependencies to place before and after the object being linked:
7859 _LT_AC_TAGVAR(predep_objects, $1)=
7860 _LT_AC_TAGVAR(postdep_objects, $1)=
7861 _LT_AC_TAGVAR(predeps, $1)=
7862 _LT_AC_TAGVAR(postdeps, $1)=
7863 _LT_AC_TAGVAR(compiler_lib_search_path, $1)=
7864
7865 # Source file extension for C test sources.
7866 ac_ext=cc
7867
7868 # Object file extension for compiled C test sources.
7869 objext=o
7870 _LT_AC_TAGVAR(objext, $1)=$objext
7871
7872 # Code to be used in simple compile tests
7873 lt_simple_compile_test_code="int some_variable = 0;"
7874
7875 # Code to be used in simple link tests
7876 lt_simple_link_test_code='int main(int char *[]) { return(0); }'
7877
7878 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7879 _LT_AC_SYS_COMPILER
7880
7881 # Allow CC to be a program name with arguments.
7882 lt_save_CC="$CC"
7883 CC=${CXX-"c++"}
7884 set dummy $CC
7885 compiler="[$]2"
7886 _LT_AC_TAGVAR(compiler, $1)=$CC
7887 cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
7888
7889 # We don't want -fno-exception wen compiling C++ code, so set the
7890 # no_builtin_flag separately
7891 if test "$GXX" = yes; then
7892   _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
7893 else
7894   _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
7895 fi
7896
7897 if test "$GXX" = yes; then
7898   # Set up default GNU C++ configuration
7899
7900   # Check if GNU C++ uses GNU ld as the underlying linker, since the
7901   # archiving commands below assume that GNU ld is being used.
7902   if eval "`$CC -print-prog-name=ld` --version 2>&1" | \
7903       egrep 'GNU ld' > /dev/null; then
7904     with_gnu_ld=yes
7905
7906     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7907     _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
7908
7909     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
7910     _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7911
7912     # If archive_cmds runs LD, not CC, wlarc should be empty
7913     # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
7914     #     investigate it a little bit more. (MM)
7915     wlarc='${wl}'
7916
7917     # ancient GNU ld didn't support --whole-archive et. al.
7918     if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
7919         egrep 'no-whole-archive' > /dev/null; then
7920       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7921     else
7922       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
7923     fi
7924   else
7925     with_gnu_ld=no
7926     wlarc=
7927
7928     # A generic and very simple default shared library creation
7929     # command for GNU C++ for the case where it uses the native
7930     # linker, instead of GNU ld.  If possible, this setting should
7931     # overridden to take advantage of the native linker features on
7932     # the platform it is being used on.
7933     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7934   fi
7935
7936   # Commands to make compiler produce verbose output that lists
7937   # what "hidden" libraries, object files and flags are used when
7938   # linking a shared library.
7939   output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
7940
7941 else
7942   GXX=no
7943   with_gnu_ld=no
7944   wlarc=
7945 fi
7946
7947 # PORTME: fill in a description of your system's C++ link characteristics
7948 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
7949 _LT_AC_TAGVAR(ld_shlibs, $1)=yes
7950 case $host_os in
7951   aix3*)
7952     # FIXME: insert proper C++ library support
7953     _LT_AC_TAGVAR(ld_shlibs, $1)=no
7954     ;;
7955   aix4* | aix5*)
7956     if test "$host_cpu" = ia64; then
7957       # On IA64, the linker does run time linking by default, so we don't
7958       # have to do anything special.
7959       aix_use_runtimelinking=no
7960       exp_sym_flag='-Bexport'
7961       no_entry_flag=""
7962     else
7963       # KDE requires run time linking.  Make it the default.
7964       aix_use_runtimelinking=yes
7965       exp_sym_flag='-bexport'
7966       no_entry_flag='-bnoentry'
7967     fi
7968
7969     # When large executables or shared objects are built, AIX ld can
7970     # have problems creating the table of contents.  If linking a library
7971     # or program results in "error TOC overflow" add -mminimal-toc to
7972     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
7973     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7974
7975     _LT_AC_TAGVAR(archive_cmds, $1)=''
7976     _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7977     _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
7978     _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
7979
7980     if test "$GXX" = yes; then
7981       case $host_os in aix4.[012]|aix4.[012].*)
7982       # We only want to do this on AIX 4.2 and lower, the check
7983       # below for broken collect2 doesn't work under 4.3+
7984         collect2name=`${CC} -print-prog-name=collect2`
7985         if test -f "$collect2name" && \
7986            strings "$collect2name" | grep resolve_lib_name >/dev/null
7987         then
7988           # We have reworked collect2
7989           _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7990         else
7991           # We have old collect2
7992           _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
7993           # It fails to find uninstalled libraries when the uninstalled
7994           # path is not listed in the libpath.  Setting hardcode_minus_L
7995           # to unsupported forces relinking
7996           _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7997           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7998           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
7999         fi
8000       esac
8001       shared_flag='-shared'
8002     else
8003       # not using gcc
8004       if test "$host_cpu" = ia64; then
8005         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
8006         # chokes on -Wl,-G. The following line is correct:
8007         shared_flag='-G'
8008       else
8009         if test "$aix_use_runtimelinking" = yes; then
8010           shared_flag='-qmkshrobj ${wl}-G'
8011         else
8012           shared_flag='-qmkshrobj'
8013         fi
8014       fi
8015     fi
8016
8017     # Let the compiler handle the export list.
8018     _LT_AC_TAGVAR(always_export_symbols, $1)=no
8019     if test "$aix_use_runtimelinking" = yes; then
8020       # Warning - without using the other runtime loading flags (-brtl),
8021       # -berok will link without error, but may produce a broken library.
8022       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
8023       # Determine the default libpath from the value encoded in an empty executable.
8024       _LT_AC_SYS_LIBPATH_AIX
8025       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
8026
8027       _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
8028       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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}$exp_sym_flag:\$export_symbols $shared_flag"
8029      else
8030       if test "$host_cpu" = ia64; then
8031         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
8032         _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
8033         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
8034       else
8035         # Determine the default libpath from the value encoded in an empty executable.
8036         _LT_AC_SYS_LIBPATH_AIX
8037         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
8038         # Warning - without using the other run time loading flags,
8039         # -berok will link without error, but may produce a broken library.
8040         _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
8041         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
8042         # -bexpall does not export symbols beginning with underscore (_)
8043         _LT_AC_TAGVAR(always_export_symbols, $1)=yes
8044         # Exported symbols can be pulled into shared objects from archives
8045         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
8046         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
8047         # This is similar to how AIX traditionally builds it's shared libraries.
8048         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
8049       fi
8050     fi
8051     ;;
8052   chorus*)
8053     case $cc_basename in
8054       *)
8055         # FIXME: insert proper C++ library support
8056         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8057         ;;
8058     esac
8059     ;;
8060   dgux*)
8061     case $cc_basename in
8062       ec++)
8063         # FIXME: insert proper C++ library support
8064         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8065         ;;
8066       ghcx)
8067         # Green Hills C++ Compiler
8068         # FIXME: insert proper C++ library support
8069         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8070         ;;
8071       *)
8072         # FIXME: insert proper C++ library support
8073         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8074         ;;
8075     esac
8076     ;;
8077   freebsd[12]*)
8078     # C++ shared libraries reported to be fairly broken before switch to ELF
8079     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8080     ;;
8081   freebsd-elf*)
8082     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8083     ;;
8084   freebsd*)
8085     # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
8086     # conventions
8087     _LT_AC_TAGVAR(ld_shlibs, $1)=yes
8088     ;;
8089   gnu*)
8090     ;;
8091   hpux*)
8092     if test $with_gnu_ld = no; then
8093       if test "$host_cpu" = ia64; then
8094         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8095       else
8096         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
8097         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8098         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8099       fi
8100     fi
8101     if test "$host_cpu" = ia64; then
8102       _LT_AC_TAGVAR(hardcode_direct, $1)=no
8103       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8104     else
8105       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8106     fi
8107     _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
8108                                             # but as the default
8109                                             # location of the library.
8110
8111     case $cc_basename in
8112       CC)
8113         # FIXME: insert proper C++ library support
8114         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8115         ;;
8116       aCC)
8117         case $host_os in
8118         hpux9*)
8119           _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
8120           ;;
8121         *)
8122           if test "$host_cpu" = ia64; then
8123             _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
8124           else
8125             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8126           fi
8127           ;;
8128         esac
8129         # Commands to make compiler produce verbose output that lists
8130         # what "hidden" libraries, object files and flags are used when
8131         # linking a shared library.
8132         #
8133         # There doesn't appear to be a way to prevent this compiler from
8134         # explicitly linking system object files so we need to strip them
8135         # from the output so that they don't get included in the library
8136         # dependencies.
8137         output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
8138         ;;
8139       *)
8140         if test "$GXX" = yes; then
8141           if test $with_gnu_ld = no; then
8142             case $host_os in
8143             hpux9*)
8144               _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
8145               ;;
8146             *)
8147               if test "$host_cpu" = ia64; then
8148                 _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
8149               else
8150                 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8151               fi
8152               ;;
8153             esac
8154           fi
8155         else
8156           # FIXME: insert proper C++ library support
8157           _LT_AC_TAGVAR(ld_shlibs, $1)=no
8158         fi
8159         ;;
8160     esac
8161     ;;
8162   irix5* | irix6*)
8163     case $cc_basename in
8164       CC)
8165         # SGI C++
8166         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
8167
8168         # Archives containing C++ object files must be created using
8169         # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
8170         # necessary to make sure instantiated templates are included
8171         # in the archive.
8172         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
8173         ;;
8174       *)
8175         if test "$GXX" = yes; then
8176           if test "$with_gnu_ld" = no; then
8177             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
8178           else
8179             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
8180           fi
8181         fi
8182         _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8183         ;;
8184     esac
8185     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8186     _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8187     ;;
8188   linux*)
8189     case $cc_basename in
8190       KCC)
8191         # Kuck and Associates, Inc. (KAI) C++ Compiler
8192
8193         # KCC will only create a shared library if the output file
8194         # ends with ".so" (or ".sl" for HP-UX), so rename the library
8195         # to its proper name (with version) after linking.
8196         _LT_AC_TAGVAR(archive_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
8197         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
8198
8199         # Commands to make compiler produce verbose output that lists
8200         # what "hidden" libraries, object files and flags are used when
8201         # linking a shared library.
8202         #
8203         # There doesn't appear to be a way to prevent this compiler from
8204         # explicitly linking system object files so we need to strip them
8205         # from the output so that they don't get included in the library
8206         # dependencies.
8207         output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest.so 2>&1 | egrep "ld"`; rm -f libconftest.so; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
8208
8209         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
8210         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
8211
8212         # Archives containing C++ object files must be created using
8213         # "CC -Bstatic", where "CC" is the KAI C++ compiler.
8214         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
8215         ;;
8216       cxx)
8217         # Compaq C++
8218         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
8219         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
8220
8221         runpath_var=LD_RUN_PATH
8222         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
8223         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8224
8225         # Commands to make compiler produce verbose output that lists
8226         # what "hidden" libraries, object files and flags are used when
8227         # linking a shared library.
8228         #
8229         # There doesn't appear to be a way to prevent this compiler from
8230         # explicitly linking system object files so we need to strip them
8231         # from the output so that they don't get included in the library
8232         # dependencies.
8233         output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
8234         ;;
8235     esac
8236     ;;
8237   lynxos*)
8238     # FIXME: insert proper C++ library support
8239     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8240     ;;
8241   m88k*)
8242     # FIXME: insert proper C++ library support
8243     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8244     ;;
8245   mvs*)
8246     case $cc_basename in
8247       cxx)
8248         # FIXME: insert proper C++ library support
8249         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8250         ;;
8251       *)
8252         # FIXME: insert proper C++ library support
8253         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8254         ;;
8255     esac
8256     ;;
8257   netbsd*)
8258     # NetBSD uses g++ - do we need to do anything?
8259     ;;
8260   osf3*)
8261     case $cc_basename in
8262       KCC)
8263         # Kuck and Associates, Inc. (KAI) C++ Compiler
8264
8265         # KCC will only create a shared library if the output file
8266         # ends with ".so" (or ".sl" for HP-UX), so rename the library
8267         # to its proper name (with version) after linking.
8268         _LT_AC_TAGVAR(archive_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
8269
8270         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8271         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8272
8273         # Archives containing C++ object files must be created using
8274         # "CC -Bstatic", where "CC" is the KAI C++ compiler.
8275         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
8276
8277         ;;
8278       RCC)
8279         # Rational C++ 2.4.1
8280         # FIXME: insert proper C++ library support
8281         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8282         ;;
8283       cxx)
8284         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8285         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
8286
8287         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8288         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8289
8290         # Commands to make compiler produce verbose output that lists
8291         # what "hidden" libraries, object files and flags are used when
8292         # linking a shared library.
8293         #
8294         # There doesn't appear to be a way to prevent this compiler from
8295         # explicitly linking system object files so we need to strip them
8296         # from the output so that they don't get included in the library
8297         # dependencies.
8298         output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
8299         ;;
8300       *)
8301         if test "$GXX" = yes && test "$with_gnu_ld" = no; then
8302           _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8303           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
8304
8305           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8306           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8307
8308           # Commands to make compiler produce verbose output that lists
8309           # what "hidden" libraries, object files and flags are used when
8310           # linking a shared library.
8311           output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
8312
8313         else
8314           # FIXME: insert proper C++ library support
8315           _LT_AC_TAGVAR(ld_shlibs, $1)=no
8316         fi
8317         ;;
8318     esac
8319     ;;
8320   osf4* | osf5*)
8321     case $cc_basename in
8322       KCC)
8323         # Kuck and Associates, Inc. (KAI) C++ Compiler
8324
8325         # KCC will only create a shared library if the output file
8326         # ends with ".so" (or ".sl" for HP-UX), so rename the library
8327         # to its proper name (with version) after linking.
8328         _LT_AC_TAGVAR(archive_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
8329
8330         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8331         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8332
8333         # Archives containing C++ object files must be created using
8334         # the KAI C++ compiler.
8335         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
8336         ;;
8337       RCC)
8338         # Rational C++ 2.4.1
8339         # FIXME: insert proper C++ library support
8340         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8341         ;;
8342       cxx)
8343         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
8344         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
8345         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done~
8346           echo "-hidden">> $lib.exp~
8347           $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~
8348           $rm $lib.exp'
8349
8350         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
8351         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8352
8353         # Commands to make compiler produce verbose output that lists
8354         # what "hidden" libraries, object files and flags are used when
8355         # linking a shared library.
8356         #
8357         # There doesn't appear to be a way to prevent this compiler from
8358         # explicitly linking system object files so we need to strip them
8359         # from the output so that they don't get included in the library
8360         # dependencies.
8361         output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
8362         ;;
8363       *)
8364         if test "$GXX" = yes && test "$with_gnu_ld" = no; then
8365           _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8366          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
8367
8368           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8369           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8370
8371           # Commands to make compiler produce verbose output that lists
8372           # what "hidden" libraries, object files and flags are used when
8373           # linking a shared library.
8374           output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
8375
8376         else
8377           # FIXME: insert proper C++ library support
8378           _LT_AC_TAGVAR(ld_shlibs, $1)=no
8379         fi
8380         ;;
8381     esac
8382     ;;
8383   psos*)
8384     # FIXME: insert proper C++ library support
8385     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8386     ;;
8387   sco*)
8388     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8389     case $cc_basename in
8390       CC)
8391         # FIXME: insert proper C++ library support
8392         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8393         ;;
8394       *)
8395         # FIXME: insert proper C++ library support
8396         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8397         ;;
8398     esac
8399     ;;
8400   sunos4*)
8401     case $cc_basename in
8402       CC)
8403         # Sun C++ 4.x
8404         # FIXME: insert proper C++ library support
8405         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8406         ;;
8407       lcc)
8408         # Lucid
8409         # FIXME: insert proper C++ library support
8410         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8411         ;;
8412       *)
8413         # FIXME: insert proper C++ library support
8414         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8415         ;;
8416     esac
8417     ;;
8418   solaris*)
8419     case $cc_basename in
8420       CC)
8421         # Sun C++ 4.2, 5.x and Centerline C++
8422         _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
8423         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8424         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
8425         $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
8426
8427         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8428         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8429         case $host_os in
8430           solaris2.[0-5] | solaris2.[0-5].*) ;;
8431           *)
8432             # The C++ compiler is used as linker so we must use $wl
8433             # flag to pass the commands to the underlying system
8434             # linker.
8435             # Supported since Solaris 2.6 (maybe 2.5.1?)
8436             _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
8437             ;;
8438         esac
8439         _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8440
8441         # Commands to make compiler produce verbose output that lists
8442         # what "hidden" libraries, object files and flags are used when
8443         # linking a shared library.
8444         #
8445         # There doesn't appear to be a way to prevent this compiler from
8446         # explicitly linking system object files so we need to strip them
8447         # from the output so that they don't get included in the library
8448         # dependencies.
8449         output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep "\-R|\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
8450
8451         # Archives containing C++ object files must be created using
8452         # "CC -xar", where "CC" is the Sun C++ compiler.  This is
8453         # necessary to make sure instantiated templates are included
8454         # in the archive.
8455         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
8456         ;;
8457       gcx)
8458         # Green Hills C++ Compiler
8459         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
8460
8461         # The C++ compiler must be used to create the archive.
8462         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
8463         ;;
8464       *)
8465         # GNU C++ compiler with Solaris linker
8466         if test "$GXX" = yes && test "$with_gnu_ld" = no; then
8467           _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
8468           if $CC --version | egrep -v '^2\.7' > /dev/null; then
8469             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
8470             _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
8471                 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
8472
8473             # Commands to make compiler produce verbose output that lists
8474             # what "hidden" libraries, object files and flags are used when
8475             # linking a shared library.
8476             output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
8477           else
8478             # g++ 2.7 appears to require `-G' NOT `-shared' on this
8479             # platform.
8480             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
8481             _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
8482                 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
8483
8484             # Commands to make compiler produce verbose output that lists
8485             # what "hidden" libraries, object files and flags are used when
8486             # linking a shared library.
8487             output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
8488           fi
8489
8490           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
8491         fi
8492         ;;
8493     esac
8494     ;;
8495   sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
8496     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8497     ;;
8498   tandem*)
8499     case $cc_basename in
8500       NCC)
8501         # NonStop-UX NCC 3.20
8502         # FIXME: insert proper C++ library support
8503         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8504         ;;
8505       *)
8506         # FIXME: insert proper C++ library support
8507         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8508         ;;
8509     esac
8510     ;;
8511   vxworks*)
8512     # FIXME: insert proper C++ library support
8513     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8514     ;;
8515   *)
8516     # FIXME: insert proper C++ library support
8517     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8518     ;;
8519 esac
8520 AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
8521 test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
8522
8523 # Figure out "hidden" C++ library dependencies from verbose
8524 # compiler output whening linking a shared library.
8525 cat > conftest.$ac_ext <<EOF
8526 class Foo
8527 {
8528 public:
8529   Foo (void) { a = 0; }
8530 private:
8531   int a;
8532 };
8533 EOF
8534
8535
8536 if AC_TRY_EVAL(ac_compile); then
8537   # Parse the compiler output and extract the necessary
8538   # objects, libraries and library flags.
8539
8540   # Sentinel used to keep track of whether or not we are before
8541   # the conftest object file.
8542   pre_test_object_deps_done=no
8543
8544   # The `*' in the case matches for architectures that use `case' in
8545   # $output_verbose_cmd can trigger glob expansion during the loop
8546   # eval without this substitution.
8547   output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
8548
8549   for p in `eval $output_verbose_link_cmd`; do
8550     case $p in
8551
8552     -L* | -R* | -l*)
8553        # Some compilers place space between "-{L,R}" and the path.
8554        # Remove the space.
8555        if test $p = "-L" \
8556           || test $p = "-R"; then
8557          prev=$p
8558          continue
8559        else
8560          prev=
8561        fi
8562
8563        if test "$pre_test_object_deps_done" = no; then
8564          case $p in
8565          -L* | -R*)
8566            # Internal compiler library paths should come after those
8567            # provided the user.  The postdeps already come after the
8568            # user supplied libs so there is no need to process them.
8569            if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
8570              _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
8571            else
8572              _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
8573            fi
8574            ;;
8575          # The "-l" case would never come before the object being
8576          # linked, so don't bother handling this case.
8577          esac
8578        else
8579          if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
8580            _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
8581          else
8582            _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
8583          fi
8584        fi
8585        ;;
8586
8587     *.$objext|*.$libext)
8588        # This assumes that the test object file only shows up
8589        # once in the compiler output.
8590        if test "$p" = "conftest.$objext"; then
8591          pre_test_object_deps_done=yes
8592          continue
8593        fi
8594
8595        if test "$pre_test_object_deps_done" = no; then
8596          if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
8597            _LT_AC_TAGVAR(predep_objects, $1)="$p"
8598          else
8599            _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
8600          fi
8601        else
8602          if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
8603            _LT_AC_TAGVAR(postdep_objects, $1)="$p"
8604          else
8605            _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
8606          fi
8607        fi
8608        ;;
8609
8610     *) ;; # Ignore the rest.
8611
8612     esac
8613   done
8614
8615   # Clean up.
8616   rm -f a.out
8617 else
8618   echo "libtool.m4: error: problem compiling C++ test program"
8619 fi
8620
8621 $rm -f confest.$objext
8622
8623 case " $_LT_AC_TAGVAR(postdeps, $1) " in
8624 *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
8625 *) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes ;;
8626 esac
8627
8628 _LT_AC_TAGVAR(GCC, $1)="$GXX"
8629 _LT_AC_TAGVAR(LD, $1)="$LD"
8630
8631 AC_LIBTOOL_PROG_COMPILER_PIC($1)
8632 AC_LIBTOOL_PROG_CC_C_O($1)
8633 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
8634 AC_LIBTOOL_PROG_LD_SHLIBS($1)
8635 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
8636 AC_LIBTOOL_SYS_LIB_STRIP
8637 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
8638 AC_LIBTOOL_DLOPEN_SELF($1)
8639
8640 AC_LIBTOOL_CONFIG($1)
8641
8642 AC_LANG_POP
8643 CC="$lt_save_CC"
8644 ])# AC_LIBTOOL_LANG_CXX_CONFIG
8645
8646
8647 # AC_LIBTOOL_LANG_GCJ_CONFIG
8648 # --------------------------
8649 # Ensure that the configuration vars for the C compiler are
8650 # suitably defined.  Those variables are subsequently used by
8651 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
8652 AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
8653 AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
8654 [AC_LANG_SAVE
8655
8656 # Source file extension for C test sources.
8657 ac_ext=java
8658
8659 # Object file extension for compiled C test sources.
8660 objext=o
8661 _LT_AC_TAGVAR(objext, $1)=$objext
8662
8663 # Code to be used in simple compile tests
8664 lt_simple_compile_test_code="class foo {}"
8665
8666 # Code to be used in simple link tests
8667 lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
8668
8669 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8670 _LT_AC_SYS_COMPILER
8671
8672 # Allow CC to be a program name with arguments.
8673 lt_save_CC="$CC"
8674 CC=${GCJ-"gcj"}
8675 set dummy $CC
8676 compiler="[$]2"
8677 _LT_AC_TAGVAR(compiler, $1)=$CC
8678
8679 # GCJ did not exist at the time GCC didn't implicitly link libc in.
8680 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8681
8682 AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
8683 AC_LIBTOOL_PROG_COMPILER_PIC($1)
8684 AC_LIBTOOL_PROG_CC_C_O($1)
8685 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
8686 AC_LIBTOOL_PROG_LD_SHLIBS($1)
8687 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
8688 AC_LIBTOOL_SYS_LIB_STRIP
8689 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
8690 AC_LIBTOOL_DLOPEN_SELF($1)
8691
8692 AC_LIBTOOL_CONFIG($1)
8693
8694 AC_LANG_RESTORE
8695 CC="$lt_save_CC"
8696 ])# AC_LIBTOOL_LANG_GCJ_CONFIG
8697
8698
8699 # AC_LIBTOOL_LANG_RC_CONFIG
8700 # --------------------------
8701 # Ensure that the configuration vars for the Windows resource compiler are
8702 # suitably defined.  Those variables are subsequently used by
8703 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
8704 AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
8705 AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
8706 [AC_LANG_SAVE
8707
8708 # Source file extension for RC test sources.
8709 ac_ext=rc
8710
8711 # Object file extension for compiled RC test sources.
8712 objext=o
8713 _LT_AC_TAGVAR(objext, $1)=$objext
8714
8715 # Code to be used in simple compile tests
8716 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8717
8718 # Code to be used in simple link tests
8719 lt_simple_link_test_code="$lt_simple_compile_test_code"
8720
8721 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8722 _LT_AC_SYS_COMPILER
8723
8724 # Allow CC to be a program name with arguments.
8725 lt_save_CC="$CC"
8726 CC=${RC-"windres"}
8727 set dummy $CC
8728 compiler="[$]2"
8729 _LT_AC_TAGVAR(compiler, $1)=$CC
8730 _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8731
8732 AC_LIBTOOL_CONFIG($1)
8733
8734 AC_LANG_RESTORE
8735 CC="$lt_save_CC"
8736 ])# AC_LIBTOOL_LANG_RC_CONFIG
8737
8738
8739 # AC_LIBTOOL_CONFIG([TAGNAME])
8740 # ----------------------------
8741 # If TAGNAME is not passed, then create an initial libtool script
8742 # with a default configuration from the untagged config vars.  Otherwise
8743 # add code to config.status for appending the configuration named by
8744 # TAGNAME from the matching tagged config vars.
8745 AC_DEFUN([AC_LIBTOOL_CONFIG],
8746 [# The else clause should only fire when bootstrapping the
8747 # libtool distribution, otherwise you forgot to ship ltmain.sh
8748 # with your package, and you will get complaints that there are
8749 # no rules to generate ltmain.sh.
8750 if test -f "$ltmain"; then
8751   # Now quote all the things that may contain metacharacters while being
8752   # careful not to overquote the AC_SUBSTed values.  We take copies of the
8753   # variables and quote the copies for generation of the libtool script.
8754   for var in echo old_CC old_CFLAGS AR AR_FLAGS RANLIB LN_S LTCC NM SED SHELL \
8755     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
8756     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
8757     deplibs_check_method reload_flag reload_cmds need_locks \
8758     lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
8759     lt_cv_sys_global_symbol_to_c_name_address \
8760     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
8761     old_postinstall_cmds old_postuninstall_cmds \
8762     _LT_AC_TAGVAR(compiler, $1) \
8763     _LT_AC_TAGVAR(CC, $1) \
8764     _LT_AC_TAGVAR(LD, $1) \
8765     _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
8766     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
8767     _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
8768     _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
8769     _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
8770     _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
8771     _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
8772     _LT_AC_TAGVAR(old_archive_cmds, $1) \
8773     _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
8774     _LT_AC_TAGVAR(predep_objects, $1) \
8775     _LT_AC_TAGVAR(postdep_objects, $1) \
8776     _LT_AC_TAGVAR(predeps, $1) \
8777     _LT_AC_TAGVAR(postdeps, $1) \
8778     _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
8779     _LT_AC_TAGVAR(archive_cmds, $1) \
8780     _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
8781     _LT_AC_TAGVAR(postinstall_cmds, $1) \
8782     _LT_AC_TAGVAR(postuninstall_cmds, $1) \
8783     _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
8784     _LT_AC_TAGVAR(allow_undefined_flag, $1) \
8785     _LT_AC_TAGVAR(no_undefined_flag, $1) \
8786     _LT_AC_TAGVAR(export_symbols_cmds, $1) \
8787     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
8788     _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
8789     _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
8790     _LT_AC_TAGVAR(exclude_expsyms, $1) \
8791     _LT_AC_TAGVAR(include_expsyms, $1); do
8792
8793     case $var in
8794     _LT_AC_TAGVAR(old_archive_cmds, $1) | \
8795     _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
8796     _LT_AC_TAGVAR(archive_cmds, $1) | \
8797     _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
8798     _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
8799     _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
8800     extract_expsyms_cmds | reload_cmds | finish_cmds | \
8801     postinstall_cmds | postuninstall_cmds | \
8802     old_postinstall_cmds | old_postuninstall_cmds | \
8803     sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
8804       # Double-quote double-evaled strings.
8805       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
8806       ;;
8807     *)
8808       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
8809       ;;
8810     esac
8811   done
8812
8813   case $lt_echo in
8814   *'\[$]0 --fallback-echo"')
8815     lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
8816     ;;
8817   esac
8818
8819 ifelse([$1], [],
8820   [cfgfile="${ofile}T"
8821   trap "$rm \"$cfgfile\"; exit 1" 1 2 15
8822   $rm -f "$cfgfile"
8823   AC_MSG_NOTICE([creating $ofile])],
8824   [cfgfile="$ofile"])
8825
8826   cat <<__EOF__ >> "$cfgfile"
8827 ifelse([$1], [],
8828 [#! $SHELL
8829
8830 # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
8831 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
8832 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
8833 #
8834 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
8835 # Free Software Foundation, Inc.
8836 #
8837 # This file is part of GNU Libtool:
8838 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8839 #
8840 # This program is free software; you can redistribute it and/or modify
8841 # it under the terms of the GNU General Public License as published by
8842 # the Free Software Foundation; either version 2 of the License, or
8843 # (at your option) any later version.
8844 #
8845 # This program is distributed in the hope that it will be useful, but
8846 # WITHOUT ANY WARRANTY; without even the implied warranty of
8847 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8848 # General Public License for more details.
8849 #
8850 # You should have received a copy of the GNU General Public License
8851 # along with this program; if not, write to the Free Software
8852 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
8853 #
8854 # As a special exception to the GNU General Public License, if you
8855 # distribute this file as part of a program that contains a
8856 # configuration script generated by Autoconf, you may include it under
8857 # the same distribution terms that you use for the rest of that program.
8858
8859 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
8860 Xsed="sed -e s/^X//"
8861
8862 # The HP-UX ksh and POSIX shell print the target directory to stdout
8863 # if CDPATH is set.
8864 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
8865
8866 # The names of the tagged configurations supported by this script.
8867 available_tags=
8868
8869 # ### BEGIN LIBTOOL CONFIG],
8870 [# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
8871
8872 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
8873
8874 # Shell to use when invoking shell scripts.
8875 SHELL=$lt_SHELL
8876
8877 # Whether or not to build shared libraries.
8878 build_libtool_libs=$enable_shared
8879
8880 # Whether or not to build static libraries.
8881 build_old_libs=$enable_static
8882
8883 # Whether or not to add -lc for building shared libraries.
8884 build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
8885
8886 # Whether or not to optimize for fast installation.
8887 fast_install=$enable_fast_install
8888
8889 # The host system.
8890 host_alias=$host_alias
8891 host=$host
8892
8893 # An echo program that does not interpret backslashes.
8894 echo=$lt_echo
8895
8896 # The archiver.
8897 AR=$lt_AR
8898 AR_FLAGS=$lt_AR_FLAGS
8899
8900 # A C compiler.
8901 LTCC=$lt_LTCC
8902
8903 # A language-specific compiler.
8904 CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
8905
8906 # Is the compiler the GNU C compiler?
8907 with_gcc=$_LT_AC_TAGVAR(GCC, $1)
8908
8909 # The linker used to build libraries.
8910 LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
8911
8912 # Whether we need hard or soft links.
8913 LN_S=$lt_LN_S
8914
8915 # A BSD-compatible nm program.
8916 NM=$lt_NM
8917
8918 # A sed program that does not truncate output.
8919 SED=$lt_SED
8920
8921 # A symbol stripping program
8922 STRIP=$STRIP
8923
8924 # Used to examine libraries when file_magic_cmd begins "file"
8925 MAGIC_CMD=$MAGIC_CMD
8926
8927 # Used on cygwin: DLL creation program.
8928 DLLTOOL="$DLLTOOL"
8929
8930 # Used on cygwin: object dumper.
8931 OBJDUMP="$OBJDUMP"
8932
8933 # Used on cygwin: assembler.
8934 AS="$AS"
8935
8936 # The name of the directory that contains temporary libtool files.
8937 objdir=$objdir
8938
8939 # How to create reloadable object files.
8940 reload_flag=$lt_reload_flag
8941 reload_cmds=$lt_reload_cmds
8942
8943 # How to pass a linker flag through the compiler.
8944 wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
8945
8946 # Object file suffix (normally "o").
8947 objext="$ac_objext"
8948
8949 # Old archive suffix (normally "a").
8950 libext="$libext"
8951
8952 # Executable file suffix (normally "").
8953 exeext="$exeext"
8954
8955 # Additional compiler flags for building library objects.
8956 pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
8957 pic_mode=$pic_mode
8958
8959 # What is the maximum length of a command?
8960 max_cmd_len=$lt_cv_sys_max_cmd_len
8961
8962 # Does compiler simultaneously support -c and -o options?
8963 compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
8964
8965 # Must we lock files when doing compilation ?
8966 need_locks=$lt_need_locks
8967
8968 # Do we need the lib prefix for modules?
8969 need_lib_prefix=$need_lib_prefix
8970
8971 # Do we need a version for libraries?
8972 need_version=$need_version
8973
8974 # Whether dlopen is supported.
8975 dlopen_support=$enable_dlopen
8976
8977 # Whether dlopen of programs is supported.
8978 dlopen_self=$enable_dlopen_self
8979
8980 # Whether dlopen of statically linked programs is supported.
8981 dlopen_self_static=$enable_dlopen_self_static
8982
8983 # Compiler flag to prevent dynamic linking.
8984 link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
8985
8986 # Compiler flag to turn off builtin functions.
8987 no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
8988
8989 # Compiler flag to allow reflexive dlopens.
8990 export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
8991
8992 # Compiler flag to generate shared objects directly from archives.
8993 whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
8994
8995 # Compiler flag to generate thread-safe objects.
8996 thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
8997
8998 # Library versioning type.
8999 version_type=$version_type
9000
9001 # Format of library name prefix.
9002 libname_spec=$lt_libname_spec
9003
9004 # List of archive names.  First name is the real one, the rest are links.
9005 # The last name is the one that the linker finds with -lNAME.
9006 library_names_spec=$lt_library_names_spec
9007
9008 # The coded name of the library, if different from the real name.
9009 soname_spec=$lt_soname_spec
9010
9011 # Commands used to build and install an old-style archive.
9012 RANLIB=$lt_RANLIB
9013 old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
9014 old_postinstall_cmds=$lt_old_postinstall_cmds
9015 old_postuninstall_cmds=$lt_old_postuninstall_cmds
9016
9017 # Create an old-style archive from a shared archive.
9018 old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
9019
9020 # Create a temporary old-style archive to link instead of a shared archive.
9021 old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
9022
9023 # Commands used to build and install a shared archive.
9024 archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
9025 archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
9026 postinstall_cmds=$lt_postinstall_cmds
9027 postuninstall_cmds=$lt_postuninstall_cmds
9028
9029 # Commands to strip libraries.
9030 old_striplib=$lt_old_striplib
9031 striplib=$lt_striplib
9032
9033 # Dependencies to place before the objects being linked to create a
9034 # shared library.
9035 predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
9036
9037 # Dependencies to place after the objects being linked to create a
9038 # shared library.
9039 postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
9040
9041 # Dependencies to place before the objects being linked to create a
9042 # shared library.
9043 predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
9044
9045 # Dependencies to place after the objects being linked to create a
9046 # shared library.
9047 postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
9048
9049 # The library search path used internally by the compiler when linking
9050 # a shared library.
9051 compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
9052
9053 # Method to check whether dependent libraries are shared objects.
9054 deplibs_check_method=$lt_deplibs_check_method
9055
9056 # Command to use when deplibs_check_method == file_magic.
9057 file_magic_cmd=$lt_file_magic_cmd
9058
9059 # Flag that allows shared libraries with undefined symbols to be built.
9060 allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
9061
9062 # Flag that forces no undefined symbols.
9063 no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
9064
9065 # Commands used to finish a libtool library installation in a directory.
9066 finish_cmds=$lt_finish_cmds
9067
9068 # Same as above, but a single script fragment to be evaled but not shown.
9069 finish_eval=$lt_finish_eval
9070
9071 # Take the output of nm and produce a listing of raw symbols and C names.
9072 global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
9073
9074 # Transform the output of nm in a proper C declaration
9075 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
9076
9077 # Transform the output of nm in a C name address pair
9078 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
9079
9080 # This is the shared library runtime path variable.
9081 runpath_var=$runpath_var
9082
9083 # This is the shared library path variable.
9084 shlibpath_var=$shlibpath_var
9085
9086 # Is shlibpath searched before the hard-coded library search path?
9087 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
9088
9089 # How to hardcode a shared library path into an executable.
9090 hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
9091
9092 # Whether we should hardcode library paths into libraries.
9093 hardcode_into_libs=$hardcode_into_libs
9094
9095 # Flag to hardcode \$libdir into a binary during linking.
9096 # This must work even if \$libdir does not exist.
9097 hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
9098
9099 # Whether we need a single -rpath flag with a separated argument.
9100 hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
9101
9102 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
9103 # resulting binary.
9104 hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
9105
9106 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
9107 # resulting binary.
9108 hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
9109
9110 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
9111 # the resulting binary.
9112 hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
9113
9114 # Variables whose values should be saved in libtool wrapper scripts and
9115 # restored at relink time.
9116 variables_saved_for_relink="$variables_saved_for_relink"
9117
9118 # Whether libtool must link a program against all its dependency libraries.
9119 link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
9120
9121 # Compile-time system search path for libraries
9122 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
9123
9124 # Run-time system search path for libraries
9125 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
9126
9127 # Fix the shell variable \$srcfile for the compiler.
9128 fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
9129
9130 # Set to yes if exported symbols are required.
9131 always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
9132
9133 # The commands to list exported symbols.
9134 export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
9135
9136 # The commands to extract the exported symbol list from a shared archive.
9137 extract_expsyms_cmds=$lt_extract_expsyms_cmds
9138
9139 # Symbols that should not be listed in the preloaded symbols.
9140 exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
9141
9142 # Symbols that must always be exported.
9143 include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
9144
9145 ifelse([$1],[],
9146 [# ### END LIBTOOL CONFIG],
9147 [# ### END LIBTOOL TAG CONFIG: $tagname])
9148
9149 __EOF__
9150
9151 ifelse([$1],[], [
9152   case $host_os in
9153   aix3*)
9154     cat <<\EOF >> "$cfgfile"
9155
9156 # AIX sometimes has problems with the GCC collect2 program.  For some
9157 # reason, if we set the COLLECT_NAMES environment variable, the problems
9158 # vanish in a puff of smoke.
9159 if test "X${COLLECT_NAMES+set}" != Xset; then
9160   COLLECT_NAMES=
9161   export COLLECT_NAMES
9162 fi
9163 EOF
9164     ;;
9165
9166   cygwin* | mingw* | pw32* | os2*)
9167     cat <<'EOF' >> "$cfgfile"
9168     # This is a source program that is used to create dlls on Windows
9169     # Don't remove nor modify the starting and closing comments
9170     _LT_AC_FILE_LTDLL_C
9171     # This is a source program that is used to create import libraries
9172     # on Windows for dlls which lack them. Don't remove nor modify the
9173     # starting and closing comments
9174     _LT_AC_FILE_IMPGEN_C
9175 EOF
9176     ;;
9177   esac
9178
9179   # We use sed instead of cat because bash on DJGPP gets confused if
9180   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
9181   # text mode, it properly converts lines to CR/LF.  This bash problem
9182   # is reportedly fixed, but why not run on old versions too?
9183   sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
9184
9185   mv -f "$cfgfile" "$ofile" || \
9186     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
9187   chmod +x "$ofile"
9188 ])
9189 else
9190   # If there is no Makefile yet, we rely on a make rule to execute
9191   # `config.status --recheck' to rerun these tests and create the
9192   # libtool script then.
9193   test -f Makefile && make "$ltmain"
9194 fi
9195 ])# AC_LIBTOOL_CONFIG
9196
9197
9198 # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
9199 # -------------------------------------------
9200 AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
9201 [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
9202
9203 _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
9204
9205 if test "$GCC" = yes; then
9206   _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
9207
9208   AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
9209     lt_cv_prog_compiler_rtti_exceptions,
9210     [-fno-rtti -fno-exceptions -c conftest.$ac_ext], [],
9211     [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
9212 fi
9213 ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
9214
9215
9216 # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
9217 # ---------------------------------
9218 AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
9219 [AC_REQUIRE([AC_CANONICAL_HOST])
9220 AC_REQUIRE([AC_PROG_NM])
9221 AC_REQUIRE([AC_OBJEXT])
9222 # Check for command to grab the raw symbol name followed by C symbol from nm.
9223 AC_MSG_CHECKING([command to parse $NM output from $compiler object])
9224 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
9225 [
9226 # These are sane defaults that work on at least a few old systems.
9227 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
9228
9229 # Character class describing NM global symbol codes.
9230 symcode='[[BCDEGRST]]'
9231
9232 # Regexp to match symbols that can be accessed directly from C.
9233 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
9234
9235 # Transform the above into a raw symbol and a C symbol.
9236 symxfrm='\1 \2\3 \3'
9237
9238 # Transform an extracted symbol line into a proper C declaration
9239 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
9240
9241 # Transform an extracted symbol line into symbol name and symbol address
9242 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
9243
9244 # Define system-specific variables.
9245 case $host_os in
9246 aix*)
9247   symcode='[[BCDT]]'
9248   ;;
9249 cygwin* | mingw* | pw32*)
9250   symcode='[[ABCDGISTW]]'
9251   ;;
9252 hpux*) # Its linker distinguishes data from code symbols
9253   if test "$host_cpu" = ia64; then
9254     symcode='[[ABCDEGRST]]'
9255   fi
9256   lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
9257   lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
9258   ;;
9259 irix* | nonstopux*)
9260   symcode='[[BCDEGRST]]'
9261   ;;
9262 solaris* | sysv5*)
9263   symcode='[[BDT]]'
9264   ;;
9265 sysv4)
9266   symcode='[[DFNSTU]]'
9267   ;;
9268 esac
9269
9270 # Handle CRLF in mingw tool chain
9271 opt_cr=
9272 case $host_os in
9273 mingw*)
9274   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
9275   ;;
9276 esac
9277
9278 # If we're using GNU nm, then use its standard symbol codes.
9279 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
9280   symcode='[[ABCDGISTW]]'
9281 fi
9282
9283 # Try without a prefix undercore, then with it.
9284 for ac_symprfx in "" "_"; do
9285
9286   # Write the raw and C identifiers.
9287   lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[      ]]\($symcode$symcode*\)[[       ]][[    ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
9288
9289   # Check to see that the pipe works correctly.
9290   pipe_works=no
9291
9292   rm -f conftest*
9293   cat > conftest.$ac_ext <<EOF
9294 #ifdef __cplusplus
9295 extern "C" {
9296 #endif
9297 char nm_test_var;
9298 void nm_test_func(){}
9299 #ifdef __cplusplus
9300 }
9301 #endif
9302 int main(){nm_test_var='a';nm_test_func();return(0);}
9303 EOF
9304
9305   if AC_TRY_EVAL(ac_compile); then
9306     # Now try to grab the symbols.
9307     nlist=conftest.nm
9308     if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
9309       # Try sorting and uniquifying the output.
9310       if sort "$nlist" | uniq > "$nlist"T; then
9311         mv -f "$nlist"T "$nlist"
9312       else
9313         rm -f "$nlist"T
9314       fi
9315
9316       # Make sure that we snagged all the symbols we need.
9317       if egrep ' nm_test_var$' "$nlist" >/dev/null; then
9318         if egrep ' nm_test_func$' "$nlist" >/dev/null; then
9319           cat <<EOF > conftest.$ac_ext
9320 #ifdef __cplusplus
9321 extern "C" {
9322 #endif
9323
9324 EOF
9325           # Now generate the symbol file.
9326           eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
9327
9328           cat <<EOF >> conftest.$ac_ext
9329 #if defined (__STDC__) && __STDC__
9330 # define lt_ptr_t void *
9331 #else
9332 # define lt_ptr_t char *
9333 # define const
9334 #endif
9335
9336 /* The mapping between symbol names and symbols. */
9337 const struct {
9338   const char *name;
9339   lt_ptr_t address;
9340 }
9341 lt_preloaded_symbols[[]] =
9342 {
9343 EOF
9344           sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
9345           cat <<\EOF >> conftest.$ac_ext
9346   {0, (lt_ptr_t) 0}
9347 };
9348
9349 #ifdef __cplusplus
9350 }
9351 #endif
9352 EOF
9353           # Now try linking the two files.
9354           mv conftest.$ac_objext conftstm.$ac_objext
9355           lt_save_LIBS="$LIBS"
9356           lt_save_CFLAGS="$CFLAGS"
9357           LIBS="conftstm.$ac_objext"
9358           CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
9359           if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
9360             pipe_works=yes
9361           fi
9362           LIBS="$lt_save_LIBS"
9363           CFLAGS="$lt_save_CFLAGS"
9364         else
9365           echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
9366         fi
9367       else
9368         echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
9369       fi
9370     else
9371       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
9372     fi
9373   else
9374     echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
9375     cat conftest.$ac_ext >&5
9376   fi
9377   rm -f conftest* conftst*
9378
9379   # Do not use the global_symbol_pipe unless it works.
9380   if test "$pipe_works" = yes; then
9381     break
9382   else
9383     lt_cv_sys_global_symbol_pipe=
9384   fi
9385 done
9386 ])
9387 if test -z "$lt_cv_sys_global_symbol_pipe"; then
9388   lt_cv_sys_global_symbol_to_cdecl=
9389 fi
9390 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
9391   AC_MSG_RESULT(failed)
9392 else
9393   AC_MSG_RESULT(ok)
9394 fi
9395 ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
9396
9397
9398 # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
9399 # ---------------------------------------
9400 AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
9401 [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
9402 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
9403 _LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
9404
9405 AC_MSG_CHECKING([for $compiler option to produce PIC])
9406  ifelse([$1],[CXX],[
9407   # C++ specific cases for pic, static, wl, etc.
9408   if test "$GXX" = yes; then
9409     _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9410     _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
9411
9412     case $host_os in
9413     aix*)
9414       # All AIX code is PIC.
9415       if test "$host_cpu" = ia64; then
9416         # AIX 5 now supports IA64 processor
9417         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9418       fi
9419       ;;
9420     amigaos*)
9421       # FIXME: we need at least 68020 code to build shared libraries, but
9422       # adding the `-m68020' flag to GCC prevents building anything better,
9423       # like `-m68040'.
9424       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
9425       ;;
9426     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
9427       # PIC is the default for these OSes.
9428       ;;
9429     cygwin* | mingw* | os2*)
9430       # This hack is so that the source file can tell whether it is being
9431       # built for inclusion in a dll (and should export symbols for example).
9432       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
9433       ;;
9434     darwin* | rhapsody*)
9435       # PIC is the default on this platform
9436       # Common symbols not allowed in MH_DYLIB files
9437       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
9438       ;;
9439     *djgpp*)
9440       # DJGPP does not support shared libraries at all
9441       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
9442       ;;
9443     sysv4*MP*)
9444       if test -d /usr/nec; then
9445         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
9446       fi
9447       ;;
9448     hpux*)
9449       # PIC is the default for IA64 HP-UX, but not for PA HP-UX.
9450       if test "$host_cpu" != ia64; then
9451         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9452       fi
9453       ;;
9454     *)
9455       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9456       ;;
9457     esac
9458   else
9459     case $host_os in
9460       aix4* | aix5*)
9461         # All AIX code is PIC.
9462         if test "$host_cpu" = ia64; then
9463           # AIX 5 now supports IA64 processor
9464           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9465         else
9466           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
9467         fi
9468         ;;
9469       chorus*)
9470         case $cc_basename in
9471         cxch68)
9472           # Green Hills C++ Compiler
9473           # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
9474           ;;
9475         esac
9476         ;;
9477       dgux*)
9478         case $cc_basename in
9479           ec++)
9480             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9481             ;;
9482           ghcx)
9483             # Green Hills C++ Compiler
9484             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
9485             ;;
9486           *)
9487             ;;
9488         esac
9489         ;;
9490       freebsd*)
9491         # FreeBSD uses GNU C++
9492         ;;
9493       hpux9* | hpux10* | hpux11*)
9494         case $cc_basename in
9495           CC)
9496             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9497             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
9498             if test "$host_cpu" != ia64; then
9499               _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
9500             fi
9501             ;;
9502           aCC)
9503             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9504             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
9505             if test "$host_cpu" != ia64; then
9506               _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
9507             fi
9508             ;;
9509           *)
9510             ;;
9511         esac
9512         ;;
9513       irix5* | irix6* | nonstopux*)
9514         case $cc_basename in
9515           CC)
9516             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9517             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9518             # CC pic flag -KPIC is the default.
9519             ;;
9520           *)
9521             ;;
9522         esac
9523         ;;
9524       linux*)
9525         case $cc_basename in
9526           KCC)
9527             # KAI C++ Compiler
9528             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
9529             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9530             ;;
9531           cxx)
9532             # Compaq C++
9533             # Make sure the PIC flag is empty.  It appears that all Alpha
9534             # Linux and Compaq Tru64 Unix objects are PIC.
9535             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
9536             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9537             ;;
9538           *)
9539             ;;
9540         esac
9541         ;;
9542       lynxos*)
9543         ;;
9544       m88k*)
9545         ;;
9546       mvs*)
9547         case $cc_basename in
9548           cxx)
9549             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
9550             ;;
9551           *)
9552             ;;
9553         esac
9554         ;;
9555       netbsd*)
9556         ;;
9557       osf3* | osf4* | osf5*)
9558         case $cc_basename in
9559           KCC)
9560             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
9561             ;;
9562           RCC)
9563             # Rational C++ 2.4.1
9564             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
9565             ;;
9566           cxx)
9567             # Digital/Compaq C++
9568             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9569             # Make sure the PIC flag is empty.  It appears that all Alpha
9570             # Linux and Compaq Tru64 Unix objects are PIC.
9571             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
9572             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9573             ;;
9574           *)
9575             ;;
9576         esac
9577         ;;
9578       psos*)
9579         ;;
9580       sco*)
9581         case $cc_basename in
9582           CC)
9583             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9584             ;;
9585           *)
9586             ;;
9587         esac
9588         ;;
9589       solaris*)
9590         case $cc_basename in
9591           CC)
9592             # Sun C++ 4.2, 5.x and Centerline C++
9593             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9594             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9595             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
9596             ;;
9597           gcx)
9598             # Green Hills C++ Compiler
9599             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
9600             ;;
9601           *)
9602             ;;
9603         esac
9604         ;;
9605       sunos4*)
9606         case $cc_basename in
9607           CC)
9608             # Sun C++ 4.x
9609             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
9610             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9611             ;;
9612           lcc)
9613             # Lucid
9614             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
9615             ;;
9616           *)
9617             ;;
9618         esac
9619         ;;
9620       tandem*)
9621         case $cc_basename in
9622           NCC)
9623             # NonStop-UX NCC 3.20
9624             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9625             ;;
9626           *)
9627             ;;
9628         esac
9629         ;;
9630       unixware*)
9631         ;;
9632       vxworks*)
9633         ;;
9634       *)
9635         _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
9636         ;;
9637     esac
9638   fi
9639 ],
9640 [
9641   if test "$GCC" = yes; then
9642     _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9643     _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
9644
9645     case $host_os in
9646       aix*)
9647       # All AIX code is PIC.
9648       if test "$host_cpu" = ia64; then
9649         # AIX 5 now supports IA64 processor
9650         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9651       fi
9652       ;;
9653
9654     amigaos*)
9655       # FIXME: we need at least 68020 code to build shared libraries, but
9656       # adding the `-m68020' flag to GCC prevents building anything better,
9657       # like `-m68040'.
9658       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
9659       ;;
9660
9661     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
9662       # PIC is the default for these OSes.
9663       ;;
9664
9665     cygwin* | mingw* | pw32* | os2*)
9666       # This hack is so that the source file can tell whether it is being
9667       # built for inclusion in a dll (and should export symbols for example).
9668       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
9669       ;;
9670
9671     darwin* | rhapsody*)
9672       # PIC is the default on this platform
9673       # Common symbols not allowed in MH_DYLIB files
9674       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
9675       ;;
9676
9677     msdosdjgpp*)
9678       # Just because we use GCC doesn't mean we suddenly get shared libraries
9679       # on systems that don't support them.
9680       _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
9681       enable_shared=no
9682       ;;
9683
9684     sysv4*MP*)
9685       if test -d /usr/nec; then
9686         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
9687       fi
9688       ;;
9689
9690     hpux*)
9691       # PIC is the default for IA64 HP-UX, but not for PA HP-UX.
9692       if test "$host_cpu" != ia64; then
9693         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9694       fi
9695       ;;
9696
9697     *)
9698       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9699       ;;
9700     esac
9701   else
9702     # PORTME Check for flag to pass linker flags through the system compiler.
9703     case $host_os in
9704     aix*)
9705       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9706       if test "$host_cpu" = ia64; then
9707         # AIX 5 now supports IA64 processor
9708         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9709       else
9710         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
9711       fi
9712       ;;
9713
9714     cygwin* | mingw* | pw32* | os2*)
9715       # This hack is so that the source file can tell whether it is being
9716       # built for inclusion in a dll (and should export symbols for example).
9717       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
9718       ;;
9719
9720     hpux9* | hpux10* | hpux11*)
9721       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9722       if test "$host_cpu" != ia64; then
9723         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
9724       fi
9725       # Is there a better lt_prog_compiler_static that works with the bundled CC?
9726       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
9727       ;;
9728
9729     irix5* | irix6* | nonstopux*)
9730       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9731       # PIC (with -KPIC) is the default.
9732       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9733       ;;
9734
9735     newsos6)
9736       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9737       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9738       ;;
9739
9740     osf3* | osf4* | osf5*)
9741       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9742       # All OSF/1 code is PIC.
9743       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9744       ;;
9745
9746     sco3.2v5*)
9747       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
9748       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
9749       ;;
9750
9751     solaris*)
9752       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9753       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9754       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9755       ;;
9756
9757     sunos4*)
9758       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
9759       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
9760       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9761       ;;
9762
9763     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
9764       if test "x$host_vendor" = xsni; then
9765         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-LD'
9766       else
9767         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9768       fi
9769       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9770       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9771       ;;
9772
9773     sysv4*MP*)
9774       if test -d /usr/nec ;then
9775         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
9776         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9777       fi
9778       ;;
9779
9780     uts4*)
9781       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
9782       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9783       ;;
9784
9785     *)
9786       _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
9787       ;;
9788     esac
9789   fi
9790 ])
9791 AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
9792
9793 #
9794 # Check to make sure the PIC flag actually works.
9795 #
9796 if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
9797   AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
9798     _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
9799     [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC], [],
9800     [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
9801      "" | " "*) ;;
9802      *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
9803      esac],
9804     [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
9805      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
9806 fi
9807 case "$host_os" in
9808   # For platforms which do not support PIC, -DPIC is meaningless:
9809   *djgpp*)
9810     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
9811     ;;
9812   *)
9813     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC"
9814     ;;
9815 esac
9816 ])
9817
9818
9819 # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
9820 # ------------------------------------
9821 # See if the linker supports building shared libraries.
9822 AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
9823 [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
9824 ifelse([$1],[CXX],[
9825   _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
9826   case $host_os in
9827   aix4* | aix5*)
9828     # If we're using GNU nm, then we don't want the "-C" option.
9829     # -C means demangle to AIX nm, but means don't demangle with GNU nm
9830     if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then
9831       _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
9832     else
9833       _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
9834     fi
9835     ;;
9836   cygwin* | mingw* | pw32*)
9837     _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
9838   ;;
9839   *)
9840     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
9841   ;;
9842   esac
9843 ],[
9844   runpath_var=
9845   _LT_AC_TAGVAR(allow_undefined_flag, $1)=
9846
9847   _LT_AC_TAGVAR(archive_cmds, $1)=
9848   _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=
9849   _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
9850   _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
9851   _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
9852   _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
9853   _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
9854   _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
9855   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
9856   _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
9857   _LT_AC_TAGVAR(hardcode_direct, $1)=no
9858   _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
9859   _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
9860   _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
9861   _LT_AC_TAGVAR(always_export_symbols, $1)=no
9862   _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
9863   # include_expsyms should be a list of space-separated symbols to be *always*
9864   # included in the symbol list
9865   _LT_AC_TAGVAR(include_expsyms, $1)=
9866   # exclude_expsyms can be an egrep regular expression of symbols to exclude
9867   # it will be wrapped by ` (' and `)$', so one must not match beginning or
9868   # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
9869   # as well as any symbol that contains `d'.
9870   _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
9871   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
9872   # platforms (ab)use it in PIC code, but their linkers get confused if
9873   # the symbol is explicitly referenced.  Since portable code cannot
9874   # rely on this symbol name, it's probably fine to never include it in
9875   # preloaded symbol tables.
9876   extract_expsyms_cmds=
9877
9878   case $host_os in
9879   cygwin* | mingw* | pw32*)
9880     # FIXME: the MSVC++ port hasn't been tested in a loooong time
9881     # When not using gcc, we currently assume that we are using
9882     # Microsoft Visual C++.
9883     if test "$GCC" != yes; then
9884       with_gnu_ld=no
9885     fi
9886     ;;
9887   openbsd*)
9888     with_gnu_ld=no
9889     ;;
9890   esac
9891
9892   _LT_AC_TAGVAR(ld_shlibs, $1)=yes
9893   if test "$with_gnu_ld" = yes; then
9894     # If archive_cmds runs LD, not CC, wlarc should be empty
9895     wlarc='${wl}'
9896
9897     # See if GNU ld supports shared libraries.
9898     case $host_os in
9899     aix3* | aix4* | aix5*)
9900       # On AIX/PPC, the GNU linker is very broken
9901       if test "$host_cpu" != ia64; then
9902         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9903         cat <<EOF 1>&2
9904
9905 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
9906 *** to be unable to reliably create shared libraries on AIX.
9907 *** Therefore, libtool is disabling shared libraries support.  If you
9908 *** really care for shared libraries, you may want to modify your PATH
9909 *** so that a non-GNU linker is found, and then restart.
9910
9911 EOF
9912       fi
9913       ;;
9914
9915     amigaos*)
9916       _LT_AC_TAGVAR(archive_cmds, $1)='$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)'
9917       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9918       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
9919
9920       # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
9921       # that the semantics of dynamic libraries on AmigaOS, at least up
9922       # to version 4, is to share data among multiple programs linked
9923       # with the same dynamic library.  Since this doesn't match the
9924       # behavior of shared libraries on other platforms, we can't use
9925       # them.
9926       _LT_AC_TAGVAR(ld_shlibs, $1)=no
9927       ;;
9928
9929     beos*)
9930       if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
9931         _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
9932         # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
9933         # support --undefined.  This deserves some investigation.  FIXME
9934         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9935       else
9936         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9937       fi
9938       ;;
9939
9940     cygwin* | mingw* | pw32*)
9941       # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, as there is
9942       # no search path for DLLs.
9943       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9944       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
9945       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
9946
9947       extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
9948         sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
9949         test -f $output_objdir/impgen.exe || (cd $output_objdir && \
9950         if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
9951         else $CC -o impgen impgen.c ; fi)~
9952         $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
9953
9954       _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
9955
9956       # cygwin and mingw dlls have different entry points and sets of symbols
9957       # to exclude.
9958       # FIXME: what about values for MSVC?
9959       dll_entry=__cygwin_dll_entry@12
9960       dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
9961       case $host_os in
9962       mingw*)
9963         # mingw values
9964         dll_entry=_DllMainCRTStartup@12
9965         dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
9966         ;;
9967       esac
9968
9969       # mingw and cygwin differ, and it's simplest to just exclude the union
9970       # of the two symbol sets.
9971       dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
9972
9973       # recent cygwin and mingw systems supply a stub DllMain which the user
9974       # can override, but on older systems we have to supply one (in ltdll.c)
9975       if test "x$lt_cv_need_dllmain" = "xyes"; then
9976         ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
9977         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~
9978         test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
9979       else
9980         ltdll_obj=
9981         ltdll_cmds=
9982       fi
9983
9984       # Extract the symbol export list from an `--export-all' def file,
9985       # then regenerate the def file from the symbol export list, so that
9986       # the compiled dll only exports the symbol export list.
9987       # Be careful not to strip the DATA tag left by newer dlltools.
9988       _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"'
9989         $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
9990         sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
9991
9992       # If the export-symbols file already is a .def file (1st line
9993       # is EXPORTS), use it as is.
9994       # If DATA tags from a recent dlltool are present, honour them!
9995       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`head -1 $export_symbols`" = xEXPORTS; then
9996           cp $export_symbols $output_objdir/$soname-def;
9997         else
9998           echo EXPORTS > $output_objdir/$soname-def;
9999           _lt_hint=1;
10000           cat $export_symbols | while read symbol; do
10001            set dummy \$symbol;
10002            case \[$]# in
10003              2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
10004              *) echo "   \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
10005            esac;
10006            _lt_hint=`expr 1 + \$_lt_hint`;
10007           done;
10008         fi~
10009         '"$ltdll_cmds"'
10010         $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~
10011         $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~
10012         $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~
10013         $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~
10014         $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
10015       ;;
10016
10017     netbsd*)
10018       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
10019         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
10020         wlarc=
10021       else
10022         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10023         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
10024       fi
10025       ;;
10026
10027     solaris* | sysv5*)
10028       if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
10029         _LT_AC_TAGVAR(ld_shlibs, $1)=no
10030         cat <<EOF 1>&2
10031
10032 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
10033 *** create shared libraries on Solaris systems.  Therefore, libtool
10034 *** is disabling shared libraries support.  We urge you to upgrade GNU
10035 *** binutils to release 2.9.1 or newer.  Another option is to modify
10036 *** your PATH or compiler configuration so that the native linker is
10037 *** used, and then restart.
10038
10039 EOF
10040       elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
10041         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10042         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
10043       else
10044         _LT_AC_TAGVAR(ld_shlibs, $1)=no
10045       fi
10046       ;;
10047
10048     sunos4*)
10049       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
10050       wlarc=
10051       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10052       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10053       ;;
10054
10055     *)
10056       if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
10057         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10058         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
10059       else
10060         _LT_AC_TAGVAR(ld_shlibs, $1)=no
10061       fi
10062       ;;
10063     esac
10064
10065     if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
10066       runpath_var=LD_RUN_PATH
10067       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
10068       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
10069       case $host_os in
10070       cygwin* | mingw* | pw32*)
10071         # dlltool doesn't understand --whole-archive et. al.
10072         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
10073         ;;
10074       *)
10075         # ancient GNU ld didn't support --whole-archive et. al.
10076         if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
10077         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
10078         else
10079         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
10080         fi
10081         ;;
10082       esac
10083     fi
10084   else
10085     # PORTME fill in a description of your system's linker (not GNU ld)
10086     case $host_os in
10087     aix3*)
10088       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
10089       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
10090       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
10091       # Note: this linker hardcodes the directories in LIBPATH if there
10092       # are no directories specified by -L.
10093       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10094       if test "$GCC" = yes && test -z "$link_static_flag"; then
10095         # Neither direct hardcoding nor static linking is supported with a
10096         # broken collect2.
10097         _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
10098       fi
10099       ;;
10100
10101     aix4* | aix5*)
10102       if test "$host_cpu" = ia64; then
10103         # On IA64, the linker does run time linking by default, so we don't
10104         # have to do anything special.
10105         aix_use_runtimelinking=no
10106         exp_sym_flag='-Bexport'
10107         no_entry_flag=""
10108       else
10109         # If we're using GNU nm, then we don't want the "-C" option.
10110         # -C means demangle to AIX nm, but means don't demangle with GNU nm
10111         if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then
10112           _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
10113         else
10114           _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
10115         fi
10116
10117         # KDE requires run time linking.  Make it the default.
10118         aix_use_runtimelinking=yes
10119         exp_sym_flag='-bexport'
10120         no_entry_flag='-bnoentry'
10121       fi
10122
10123       # When large executables or shared objects are built, AIX ld can
10124       # have problems creating the table of contents.  If linking a library
10125       # or program results in "error TOC overflow" add -mminimal-toc to
10126       # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
10127       # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
10128
10129       _LT_AC_TAGVAR(archive_cmds, $1)=''
10130       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10131       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
10132       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
10133
10134       if test "$GCC" = yes; then
10135         case $host_os in aix4.[012]|aix4.[012].*)
10136         # We only want to do this on AIX 4.2 and lower, the check
10137         # below for broken collect2 doesn't work under 4.3+
10138           collect2name=`${CC} -print-prog-name=collect2`
10139           if test -f "$collect2name" && \
10140            strings "$collect2name" | grep resolve_lib_name >/dev/null
10141           then
10142           # We have reworked collect2
10143           _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10144           else
10145           # We have old collect2
10146           _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
10147           # It fails to find uninstalled libraries when the uninstalled
10148           # path is not listed in the libpath.  Setting hardcode_minus_L
10149           # to unsupported forces relinking
10150           _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10151           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10152           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
10153           fi
10154         esac
10155         shared_flag='-shared'
10156       else
10157         # not using gcc
10158         if test "$host_cpu" = ia64; then
10159         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
10160         # chokes on -Wl,-G. The following line is correct:
10161           shared_flag='-G'
10162         else
10163         if test "$aix_use_runtimelinking" = yes; then
10164             shared_flag='-qmkshrobj ${wl}-G'
10165           else
10166             shared_flag='-qmkshrobj'
10167         fi
10168         fi
10169       fi
10170
10171       # Let the compiler handle the export list.
10172       _LT_AC_TAGVAR(always_export_symbols, $1)=no
10173       if test "$aix_use_runtimelinking" = yes; then
10174         # Warning - without using the other runtime loading flags (-brtl),
10175         # -berok will link without error, but may produce a broken library.
10176         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
10177        # Determine the default libpath from the value encoded in an empty executable.
10178         _LT_AC_SYS_LIBPATH_AIX
10179         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
10180         _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
10181         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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}$exp_sym_flag:\$export_symbols $shared_flag"
10182        else
10183         if test "$host_cpu" = ia64; then
10184           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
10185           _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
10186           _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
10187         else
10188          # Determine the default libpath from the value encoded in an empty executable.
10189          _LT_AC_SYS_LIBPATH_AIX
10190          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
10191           # Warning - without using the other run time loading flags,
10192           # -berok will link without error, but may produce a broken library.
10193           _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
10194           _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
10195           # -bexpall does not export symbols beginning with underscore (_)
10196           _LT_AC_TAGVAR(always_export_symbols, $1)=yes
10197           # Exported symbols can be pulled into shared objects from archives
10198           _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
10199           _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
10200           # This is similar to how AIX traditionally builds it's shared libraries.
10201           _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
10202         fi
10203       fi
10204       ;;
10205
10206     amigaos*)
10207       _LT_AC_TAGVAR(archive_cmds, $1)='$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)'
10208       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10209       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10210       # see comment about different semantics on the GNU ld section
10211       _LT_AC_TAGVAR(ld_shlibs, $1)=no
10212       ;;
10213
10214     bsdi4*)
10215       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
10216       ;;
10217
10218     cygwin* | mingw* | pw32*)
10219       # When not using gcc, we currently assume that we are using
10220       # Microsoft Visual C++.
10221       # hardcode_libdir_flag_spec is actually meaningless, as there is
10222       # no search path for DLLs.
10223       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
10224       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
10225       # Tell ltmain to make .lib files, not .a files.
10226       libext=lib
10227       # FIXME: Setting linknames here is a bad hack.
10228       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
10229       # The linker will automatically build a .lib file if we build a DLL.
10230       _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
10231       # FIXME: Should let the user specify the lib program.
10232       _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
10233       fix_srcfile_path='`cygpath -w "$srcfile"`'
10234       ;;
10235
10236     darwin* | rhapsody*)
10237       case "$host_os" in
10238       rhapsody* | darwin1.[[012]])
10239         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
10240         ;;
10241       *) # Darwin 1.3 on
10242         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
10243         ;;
10244       esac
10245
10246       # FIXME: Relying on posixy $() will cause problems for
10247       #        cross-compilation, but unfortunately the echo tests do not
10248       #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
10249       #        `"' quotes if we put them in here... so don't!
10250       _LT_AC_TAGVAR(archive_cmds, $1)='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring'
10251       # We need to add '_' to the symbols in $export_symbols first
10252       #_LT_AC_TAGVAR(archive_expsym_cmds, $1)="$_LT_AC_TAGVAR(archive_cmds, $1)"' && strip -s $export_symbols'
10253       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10254       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10255       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
10256       ;;
10257
10258     dgux*)
10259       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10260       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10261       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10262       ;;
10263
10264     freebsd1*)
10265       _LT_AC_TAGVAR(ld_shlibs, $1)=no
10266       ;;
10267
10268     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
10269     # support.  Future versions do this automatically, but an explicit c++rt0.o
10270     # does not break anything, and helps significantly (at the cost of a little
10271     # extra space).
10272     freebsd2.2*)
10273       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
10274       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10275       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10276       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10277       ;;
10278
10279     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
10280     freebsd2*)
10281       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
10282       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10283       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10284       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10285       ;;
10286
10287     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
10288     freebsd*)
10289       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
10290       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10291       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10292       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10293       ;;
10294
10295     hpux9* | hpux10* | hpux11*)
10296       if test "$GCC" = yes; then
10297         case $host_os in
10298           hpux9*)
10299             _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
10300             ;;
10301           *)
10302             if test "$host_cpu" = ia64; then
10303               _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10304             else
10305               _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
10306             fi
10307             ;;
10308         esac
10309       else
10310         case $host_os in
10311           hpux9*)
10312             _LT_AC_TAGVAR(archive_cmds, $1)='$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'
10313             ;;
10314           *)
10315             if test "$host_cpu" = ia64; then
10316               _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
10317             else
10318               _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
10319             fi
10320             ;;
10321         esac
10322       fi
10323       if test "$host_cpu" = ia64; then
10324         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10325         _LT_AC_TAGVAR(hardcode_direct, $1)=no
10326         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10327       else
10328         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
10329         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
10330         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10331       fi
10332       # hardcode_minus_L: Not really in the search PATH,
10333       # but as the default location of the library.
10334       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10335       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
10336       ;;
10337
10338     irix5* | irix6* | nonstopux*)
10339       if test "$GCC" = yes; then
10340         _LT_AC_TAGVAR(archive_cmds, $1)='$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'
10341       else
10342         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
10343       fi
10344       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
10345       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
10346       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
10347       ;;
10348
10349     netbsd*)
10350       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
10351         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
10352       else
10353         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
10354       fi
10355       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10356       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10357       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10358       ;;
10359
10360     newsos6)
10361       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10362       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10363       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
10364       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
10365       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10366       ;;
10367
10368     openbsd*)
10369       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10370       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10371
10372       if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
10373         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
10374         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
10375         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
10376       else
10377        case $host_os in
10378          openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
10379            _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
10380            _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10381            ;;
10382          *)
10383            _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
10384            _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
10385            ;;
10386        esac
10387       fi
10388       ;;
10389
10390     os2*)
10391       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10392       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10393       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
10394       _LT_AC_TAGVAR(archive_cmds, $1)='$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'
10395       _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
10396       ;;
10397
10398     osf3*)
10399       if test "$GCC" = yes; then
10400         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
10401         _LT_AC_TAGVAR(archive_cmds, $1)='$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'
10402       else
10403         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
10404         _LT_AC_TAGVAR(archive_cmds, $1)='$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'
10405       fi
10406       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
10407       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
10408       ;;
10409
10410     osf4* | osf5*)      # as osf3* with the addition of -msym flag
10411       if test "$GCC" = yes; then
10412         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
10413         _LT_AC_TAGVAR(archive_cmds, $1)='$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'
10414         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
10415       else
10416         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
10417         _LT_AC_TAGVAR(archive_cmds, $1)='$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'
10418         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
10419         $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'
10420
10421         # Both c and cxx compiler support -rpath directly
10422         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
10423       fi
10424       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
10425       ;;
10426
10427     sco3.2v5*)
10428       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10429       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10430       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
10431       runpath_var=LD_RUN_PATH
10432       hardcode_runpath_var=yes
10433       ;;
10434
10435     solaris*)
10436       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
10437       if test "$GCC" = yes; then
10438         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10439         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
10440           $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
10441       else
10442         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
10443         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
10444         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
10445       fi
10446       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10447       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10448       case $host_os in
10449       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
10450       *) # Supported since Solaris 2.6 (maybe 2.5.1?)
10451         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
10452       esac
10453       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
10454       ;;
10455
10456     sunos4*)
10457       if test "x$host_vendor" = xsequent; then
10458         # Use $CC to link under sequent, because it throws in some extra .o
10459         # files that make .init and .fini sections work.
10460         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
10461       else
10462         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
10463       fi
10464       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10465       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10466       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10467       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10468       ;;
10469
10470     sysv4)
10471       if test "x$host_vendor" = xsni; then
10472         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
10473         _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
10474       else
10475         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10476         _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
10477       fi
10478       runpath_var='LD_RUN_PATH'
10479       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10480       ;;
10481
10482     sysv4.3*)
10483       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10484       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10485       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
10486       ;;
10487
10488     sysv4*MP*)
10489       if test -d /usr/nec; then
10490         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10491         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10492         runpath_var=LD_RUN_PATH
10493         hardcode_runpath_var=yes
10494         _LT_AC_TAGVAR(ld_shlibs, $1)=yes
10495       fi
10496       ;;
10497
10498     sysv4.2uw2*)
10499       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
10500       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10501       _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
10502       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10503       hardcode_runpath_var=yes
10504       runpath_var=LD_RUN_PATH
10505       ;;
10506
10507    sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
10508       _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
10509       if test "$GCC" = yes; then
10510         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10511       else
10512         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10513       fi
10514       runpath_var='LD_RUN_PATH'
10515       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10516       ;;
10517
10518     sysv5*)
10519       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
10520       # $CC -shared without GNU ld will not create a library from C++
10521       # object files and a static libstdc++, better avoid it by now
10522       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
10523       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
10524                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
10525       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
10526       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10527       runpath_var='LD_RUN_PATH'
10528       ;;
10529
10530     uts4*)
10531       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10532       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10533       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10534       ;;
10535
10536     *)
10537       _LT_AC_TAGVAR(ld_shlibs, $1)=no
10538       ;;
10539     esac
10540   fi
10541 ])
10542 AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
10543 test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
10544
10545 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
10546 if test "$GCC" = yes; then
10547   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
10548 fi
10549
10550 #
10551 # Do we need to explicitly link libc?
10552 #
10553 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
10554 if test "$enable_shared" = yes && test "$GCC" = yes; then
10555   case $_LT_AC_TAGVAR(archive_cmds, $1) in
10556   *'~'*)
10557     # FIXME: we may have to deal with multi-command sequences.
10558     ;;
10559   '$CC '*)
10560     # Test whether the compiler implicitly links with -lc since on some
10561     # systems, -lgcc has to come before -lc. If gcc already passes -lc
10562     # to ld, don't add -lc before -lgcc.
10563     AC_MSG_CHECKING([whether -lc should be explicitly linked in])
10564     $rm conftest*
10565     echo 'static int dummy;' > conftest.$ac_ext
10566
10567     if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
10568       soname=conftest
10569       lib=conftest
10570       libobjs=conftest.$ac_objext
10571       deplibs=
10572       wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
10573       compiler_flags=-v
10574       linker_flags=-v
10575       verstring=
10576       output_objdir=.
10577       libname=conftest
10578       lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
10579       _LT_AC_TAGVAR(allow_undefined_flag, $1)=
10580       if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
10581       then
10582         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
10583       else
10584         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
10585       fi
10586       _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
10587     else
10588       cat conftest.err 1>&5
10589     fi
10590     $rm conftest*
10591     AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
10592     ;;
10593   esac
10594 fi
10595 ])# AC_LIBTOOL_PROG_LD_SHLIBS
10596
10597
10598 # _LT_AC_FILE_LTDLL_C
10599 # -------------------
10600 # Be careful that the start marker always follows a newline.
10601 AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
10602 # /* ltdll.c starts here */
10603 # #define WIN32_LEAN_AND_MEAN
10604 # #include <windows.h>
10605 # #undef WIN32_LEAN_AND_MEAN
10606 # #include <stdio.h>
10607 #
10608 # #ifndef __CYGWIN__
10609 # #  ifdef __CYGWIN32__
10610 # #    define __CYGWIN__ __CYGWIN32__
10611 # #  endif
10612 # #endif
10613 #
10614 # #ifdef __cplusplus
10615 # extern "C" {
10616 # #endif
10617 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
10618 # #ifdef __cplusplus
10619 # }
10620 # #endif
10621 #
10622 # #ifdef __CYGWIN__
10623 # #include <cygwin/cygwin_dll.h>
10624 # DECLARE_CYGWIN_DLL( DllMain );
10625 # #endif
10626 # HINSTANCE __hDllInstance_base;
10627 #
10628 # BOOL APIENTRY
10629 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
10630 # {
10631 #   __hDllInstance_base = hInst;
10632 #   return TRUE;
10633 # }
10634 # /* ltdll.c ends here */
10635 ])# _LT_AC_FILE_LTDLL_C
10636
10637
10638 # _LT_AC_FILE_IMPGEN_C
10639 # --------------------
10640 # Be careful that the start marker always follows a newline.
10641 AC_DEFUN([_LT_AC_FILE_IMPGEN_C], [
10642 # /* impgen.c starts here */
10643 # /*   Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
10644 #
10645 #  This file is part of GNU libtool.
10646 #
10647 #  This program is free software; you can redistribute it and/or modify
10648 #  it under the terms of the GNU General Public License as published by
10649 #  the Free Software Foundation; either version 2 of the License, or
10650 #  (at your option) any later version.
10651 #
10652 #  This program is distributed in the hope that it will be useful,
10653 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
10654 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10655 #  GNU General Public License for more details.
10656 #
10657 #  You should have received a copy of the GNU General Public License
10658 #  along with this program; if not, write to the Free Software
10659 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
10660 #  */
10661 #
10662 # #include <stdio.h>            /* for printf() */
10663 # #include <unistd.h>           /* for open(), lseek(), read() */
10664 # #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
10665 # #include <string.h>           /* for strdup() */
10666 #
10667 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
10668 # #ifndef O_BINARY
10669 # #define O_BINARY 0
10670 # #endif
10671 #
10672 # static unsigned int
10673 # pe_get16 (fd, offset)
10674 #      int fd;
10675 #      int offset;
10676 # {
10677 #   unsigned char b[2];
10678 #   lseek (fd, offset, SEEK_SET);
10679 #   read (fd, b, 2);
10680 #   return b[0] + (b[1]<<8);
10681 # }
10682 #
10683 # static unsigned int
10684 # pe_get32 (fd, offset)
10685 #     int fd;
10686 #     int offset;
10687 # {
10688 #   unsigned char b[4];
10689 #   lseek (fd, offset, SEEK_SET);
10690 #   read (fd, b, 4);
10691 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
10692 # }
10693 #
10694 # static unsigned int
10695 # pe_as32 (ptr)
10696 #      void *ptr;
10697 # {
10698 #   unsigned char *b = ptr;
10699 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
10700 # }
10701 #
10702 # int
10703 # main (argc, argv)
10704 #     int argc;
10705 #     char *argv[];
10706 # {
10707 #     int dll;
10708 #     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
10709 #     unsigned long export_rva, export_size, nsections, secptr, expptr;
10710 #     unsigned long name_rvas, nexp;
10711 #     unsigned char *expdata, *erva;
10712 #     char *filename, *dll_name;
10713 #
10714 #     filename = argv[1];
10715 #
10716 #     dll = open(filename, O_RDONLY|O_BINARY);
10717 #     if (dll < 1)
10718 #       return 1;
10719 #
10720 #     dll_name = filename;
10721 #
10722 #     for (i=0; filename[i]; i++)
10723 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
10724 #           dll_name = filename + i +1;
10725 #
10726 #     pe_header_offset = pe_get32 (dll, 0x3c);
10727 #     opthdr_ofs = pe_header_offset + 4 + 20;
10728 #     num_entries = pe_get32 (dll, opthdr_ofs + 92);
10729 #
10730 #     if (num_entries < 1) /* no exports */
10731 #       return 1;
10732 #
10733 #     export_rva = pe_get32 (dll, opthdr_ofs + 96);
10734 #     export_size = pe_get32 (dll, opthdr_ofs + 100);
10735 #     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
10736 #     secptr = (pe_header_offset + 4 + 20 +
10737 #             pe_get16 (dll, pe_header_offset + 4 + 16));
10738 #
10739 #     expptr = 0;
10740 #     for (i = 0; i < nsections; i++)
10741 #     {
10742 #       char sname[8];
10743 #       unsigned long secptr1 = secptr + 40 * i;
10744 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
10745 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
10746 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
10747 #       lseek(dll, secptr1, SEEK_SET);
10748 #       read(dll, sname, 8);
10749 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)
10750 #       {
10751 #           expptr = fptr + (export_rva - vaddr);
10752 #           if (export_rva + export_size > vaddr + vsize)
10753 #               export_size = vsize - (export_rva - vaddr);
10754 #           break;
10755 #       }
10756 #     }
10757 #
10758 #     expdata = (unsigned char*)malloc(export_size);
10759 #     lseek (dll, expptr, SEEK_SET);
10760 #     read (dll, expdata, export_size);
10761 #     erva = expdata - export_rva;
10762 #
10763 #     nexp = pe_as32 (expdata+24);
10764 #     name_rvas = pe_as32 (expdata+32);
10765 #
10766 #     printf ("EXPORTS\n");
10767 #     for (i = 0; i<nexp; i++)
10768 #     {
10769 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
10770 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
10771 #     }
10772 #
10773 #     return 0;
10774 # }
10775 # /* impgen.c ends here */
10776 ])# _LT_AC_FILE_IMPGEN_C
10777
10778 # _LT_AC_TAGVAR(VARNAME, [TAGNAME])
10779 # ---------------------------------
10780 AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
10781
10782
10783 # old names
10784 AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
10785 AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
10786 AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
10787 AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
10788 AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
10789 AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
10790 AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
10791
10792 # This is just to silence aclocal about the macro not being used
10793 ifelse([AC_DISABLE_FAST_INSTALL])
10794
10795 AC_DEFUN([LT_AC_PROG_GCJ],
10796 [AC_CHECK_TOOL(GCJ, gcj, no)
10797   test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
10798   AC_SUBST(GCJFLAGS)
10799 ])
10800
10801 AC_DEFUN([LT_AC_PROG_RC],
10802 [AC_CHECK_TOOL(RC, windres, no)
10803 ])
10804
10805 # NOTE: This macro has been submitted for inclusion into   #
10806 #  GNU Autoconf as AC_PROG_SED.  When it is available in   #
10807 #  a released version of Autoconf we should remove this    #
10808 #  macro and use it instead.                               #
10809 # LT_AC_PROG_SED
10810 # --------------
10811 # Check for a fully-functional sed program, that truncates
10812 # as few characters as possible.  Prefer GNU sed if found.
10813 AC_DEFUN([LT_AC_PROG_SED],
10814 [AC_MSG_CHECKING([for a sed that does not truncate output])
10815 AC_CACHE_VAL(lt_cv_path_SED,
10816 [# Loop through the user's path and test for sed and gsed.
10817 # Then use that list of sed's as ones to test for truncation.
10818 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10819 for as_dir in $PATH
10820 do
10821   IFS=$as_save_IFS
10822   test -z "$as_dir" && as_dir=.
10823   for ac_prog in sed gsed; do
10824     for ac_exec_ext in '' $ac_executable_extensions; do
10825       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
10826         _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
10827       fi
10828     done
10829   done
10830 done
10831
10832   # Create a temporary directory, and hook for its removal unless debugging.
10833 $debug ||
10834 {
10835   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
10836   trap '{ (exit 1); exit 1; }' 1 2 13 15
10837 }
10838
10839 # Create a (secure) tmp directory for tmp files.
10840 : ${TMPDIR=/tmp}
10841 {
10842   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
10843   test -n "$tmp" && test -d "$tmp"
10844 }  ||
10845 {
10846   tmp=$TMPDIR/sed$$-$RANDOM
10847   (umask 077 && mkdir $tmp)
10848 } ||
10849 {
10850    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
10851    { (exit 1); exit 1; }
10852 }
10853   _max=0
10854   _count=0
10855   # Add /usr/xpg4/bin/sed as it is typically found on Solaris
10856   # along with /bin/sed that truncates output.
10857   for _sed in $_sed_list /usr/xpg4/bin/sed; do
10858     test ! -f ${_sed} && break
10859     cat /dev/null > "$tmp/sed.in"
10860     _count=0
10861     echo $ECHO_N "0123456789$ECHO_C" >"$tmp/sed.in"
10862     # Check for GNU sed and select it if it is found.
10863     if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
10864       lt_cv_path_SED=${_sed}
10865       break;
10866     fi
10867     while true; do
10868       cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
10869       mv "$tmp/sed.tmp" "$tmp/sed.in"
10870       cp "$tmp/sed.in" "$tmp/sed.nl"
10871       echo >>"$tmp/sed.nl"
10872       ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
10873       cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
10874       # 10000 chars as input seems more than enough
10875       test $_count -gt 10 && break
10876       _count=`expr $_count + 1`
10877       if test $_count -gt $_max; then
10878         _max=$_count
10879         lt_cv_path_SED=$_sed
10880       fi
10881     done
10882   done
10883   rm -rf "$tmp"
10884 ])
10885 AC_MSG_RESULT([$SED])
10886 ])
10887
10888 # Do all the work for Automake.  This macro actually does too much --
10889 # some checks are only needed if your package does certain things.
10890 # But this isn't really a big deal.
10891
10892 # serial 5
10893
10894 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
10895 # written in clear, in which case automake, when reading aclocal.m4,
10896 # will think it sees a *use*, and therefore will trigger all it's
10897 # C support machinery.  Also note that it means that autoscan, seeing
10898 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
10899
10900
10901 # We require 2.13 because we rely on SHELL being computed by configure.
10902 AC_PREREQ([2.13])
10903
10904 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
10905 # -----------------------------------------------------------
10906 # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
10907 # The purpose of this macro is to provide the user with a means to
10908 # check macros which are provided without letting her know how the
10909 # information is coded.
10910 # If this macro is not defined by Autoconf, define it here.
10911 ifdef([AC_PROVIDE_IFELSE],
10912       [],
10913       [define([AC_PROVIDE_IFELSE],
10914               [ifdef([AC_PROVIDE_$1],
10915                      [$2], [$3])])])
10916
10917
10918 # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
10919 # ----------------------------------------------
10920 AC_DEFUN([AM_INIT_AUTOMAKE],
10921 [AC_REQUIRE([AC_PROG_INSTALL])dnl
10922 # test to see if srcdir already configured
10923 if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
10924    test -f $srcdir/config.status; then
10925   AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
10926 fi
10927
10928 # Define the identity of the package.
10929 PACKAGE=$1
10930 AC_SUBST(PACKAGE)dnl
10931 VERSION=$2
10932 AC_SUBST(VERSION)dnl
10933 ifelse([$3],,
10934 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
10935 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
10936
10937 # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
10938 # the ones we care about.
10939 ifdef([m4_pattern_allow],
10940       [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
10941
10942 # Autoconf 2.50 always computes EXEEXT.  However we need to be
10943 # compatible with 2.13, for now.  So we always define EXEEXT, but we
10944 # don't compute it.
10945 AC_SUBST(EXEEXT)
10946 # Similar for OBJEXT -- only we only use OBJEXT if the user actually
10947 # requests that it be used.  This is a bit dumb.
10948 : ${OBJEXT=o}
10949 AC_SUBST(OBJEXT)
10950
10951 # Some tools Automake needs.
10952 AC_REQUIRE([AM_SANITY_CHECK])dnl
10953 AC_REQUIRE([AC_ARG_PROGRAM])dnl
10954 AM_MISSING_PROG(ACLOCAL, aclocal)
10955 AM_MISSING_PROG(AUTOCONF, autoconf)
10956 AM_MISSING_PROG(AUTOMAKE, automake)
10957 AM_MISSING_PROG(AUTOHEADER, autoheader)
10958 AM_MISSING_PROG(MAKEINFO, makeinfo)
10959 AM_MISSING_PROG(AMTAR, tar)
10960 AM_PROG_INSTALL_SH
10961 AM_PROG_INSTALL_STRIP
10962 # We need awk for the "check" target.  The system "awk" is bad on
10963 # some platforms.
10964 AC_REQUIRE([AC_PROG_AWK])dnl
10965 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
10966 AC_REQUIRE([AM_DEP_TRACK])dnl
10967 AC_REQUIRE([AM_SET_DEPDIR])dnl
10968 AC_PROVIDE_IFELSE([AC_PROG_][CC],
10969                   [_AM_DEPENDENCIES(CC)],
10970                   [define([AC_PROG_][CC],
10971                           defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
10972 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
10973                   [_AM_DEPENDENCIES(CXX)],
10974                   [define([AC_PROG_][CXX],
10975                           defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
10976 ])
10977
10978 #
10979 # Check to make sure that the build environment is sane.
10980 #
10981
10982 # serial 3
10983
10984 # AM_SANITY_CHECK
10985 # ---------------
10986 AC_DEFUN([AM_SANITY_CHECK],
10987 [AC_MSG_CHECKING([whether build environment is sane])
10988 # Just in case
10989 sleep 1
10990 echo timestamp > conftest.file
10991 # Do `set' in a subshell so we don't clobber the current shell's
10992 # arguments.  Must try -L first in case configure is actually a
10993 # symlink; some systems play weird games with the mod time of symlinks
10994 # (eg FreeBSD returns the mod time of the symlink's containing
10995 # directory).
10996 if (
10997    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
10998    if test "$[*]" = "X"; then
10999       # -L didn't work.
11000       set X `ls -t $srcdir/configure conftest.file`
11001    fi
11002    rm -f conftest.file
11003    if test "$[*]" != "X $srcdir/configure conftest.file" \
11004       && test "$[*]" != "X conftest.file $srcdir/configure"; then
11005
11006       # If neither matched, then we have a broken ls.  This can happen
11007       # if, for instance, CONFIG_SHELL is bash and it inherits a
11008       # broken ls alias from the environment.  This has actually
11009       # happened.  Such a system could not be considered "sane".
11010       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
11011 alias in your environment])
11012    fi
11013
11014    test "$[2]" = conftest.file
11015    )
11016 then
11017    # Ok.
11018    :
11019 else
11020    AC_MSG_ERROR([newly created file is older than distributed files!
11021 Check your system clock])
11022 fi
11023 AC_MSG_RESULT(yes)])
11024
11025
11026 # serial 2
11027
11028 # AM_MISSING_PROG(NAME, PROGRAM)
11029 # ------------------------------
11030 AC_DEFUN([AM_MISSING_PROG],
11031 [AC_REQUIRE([AM_MISSING_HAS_RUN])
11032 $1=${$1-"${am_missing_run}$2"}
11033 AC_SUBST($1)])
11034
11035
11036 # AM_MISSING_HAS_RUN
11037 # ------------------
11038 # Define MISSING if not defined so far and test if it supports --run.
11039 # If it does, set am_missing_run to use it, otherwise, to nothing.
11040 AC_DEFUN([AM_MISSING_HAS_RUN],
11041 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11042 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
11043 # Use eval to expand $SHELL
11044 if eval "$MISSING --run true"; then
11045   am_missing_run="$MISSING --run "
11046 else
11047   am_missing_run=
11048   am_backtick='`'
11049   AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
11050 fi
11051 ])
11052
11053 # AM_AUX_DIR_EXPAND
11054
11055 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
11056 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
11057 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
11058 #
11059 # Of course, Automake must honor this variable whenever it calls a
11060 # tool from the auxiliary directory.  The problem is that $srcdir (and
11061 # therefore $ac_aux_dir as well) can be either absolute or relative,
11062 # depending on how configure is run.  This is pretty annoying, since
11063 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
11064 # source directory, any form will work fine, but in subdirectories a
11065 # relative path needs to be adjusted first.
11066 #
11067 # $ac_aux_dir/missing
11068 #    fails when called from a subdirectory if $ac_aux_dir is relative
11069 # $top_srcdir/$ac_aux_dir/missing
11070 #    fails if $ac_aux_dir is absolute,
11071 #    fails when called from a subdirectory in a VPATH build with
11072 #          a relative $ac_aux_dir
11073 #
11074 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
11075 # are both prefixed by $srcdir.  In an in-source build this is usually
11076 # harmless because $srcdir is `.', but things will broke when you
11077 # start a VPATH build or use an absolute $srcdir.
11078 #
11079 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
11080 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
11081 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
11082 # and then we would define $MISSING as
11083 #   MISSING="\${SHELL} $am_aux_dir/missing"
11084 # This will work as long as MISSING is not called from configure, because
11085 # unfortunately $(top_srcdir) has no meaning in configure.
11086 # However there are other variables, like CC, which are often used in
11087 # configure, and could therefore not use this "fixed" $ac_aux_dir.
11088 #
11089 # Another solution, used here, is to always expand $ac_aux_dir to an
11090 # absolute PATH.  The drawback is that using absolute paths prevent a
11091 # configured tree to be moved without reconfiguration.
11092
11093 AC_DEFUN([AM_AUX_DIR_EXPAND], [
11094 # expand $ac_aux_dir to an absolute path
11095 am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
11096 ])
11097
11098 # AM_PROG_INSTALL_SH
11099 # ------------------
11100 # Define $install_sh.
11101 AC_DEFUN([AM_PROG_INSTALL_SH],
11102 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11103 install_sh=${install_sh-"$am_aux_dir/install-sh"}
11104 AC_SUBST(install_sh)])
11105
11106 # One issue with vendor `install' (even GNU) is that you can't
11107 # specify the program used to strip binaries.  This is especially
11108 # annoying in cross-compiling environments, where the build's strip
11109 # is unlikely to handle the host's binaries.
11110 # Fortunately install-sh will honor a STRIPPROG variable, so we
11111 # always use install-sh in `make install-strip', and initialize
11112 # STRIPPROG with the value of the STRIP variable (set by the user).
11113 AC_DEFUN([AM_PROG_INSTALL_STRIP],
11114 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11115 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
11116 AC_SUBST([INSTALL_STRIP_PROGRAM])])
11117
11118 # serial 4                                              -*- Autoconf -*-
11119
11120
11121
11122 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
11123 # written in clear, in which case automake, when reading aclocal.m4,
11124 # will think it sees a *use*, and therefore will trigger all it's
11125 # C support machinery.  Also note that it means that autoscan, seeing
11126 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
11127
11128
11129
11130 # _AM_DEPENDENCIES(NAME)
11131 # ---------------------
11132 # See how the compiler implements dependency checking.
11133 # NAME is "CC", "CXX" or "OBJC".
11134 # We try a few techniques and use that to set a single cache variable.
11135 #
11136 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
11137 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
11138 # dependency, and given that the user is not expected to run this macro,
11139 # just rely on AC_PROG_CC.
11140 AC_DEFUN([_AM_DEPENDENCIES],
11141 [AC_REQUIRE([AM_SET_DEPDIR])dnl
11142 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
11143 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
11144 AC_REQUIRE([AM_DEP_TRACK])dnl
11145
11146 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
11147        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
11148        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
11149        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
11150                    [depcc="$$1"   am_compiler_list=])
11151
11152 AC_CACHE_CHECK([dependency style of $depcc],
11153                [am_cv_$1_dependencies_compiler_type],
11154 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
11155   # We make a subdir and do the tests there.  Otherwise we can end up
11156   # making bogus files that we don't know about and never remove.  For
11157   # instance it was reported that on HP-UX the gcc test will end up
11158   # making a dummy file named `D' -- because `-MD' means `put the output
11159   # in D'.
11160   mkdir conftest.dir
11161   # Copy depcomp to subdir because otherwise we won't find it if we're
11162   # using a relative directory.
11163   cp "$am_depcomp" conftest.dir
11164   cd conftest.dir
11165
11166   am_cv_$1_dependencies_compiler_type=none
11167   if test "$am_compiler_list" = ""; then
11168      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
11169   fi
11170   for depmode in $am_compiler_list; do
11171     # We need to recreate these files for each test, as the compiler may
11172     # overwrite some of them when testing with obscure command lines.
11173     # This happens at least with the AIX C compiler.
11174     echo '#include "conftest.h"' > conftest.c
11175     echo 'int i;' > conftest.h
11176     echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
11177
11178     case $depmode in
11179     nosideeffect)
11180       # after this tag, mechanisms are not by side-effect, so they'll
11181       # only be used when explicitly requested
11182       if test "x$enable_dependency_tracking" = xyes; then
11183         continue
11184       else
11185         break
11186       fi
11187       ;;
11188     none) break ;;
11189     esac
11190     # We check with `-c' and `-o' for the sake of the "dashmstdout"
11191     # mode.  It turns out that the SunPro C++ compiler does not properly
11192     # handle `-M -o', and we need to detect this.
11193     if depmode=$depmode \
11194        source=conftest.c object=conftest.o \
11195        depfile=conftest.Po tmpdepfile=conftest.TPo \
11196        $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
11197        grep conftest.h conftest.Po > /dev/null 2>&1 &&
11198        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
11199       am_cv_$1_dependencies_compiler_type=$depmode
11200       break
11201     fi
11202   done
11203
11204   cd ..
11205   rm -rf conftest.dir
11206 else
11207   am_cv_$1_dependencies_compiler_type=none
11208 fi
11209 ])
11210 $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
11211 AC_SUBST([$1DEPMODE])
11212 ])
11213
11214
11215 # AM_SET_DEPDIR
11216 # -------------
11217 # Choose a directory name for dependency files.
11218 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
11219 AC_DEFUN([AM_SET_DEPDIR],
11220 [rm -f .deps 2>/dev/null
11221 mkdir .deps 2>/dev/null
11222 if test -d .deps; then
11223   DEPDIR=.deps
11224 else
11225   # MS-DOS does not allow filenames that begin with a dot.
11226   DEPDIR=_deps
11227 fi
11228 rmdir .deps 2>/dev/null
11229 AC_SUBST(DEPDIR)
11230 ])
11231
11232
11233 # AM_DEP_TRACK
11234 # ------------
11235 AC_DEFUN([AM_DEP_TRACK],
11236 [AC_ARG_ENABLE(dependency-tracking,
11237 [  --disable-dependency-tracking Speeds up one-time builds
11238   --enable-dependency-tracking  Do not reject slow dependency extractors])
11239 if test "x$enable_dependency_tracking" != xno; then
11240   am_depcomp="$ac_aux_dir/depcomp"
11241   AMDEPBACKSLASH='\'
11242 fi
11243 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
11244 pushdef([subst], defn([AC_SUBST]))
11245 subst(AMDEPBACKSLASH)
11246 popdef([subst])
11247 ])
11248
11249 # Generate code to set up dependency tracking.
11250 # This macro should only be invoked once -- use via AC_REQUIRE.
11251 # Usage:
11252 # AM_OUTPUT_DEPENDENCY_COMMANDS
11253
11254 #
11255 # This code is only required when automatic dependency tracking
11256 # is enabled.  FIXME.  This creates each `.P' file that we will
11257 # need in order to bootstrap the dependency handling code.
11258 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
11259 AC_OUTPUT_COMMANDS([
11260 test x"$AMDEP_TRUE" != x"" ||
11261 for mf in $CONFIG_FILES; do
11262   case "$mf" in
11263   Makefile) dirpart=.;;
11264   */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
11265   *) continue;;
11266   esac
11267   grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
11268   # Extract the definition of DEP_FILES from the Makefile without
11269   # running `make'.
11270   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
11271   test -z "$DEPDIR" && continue
11272   # When using ansi2knr, U may be empty or an underscore; expand it
11273   U=`sed -n -e '/^U = / s///p' < "$mf"`
11274   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
11275   # We invoke sed twice because it is the simplest approach to
11276   # changing $(DEPDIR) to its actual value in the expansion.
11277   for file in `sed -n -e '
11278     /^DEP_FILES = .*\\\\$/ {
11279       s/^DEP_FILES = //
11280       :loop
11281         s/\\\\$//
11282         p
11283         n
11284         /\\\\$/ b loop
11285       p
11286     }
11287     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
11288        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
11289     # Make sure the directory exists.
11290     test -f "$dirpart/$file" && continue
11291     fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
11292     $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
11293     # echo "creating $dirpart/$file"
11294     echo '# dummy' > "$dirpart/$file"
11295   done
11296 done
11297 ], [AMDEP_TRUE="$AMDEP_TRUE"
11298 ac_aux_dir="$ac_aux_dir"])])
11299
11300 # AM_MAKE_INCLUDE()
11301 # -----------------
11302 # Check to see how make treats includes.
11303 AC_DEFUN([AM_MAKE_INCLUDE],
11304 [am_make=${MAKE-make}
11305 cat > confinc << 'END'
11306 doit:
11307         @echo done
11308 END
11309 # If we don't find an include directive, just comment out the code.
11310 AC_MSG_CHECKING([for style of include used by $am_make])
11311 am__include='#'
11312 am__quote=
11313 _am_result=none
11314 # First try GNU make style include.
11315 echo "include confinc" > confmf
11316 # We grep out `Entering directory' and `Leaving directory'
11317 # messages which can occur if `w' ends up in MAKEFLAGS.
11318 # In particular we don't look at `^make:' because GNU make might
11319 # be invoked under some other name (usually "gmake"), in which
11320 # case it prints its new name instead of `make'.
11321 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
11322    am__include=include
11323    am__quote=
11324    _am_result=GNU
11325 fi
11326 # Now try BSD make style include.
11327 if test "$am__include" = "#"; then
11328    echo '.include "confinc"' > confmf
11329    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
11330       am__include=.include
11331       am__quote='"'
11332       _am_result=BSD
11333    fi
11334 fi
11335 AC_SUBST(am__include)
11336 AC_SUBST(am__quote)
11337 AC_MSG_RESULT($_am_result)
11338 rm -f confinc confmf
11339 ])
11340
11341 # serial 3
11342
11343 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
11344 # -------------------------------------
11345 # Define a conditional.
11346 #
11347 # FIXME: Once using 2.50, use this:
11348 # m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
11349 AC_DEFUN([AM_CONDITIONAL],
11350 [ifelse([$1], [TRUE],
11351         [errprint(__file__:__line__: [$0: invalid condition: $1
11352 ])dnl
11353 m4exit(1)])dnl
11354 ifelse([$1], [FALSE],
11355        [errprint(__file__:__line__: [$0: invalid condition: $1
11356 ])dnl
11357 m4exit(1)])dnl
11358 AC_SUBST([$1_TRUE])
11359 AC_SUBST([$1_FALSE])
11360 if $2; then
11361   $1_TRUE=
11362   $1_FALSE='#'
11363 else
11364   $1_TRUE='#'
11365   $1_FALSE=
11366 fi])
11367
11368
11369 # AM_PROG_LEX
11370 # Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
11371 AC_DEFUN([AM_PROG_LEX],
11372 [AC_REQUIRE([AM_MISSING_HAS_RUN])
11373 AC_CHECK_PROGS(LEX, flex lex, [${am_missing_run}flex])
11374 AC_PROG_LEX
11375 AC_DECL_YYTEXT])
11376
11377 # Like AC_CONFIG_HEADER, but automatically create stamp file.
11378
11379 # serial 3
11380
11381 # When config.status generates a header, we must update the stamp-h file.
11382 # This file resides in the same directory as the config header
11383 # that is generated.  We must strip everything past the first ":",
11384 # and everything past the last "/".
11385
11386 AC_PREREQ([2.12])
11387
11388 AC_DEFUN([AM_CONFIG_HEADER],
11389 [ifdef([AC_FOREACH],dnl
11390          [dnl init our file count if it isn't already
11391          m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
11392          dnl prepare to store our destination file list for use in config.status
11393          AC_FOREACH([_AM_File], [$1],
11394                     [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
11395                     m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
11396                     dnl and add it to the list of files AC keeps track of, along
11397                     dnl with our hook
11398                     AC_CONFIG_HEADERS(_AM_File,
11399 dnl COMMANDS, [, INIT-CMDS]
11400 [# update the timestamp
11401 echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
11402 ][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
11403                     m4_popdef([_AM_Dest])])],dnl
11404 [AC_CONFIG_HEADER([$1])
11405   AC_OUTPUT_COMMANDS(
11406    ifelse(patsubst([$1], [[^ ]], []),
11407           [],
11408           [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
11409            patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
11410 [am_indx=1
11411 for am_file in $1; do
11412   case " \$CONFIG_HEADERS " in
11413   *" \$am_file "*)
11414     am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
11415     if test -n "\$am_dir"; then
11416       am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
11417       for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
11418         am_tmpdir=\$am_tmpdir\$am_subdir/
11419         if test ! -d \$am_tmpdir; then
11420           mkdir \$am_tmpdir
11421         fi
11422       done
11423     fi
11424     echo timestamp > "\$am_dir"stamp-h\$am_indx
11425     ;;
11426   esac
11427   am_indx=\`expr \$am_indx + 1\`
11428 done])
11429 ])]) # AM_CONFIG_HEADER
11430
11431 # _AM_DIRNAME(PATH)
11432 # -----------------
11433 # Like AS_DIRNAME, only do it during macro expansion
11434 AC_DEFUN([_AM_DIRNAME],
11435        [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
11436               m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
11437                     m4_if(m4_regexp([$1], [^/.*]), -1,
11438                           [.],
11439                           m4_patsubst([$1], [^\(/\).*], [\1])),
11440                     m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
11441               m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
11442 ]) # _AM_DIRNAME
11443