Fix Makefile.am not to build GTK setup module.
[framework/uifw/ise-engine-hangul.git] / skim / acinclude.m4
1 ##   -*- autoconf -*-
2
3 dnl    This file is part of the KDE libraries/packages
4 dnl    Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
5 dnl              (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
6
7 dnl    This file is free software; you can redistribute it and/or
8 dnl    modify it under the terms of the GNU Library General Public
9 dnl    License as published by the Free Software Foundation; either
10 dnl    version 2 of the License, or (at your option) any later version.
11
12 dnl    This library is distributed in the hope that it will be useful,
13 dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 dnl    Library General Public License for more details.
16
17 dnl    You should have received a copy of the GNU Library General Public License
18 dnl    along with this library; see the file COPYING.LIB.  If not, write to
19 dnl    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 dnl    Boston, MA 02111-1307, USA.
21
22 dnl IMPORTANT NOTE:
23 dnl Please do not modify this file unless you expect your modifications to be
24 dnl carried into every other module in the repository. 
25 dnl
26 dnl Single-module modifications are best placed in configure.in for kdelibs
27 dnl and kdebase or configure.in.in if present.
28
29 # KDE_PATH_X_DIRECT
30 dnl Internal subroutine of AC_PATH_X.
31 dnl Set ac_x_includes and/or ac_x_libraries.
32 AC_DEFUN([KDE_PATH_X_DIRECT],
33 [
34 AC_REQUIRE([KDE_CHECK_LIB64])
35
36 if test "$ac_x_includes" = NO; then
37   # Guess where to find include files, by looking for this one X11 .h file.
38   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
39
40   # First, try using that file with no special directory specified.
41 AC_TRY_CPP([#include <$x_direct_test_include>],
42 [# We can compile using X headers with no special include directory.
43 ac_x_includes=],
44 [# Look for the header file in a standard set of common directories.
45 # Check X11 before X11Rn because it is often a symlink to the current release.
46   for ac_dir in               \
47     /usr/X11/include          \
48     /usr/X11R6/include        \
49     /usr/X11R5/include        \
50     /usr/X11R4/include        \
51                               \
52     /usr/include/X11          \
53     /usr/include/X11R6        \
54     /usr/include/X11R5        \
55     /usr/include/X11R4        \
56                               \
57     /usr/local/X11/include    \
58     /usr/local/X11R6/include  \
59     /usr/local/X11R5/include  \
60     /usr/local/X11R4/include  \
61                               \
62     /usr/local/include/X11    \
63     /usr/local/include/X11R6  \
64     /usr/local/include/X11R5  \
65     /usr/local/include/X11R4  \
66                               \
67     /usr/X386/include         \
68     /usr/x386/include         \
69     /usr/XFree86/include/X11  \
70                               \
71     /usr/include              \
72     /usr/local/include        \
73     /usr/unsupported/include  \
74     /usr/athena/include       \
75     /usr/local/x11r5/include  \
76     /usr/lpp/Xamples/include  \
77                               \
78     /usr/openwin/include      \
79     /usr/openwin/share/include \
80     ; \
81   do
82     if test -r "$ac_dir/$x_direct_test_include"; then
83       ac_x_includes=$ac_dir
84       break
85     fi
86   done])
87 fi # $ac_x_includes = NO
88
89 if test "$ac_x_libraries" = NO; then
90   # Check for the libraries.
91
92   test -z "$x_direct_test_library" && x_direct_test_library=Xt
93   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
94
95   # See if we find them without any special options.
96   # Don't add to $LIBS permanently.
97   ac_save_LIBS="$LIBS"
98   LIBS="-l$x_direct_test_library $LIBS"
99 AC_TRY_LINK([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
100 [LIBS="$ac_save_LIBS"
101 # We can link X programs with no special library path.
102 ac_x_libraries=],
103 [LIBS="$ac_save_LIBS"
104 # First see if replacing the include by lib works.
105 # Check X11 before X11Rn because it is often a symlink to the current release.
106 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \
107     /usr/X11/lib${kdelibsuff}           \
108     /usr/X11R6/lib${kdelibsuff}         \
109     /usr/X11R5/lib${kdelibsuff}         \
110     /usr/X11R4/lib${kdelibsuff}         \
111                                         \
112     /usr/lib${kdelibsuff}/X11           \
113     /usr/lib${kdelibsuff}/X11R6         \
114     /usr/lib${kdelibsuff}/X11R5         \
115     /usr/lib${kdelibsuff}/X11R4         \
116                                         \
117     /usr/local/X11/lib${kdelibsuff}     \
118     /usr/local/X11R6/lib${kdelibsuff}   \
119     /usr/local/X11R5/lib${kdelibsuff}   \
120     /usr/local/X11R4/lib${kdelibsuff}   \
121                                         \
122     /usr/local/lib${kdelibsuff}/X11     \
123     /usr/local/lib${kdelibsuff}/X11R6   \
124     /usr/local/lib${kdelibsuff}/X11R5   \
125     /usr/local/lib${kdelibsuff}/X11R4   \
126                                         \
127     /usr/X386/lib${kdelibsuff}          \
128     /usr/x386/lib${kdelibsuff}          \
129     /usr/XFree86/lib${kdelibsuff}/X11   \
130                                         \
131     /usr/lib${kdelibsuff}               \
132     /usr/local/lib${kdelibsuff}         \
133     /usr/unsupported/lib${kdelibsuff}   \
134     /usr/athena/lib${kdelibsuff}        \
135     /usr/local/x11r5/lib${kdelibsuff}   \
136     /usr/lpp/Xamples/lib${kdelibsuff}   \
137     /lib/usr/lib${kdelibsuff}/X11       \
138                                         \
139     /usr/openwin/lib${kdelibsuff}       \
140     /usr/openwin/share/lib${kdelibsuff} \
141     ; \
142 do
143 dnl Don't even attempt the hair of trying to link an X program!
144   for ac_extension in a so sl; do
145     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
146       ac_x_libraries=$ac_dir
147       break 2
148     fi
149   done
150 done])
151 fi # $ac_x_libraries = NO
152 ])
153
154
155 dnl ------------------------------------------------------------------------
156 dnl Find a file (or one of more files in a list of dirs)
157 dnl ------------------------------------------------------------------------
158 dnl
159 AC_DEFUN([AC_FIND_FILE],
160 [
161 $3=NO
162 for i in $2;
163 do
164   for j in $1;
165   do
166     echo "configure: __oline__: $i/$j" >&AC_FD_CC
167     if test -r "$i/$j"; then
168       echo "taking that" >&AC_FD_CC
169       $3=$i
170       break 2
171     fi
172   done
173 done
174 ])
175
176 dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs,
177 dnl     if-not-found, test-parameter, prepend-path)
178 dnl
179 dnl Look for program-name in list-of-dirs+$PATH.
180 dnl If prepend-path is set, look in $PATH+list-of-dirs instead.
181 dnl If found, $variable-name is set. If not, if-not-found is evaluated.
182 dnl test-parameter: if set, the program is executed with this arg,
183 dnl                 and only a successful exit code is required.
184 AC_DEFUN([KDE_FIND_PATH],
185 [
186    AC_MSG_CHECKING([for $1])
187    if test -n "$$2"; then
188         kde_cv_path="$$2";
189    else
190         kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
191
192         AC_CACHE_VAL(kde_cv_path_$kde_cache,
193         [
194         kde_cv_path="NONE"
195         kde_save_IFS=$IFS
196         IFS=':'
197         dirs=""
198         for dir in $PATH; do
199           dirs="$dirs $dir"
200         done
201         if test -z "$6"; then  dnl Append dirs in PATH (default)
202           dirs="$3 $dirs"
203         else  dnl Prepend dirs in PATH (if 6th arg is set)
204           dirs="$dirs $3"
205         fi
206         IFS=$kde_save_IFS
207
208         for dir in $dirs; do
209           if test -x "$dir/$1"; then
210             if test -n "$5"
211             then
212               evalstr="$dir/$1 $5 2>&1 "
213               if eval $evalstr; then
214                 kde_cv_path="$dir/$1"
215                 break
216               fi
217             else
218                 kde_cv_path="$dir/$1"
219                 break
220             fi
221           fi
222         done
223
224         eval "kde_cv_path_$kde_cache=$kde_cv_path"
225
226         ])
227
228       eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
229
230    fi
231
232    if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
233       AC_MSG_RESULT(not found)
234       $4
235    else
236       AC_MSG_RESULT($kde_cv_path)
237       $2=$kde_cv_path
238
239    fi
240 ])
241
242 AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
243 [
244     AC_MSG_ERROR([No Qt meta object compiler (moc) found!
245 Please check whether you installed Qt correctly.
246 You need to have a running moc binary.
247 configure tried to run $ac_cv_path_moc and the test didn't
248 succeed. If configure shouldn't have tried this one, set
249 the environment variable MOC to the right one before running
250 configure.
251 ])
252 ])
253
254 AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
255 [
256     AC_MSG_WARN([No Qt ui compiler (uic) found!
257 Please check whether you installed Qt correctly.
258 You need to have a running uic binary.
259 configure tried to run $ac_cv_path_uic and the test didn't
260 succeed. If configure shouldn't have tried this one, set
261 the environment variable UIC to the right one before running
262 configure.
263 ])
264 ])
265
266
267 AC_DEFUN([KDE_CHECK_UIC_FLAG],
268 [
269     AC_MSG_CHECKING([whether uic supports -$1 ])
270     kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
271     AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
272     [
273         cat >conftest.ui <<EOT
274         <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
275 EOT
276         ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
277         if AC_TRY_EVAL(ac_uic_testrun); then
278             eval "kde_cv_prog_uic_$kde_cache=yes"
279         else
280             eval "kde_cv_prog_uic_$kde_cache=no"
281         fi
282         rm -f conftest*
283     ])
284
285     if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
286         AC_MSG_RESULT([yes])
287         :
288         $3
289     else
290         AC_MSG_RESULT([no])
291         :
292         $4
293     fi
294 ])
295
296
297 dnl ------------------------------------------------------------------------
298 dnl Find the meta object compiler and the ui compiler in the PATH,
299 dnl in $QTDIR/bin, and some more usual places
300 dnl ------------------------------------------------------------------------
301 dnl
302 AC_DEFUN([AC_PATH_QT_MOC_UIC],
303 [
304    AC_REQUIRE([KDE_CHECK_PERL])
305    qt_bindirs=""
306    for dir in $kde_qt_dirs; do
307       qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
308    done
309    qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
310    if test ! "$ac_qt_bindir" = "NO"; then
311       qt_bindirs="$ac_qt_bindir $qt_bindirs"
312    fi
313
314    KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
315    if test -z "$UIC_NOT_NEEDED"; then
316      KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
317      if test -z "$UIC_PATH" ; then
318        KDE_UIC_ERROR_MESSAGE
319        exit 1
320      else
321        UIC=$UIC_PATH
322
323        if test $kde_qtver = 3; then
324          KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
325          KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
326
327          if test x$ac_uic_supports_libpath = xyes; then
328              UIC="$UIC -L \$(kde_widgetdir)"
329          fi
330          if test x$ac_uic_supports_nounload = xyes; then
331              UIC="$UIC -nounload"
332          fi
333        fi
334      fi
335    else
336      UIC="echo uic not available: "
337    fi
338
339    AC_SUBST(MOC)
340    AC_SUBST(UIC)
341
342    UIC_TR="i18n"
343    if test $kde_qtver = 3; then
344      UIC_TR="tr2i18n"
345    fi
346
347    AC_SUBST(UIC_TR)
348 ])
349
350 AC_DEFUN([KDE_1_CHECK_PATHS],
351 [
352   KDE_1_CHECK_PATH_HEADERS
353
354   KDE_TEST_RPATH=
355
356   if test -n "$USE_RPATH"; then
357
358      if test -n "$kde_libraries"; then
359        KDE_TEST_RPATH="-R $kde_libraries"
360      fi
361
362      if test -n "$qt_libraries"; then
363        KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
364      fi
365
366      if test -n "$x_libraries"; then
367        KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
368      fi
369
370      KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
371   fi
372
373 AC_MSG_CHECKING([for KDE libraries installed])
374 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'
375
376 if AC_TRY_EVAL(ac_link) && test -s conftest; then
377   AC_MSG_RESULT(yes)
378 else
379   AC_MSG_ERROR([your system fails at linking a small KDE application!
380 Check, if your compiler is installed correctly and if you have used the
381 same compiler to compile Qt and kdelibs as you did use now.
382 For more details about this problem, look at the end of config.log.])
383 fi
384
385 if eval `KDEDIR= ./conftest 2>&5`; then
386   kde_result=done
387 else
388   kde_result=problems
389 fi
390
391 KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
392 kde_have_all_paths=yes
393
394 KDE_SET_PATHS($kde_result)
395
396 ])
397
398 AC_DEFUN([KDE_SET_PATHS],
399 [
400   kde_cv_all_paths="kde_have_all_paths=\"yes\" \
401         kde_htmldir=\"$kde_htmldir\" \
402         kde_appsdir=\"$kde_appsdir\" \
403         kde_icondir=\"$kde_icondir\" \
404         kde_sounddir=\"$kde_sounddir\" \
405         kde_datadir=\"$kde_datadir\" \
406         kde_locale=\"$kde_locale\" \
407         kde_cgidir=\"$kde_cgidir\" \
408         kde_confdir=\"$kde_confdir\" \
409         kde_kcfgdir=\"$kde_kcfgdir\" \
410         kde_mimedir=\"$kde_mimedir\" \
411         kde_toolbardir=\"$kde_toolbardir\" \
412         kde_wallpaperdir=\"$kde_wallpaperdir\" \
413         kde_templatesdir=\"$kde_templatesdir\" \
414         kde_bindir=\"$kde_bindir\" \
415         kde_servicesdir=\"$kde_servicesdir\" \
416         kde_servicetypesdir=\"$kde_servicetypesdir\" \
417         kde_moduledir=\"$kde_moduledir\" \
418         kde_styledir=\"$kde_styledir\" \
419         kde_widgetdir=\"$kde_widgetdir\" \
420         xdg_appsdir=\"$xdg_appsdir\" \
421         xdg_menudir=\"$xdg_menudir\" \
422         xdg_directorydir=\"$xdg_directorydir\" \
423         kde_result=$1"
424 ])
425
426 AC_DEFUN([KDE_SET_DEFAULT_PATHS],
427 [
428 if test "$1" = "default"; then
429
430   if test -z "$kde_htmldir"; then
431     kde_htmldir='\${datadir}/doc/HTML'
432   fi
433   if test -z "$kde_appsdir"; then
434     kde_appsdir='\${datadir}/applnk'
435   fi
436   if test -z "$kde_icondir"; then
437     kde_icondir='\${datadir}/icons'
438   fi
439   if test -z "$kde_sounddir"; then
440     kde_sounddir='\${datadir}/sounds'
441   fi
442   if test -z "$kde_datadir"; then
443     kde_datadir='\${datadir}/apps'
444   fi
445   if test -z "$kde_locale"; then
446     kde_locale='\${datadir}/locale'
447   fi
448   if test -z "$kde_cgidir"; then
449     kde_cgidir='\${exec_prefix}/cgi-bin'
450   fi
451   if test -z "$kde_confdir"; then
452     kde_confdir='\${datadir}/config'
453   fi
454   if test -z "$kde_kcfgdir"; then
455     kde_kcfgdir='\${datadir}/config.kcfg'
456   fi
457   if test -z "$kde_mimedir"; then
458     kde_mimedir='\${datadir}/mimelnk'
459   fi
460   if test -z "$kde_toolbardir"; then
461     kde_toolbardir='\${datadir}/toolbar'
462   fi
463   if test -z "$kde_wallpaperdir"; then
464     kde_wallpaperdir='\${datadir}/wallpapers'
465   fi
466   if test -z "$kde_templatesdir"; then
467     kde_templatesdir='\${datadir}/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='\${datadir}/services'
474   fi
475   if test -z "$kde_servicetypesdir"; then
476     kde_servicetypesdir='\${datadir}/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   if test -z "$xdg_appsdir"; then
492     xdg_appsdir='\${datadir}/applications/kde'
493   fi
494   if test -z "$xdg_menudir"; then
495     xdg_menudir='\${sysconfdir}/xdg/menus'
496   fi
497   if test -z "$xdg_directorydir"; then
498     xdg_directorydir='\${datadir}/desktop-directories'
499   fi
500
501   KDE_SET_PATHS(defaults)
502
503 else
504
505   if test $kde_qtver = 1; then
506      AC_MSG_RESULT([compiling])
507      KDE_1_CHECK_PATHS
508   else
509      AC_MSG_ERROR([path checking not yet supported for KDE 2])
510   fi
511
512 fi
513 ])
514
515 AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
516 [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
517    test -z "$kde_icondir" || test -z "$kde_sounddir" ||
518    test -z "$kde_datadir" || test -z "$kde_locale"  ||
519    test -z "$kde_cgidir"  || test -z "$kde_confdir" ||
520    test -z "$kde_kcfgdir" ||
521    test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
522    test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
523    test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
524    test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
525    test -z "$kde_styledir" || test -z "kde_widgetdir" ||
526    test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
527    test "x$kde_have_all_paths" != "xyes"; then
528      kde_have_all_paths=no
529   fi
530 ])
531
532 AC_DEFUN([KDE_MISSING_PROG_ERROR],
533 [
534     AC_MSG_ERROR([The important program $1 was not found!
535 Please check whether you installed KDE correctly.
536 ])
537 ])
538
539 AC_DEFUN([KDE_MISSING_ARTS_ERROR],
540 [
541     AC_MSG_ERROR([The important program $1 was not found!
542 Please check whether you installed aRts correctly or use
543 --without-arts to compile without aRts support (this will remove functionality).
544 ])
545 ])
546
547 AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
548 [
549     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"
550     test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
551     if test -n "$KDEDIRS"; then
552        kde_save_IFS=$IFS
553        IFS=:
554        for dir in $KDEDIRS; do
555             kde_default_bindirs="$dir/bin $kde_default_bindirs "
556        done
557        IFS=$kde_save_IFS
558     fi
559 ])
560
561 AC_DEFUN([KDE_SUBST_PROGRAMS],
562 [
563     AC_ARG_WITH(arts,
564         AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
565         [build_arts=$withval],
566         [build_arts=yes]
567     )
568     AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
569     if test "$build_arts" = "no"; then
570         AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
571     fi
572
573         KDE_SET_DEFAULT_BINDIRS
574         kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
575         KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
576         KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
577         if test "$build_arts" '!=' "no"; then
578           KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
579           KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
580         fi
581         KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
582
583         kde32ornewer=1
584         kde33ornewer=1
585         if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then
586             kde32ornewer=
587             kde33ornewer=
588         else
589             if test "$kde_qtver" = "3"; then
590               if test "$kde_qtsubver" -le 1; then
591                 kde32ornewer=
592               fi
593               if test "$kde_qtsubver" -le 2 -o `kde-config --version | grep KDE | sed 's/KDE: \(...\).*/\1/'` == 3.2; then
594                 kde33ornewer=
595               fi
596             fi
597         fi
598
599         if test -n "$kde32ornewer"; then
600             KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)])
601             KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
602         fi
603         if test -n "$kde33ornewer"; then
604             KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)])
605             AC_SUBST(MAKEKDEWIDGETS)
606         fi
607         KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
608
609         if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then  
610             kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
611             test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
612             AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
613             if test "$KDE_XSL_STYLESHEET" = "NO"; then
614                 KDE_XSL_STYLESHEET=""
615             else
616                 KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
617             fi
618         fi
619
620         DCOP_DEPENDENCIES='$(DCOPIDL)'
621         if test -n "$kde32ornewer"; then
622             KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
623             DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
624             AC_SUBST(KCONFIG_COMPILER)
625             AC_SUBST(KCFG_DEPENDENCIES)
626             AC_SUBST(DCOPIDLNG)
627         fi
628         AC_SUBST(DCOPIDL)
629         AC_SUBST(DCOPIDL2CPP)
630         AC_SUBST(DCOP_DEPENDENCIES)
631         AC_SUBST(MCOPIDL)
632         AC_SUBST(ARTSCCONFIG)
633         AC_SUBST(MEINPROC)
634         AC_SUBST(KDE_XSL_STYLESHEET)
635         AC_SUBST(XMLLINT)
636 ])dnl
637
638 AC_DEFUN([AC_CREATE_KFSSTND],
639 [
640 AC_REQUIRE([AC_CHECK_RPATH])
641
642 AC_MSG_CHECKING([for KDE paths])
643 kde_result=""
644 kde_cached_paths=yes
645 AC_CACHE_VAL(kde_cv_all_paths,
646 [
647   KDE_SET_DEFAULT_PATHS($1)
648   kde_cached_paths=no
649 ])
650 eval "$kde_cv_all_paths"
651 KDE_CHECK_PATHS_FOR_COMPLETENESS
652 if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
653   # wrong values were cached, may be, we can set better ones
654   kde_result=
655   kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
656   kde_datadir= kde_locale=  kde_cgidir=  kde_confdir= kde_kcfgdir=
657   kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
658   kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
659   kde_have_all_paths=
660   kde_styledir=
661   kde_widgetdir=
662   xdg_appsdir = xdg_menudir= xdg_directorydir= 
663   KDE_SET_DEFAULT_PATHS($1)
664   eval "$kde_cv_all_paths"
665   KDE_CHECK_PATHS_FOR_COMPLETENESS
666   kde_result="$kde_result (cache overridden)"
667 fi
668 if test "$kde_have_all_paths" = "no"; then
669   AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
670 Since it had compiled and linked before, it must be a strange problem on your system.
671 Look at config.log for details. If you are not able to fix this, look at
672 http://www.kde.org/faq/installation.html or any www.kde.org mirror.
673 (If you're using an egcs version on Linux, you may update binutils!)
674 ])
675 else
676   rm -f conftest*
677   AC_MSG_RESULT($kde_result)
678 fi
679
680 bindir=$kde_bindir
681
682 KDE_SUBST_PROGRAMS
683
684 ])
685
686 AC_DEFUN([AC_SUBST_KFSSTND],
687 [
688 AC_SUBST(kde_htmldir)
689 AC_SUBST(kde_appsdir)
690 AC_SUBST(kde_icondir)
691 AC_SUBST(kde_sounddir)
692 AC_SUBST(kde_datadir)
693 AC_SUBST(kde_locale)
694 AC_SUBST(kde_confdir)
695 AC_SUBST(kde_kcfgdir)
696 AC_SUBST(kde_mimedir)
697 AC_SUBST(kde_wallpaperdir)
698 AC_SUBST(kde_bindir)
699 dnl X Desktop Group standards
700 AC_SUBST(xdg_appsdir)
701 AC_SUBST(xdg_menudir)
702 AC_SUBST(xdg_directorydir)
703 dnl for KDE 2
704 AC_SUBST(kde_templatesdir)
705 AC_SUBST(kde_servicesdir)
706 AC_SUBST(kde_servicetypesdir)
707 AC_SUBST(kde_moduledir)
708 AC_SUBST(kdeinitdir, '$(kde_moduledir)')
709 AC_SUBST(kde_styledir)
710 AC_SUBST(kde_widgetdir)
711 if test "$kde_qtver" = 1; then
712   kde_minidir="$kde_icondir/mini"
713 else
714 # for KDE 1 - this breaks KDE2 apps using minidir, but
715 # that's the plan ;-/
716   kde_minidir="/dev/null"
717 fi
718 dnl AC_SUBST(kde_minidir)
719 dnl AC_SUBST(kde_cgidir)
720 dnl AC_SUBST(kde_toolbardir)
721 ])
722
723 AC_DEFUN([KDE_MISC_TESTS],
724 [
725    dnl Checks for libraries.
726    AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD 
727    AC_SUBST(LIBUTIL)
728    AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
729    AC_SUBST(LIBCOMPAT)
730    kde_have_crypt=
731    AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
732       AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
733         AC_MSG_WARN([you have no crypt in either libcrypt or libc.
734 You should install libcrypt from another source or configure with PAM
735 support])
736         kde_have_crypt=no
737       ]))
738    AC_SUBST(LIBCRYPT)
739    if test $kde_have_crypt = yes; then
740       AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
741    fi
742    AC_CHECK_SOCKLEN_T
743    AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
744    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
745       AC_CHECK_LIB(dnet_stub, dnet_ntoa,
746         [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
747    fi
748    AC_CHECK_FUNC(inet_ntoa)
749    if test $ac_cv_func_inet_ntoa = no; then
750      AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
751    fi
752    AC_CHECK_FUNC(connect)
753    if test $ac_cv_func_connect = no; then
754       AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
755         $X_EXTRA_LIBS)
756    fi
757
758    AC_CHECK_FUNC(remove)
759    if test $ac_cv_func_remove = no; then
760       AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
761    fi
762
763    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
764    AC_CHECK_FUNC(shmat, ,
765      AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
766    
767    # more headers that need to be explicitly included on darwin
768    AC_CHECK_HEADERS(sys/types.h stdint.h)
769
770    # sys/bitypes.h is needed for uint32_t and friends on Tru64
771    AC_CHECK_HEADERS(sys/bitypes.h)
772
773    # darwin requires a poll emulation library
774    AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
775
776    # for some image handling on Mac OS X
777    AC_CHECK_HEADERS(Carbon/Carbon.h)
778
779    # CoreAudio framework
780    AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
781      AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
782      FRAMEWORK_COREAUDIO="-Xlinker -framework -Xlinker CoreAudio"
783    ])
784
785    AC_CHECK_RES_INIT
786    AC_SUBST(LIB_POLL)
787    AC_SUBST(FRAMEWORK_COREAUDIO)
788    LIBSOCKET="$X_EXTRA_LIBS"
789    AC_SUBST(LIBSOCKET)
790    AC_SUBST(X_EXTRA_LIBS)
791    AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
792    AC_SUBST(LIBUCB)
793
794    case $host in  dnl this *is* LynxOS specific
795    *-*-lynxos* )
796         AC_MSG_CHECKING([LynxOS header file wrappers])
797         [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
798         AC_MSG_RESULT(disabled)
799         AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
800          ;;
801     esac
802
803    KDE_CHECK_TYPES
804    KDE_CHECK_LIBDL
805    KDE_CHECK_STRLCPY
806
807 # darwin needs this to initialize the environment
808 AC_CHECK_HEADERS(crt_externs.h)
809 AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
810  
811 AH_VERBATIM(_DARWIN_ENVIRON,
812 [
813 #if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
814 # include <sys/time.h>
815 # include <crt_externs.h>
816 # define environ (*_NSGetEnviron())
817 #endif
818 ])
819
820 AH_VERBATIM(_AIX_STRINGS_H_BZERO,
821 [
822 /*
823  * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
824  * that defines bzero.
825  */
826
827 #if defined(_AIX)
828 #include <strings.h>
829 #endif
830 ])
831
832 AC_CHECK_FUNCS([vsnprintf snprintf])
833
834 AH_VERBATIM(_TRU64,[
835 /*
836  * On HP-UX, the declaration of vsnprintf() is needed every time !
837  */
838
839 #if !defined(HAVE_VSNPRINTF) || defined(hpux)
840 #if __STDC__
841 #include <stdarg.h>
842 #include <stdlib.h>
843 #else
844 #include <varargs.h>
845 #endif
846 #ifdef __cplusplus
847 extern "C"
848 #endif
849 int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
850 #ifdef __cplusplus
851 extern "C"
852 #endif
853 int snprintf(char *str, size_t n, char const *fmt, ...);
854 #endif
855 ])
856
857 ])
858
859 dnl ------------------------------------------------------------------------
860 dnl Find the header files and libraries for X-Windows. Extended the
861 dnl macro AC_PATH_X
862 dnl ------------------------------------------------------------------------
863 dnl
864 AC_DEFUN([K_PATH_X],
865 [
866 AC_REQUIRE([KDE_MISC_TESTS])dnl
867 AC_REQUIRE([KDE_CHECK_LIB64])
868
869 AC_ARG_ENABLE(
870   embedded,
871   AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
872   kde_use_qt_emb=$enableval,
873   kde_use_qt_emb=no
874 )
875
876 AC_ARG_ENABLE(
877   qtopia,
878   AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
879   kde_use_qt_emb_palm=$enableval,
880   kde_use_qt_emb_palm=no
881 )
882
883 AC_ARG_ENABLE(
884   mac,
885   AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
886   kde_use_qt_mac=$enableval,
887   kde_use_qt_mac=no
888 )
889
890 # used to disable x11-specific stuff on special platforms
891 AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
892
893 if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
894
895 AC_MSG_CHECKING(for X)
896
897 AC_CACHE_VAL(kde_cv_have_x,
898 [# One or both of the vars are not set, and there is no cached value.
899 if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
900    kde_x_includes=NO
901 else
902    kde_x_includes=$x_includes
903 fi
904 if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
905    kde_x_libraries=NO
906 else
907    kde_x_libraries=$x_libraries
908 fi
909
910 # below we use the standard autoconf calls
911 ac_x_libraries=$kde_x_libraries
912 ac_x_includes=$kde_x_includes
913
914 KDE_PATH_X_DIRECT
915 dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
916 dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
917 dnl location. The correct location is /usr/lib32 or an undefined value
918 dnl (the linker is smart enough to pick the correct default library).
919 dnl Things work just fine if you use just AC_PATH_X_DIRECT.
920 dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
921 dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
922 dnl x_includes should be left alone.
923 case "$host" in
924 mips-sgi-irix6*)
925   ;;
926 *-*-solaris*)
927   ;;
928 *)
929   _AC_PATH_X_XMKMF
930   if test -z "$ac_x_includes"; then
931     ac_x_includes="."
932   fi
933   if test -z "$ac_x_libraries"; then
934     ac_x_libraries="/usr/lib${kdelibsuff}"
935   fi
936 esac
937 #from now on we use our own again
938
939 # when the user already gave --x-includes, we ignore
940 # what the standard autoconf macros told us.
941 if test "$kde_x_includes" = NO; then
942   kde_x_includes=$ac_x_includes
943 fi
944
945 # for --x-libraries too
946 if test "$kde_x_libraries" = NO; then
947   kde_x_libraries=$ac_x_libraries
948 fi
949
950 if test "$kde_x_includes" = NO; then
951   AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
952 fi
953
954 if test "$kde_x_libraries" = NO; then
955   AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
956 fi
957
958 # Record where we found X for the cache.
959 kde_cv_have_x="have_x=yes \
960          kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
961 ])dnl
962
963 eval "$kde_cv_have_x"
964
965 if test "$have_x" != yes; then
966   AC_MSG_RESULT($have_x)
967   no_x=yes
968 else
969   AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
970 fi
971
972 if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
973   X_INCLUDES=""
974   x_includes="."; dnl better than nothing :-
975  else
976   x_includes=$kde_x_includes
977   X_INCLUDES="-I$x_includes"
978 fi
979
980 if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
981   X_LDFLAGS=""
982   x_libraries="/usr/lib"; dnl better than nothing :-
983  else
984   x_libraries=$kde_x_libraries
985   X_LDFLAGS="-L$x_libraries"
986 fi
987 all_includes="$X_INCLUDES"
988 all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
989
990 # Check for libraries that X11R6 Xt/Xaw programs need.
991 ac_save_LDFLAGS="$LDFLAGS"
992 LDFLAGS="$LDFLAGS $X_LDFLAGS"
993 # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
994 # check for ICE first), but we must link in the order -lSM -lICE or
995 # we get undefined symbols.  So assume we have SM if we have ICE.
996 # These have to be linked with before -lX11, unlike the other
997 # libraries we check for below, so use a different variable.
998 #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
999 AC_CHECK_LIB(ICE, IceConnectionNumber,
1000   [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
1001 LDFLAGS="$ac_save_LDFLAGS"
1002
1003 LIB_X11='-lX11 $(LIBSOCKET)'
1004
1005 AC_MSG_CHECKING(for libXext)
1006 AC_CACHE_VAL(kde_cv_have_libXext,
1007 [
1008 kde_ldflags_safe="$LDFLAGS"
1009 kde_libs_safe="$LIBS"
1010
1011 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
1012 LIBS="-lXext -lX11 $LIBSOCKET"
1013
1014 AC_TRY_LINK([
1015 #include <stdio.h>
1016 #ifdef STDC_HEADERS
1017 # include <stdlib.h>
1018 #endif
1019 ],
1020 [
1021 printf("hello Xext\n");
1022 ],
1023 kde_cv_have_libXext=yes,
1024 kde_cv_have_libXext=no
1025 )
1026
1027 LDFLAGS=$kde_ldflags_safe
1028 LIBS=$kde_libs_safe
1029 ])
1030
1031 AC_MSG_RESULT($kde_cv_have_libXext)
1032
1033 if test "$kde_cv_have_libXext" = "no"; then
1034   AC_MSG_ERROR([We need a working libXext to proceed. Since configure
1035 can't find it itself, we stop here assuming that make wouldn't find
1036 them either.])
1037 fi
1038
1039 LIB_XEXT="-lXext"
1040 QTE_NORTTI=""
1041
1042 elif test "$kde_use_qt_emb" = "yes"; then
1043   dnl We're using QT Embedded
1044   CPPFLAGS=-DQWS
1045   CXXFLAGS="$CXXFLAGS -fno-rtti"
1046   QTE_NORTTI="-fno-rtti -DQWS"
1047   X_PRE_LIBS=""
1048   LIB_X11=""
1049   LIB_XEXT=""
1050   LIB_XRENDER=""
1051   LIBSM=""
1052   X_INCLUDES=""
1053   X_LDFLAGS=""
1054   x_includes=""
1055   x_libraries=""
1056 elif test "$kde_use_qt_mac" = "yes"; then
1057   dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
1058   dnl be included to get the information) --Sam
1059   CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
1060   CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
1061   X_PRE_LIBS=""
1062   LIB_X11=""
1063   LIB_XEXT=""
1064   LIB_XRENDER=""
1065   LIBSM=""
1066   X_INCLUDES=""
1067   X_LDFLAGS=""
1068   x_includes=""
1069   x_libraries=""
1070 fi
1071 AC_SUBST(X_PRE_LIBS)
1072 AC_SUBST(LIB_X11)
1073 AC_SUBST(LIB_XRENDER)
1074 AC_SUBST(LIBSM)
1075 AC_SUBST(X_INCLUDES)
1076 AC_SUBST(X_LDFLAGS)
1077 AC_SUBST(x_includes)
1078 AC_SUBST(x_libraries)
1079 AC_SUBST(QTE_NORTTI)
1080 AC_SUBST(LIB_XEXT)
1081
1082 ])
1083
1084 AC_DEFUN([KDE_PRINT_QT_PROGRAM],
1085 [
1086 AC_REQUIRE([KDE_USE_QT])
1087 cat > conftest.$ac_ext <<EOF
1088 #include "confdefs.h"
1089 #include <qglobal.h>
1090 #include <qapplication.h>
1091 EOF
1092 if test "$kde_qtver" = "2"; then
1093 cat >> conftest.$ac_ext <<EOF
1094 #include <qevent.h>
1095 #include <qstring.h>
1096 #include <qstyle.h>
1097 EOF
1098
1099 if test $kde_qtsubver -gt 0; then
1100 cat >> conftest.$ac_ext <<EOF
1101 #if QT_VERSION < 210
1102 #error 1
1103 #endif
1104 EOF
1105 fi
1106 fi
1107
1108 if test "$kde_qtver" = "3"; then
1109 cat >> conftest.$ac_ext <<EOF
1110 #include <qcursor.h>
1111 #include <qstylefactory.h>
1112 #include <private/qucomextra_p.h>
1113 EOF
1114 fi
1115
1116 echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
1117 cat >> conftest.$ac_ext <<EOF
1118 #error 1
1119 #endif
1120
1121 int main() {
1122 EOF
1123 if test "$kde_qtver" = "2"; then
1124 cat >> conftest.$ac_ext <<EOF
1125     QStringList *t = new QStringList();
1126     Q_UNUSED(t);
1127 EOF
1128 if test $kde_qtsubver -gt 0; then
1129 cat >> conftest.$ac_ext <<EOF
1130     QString s;
1131     s.setLatin1("Elvis is alive", 14);
1132 EOF
1133 fi
1134 fi
1135 if test "$kde_qtver" = "3"; then
1136 cat >> conftest.$ac_ext <<EOF
1137     (void)QStyleFactory::create(QString::null);
1138     QCursor c(Qt::WhatsThisCursor);
1139 EOF
1140 fi
1141 cat >> conftest.$ac_ext <<EOF
1142     return 0;
1143 }
1144 EOF
1145 ])
1146
1147 AC_DEFUN([KDE_USE_QT],
1148 [
1149 if test -z "$1"; then
1150   # Current default Qt version: 3.3
1151   kde_qtver=3
1152   kde_qtsubver=3
1153 else
1154   kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
1155   # following is the check if subversion isnt found in passed argument
1156   if test "$kde_qtsubver" = "$1"; then
1157     kde_qtsubver=1
1158   fi
1159   kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
1160   if test "$kde_qtver" = "1"; then
1161     kde_qtsubver=42
1162   fi
1163 fi
1164
1165 if test -z "$2"; then
1166   if test "$kde_qtver" = "2"; then
1167     if test $kde_qtsubver -gt 0; then
1168       kde_qt_minversion=">= Qt 2.2.2"
1169     else
1170       kde_qt_minversion=">= Qt 2.0.2"
1171     fi
1172   fi
1173   if test "$kde_qtver" = "3"; then
1174     if test $kde_qtsubver -gt 0; then
1175          if test $kde_qtsubver -gt 1; then
1176             if test $kde_qtsubver -gt 2; then
1177                 kde_qt_minversion=">= Qt 3.3"
1178             else
1179                 kde_qt_minversion=">= Qt 3.2"
1180             fi
1181          else
1182             kde_qt_minversion=">= Qt 3.1 (20021021)"
1183          fi
1184     else
1185       kde_qt_minversion=">= Qt 3.0"
1186     fi
1187   fi
1188   if test "$kde_qtver" = "1"; then
1189     kde_qt_minversion=">= 1.42 and < 2.0"
1190   fi
1191 else
1192    kde_qt_minversion="$2"
1193 fi
1194
1195 if test -z "$3"; then
1196    if test $kde_qtver = 3; then
1197      if test $kde_qtsubver -gt 0; then
1198        kde_qt_verstring="QT_VERSION >= 0x03@VER@00 && QT_VERSION < 0x040000"
1199        qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
1200        kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
1201      else
1202        kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000"
1203      fi
1204    fi
1205    if test $kde_qtver = 2; then
1206      if test $kde_qtsubver -gt 0; then
1207        kde_qt_verstring="QT_VERSION >= 222"
1208      else
1209        kde_qt_verstring="QT_VERSION >= 200"
1210      fi
1211    fi
1212    if test $kde_qtver = 1; then
1213     kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
1214    fi
1215 else
1216    kde_qt_verstring="$3"
1217 fi
1218
1219 if test $kde_qtver = 3; then
1220   kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3"
1221 fi
1222 if test $kde_qtver = 2; then
1223    kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
1224 fi
1225 if test $kde_qtver = 1; then
1226    kde_qt_dirs="$QTDIR /usr/lib/qt"
1227 fi
1228 ])
1229
1230 AC_DEFUN([KDE_CHECK_QT_DIRECT],
1231 [
1232 AC_REQUIRE([KDE_USE_QT])
1233 AC_MSG_CHECKING([if Qt compiles without flags])
1234 AC_CACHE_VAL(kde_cv_qt_direct,
1235 [
1236 AC_LANG_SAVE
1237 AC_LANG_CPLUSPLUS
1238 ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
1239 ac_LIBRARY_PATH="$LIBRARY_PATH"
1240 ac_cxxflags_safe="$CXXFLAGS"
1241 ac_ldflags_safe="$LDFLAGS"
1242 ac_libs_safe="$LIBS"
1243
1244 CXXFLAGS="$CXXFLAGS -I$qt_includes"
1245 LDFLAGS="$LDFLAGS $X_LDFLAGS"
1246 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1247 LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
1248 else
1249 LIBS="$LIBQT $LIBSOCKET"
1250 fi
1251 LD_LIBRARY_PATH=
1252 export LD_LIBRARY_PATH
1253 LIBRARY_PATH=
1254 export LIBRARY_PATH
1255
1256 KDE_PRINT_QT_PROGRAM
1257
1258 if AC_TRY_EVAL(ac_link) && test -s conftest; then
1259   kde_cv_qt_direct="yes"
1260 else
1261   kde_cv_qt_direct="no"
1262   echo "configure: failed program was:" >&AC_FD_CC
1263   cat conftest.$ac_ext >&AC_FD_CC
1264 fi
1265
1266 rm -f conftest*
1267 CXXFLAGS="$ac_cxxflags_safe"
1268 LDFLAGS="$ac_ldflags_safe"
1269 LIBS="$ac_libs_safe"
1270
1271 LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
1272 export LD_LIBRARY_PATH
1273 LIBRARY_PATH="$ac_LIBRARY_PATH"
1274 export LIBRARY_PATH
1275 AC_LANG_RESTORE
1276 ])
1277
1278 if test "$kde_cv_qt_direct" = "yes"; then
1279   AC_MSG_RESULT(yes)
1280   $1
1281 else
1282   AC_MSG_RESULT(no)
1283   $2
1284 fi
1285 ])
1286
1287 dnl ------------------------------------------------------------------------
1288 dnl Try to find the Qt headers and libraries.
1289 dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
1290 dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
1291 dnl ------------------------------------------------------------------------
1292 dnl
1293 AC_DEFUN([AC_PATH_QT_1_3],
1294 [
1295 AC_REQUIRE([K_PATH_X])
1296 AC_REQUIRE([KDE_USE_QT])
1297 AC_REQUIRE([KDE_CHECK_LIB64])
1298
1299 dnl ------------------------------------------------------------------------
1300 dnl Add configure flag to enable linking to MT version of Qt library.
1301 dnl ------------------------------------------------------------------------
1302
1303 AC_ARG_ENABLE(
1304   mt,
1305   AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]),
1306   kde_use_qt_mt=$enableval,
1307   [
1308     if test $kde_qtver = 3; then
1309       kde_use_qt_mt=yes
1310     else
1311       kde_use_qt_mt=no
1312     fi
1313   ]
1314 )
1315
1316 USING_QT_MT=""
1317
1318 dnl ------------------------------------------------------------------------
1319 dnl If we not get --disable-qt-mt then adjust some vars for the host.
1320 dnl ------------------------------------------------------------------------
1321
1322 KDE_MT_LDFLAGS=
1323 KDE_MT_LIBS=
1324 if test "x$kde_use_qt_mt" = "xyes"; then
1325   KDE_CHECK_THREADING
1326   if test "x$kde_use_threading" = "xyes"; then
1327     CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
1328     KDE_MT_LDFLAGS="$USE_THREADS"
1329     KDE_MT_LIBS="$LIBPTHREAD"
1330   else
1331     kde_use_qt_mt=no
1332   fi
1333 fi
1334 AC_SUBST(KDE_MT_LDFLAGS)
1335 AC_SUBST(KDE_MT_LIBS)
1336
1337 kde_qt_was_given=yes
1338
1339 dnl ------------------------------------------------------------------------
1340 dnl If we haven't been told how to link to Qt, we work it out for ourselves.
1341 dnl ------------------------------------------------------------------------
1342 if test -z "$LIBQT_GLOB"; then
1343   if test "x$kde_use_qt_emb" = "xyes"; then
1344     LIBQT_GLOB="libqte.*"
1345   else
1346     LIBQT_GLOB="libqt.*"
1347   fi
1348 fi
1349
1350 if test -z "$LIBQT"; then
1351 dnl ------------------------------------------------------------
1352 dnl If we got --enable-embedded then adjust the Qt library name.
1353 dnl ------------------------------------------------------------
1354   if test "x$kde_use_qt_emb" = "xyes"; then
1355     qtlib="qte"
1356   else
1357     qtlib="qt"
1358   fi
1359
1360   kde_int_qt="-l$qtlib"
1361 else
1362   kde_int_qt="$LIBQT"
1363   kde_lib_qt_set=yes
1364 fi
1365
1366 if test -z "$LIBQPE"; then
1367 dnl ------------------------------------------------------------
1368 dnl If we got --enable-palmtop then add -lqpe to the link line
1369 dnl ------------------------------------------------------------
1370   if test "x$kde_use_qt_emb" = "xyes"; then
1371     if test "x$kde_use_qt_emb_palm" = "xyes"; then
1372       LIB_QPE="-lqpe"
1373     else
1374       LIB_QPE=""
1375     fi
1376   else
1377     LIB_QPE=""
1378   fi
1379 fi
1380
1381 dnl ------------------------------------------------------------------------
1382 dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
1383 dnl ------------------------------------------------------------------------
1384
1385 if test "x$kde_use_qt_mt" = "xyes"; then
1386   if test -z "$LIBQT"; then
1387     LIBQT="-l$qtlib-mt"
1388     kde_int_qt="-l$qtlib-mt"
1389   else
1390     LIBQT="$qtlib-mt"
1391     kde_int_qt="$qtlib-mt"
1392   fi
1393   LIBQT_GLOB="lib$qtlib-mt.*"
1394   USING_QT_MT="using -mt"
1395 else
1396   LIBQT="-l$qtlib"
1397 fi
1398
1399 if test $kde_qtver != 1; then
1400
1401   AC_REQUIRE([AC_FIND_PNG])
1402   AC_REQUIRE([AC_FIND_JPEG])
1403   LIBQT="$LIBQT $LIBPNG $LIBJPEG"
1404 fi
1405
1406 if test $kde_qtver = 3; then
1407   AC_REQUIRE([KDE_CHECK_LIBDL])
1408   LIBQT="$LIBQT $LIBDL"
1409 fi
1410
1411 AC_MSG_CHECKING([for Qt])
1412
1413 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1414 LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
1415 fi
1416 ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
1417 qt_libraries=""
1418 qt_includes=""
1419 AC_ARG_WITH(qt-dir,
1420     AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]),
1421     [  ac_qt_includes="$withval"/include
1422        ac_qt_libraries="$withval"/lib${kdelibsuff}
1423        ac_qt_bindir="$withval"/bin
1424     ])
1425
1426 AC_ARG_WITH(qt-includes,
1427     AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]),
1428     [
1429        ac_qt_includes="$withval"
1430     ])
1431
1432 kde_qt_libs_given=no
1433
1434 AC_ARG_WITH(qt-libraries,
1435     AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]),
1436     [  ac_qt_libraries="$withval"
1437        kde_qt_libs_given=yes
1438     ])
1439
1440 AC_CACHE_VAL(ac_cv_have_qt,
1441 [#try to guess Qt locations
1442
1443 qt_incdirs=""
1444 for dir in $kde_qt_dirs; do
1445    qt_incdirs="$qt_incdirs $dir/include $dir"
1446 done
1447 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 /usr/include/qt3 $x_includes"
1448 if test ! "$ac_qt_includes" = "NO"; then
1449    qt_incdirs="$ac_qt_includes $qt_incdirs"
1450 fi
1451
1452 if test "$kde_qtver" != "1"; then
1453   kde_qt_header=qstyle.h
1454 else
1455   kde_qt_header=qglobal.h
1456 fi
1457
1458 AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
1459 ac_qt_includes="$qt_incdir"
1460
1461 qt_libdirs=""
1462 for dir in $kde_qt_dirs; do
1463    qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir"
1464 done
1465 qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
1466 if test ! "$ac_qt_libraries" = "NO"; then
1467   qt_libdir=$ac_qt_libraries
1468 else
1469   qt_libdirs="$ac_qt_libraries $qt_libdirs"
1470   # if the Qt was given, the chance is too big that libqt.* doesn't exist
1471   qt_libdir=NONE
1472   for dir in $qt_libdirs; do
1473     try="ls -1 $dir/${LIBQT_GLOB}"
1474     if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
1475   done
1476 fi
1477 for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
1478   if test -e "$a"; then
1479     LIBQT="$LIBQT ${kde_int_qt}_incremental"
1480     break
1481   fi
1482 done
1483
1484 ac_qt_libraries="$qt_libdir"
1485
1486 AC_LANG_SAVE
1487 AC_LANG_CPLUSPLUS
1488
1489 ac_cxxflags_safe="$CXXFLAGS"
1490 ac_ldflags_safe="$LDFLAGS"
1491 ac_libs_safe="$LIBS"
1492
1493 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
1494 LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
1495 LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
1496
1497 KDE_PRINT_QT_PROGRAM
1498
1499 if AC_TRY_EVAL(ac_link) && test -s conftest; then
1500   rm -f conftest*
1501 else
1502   echo "configure: failed program was:" >&AC_FD_CC
1503   cat conftest.$ac_ext >&AC_FD_CC
1504   ac_qt_libraries="NO"
1505 fi
1506 rm -f conftest*
1507 CXXFLAGS="$ac_cxxflags_safe"
1508 LDFLAGS="$ac_ldflags_safe"
1509 LIBS="$ac_libs_safe"
1510
1511 AC_LANG_RESTORE
1512 if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
1513   ac_cv_have_qt="have_qt=no"
1514   ac_qt_notfound=""
1515   missing_qt_mt=""
1516   if test "$ac_qt_includes" = NO; then
1517     if test "$ac_qt_libraries" = NO; then
1518       ac_qt_notfound="(headers and libraries)";
1519     else
1520       ac_qt_notfound="(headers)";
1521     fi
1522   else
1523     if test "x$kde_use_qt_mt" = "xyes"; then
1524        missing_qt_mt="
1525 Make sure that you have compiled Qt with thread support!"
1526        ac_qt_notfound="(library $qtlib-mt)";
1527     else
1528        ac_qt_notfound="(library $qtlib)";
1529     fi
1530   fi
1531
1532   AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
1533 For more details about this problem, look at the end of config.log.$missing_qt_mt])
1534 else
1535   have_qt="yes"
1536 fi
1537 ])
1538
1539 eval "$ac_cv_have_qt"
1540
1541 if test "$have_qt" != yes; then
1542   AC_MSG_RESULT([$have_qt]);
1543 else
1544   ac_cv_have_qt="have_qt=yes \
1545     ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
1546   AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
1547
1548   qt_libraries="$ac_qt_libraries"
1549   qt_includes="$ac_qt_includes"
1550 fi
1551
1552 if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
1553      KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
1554 fi
1555
1556 AC_SUBST(qt_libraries)
1557 AC_SUBST(qt_includes)
1558
1559 if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
1560  QT_INCLUDES=""
1561 else
1562  QT_INCLUDES="-I$qt_includes"
1563  all_includes="$QT_INCLUDES $all_includes"
1564 fi
1565
1566 if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
1567  QT_LDFLAGS=""
1568 else
1569  QT_LDFLAGS="-L$qt_libraries"
1570  all_libraries="$QT_LDFLAGS $all_libraries"
1571 fi
1572 test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
1573
1574 AC_SUBST(QT_INCLUDES)
1575 AC_SUBST(QT_LDFLAGS)
1576 AC_PATH_QT_MOC_UIC
1577
1578 KDE_CHECK_QT_JPEG
1579
1580 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1581 LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
1582 else
1583 LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
1584 fi
1585 test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
1586 for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
1587   if test -e "$a"; then
1588      LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
1589      break
1590   fi
1591 done
1592
1593 AC_SUBST(LIB_QT)
1594 AC_SUBST(LIB_QPE)
1595
1596 AC_SUBST(kde_qtver)
1597 ])
1598
1599 AC_DEFUN([AC_PATH_QT],
1600 [
1601 AC_PATH_QT_1_3
1602 ])
1603
1604 AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
1605 [
1606 AC_REQUIRE([AC_PATH_QT_MOC_UIC])
1607
1608 if test x$ac_uic_supports_libpath = xyes; then
1609
1610 AC_MSG_CHECKING([if UIC has KDE plugins available])
1611 AC_CACHE_VAL(kde_cv_uic_plugins,
1612 [
1613 cat > actest.ui << EOF
1614 <!DOCTYPE UI><UI version="3.0" stdsetdef="1">
1615 <class>NewConnectionDialog</class>
1616 <widget class="QDialog">
1617    <widget class="KLineEdit">
1618         <property name="name">
1619            <cstring>testInput</cstring>
1620         </property>
1621    </widget>
1622 </widget>
1623 </UI>
1624 EOF
1625        
1626
1627
1628 kde_cv_uic_plugins=no
1629 kde_line="$UIC_PATH -L $kde_widgetdir"
1630 if test x$ac_uic_supports_nounload = xyes; then
1631    kde_line="$kde_line -nounload"
1632 fi
1633 kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
1634 if AC_TRY_EVAL(kde_line); then
1635         # if you're trying to debug this check and think it's incorrect,
1636         # better check your installation. The check _is_ correct - your
1637         # installation is not.
1638         if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
1639                 kde_cv_uic_plugins=yes
1640         fi
1641 fi
1642 rm -f actest.ui actest.cpp
1643 ])
1644
1645 AC_MSG_RESULT([$kde_cv_uic_plugins])
1646 if test "$kde_cv_uic_plugins" != yes; then
1647         AC_MSG_ERROR([you need to install kdelibs first.])
1648 fi
1649 fi
1650 ])
1651
1652 AC_DEFUN([KDE_CHECK_FINAL],
1653 [
1654   AC_ARG_ENABLE(final,
1655         AC_HELP_STRING([--enable-final],
1656                        [build size optimized apps (experimental - needs lots of memory)]),
1657         kde_use_final=$enableval, kde_use_final=no)
1658
1659   if test "x$kde_use_final" = "xyes"; then
1660       KDE_USE_FINAL_TRUE=""
1661       KDE_USE_FINAL_FALSE="#"
1662    else
1663       KDE_USE_FINAL_TRUE="#"
1664       KDE_USE_FINAL_FALSE=""
1665   fi
1666   AC_SUBST(KDE_USE_FINAL_TRUE)
1667   AC_SUBST(KDE_USE_FINAL_FALSE)
1668 ])
1669
1670 AC_DEFUN([KDE_CHECK_CLOSURE],
1671 [
1672   AC_ARG_ENABLE(closure,
1673                 AC_HELP_STRING([--enable-closure],[delay template instantiation]),
1674         kde_use_closure=$enableval, kde_use_closure=no)
1675
1676   KDE_NO_UNDEFINED=""
1677   if test "x$kde_use_closure" = "xyes"; then
1678        KDE_USE_CLOSURE_TRUE=""
1679        KDE_USE_CLOSURE_FALSE="#"
1680 #       CXXFLAGS="$CXXFLAGS $REPO"
1681   else
1682        KDE_USE_CLOSURE_TRUE="#"
1683        KDE_USE_CLOSURE_FALSE=""
1684        KDE_NO_UNDEFINED=""
1685        case $host in 
1686          *-*-linux-gnu)
1687            KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
1688                 [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
1689                 [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
1690                 [KDE_NO_UNDEFINED=""])],
1691             [KDE_NO_UNDEFINED=""])
1692            ;;
1693        esac
1694   fi
1695   AC_SUBST(KDE_USE_CLOSURE_TRUE)
1696   AC_SUBST(KDE_USE_CLOSURE_FALSE)
1697   AC_SUBST(KDE_NO_UNDEFINED)
1698 ])
1699
1700 dnl Check if the linker supports --enable-new-dtags and --as-needed
1701 AC_DEFUN([KDE_CHECK_NEW_LDFLAGS],
1702 [
1703   AC_ARG_ENABLE(new_ldflags,
1704                 AC_HELP_STRING([--enable-new-ldflags],
1705                 [enable the new linker flags]),
1706         kde_use_new_ldflags=$enableval, 
1707         kde_use_new_ldflags=no)
1708
1709   LDFLAGS_AS_NEEDED=""
1710   LDFLAGS_NEW_DTAGS=""
1711   if test "x$kde_use_new_ldflags" = "xyes"; then
1712        LDFLAGS_NEW_DTAGS=""
1713        KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags],
1714                 [LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],)
1715
1716        KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
1717                 [LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
1718   fi
1719   AC_SUBST(LDFLAGS_AS_NEEDED)
1720   AC_SUBST(LDFLAGS_NEW_DTAGS)
1721 ])
1722
1723 AC_DEFUN([KDE_CHECK_NMCHECK],
1724 [
1725   AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
1726         kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
1727
1728   if test "$kde_use_nmcheck" = "yes"; then
1729       KDE_USE_NMCHECK_TRUE=""
1730       KDE_USE_NMCHECK_FALSE="#"
1731    else
1732       KDE_USE_NMCHECK_TRUE="#"
1733       KDE_USE_NMCHECK_FALSE=""
1734   fi
1735   AC_SUBST(KDE_USE_NMCHECK_TRUE)
1736   AC_SUBST(KDE_USE_NMCHECK_FALSE)
1737 ])
1738
1739 AC_DEFUN([KDE_EXPAND_MAKEVAR], [
1740 savex=$exec_prefix
1741 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1742 tmp=$$2
1743 while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
1744 exec_prefix=$savex
1745 ])
1746
1747 dnl ------------------------------------------------------------------------
1748 dnl Now, the same with KDE
1749 dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
1750 dnl and $(kde_includes) will be the kdehdrlocation (if needed)
1751 dnl ------------------------------------------------------------------------
1752 dnl
1753 AC_DEFUN([AC_BASE_PATH_KDE],
1754 [
1755 AC_REQUIRE([KDE_CHECK_STL])
1756 AC_REQUIRE([AC_PATH_QT])dnl
1757 AC_REQUIRE([KDE_CHECK_LIB64])
1758
1759 AC_CHECK_RPATH
1760 AC_MSG_CHECKING([for KDE])
1761
1762 if test "${prefix}" != NONE; then
1763   kde_includes=${includedir}
1764   KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
1765
1766   kde_libraries=${libdir}
1767   KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
1768
1769 else
1770   ac_kde_includes=
1771   ac_kde_libraries=
1772   kde_libraries=""
1773   kde_includes=""
1774 fi
1775
1776 AC_CACHE_VAL(ac_cv_have_kde,
1777 [#try to guess kde locations
1778
1779 if test "$kde_qtver" = 1; then
1780   kde_check_header="ksock.h"
1781   kde_check_lib="libkdecore.la"
1782 else
1783   kde_check_header="ksharedptr.h"
1784   kde_check_lib="libkio.la"
1785 fi
1786
1787 if test -z "$1"; then
1788
1789 kde_incdirs="$kde_libs_prefix/include /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"
1790 test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
1791 kde_incdirs="$ac_kde_includes $kde_incdirs"
1792 AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
1793 ac_kde_includes="$kde_incdir"
1794
1795 if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
1796   AC_MSG_ERROR([
1797 in the prefix, you've chosen, are no KDE headers installed. This will fail.
1798 So, check this please and use another prefix!])
1799 fi
1800
1801 kde_libdirs="$kde_libs_prefix/lib${kdelibsuff} /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}"
1802 test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
1803 kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
1804 AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
1805 ac_kde_libraries="$kde_libdir"
1806
1807 kde_widgetdir=NO
1808 dnl this might be somewhere else
1809 AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
1810
1811 if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
1812 AC_MSG_ERROR([
1813 in the prefix, you've chosen, are no KDE libraries installed. This will fail.
1814 So, check this please and use another prefix!])
1815 fi
1816
1817 if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
1818 AC_MSG_ERROR([
1819 I can't find the designer plugins. These are required and should have been installed
1820 by kdelibs])
1821 fi
1822
1823 if test -n "$kde_widgetdir"; then
1824     kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
1825 fi
1826
1827
1828 if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
1829   ac_cv_have_kde="have_kde=no"
1830 else
1831   ac_cv_have_kde="have_kde=yes \
1832     ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1833 fi
1834
1835 else dnl test -z $1, e.g. from kdelibs
1836
1837   ac_cv_have_kde="have_kde=no"
1838
1839 fi
1840 ])dnl
1841
1842 eval "$ac_cv_have_kde"
1843
1844 if test "$have_kde" != "yes"; then
1845  if test "${prefix}" = NONE; then
1846   ac_kde_prefix="$ac_default_prefix"
1847  else
1848   ac_kde_prefix="$prefix"
1849  fi
1850  if test "$exec_prefix" = NONE; then
1851   ac_kde_exec_prefix="$ac_kde_prefix"
1852   AC_MSG_RESULT([will be installed in $ac_kde_prefix])
1853  else
1854   ac_kde_exec_prefix="$exec_prefix"
1855   AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
1856  fi
1857
1858  kde_libraries="${libdir}"
1859  kde_includes="${includedir}"
1860
1861 else
1862   ac_cv_have_kde="have_kde=yes \
1863     ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1864   AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
1865
1866   kde_libraries="$ac_kde_libraries"
1867   kde_includes="$ac_kde_includes"
1868 fi
1869 AC_SUBST(kde_libraries)
1870 AC_SUBST(kde_includes)
1871
1872 if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes"  || test "$kde_includes" = "/usr/include"; then
1873  KDE_INCLUDES=""
1874 else
1875  KDE_INCLUDES="-I$kde_includes"
1876  all_includes="$KDE_INCLUDES $all_includes"
1877 fi
1878
1879 KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
1880  
1881 KDE_LDFLAGS="-L$kde_libraries"
1882 if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then 
1883  all_libraries="$KDE_LDFLAGS $all_libraries"
1884 fi
1885
1886 AC_SUBST(KDE_LDFLAGS)
1887 AC_SUBST(KDE_INCLUDES)
1888
1889 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1890
1891 all_libraries="$all_libraries $USER_LDFLAGS"
1892 all_includes="$all_includes $USER_INCLUDES"
1893 AC_SUBST(all_includes)
1894 AC_SUBST(all_libraries)
1895
1896 if test -z "$1"; then
1897 KDE_CHECK_UIC_PLUGINS
1898 fi
1899
1900 ac_kde_libraries="$kde_libdir"
1901
1902 AC_SUBST(AUTODIRS)
1903
1904
1905 ])
1906
1907 AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
1908 [
1909 AC_MSG_CHECKING(for extra includes)
1910 AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
1911   kde_use_extra_includes="$withval",
1912   kde_use_extra_includes=NONE
1913 )
1914 kde_extra_includes=
1915 if test -n "$kde_use_extra_includes" && \
1916    test "$kde_use_extra_includes" != "NONE"; then
1917
1918    ac_save_ifs=$IFS
1919    IFS=':'
1920    for dir in $kde_use_extra_includes; do
1921      kde_extra_includes="$kde_extra_includes $dir"
1922      USER_INCLUDES="$USER_INCLUDES -I$dir"
1923    done
1924    IFS=$ac_save_ifs
1925    kde_use_extra_includes="added"
1926 else
1927    kde_use_extra_includes="no"
1928 fi
1929 AC_SUBST(USER_INCLUDES)
1930
1931 AC_MSG_RESULT($kde_use_extra_includes)
1932
1933 kde_extra_libs=
1934 AC_MSG_CHECKING(for extra libs)
1935 AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
1936   kde_use_extra_libs=$withval,
1937   kde_use_extra_libs=NONE
1938 )
1939 if test -n "$kde_use_extra_libs" && \
1940    test "$kde_use_extra_libs" != "NONE"; then
1941
1942    ac_save_ifs=$IFS
1943    IFS=':'
1944    for dir in $kde_use_extra_libs; do
1945      kde_extra_libs="$kde_extra_libs $dir"
1946      KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
1947      USER_LDFLAGS="$USER_LDFLAGS -L$dir"
1948    done
1949    IFS=$ac_save_ifs
1950    kde_use_extra_libs="added"
1951 else
1952    kde_use_extra_libs="no"
1953 fi
1954
1955 AC_SUBST(USER_LDFLAGS)
1956
1957 AC_MSG_RESULT($kde_use_extra_libs)
1958
1959 ])
1960
1961 AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
1962 [
1963     AC_MSG_CHECKING([for KDE headers installed])
1964     AC_LANG_SAVE
1965     AC_LANG_CPLUSPLUS
1966 cat > conftest.$ac_ext <<EOF
1967 #ifdef STDC_HEADERS
1968 # include <stdlib.h>
1969 #endif
1970 #include <stdio.h>
1971 #include "confdefs.h"
1972 #include <kapp.h>
1973
1974 int main() {
1975     printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
1976     printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
1977     printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
1978     printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
1979     printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
1980     printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
1981     printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
1982     printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
1983     printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
1984     printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
1985     printf("kde_wallpaperdir=\\"%s\\"\n",
1986         KApplication::kde_wallpaperdir().data());
1987     printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
1988     printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
1989     printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
1990     printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
1991     printf("kde_moduledir=\\"/tmp/dummy\\"\n");
1992     printf("kde_styledir=\\"/tmp/dummy\\"\n");
1993     printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
1994     printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
1995     printf("xdg_menudir=\\"/tmp/dummy\\"\n");
1996     printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
1997     printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
1998     return 0;
1999     }
2000 EOF
2001
2002  ac_save_CPPFLAGS=$CPPFLAGS
2003  CPPFLAGS="$all_includes $CPPFLAGS"
2004  if AC_TRY_EVAL(ac_compile); then
2005    AC_MSG_RESULT(yes)
2006  else
2007    AC_MSG_ERROR([your system is not able to compile a small KDE application!
2008 Check, if you installed the KDE header files correctly.
2009 For more details about this problem, look at the end of config.log.])
2010   fi
2011   CPPFLAGS=$ac_save_CPPFLAGS
2012
2013   AC_LANG_RESTORE
2014 ])
2015
2016 AC_DEFUN([KDE_CHECK_KDEQTADDON],
2017 [
2018 AC_MSG_CHECKING(for kde-qt-addon)
2019 AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
2020 [
2021  kde_ldflags_safe="$LDFLAGS"
2022  kde_libs_safe="$LIBS"
2023  kde_cxxflags_safe="$CXXFLAGS"
2024
2025  LIBS="-lkde-qt-addon $LIBQT $LIBS"
2026  CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
2027  LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
2028
2029  AC_TRY_LINK([
2030    #include <qdom.h>
2031  ],
2032  [
2033    QDomDocument doc;
2034  ],
2035   kde_cv_have_kdeqtaddon=yes,
2036   kde_cv_have_kdeqtaddon=no
2037  )
2038
2039  LDFLAGS=$kde_ldflags_safe
2040  LIBS=$kde_libs_safe
2041  CXXFLAGS=$kde_cxxflags_safe
2042 ])
2043
2044 AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
2045
2046 if test "$kde_cv_have_kdeqtaddon" = "no"; then
2047   AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
2048 It is a separate package (and CVS module) named kde-qt-addon.])
2049 fi
2050 ])
2051
2052 AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
2053 [
2054    AC_REQUIRE([KDE_MISC_TESTS])
2055    AC_REQUIRE([KDE_CHECK_LIBDL])
2056    AC_REQUIRE([K_PATH_X])
2057
2058 if test $kde_qtver = 3; then
2059    AC_SUBST(LIB_KDECORE, "-lkdecore")
2060    AC_SUBST(LIB_KDEUI, "-lkdeui")
2061    AC_SUBST(LIB_KIO, "-lkio")
2062    AC_SUBST(LIB_KJS, "-lkjs")
2063    AC_SUBST(LIB_SMB, "-lsmb")
2064    AC_SUBST(LIB_KAB, "-lkab")
2065    AC_SUBST(LIB_KABC, "-lkabc")
2066    AC_SUBST(LIB_KHTML, "-lkhtml")
2067    AC_SUBST(LIB_KSPELL, "-lkspell")
2068    AC_SUBST(LIB_KPARTS, "-lkparts")
2069    AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2070    AC_SUBST(LIB_KUTILS, "-lkutils")
2071    AC_SUBST(LIB_KDEPIM, "-lkdepim")
2072    AC_SUBST(LIB_KIMPROXY, "-lkimproxy")
2073    AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
2074    AC_SUBST(LIB_KDNSSD, "-lkdnssd")
2075 # these are for backward compatibility
2076    AC_SUBST(LIB_KSYCOCA, "-lkio")
2077    AC_SUBST(LIB_KFILE, "-lkio")
2078 elif test $kde_qtver = 2; then
2079    AC_SUBST(LIB_KDECORE, "-lkdecore")
2080    AC_SUBST(LIB_KDEUI, "-lkdeui")
2081    AC_SUBST(LIB_KIO, "-lkio")
2082    AC_SUBST(LIB_KSYCOCA, "-lksycoca")
2083    AC_SUBST(LIB_SMB, "-lsmb")
2084    AC_SUBST(LIB_KFILE, "-lkfile")
2085    AC_SUBST(LIB_KAB, "-lkab")
2086    AC_SUBST(LIB_KHTML, "-lkhtml")
2087    AC_SUBST(LIB_KSPELL, "-lkspell")
2088    AC_SUBST(LIB_KPARTS, "-lkparts")
2089    AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2090 else
2091    AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
2092    AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
2093    AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
2094    AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
2095    AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
2096 fi
2097 ])
2098
2099 AC_DEFUN([AC_PATH_KDE],
2100 [
2101   AC_BASE_PATH_KDE
2102   AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
2103   [
2104   if test "$enableval" = "no";
2105     then ac_use_path_checking="default"
2106     else ac_use_path_checking=""
2107   fi
2108   ],
2109   [
2110   if test "$kde_qtver" = 1;
2111     then ac_use_path_checking=""
2112     else ac_use_path_checking="default"
2113   fi
2114   ]
2115   )
2116
2117   AC_CREATE_KFSSTND($ac_use_path_checking)
2118
2119   AC_SUBST_KFSSTND
2120   KDE_CREATE_LIBS_ALIASES
2121 ])
2122
2123 dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
2124 AC_DEFUN([KDE_CHECK_FUNC_EXT],
2125 [
2126 AC_MSG_CHECKING(for $1)
2127 AC_CACHE_VAL(kde_cv_func_$1,
2128 [
2129 AC_LANG_SAVE
2130 AC_LANG_CPLUSPLUS
2131 save_CXXFLAGS="$CXXFLAGS"
2132 kde_safe_LIBS="$LIBS"
2133 LIBS="$LIBS $X_EXTRA_LIBS"
2134 if test "$GXX" = "yes"; then
2135 CXXFLAGS="$CXXFLAGS -pedantic-errors"
2136 fi
2137 AC_TRY_COMPILE([
2138 $2
2139 ],
2140 [
2141 $3
2142 ],
2143 kde_cv_func_$1=yes,
2144 kde_cv_func_$1=no)
2145 CXXFLAGS="$save_CXXFLAGS"
2146 LIBS="$kde_safe_LIBS"
2147 AC_LANG_RESTORE
2148 ])
2149
2150 AC_MSG_RESULT($kde_cv_func_$1)
2151
2152 AC_MSG_CHECKING([if $1 needs custom prototype])
2153 AC_CACHE_VAL(kde_cv_proto_$1,
2154 [
2155 if test "x$kde_cv_func_$1" = xyes; then
2156   kde_cv_proto_$1=no
2157 else
2158   case "$1" in
2159         setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
2160                 kde_cv_proto_$1="yes - in libkdefakes"
2161                 ;;
2162         *)
2163                 kde_cv_proto_$1=unknown
2164                 ;;
2165   esac
2166 fi
2167
2168 if test "x$kde_cv_proto_$1" = xunknown; then
2169
2170 AC_LANG_SAVE
2171 AC_LANG_CPLUSPLUS
2172   kde_safe_libs=$LIBS
2173   LIBS="$LIBS $X_EXTRA_LIBS"
2174   AC_TRY_LINK([
2175 $2
2176
2177 extern "C" $4;
2178 ],
2179 [
2180 $3
2181 ],
2182 [ kde_cv_func_$1=yes
2183   kde_cv_proto_$1=yes ],
2184   [kde_cv_proto_$1="$1 unavailable"]
2185 )
2186 LIBS=$kde_safe_libs
2187 AC_LANG_RESTORE
2188 fi
2189 ])
2190 AC_MSG_RESULT($kde_cv_proto_$1)
2191
2192 if test "x$kde_cv_func_$1" = xyes; then
2193   AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
2194   $6
2195 fi
2196 if test "x$kde_cv_proto_$1" = xno; then
2197   AC_DEFINE(HAVE_$5_PROTO, 1,
2198   [Define if you have the $1 prototype])
2199 fi
2200
2201 AH_VERBATIM([_HAVE_$5_PROTO],
2202 [
2203 #if !defined(HAVE_$5_PROTO)
2204 #ifdef __cplusplus
2205 extern "C" {
2206 #endif
2207 $4;
2208 #ifdef __cplusplus
2209 }
2210 #endif
2211 #endif
2212 ])
2213 ])
2214
2215 AC_DEFUN([AC_CHECK_SETENV],
2216 [
2217         KDE_CHECK_FUNC_EXT(setenv, [
2218 #include <stdlib.h>
2219 ], 
2220                 [setenv("VAR", "VALUE", 1);],
2221                 [int setenv (const char *, const char *, int)],
2222                 [SETENV])
2223 ])
2224
2225 AC_DEFUN([AC_CHECK_UNSETENV],
2226 [
2227         KDE_CHECK_FUNC_EXT(unsetenv, [
2228 #include <stdlib.h>
2229 ], 
2230                 [unsetenv("VAR");],
2231                 [void unsetenv (const char *)],
2232                 [UNSETENV])
2233 ])
2234
2235 AC_DEFUN([AC_CHECK_GETDOMAINNAME],
2236 [
2237         KDE_CHECK_FUNC_EXT(getdomainname, [
2238 #include <stdlib.h>
2239 #include <unistd.h>
2240 #include <netdb.h>
2241 ], 
2242                 [
2243 char buffer[200];
2244 getdomainname(buffer, 200);
2245 ],      
2246                 [#include <sys/types.h>
2247                 int getdomainname (char *, size_t)],
2248                 [GETDOMAINNAME])
2249 ])
2250
2251 AC_DEFUN([AC_CHECK_GETHOSTNAME],
2252 [
2253         KDE_CHECK_FUNC_EXT(gethostname, [
2254 #include <stdlib.h>
2255 #include <unistd.h>
2256 ], 
2257                 [
2258 char buffer[200];
2259 gethostname(buffer, 200);
2260 ],      
2261                 [int gethostname (char *, unsigned int)],
2262                 [GETHOSTNAME])
2263 ])
2264
2265 AC_DEFUN([AC_CHECK_USLEEP],
2266 [
2267         KDE_CHECK_FUNC_EXT(usleep, [
2268 #include <unistd.h>
2269 ], 
2270                 [
2271 usleep(200);
2272 ],      
2273                 [int usleep (unsigned int)],
2274                 [USLEEP])
2275 ])
2276
2277
2278 AC_DEFUN([AC_CHECK_RANDOM],
2279 [
2280         KDE_CHECK_FUNC_EXT(random, [
2281 #include <stdlib.h>
2282 ], 
2283                 [
2284 random();
2285 ],      
2286                 [long int random(void)],
2287                 [RANDOM])
2288
2289         KDE_CHECK_FUNC_EXT(srandom, [
2290 #include <stdlib.h>
2291 ], 
2292                 [
2293 srandom(27);
2294 ],      
2295                 [void srandom(unsigned int)],
2296                 [SRANDOM])
2297
2298 ])
2299
2300 AC_DEFUN([AC_CHECK_INITGROUPS],
2301 [
2302         KDE_CHECK_FUNC_EXT(initgroups, [
2303 #include <sys/types.h>
2304 #include <unistd.h>
2305 #include <grp.h>
2306 ],
2307         [
2308 char buffer[200];
2309 initgroups(buffer, 27);
2310 ],
2311         [int initgroups(const char *, gid_t)],
2312         [INITGROUPS])
2313 ])
2314
2315 AC_DEFUN([AC_CHECK_MKSTEMPS],
2316 [
2317         KDE_CHECK_FUNC_EXT(mkstemps, [
2318 #include <stdlib.h>
2319 #include <unistd.h>
2320 ],
2321         [
2322 mkstemps("/tmp/aaaXXXXXX", 6);
2323 ],
2324         [int mkstemps(char *, int)],
2325         [MKSTEMPS])
2326 ])
2327
2328 AC_DEFUN([AC_CHECK_MKSTEMP],
2329 [
2330         KDE_CHECK_FUNC_EXT(mkstemp, [
2331 #include <stdlib.h>
2332 #include <unistd.h>
2333 ],
2334         [
2335 mkstemp("/tmp/aaaXXXXXX");
2336 ],
2337         [int mkstemp(char *)],
2338         [MKSTEMP])
2339 ])
2340
2341 AC_DEFUN([AC_CHECK_MKDTEMP],
2342 [
2343         KDE_CHECK_FUNC_EXT(mkdtemp, [
2344 #include <stdlib.h>
2345 #include <unistd.h>
2346 ],
2347         [
2348 mkdtemp("/tmp/aaaXXXXXX");
2349 ],
2350         [char *mkdtemp(char *)],
2351         [MKDTEMP])
2352 ])
2353
2354
2355 AC_DEFUN([AC_CHECK_RES_INIT],
2356 [
2357   AC_MSG_CHECKING([if res_init needs -lresolv])
2358   kde_libs_safe="$LIBS"
2359   LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
2360   AC_TRY_LINK(
2361     [
2362 #include <sys/types.h>
2363 #include <netinet/in.h>
2364 #include <arpa/nameser.h>
2365 #include <resolv.h>
2366     ],
2367     [
2368       res_init(); 
2369     ],
2370     [
2371       LIBRESOLV="-lresolv"
2372       AC_MSG_RESULT(yes)
2373       AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2374     ],
2375     [ AC_MSG_RESULT(no) ]
2376   )
2377   LIBS=$kde_libs_safe
2378   AC_SUBST(LIBRESOLV)
2379
2380   KDE_CHECK_FUNC_EXT(res_init,
2381     [
2382 #include <sys/types.h>
2383 #include <netinet/in.h>
2384 #include <arpa/nameser.h>
2385 #include <resolv.h>
2386     ],
2387     [res_init()],
2388     [int res_init(void)],
2389     [RES_INIT])
2390 ])
2391
2392 AC_DEFUN([AC_CHECK_STRLCPY],
2393 [
2394         KDE_CHECK_FUNC_EXT(strlcpy, [
2395 #include <string.h>
2396 ],
2397 [ char buf[20];
2398   strlcpy(buf, "KDE function test", sizeof(buf));
2399 ],
2400         [unsigned long strlcpy(char*, const char*, unsigned long)],
2401         [STRLCPY])
2402 ])
2403
2404 AC_DEFUN([AC_CHECK_STRLCAT],
2405 [
2406         KDE_CHECK_FUNC_EXT(strlcat, [
2407 #include <string.h>
2408 ],
2409 [ char buf[20];
2410   buf[0]='\0';
2411   strlcat(buf, "KDE function test", sizeof(buf));
2412 ],
2413         [unsigned long strlcat(char*, const char*, unsigned long)],
2414         [STRLCAT])
2415 ])
2416
2417 AC_DEFUN([AC_CHECK_RES_QUERY],
2418 [
2419         KDE_CHECK_FUNC_EXT(res_query, [
2420 #include <sys/types.h>
2421 #include <netinet/in.h>
2422 #include <arpa/nameser.h>
2423 #include <resolv.h>
2424 #include <netdb.h>
2425 ],
2426 [
2427 res_query(NULL, 0, 0, NULL, 0);
2428 ],
2429         [int res_query(const char *, int, int, unsigned char *, int)],
2430         [RES_QUERY])
2431 ])
2432
2433 AC_DEFUN([AC_CHECK_DN_SKIPNAME],
2434 [
2435         KDE_CHECK_FUNC_EXT(dn_skipname, [
2436 #include <sys/types.h>
2437 #include <netinet/in.h>
2438 #include <arpa/nameser.h>
2439 #include <resolv.h>
2440 ],
2441 [
2442 dn_skipname (NULL, NULL);
2443 ],
2444         [int dn_skipname (unsigned char *, unsigned char *)],
2445         [DN_SKIPNAME])
2446 ])
2447
2448
2449 AC_DEFUN([AC_FIND_GIF],
2450    [AC_MSG_CHECKING([for giflib])
2451 AC_CACHE_VAL(ac_cv_lib_gif,
2452 [ac_save_LIBS="$LIBS"
2453 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2454 LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
2455 else
2456 LIBS="$all_libraries -lgif"
2457 fi
2458 AC_TRY_LINK(dnl
2459 [
2460 #ifdef __cplusplus
2461 extern "C" {
2462 #endif
2463 int GifLastError(void);
2464 #ifdef __cplusplus
2465 }
2466 #endif
2467 /* We use char because int might match the return type of a gcc2
2468     builtin and then its argument prototype would still apply.  */
2469 ],
2470             [return GifLastError();],
2471             eval "ac_cv_lib_gif=yes",
2472             eval "ac_cv_lib_gif=no")
2473 LIBS="$ac_save_LIBS"
2474 ])dnl
2475 if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
2476   AC_MSG_RESULT(yes)
2477   AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
2478 else
2479   AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
2480 fi
2481 ])
2482
2483 AC_DEFUN([KDE_FIND_JPEG_HELPER],
2484 [
2485 AC_MSG_CHECKING([for libjpeg$2])
2486 AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
2487 [
2488 ac_save_LIBS="$LIBS"
2489 LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
2490 ac_save_CFLAGS="$CFLAGS"
2491 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2492 AC_TRY_LINK(
2493 [/* Override any gcc2 internal prototype to avoid an error.  */
2494 struct jpeg_decompress_struct;
2495 typedef struct jpeg_decompress_struct * j_decompress_ptr;
2496 typedef int size_t;
2497 #ifdef __cplusplus
2498 extern "C" {
2499 #endif
2500     void jpeg_CreateDecompress(j_decompress_ptr cinfo,
2501                                     int version, size_t structsize);
2502 #ifdef __cplusplus
2503 }
2504 #endif
2505 /* We use char because int might match the return type of a gcc2
2506     builtin and then its argument prototype would still apply.  */
2507 ],
2508             [jpeg_CreateDecompress(0L, 0, 0);],
2509             eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
2510             eval "ac_cv_lib_jpeg_$1=no")
2511 LIBS="$ac_save_LIBS"
2512 CFLAGS="$ac_save_CFLAGS"
2513 ])
2514
2515 if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
2516   LIBJPEG="$ac_cv_lib_jpeg_$1"
2517   AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
2518 else
2519   AC_MSG_RESULT(no)
2520   $3
2521 fi
2522
2523 ])
2524
2525 AC_DEFUN([AC_FIND_JPEG],
2526 [
2527 dnl first look for libraries
2528 KDE_FIND_JPEG_HELPER(6b, 6b,
2529    KDE_FIND_JPEG_HELPER(normal, [],
2530     [
2531        LIBJPEG=
2532     ]
2533    )
2534 )
2535
2536 dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
2537 dnl requires system dependent includes loaded before it)
2538 jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
2539 AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
2540 test "x$jpeg_incdir" = xNO && jpeg_incdir=
2541
2542 dnl if headers _and_ libraries are missing, this is no error, and we
2543 dnl continue with a warning (the user will get no jpeg support in khtml)
2544 dnl if only one is missing, it means a configuration error, but we still
2545 dnl only warn
2546 if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
2547   AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
2548 else
2549   if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
2550     AC_MSG_WARN([
2551 There is an installation error in jpeg support. You seem to have only one
2552 of either the headers _or_ the libraries installed. You may need to either
2553 provide correct --with-extra-... options, or the development package of
2554 libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
2555 Disabling JPEG support.
2556 ])
2557   else
2558     AC_MSG_WARN([libjpeg not found. disable JPEG support.])
2559   fi
2560   jpeg_incdir=
2561   LIBJPEG=
2562 fi
2563
2564 AC_SUBST(LIBJPEG)
2565 AH_VERBATIM(_AC_CHECK_JPEG,
2566 [/*
2567  * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
2568  * headers and I'm too lazy to write a configure test as long as only
2569  * unixware is related
2570  */
2571 #ifdef _UNIXWARE
2572 #define HAVE_BOOLEAN
2573 #endif
2574 ])
2575 ])
2576
2577 AC_DEFUN([KDE_CHECK_QT_JPEG],
2578 [
2579 if test -n "$LIBJPEG"; then
2580 AC_MSG_CHECKING([if Qt needs $LIBJPEG])
2581 AC_CACHE_VAL(kde_cv_qt_jpeg,
2582 [
2583 AC_LANG_SAVE
2584 AC_LANG_CPLUSPLUS
2585 ac_save_LIBS="$LIBS"
2586 LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
2587 LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
2588 ac_save_CXXFLAGS="$CXXFLAGS"
2589 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2590 AC_TRY_LINK(
2591 [#include <qapplication.h>],
2592             [
2593             int argc;
2594             char** argv;
2595             QApplication app(argc, argv);],
2596             eval "kde_cv_qt_jpeg=no",
2597             eval "kde_cv_qt_jpeg=yes")
2598 LIBS="$ac_save_LIBS"
2599 CXXFLAGS="$ac_save_CXXFLAGS"
2600 AC_LANG_RESTORE
2601 fi
2602 ])
2603
2604 if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
2605   AC_MSG_RESULT(yes)
2606   LIBJPEG_QT='$(LIBJPEG)'
2607 else
2608   AC_MSG_RESULT(no)
2609   LIBJPEG_QT=
2610 fi
2611
2612 ])
2613
2614 AC_DEFUN([AC_FIND_ZLIB],
2615 [
2616 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2617 AC_MSG_CHECKING([for libz])
2618 AC_CACHE_VAL(ac_cv_lib_z,
2619 [
2620 kde_save_LIBS="$LIBS"
2621 LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
2622 kde_save_CFLAGS="$CFLAGS"
2623 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2624 AC_TRY_LINK(dnl
2625 [
2626 #include<zlib.h>
2627 ],
2628 [
2629   char buf[42];
2630   gzFile f = (gzFile) 0;
2631   /* this would segfault.. but we only link, don't run */
2632   (void) gzgets(f, buf, sizeof(buf));
2633
2634   return (zlibVersion() == ZLIB_VERSION); 
2635 ],
2636             eval "ac_cv_lib_z='-lz'",
2637             eval "ac_cv_lib_z=no")
2638 LIBS="$kde_save_LIBS"
2639 CFLAGS="$kde_save_CFLAGS"
2640 ])dnl
2641 if test ! "$ac_cv_lib_z" = no; then
2642   AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
2643   LIBZ="$ac_cv_lib_z"
2644   AC_MSG_RESULT($ac_cv_lib_z)
2645 else
2646   AC_MSG_ERROR(not found. 
2647           Possibly configure picks up an outdated version
2648           installed by XFree86. Remove it from your system.
2649
2650           Check your installation and look into config.log)
2651   LIBZ=""
2652 fi
2653 AC_SUBST(LIBZ)
2654 ])
2655
2656 AC_DEFUN([KDE_TRY_TIFFLIB],
2657 [
2658 AC_MSG_CHECKING([for libtiff $1])
2659
2660 AC_CACHE_VAL(kde_cv_libtiff_$1,
2661 [
2662 AC_LANG_SAVE
2663 AC_LANG_CPLUSPLUS
2664 kde_save_LIBS="$LIBS"
2665 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2666 LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
2667 else
2668 LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
2669 fi
2670 kde_save_CXXFLAGS="$CXXFLAGS"
2671 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2672
2673 AC_TRY_LINK(dnl
2674 [
2675 #include<tiffio.h>
2676 ],
2677     [return (TIFFOpen( "", "r") == 0); ],
2678 [
2679     kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
2680 ], [
2681     kde_cv_libtiff_$1=no
2682 ])
2683
2684 LIBS="$kde_save_LIBS"
2685 CXXFLAGS="$kde_save_CXXFLAGS"
2686 AC_LANG_RESTORE
2687 ])
2688
2689 if test "$kde_cv_libtiff_$1" = "no"; then
2690     AC_MSG_RESULT(no)
2691     LIBTIFF=""
2692     $3
2693 else
2694     LIBTIFF="$kde_cv_libtiff_$1"
2695     AC_MSG_RESULT(yes)
2696     AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
2697     $2
2698 fi
2699
2700 ])
2701
2702 AC_DEFUN([AC_FIND_TIFF],
2703 [
2704 AC_REQUIRE([K_PATH_X])
2705 AC_REQUIRE([AC_FIND_ZLIB])
2706 AC_REQUIRE([AC_FIND_JPEG])
2707 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2708
2709 KDE_TRY_TIFFLIB(tiff, [],
2710    KDE_TRY_TIFFLIB(tiff34))
2711
2712 AC_SUBST(LIBTIFF)
2713 ])
2714
2715
2716 AC_DEFUN([AC_FIND_PNG],
2717 [
2718 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2719 AC_REQUIRE([AC_FIND_ZLIB])
2720 AC_MSG_CHECKING([for libpng])
2721 AC_CACHE_VAL(ac_cv_lib_png,
2722 [
2723 kde_save_LIBS="$LIBS"
2724 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2725 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
2726 else
2727 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
2728 fi
2729 kde_save_CFLAGS="$CFLAGS"
2730 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2731
2732 AC_TRY_LINK(dnl
2733     [
2734     #include<png.h>
2735     ],
2736     [
2737     png_structp png_ptr = png_create_read_struct(  /* image ptr */
2738                 PNG_LIBPNG_VER_STRING, 0, 0, 0 );
2739     return( png_ptr != 0 );
2740     ],
2741     eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
2742     eval "ac_cv_lib_png=no"
2743 )
2744 LIBS="$kde_save_LIBS"
2745 CFLAGS="$kde_save_CFLAGS"
2746 ])dnl
2747 if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
2748   AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
2749   LIBPNG="$ac_cv_lib_png"
2750   AC_SUBST(LIBPNG)
2751   AC_MSG_RESULT($ac_cv_lib_png)
2752 else
2753   AC_MSG_RESULT(no)
2754   LIBPNG=""
2755   AC_SUBST(LIBPNG)
2756 fi
2757 ])
2758
2759
2760 AC_DEFUN([AC_FIND_JASPER],
2761 [
2762 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2763 AC_REQUIRE([AC_FIND_JPEG])
2764 AC_MSG_CHECKING([for jasper])
2765 AC_CACHE_VAL(ac_cv_jasper,
2766 [
2767 kde_save_LIBS="$LIBS"
2768 LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
2769 kde_save_CFLAGS="$CFLAGS"
2770 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2771
2772 AC_TRY_LINK(dnl
2773     [
2774     #include<jasper/jasper.h>
2775     ],
2776     [
2777     return( jas_init() );
2778     ],
2779     eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
2780     eval "ac_cv_jasper=no"
2781 )
2782 LIBS="$kde_save_LIBS"
2783 CFLAGS="$kde_save_CFLAGS"
2784 ])dnl
2785 if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
2786   AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
2787   LIB_JASPER="$ac_cv_jasper"
2788   AC_MSG_RESULT($ac_cv_jasper)
2789 else
2790   AC_MSG_RESULT(no)
2791   LIB_JASPER=""
2792 fi
2793 AC_SUBST(LIB_JASPER)
2794 ])
2795
2796 AC_DEFUN([AC_CHECK_BOOL],
2797 [
2798   AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
2799 ])
2800
2801 AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
2802 [
2803 AC_MSG_CHECKING(if you need GNU extensions)
2804 AC_CACHE_VAL(ac_cv_gnu_extensions,
2805 [
2806 cat > conftest.c << EOF
2807 #include <features.h>
2808
2809 #ifdef __GNU_LIBRARY__
2810 yes
2811 #endif
2812 EOF
2813
2814 if (eval "$ac_cpp conftest.c") 2>&5 |
2815   egrep "yes" >/dev/null 2>&1; then
2816   rm -rf conftest*
2817   ac_cv_gnu_extensions=yes
2818 else
2819   ac_cv_gnu_extensions=no
2820 fi
2821 ])
2822
2823 AC_MSG_RESULT($ac_cv_gnu_extensions)
2824 if test "$ac_cv_gnu_extensions" = "yes"; then
2825   AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
2826 fi
2827 ])
2828
2829 AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
2830 [
2831 AC_MSG_CHECKING([whether $CXX supports -$1])
2832 kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
2833 AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
2834 [
2835   AC_LANG_SAVE
2836   AC_LANG_CPLUSPLUS
2837   save_CXXFLAGS="$CXXFLAGS"
2838   CXXFLAGS="$CXXFLAGS -$1"
2839   AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
2840   CXXFLAGS="$save_CXXFLAGS"
2841   AC_LANG_RESTORE
2842 ])
2843 if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
2844  AC_MSG_RESULT(yes)
2845  :
2846  $2
2847 else
2848  AC_MSG_RESULT(no)
2849  :
2850  $3
2851 fi
2852 ])
2853
2854 AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
2855 [
2856 AC_MSG_CHECKING([whether $CC supports -$1])
2857 kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
2858 AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
2859 [
2860   AC_LANG_SAVE
2861   AC_LANG_C
2862   save_CFLAGS="$CFLAGS"
2863   CFLAGS="$CFLAGS -$1"
2864   AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
2865   CFLAGS="$save_CFLAGS"
2866   AC_LANG_RESTORE
2867 ])
2868 if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
2869  AC_MSG_RESULT(yes)
2870  :
2871  $2
2872 else
2873  AC_MSG_RESULT(no)
2874  :
2875  $3
2876 fi
2877 ])
2878
2879
2880 dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
2881 dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
2882 dnl it's all white-space separated
2883 AC_DEFUN([AC_REMOVE_FORBIDDEN],
2884 [ __val=$$1
2885   __forbid=" $2 "
2886   if test -n "$__val"; then
2887     __new=""
2888     ac_save_IFS=$IFS
2889     IFS="       "
2890     for i in $__val; do
2891       case "$__forbid" in
2892         *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
2893         *) # Careful to not add spaces, where there were none, because otherwise
2894            # libtool gets confused, if we change e.g. CXX
2895            if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
2896       esac
2897     done
2898     IFS=$ac_save_IFS
2899     $1=$__new
2900   fi
2901 ])
2902
2903 dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
2904 AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
2905 [dnl
2906 if test "x$kde_use_qt_emb" != "xyes"; then
2907  AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
2908  AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
2909 else
2910  AC_REMOVE_FORBIDDEN(CXX, [-rpath])
2911  AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
2912 fi
2913 ])
2914
2915 AC_DEFUN([AC_CHECK_COMPILERS],
2916 [
2917   AC_ARG_ENABLE(debug,
2918                 AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
2919   [
2920     case $enableval in
2921       yes)
2922         kde_use_debug_code="yes"
2923         kde_use_debug_define=no
2924         ;;
2925       full)
2926         kde_use_debug_code="full"
2927         kde_use_debug_define=no
2928         ;;
2929       *)
2930         kde_use_debug_code="no"
2931         kde_use_debug_define=yes
2932         ;;
2933     esac
2934   ], 
2935     [kde_use_debug_code="no"
2936       kde_use_debug_define=no
2937   ])
2938
2939   dnl Just for configure --help
2940   AC_ARG_ENABLE(dummyoption,
2941                 AC_HELP_STRING([--disable-debug],
2942                                [disables debug output and debug symbols [default=no]]),
2943                 [],[])
2944
2945   AC_ARG_ENABLE(strict,
2946                 AC_HELP_STRING([--enable-strict],
2947                               [compiles with strict compiler options (may not work!)]),
2948    [
2949     if test $enableval = "no"; then
2950          kde_use_strict_options="no"
2951        else
2952          kde_use_strict_options="yes"
2953     fi
2954    ], [kde_use_strict_options="no"])
2955
2956   AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
2957    [
2958     if test $enableval = "no"; then
2959          kde_use_warnings="no"
2960        else
2961          kde_use_warnings="yes"
2962     fi
2963    ], [kde_use_warnings="yes"])
2964
2965   dnl enable warnings for debug build
2966   if test "$kde_use_debug_code" != "no"; then
2967     kde_use_warnings=yes
2968   fi
2969
2970   AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
2971     [kde_use_profiling=$enableval],
2972     [kde_use_profiling="no"]
2973   )
2974
2975   dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
2976   CFLAGS=" $CFLAGS"
2977
2978   AC_PROG_CC 
2979
2980   AC_PROG_CPP
2981
2982   if test "$GCC" = "yes"; then
2983     if test "$kde_use_debug_code" != "no"; then
2984       if test $kde_use_debug_code = "full"; then
2985         CFLAGS="-g3 -fno-inline $CFLAGS"
2986       else
2987         CFLAGS="-g -O2 $CFLAGS"
2988       fi
2989     else
2990       CFLAGS="-O2 $CFLAGS"
2991     fi
2992   fi
2993
2994   if test "$kde_use_debug_define" = "yes"; then
2995     CFLAGS="-DNDEBUG $CFLAGS"
2996   fi
2997
2998
2999   case "$host" in
3000   *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
3001   *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
3002   esac
3003
3004   if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
3005      LDFLAGS=""
3006   fi
3007
3008   CXXFLAGS=" $CXXFLAGS"
3009
3010   AC_PROG_CXX
3011
3012   if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
3013     if test "$kde_use_debug_code" != "no"; then
3014       if test "$CXX" = "KCC"; then
3015         CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
3016       else
3017         if test "$kde_use_debug_code" = "full"; then
3018           CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
3019         else
3020           CXXFLAGS="-g -O2 $CXXFLAGS"
3021         fi
3022       fi
3023       KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
3024
3025       dnl convenience compiler flags
3026       KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
3027       AC_SUBST(WOVERLOADED_VIRTUAL)
3028     else
3029       if test "$CXX" = "KCC"; then
3030         CXXFLAGS="+K3 $CXXFLAGS"
3031       else
3032         CXXFLAGS="-O2 $CXXFLAGS"
3033       fi  
3034     fi
3035   fi
3036
3037   if test "$kde_use_debug_define" = "yes"; then
3038     CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
3039   fi  
3040
3041   if test "$kde_use_profiling" = "yes"; then
3042     KDE_CHECK_COMPILER_FLAG(pg,
3043     [
3044       CFLAGS="-pg $CFLAGS"
3045       CXXFLAGS="-pg $CXXFLAGS"
3046     ])
3047   fi
3048
3049   if test "$kde_use_warnings" = "yes"; then
3050       if test "$GCC" = "yes"; then
3051         CXXFLAGS="-Wall -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
3052         case $host in
3053           *-*-linux-gnu)        
3054             CFLAGS="-ansi -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
3055             CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts $CXXFLAGS"
3056             KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
3057             KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
3058           ;;
3059         esac
3060         KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
3061         KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
3062         KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
3063      fi
3064   fi
3065
3066   if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
3067     CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
3068   fi
3069
3070   AC_ARG_ENABLE(pch,
3071      AC_HELP_STRING([--enable-pch],
3072                     [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
3073     [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
3074  
3075   HAVE_GCC_VISIBILITY=0
3076   AC_SUBST([HAVE_GCC_VISIBILITY])
3077
3078   if test "$GXX" = "yes"; then
3079     KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
3080     KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
3081     KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
3082     KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS=       )
3083     ENABLE_PERMISSIVE_FLAG="-fpermissive"
3084
3085     if test "$kde_use_pch" = "yes"; then
3086         AC_MSG_CHECKING(whether gcc supports precompiling c header files)
3087         echo >conftest.h
3088         if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
3089             kde_gcc_supports_pch=yes
3090             AC_MSG_RESULT(yes)
3091         else
3092             kde_gcc_supports_pch=no
3093             AC_MSG_RESULT(no)
3094         fi
3095         if test "$kde_gcc_supports_pch" = "yes"; then
3096             AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
3097             if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
3098                 kde_gcc_supports_pch=yes
3099                 AC_MSG_RESULT(yes)
3100             else
3101                 kde_gcc_supports_pch=no
3102                 AC_MSG_RESULT(no)
3103             fi
3104         fi
3105         rm -f conftest.h conftest.h.gch
3106     fi
3107     AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
3108   fi
3109   if test "$CXX" = "KCC"; then
3110     dnl unfortunately we currently cannot disable exception support in KCC
3111     dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
3112     dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
3113     dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS=   )
3114
3115     if test "$kde_use_pch" = "yes"; then
3116       dnl TODO: support --pch-dir!
3117       KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
3118       dnl the below works (but the dir must exist), but it's
3119       dnl useless for a whole package.
3120       dnl The are precompiled headers for each source file, so when compiling
3121       dnl from scratch, it doesn't make a difference, and they take up
3122       dnl around ~5Mb _per_ sourcefile.
3123       dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
3124       dnl   [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
3125     fi
3126     dnl this flag controls inlining. by default KCC inlines in optimisation mode
3127     dnl all implementations that are defined inside the class {} declaration. 
3128     dnl because of templates-compatibility with broken gcc compilers, this
3129     dnl can cause excessive inlining. This flag limits it to a sane level
3130     KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
3131     KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
3132     KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
3133     KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
3134     dnl Some source files are shared between multiple executables
3135     dnl (or libraries) and some of those need template instantiations.
3136     dnl In that case KCC needs to compile those sources with
3137     dnl --one_instantiation_per_object.  To make it easy for us we compile
3138     dnl _all_ objects with that flag (--one_per is a shorthand).
3139     KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
3140   fi
3141   AC_SUBST(USE_EXCEPTIONS)
3142   dnl obsolete macro - provided to keep things going
3143   USE_RTTI=
3144   AC_SUBST(USE_RTTI)
3145
3146   case "$host" in
3147       *-*-irix*)  test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
3148       *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
3149       *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
3150       *-*-solaris*) 
3151         if test "$GXX" = yes; then
3152           libstdcpp=`$CXX -print-file-name=libstdc++.so`
3153           if test ! -f $libstdcpp; then
3154              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])
3155           fi
3156         fi
3157         ;;
3158   esac
3159
3160   AC_VALIDIFY_CXXFLAGS
3161
3162   AC_PROG_CXXCPP
3163
3164   if test "$GCC" = yes; then
3165      NOOPT_CFLAGS=-O0
3166   fi
3167   KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
3168
3169   AC_ARG_ENABLE(coverage,
3170     AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
3171       if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
3172         ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
3173         ac_coverage_linker="-lgcc"
3174       elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
3175         ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
3176         ac_coverage_linker=""
3177       else
3178         AC_MSG_ERROR([coverage with your compiler is not supported])
3179       fi
3180       CFLAGS="$CFLAGS $ac_coverage_compiler"
3181       CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
3182       LDFLAGS="$LDFLAGS $ac_coverage_linker"
3183     ])
3184
3185   AC_SUBST(NOOPT_CXXFLAGS)
3186   AC_SUBST(NOOPT_CFLAGS)
3187   AC_SUBST(ENABLE_PERMISSIVE_FLAG)
3188
3189   KDE_CHECK_NEW_LDFLAGS
3190   KDE_CHECK_FINAL
3191   KDE_CHECK_CLOSURE
3192   KDE_CHECK_NMCHECK
3193
3194   ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
3195 ])
3196
3197 AC_DEFUN([KDE_CHECK_AND_ADD_HIDDEN_VISIBILITY],
3198 [
3199   if test "$GXX" = "yes"; then
3200     KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
3201     KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
3202     KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
3203     KDE_CHECK_COMPILER_FLAG(fvisibility=hidden, 
3204     [
3205         CXXFLAGS="$CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
3206         HAVE_GCC_VISIBILITY=1
3207         AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
3208     ])
3209   fi
3210 ])
3211
3212 AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
3213 [
3214   AC_REQUIRE([KDE_CHECK_AND_ADD_HIDDEN_VISIBILITY])
3215 ])
3216
3217 AC_DEFUN([KDE_ADD_DEPENDENCIES],
3218 [
3219    [A]M_DEPENDENCIES(CC)
3220    [A]M_DEPENDENCIES(CXX)
3221 ])
3222
3223 dnl just a wrapper to clean up configure.in
3224 AC_DEFUN([KDE_PROG_LIBTOOL],
3225 [
3226 AC_REQUIRE([AC_CHECK_COMPILERS])
3227 AC_REQUIRE([AC_ENABLE_SHARED])
3228 AC_REQUIRE([AC_ENABLE_STATIC])
3229
3230 AC_REQUIRE([AC_LIBTOOL_DLOPEN])
3231 AC_REQUIRE([KDE_CHECK_LIB64])
3232
3233 AC_OBJEXT
3234 AC_EXEEXT
3235
3236 AM_PROG_LIBTOOL
3237 AC_LIBTOOL_CXX
3238
3239 LIBTOOL_SHELL="/bin/sh ./libtool"
3240 #  LIBTOOL="$LIBTOOL --silent"
3241 KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
3242 AC_SUBST(KDE_PLUGIN)
3243
3244 # we patch configure quite some so we better keep that consistent for incremental runs 
3245 AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
3246 ])
3247
3248 AC_DEFUN([KDE_CHECK_LIB64],
3249 [
3250     kdelibsuff="$kde_libs_suffix"
3251     if test -z "$kdelibsuff"; then
3252        kdelibsuff=no
3253     fi
3254     AC_ARG_ENABLE(libsuffix,
3255         AC_HELP_STRING([--enable-libsuffix],
3256             [/lib directory suffix (64,32,none[=default])]),
3257             kdelibsuff=$enableval)
3258     # TODO: add an auto case that compiles a little C app to check
3259     # where the glibc is
3260     if test "$kdelibsuff" = "no"; then
3261        kdelibsuff=
3262     fi
3263     if test -z "$kdelibsuff"; then
3264         AC_MSG_RESULT([not using lib directory suffix])
3265         AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
3266     else
3267         if test "$libdir" = '${exec_prefix}/lib'; then
3268             libdir="$libdir${kdelibsuff}"
3269             AC_SUBST([libdir], ["$libdir"])  dnl ugly hack for lib64 platforms
3270         fi
3271         AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${kdelibsuff}"], Suffix for lib directories)
3272         AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
3273     fi
3274 ])
3275
3276 AC_DEFUN([KDE_CHECK_TYPES],
3277 [  AC_CHECK_SIZEOF(int, 4)dnl
3278    AC_CHECK_SIZEOF(short)dnl
3279   AC_CHECK_SIZEOF(long, 4)dnl
3280   AC_CHECK_SIZEOF(char *, 4)dnl
3281 ])dnl
3282
3283 dnl Not used - kept for compat only?
3284 AC_DEFUN([KDE_DO_IT_ALL],
3285 [
3286 AC_CANONICAL_SYSTEM
3287 AC_ARG_PROGRAM
3288 AM_INIT_AUTOMAKE($1, $2)
3289 AM_DISABLE_LIBRARIES
3290 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
3291 AC_CHECK_COMPILERS
3292 KDE_PROG_LIBTOOL
3293 AM_KDE_WITH_NLS
3294 AC_PATH_KDE
3295 ])
3296
3297 AC_DEFUN([AC_CHECK_RPATH],
3298 [
3299 AC_MSG_CHECKING(for rpath)
3300 AC_ARG_ENABLE(rpath,
3301       AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
3302       USE_RPATH=$enableval, USE_RPATH=yes)
3303
3304 if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
3305
3306   KDE_RPATH="-R \$(libdir)"
3307
3308   if test "$kde_libraries" != "$libdir"; then
3309       KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)"
3310   fi
3311
3312   if test -n "$qt_libraries"; then
3313     KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
3314   fi
3315   dnl $x_libraries is set to /usr/lib in case
3316   if test -n "$X_LDFLAGS"; then
3317     X_RPATH="-R \$(x_libraries)"
3318     KDE_RPATH="$KDE_RPATH $X_RPATH"
3319   fi
3320   if test -n "$KDE_EXTRA_RPATH"; then
3321     KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
3322   fi
3323 fi
3324 AC_SUBST(KDE_EXTRA_RPATH)
3325 AC_SUBST(KDE_RPATH)
3326 AC_SUBST(X_RPATH)
3327 AC_MSG_RESULT($USE_RPATH)
3328 ])
3329
3330 dnl Check for the type of the third argument of getsockname
3331 AC_DEFUN([AC_CHECK_SOCKLEN_T],
3332 [
3333    AC_MSG_CHECKING(for socklen_t)
3334    AC_CACHE_VAL(kde_cv_socklen_t,
3335    [
3336       AC_LANG_PUSH(C++)
3337       kde_cv_socklen_t=no
3338       AC_TRY_COMPILE([
3339          #include <sys/types.h>
3340          #include <sys/socket.h>
3341       ],
3342       [
3343          socklen_t len;
3344          getpeername(0,0,&len);
3345       ],
3346       [
3347          kde_cv_socklen_t=yes
3348          kde_cv_socklen_t_equiv=socklen_t
3349       ])
3350       AC_LANG_POP(C++)
3351    ])
3352    AC_MSG_RESULT($kde_cv_socklen_t)
3353    if test $kde_cv_socklen_t = no; then
3354       AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
3355       AC_CACHE_VAL(kde_cv_socklen_t_equiv,
3356       [
3357          kde_cv_socklen_t_equiv=int
3358          AC_LANG_PUSH(C++)
3359          for t in int size_t unsigned long "unsigned long"; do
3360             AC_TRY_COMPILE([
3361                #include <sys/types.h>
3362                #include <sys/socket.h>
3363             ],
3364             [
3365                $t len;
3366                getpeername(0,0,&len);
3367             ],
3368             [
3369                kde_cv_socklen_t_equiv="$t"
3370                break
3371             ])
3372          done
3373          AC_LANG_POP(C++)
3374       ])
3375       AC_MSG_RESULT($kde_cv_socklen_t_equiv)
3376    fi
3377    AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
3378                      [type to use in place of socklen_t if not defined])
3379    AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
3380                      [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
3381 ])
3382
3383 dnl This is a merge of some macros out of the gettext aclocal.m4
3384 dnl since we don't need anything, I took the things we need
3385 dnl the copyright for them is:
3386 dnl >
3387 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3388 dnl This Makefile.in is free software; the Free Software Foundation
3389 dnl gives unlimited permission to copy and/or distribute it,
3390 dnl with or without modifications, as long as this notice is preserved.
3391
3392 dnl This program is distributed in the hope that it will be useful,
3393 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
3394 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
3395 dnl PARTICULAR PURPOSE.
3396 dnl >
3397 dnl for this file it is relicensed under LGPL
3398
3399 AC_DEFUN([AM_KDE_WITH_NLS],
3400   [
3401     dnl If we use NLS figure out what method
3402
3403     AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
3404         [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
3405     AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
3406
3407      if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
3408         AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
3409         GMSGFMT=":"
3410       fi
3411       MSGFMT=$GMSGFMT
3412       AC_SUBST(GMSGFMT)
3413       AC_SUBST(MSGFMT)
3414
3415       AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
3416         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
3417
3418       dnl Test whether we really found GNU xgettext.
3419       if test "$XGETTEXT" != ":"; then
3420         dnl If it is no GNU xgettext we define it as : so that the
3421         dnl Makefiles still can work.
3422         if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
3423           : ;
3424         else
3425           AC_MSG_RESULT(
3426             [found xgettext programs is not GNU xgettext; ignore it])
3427           XGETTEXT=":"
3428         fi
3429       fi
3430      AC_SUBST(XGETTEXT)
3431
3432   ])
3433
3434 # Search path for a program which passes the given test.
3435 # Ulrich Drepper <drepper@cygnus.com>, 1996.
3436
3437 # serial 1
3438 # Stephan Kulow: I appended a _KDE against name conflicts
3439
3440 dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
3441 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3442 AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
3443 [# Extract the first word of "$2", so it can be a program name with args.
3444 set dummy $2; ac_word=[$]2
3445 AC_MSG_CHECKING([for $ac_word])
3446 AC_CACHE_VAL(ac_cv_path_$1,
3447 [case "[$]$1" in
3448   /*)
3449   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3450   ;;
3451   *)
3452   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3453   for ac_dir in ifelse([$5], , $PATH, [$5]); do
3454     test -z "$ac_dir" && ac_dir=.
3455     if test -f $ac_dir/$ac_word; then
3456       if [$3]; then
3457         ac_cv_path_$1="$ac_dir/$ac_word"
3458         break
3459       fi
3460     fi
3461   done
3462   IFS="$ac_save_ifs"
3463 dnl If no 4th arg is given, leave the cache variable unset,
3464 dnl so AC_PATH_PROGS will keep looking.
3465 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3466 ])dnl
3467   ;;
3468 esac])dnl
3469 $1="$ac_cv_path_$1"
3470 if test -n "[$]$1"; then
3471   AC_MSG_RESULT([$]$1)
3472 else
3473   AC_MSG_RESULT(no)
3474 fi
3475 AC_SUBST($1)dnl
3476 ])
3477
3478
3479 # Check whether LC_MESSAGES is available in <locale.h>.
3480 # Ulrich Drepper <drepper@cygnus.com>, 1995.
3481
3482 # serial 1
3483
3484 AC_DEFUN([AM_LC_MESSAGES],
3485   [if test $ac_cv_header_locale_h = yes; then
3486     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
3487       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
3488        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
3489     if test $am_cv_val_LC_MESSAGES = yes; then
3490       AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
3491     fi
3492   fi])
3493
3494 dnl From Jim Meyering.
3495 dnl FIXME: migrate into libit.
3496
3497 AC_DEFUN([AM_FUNC_OBSTACK],
3498 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
3499  [AC_TRY_LINK([#include "obstack.h"],
3500               [struct obstack *mem;obstack_free(mem,(char *) 0)],
3501               am_cv_func_obstack=yes,
3502               am_cv_func_obstack=no)])
3503  if test $am_cv_func_obstack = yes; then
3504    AC_DEFINE(HAVE_OBSTACK)
3505  else
3506    LIBOBJS="$LIBOBJS obstack.o"
3507  fi
3508 ])
3509
3510 dnl From Jim Meyering.  Use this if you use the GNU error.[ch].
3511 dnl FIXME: Migrate into libit
3512
3513 AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
3514 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
3515  [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
3516               am_cv_lib_error_at_line=yes,
3517               am_cv_lib_error_at_line=no)])
3518  if test $am_cv_lib_error_at_line = no; then
3519    LIBOBJS="$LIBOBJS error.o"
3520  fi
3521  AC_SUBST(LIBOBJS)dnl
3522 ])
3523
3524 # Macro to add for using GNU gettext.
3525 # Ulrich Drepper <drepper@cygnus.com>, 1995.
3526
3527 # serial 1
3528 # Stephan Kulow: I put a KDE in it to avoid name conflicts
3529
3530 AC_DEFUN([AM_KDE_GNU_GETTEXT],
3531   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3532    AC_REQUIRE([AC_PROG_RANLIB])dnl
3533    AC_REQUIRE([AC_HEADER_STDC])dnl
3534    AC_REQUIRE([AC_TYPE_OFF_T])dnl
3535    AC_REQUIRE([AC_TYPE_SIZE_T])dnl
3536    AC_REQUIRE([AC_FUNC_ALLOCA])dnl
3537    AC_REQUIRE([AC_FUNC_MMAP])dnl
3538    AC_REQUIRE([AM_KDE_WITH_NLS])dnl
3539    AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
3540    AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
3541 __argz_count __argz_stringify __argz_next])
3542
3543    AC_MSG_CHECKING(for stpcpy)
3544    AC_CACHE_VAL(kde_cv_func_stpcpy,
3545    [
3546    kde_safe_cxxflags=$CXXFLAGS
3547    CXXFLAGS="-Werror"
3548    AC_LANG_SAVE
3549    AC_LANG_CPLUSPLUS
3550    AC_TRY_COMPILE([
3551    #include <string.h>
3552    ],
3553    [
3554    char buffer[200];
3555    stpcpy(buffer, buffer);
3556    ],
3557    kde_cv_func_stpcpy=yes,
3558    kde_cv_func_stpcpy=no)
3559    AC_LANG_RESTORE
3560    CXXFLAGS=$kde_safe_cxxflags
3561    ])
3562    AC_MSG_RESULT($kde_cv_func_stpcpy)
3563    if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
3564      AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
3565    fi
3566
3567    AM_LC_MESSAGES
3568
3569    if test "x$CATOBJEXT" != "x"; then
3570      if test "x$ALL_LINGUAS" = "x"; then
3571        LINGUAS=
3572      else
3573        AC_MSG_CHECKING(for catalogs to be installed)
3574        NEW_LINGUAS=
3575        for lang in ${LINGUAS=$ALL_LINGUAS}; do
3576          case "$ALL_LINGUAS" in
3577           *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
3578          esac
3579        done
3580        LINGUAS=$NEW_LINGUAS
3581        AC_MSG_RESULT($LINGUAS)
3582      fi
3583
3584      dnl Construct list of names of catalog files to be constructed.
3585      if test -n "$LINGUAS"; then
3586        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
3587      fi
3588    fi
3589
3590   ])
3591
3592 AC_DEFUN([AC_HAVE_XPM],
3593  [AC_REQUIRE_CPP()dnl
3594   AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3595
3596  test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
3597  test -z "$XPM_INCLUDE" && XPM_INCLUDE=
3598
3599  AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
3600         xpm_test=$withval, xpm_test="yes")
3601  if test "x$xpm_test" = xno; then
3602    ac_cv_have_xpm=no
3603  else
3604    AC_MSG_CHECKING(for XPM)
3605    AC_CACHE_VAL(ac_cv_have_xpm,
3606    [
3607     ac_save_ldflags="$LDFLAGS"
3608     ac_save_cflags="$CFLAGS"
3609     if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
3610       LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
3611     else
3612       LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
3613     fi
3614     CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
3615     test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
3616     AC_TRY_LINK([#include <X11/xpm.h>],[],
3617         ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
3618     LDFLAGS="$ac_save_ldflags"
3619     CFLAGS="$ac_save_cflags"
3620    ])dnl
3621
3622   if test "$ac_cv_have_xpm" = no; then
3623     AC_MSG_RESULT(no)
3624     XPM_LDFLAGS=""
3625     XPMINC=""
3626     $2
3627   else
3628     AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
3629     if test "$XPM_LDFLAGS" = ""; then
3630        XPMLIB='-lXpm $(LIB_X11)'
3631     else
3632        XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
3633     fi
3634     if test "$XPM_INCLUDE" = ""; then
3635        XPMINC=""
3636     else
3637        XPMINC="-I$XPM_INCLUDE"
3638     fi
3639     AC_MSG_RESULT(yes)
3640     $1
3641   fi
3642  fi
3643  AC_SUBST(XPMINC)
3644  AC_SUBST(XPMLIB)
3645 ])
3646
3647 AC_DEFUN([AC_HAVE_DPMS],
3648  [AC_REQUIRE_CPP()dnl
3649   AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3650
3651  test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
3652  test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
3653  DPMS_LIB=
3654
3655  AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
3656         dpms_test=$withval, dpms_test="yes")
3657  if test "x$dpms_test" = xno; then
3658    ac_cv_have_dpms=no
3659  else
3660    AC_MSG_CHECKING(for DPMS)
3661    dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
3662    dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
3663    AC_CACHE_VAL(ac_cv_have_dpms,
3664    [
3665     if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
3666       AC_MSG_RESULT(no)
3667       ac_cv_have_dpms="no"
3668     else
3669       ac_save_ldflags="$LDFLAGS"
3670       ac_save_cflags="$CFLAGS"
3671       ac_save_libs="$LIBS"
3672       LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
3673       CFLAGS="$CFLAGS $X_INCLUDES"
3674       test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3675       AC_TRY_LINK([
3676           #include <X11/Xproto.h>
3677           #include <X11/X.h>
3678           #include <X11/Xlib.h>
3679           #include <X11/extensions/dpms.h>
3680           int foo_test_dpms()
3681           { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3682           ac_cv_have_dpms="yes", [
3683               LDFLAGS="$ac_save_ldflags"
3684               CFLAGS="$ac_save_cflags"
3685               LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
3686               LIBS="$LIBS -lXdpms"
3687               CFLAGS="$CFLAGS $X_INCLUDES"
3688               test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3689               AC_TRY_LINK([
3690                   #include <X11/Xproto.h>
3691                   #include <X11/X.h>
3692                   #include <X11/Xlib.h>
3693                   #include <X11/extensions/dpms.h>
3694                   int foo_test_dpms()
3695                   { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3696                   [
3697                   ac_cv_have_dpms="-lXdpms"
3698                   ],ac_cv_have_dpms="no")
3699               ])
3700       LDFLAGS="$ac_save_ldflags"
3701       CFLAGS="$ac_save_cflags"
3702       LIBS="$ac_save_libs"
3703     fi
3704    ])dnl
3705
3706   if test "$ac_cv_have_dpms" = no; then
3707     AC_MSG_RESULT(no)
3708     DPMS_LDFLAGS=""
3709     DPMSINC=""
3710     $2
3711   else
3712     AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
3713     if test "$ac_cv_have_dpms" = "-lXdpms"; then
3714        DPMS_LIB="-lXdpms"
3715     fi
3716     if test "$DPMS_LDFLAGS" = ""; then
3717        DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
3718     else
3719        DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
3720     fi
3721     if test "$DPMS_INCLUDE" = ""; then
3722        DPMSINC=""
3723     else
3724        DPMSINC="-I$DPMS_INCLUDE"
3725     fi
3726     AC_MSG_RESULT(yes)
3727     $1
3728   fi
3729  fi
3730  ac_save_cflags="$CFLAGS"
3731  CFLAGS="$CFLAGS $X_INCLUDES"
3732  test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3733  AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
3734    [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
3735  AC_CHECK_DECL(DPMSCapable,
3736    AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
3737    [#include <X11/extensions/dpms.h>])
3738  AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
3739    [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
3740  AC_CHECK_DECL(DPMSInfo,
3741    AC_DEFINE(HAVE_DPMSINFO_PROTO),,
3742    [#include <X11/extensions/dpms.h>])
3743  CFLAGS="$ac_save_cflags"
3744  AC_SUBST(DPMSINC)
3745  AC_SUBST(DPMSLIB)
3746 ])
3747
3748 AC_DEFUN([AC_HAVE_GL],
3749  [AC_REQUIRE_CPP()dnl
3750   AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3751
3752  test -z "$GL_LDFLAGS" && GL_LDFLAGS=
3753  test -z "$GL_INCLUDE" && GL_INCLUDE=
3754
3755  AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
3756         gl_test=$withval, gl_test="yes")
3757  if test "x$kde_use_qt_emb" = "xyes"; then
3758    # GL and Qt Embedded is a no-go for now.
3759    ac_cv_have_gl=no
3760  elif test "x$gl_test" = xno; then
3761    ac_cv_have_gl=no
3762  else
3763    AC_MSG_CHECKING(for GL)
3764    AC_CACHE_VAL(ac_cv_have_gl,
3765    [
3766     AC_LANG_SAVE
3767     AC_LANG_CPLUSPLUS
3768     ac_save_ldflags="$LDFLAGS"
3769     ac_save_cxxflags="$CXXFLAGS"
3770     LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lGL -lGLU"
3771     test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3772     LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3773     CXXFLAGS="$CFLAGS $X_INCLUDES"
3774     test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3775     AC_TRY_LINK([#include <GL/gl.h>
3776 #include <GL/glu.h>
3777 ], [],
3778         ac_cv_have_gl="yes", ac_cv_have_gl="no")
3779     AC_LANG_RESTORE
3780     LDFLAGS="$ac_save_ldflags"
3781     CXXFLAGS="$ac_save_cxxflags"
3782    ])dnl
3783
3784   if test "$ac_cv_have_gl" = "no"; then
3785     AC_MSG_RESULT(no)
3786     GL_LDFLAGS=""
3787     GLINC=""
3788     $2
3789   else
3790     AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
3791     if test "$GL_LDFLAGS" = ""; then
3792        GLLIB='-lGLU -lGL $(LIB_X11)'
3793     else
3794        GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
3795     fi
3796     if test "$GL_INCLUDE" = ""; then
3797        GLINC=""
3798     else
3799        GLINC="-I$GL_INCLUDE"
3800     fi
3801     AC_MSG_RESULT($ac_cv_have_gl)
3802     $1
3803   fi
3804  fi
3805  AC_SUBST(GLINC)
3806  AC_SUBST(GLLIB)
3807 ])
3808
3809
3810  dnl shadow password and PAM magic - maintained by ossi@kde.org
3811
3812 AC_DEFUN([KDE_PAM], [
3813   AC_REQUIRE([KDE_CHECK_LIBDL])
3814
3815   want_pam=
3816   AC_ARG_WITH(pam,
3817     AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
3818     [ if test "x$withval" = "xyes"; then
3819         want_pam=yes
3820         pam_service=kde
3821       elif test "x$withval" = "xno"; then
3822         want_pam=no
3823       else
3824         want_pam=yes
3825         pam_service=$withval
3826       fi
3827     ], [ pam_service=kde ])
3828
3829   use_pam=
3830   PAMLIBS=
3831   if test "x$want_pam" != xno; then
3832     AC_CHECK_LIB(pam, pam_start, [
3833       AC_CHECK_HEADER(security/pam_appl.h,
3834         [ pam_header=security/pam_appl.h ],
3835         [ AC_CHECK_HEADER(pam/pam_appl.h,
3836             [ pam_header=pam/pam_appl.h ],
3837             [
3838     AC_MSG_WARN([PAM detected, but no headers found!
3839 Make sure you have the necessary development packages installed.])
3840             ]
3841           )
3842         ]
3843       )
3844     ], , $LIBDL)
3845     if test -z "$pam_header"; then
3846       if test "x$want_pam" = xyes; then
3847         AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
3848       fi
3849     else
3850       AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
3851       PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
3852       use_pam=yes
3853
3854       dnl darwin claims to be something special
3855       if test "$pam_header" = "pam/pam_appl.h"; then
3856         AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
3857       fi
3858
3859       dnl test whether struct pam_message is const (Linux) or not (Sun)
3860       AC_MSG_CHECKING(for const pam_message)
3861       AC_EGREP_HEADER([struct pam_message], $pam_header,
3862         [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
3863                           [AC_MSG_RESULT([const: Linux-type PAM])],
3864                           [AC_MSG_RESULT([nonconst: Sun-type PAM])
3865                           AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
3866                           )],
3867         [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
3868     fi
3869   fi
3870
3871   AC_SUBST(PAMLIBS)
3872 ])
3873
3874 dnl DEF_PAM_SERVICE(arg name, full name, define name)
3875 AC_DEFUN([DEF_PAM_SERVICE], [
3876   AC_ARG_WITH($1-pam,
3877     AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
3878     [ if test "x$use_pam" = xyes; then
3879         $3_PAM_SERVICE=$withval
3880       else
3881         AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
3882 You may want to enforce it by using --with-pam.])
3883       fi
3884     ], 
3885     [ if test "x$use_pam" = xyes; then
3886         $3_PAM_SERVICE="$pam_service"
3887       fi
3888     ])
3889     if test -n "$$3_PAM_SERVICE"; then
3890       AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
3891       AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
3892     fi
3893     AC_SUBST($3_PAM_SERVICE)
3894 ])
3895
3896 AC_DEFUN([KDE_SHADOWPASSWD], [
3897   AC_REQUIRE([KDE_PAM])
3898
3899   AC_CHECK_LIB(shadow, getspent,
3900     [ LIBSHADOW="-lshadow"
3901       ac_use_shadow=yes
3902     ],
3903     [ dnl for UnixWare
3904       AC_CHECK_LIB(gen, getspent, 
3905         [ LIBGEN="-lgen"
3906           ac_use_shadow=yes
3907         ], 
3908         [ AC_CHECK_FUNC(getspent, 
3909             [ ac_use_shadow=yes ],
3910             [ ac_use_shadow=no ])
3911         ])
3912     ])
3913   AC_SUBST(LIBSHADOW)
3914   AC_SUBST(LIBGEN)
3915   
3916   AC_MSG_CHECKING([for shadow passwords])
3917
3918   AC_ARG_WITH(shadow,
3919     AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
3920     [ if test "x$withval" != "xno"; then
3921         use_shadow=yes
3922       else
3923         use_shadow=no
3924       fi
3925     ], [
3926       use_shadow="$ac_use_shadow"
3927     ])
3928
3929   if test "x$use_shadow" = xyes; then
3930     AC_MSG_RESULT(yes)
3931     AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
3932   else
3933     AC_MSG_RESULT(no)
3934     LIBSHADOW=
3935     LIBGEN=
3936   fi
3937
3938   dnl finally make the relevant binaries setuid root, if we have shadow passwds.
3939   dnl this still applies, if we could use it indirectly through pam.
3940   if test "x$use_shadow" = xyes || 
3941      ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
3942       case $host in
3943       *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
3944         SETUIDFLAGS="-m 4755 -o root";;
3945       *)
3946         SETUIDFLAGS="-m 4755";;
3947       esac
3948   fi
3949   AC_SUBST(SETUIDFLAGS)
3950
3951 ])
3952
3953 AC_DEFUN([KDE_PASSWDLIBS], [
3954   AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
3955   AC_REQUIRE([KDE_PAM])
3956   AC_REQUIRE([KDE_SHADOWPASSWD])
3957
3958   if test "x$use_pam" = "xyes"; then 
3959     PASSWDLIBS="$PAMLIBS"
3960   else
3961     PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
3962   fi
3963
3964   dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
3965   dnl /etc/master.passwd holds the actual passwords.  /etc/master.passwd requires
3966   dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
3967   dnl may need to read /etc/master.passwd).
3968   case $host in
3969   *-*-freebsd*)
3970     SETUIDFLAGS="-m 4755 -o root"
3971     ;;
3972   *)
3973     ;;
3974   esac
3975
3976   AC_SUBST(PASSWDLIBS)
3977 ])
3978
3979 AC_DEFUN([KDE_CHECK_LIBDL],
3980 [
3981 AC_CHECK_LIB(dl, dlopen, [
3982 LIBDL="-ldl"
3983 ac_cv_have_dlfcn=yes
3984 ])
3985
3986 AC_CHECK_LIB(dld, shl_unload, [
3987 LIBDL="-ldld"
3988 ac_cv_have_shload=yes
3989 ])
3990
3991 AC_SUBST(LIBDL)
3992 ])
3993
3994 AC_DEFUN([KDE_CHECK_DLOPEN],
3995 [
3996 KDE_CHECK_LIBDL
3997 AC_CHECK_HEADERS(dlfcn.h dl.h)
3998 if test "$ac_cv_header_dlfcn_h" = "no"; then
3999   ac_cv_have_dlfcn=no
4000 fi
4001
4002 if test "$ac_cv_header_dl_h" = "no"; then
4003   ac_cv_have_shload=no
4004 fi
4005
4006 dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
4007 dnl (MM)
4008 AC_ARG_ENABLE(dlopen,
4009 AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
4010 enable_dlopen=$enableval,
4011 enable_dlopen=yes)
4012
4013 # override the user's opinion, if we know it better ;)
4014 if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
4015   enable_dlopen=no
4016 fi
4017
4018 if test "$ac_cv_have_dlfcn" = "yes"; then
4019   AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
4020 fi
4021
4022 if test "$ac_cv_have_shload" = "yes"; then
4023   AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
4024 fi
4025
4026 if test "$enable_dlopen" = no ; then
4027   test -n "$1" && eval $1
4028 else
4029   test -n "$2" && eval $2
4030 fi
4031
4032 ])
4033
4034 AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
4035 [
4036 KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
4037 KDE_PROG_LIBTOOL
4038 AC_MSG_CHECKING([dynamic loading])
4039 eval "`egrep '^build_libtool_libs=' libtool`"
4040 if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
4041   dynamic_loading=yes
4042   AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
4043 else
4044   dynamic_loading=no
4045 fi
4046 AC_MSG_RESULT($dynamic_loading)
4047 if test "$dynamic_loading" = "yes"; then
4048   $1
4049 else
4050   $2
4051 fi
4052 ])
4053
4054 AC_DEFUN([KDE_ADD_INCLUDES],
4055 [
4056 if test -z "$1"; then
4057   test_include="Pix.h"
4058 else
4059   test_include="$1"
4060 fi
4061
4062 AC_MSG_CHECKING([for libg++ ($test_include)])
4063
4064 AC_CACHE_VAL(kde_cv_libgpp_includes,
4065 [
4066 kde_cv_libgpp_includes=no
4067
4068    for ac_dir in               \
4069                                \
4070      /usr/include/g++          \
4071      /usr/include              \
4072      /usr/unsupported/include  \
4073      /opt/include              \
4074      $extra_include            \
4075      ; \
4076    do
4077      if test -r "$ac_dir/$test_include"; then
4078        kde_cv_libgpp_includes=$ac_dir
4079        break
4080      fi
4081    done
4082 ])
4083
4084 AC_MSG_RESULT($kde_cv_libgpp_includes)
4085 if test "$kde_cv_libgpp_includes" != "no"; then
4086   all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
4087 fi
4088 ])
4089 ])
4090
4091 AC_DEFUN([KDE_CHECK_LIBPTHREAD],
4092 [
4093   dnl This code is here specifically to handle the
4094   dnl various flavors of threading library on FreeBSD
4095   dnl 4-, 5-, and 6-, and the (weird) rules around it.
4096   dnl There may be an environment PTHREAD_LIBS that 
4097   dnl specifies what to use; otherwise, search for it.
4098   dnl -pthread is special cased and unsets LIBPTHREAD
4099   dnl below if found.
4100   LIBPTHREAD=""
4101
4102   if test -n "$PTHREAD_LIBS"; then
4103     if test "x$PTHREAD_LIBS" = "x-pthread" ; then
4104       LIBPTHREAD="PTHREAD"
4105     else
4106       PTHREAD_LIBS_save="$PTHREAD_LIBS"
4107       PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
4108       AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
4109       KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
4110           LIBPTHREAD="$PTHREAD_LIBS_save"])
4111       PTHREAD_LIBS="$PTHREAD_LIBS_save"
4112     fi
4113   fi
4114
4115   dnl Is this test really needed, in the face of the Tru64 test below?
4116   if test -z "$LIBPTHREAD"; then
4117     AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
4118   fi
4119
4120   dnl This is a special Tru64 check, see BR 76171 issue #18.
4121   if test -z "$LIBPTHREAD" ; then
4122     AC_MSG_CHECKING([for pthread_create in -lpthread])
4123     kde_safe_libs=$LIBS
4124     LIBS="$LIBS -lpthread"
4125     AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
4126         AC_MSG_RESULT(yes)
4127         LIBPTHREAD="-lpthread"],[
4128         AC_MSG_RESULT(no)])
4129     LIBS=$kde_safe_libs
4130   fi
4131
4132   dnl Un-special-case for FreeBSD.
4133   if test "x$LIBPTHREAD" = "xPTHREAD" ; then
4134     LIBPTHREAD=""
4135   fi
4136
4137   AC_SUBST(LIBPTHREAD)
4138 ])
4139
4140 AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
4141 [
4142       USE_THREADS=""
4143       if test -z "$LIBPTHREAD"; then
4144         KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
4145       fi
4146
4147     AH_VERBATIM(__svr_define, [
4148 #if defined(__SVR4) && !defined(__svr4__)
4149 #define __svr4__ 1
4150 #endif
4151 ])
4152     case $host_os in
4153         solaris*)
4154                 KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
4155                 CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
4156                 ;;
4157         freebsd*)
4158                 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
4159                 ;;
4160         aix*)
4161                 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
4162                 LIBPTHREAD="$LIBPTHREAD -lc_r"
4163                 ;;
4164         linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
4165                 if test "$CXX" = "KCC"; then
4166                   CXXFLAGS="$CXXFLAGS --thread_safe"
4167                   NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
4168                 fi
4169                 ;;
4170         *)
4171                 ;;
4172     esac
4173     AC_SUBST(USE_THREADS)
4174     AC_SUBST(LIBPTHREAD)
4175 ])
4176
4177 AC_DEFUN([KDE_CHECK_THREADING],
4178 [
4179   AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4180   AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
4181   dnl default is yes if libpthread is found and no if no libpthread is available
4182   if test -z "$LIBPTHREAD"; then
4183     if test -z "$USE_THREADS"; then
4184       kde_check_threading_default=no
4185     else
4186       kde_check_threading_default=yes
4187     fi
4188   else
4189     kde_check_threading_default=yes
4190   fi
4191   AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
4192    kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
4193   if test "x$kde_use_threading" = "xyes"; then
4194     AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
4195   fi
4196 ])
4197
4198 AC_DEFUN([KDE_TRY_LINK_PYTHON],
4199 [
4200 if test "$kde_python_link_found" = no; then
4201
4202 if test "$1" = normal; then
4203   AC_MSG_CHECKING(if a Python application links)
4204 else
4205   AC_MSG_CHECKING(if Python depends on $2)
4206 fi
4207
4208 AC_CACHE_VAL(kde_cv_try_link_python_$1,
4209 [
4210 kde_save_cflags="$CFLAGS"
4211 CFLAGS="$CFLAGS $PYTHONINC"
4212 kde_save_libs="$LIBS"
4213 LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
4214 kde_save_ldflags="$LDFLAGS"
4215 LDFLAGS="$LDFLAGS $PYTHONLIB"
4216
4217 AC_TRY_LINK(
4218 [
4219 #include <Python.h>
4220 ],[
4221         PySys_SetArgv(1, 0);
4222 ],
4223         [kde_cv_try_link_python_$1=yes],
4224         [kde_cv_try_link_python_$1=no]
4225 )
4226 CFLAGS="$kde_save_cflags"
4227 LIBS="$kde_save_libs"
4228 LDFLAGS="$kde_save_ldflags"
4229 ])
4230
4231 if test "$kde_cv_try_link_python_$1" = "yes"; then
4232   AC_MSG_RESULT(yes)
4233   kde_python_link_found=yes
4234   if test ! "$1" = normal; then
4235     LIBPYTHON="$LIBPYTHON $2"
4236   fi
4237   $3
4238 else
4239   AC_MSG_RESULT(no)
4240   $4
4241 fi
4242
4243 fi
4244
4245 ])
4246
4247 AC_DEFUN([KDE_CHECK_PYTHON_DIR],
4248 [
4249 AC_MSG_CHECKING([for Python directory])
4250  
4251 AC_CACHE_VAL(kde_cv_pythondir,
4252 [
4253   if test -z "$PYTHONDIR"; then
4254     kde_cv_pythondir=/usr/local
4255   else
4256     kde_cv_pythondir="$PYTHONDIR"
4257   fi
4258 ])
4259  
4260 AC_ARG_WITH(pythondir,
4261 AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
4262 [
4263   ac_python_dir=$withval
4264 ], ac_python_dir=$kde_cv_pythondir
4265 )
4266  
4267 AC_MSG_RESULT($ac_python_dir)
4268 ])
4269
4270 AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
4271 [
4272 AC_REQUIRE([KDE_CHECK_LIBDL])
4273 AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4274 AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
4275
4276 if test -z "$1"; then
4277   version="1.5"
4278 else
4279   version="$1"
4280 fi
4281
4282 AC_MSG_CHECKING([for Python$version])
4283
4284 python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
4285 AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
4286 if test ! -r $python_incdir/Python.h; then
4287   AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
4288   python_incdir=$python_incdir/python$version
4289   if test ! -r $python_incdir/Python.h; then
4290     python_incdir=no
4291   fi
4292 fi
4293
4294 PYTHONINC=-I$python_incdir
4295
4296 python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs"
4297 AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
4298 if test ! -r $python_libdir/libpython$version.so; then
4299   AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
4300   if test ! -r $python_libdir/libpython$version.a; then
4301     AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
4302     python_libdir=$python_libdir/python$version/config
4303     if test ! -r $python_libdir/libpython$version.a; then
4304       python_libdir=no
4305     fi
4306   fi
4307 fi
4308
4309 PYTHONLIB=-L$python_libdir
4310 kde_orig_LIBPYTHON=$LIBPYTHON
4311 if test -z "$LIBPYTHON"; then
4312   LIBPYTHON=-lpython$version
4313 fi
4314
4315 AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
4316 python_moddir=$python_moddir/python$version
4317 if test ! -r $python_moddir/copy.py; then
4318   python_moddir=no
4319 fi
4320
4321 PYTHONMODDIR=$python_moddir
4322
4323 AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
4324
4325 if test x$python_incdir = xno ||  test x$python_libdir = xno ||  test x$python_moddir = xno; then
4326    LIBPYTHON=$kde_orig_LIBPYTHON
4327    test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
4328    test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
4329    $2
4330 else 
4331   dnl Note: this test is very weak
4332   kde_python_link_found=no
4333   KDE_TRY_LINK_PYTHON(normal)
4334   KDE_TRY_LINK_PYTHON(m, -lm)
4335   KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
4336   KDE_TRY_LINK_PYTHON(tcl, -ltcl)
4337   KDE_TRY_LINK_PYTHON(db2, -ldb2)
4338   KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
4339   KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
4340   KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
4341   KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
4342   KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
4343   KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
4344   KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
4345   KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
4346         [AC_MSG_WARN([it seems, Python depends on another library.
4347     Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
4348     and contact the authors to let them know about this problem])
4349         ])
4350
4351   LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
4352   AC_SUBST(PYTHONINC)
4353   AC_SUBST(PYTHONLIB)
4354   AC_SUBST(LIBPYTHON)
4355   AC_SUBST(PYTHONMODDIR)
4356   AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
4357 fi
4358
4359 ])
4360
4361
4362 AC_DEFUN([KDE_CHECK_PYTHON],
4363 [
4364   KDE_CHECK_PYTHON_INTERN("2.4",
4365    [KDE_CHECK_PYTHON_INTERN("2.3", 
4366      [KDE_CHECK_PYTHON_INTERN("2.2", 
4367        [KDE_CHECK_PYTHON_INTERN("2.1", 
4368          [KDE_CHECK_PYTHON_INTERN("2.0", 
4369            [KDE_CHECK_PYTHON_INTERN($1, $2) ])
4370          ])
4371        ])
4372      ])
4373   ])
4374 ])
4375
4376 AC_DEFUN([KDE_CHECK_STL],
4377 [
4378     AC_LANG_SAVE
4379     AC_LANG_CPLUSPLUS
4380     ac_save_CXXFLAGS="$CXXFLAGS"
4381     CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
4382
4383     AC_MSG_CHECKING([if C++ programs can be compiled])
4384     AC_CACHE_VAL(kde_cv_stl_works,
4385     [
4386       AC_TRY_COMPILE([
4387 #include <string>
4388 using namespace std;
4389 ],[
4390   string astring="Hallo Welt.";
4391   astring.erase(0, 6); // now astring is "Welt"
4392   return 0;
4393 ], kde_cv_stl_works=yes,
4394    kde_cv_stl_works=no)
4395 ])
4396
4397    AC_MSG_RESULT($kde_cv_stl_works)
4398
4399    if test "$kde_cv_stl_works" = "yes"; then
4400      # back compatible
4401          AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
4402    else
4403          AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
4404 Check config.log for details - if you're using a Linux distribution you might miss
4405 a package named similar to libstdc++-dev.])
4406    fi
4407
4408    CXXFLAGS="$ac_save_CXXFLAGS"
4409    AC_LANG_RESTORE
4410 ])
4411
4412 AC_DEFUN([AC_FIND_QIMGIO],
4413    [AC_REQUIRE([AC_FIND_JPEG])
4414 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
4415 AC_MSG_CHECKING([for qimgio])
4416 AC_CACHE_VAL(ac_cv_lib_qimgio,
4417 [
4418 AC_LANG_SAVE
4419 AC_LANG_CPLUSPLUS
4420 ac_save_LIBS="$LIBS"
4421 ac_save_CXXFLAGS="$CXXFLAGS"
4422 LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
4423 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
4424 AC_TRY_RUN(dnl
4425 [
4426 #include <qimageio.h>
4427 #include <qstring.h>
4428 int main() {
4429                 QString t = "hallo";
4430                 t.fill('t');
4431                 qInitImageIO();
4432 }
4433 ],
4434             ac_cv_lib_qimgio=yes,
4435             ac_cv_lib_qimgio=no,
4436             ac_cv_lib_qimgio=no)
4437 LIBS="$ac_save_LIBS"
4438 CXXFLAGS="$ac_save_CXXFLAGS"
4439 AC_LANG_RESTORE
4440 ])dnl
4441 if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
4442   LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
4443   AC_MSG_RESULT(yes)
4444   AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
4445   AC_SUBST(LIBQIMGIO)
4446 else
4447   AC_MSG_RESULT(not found)
4448 fi
4449 ])
4450
4451 AC_DEFUN([AM_DISABLE_LIBRARIES],
4452 [
4453     AC_PROVIDE([AM_ENABLE_STATIC])
4454     AC_PROVIDE([AM_ENABLE_SHARED])
4455     enable_static=no
4456     enable_shared=yes
4457 ])
4458
4459
4460 AC_DEFUN([AC_CHECK_UTMP_FILE],
4461 [
4462     AC_MSG_CHECKING([for utmp file])
4463
4464     AC_CACHE_VAL(kde_cv_utmp_file,
4465     [
4466     kde_cv_utmp_file=no
4467
4468     for ac_file in    \
4469                       \
4470         /var/run/utmp \
4471         /var/adm/utmp \
4472         /etc/utmp     \
4473      ; \
4474     do
4475      if test -r "$ac_file"; then
4476        kde_cv_utmp_file=$ac_file
4477        break
4478      fi
4479     done
4480     ])
4481
4482     if test "$kde_cv_utmp_file" != "no"; then
4483         AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
4484         $1
4485         AC_MSG_RESULT($kde_cv_utmp_file)
4486     else
4487         $2
4488         AC_MSG_RESULT([non found])
4489     fi
4490 ])
4491
4492
4493 AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
4494 [
4495
4496 DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
4497 TOPSUBDIRS=""
4498
4499 if test ! -s $srcdir/subdirs; then
4500   dnl Note: Makefile.common creates subdirs, so this is just a fallback
4501   files=`cd $srcdir && ls -1`
4502   dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
4503   for i in $dirs; do
4504     echo $i >> $srcdir/subdirs
4505   done
4506 fi
4507
4508 ac_topsubdirs=
4509 if test -s $srcdir/inst-apps; then
4510   ac_topsubdirs="`cat $srcdir/inst-apps`"
4511 elif test -s $srcdir/subdirs; then
4512   ac_topsubdirs="`cat $srcdir/subdirs`"
4513 fi
4514
4515 for i in $ac_topsubdirs; do
4516   AC_MSG_CHECKING([if $i should be compiled])
4517   if test -d $srcdir/$i; then
4518     install_it="yes"
4519     for j in $DO_NOT_COMPILE; do
4520       if test $i = $j; then
4521         install_it="no"
4522       fi
4523     done
4524   else
4525     install_it="no"
4526   fi
4527   AC_MSG_RESULT($install_it)
4528   vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
4529   if test $install_it = "yes"; then
4530     TOPSUBDIRS="$TOPSUBDIRS $i"
4531     eval "$vari""_SUBDIR_included=yes"
4532   else
4533     eval "$vari""_SUBDIR_included=no"
4534   fi
4535 done
4536
4537 AC_SUBST(TOPSUBDIRS)
4538 ])
4539
4540 AC_DEFUN([KDE_CHECK_NAMESPACES],
4541 [
4542 AC_MSG_CHECKING(whether C++ compiler supports namespaces)
4543 AC_LANG_SAVE
4544 AC_LANG_CPLUSPLUS
4545 AC_TRY_COMPILE([
4546 ],
4547 [
4548 namespace Foo {
4549   extern int i;
4550   namespace Bar {
4551     extern int i;
4552   }
4553 }
4554
4555 int Foo::i = 0;
4556 int Foo::Bar::i = 1;
4557 ],[
4558   AC_MSG_RESULT(yes)
4559   AC_DEFINE(HAVE_NAMESPACES)
4560 ], [
4561 AC_MSG_RESULT(no)
4562 ])
4563 AC_LANG_RESTORE
4564 ])
4565
4566 dnl ------------------------------------------------------------------------
4567 dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
4568 dnl ------------------------------------------------------------------------
4569 dnl
4570 AC_DEFUN([AC_CHECK_S_ISSOCK],
4571 [
4572 AC_MSG_CHECKING(for S_ISSOCK)
4573 AC_CACHE_VAL(ac_cv_have_s_issock,
4574 [
4575 AC_TRY_LINK(
4576 [
4577 #include <sys/stat.h>
4578 ],
4579 [
4580 struct stat buff;
4581 int b = S_ISSOCK( buff.st_mode );
4582 ],
4583 ac_cv_have_s_issock=yes,
4584 ac_cv_have_s_issock=no)
4585 ])
4586 AC_MSG_RESULT($ac_cv_have_s_issock)
4587 if test "$ac_cv_have_s_issock" = "yes"; then
4588   AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
4589 fi
4590
4591 AH_VERBATIM(_ISSOCK,
4592 [
4593 #ifndef HAVE_S_ISSOCK
4594 #define HAVE_S_ISSOCK
4595 #define S_ISSOCK(mode) (1==0)
4596 #endif
4597 ])
4598
4599 ])
4600
4601 dnl ------------------------------------------------------------------------
4602 dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
4603 dnl ------------------------------------------------------------------------
4604 dnl
4605 AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
4606 [
4607 AC_MSG_CHECKING(for MAXPATHLEN)
4608 AC_CACHE_VAL(ac_cv_maxpathlen,
4609 [
4610 cat > conftest.$ac_ext <<EOF
4611 #ifdef STDC_HEADERS
4612 # include <stdlib.h>
4613 #endif
4614 #include <stdio.h>
4615 #include <sys/param.h>
4616 #ifndef MAXPATHLEN
4617 #define MAXPATHLEN 1024
4618 #endif
4619
4620 KDE_HELLO MAXPATHLEN
4621
4622 EOF
4623
4624 ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
4625
4626 if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
4627     ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
4628 else
4629     ac_cv_maxpathlen=1024
4630 fi
4631
4632 rm conftest.*
4633
4634 ])
4635 AC_MSG_RESULT($ac_cv_maxpathlen)
4636 AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
4637 ])
4638
4639 AC_DEFUN([KDE_CHECK_HEADER],
4640 [
4641    AC_LANG_SAVE
4642    kde_safe_cppflags=$CPPFLAGS
4643    CPPFLAGS="$CPPFLAGS $all_includes"
4644    AC_LANG_CPLUSPLUS
4645    AC_CHECK_HEADER([$1], [$2], [$3], [$4])
4646    CPPFLAGS=$kde_safe_cppflags
4647    AC_LANG_RESTORE
4648 ])
4649
4650 AC_DEFUN([KDE_CHECK_HEADERS],
4651 [
4652    AH_CHECK_HEADERS([$1])
4653    AC_LANG_SAVE
4654    kde_safe_cppflags=$CPPFLAGS
4655    CPPFLAGS="$CPPFLAGS $all_includes"
4656    AC_LANG_CPLUSPLUS
4657    AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
4658    CPPFLAGS=$kde_safe_cppflags
4659    AC_LANG_RESTORE
4660 ])
4661
4662 AC_DEFUN([KDE_FAST_CONFIGURE],
4663 [
4664   dnl makes configure fast (needs perl)
4665   AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
4666       with_fast_perl=$enableval, with_fast_perl=yes)
4667 ])
4668
4669 AC_DEFUN([KDE_CONF_FILES],
4670 [
4671   val=
4672   if test -f $srcdir/configure.files ; then
4673     val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
4674   fi
4675   CONF_FILES=
4676   if test -n "$val" ; then
4677     for i in $val ; do
4678       CONF_FILES="$CONF_FILES $i"
4679     done
4680   fi
4681   AC_SUBST(CONF_FILES)
4682 ])dnl
4683
4684 dnl This sets the prefix, for arts and kdelibs
4685 dnl Do NOT use in any other module.
4686 dnl It only looks at --prefix, KDEDIR and falls back to /usr/local/kde
4687 AC_DEFUN([KDE_SET_PREFIX_CORE],
4688 [
4689   unset CDPATH
4690   dnl make $KDEDIR the default for the installation
4691   AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
4692
4693   if test "x$prefix" = "xNONE"; then
4694     prefix=$ac_default_prefix
4695     ac_configure_args="$ac_configure_args --prefix=$prefix"
4696   fi
4697   # And delete superfluous '/' to make compares easier
4698   prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4699   exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4700
4701   kde_libs_prefix='$(prefix)'
4702   kde_libs_htmldir='$(kde_htmldir)'
4703   AC_SUBST(kde_libs_prefix)
4704   AC_SUBST(kde_libs_htmldir)
4705   KDE_FAST_CONFIGURE
4706   KDE_CONF_FILES
4707 ])
4708
4709
4710 AC_DEFUN([KDE_SET_PREFIX],
4711 [
4712   unset CDPATH
4713   dnl We can't give real code to that macro, only a value.
4714   dnl It only matters for --help, since we set the prefix in this function anyway.
4715   AC_PREFIX_DEFAULT(${KDEDIR:-the kde prefix})
4716
4717   KDE_SET_DEFAULT_BINDIRS
4718   if test "x$prefix" = "xNONE"; then
4719     dnl no prefix given: look for kde-config in the PATH and deduce the prefix from it
4720     KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
4721   else
4722     dnl prefix given: look for kde-config, preferrably in prefix, otherwise in PATH
4723     kde_save_PATH="$PATH"
4724     PATH="$exec_prefix/bin:$prefix/bin:$PATH"
4725     KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
4726     PATH="$kde_save_PATH"
4727   fi
4728
4729   kde_libs_prefix=`$KDECONFIG --prefix`
4730   if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
4731        AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
4732                     This means it has been moved since you installed it.
4733                     This won't work. Please recompile kdelibs for the new prefix.
4734                     ])
4735   fi
4736   kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
4737   kde_libs_suffix=`$KDECONFIG --libsuffix`
4738
4739   AC_MSG_CHECKING([where to install])
4740   if test "x$prefix" = "xNONE"; then
4741     prefix=$kde_libs_prefix
4742     AC_MSG_RESULT([$prefix (as returned by kde-config)])
4743   else
4744     dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
4745     given_prefix=$prefix
4746     AC_MSG_RESULT([$prefix (as requested)])
4747   fi
4748
4749   # And delete superfluous '/' to make compares easier
4750   prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4751   exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4752   given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4753
4754   AC_SUBST(KDECONFIG)
4755   AC_SUBST(kde_libs_prefix)
4756   AC_SUBST(kde_libs_htmldir)
4757
4758   KDE_FAST_CONFIGURE
4759   KDE_CONF_FILES
4760 ])
4761
4762 pushdef([AC_PROG_INSTALL],
4763 [
4764   dnl our own version, testing for a -p flag
4765   popdef([AC_PROG_INSTALL])
4766   dnl as AC_PROG_INSTALL works as it works we first have
4767   dnl to save if the user didn't specify INSTALL, as the
4768   dnl autoconf one overwrites INSTALL and we have no chance to find
4769   dnl out afterwards
4770   test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
4771   test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
4772   test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
4773   AC_PROG_INSTALL
4774
4775   if test -z "$kde_save_INSTALL_given" ; then
4776     # OK, user hasn't given any INSTALL, autoconf found one for us
4777     # now we test, if it supports the -p flag
4778     AC_MSG_CHECKING(for -p flag to install)
4779     rm -f confinst.$$.* > /dev/null 2>&1
4780     echo "Testtest" > confinst.$$.orig
4781     ac_res=no
4782     if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
4783       if test -f confinst.$$.new ; then
4784         # OK, -p seems to do no harm to install
4785         INSTALL="${INSTALL} -p"
4786         ac_res=yes
4787       fi
4788     fi
4789     rm -f confinst.$$.*
4790     AC_MSG_RESULT($ac_res)
4791   fi
4792   dnl the following tries to resolve some signs and wonders coming up
4793   dnl with different autoconf/automake versions
4794   dnl e.g.:
4795   dnl  *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
4796   dnl   and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
4797   dnl   it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
4798   dnl  *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
4799   dnl   INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
4800   dnl   install-@DIR@PROGRAMS targets to explicitly use that flag
4801   dnl  *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
4802   dnl   INSTALL_SCRIPT, which breaks with automake <= 1.4
4803   dnl  *autoconf >2.13 (since 10.Apr 1999) has not that failure
4804   dnl  *sometimes KDE does not use the install-@DIR@PROGRAM targets from
4805   dnl   automake (due to broken Makefile.am or whatever) to install programs,
4806   dnl   and so does not see the -s flag in automake > 1.4
4807   dnl to clean up that mess we:
4808   dnl  +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
4809   dnl   which cleans KDE's program with automake > 1.4;
4810   dnl  +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
4811   dnl   with automake<=1.4
4812   dnl  note that dues to this sometimes two '-s' flags are used (if KDE
4813   dnl   properly uses install-@DIR@PROGRAMS, but I don't care
4814   dnl
4815   dnl And to all this comes, that I even can't write in comments variable
4816   dnl  names used by automake, because it is so stupid to think I wanted to
4817   dnl  _use_ them, therefor I have written A_M_... instead of AM_
4818   dnl hmm, I wanted to say something ... ahh yes: Arghhh.
4819
4820   if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
4821     INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
4822   fi
4823   if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
4824     INSTALL_SCRIPT='${INSTALL}'
4825   fi
4826 ])dnl
4827
4828 AC_DEFUN([KDE_LANG_CPLUSPLUS],
4829 [AC_LANG_CPLUSPLUS
4830 ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
4831 pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
4832 ])
4833
4834 pushdef([AC_LANG_CPLUSPLUS],
4835 [popdef([AC_LANG_CPLUSPLUS])
4836 KDE_LANG_CPLUSPLUS
4837 ])
4838
4839 AC_DEFUN([KDE_CHECK_LONG_LONG],
4840 [
4841 AC_MSG_CHECKING(for long long)
4842 AC_CACHE_VAL(kde_cv_c_long_long,
4843 [
4844   AC_LANG_SAVE
4845   AC_LANG_CPLUSPLUS
4846   AC_TRY_LINK([], [
4847   long long foo = 0;
4848   foo = foo+1;
4849   ],
4850   kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
4851   AC_LANG_RESTORE
4852 ])
4853 AC_MSG_RESULT($kde_cv_c_long_long)
4854 if test "$kde_cv_c_long_long" = yes; then
4855    AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
4856 fi
4857 ])
4858
4859 AC_DEFUN([KDE_CHECK_LIB],
4860 [
4861      kde_save_LDFLAGS="$LDFLAGS"
4862      dnl AC_CHECK_LIB modifies LIBS, so save it here
4863      kde_save_LIBS="$LIBS"
4864      LDFLAGS="$LDFLAGS $all_libraries"
4865      case $host_os in
4866       aix*) LDFLAGS="-brtl $LDFLAGS"
4867         test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
4868         ;;
4869      esac
4870      AC_CHECK_LIB($1, $2, $3, $4, $5)
4871      LDFLAGS="$kde_save_LDFLAGS"
4872      LIBS="$kde_save_LIBS"
4873 ])
4874
4875 AC_DEFUN([KDE_JAVA_PREFIX],
4876 [
4877         dir=`dirname "$1"`
4878         base=`basename "$1"`
4879         list=`ls -1 $dir 2> /dev/null`
4880         for entry in $list; do 
4881                 if test -d $dir/$entry/bin; then
4882                         case $entry in
4883                            $base)
4884                                 javadirs="$javadirs $dir/$entry/bin"
4885                                 ;;
4886                         esac
4887                 elif test -d $dir/$entry/jre/bin; then
4888                         case $entry in
4889                            $base)
4890                                 javadirs="$javadirs $dir/$entry/jre/bin"
4891                                 ;;
4892                         esac
4893                 fi
4894         done
4895 ])
4896
4897 dnl KDE_CHEC_JAVA_DIR(onlyjre)
4898 AC_DEFUN([KDE_CHECK_JAVA_DIR],
4899 [
4900
4901 AC_ARG_WITH(java,
4902 AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
4903 [  ac_java_dir=$withval
4904 ], ac_java_dir=""
4905 )
4906
4907 AC_MSG_CHECKING([for Java])
4908
4909 dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
4910 if test "x$ac_java_dir" = "xno"; then
4911    kde_java_bindir=no
4912    kde_java_includedir=no
4913    kde_java_libjvmdir=no
4914    kde_java_libgcjdir=no
4915    kde_java_libhpidir=no
4916 else
4917   if test "x$ac_java_dir" = "x"; then
4918      
4919      
4920       dnl No option set -> collect list of candidate paths
4921       if test -n "$JAVA_HOME"; then
4922         KDE_JAVA_PREFIX($JAVA_HOME)
4923       fi
4924       KDE_JAVA_PREFIX(/usr/j2se)
4925       KDE_JAVA_PREFIX(/usr/lib/j2se)
4926       KDE_JAVA_PREFIX(/usr/j*dk*)
4927       KDE_JAVA_PREFIX(/usr/lib/j*dk*)
4928       KDE_JAVA_PREFIX(/opt/j*sdk*)
4929       KDE_JAVA_PREFIX(/usr/lib/java*)
4930       KDE_JAVA_PREFIX(/usr/java*)
4931       KDE_JAVA_PREFIX(/usr/java/j*dk*)
4932       KDE_JAVA_PREFIX(/usr/java/j*re*)
4933       KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
4934       KDE_JAVA_PREFIX(/usr/lib/SunJava*)
4935       KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
4936       KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
4937       KDE_JAVA_PREFIX(/opt/java*)
4938
4939       kde_cv_path="NONE"
4940       kde_save_IFS=$IFS
4941       IFS=':'
4942       for dir in $PATH; do
4943           if test -d "$dir"; then
4944               javadirs="$javadirs $dir"
4945           fi
4946       done
4947       IFS=$kde_save_IFS
4948       jredirs=
4949
4950       dnl Now javadirs contains a list of paths that exist, all ending with bin/
4951       for dir in $javadirs; do
4952           dnl Check for the java executable
4953           if test -x "$dir/java"; then
4954               dnl And also check for a libjvm.so somewhere under there
4955               dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
4956               if test "$dir" != "/usr/bin"; then
4957                   libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4958                   if test ! -f $libjvmdir/libjvm.so; then continue; fi
4959                   jredirs="$jredirs $dir"
4960               fi
4961           fi
4962       done
4963
4964       dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
4965       JAVAC=
4966       JAVA=
4967       kde_java_bindir=no
4968       for dir in $jredirs; do
4969           JAVA="$dir/java"
4970           kde_java_bindir=$dir
4971           if test -x "$dir/javac"; then
4972                 JAVAC="$dir/javac"
4973                 break
4974           fi
4975       done
4976
4977       if test -n "$JAVAC"; then
4978           dnl this substitution might not work - well, we test for jni.h below
4979           kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
4980       else
4981           kde_java_includedir=no
4982       fi
4983   else
4984     dnl config option set
4985     kde_java_bindir=$ac_java_dir/bin
4986     if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
4987         kde_java_includedir=no
4988     else
4989         kde_java_includedir=$ac_java_dir/include
4990     fi
4991   fi
4992 fi
4993
4994 dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
4995 if test "x$kde_java_bindir" != "xno"; then
4996
4997   dnl Look for libjvm.so
4998   kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4999   dnl Look for libgcj.so
5000   kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
5001   dnl Look for libhpi.so and avoid green threads
5002   kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
5003
5004   dnl Now check everything's fine under there
5005   dnl the include dir is our flag for having the JDK
5006   if test -d "$kde_java_includedir"; then
5007     if test ! -x "$kde_java_bindir/javac"; then
5008       AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
5009     fi
5010     if test ! -x "$kde_java_bindir/javah"; then
5011       AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5012     fi
5013     if test ! -x "$kde_java_bindir/jar"; then
5014       AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5015     fi
5016     if test ! -r "$kde_java_includedir/jni.h"; then
5017       AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
5018     fi
5019
5020     jni_includes="-I$kde_java_includedir"
5021     dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
5022     dnl and under linux here.. 
5023     
5024     dnl not needed for gcj
5025
5026     if test "x$kde_java_libgcjdir" = "x"; then 
5027       test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
5028       test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
5029       test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
5030     fi
5031
5032   else
5033     JAVAC=
5034     jni_includes=
5035   fi
5036
5037   if test "x$kde_java_libgcjdir" = "x"; then 
5038      if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
5039         AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
5040      fi 
5041   else
5042      if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
5043         AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
5044      fi 
5045   fi
5046
5047   if test ! -x "$kde_java_bindir/java"; then
5048       AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5049   fi
5050
5051   dnl not needed for gcj compile
5052
5053   if test "x$kde_java_libgcjdir" = "x"; then 
5054       if test ! -r "$kde_java_libhpidir/libhpi.so"; then
5055         AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
5056       fi
5057   fi
5058
5059   if test -n "$jni_includes"; then
5060     dnl Check for JNI version
5061     AC_LANG_SAVE
5062     AC_LANG_CPLUSPLUS
5063     ac_cxxflags_safe="$CXXFLAGS"
5064     CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
5065
5066     AC_TRY_COMPILE([
5067   #include <jni.h>
5068               ],
5069               [
5070   #ifndef JNI_VERSION_1_2
5071   Syntax Error
5072   #endif
5073               ],[ kde_jni_works=yes ],
5074               [ kde_jni_works=no ])
5075
5076     if test $kde_jni_works = no; then
5077       AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
5078                     You need to have Java Development Kit (JDK) version 1.2. 
5079
5080                     Use --with-java to specify another location.
5081                     Use --without-java to configure without java support.
5082                     Or download a newer JDK and try again. 
5083                     See e.g. http://java.sun.com/products/jdk/1.2 ])
5084     fi
5085
5086     CXXFLAGS="$ac_cxxflags_safe"    
5087     AC_LANG_RESTORE
5088
5089     dnl All tests ok, inform and subst the variables
5090
5091     JAVAC=$kde_java_bindir/javac
5092     JAVAH=$kde_java_bindir/javah
5093     JAR=$kde_java_bindir/jar
5094     AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5095     if test "x$kde_java_libgcjdir" = "x"; then 
5096       JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
5097     else
5098       JVMLIBS="-L$kde_java_libgcjdir -lgcj"
5099     fi
5100     AC_MSG_RESULT([java JDK in $kde_java_bindir])
5101
5102   else
5103       AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5104       AC_MSG_RESULT([java JRE in $kde_java_bindir])
5105   fi
5106 elif test -d "/Library/Java/Home"; then
5107   kde_java_bindir="/Library/Java/Home/bin"
5108   jni_includes="-I/Library/Java/Home/include"
5109
5110   JAVAC=$kde_java_bindir/javac
5111   JAVAH=$kde_java_bindir/javah
5112   JAR=$kde_java_bindir/jar
5113   JVMLIBS="-Xlinker -framework -Xlinker JavaVM"
5114
5115   AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5116   AC_MSG_RESULT([Apple Java Framework])
5117 else
5118   AC_MSG_RESULT([none found])
5119 fi
5120
5121 AC_SUBST(JAVAC)
5122 AC_SUBST(JAVAH)
5123 AC_SUBST(JAR)
5124 AC_SUBST(JVMLIBS)
5125 AC_SUBST(jni_includes)
5126
5127 # for backward compat
5128 kde_cv_java_includedir=$kde_java_includedir
5129 kde_cv_java_bindir=$kde_java_bindir
5130 ])
5131
5132 dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
5133 dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
5134 dnl big packages, m4_foreach is dog-slow.  So use our own version of
5135 dnl it.  (matz@kde.org)
5136 m4_define([mm_foreach],
5137 [m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
5138 m4_define([mm_car], [[$1]])
5139 m4_define([mm_car2], [[$@]])
5140 m4_define([_mm_foreach],
5141 [m4_if(m4_quote($2), [], [],
5142        [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
5143                                                    mm_car2(m4_shift($2)),
5144                                                    [$3])])])
5145 m4_define([AC_FOREACH],
5146 [mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
5147
5148 AC_DEFUN([KDE_NEED_FLEX],
5149 [
5150 kde_libs_safe=$LIBS
5151 LIBS="$LIBS $USER_LDFLAGS"
5152 AM_PROG_LEX
5153 LIBS=$kde_libs_safe
5154 if test -z "$LEXLIB"; then
5155     AC_MSG_ERROR([You need to have flex installed.])
5156 fi
5157 AC_SUBST(LEXLIB)
5158 ])
5159
5160 AC_DEFUN([AC_PATH_QTOPIA],
5161 [
5162   dnl TODO: use AC_CACHE_VAL
5163
5164   if test -z "$1"; then
5165     qtopia_minver_maj=1
5166     qtopia_minver_min=5
5167     qtopia_minver_pat=0
5168   else
5169     qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
5170     qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
5171     qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
5172   fi
5173
5174   qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
5175   qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
5176
5177   AC_REQUIRE([AC_PATH_QT])
5178
5179   AC_MSG_CHECKING([for Qtopia])
5180
5181   LIB_QTOPIA="-lqpe"
5182   AC_SUBST(LIB_QTOPIA)
5183
5184   kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
5185
5186   ac_qtopia_incdir=NO
5187
5188   AC_ARG_WITH(qtopia-dir,
5189               AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]),
5190               [  ac_qtopia_incdir="$withval"/include] ) 
5191   
5192   qtopia_incdirs=""
5193   for dir in $kde_qtopia_dirs; do
5194     qtopia_incdirs="$qtopia_incdirs $dir/include"
5195   done
5196
5197   if test ! "$ac_qtopia_incdir" = "NO"; then
5198     qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
5199   fi
5200
5201   qtopia_incdir=""
5202   AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
5203   ac_qtopia_incdir="$qtopia_incdir"
5204
5205   if test -z "$qtopia_incdir"; then
5206     AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
5207   fi
5208
5209   qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
5210   qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
5211   qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
5212
5213   qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
5214   qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
5215   if test "$qtopia_ver" -lt "$qtopia_minver"; then
5216     AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
5217 is required.])
5218   fi
5219
5220   AC_LANG_SAVE
5221   AC_LANG_CPLUSPLUS
5222
5223   ac_cxxflags_safe="$CXXFLAGS"
5224   ac_ldflags_safe="$LDFLAGS"
5225   ac_libs_safe="$LIBS"
5226
5227   CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
5228   LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
5229   LIBS="$LIBS $LIB_QTOPIA $LIBQT"
5230
5231   cat > conftest.$ac_ext <<EOF
5232 #include "confdefs.h"
5233 #include <qpe/qpeapplication.h>
5234 #include <qpe/version.h>
5235
5236 int main( int argc, char **argv )
5237 {
5238     QPEApplication app( argc, argv );
5239     return 0;
5240 }
5241 EOF
5242
5243   if AC_TRY_EVAL(ac_link) && test -s conftest; then
5244     rm -f conftest*
5245   else
5246     rm -f conftest*
5247     AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
5248 the end of config.log])
5249   fi
5250
5251   CXXFLAGS="$ac_cxxflags_safe"
5252   LDFLAGS="$ac_ldflags_safe"
5253   LIBS="$ac_libs_safe"
5254
5255   AC_LANG_RESTORE
5256
5257   QTOPIA_INCLUDES="-I$qtopia_incdir"
5258   AC_SUBST(QTOPIA_INCLUDES)
5259
5260   AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
5261 ])
5262
5263
5264 AC_DEFUN([KDE_INIT_DOXYGEN],
5265 [
5266 AC_MSG_CHECKING([for Qt docs])
5267 kde_qtdir=
5268 if test "${with_qt_dir+set}" = set; then
5269   kde_qtdir="$with_qt_dir"
5270 fi
5271
5272 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 /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
5273 AC_MSG_RESULT($QTDOCDIR)
5274
5275 AC_SUBST(QTDOCDIR)
5276
5277 KDE_FIND_PATH(dot, DOT, [], [])
5278 if test -n "$DOT"; then
5279   KDE_HAVE_DOT="YES"
5280 else
5281   KDE_HAVE_DOT="NO"
5282 fi
5283 AC_SUBST(KDE_HAVE_DOT)
5284 KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
5285 AC_SUBST(DOXYGEN)
5286
5287 DOXYGEN_PROJECT_NAME="$1"
5288 DOXYGEN_PROJECT_NUMBER="$2"
5289 AC_SUBST(DOXYGEN_PROJECT_NAME)
5290 AC_SUBST(DOXYGEN_PROJECT_NUMBER)
5291
5292 KDE_HAS_DOXYGEN=no
5293 if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
5294   KDE_HAS_DOXYGEN=yes
5295 fi
5296 AC_SUBST(KDE_HAS_DOXYGEN)
5297
5298 ])
5299
5300
5301 AC_DEFUN([AC_FIND_BZIP2],
5302 [
5303 AC_MSG_CHECKING([for bzDecompress in libbz2])
5304 AC_CACHE_VAL(ac_cv_lib_bzip2,
5305 [
5306 AC_LANG_SAVE
5307 AC_LANG_CPLUSPLUS
5308 kde_save_LIBS="$LIBS"
5309 LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
5310 kde_save_CXXFLAGS="$CXXFLAGS"
5311 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
5312 AC_TRY_LINK(dnl
5313 [
5314 #define BZ_NO_STDIO
5315 #include<bzlib.h>
5316 ],
5317             [ bz_stream s; (void) bzDecompress(&s); ],
5318             eval "ac_cv_lib_bzip2='-lbz2'",
5319             eval "ac_cv_lib_bzip2=no")
5320 LIBS="$kde_save_LIBS"
5321 CXXFLAGS="$kde_save_CXXFLAGS"
5322 AC_LANG_RESTORE
5323 ])dnl
5324 AC_MSG_RESULT($ac_cv_lib_bzip2)
5325
5326 if test ! "$ac_cv_lib_bzip2" = no; then
5327   BZIP2DIR=bzip2
5328
5329   LIBBZ2="$ac_cv_lib_bzip2"
5330   AC_SUBST(LIBBZ2)
5331
5332 else
5333
5334    cxx_shared_flag=
5335    ld_shared_flag=
5336    KDE_CHECK_COMPILER_FLAG(shared, [
5337         ld_shared_flag="-shared"
5338    ])
5339    KDE_CHECK_COMPILER_FLAG(fPIC, [
5340         cxx_shared_flag="-fPIC"
5341    ])
5342
5343    AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
5344    AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
5345    [
5346    AC_LANG_SAVE
5347    AC_LANG_CPLUSPLUS
5348    kde_save_LIBS="$LIBS"
5349    LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
5350    kde_save_CXXFLAGS="$CXXFLAGS"
5351    CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
5352
5353    AC_TRY_LINK(dnl
5354    [
5355    #define BZ_NO_STDIO
5356    #include<bzlib.h>
5357    ],
5358                [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
5359                eval "ac_cv_lib_bzip2_prefix='-lbz2'",
5360                eval "ac_cv_lib_bzip2_prefix=no")
5361    LIBS="$kde_save_LIBS"
5362    CXXFLAGS="$kde_save_CXXFLAGS"
5363    AC_LANG_RESTORE
5364    ])dnl
5365
5366    AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
5367    
5368    if test ! "$ac_cv_lib_bzip2_prefix" = no; then
5369      BZIP2DIR=bzip2
5370     
5371      LIBBZ2="$ac_cv_lib_bzip2_prefix"
5372      AC_SUBST(LIBBZ2)
5373
5374      AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
5375    dnl else, we just ignore this
5376    fi
5377
5378 fi
5379 AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
5380 ])
5381
5382 dnl ------------------------------------------------------------------------
5383 dnl Try to find the SSL headers and libraries.
5384 dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
5385 dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
5386 dnl ------------------------------------------------------------------------
5387 dnl
5388 AC_DEFUN([KDE_CHECK_SSL],
5389 [
5390 LIBSSL="-lssl -lcrypto"
5391 AC_REQUIRE([KDE_CHECK_LIB64])
5392
5393 ac_ssl_includes=NO ac_ssl_libraries=NO
5394 ssl_libraries=""
5395 ssl_includes=""
5396 AC_ARG_WITH(ssl-dir,
5397     AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
5398     [  ac_ssl_includes="$withval"/include
5399        ac_ssl_libraries="$withval"/lib$kdelibsuff
5400     ])
5401
5402 want_ssl=yes
5403 AC_ARG_WITH(ssl,
5404     AC_HELP_STRING([--without-ssl],[disable SSL checks]),
5405     [want_ssl=$withval])
5406
5407 if test $want_ssl = yes; then
5408
5409 AC_MSG_CHECKING(for OpenSSL)
5410
5411 AC_CACHE_VAL(ac_cv_have_ssl,
5412 [#try to guess OpenSSL locations
5413   
5414   ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
5415   ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
5416   AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
5417   ac_ssl_includes="$ssl_incdir"
5418
5419   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"
5420   if test ! "$ac_ssl_libraries" = "NO"; then
5421     ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
5422   fi
5423
5424   test=NONE
5425   ssl_libdir=NONE
5426   for dir in $ssl_libdirs; do
5427     try="ls -1 $dir/libssl*"
5428     if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
5429   done
5430
5431   ac_ssl_libraries="$ssl_libdir"
5432
5433   ac_ldflags_safe="$LDFLAGS"
5434   ac_libs_safe="$LIBS"
5435
5436   LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
5437   LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
5438
5439   AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
5440   ac_ssl_rsaref="yes"
5441   ,
5442   ac_ssl_rsaref="no"
5443   )
5444
5445   LDFLAGS="$ac_ldflags_safe"
5446   LIBS="$ac_libs_safe"
5447
5448   if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
5449     have_ssl=no
5450   else
5451     have_ssl=yes;
5452   fi
5453
5454   ])
5455
5456   eval "$ac_cv_have_ssl"
5457
5458   AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
5459
5460   AC_MSG_CHECKING([whether OpenSSL uses rsaref])
5461   AC_MSG_RESULT($ac_ssl_rsaref)
5462
5463   AC_MSG_CHECKING([for easter eggs])
5464   AC_MSG_RESULT([none found])
5465
5466 else
5467   have_ssl=no
5468 fi
5469
5470 if test "$have_ssl" = yes; then
5471   AC_MSG_CHECKING(for OpenSSL version)
5472   dnl Check for SSL version
5473   AC_CACHE_VAL(ac_cv_ssl_version,
5474   [
5475
5476     cat >conftest.$ac_ext <<EOF
5477 #include <openssl/opensslv.h>
5478 #include <stdio.h>
5479     int main() {
5480  
5481 #ifndef OPENSSL_VERSION_NUMBER
5482       printf("ssl_version=\\"error\\"\n");
5483 #else
5484       if (OPENSSL_VERSION_NUMBER < 0x00906000)
5485         printf("ssl_version=\\"old\\"\n");
5486       else
5487         printf("ssl_version=\\"ok\\"\n");
5488 #endif
5489      return (0);
5490     }
5491 EOF
5492
5493     ac_save_CPPFLAGS=$CPPFLAGS
5494     if test "$ac_ssl_includes" != "/usr/include"; then
5495         CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
5496     fi
5497
5498     if AC_TRY_EVAL(ac_link); then 
5499
5500       if eval `./conftest 2>&5`; then
5501         if test $ssl_version = error; then
5502           AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
5503         else
5504           if test $ssl_version = old; then
5505             AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
5506             have_ssl=no
5507           fi
5508         fi
5509         ac_cv_ssl_version="ssl_version=$ssl_version"
5510       else
5511         AC_MSG_ERROR([Your system couldn't run a small SSL test program.
5512         Check config.log, and if you can't figure it out, send a mail to 
5513         David Faure <faure@kde.org>, attaching your config.log])
5514       fi
5515
5516     else
5517       AC_MSG_ERROR([Your system couldn't link a small SSL test program.
5518       Check config.log, and if you can't figure it out, send a mail to 
5519       David Faure <faure@kde.org>, attaching your config.log])
5520     fi 
5521     CPPFLAGS=$ac_save_CPPFLAGS
5522
5523   ])
5524
5525   eval "$ac_cv_ssl_version"
5526   AC_MSG_RESULT($ssl_version)
5527 fi
5528
5529 if test "$have_ssl" != yes; then
5530   LIBSSL="";
5531 else
5532   AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
5533   ac_cv_have_ssl="have_ssl=yes \
5534     ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
5535   
5536   
5537   ssl_libraries="$ac_ssl_libraries"
5538   ssl_includes="$ac_ssl_includes"
5539
5540   if test "$ac_ssl_rsaref" = yes; then
5541     LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref" 
5542   fi
5543
5544   if test $ssl_version = "old"; then
5545     AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
5546   fi
5547 fi
5548
5549 SSL_INCLUDES=
5550
5551 if test "$ssl_includes" = "/usr/include"; then
5552   if test -f /usr/kerberos/include/krb5.h; then
5553         SSL_INCLUDES="-I/usr/kerberos/include"
5554   fi
5555 elif test  "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
5556   SSL_INCLUDES="-I$ssl_includes"
5557 fi
5558
5559 if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
5560  SSL_LDFLAGS=""
5561 else
5562  SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
5563 fi
5564
5565 AC_SUBST(SSL_INCLUDES)
5566 AC_SUBST(SSL_LDFLAGS)
5567 AC_SUBST(LIBSSL)
5568 ])
5569
5570 AC_DEFUN([KDE_CHECK_STRLCPY],
5571 [
5572   AC_REQUIRE([AC_CHECK_STRLCAT])
5573   AC_REQUIRE([AC_CHECK_STRLCPY])
5574   AC_CHECK_SIZEOF(size_t)
5575   AC_CHECK_SIZEOF(unsigned long)
5576
5577   AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
5578   AC_TRY_COMPILE(,[
5579     #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
5580        choke me
5581     #endif
5582     ],AC_MSG_RESULT([yes]),[
5583       AC_MSG_RESULT(no)
5584       AC_MSG_ERROR([
5585        Apparently on your system our assumption sizeof size_t == sizeof unsigned long 
5586        does not apply. Please mail kde-devel@kde.org with a description of your system!
5587       ])
5588   ])
5589 ])
5590
5591 AC_DEFUN([KDE_CHECK_BINUTILS],
5592 [
5593   AC_MSG_CHECKING([if ld supports unversioned version maps])
5594
5595   kde_save_LDFLAGS="$LDFLAGS"
5596   LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
5597   echo "{ local: extern \"C++\" { foo }; };" > conftest.map
5598   AC_TRY_LINK([int foo;],
5599 [
5600 #ifdef __INTEL_COMPILER
5601 icc apparently does not support libtools version-info and version-script
5602 at the same time. Dunno where the bug is, but until somebody figured out,
5603 better disable the optional version scripts.
5604 #endif
5605
5606   foo = 42;
5607 ], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
5608   LDFLAGS="$kde_save_LDFLAGS"
5609   rm -f conftest.map
5610   AM_CONDITIONAL(include_VERSION_SCRIPT, 
5611     [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
5612
5613   AC_MSG_RESULT($kde_supports_versionmaps)
5614 ])
5615
5616 AC_DEFUN([AM_PROG_OBJC],[
5617 AC_CHECK_PROGS(OBJC, gcc, gcc)
5618 test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
5619 if test "x${OBJCFLAGS-unset}" = xunset; then
5620    OBJCFLAGS="-g -O2"
5621 fi
5622 AC_SUBST(OBJCFLAGS)
5623 _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
5624 ])
5625
5626 AC_DEFUN([KDE_CHECK_PERL],
5627 [
5628         KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
5629                     AC_MSG_ERROR([No Perl found in your $PATH.
5630 We need perl to generate some code.])
5631         ])
5632     AC_SUBST(PERL)
5633 ])
5634
5635 AC_DEFUN([KDE_CHECK_LARGEFILE],
5636 [
5637 AC_SYS_LARGEFILE
5638 if test "$ac_cv_sys_file_offset_bits" != no; then
5639   CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
5640 fi
5641
5642 if test "x$ac_cv_sys_large_files" != "xno"; then
5643   CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
5644 fi
5645
5646 ])
5647
5648 dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
5649 dnl which allows to search for libs that get installed into the KDE prefix.
5650 dnl
5651 dnl Syntax:  KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
5652 dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
5653 dnl also defines KSTUFF_PKG_ERRORS on error
5654 AC_DEFUN([KDE_PKG_CHECK_MODULES], [
5655
5656    PKG_CONFIG_PATH="$prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
5657    if test "$prefix" != "$kde_libs_prefix"; then
5658        PKG_CONFIG_PATH="$kde_libs_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
5659    fi
5660    export PKG_CONFIG_PATH
5661    PKG_CHECK_MODULES($1,$2,$3,$4)
5662 ])
5663
5664 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
5665 ## Copyright 1996, 1997, 1998, 1999, 2000, 2001
5666 ## Free Software Foundation, Inc.
5667 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5668 ##
5669 ## This program is free software; you can redistribute it and/or modify
5670 ## it under the terms of the GNU General Public License as published by
5671 ## the Free Software Foundation; either version 2 of the License, or
5672 ## (at your option) any later version.
5673 ##
5674 ## This program is distributed in the hope that it will be useful, but
5675 ## WITHOUT ANY WARRANTY; without even the implied warranty of
5676 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
5677 ## General Public License for more details.
5678 ##
5679 ## You should have received a copy of the GNU General Public License
5680 ## along with this program; if not, write to the Free Software
5681 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
5682 ##
5683 ## As a special exception to the GNU General Public License, if you
5684 ## distribute this file as part of a program that contains a
5685 ## configuration script generated by Autoconf, you may include it under
5686 ## the same distribution terms that you use for the rest of that program.
5687
5688 # serial 47 AC_PROG_LIBTOOL
5689
5690
5691 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
5692 # -----------------------------------------------------------
5693 # If this macro is not defined by Autoconf, define it here.
5694 m4_ifdef([AC_PROVIDE_IFELSE],
5695          [],
5696          [m4_define([AC_PROVIDE_IFELSE],
5697                  [m4_ifdef([AC_PROVIDE_$1],
5698                            [$2], [$3])])])
5699
5700
5701 # AC_PROG_LIBTOOL
5702 # ---------------
5703 AC_DEFUN([AC_PROG_LIBTOOL],
5704 [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
5705 dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
5706 dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
5707   AC_PROVIDE_IFELSE([AC_PROG_CXX],
5708     [AC_LIBTOOL_CXX],
5709     [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
5710   ])])
5711 dnl And a similar setup for Fortran 77 support
5712   AC_PROVIDE_IFELSE([AC_PROG_F77],
5713     [AC_LIBTOOL_F77],
5714     [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
5715 ])])
5716
5717 dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
5718 dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
5719 dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
5720   AC_PROVIDE_IFELSE([AC_PROG_GCJ],
5721     [AC_LIBTOOL_GCJ],
5722     [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
5723       [AC_LIBTOOL_GCJ],
5724       [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
5725         [AC_LIBTOOL_GCJ],
5726       [ifdef([AC_PROG_GCJ],
5727              [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
5728        ifdef([A][M_PROG_GCJ],
5729              [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
5730        ifdef([LT_AC_PROG_GCJ],
5731              [define([LT_AC_PROG_GCJ],
5732                 defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
5733 ])])# AC_PROG_LIBTOOL
5734
5735
5736 # _AC_PROG_LIBTOOL
5737 # ----------------
5738 AC_DEFUN([_AC_PROG_LIBTOOL],
5739 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
5740 AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
5741 AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
5742 AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
5743
5744 # This can be used to rebuild libtool when needed
5745 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
5746
5747 # Always use our own libtool.
5748 LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'
5749 AC_SUBST(LIBTOOL)dnl
5750
5751 # Prevent multiple expansion
5752 define([AC_PROG_LIBTOOL], [])
5753 ])# _AC_PROG_LIBTOOL
5754
5755
5756 # AC_LIBTOOL_SETUP
5757 # ----------------
5758 AC_DEFUN([AC_LIBTOOL_SETUP],
5759 [AC_PREREQ(2.50)dnl
5760 AC_REQUIRE([AC_ENABLE_SHARED])dnl
5761 AC_REQUIRE([AC_ENABLE_STATIC])dnl
5762 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
5763 AC_REQUIRE([AC_CANONICAL_HOST])dnl
5764 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
5765 AC_REQUIRE([AC_PROG_CC])dnl
5766 AC_REQUIRE([AC_PROG_LD])dnl
5767 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
5768 AC_REQUIRE([AC_PROG_NM])dnl
5769
5770 AC_REQUIRE([AC_PROG_LN_S])dnl
5771 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
5772 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
5773 AC_REQUIRE([AC_OBJEXT])dnl
5774 AC_REQUIRE([AC_EXEEXT])dnl
5775 dnl
5776
5777 AC_LIBTOOL_SYS_MAX_CMD_LEN
5778 AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
5779 AC_LIBTOOL_OBJDIR
5780
5781 AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
5782 _LT_AC_PROG_ECHO_BACKSLASH
5783
5784 case $host_os in
5785 aix3*)
5786   # AIX sometimes has problems with the GCC collect2 program.  For some
5787   # reason, if we set the COLLECT_NAMES environment variable, the problems
5788   # vanish in a puff of smoke.
5789   if test "X${COLLECT_NAMES+set}" != Xset; then
5790     COLLECT_NAMES=
5791     export COLLECT_NAMES
5792   fi
5793   ;;
5794 esac
5795
5796 # Sed substitution that helps us do robust quoting.  It backslashifies
5797 # metacharacters that are still active within double-quoted strings.
5798 Xsed='sed -e s/^X//'
5799 [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
5800
5801 # Same as above, but do not quote variable references.
5802 [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
5803
5804 # Sed substitution to delay expansion of an escaped shell variable in a
5805 # double_quote_subst'ed string.
5806 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
5807
5808 # Sed substitution to avoid accidental globbing in evaled expressions
5809 no_glob_subst='s/\*/\\\*/g'
5810
5811 # Constants:
5812 rm="rm -f"
5813
5814 # Global variables:
5815 default_ofile=libtool
5816 can_build_shared=yes
5817
5818 # All known linkers require a `.a' archive for static linking (except M$VC,
5819 # which needs '.lib').
5820 libext=a
5821 ltmain="$ac_aux_dir/ltmain.sh"
5822 ofile="$default_ofile"
5823 with_gnu_ld="$lt_cv_prog_gnu_ld"
5824
5825 AC_CHECK_TOOL(AR, ar, false)
5826 AC_CHECK_TOOL(RANLIB, ranlib, :)
5827 AC_CHECK_TOOL(STRIP, strip, :)
5828
5829 old_CC="$CC"
5830 old_CFLAGS="$CFLAGS"
5831
5832 # Set sane defaults for various variables
5833 test -z "$AR" && AR=ar
5834 test -z "$AR_FLAGS" && AR_FLAGS=cru
5835 test -z "$AS" && AS=as
5836 test -z "$CC" && CC=cc
5837 test -z "$LTCC" && LTCC=$CC
5838 test -z "$DLLTOOL" && DLLTOOL=dlltool
5839 test -z "$LD" && LD=ld
5840 test -z "$LN_S" && LN_S="ln -s"
5841 test -z "$MAGIC_CMD" && MAGIC_CMD=file
5842 test -z "$NM" && NM=nm
5843 test -z "$SED" && SED=sed
5844 test -z "$OBJDUMP" && OBJDUMP=objdump
5845 test -z "$RANLIB" && RANLIB=:
5846 test -z "$STRIP" && STRIP=:
5847 test -z "$ac_objext" && ac_objext=o
5848
5849 # Determine commands to create old-style static archives.
5850 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
5851 old_postinstall_cmds='chmod 644 $oldlib'
5852 old_postuninstall_cmds=
5853
5854 if test -n "$RANLIB"; then
5855   case $host_os in
5856   openbsd*)
5857     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
5858     ;;
5859   *)
5860     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
5861     ;;
5862   esac
5863   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
5864 fi
5865
5866 # Only perform the check for file, if the check method requires it
5867 case $deplibs_check_method in
5868 file_magic*)
5869   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
5870     AC_PATH_MAGIC
5871   fi
5872   ;;
5873 esac
5874
5875 AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
5876 AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
5877 enable_win32_dll=yes, enable_win32_dll=no)
5878
5879 AC_ARG_ENABLE([libtool-lock],
5880     [AC_HELP_STRING([--disable-libtool-lock],
5881         [avoid locking (might break parallel builds)])])
5882 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
5883
5884 AC_ARG_WITH([pic],
5885     [AC_HELP_STRING([--with-pic],
5886         [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
5887     [pic_mode="$withval"],
5888     [pic_mode=default])
5889 test -z "$pic_mode" && pic_mode=default
5890
5891 # Use C for the default configuration in the libtool script
5892 tagname=
5893 AC_LIBTOOL_LANG_C_CONFIG
5894 _LT_AC_TAGCONFIG
5895 ])# AC_LIBTOOL_SETUP
5896
5897
5898 # _LT_AC_SYS_COMPILER
5899 # -------------------
5900 AC_DEFUN([_LT_AC_SYS_COMPILER],
5901 [AC_REQUIRE([AC_PROG_CC])dnl
5902
5903 # If no C compiler was specified, use CC.
5904 LTCC=${LTCC-"$CC"}
5905
5906 # Allow CC to be a program name with arguments.
5907 compiler=$CC
5908 ])# _LT_AC_SYS_COMPILER
5909
5910
5911 # _LT_AC_SYS_LIBPATH_AIX
5912 # ----------------------
5913 # Links a minimal program and checks the executable
5914 # for the system default hardcoded library path. In most cases,
5915 # this is /usr/lib:/lib, but when the MPI compilers are used
5916 # the location of the communication and MPI libs are included too.
5917 # If we don't find anything, use the default library path according
5918 # to the aix ld manual.
5919 AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
5920 [AC_LINK_IFELSE(AC_LANG_PROGRAM,[
5921 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
5922 }'`
5923 # Check for a 64-bit object if we didn't find anything.
5924 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; }
5925 }'`; fi],[])
5926 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
5927 ])# _LT_AC_SYS_LIBPATH_AIX
5928
5929
5930 # _LT_AC_SHELL_INIT(ARG)
5931 # ----------------------
5932 AC_DEFUN([_LT_AC_SHELL_INIT],
5933 [ifdef([AC_DIVERSION_NOTICE],
5934              [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
5935          [AC_DIVERT_PUSH(NOTICE)])
5936 $1
5937 AC_DIVERT_POP
5938 ])# _LT_AC_SHELL_INIT
5939
5940
5941 # _LT_AC_PROG_ECHO_BACKSLASH
5942 # --------------------------
5943 # Add some code to the start of the generated configure script which
5944 # will find an echo command which doesn't interpret backslashes.
5945 AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
5946 [_LT_AC_SHELL_INIT([
5947 # Check that we are running under the correct shell.
5948 SHELL=${CONFIG_SHELL-/bin/sh}
5949
5950 case X$ECHO in
5951 X*--fallback-echo)
5952   # Remove one level of quotation (which was required for Make).
5953   ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
5954   ;;
5955 esac
5956
5957 echo=${ECHO-echo}
5958 if test "X[$]1" = X--no-reexec; then
5959   # Discard the --no-reexec flag, and continue.
5960   shift
5961 elif test "X[$]1" = X--fallback-echo; then
5962   # Avoid inline document here, it may be left over
5963   :
5964 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
5965   # Yippee, $echo works!
5966   :
5967 else
5968   # Restart under the correct shell.
5969   exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
5970 fi
5971
5972 if test "X[$]1" = X--fallback-echo; then
5973   # used as fallback echo
5974   shift
5975   cat <<EOF
5976 [$]*
5977 EOF
5978   exit 0
5979 fi
5980
5981 # The HP-UX ksh and POSIX shell print the target directory to stdout
5982 # if CDPATH is set.
5983 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
5984
5985 if test -z "$ECHO"; then
5986 if test "X${echo_test_string+set}" != Xset; then
5987 # find a string as large as possible, as long as the shell can cope with it
5988   for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
5989     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
5990     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
5991        echo_test_string="`eval $cmd`" &&
5992        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
5993     then
5994       break
5995     fi
5996   done
5997 fi
5998
5999 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
6000    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
6001    test "X$echo_testing_string" = "X$echo_test_string"; then
6002   :
6003 else
6004   # The Solaris, AIX, and Digital Unix default echo programs unquote
6005   # backslashes.  This makes it impossible to quote backslashes using
6006   #   echo "$something" | sed 's/\\/\\\\/g'
6007   #
6008   # So, first we look for a working echo in the user's PATH.
6009
6010   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
6011   for dir in $PATH /usr/ucb; do
6012     IFS="$lt_save_ifs"
6013     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
6014        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
6015        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
6016        test "X$echo_testing_string" = "X$echo_test_string"; then
6017       echo="$dir/echo"
6018       break
6019     fi
6020   done
6021   IFS="$lt_save_ifs"
6022
6023   if test "X$echo" = Xecho; then
6024     # We didn't find a better echo, so look for alternatives.
6025     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
6026        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
6027        test "X$echo_testing_string" = "X$echo_test_string"; then
6028       # This shell has a builtin print -r that does the trick.
6029       echo='print -r'
6030     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
6031          test "X$CONFIG_SHELL" != X/bin/ksh; then
6032       # If we have ksh, try running configure again with it.
6033       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
6034       export ORIGINAL_CONFIG_SHELL
6035       CONFIG_SHELL=/bin/ksh
6036       export CONFIG_SHELL
6037       exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
6038     else
6039       # Try using printf.
6040       echo='printf %s\n'
6041       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
6042          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
6043          test "X$echo_testing_string" = "X$echo_test_string"; then
6044         # Cool, printf works
6045         :
6046       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
6047            test "X$echo_testing_string" = 'X\t' &&
6048            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
6049            test "X$echo_testing_string" = "X$echo_test_string"; then
6050         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
6051         export CONFIG_SHELL
6052         SHELL="$CONFIG_SHELL"
6053         export SHELL
6054         echo="$CONFIG_SHELL [$]0 --fallback-echo"
6055       elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
6056            test "X$echo_testing_string" = 'X\t' &&
6057            echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
6058            test "X$echo_testing_string" = "X$echo_test_string"; then
6059         echo="$CONFIG_SHELL [$]0 --fallback-echo"
6060       else
6061         # maybe with a smaller string...
6062         prev=:
6063
6064         for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
6065           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
6066           then
6067             break
6068           fi
6069           prev="$cmd"
6070         done
6071
6072         if test "$prev" != 'sed 50q "[$]0"'; then
6073           echo_test_string=`eval $prev`
6074           export echo_test_string
6075           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
6076         else
6077           # Oops.  We lost completely, so just stick with echo.
6078           echo=echo
6079         fi
6080       fi
6081     fi
6082   fi
6083 fi
6084 fi
6085
6086 # Copy echo and quote the copy suitably for passing to libtool from
6087 # the Makefile, instead of quoting the original, which is used later.
6088 ECHO=$echo
6089 if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
6090    ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
6091 fi
6092
6093 AC_SUBST(ECHO)
6094 ])])# _LT_AC_PROG_ECHO_BACKSLASH
6095
6096
6097 # _LT_AC_LOCK
6098 # -----------
6099 AC_DEFUN([_LT_AC_LOCK],
6100 [AC_ARG_ENABLE([libtool-lock],
6101     [AC_HELP_STRING([--disable-libtool-lock],
6102         [avoid locking (might break parallel builds)])])
6103 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
6104
6105 # Some flags need to be propagated to the compiler or linker for good
6106 # libtool support.
6107 case $host in
6108 ia64-*-hpux*)
6109   # Find out which ABI we are using.
6110   echo 'int i;' > conftest.$ac_ext
6111   if AC_TRY_EVAL(ac_compile); then
6112     case `/usr/bin/file conftest.$ac_objext` in
6113     *ELF-32*)
6114       HPUX_IA64_MODE="32"
6115       ;;
6116     *ELF-64*)
6117       HPUX_IA64_MODE="64"
6118       ;;
6119     esac
6120   fi
6121   rm -rf conftest*
6122   ;;
6123 *-*-irix6*)
6124   # Find out which ABI we are using.
6125   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
6126   if AC_TRY_EVAL(ac_compile); then
6127    if test "$lt_cv_prog_gnu_ld" = yes; then
6128     case `/usr/bin/file conftest.$ac_objext` in
6129     *32-bit*)
6130       LD="${LD-ld} -melf32bsmip"
6131       ;;
6132     *N32*)
6133       LD="${LD-ld} -melf32bmipn32"
6134       ;;
6135     *64-bit*)
6136       LD="${LD-ld} -melf64bmip"
6137       ;;
6138     esac
6139    else
6140     case `/usr/bin/file conftest.$ac_objext` in
6141     *32-bit*)
6142       LD="${LD-ld} -32"
6143       ;;
6144     *N32*)
6145       LD="${LD-ld} -n32"
6146       ;;
6147     *64-bit*)
6148       LD="${LD-ld} -64"
6149       ;;
6150     esac
6151    fi
6152   fi
6153   rm -rf conftest*
6154   ;;
6155
6156 x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
6157   # Find out which ABI we are using.
6158   echo 'int i;' > conftest.$ac_ext
6159   if AC_TRY_EVAL(ac_compile); then
6160     case "`/usr/bin/file conftest.o`" in
6161     *32-bit*)
6162       LINUX_64_MODE="32"
6163       case $host in
6164         x86_64-*linux*)
6165           LD="${LD-ld} -m elf_i386"
6166           ;;
6167         ppc64-*linux*)
6168           LD="${LD-ld} -m elf32ppclinux"
6169           ;;
6170         s390x-*linux*)
6171           LD="${LD-ld} -m elf_s390"
6172           ;;
6173         sparc64-*linux*)
6174           LD="${LD-ld} -m elf32_sparc"
6175           ;;
6176       esac
6177       ;;
6178     *64-bit*)
6179       LINUX_64_MODE="64"
6180       case $host in
6181         x86_64-*linux*)
6182           LD="${LD-ld} -m elf_x86_64"
6183           ;;
6184         ppc*-*linux*|powerpc*-*linux*)
6185           LD="${LD-ld} -m elf64ppc"
6186           ;;
6187         s390*-*linux*)
6188           LD="${LD-ld} -m elf64_s390"
6189           ;;
6190         sparc*-*linux*)
6191           LD="${LD-ld} -m elf64_sparc"
6192           ;;
6193       esac
6194       ;;
6195     esac
6196   fi
6197   rm -rf conftest*
6198   ;;
6199
6200 *-*-sco3.2v5*)
6201   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
6202   SAVE_CFLAGS="$CFLAGS"
6203   CFLAGS="$CFLAGS -belf"
6204   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
6205     [AC_LANG_PUSH(C)
6206      AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
6207      AC_LANG_POP])
6208   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
6209     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
6210     CFLAGS="$SAVE_CFLAGS"
6211   fi
6212   ;;
6213 AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
6214 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
6215   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
6216   AC_CHECK_TOOL(AS, as, false)
6217   AC_CHECK_TOOL(OBJDUMP, objdump, false)
6218   ;;
6219   ])
6220 esac
6221
6222 need_locks="$enable_libtool_lock"
6223
6224 ])# _LT_AC_LOCK
6225
6226
6227 # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
6228 #               [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
6229 # ----------------------------------------------------------------
6230 # Check whether the given compiler option works
6231 AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
6232 [AC_REQUIRE([LT_AC_PROG_SED])
6233 AC_CACHE_CHECK([$1], [$2],
6234   [$2=no
6235   ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
6236    printf "$lt_simple_compile_test_code" > conftest.$ac_ext
6237    lt_compiler_flag="$3"
6238    # Insert the option either (1) after the last *FLAGS variable, or
6239    # (2) before a word containing "conftest.", or (3) at the end.
6240    # Note that $ac_compile itself does not contain backslashes and begins
6241    # with a dollar sign (not a hyphen), so the echo should work correctly.
6242    # The option is referenced via a variable to avoid confusing sed.
6243    lt_compile=`echo "$ac_compile" | $SED \
6244    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
6245    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
6246    -e 's:$: $lt_compiler_flag:'`
6247    (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
6248    (eval "$lt_compile" 2>conftest.err)
6249    ac_status=$?
6250    cat conftest.err >&AS_MESSAGE_LOG_FD
6251    echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
6252    if (exit $ac_status) && test -s "$ac_outfile"; then
6253      # The compiler can only warn and ignore the option if not recognized
6254      # So say no if there are warnings
6255      if test ! -s conftest.err; then
6256        $2=yes
6257      fi
6258    fi
6259    $rm conftest*
6260 ])
6261
6262 if test x"[$]$2" = xyes; then
6263     ifelse([$5], , :, [$5])
6264 else
6265     ifelse([$6], , :, [$6])
6266 fi
6267 ])# AC_LIBTOOL_COMPILER_OPTION
6268
6269
6270 # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
6271 #                          [ACTION-SUCCESS], [ACTION-FAILURE])
6272 # ------------------------------------------------------------
6273 # Check whether the given compiler option works
6274 AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
6275 [AC_CACHE_CHECK([$1], [$2],
6276   [$2=no
6277    save_LDFLAGS="$LDFLAGS"
6278    LDFLAGS="$LDFLAGS $3"
6279    printf "$lt_simple_link_test_code" > conftest.$ac_ext
6280    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
6281      # The compiler can only warn and ignore the option if not recognized
6282      # So say no if there are warnings
6283      if test -s conftest.err; then
6284        # Append any errors to the config.log.
6285        cat conftest.err 1>&AS_MESSAGE_LOG_FD
6286      else
6287        $2=yes
6288      fi
6289    fi
6290    $rm conftest*
6291    LDFLAGS="$save_LDFLAGS"
6292 ])
6293
6294 if test x"[$]$2" = xyes; then
6295     ifelse([$4], , :, [$4])
6296 else
6297     ifelse([$5], , :, [$5])
6298 fi
6299 ])# AC_LIBTOOL_LINKER_OPTION
6300
6301
6302 # AC_LIBTOOL_SYS_MAX_CMD_LEN
6303 # --------------------------
6304 AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
6305 [# find the maximum length of command line arguments
6306 AC_MSG_CHECKING([the maximum length of command line arguments])
6307 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
6308   i=0
6309   testring="ABCD"
6310
6311   case $build_os in
6312   msdosdjgpp*)
6313     # On DJGPP, this test can blow up pretty badly due to problems in libc
6314     # (any single argument exceeding 2000 bytes causes a buffer overrun
6315     # during glob expansion).  Even if it were fixed, the result of this
6316     # check would be larger than it should be.
6317     lt_cv_sys_max_cmd_len=12288;    # 12K is about right
6318     ;;
6319
6320   gnu*)
6321     # Under GNU Hurd, this test is not required because there is
6322     # no limit to the length of command line arguments.
6323     # Libtool will interpret -1 as no limit whatsoever
6324     lt_cv_sys_max_cmd_len=-1;
6325     ;;
6326
6327   cygwin* | mingw*)
6328     # On Win9x/ME, this test blows up -- it succeeds, but takes
6329     # about 5 minutes as the teststring grows exponentially.
6330     # Worse, since 9x/ME are not pre-emptively multitasking,
6331     # you end up with a "frozen" computer, even though with patience
6332     # the test eventually succeeds (with a max line length of 256k).
6333     # Instead, let's just punt: use the minimum linelength reported by
6334     # all of the supported platforms: 8192 (on NT/2K/XP).
6335     lt_cv_sys_max_cmd_len=8192;
6336     ;;
6337
6338  *)
6339     # If test is not a shell built-in, we'll probably end up computing a
6340     # maximum length that is only half of the actual maximum length, but
6341     # we can't tell.
6342     while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
6343                = "XX$testring") >/dev/null 2>&1 &&
6344             new_result=`expr "X$testring" : ".*" 2>&1` &&
6345             lt_cv_sys_max_cmd_len=$new_result &&
6346             test $i != 17 # 1/2 MB should be enough
6347     do
6348       i=`expr $i + 1`
6349       testring=$testring$testring
6350     done
6351     testring=
6352     # Add a significant safety factor because C++ compilers can tack on massive
6353     # amounts of additional arguments before passing them to the linker.
6354     # It appears as though 1/2 is a usable value.
6355     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
6356     ;;
6357   esac
6358 ])
6359 if test -n $lt_cv_sys_max_cmd_len ; then
6360   AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
6361 else
6362   AC_MSG_RESULT(none)
6363 fi
6364 ])# AC_LIBTOOL_SYS_MAX_CMD_LEN
6365
6366
6367 # _LT_AC_CHECK_DLFCN
6368 # --------------------
6369 AC_DEFUN([_LT_AC_CHECK_DLFCN],
6370 [AC_CHECK_HEADERS(dlfcn.h)dnl
6371 ])# _LT_AC_CHECK_DLFCN
6372
6373
6374 # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
6375 #                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
6376 # ------------------------------------------------------------------
6377 AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
6378 [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
6379 if test "$cross_compiling" = yes; then :
6380   [$4]
6381 else
6382   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
6383   lt_status=$lt_dlunknown
6384   cat > conftest.$ac_ext <<EOF
6385 [#line __oline__ "configure"
6386 #include "confdefs.h"
6387
6388 #if HAVE_DLFCN_H
6389 #include <dlfcn.h>
6390 #endif
6391
6392 #include <stdio.h>
6393
6394 #ifdef RTLD_GLOBAL
6395 #  define LT_DLGLOBAL           RTLD_GLOBAL
6396 #else
6397 #  ifdef DL_GLOBAL
6398 #    define LT_DLGLOBAL         DL_GLOBAL
6399 #  else
6400 #    define LT_DLGLOBAL         0
6401 #  endif
6402 #endif
6403
6404 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
6405    find out it does not work in some platform. */
6406 #ifndef LT_DLLAZY_OR_NOW
6407 #  ifdef RTLD_LAZY
6408 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
6409 #  else
6410 #    ifdef DL_LAZY
6411 #      define LT_DLLAZY_OR_NOW          DL_LAZY
6412 #    else
6413 #      ifdef RTLD_NOW
6414 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
6415 #      else
6416 #        ifdef DL_NOW
6417 #          define LT_DLLAZY_OR_NOW      DL_NOW
6418 #        else
6419 #          define LT_DLLAZY_OR_NOW      0
6420 #        endif
6421 #      endif
6422 #    endif
6423 #  endif
6424 #endif
6425
6426 #ifdef __cplusplus
6427 extern "C" void exit (int);
6428 #endif
6429
6430 void fnord() { int i=42;}
6431 int main ()
6432 {
6433   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
6434   int status = $lt_dlunknown;
6435
6436   if (self)
6437     {
6438       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
6439       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
6440       /* dlclose (self); */
6441     }
6442
6443     exit (status);
6444 }]
6445 EOF
6446   if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
6447     (./conftest; exit; ) 2>/dev/null
6448     lt_status=$?
6449     case x$lt_status in
6450       x$lt_dlno_uscore) $1 ;;
6451       x$lt_dlneed_uscore) $2 ;;
6452       x$lt_unknown|x*) $3 ;;
6453     esac
6454   else :
6455     # compilation failed
6456     $3
6457   fi
6458 fi
6459 rm -fr conftest*
6460 ])# _LT_AC_TRY_DLOPEN_SELF
6461
6462
6463 # AC_LIBTOOL_DLOPEN_SELF
6464 # -------------------
6465 AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
6466 [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
6467 if test "x$enable_dlopen" != xyes; then
6468   enable_dlopen=unknown
6469   enable_dlopen_self=unknown
6470   enable_dlopen_self_static=unknown
6471 else
6472   lt_cv_dlopen=no
6473   lt_cv_dlopen_libs=
6474
6475   case $host_os in
6476   beos*)
6477     lt_cv_dlopen="load_add_on"
6478     lt_cv_dlopen_libs=
6479     lt_cv_dlopen_self=yes
6480     ;;
6481
6482   mingw* | pw32*)
6483     lt_cv_dlopen="LoadLibrary"
6484     lt_cv_dlopen_libs=
6485    ;;
6486
6487   cygwin*)
6488     lt_cv_dlopen="dlopen"
6489     lt_cv_dlopen_libs=
6490    ;;
6491
6492   darwin*)
6493   # if libdl is installed we need to link against it
6494     AC_CHECK_LIB([dl], [dlopen],
6495                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
6496     lt_cv_dlopen="dyld"
6497     lt_cv_dlopen_libs=
6498     lt_cv_dlopen_self=yes
6499     ])
6500    ;;
6501     
6502   *)
6503     AC_CHECK_FUNC([shl_load],
6504           [lt_cv_dlopen="shl_load"],
6505       [AC_CHECK_LIB([dld], [shl_load],
6506             [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
6507         [AC_CHECK_FUNC([dlopen],
6508               [lt_cv_dlopen="dlopen"],
6509           [AC_CHECK_LIB([dl], [dlopen],
6510                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
6511             [AC_CHECK_LIB([svld], [dlopen],
6512                   [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
6513               [AC_CHECK_LIB([dld], [dld_link],
6514                     [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
6515               ])
6516             ])
6517           ])
6518         ])
6519       ])
6520     ;;
6521   esac
6522
6523   if test "x$lt_cv_dlopen" != xno; then
6524     enable_dlopen=yes
6525   else
6526     enable_dlopen=no
6527   fi
6528
6529   case $lt_cv_dlopen in
6530   dlopen)
6531     save_CPPFLAGS="$CPPFLAGS"
6532     test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
6533
6534     save_LDFLAGS="$LDFLAGS"
6535     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
6536
6537     save_LIBS="$LIBS"
6538     LIBS="$lt_cv_dlopen_libs $LIBS"
6539
6540     AC_CACHE_CHECK([whether a program can dlopen itself],
6541           lt_cv_dlopen_self, [dnl
6542           _LT_AC_TRY_DLOPEN_SELF(
6543             lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
6544             lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
6545     ])
6546
6547     if test "x$lt_cv_dlopen_self" = xyes; then
6548       LDFLAGS="$LDFLAGS $link_static_flag"
6549       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
6550           lt_cv_dlopen_self_static, [dnl
6551           _LT_AC_TRY_DLOPEN_SELF(
6552             lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
6553             lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
6554       ])
6555     fi
6556
6557     CPPFLAGS="$save_CPPFLAGS"
6558     LDFLAGS="$save_LDFLAGS"
6559     LIBS="$save_LIBS"
6560     ;;
6561   esac
6562
6563   case $lt_cv_dlopen_self in
6564   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
6565   *) enable_dlopen_self=unknown ;;
6566   esac
6567
6568   case $lt_cv_dlopen_self_static in
6569   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
6570   *) enable_dlopen_self_static=unknown ;;
6571   esac
6572 fi
6573 ])# AC_LIBTOOL_DLOPEN_SELF
6574
6575
6576 # AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
6577 # ---------------------------------
6578 # Check to see if options -c and -o are simultaneously supported by compiler
6579 AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
6580 [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
6581 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
6582   [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
6583   [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
6584    $rm -r conftest 2>/dev/null
6585    mkdir conftest
6586    cd conftest
6587    mkdir out
6588    printf "$lt_simple_compile_test_code" > conftest.$ac_ext
6589
6590    # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
6591    # that will create temporary files in the current directory regardless of
6592    # the output directory.  Thus, making CWD read-only will cause this test
6593    # to fail, enabling locking or at least warning the user not to do parallel
6594    # builds.
6595    chmod -w .
6596
6597    lt_compiler_flag="-o out/conftest2.$ac_objext"
6598    # Insert the option either (1) after the last *FLAGS variable, or
6599    # (2) before a word containing "conftest.", or (3) at the end.
6600    # Note that $ac_compile itself does not contain backslashes and begins
6601    # with a dollar sign (not a hyphen), so the echo should work correctly.
6602    lt_compile=`echo "$ac_compile" | $SED \
6603    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
6604    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
6605    -e 's:$: $lt_compiler_flag:'`
6606    (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
6607    (eval "$lt_compile" 2>out/conftest.err)
6608    ac_status=$?
6609    cat out/conftest.err >&AS_MESSAGE_LOG_FD
6610    echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
6611    if (exit $ac_status) && test -s out/conftest2.$ac_objext
6612    then
6613      # The compiler can only warn and ignore the option if not recognized
6614      # So say no if there are warnings
6615      if test ! -s out/conftest.err; then
6616        _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
6617      fi
6618    fi
6619    chmod u+w .
6620    $rm conftest* out/*
6621    rmdir out
6622    cd ..
6623    rmdir conftest
6624    $rm conftest*
6625 ])
6626 ])# AC_LIBTOOL_PROG_CC_C_O
6627
6628
6629 # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
6630 # -----------------------------------------
6631 # Check to see if we can do hard links to lock some files if needed
6632 AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
6633 [AC_REQUIRE([_LT_AC_LOCK])dnl
6634
6635 hard_links="nottested"
6636 if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
6637   # do not overwrite the value of need_locks provided by the user
6638   AC_MSG_CHECKING([if we can lock with hard links])
6639   hard_links=yes
6640   $rm conftest*
6641   ln conftest.a conftest.b 2>/dev/null && hard_links=no
6642   touch conftest.a
6643   ln conftest.a conftest.b 2>&5 || hard_links=no
6644   ln conftest.a conftest.b 2>/dev/null && hard_links=no
6645   AC_MSG_RESULT([$hard_links])
6646   if test "$hard_links" = no; then
6647     AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
6648     need_locks=warn
6649   fi
6650 else
6651   need_locks=no
6652 fi
6653 ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
6654
6655
6656 # AC_LIBTOOL_OBJDIR
6657 # -----------------
6658 AC_DEFUN([AC_LIBTOOL_OBJDIR],
6659 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
6660 [rm -f .libs 2>/dev/null
6661 mkdir .libs 2>/dev/null
6662 if test -d .libs; then
6663   lt_cv_objdir=.libs
6664 else
6665   # MS-DOS does not allow filenames that begin with a dot.
6666   lt_cv_objdir=_libs
6667 fi
6668 rmdir .libs 2>/dev/null])
6669 objdir=$lt_cv_objdir
6670 ])# AC_LIBTOOL_OBJDIR
6671
6672
6673 # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
6674 # ----------------------------------------------
6675 # Check hardcoding attributes.
6676 AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
6677 [AC_MSG_CHECKING([how to hardcode library paths into programs])
6678 _LT_AC_TAGVAR(hardcode_action, $1)=
6679 if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
6680    test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
6681    test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
6682
6683   # We can hardcode non-existant directories.
6684   if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
6685      # If the only mechanism to avoid hardcoding is shlibpath_var, we
6686      # have to relink, otherwise we might link with an installed library
6687      # when we should be linking with a yet-to-be-installed one
6688      ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
6689      test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
6690     # Linking always hardcodes the temporary library directory.
6691     _LT_AC_TAGVAR(hardcode_action, $1)=relink
6692   else
6693     # We can link without hardcoding, and we can hardcode nonexisting dirs.
6694     _LT_AC_TAGVAR(hardcode_action, $1)=immediate
6695   fi
6696 else
6697   # We cannot hardcode anything, or else we can only hardcode existing
6698   # directories.
6699   _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
6700 fi
6701 AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
6702
6703 if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
6704   # Fast installation is not supported
6705   enable_fast_install=no
6706 elif test "$shlibpath_overrides_runpath" = yes ||
6707      test "$enable_shared" = no; then
6708   # Fast installation is not necessary
6709   enable_fast_install=needless
6710 fi
6711 ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
6712
6713
6714 # AC_LIBTOOL_SYS_LIB_STRIP
6715 # ------------------------
6716 AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
6717 [striplib=
6718 old_striplib=
6719 AC_MSG_CHECKING([whether stripping libraries is possible])
6720 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
6721   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
6722   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
6723   AC_MSG_RESULT([yes])
6724 else
6725 # FIXME - insert some real tests, host_os isn't really good enough
6726   case $host_os in
6727    darwin*)
6728        if test -n "$STRIP" ; then
6729          striplib="$STRIP -x"
6730          AC_MSG_RESULT([yes])
6731        else
6732   AC_MSG_RESULT([no])
6733 fi
6734        ;;
6735    *)
6736   AC_MSG_RESULT([no])
6737     ;;
6738   esac  
6739 fi
6740 ])# AC_LIBTOOL_SYS_LIB_STRIP
6741
6742
6743 # AC_LIBTOOL_SYS_DYNAMIC_LINKER
6744 # -----------------------------
6745 # PORTME Fill in your ld.so characteristics
6746 AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
6747 [AC_MSG_CHECKING([dynamic linker characteristics])
6748 library_names_spec=
6749 libname_spec='lib$name'
6750 soname_spec=
6751 shrext=".so"
6752 postinstall_cmds=
6753 postuninstall_cmds=
6754 finish_cmds=
6755 finish_eval=
6756 shlibpath_var=
6757 shlibpath_overrides_runpath=unknown
6758 version_type=none
6759 dynamic_linker="$host_os ld.so"
6760 sys_lib_dlsearch_path_spec="/lib /usr/lib"
6761 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
6762 need_lib_prefix=unknown
6763 hardcode_into_libs=no
6764
6765 # when you set need_version to no, make sure it does not cause -set_version
6766 # flags to be left without arguments
6767 need_version=unknown
6768
6769 case $host_os in
6770 aix3*)
6771   version_type=linux
6772   library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
6773   shlibpath_var=LIBPATH
6774
6775   # AIX 3 has no versioning support, so we append a major version to the name.
6776   soname_spec='${libname}${release}${shared_ext}$major'
6777   ;;
6778
6779 aix4* | aix5*)
6780   version_type=linux
6781   need_lib_prefix=no
6782   need_version=no
6783   hardcode_into_libs=yes
6784   if test "$host_cpu" = ia64; then
6785     # AIX 5 supports IA64
6786     library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
6787     shlibpath_var=LD_LIBRARY_PATH
6788   else
6789     # With GCC up to 2.95.x, collect2 would create an import file
6790     # for dependence libraries.  The import file would start with
6791     # the line `#! .'.  This would cause the generated library to
6792     # depend on `.', always an invalid library.  This was fixed in
6793     # development snapshots of GCC prior to 3.0.
6794     case $host_os in
6795       aix4 | aix4.[[01]] | aix4.[[01]].*)
6796       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
6797            echo ' yes '
6798            echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
6799         :
6800       else
6801         can_build_shared=no
6802       fi
6803       ;;
6804     esac
6805     # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
6806     # soname into executable. Probably we can add versioning support to
6807     # collect2, so additional links can be useful in future.
6808     if test "$aix_use_runtimelinking" = yes; then
6809       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
6810       # instead of lib<name>.a to let people know that these are not
6811       # typical AIX shared libraries.
6812       library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
6813     else
6814       # We preserve .a as extension for shared libraries through AIX4.2
6815       # and later when we are not doing run time linking.
6816       library_names_spec='${libname}${release}.a $libname.a'
6817       soname_spec='${libname}${release}${shared_ext}$major'
6818     fi
6819     shlibpath_var=LIBPATH
6820   fi
6821   ;;
6822
6823 amigaos*)
6824   library_names_spec='$libname.ixlibrary $libname.a'
6825   # Create ${libname}_ixlibrary.a entries in /sys/libs.
6826   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'
6827   ;;
6828
6829 beos*)
6830   library_names_spec='${libname}${shared_ext}'
6831   dynamic_linker="$host_os ld.so"
6832   shlibpath_var=LIBRARY_PATH
6833   ;;
6834
6835 bsdi4*)
6836   version_type=linux
6837   need_version=no
6838   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
6839   soname_spec='${libname}${release}${shared_ext}$major'
6840   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
6841   shlibpath_var=LD_LIBRARY_PATH
6842   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
6843   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
6844   # the default ld.so.conf also contains /usr/contrib/lib and
6845   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
6846   # libtool to hard-code these into programs
6847   ;;
6848
6849 cygwin* | mingw* | pw32*)
6850   version_type=windows
6851   shrext=".dll"
6852   need_version=no
6853   need_lib_prefix=no
6854
6855   case $GCC,$host_os in
6856   yes,cygwin* | yes,mingw* | yes,pw32*)
6857     library_names_spec='$libname.dll.a'
6858     # DLL is installed to $(libdir)/../bin by postinstall_cmds
6859     postinstall_cmds='base_file=`basename \${file}`~
6860       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
6861       dldir=$destdir/`dirname \$dlpath`~
6862       test -d \$dldir || mkdir -p \$dldir~
6863       $install_prog $dir/$dlname \$dldir/$dlname'
6864     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
6865       dlpath=$dir/\$dldll~
6866        $rm \$dlpath'
6867     shlibpath_overrides_runpath=yes
6868
6869     case $host_os in
6870     cygwin*)
6871       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
6872       soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
6873       sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
6874       ;;
6875     mingw*)
6876       # MinGW DLLs use traditional 'lib' prefix
6877       soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
6878       sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
6879       if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
6880         # It is most probably a Windows format PATH printed by
6881         # mingw gcc, but we are running on Cygwin. Gcc prints its search
6882         # path with ; separators, and with drive letters. We can handle the
6883         # drive letters (cygwin fileutils understands them), so leave them,
6884         # especially as we might pass files found there to a mingw objdump,
6885         # which wouldn't understand a cygwinified path. Ahh.
6886         sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
6887       else
6888         sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
6889       fi
6890       ;;
6891     pw32*)
6892       # pw32 DLLs use 'pw' prefix rather than 'lib'
6893       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
6894       ;;
6895     esac
6896     ;;
6897
6898   *)
6899     library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
6900     ;;
6901   esac
6902   dynamic_linker='Win32 ld.exe'
6903   # FIXME: first we should search . and the directory the executable is in
6904   shlibpath_var=PATH
6905   ;;
6906
6907 darwin* | rhapsody*)
6908   dynamic_linker="$host_os dyld"
6909   version_type=darwin
6910   need_lib_prefix=no
6911   need_version=no
6912   library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
6913   soname_spec='${libname}${release}${major}$shared_ext'
6914   shlibpath_overrides_runpath=yes
6915   shlibpath_var=DYLD_LIBRARY_PATH
6916   shrext='$(test .$module = .yes && echo .so || echo .dylib)'
6917   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
6918   if test "$GCC" = yes; then
6919     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
6920   else
6921     sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
6922   fi
6923   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
6924   ;;
6925
6926 dgux*)
6927   version_type=linux
6928   need_lib_prefix=no
6929   need_version=no
6930   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
6931   soname_spec='${libname}${release}${shared_ext}$major'
6932   shlibpath_var=LD_LIBRARY_PATH
6933   ;;
6934
6935 freebsd1*)
6936   dynamic_linker=no
6937   ;;
6938
6939 freebsd*-gnu*)
6940   version_type=linux
6941   need_lib_prefix=no
6942   need_version=no
6943   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
6944   soname_spec='${libname}${release}${shared_ext}$major'
6945   shlibpath_var=LD_LIBRARY_PATH
6946   shlibpath_overrides_runpath=no
6947   hardcode_into_libs=yes
6948   dynamic_linker='GNU ld.so'
6949   ;;
6950
6951 freebsd*)
6952   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
6953   version_type=freebsd-$objformat
6954   case $version_type in
6955     freebsd-elf*)
6956       library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
6957       need_version=no
6958       need_lib_prefix=no
6959       ;;
6960     freebsd-*)
6961       library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
6962       need_version=yes
6963       ;;
6964   esac
6965   shlibpath_var=LD_LIBRARY_PATH
6966   case $host_os in
6967   freebsd2*)
6968     shlibpath_overrides_runpath=yes
6969     ;;
6970   freebsd3.[01]* | freebsdelf3.[01]*)
6971     shlibpath_overrides_runpath=yes
6972     hardcode_into_libs=yes
6973     ;;
6974   *) # from 3.2 on
6975     shlibpath_overrides_runpath=no
6976     hardcode_into_libs=yes
6977     ;;
6978   esac
6979   ;;
6980
6981 gnu*)
6982   version_type=linux
6983   need_lib_prefix=no
6984   need_version=no
6985   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
6986   soname_spec='${libname}${release}${shared_ext}$major'
6987   shlibpath_var=LD_LIBRARY_PATH
6988   hardcode_into_libs=yes
6989   ;;
6990
6991 hpux9* | hpux10* | hpux11*)
6992   # Give a soname corresponding to the major version so that dld.sl refuses to
6993   # link against other versions.
6994   version_type=sunos
6995   need_lib_prefix=no
6996   need_version=no
6997   case "$host_cpu" in
6998   ia64*)
6999     shrext='.so'
7000     hardcode_into_libs=yes
7001     dynamic_linker="$host_os dld.so"
7002     shlibpath_var=LD_LIBRARY_PATH
7003     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
7004     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7005     soname_spec='${libname}${release}${shared_ext}$major'
7006     if test "X$HPUX_IA64_MODE" = X32; then
7007       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
7008     else
7009       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
7010     fi
7011     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
7012     ;;
7013    hppa*64*)
7014      shrext='.sl'
7015      hardcode_into_libs=yes
7016      dynamic_linker="$host_os dld.sl"
7017      shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
7018      shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
7019      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7020      soname_spec='${libname}${release}${shared_ext}$major'
7021      sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
7022      sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
7023      ;;
7024    *)
7025     shrext='.sl'
7026     dynamic_linker="$host_os dld.sl"
7027     shlibpath_var=SHLIB_PATH
7028     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
7029     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7030     soname_spec='${libname}${release}${shared_ext}$major'
7031     ;;
7032   esac
7033   # HP-UX runs *really* slowly unless shared libraries are mode 555.
7034   postinstall_cmds='chmod 555 $lib'
7035   ;;
7036
7037 irix5* | irix6* | nonstopux*)
7038   case $host_os in
7039     nonstopux*) version_type=nonstopux ;;
7040     *)
7041         if test "$lt_cv_prog_gnu_ld" = yes; then
7042                 version_type=linux
7043         else
7044                 version_type=irix
7045         fi ;;
7046   esac
7047   need_lib_prefix=no
7048   need_version=no
7049   soname_spec='${libname}${release}${shared_ext}$major'
7050   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
7051   case $host_os in
7052   irix5* | nonstopux*)
7053     libsuff= shlibsuff=
7054     ;;
7055   *)
7056     case $LD in # libtool.m4 will add one of these switches to LD
7057     *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
7058       libsuff= shlibsuff= libmagic=32-bit;;
7059     *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
7060       libsuff=32 shlibsuff=N32 libmagic=N32;;
7061     *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
7062       libsuff=64 shlibsuff=64 libmagic=64-bit;;
7063     *) libsuff= shlibsuff= libmagic=never-match;;
7064     esac
7065     ;;
7066   esac
7067   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
7068   shlibpath_overrides_runpath=no
7069   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
7070   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
7071   hardcode_into_libs=yes
7072   ;;
7073
7074 # No shared lib support for Linux oldld, aout, or coff.
7075 linux*oldld* | linux*aout* | linux*coff*)
7076   dynamic_linker=no
7077   ;;
7078
7079 # This must be Linux ELF.
7080 linux*)
7081   version_type=linux
7082   need_lib_prefix=no
7083   need_version=no
7084   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7085   soname_spec='${libname}${release}${shared_ext}$major'
7086   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
7087   libsuff=
7088   if test "x$LINUX_64_MODE" = x64; then
7089     # Some platforms are per default 64-bit, so there's no /lib64
7090     if test -d /lib64; then
7091       libsuff=64
7092     fi
7093   fi
7094   shlibpath_var=LD_LIBRARY_PATH
7095   shlibpath_overrides_runpath=no
7096   sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
7097   sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
7098   # This implies no fast_install, which is unacceptable.
7099   # Some rework will be needed to allow for fast_install
7100   # before this can be enabled.
7101   hardcode_into_libs=yes
7102
7103   # We used to test for /lib/ld.so.1 and disable shared libraries on
7104   # powerpc, because MkLinux only supported shared libraries with the
7105   # GNU dynamic linker.  Since this was broken with cross compilers,
7106   # most powerpc-linux boxes support dynamic linking these days and
7107   # people can always --disable-shared, the test was removed, and we
7108   # assume the GNU/Linux dynamic linker is in use.
7109   dynamic_linker='GNU/Linux ld.so'
7110   ;;
7111
7112 netbsd*)
7113   version_type=sunos
7114   need_lib_prefix=no
7115   need_version=no
7116   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
7117     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
7118     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
7119     dynamic_linker='NetBSD (a.out) ld.so'
7120   else
7121     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
7122     soname_spec='${libname}${release}${shared_ext}$major'
7123     dynamic_linker='NetBSD ld.elf_so'
7124   fi
7125   shlibpath_var=LD_LIBRARY_PATH
7126   shlibpath_overrides_runpath=yes
7127   hardcode_into_libs=yes
7128   ;;
7129
7130 newsos6)
7131   version_type=linux
7132   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7133   shlibpath_var=LD_LIBRARY_PATH
7134   shlibpath_overrides_runpath=yes
7135   ;;
7136
7137 nto-qnx*)
7138   version_type=linux
7139   need_lib_prefix=no
7140   need_version=no
7141   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7142   soname_spec='${libname}${release}${shared_ext}$major'
7143   shlibpath_var=LD_LIBRARY_PATH
7144   shlibpath_overrides_runpath=yes
7145   ;;
7146
7147 openbsd*)
7148   version_type=sunos
7149   need_lib_prefix=no
7150   need_version=no
7151   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
7152   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
7153   shlibpath_var=LD_LIBRARY_PATH
7154   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7155     case $host_os in
7156       openbsd2.[[89]] | openbsd2.[[89]].*)
7157         shlibpath_overrides_runpath=no
7158         ;;
7159       *)
7160         shlibpath_overrides_runpath=yes
7161         ;;
7162       esac
7163   else
7164     shlibpath_overrides_runpath=yes
7165   fi
7166   ;;
7167
7168 os2*)
7169   libname_spec='$name'
7170   shrext=".dll"
7171   need_lib_prefix=no
7172   library_names_spec='$libname${shared_ext} $libname.a'
7173   dynamic_linker='OS/2 ld.exe'
7174   shlibpath_var=LIBPATH
7175   ;;
7176
7177 osf3* | osf4* | osf5*)
7178   version_type=osf
7179   need_lib_prefix=no
7180   need_version=no
7181   soname_spec='${libname}${release}${shared_ext}$major'
7182   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7183   shlibpath_var=LD_LIBRARY_PATH
7184   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
7185   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
7186   ;;
7187
7188 sco3.2v5*)
7189   version_type=osf
7190   soname_spec='${libname}${release}${shared_ext}$major'
7191   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7192   shlibpath_var=LD_LIBRARY_PATH
7193   ;;
7194
7195 solaris*)
7196   version_type=linux
7197   need_lib_prefix=no
7198   need_version=no
7199   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7200   soname_spec='${libname}${release}${shared_ext}$major'
7201   shlibpath_var=LD_LIBRARY_PATH
7202   shlibpath_overrides_runpath=yes
7203   hardcode_into_libs=yes
7204   # ldd complains unless libraries are executable
7205   postinstall_cmds='chmod +x $lib'
7206   ;;
7207
7208 sunos4*)
7209   version_type=sunos
7210   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
7211   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
7212   shlibpath_var=LD_LIBRARY_PATH
7213   shlibpath_overrides_runpath=yes
7214   if test "$with_gnu_ld" = yes; then
7215     need_lib_prefix=no
7216   fi
7217   need_version=yes
7218   ;;
7219
7220 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
7221   version_type=linux
7222   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7223   soname_spec='${libname}${release}${shared_ext}$major'
7224   shlibpath_var=LD_LIBRARY_PATH
7225   case $host_vendor in
7226     sni)
7227       shlibpath_overrides_runpath=no
7228       need_lib_prefix=no
7229       export_dynamic_flag_spec='${wl}-Blargedynsym'
7230       runpath_var=LD_RUN_PATH
7231       ;;
7232     siemens)
7233       need_lib_prefix=no
7234       ;;
7235     motorola)
7236       need_lib_prefix=no
7237       need_version=no
7238       shlibpath_overrides_runpath=no
7239       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
7240       ;;
7241   esac
7242   ;;
7243
7244 sysv4*MP*)
7245   if test -d /usr/nec ;then
7246     version_type=linux
7247     library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
7248     soname_spec='$libname${shared_ext}.$major'
7249     shlibpath_var=LD_LIBRARY_PATH
7250   fi
7251   ;;
7252
7253 uts4*)
7254   version_type=linux
7255   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7256   soname_spec='${libname}${release}${shared_ext}$major'
7257   shlibpath_var=LD_LIBRARY_PATH
7258   ;;
7259
7260 *)
7261   dynamic_linker=no
7262   ;;
7263 esac
7264 AC_MSG_RESULT([$dynamic_linker])
7265 test "$dynamic_linker" = no && can_build_shared=no
7266 ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
7267
7268
7269 # _LT_AC_TAGCONFIG
7270 # ----------------
7271 AC_DEFUN([_LT_AC_TAGCONFIG],
7272 [AC_ARG_WITH([tags],
7273     [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
7274         [include additional configurations @<:@automatic@:>@])],
7275     [tagnames="$withval"])
7276
7277 if test -f "$ltmain" && test -n "$tagnames"; then
7278   if test ! -f "${ofile}"; then
7279     AC_MSG_WARN([output file `$ofile' does not exist])
7280   fi
7281
7282   if test -z "$LTCC"; then
7283     eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
7284     if test -z "$LTCC"; then
7285       AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
7286     else
7287       AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
7288     fi
7289   fi
7290
7291   # Extract list of available tagged configurations in $ofile.
7292   # Note that this assumes the entire list is on one line.
7293   available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
7294
7295   lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7296   for tagname in $tagnames; do
7297     IFS="$lt_save_ifs"
7298     # Check whether tagname contains only valid characters
7299     case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
7300     "") ;;
7301     *)  AC_MSG_ERROR([invalid tag name: $tagname])
7302         ;;
7303     esac
7304
7305     if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
7306     then
7307       AC_MSG_ERROR([tag name \"$tagname\" already exists])
7308     fi
7309
7310     # Update the list of available tags.
7311     if test -n "$tagname"; then
7312       echo appending configuration tag \"$tagname\" to $ofile
7313
7314       case $tagname in
7315       CXX)
7316         if test -n "$CXX" && test "X$CXX" != "Xno"; then
7317           AC_LIBTOOL_LANG_CXX_CONFIG
7318         else
7319           tagname=""
7320         fi
7321         ;;
7322
7323       F77)
7324         if test -n "$F77" && test "X$F77" != "Xno"; then
7325           AC_LIBTOOL_LANG_F77_CONFIG
7326         else
7327           tagname=""
7328         fi
7329         ;;
7330
7331       GCJ)
7332         if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
7333           AC_LIBTOOL_LANG_GCJ_CONFIG
7334         else
7335           tagname=""
7336         fi
7337         ;;
7338
7339       RC)
7340         AC_LIBTOOL_LANG_RC_CONFIG
7341         ;;
7342
7343       *)
7344         AC_MSG_ERROR([Unsupported tag name: $tagname])
7345         ;;
7346       esac
7347
7348       # Append the new tag name to the list of available tags.
7349       if test -n "$tagname" ; then
7350       available_tags="$available_tags $tagname"
7351     fi
7352     fi
7353   done
7354   IFS="$lt_save_ifs"
7355
7356   # Now substitute the updated list of available tags.
7357   if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
7358     mv "${ofile}T" "$ofile"
7359     chmod +x "$ofile"
7360   else
7361     rm -f "${ofile}T"
7362     AC_MSG_ERROR([unable to update list of available tagged configurations.])
7363   fi
7364 fi
7365 ])# _LT_AC_TAGCONFIG
7366
7367
7368 # AC_LIBTOOL_DLOPEN
7369 # -----------------
7370 # enable checks for dlopen support
7371 AC_DEFUN([AC_LIBTOOL_DLOPEN],
7372  [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
7373 ])# AC_LIBTOOL_DLOPEN
7374
7375
7376 # AC_LIBTOOL_WIN32_DLL
7377 # --------------------
7378 # declare package support for building win32 dll's
7379 AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
7380 [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
7381 ])# AC_LIBTOOL_WIN32_DLL
7382
7383
7384 # AC_ENABLE_SHARED([DEFAULT])
7385 # ---------------------------
7386 # implement the --enable-shared flag
7387 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7388 AC_DEFUN([AC_ENABLE_SHARED],
7389 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
7390 AC_ARG_ENABLE([shared],
7391     [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
7392         [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
7393     [p=${PACKAGE-default}
7394     case $enableval in
7395     yes) enable_shared=yes ;;
7396     no) enable_shared=no ;;
7397     *)
7398       enable_shared=no
7399       # Look at the argument we got.  We use all the common list separators.
7400       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7401       for pkg in $enableval; do
7402         IFS="$lt_save_ifs"
7403         if test "X$pkg" = "X$p"; then
7404           enable_shared=yes
7405         fi
7406       done
7407       IFS="$lt_save_ifs"
7408       ;;
7409     esac],
7410     [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
7411 ])# AC_ENABLE_SHARED
7412
7413
7414 # AC_DISABLE_SHARED
7415 # -----------------
7416 #- set the default shared flag to --disable-shared
7417 AC_DEFUN([AC_DISABLE_SHARED],
7418 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7419 AC_ENABLE_SHARED(no)
7420 ])# AC_DISABLE_SHARED
7421
7422
7423 # AC_ENABLE_STATIC([DEFAULT])
7424 # ---------------------------
7425 # implement the --enable-static flag
7426 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7427 AC_DEFUN([AC_ENABLE_STATIC],
7428 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
7429 AC_ARG_ENABLE([static],
7430     [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
7431         [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
7432     [p=${PACKAGE-default}
7433     case $enableval in
7434     yes) enable_static=yes ;;
7435     no) enable_static=no ;;
7436     *)
7437      enable_static=no
7438       # Look at the argument we got.  We use all the common list separators.
7439       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7440       for pkg in $enableval; do
7441         IFS="$lt_save_ifs"
7442         if test "X$pkg" = "X$p"; then
7443           enable_static=yes
7444         fi
7445       done
7446       IFS="$lt_save_ifs"
7447       ;;
7448     esac],
7449     [enable_static=]AC_ENABLE_STATIC_DEFAULT)
7450 ])# AC_ENABLE_STATIC
7451
7452
7453 # AC_DISABLE_STATIC
7454 # -----------------
7455 # set the default static flag to --disable-static
7456 AC_DEFUN([AC_DISABLE_STATIC],
7457 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7458 AC_ENABLE_STATIC(no)
7459 ])# AC_DISABLE_STATIC
7460
7461
7462 # AC_ENABLE_FAST_INSTALL([DEFAULT])
7463 # ---------------------------------
7464 # implement the --enable-fast-install flag
7465 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7466 AC_DEFUN([AC_ENABLE_FAST_INSTALL],
7467 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
7468 AC_ARG_ENABLE([fast-install],
7469     [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
7470     [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
7471     [p=${PACKAGE-default}
7472     case $enableval in
7473     yes) enable_fast_install=yes ;;
7474     no) enable_fast_install=no ;;
7475     *)
7476       enable_fast_install=no
7477       # Look at the argument we got.  We use all the common list separators.
7478       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7479       for pkg in $enableval; do
7480         IFS="$lt_save_ifs"
7481         if test "X$pkg" = "X$p"; then
7482           enable_fast_install=yes
7483         fi
7484       done
7485       IFS="$lt_save_ifs"
7486       ;;
7487     esac],
7488     [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
7489 ])# AC_ENABLE_FAST_INSTALL
7490
7491
7492 # AC_DISABLE_FAST_INSTALL
7493 # -----------------------
7494 # set the default to --disable-fast-install
7495 AC_DEFUN([AC_DISABLE_FAST_INSTALL],
7496 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7497 AC_ENABLE_FAST_INSTALL(no)
7498 ])# AC_DISABLE_FAST_INSTALL
7499
7500
7501 # AC_LIBTOOL_PICMODE([MODE])
7502 # --------------------------
7503 # implement the --with-pic flag
7504 # MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
7505 AC_DEFUN([AC_LIBTOOL_PICMODE],
7506 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7507 pic_mode=ifelse($#,1,$1,default)
7508 ])# AC_LIBTOOL_PICMODE
7509
7510
7511 # AC_PROG_EGREP
7512 # -------------
7513 # This is predefined starting with Autoconf 2.54, so this conditional
7514 # definition can be removed once we require Autoconf 2.54 or later.
7515 m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
7516 [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
7517    [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
7518     then ac_cv_prog_egrep='grep -E'
7519     else ac_cv_prog_egrep='egrep'
7520     fi])
7521  EGREP=$ac_cv_prog_egrep
7522  AC_SUBST([EGREP])
7523 ])])
7524
7525
7526 # AC_PATH_TOOL_PREFIX
7527 # -------------------
7528 # find a file program which can recognise shared library
7529 AC_DEFUN([AC_PATH_TOOL_PREFIX],
7530 [AC_REQUIRE([AC_PROG_EGREP])dnl
7531 AC_MSG_CHECKING([for $1])
7532 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
7533 [case $MAGIC_CMD in
7534 [[\\/*] |  ?:[\\/]*])
7535   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
7536   ;;
7537 *)
7538   lt_save_MAGIC_CMD="$MAGIC_CMD"
7539   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7540 dnl $ac_dummy forces splitting on constant user-supplied paths.
7541 dnl POSIX.2 word splitting is done only on the output of word expansions,
7542 dnl not every word.  This closes a longstanding sh security hole.
7543   ac_dummy="ifelse([$2], , $PATH, [$2])"
7544   for ac_dir in $ac_dummy; do
7545     IFS="$lt_save_ifs"
7546     test -z "$ac_dir" && ac_dir=.
7547     if test -f $ac_dir/$1; then
7548       lt_cv_path_MAGIC_CMD="$ac_dir/$1"
7549       if test -n "$file_magic_test_file"; then
7550         case $deplibs_check_method in
7551         "file_magic "*)
7552           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
7553           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7554           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
7555             $EGREP "$file_magic_regex" > /dev/null; then
7556             :
7557           else
7558             cat <<EOF 1>&2
7559
7560 *** Warning: the command libtool uses to detect shared libraries,
7561 *** $file_magic_cmd, produces output that libtool cannot recognize.
7562 *** The result is that libtool may fail to recognize shared libraries
7563 *** as such.  This will affect the creation of libtool libraries that
7564 *** depend on shared libraries, but programs linked with such libtool
7565 *** libraries will work regardless of this problem.  Nevertheless, you
7566 *** may want to report the problem to your system manager and/or to
7567 *** bug-libtool@gnu.org
7568
7569 EOF
7570           fi ;;
7571         esac
7572       fi
7573       break
7574     fi
7575   done
7576   IFS="$lt_save_ifs"
7577   MAGIC_CMD="$lt_save_MAGIC_CMD"
7578   ;;
7579 esac])
7580 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7581 if test -n "$MAGIC_CMD"; then
7582   AC_MSG_RESULT($MAGIC_CMD)
7583 else
7584   AC_MSG_RESULT(no)
7585 fi
7586 ])# AC_PATH_TOOL_PREFIX
7587
7588
7589 # AC_PATH_MAGIC
7590 # -------------
7591 # find a file program which can recognise a shared library
7592 AC_DEFUN([AC_PATH_MAGIC],
7593 [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
7594 if test -z "$lt_cv_path_MAGIC_CMD"; then
7595   if test -n "$ac_tool_prefix"; then
7596     AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
7597   else
7598     MAGIC_CMD=:
7599   fi
7600 fi
7601 ])# AC_PATH_MAGIC
7602
7603
7604 # AC_PROG_LD
7605 # ----------
7606 # find the pathname to the GNU or non-GNU linker
7607 AC_DEFUN([AC_PROG_LD],
7608 [AC_ARG_WITH([gnu-ld],
7609     [AC_HELP_STRING([--with-gnu-ld],
7610         [assume the C compiler uses GNU ld @<:@default=no@:>@])],
7611     [test "$withval" = no || with_gnu_ld=yes],
7612     [with_gnu_ld=no])
7613 AC_REQUIRE([LT_AC_PROG_SED])dnl
7614 AC_REQUIRE([AC_PROG_CC])dnl
7615 AC_REQUIRE([AC_CANONICAL_HOST])dnl
7616 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
7617 ac_prog=ld
7618 if test "$GCC" = yes; then
7619   # Check if gcc -print-prog-name=ld gives a path.
7620   AC_MSG_CHECKING([for ld used by $CC])
7621   case $host in
7622   *-*-mingw*)
7623     # gcc leaves a trailing carriage return which upsets mingw
7624     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
7625   *)
7626     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
7627   esac
7628   case $ac_prog in
7629     # Accept absolute paths.
7630     [[\\/]]* | ?:[[\\/]]*)
7631       re_direlt='/[[^/]][[^/]]*/\.\./'
7632       # Canonicalize the pathname of ld
7633       ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
7634       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
7635         ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
7636       done
7637       test -z "$LD" && LD="$ac_prog"
7638       ;;
7639   "")
7640     # If it fails, then pretend we aren't using GCC.
7641     ac_prog=ld
7642     ;;
7643   *)
7644     # If it is relative, then search for the first ld in PATH.
7645     with_gnu_ld=unknown
7646     ;;
7647   esac
7648 elif test "$with_gnu_ld" = yes; then
7649   AC_MSG_CHECKING([for GNU ld])
7650 else
7651   AC_MSG_CHECKING([for non-GNU ld])
7652 fi
7653 AC_CACHE_VAL(lt_cv_path_LD,
7654 [if test -z "$LD"; then
7655   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7656   for ac_dir in $PATH; do
7657     IFS="$lt_save_ifs"
7658     test -z "$ac_dir" && ac_dir=.
7659     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
7660       lt_cv_path_LD="$ac_dir/$ac_prog"
7661       # Check to see if the program is GNU ld.  I'd rather use --version,
7662       # but apparently some GNU ld's only accept -v.
7663       # Break only if it was the GNU/non-GNU ld that we prefer.
7664       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
7665       *GNU* | *'with BFD'*)
7666         test "$with_gnu_ld" != no && break
7667         ;;
7668       *)
7669         test "$with_gnu_ld" != yes && break
7670         ;;
7671       esac
7672     fi
7673   done
7674   IFS="$lt_save_ifs"
7675 else
7676   lt_cv_path_LD="$LD" # Let the user override the test with a path.
7677 fi])
7678 LD="$lt_cv_path_LD"
7679 if test -n "$LD"; then
7680   AC_MSG_RESULT($LD)
7681 else
7682   AC_MSG_RESULT(no)
7683 fi
7684 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
7685 AC_PROG_LD_GNU
7686 ])# AC_PROG_LD
7687
7688
7689 # AC_PROG_LD_GNU
7690 # --------------
7691 AC_DEFUN([AC_PROG_LD_GNU],
7692 [AC_REQUIRE([AC_PROG_EGREP])dnl
7693 AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
7694 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
7695 case `$LD -v 2>&1 </dev/null` in
7696 *GNU* | *'with BFD'*)
7697   lt_cv_prog_gnu_ld=yes
7698   ;;
7699 *)
7700   lt_cv_prog_gnu_ld=no
7701   ;;
7702 esac])
7703 with_gnu_ld=$lt_cv_prog_gnu_ld
7704 ])# AC_PROG_LD_GNU
7705
7706
7707 # AC_PROG_LD_RELOAD_FLAG
7708 # ----------------------
7709 # find reload flag for linker
7710 #   -- PORTME Some linkers may need a different reload flag.
7711 AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
7712 [AC_CACHE_CHECK([for $LD option to reload object files],
7713   lt_cv_ld_reload_flag,
7714   [lt_cv_ld_reload_flag='-r'])
7715 reload_flag=$lt_cv_ld_reload_flag
7716 case $reload_flag in
7717 "" | " "*) ;;
7718 *) reload_flag=" $reload_flag" ;;
7719 esac
7720 reload_cmds='$LD$reload_flag -o $output$reload_objs'
7721 ])# AC_PROG_LD_RELOAD_FLAG
7722
7723
7724 # AC_DEPLIBS_CHECK_METHOD
7725 # -----------------------
7726 # how to check for library dependencies
7727 #  -- PORTME fill in with the dynamic library characteristics
7728 AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
7729 [AC_CACHE_CHECK([how to recognise dependent libraries],
7730 lt_cv_deplibs_check_method,
7731 [lt_cv_file_magic_cmd='$MAGIC_CMD'
7732 lt_cv_file_magic_test_file=
7733 lt_cv_deplibs_check_method='unknown'
7734 # Need to set the preceding variable on all platforms that support
7735 # interlibrary dependencies.
7736 # 'none' -- dependencies not supported.
7737 # `unknown' -- same as none, but documents that we really don't know.
7738 # 'pass_all' -- all dependencies passed with no checks.
7739 # 'test_compile' -- check by making test program.
7740 # 'file_magic [[regex]]' -- check by looking for files in library path
7741 # which responds to the $file_magic_cmd with a given extended regex.
7742 # If you have `file' or equivalent on your system and you're not sure
7743 # whether `pass_all' will *always* work, you probably want this one.
7744
7745 case $host_os in
7746 aix4* | aix5*)
7747   lt_cv_deplibs_check_method=pass_all
7748   ;;
7749
7750 beos*)
7751   lt_cv_deplibs_check_method=pass_all
7752   ;;
7753
7754 bsdi4*)
7755   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
7756   lt_cv_file_magic_cmd='/usr/bin/file -L'
7757   lt_cv_file_magic_test_file=/shlib/libc.so
7758   ;;
7759
7760 cygwin*)
7761   lt_cv_deplibs_check_method=pass_all
7762   ;;
7763   
7764 mingw* | pw32*)
7765   # win32_libid is a shell function defined in ltmain.sh
7766   lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
7767   lt_cv_file_magic_cmd='win32_libid'
7768   ;;
7769
7770 darwin* | rhapsody*)
7771   # this will be overwritten by pass_all, but leave it in just in case
7772   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
7773   lt_cv_file_magic_cmd='/usr/bin/file -L'
7774   case "$host_os" in
7775   rhapsody* | darwin1.[[012]])
7776     lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
7777     ;;
7778   *) # Darwin 1.3 on
7779     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
7780     ;;
7781   esac
7782   lt_cv_deplibs_check_method=pass_all
7783   ;;
7784
7785 freebsd*)
7786   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
7787     case $host_cpu in
7788     i*86 )
7789       # Not sure whether the presence of OpenBSD here was a mistake.
7790       # Let's accept both of them until this is cleared up.
7791       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
7792       lt_cv_file_magic_cmd=/usr/bin/file
7793       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
7794       ;;
7795     esac
7796   else
7797     lt_cv_deplibs_check_method=pass_all
7798   fi
7799   ;;
7800
7801 gnu*)
7802   lt_cv_deplibs_check_method=pass_all
7803   ;;
7804
7805 hpux10.20* | hpux11*)
7806   lt_cv_file_magic_cmd=/usr/bin/file
7807   case "$host_cpu" in
7808   ia64*)
7809     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
7810     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
7811     ;;
7812   hppa*64*)
7813     [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
7814     lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
7815     ;;
7816   *)
7817     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
7818     lt_cv_file_magic_test_file=/usr/lib/libc.sl
7819     ;;
7820   esac
7821   ;;
7822
7823 irix5* | irix6* | nonstopux*)
7824   case $host_os in
7825   irix5* | nonstopux*)
7826     # this will be overridden with pass_all, but let us keep it just in case
7827     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
7828     ;;
7829   *)
7830     case $LD in
7831     *-32|*"-32 ") libmagic=32-bit;;
7832     *-n32|*"-n32 ") libmagic=N32;;
7833     *-64|*"-64 ") libmagic=64-bit;;
7834     *) libmagic=never-match;;
7835     esac
7836     # this will be overridden with pass_all, but let us keep it just in case
7837     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
7838     ;;
7839   esac
7840   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
7841   lt_cv_deplibs_check_method=pass_all
7842   ;;
7843
7844 # This must be Linux ELF.
7845 linux*)
7846   case $host_cpu in
7847   alpha* | hppa* | i*86 | ia64* | m68* | mips* | powerpc* | sparc* | s390* | sh* | x86_64* )
7848     lt_cv_deplibs_check_method=pass_all ;;
7849   # the debian people say, arm and glibc 2.3.1 works for them with pass_all
7850   arm* )
7851     lt_cv_deplibs_check_method=pass_all ;;
7852   *)
7853     # glibc up to 2.1.1 does not perform some relocations on ARM
7854     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
7855   esac
7856   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
7857   ;;
7858
7859 netbsd*)
7860   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
7861     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
7862   else
7863     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
7864   fi
7865   ;;
7866
7867 newos6*)
7868   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
7869   lt_cv_file_magic_cmd=/usr/bin/file
7870   lt_cv_file_magic_test_file=/usr/lib/libnls.so
7871   ;;
7872
7873 nto-qnx*)
7874   lt_cv_deplibs_check_method=unknown
7875   ;;
7876
7877 openbsd*)
7878   lt_cv_file_magic_cmd=/usr/bin/file
7879   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
7880   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7881     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
7882   else
7883     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
7884   fi
7885   ;;
7886
7887 osf3* | osf4* | osf5*)
7888   # this will be overridden with pass_all, but let us keep it just in case
7889   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
7890   lt_cv_file_magic_test_file=/shlib/libc.so
7891   lt_cv_deplibs_check_method=pass_all
7892   ;;
7893
7894 sco3.2v5*)
7895   lt_cv_deplibs_check_method=pass_all
7896   ;;
7897
7898 solaris*)
7899   lt_cv_deplibs_check_method=pass_all
7900   lt_cv_file_magic_test_file=/lib/libc.so
7901   ;;
7902
7903 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
7904   case $host_vendor in
7905   motorola)
7906     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]]'
7907     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
7908     ;;
7909   ncr)
7910     lt_cv_deplibs_check_method=pass_all
7911     ;;
7912   sequent)
7913     lt_cv_file_magic_cmd='/bin/file'
7914     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
7915     ;;
7916   sni)
7917     lt_cv_file_magic_cmd='/bin/file'
7918     lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
7919     lt_cv_file_magic_test_file=/lib/libc.so
7920     ;;
7921   siemens)
7922     lt_cv_deplibs_check_method=pass_all
7923     ;;
7924   esac
7925   ;;
7926
7927 sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
7928   lt_cv_deplibs_check_method=pass_all
7929   ;;
7930 esac
7931 ])
7932 file_magic_cmd=$lt_cv_file_magic_cmd
7933 deplibs_check_method=$lt_cv_deplibs_check_method
7934 test -z "$deplibs_check_method" && deplibs_check_method=unknown
7935 ])# AC_DEPLIBS_CHECK_METHOD
7936
7937
7938 # AC_PROG_NM
7939 # ----------
7940 # find the pathname to a BSD-compatible name lister
7941 AC_DEFUN([AC_PROG_NM],
7942 [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
7943 [if test -n "$NM"; then
7944   # Let the user override the test.
7945   lt_cv_path_NM="$NM"
7946 else
7947   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7948   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
7949     IFS="$lt_save_ifs"
7950     test -z "$ac_dir" && ac_dir=.
7951     tmp_nm="$ac_dir/${ac_tool_prefix}nm"
7952     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
7953       # Check to see if the nm accepts a BSD-compat flag.
7954       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
7955       #   nm: unknown option "B" ignored
7956       # Tru64's nm complains that /dev/null is an invalid object file
7957       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
7958       */dev/null* | *'Invalid file or object type'*)
7959         lt_cv_path_NM="$tmp_nm -B"
7960         break
7961         ;;
7962       *)
7963         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
7964         */dev/null*)
7965           lt_cv_path_NM="$tmp_nm -p"
7966           break
7967           ;;
7968         *)
7969           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
7970           continue # so that we can try to find one that supports BSD flags
7971           ;;
7972         esac
7973       esac
7974     fi
7975   done
7976   IFS="$lt_save_ifs"
7977   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
7978 fi])
7979 NM="$lt_cv_path_NM"
7980 ])# AC_PROG_NM
7981
7982
7983 # AC_CHECK_LIBM
7984 # -------------
7985 # check for math library
7986 AC_DEFUN([AC_CHECK_LIBM],
7987 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
7988 LIBM=
7989 case $host in
7990 *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
7991   # These system don't have libm, or don't need it
7992   ;;
7993 *-ncr-sysv4.3*)
7994   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
7995   AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
7996   ;;
7997 *)
7998   AC_CHECK_LIB(m, cos, LIBM="-lm")
7999   ;;
8000 esac
8001 ])# AC_CHECK_LIBM
8002
8003
8004 # AC_LIBLTDL_CONVENIENCE([DIRECTORY])
8005 # -----------------------------------
8006 # sets LIBLTDL to the link flags for the libltdl convenience library and
8007 # LTDLINCL to the include flags for the libltdl header and adds
8008 # --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
8009 # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
8010 # DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
8011 # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
8012 # '${top_srcdir}/' (note the single quotes!).  If your package is not
8013 # flat and you're not using automake, define top_builddir and
8014 # top_srcdir appropriately in the Makefiles.
8015 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
8016 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
8017   case $enable_ltdl_convenience in
8018   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
8019   "") enable_ltdl_convenience=yes
8020       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
8021   esac
8022   LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
8023   LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
8024   # For backwards non-gettext consistent compatibility...
8025   INCLTDL="$LTDLINCL"
8026 ])# AC_LIBLTDL_CONVENIENCE
8027
8028
8029 # AC_LIBLTDL_INSTALLABLE([DIRECTORY])
8030 # -----------------------------------
8031 # sets LIBLTDL to the link flags for the libltdl installable library and
8032 # LTDLINCL to the include flags for the libltdl header and adds
8033 # --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
8034 # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
8035 # DIRECTORY is not provided and an installed libltdl is not found, it is
8036 # assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
8037 # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
8038 # quotes!).  If your package is not flat and you're not using automake,
8039 # define top_builddir and top_srcdir appropriately in the Makefiles.
8040 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
8041 AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
8042 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
8043   AC_CHECK_LIB(ltdl, lt_dlinit,
8044   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
8045   [if test x"$enable_ltdl_install" = xno; then
8046      AC_MSG_WARN([libltdl not installed, but installation disabled])
8047    else
8048      enable_ltdl_install=yes
8049    fi
8050   ])
8051   if test x"$enable_ltdl_install" = x"yes"; then
8052     ac_configure_args="$ac_configure_args --enable-ltdl-install"
8053     LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
8054     LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
8055   else
8056     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
8057     LIBLTDL="-lltdl"
8058     LTDLINCL=
8059   fi
8060   # For backwards non-gettext consistent compatibility...
8061   INCLTDL="$LTDLINCL"
8062 ])# AC_LIBLTDL_INSTALLABLE
8063
8064
8065 # AC_LIBTOOL_CXX
8066 # --------------
8067 # enable support for C++ libraries
8068 AC_DEFUN([AC_LIBTOOL_CXX],
8069 [AC_REQUIRE([_LT_AC_LANG_CXX])
8070 ])# AC_LIBTOOL_CXX
8071
8072
8073 # _LT_AC_LANG_CXX
8074 # ---------------
8075 AC_DEFUN([_LT_AC_LANG_CXX],
8076 [AC_REQUIRE([AC_PROG_CXX])
8077 AC_REQUIRE([AC_PROG_CXXCPP])
8078 _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
8079 ])# _LT_AC_LANG_CXX
8080
8081
8082 # AC_LIBTOOL_F77
8083 # --------------
8084 # enable support for Fortran 77 libraries
8085 AC_DEFUN([AC_LIBTOOL_F77],
8086 [AC_REQUIRE([_LT_AC_LANG_F77])
8087 ])# AC_LIBTOOL_F77
8088
8089
8090 # _LT_AC_LANG_F77
8091 # ---------------
8092 AC_DEFUN([_LT_AC_LANG_F77],
8093 [AC_REQUIRE([AC_PROG_F77])
8094 _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
8095 ])# _LT_AC_LANG_F77
8096
8097
8098 # AC_LIBTOOL_GCJ
8099 # --------------
8100 # enable support for GCJ libraries
8101 AC_DEFUN([AC_LIBTOOL_GCJ],
8102 [AC_REQUIRE([_LT_AC_LANG_GCJ])
8103 ])# AC_LIBTOOL_GCJ
8104
8105
8106 # _LT_AC_LANG_GCJ
8107 # ---------------
8108 AC_DEFUN([_LT_AC_LANG_GCJ],
8109 [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
8110   [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
8111     [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
8112       [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
8113          [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
8114            [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
8115 _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
8116 ])# _LT_AC_LANG_GCJ
8117
8118
8119 # AC_LIBTOOL_RC
8120 # --------------
8121 # enable support for Windows resource files
8122 AC_DEFUN([AC_LIBTOOL_RC],
8123 [AC_REQUIRE([LT_AC_PROG_RC])
8124 _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
8125 ])# AC_LIBTOOL_RC
8126
8127
8128 # AC_LIBTOOL_LANG_C_CONFIG
8129 # ------------------------
8130 # Ensure that the configuration vars for the C compiler are
8131 # suitably defined.  Those variables are subsequently used by
8132 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
8133 AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
8134 AC_DEFUN([_LT_AC_LANG_C_CONFIG],
8135 [lt_save_CC="$CC"
8136 AC_LANG_PUSH(C)
8137
8138 # Source file extension for C test sources.
8139 ac_ext=c
8140
8141 # Object file extension for compiled C test sources.
8142 objext=o
8143 _LT_AC_TAGVAR(objext, $1)=$objext
8144
8145 # Code to be used in simple compile tests
8146 lt_simple_compile_test_code="int some_variable = 0;\n"
8147
8148 # Code to be used in simple link tests
8149 lt_simple_link_test_code='int main(){return(0);}\n'
8150
8151 _LT_AC_SYS_COMPILER
8152
8153 #
8154 # Check for any special shared library compilation flags.
8155 #
8156 _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
8157 if test "$GCC" = no; then
8158   case $host_os in
8159   sco3.2v5*)
8160     _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
8161     ;;
8162   esac
8163 fi
8164 if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
8165   AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
8166   if echo "$old_CC $old_CFLAGS " | grep "[[     ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[      ]]" >/dev/null; then :
8167   else
8168     AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
8169     _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
8170   fi
8171 fi
8172
8173
8174 #
8175 # Check to make sure the static flag actually works.
8176 #
8177 AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
8178   _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
8179   $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
8180   [],
8181   [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
8182
8183
8184 ## CAVEAT EMPTOR:
8185 ## There is no encapsulation within the following macros, do not change
8186 ## the running order or otherwise move them around unless you know exactly
8187 ## what you are doing...
8188 AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
8189 AC_LIBTOOL_PROG_COMPILER_PIC($1)
8190 AC_LIBTOOL_PROG_CC_C_O($1)
8191 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
8192 AC_LIBTOOL_PROG_LD_SHLIBS($1)
8193 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
8194 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
8195 AC_LIBTOOL_SYS_LIB_STRIP
8196 AC_LIBTOOL_DLOPEN_SELF($1)
8197
8198 # Report which librarie types wil actually be built
8199 AC_MSG_CHECKING([if libtool supports shared libraries])
8200 AC_MSG_RESULT([$can_build_shared])
8201
8202 AC_MSG_CHECKING([whether to build shared libraries])
8203 test "$can_build_shared" = "no" && enable_shared=no
8204
8205 # On AIX, shared libraries and static libraries use the same namespace, and
8206 # are all built from PIC.
8207 case "$host_os" in
8208 aix3*)
8209   test "$enable_shared" = yes && enable_static=no
8210   if test -n "$RANLIB"; then
8211     archive_cmds="$archive_cmds~\$RANLIB \$lib"
8212     postinstall_cmds='$RANLIB $lib'
8213   fi
8214   ;;
8215
8216 aix4*)
8217   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8218     test "$enable_shared" = yes && enable_static=no
8219   fi
8220   ;;
8221   darwin* | rhapsody*)
8222   if test "$GCC" = yes; then
8223     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8224     case "$host_os" in
8225     rhapsody* | darwin1.[[012]])
8226       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
8227       ;;
8228     *) # Darwin 1.3 on
8229       if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
8230         allow_undefined_flag='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
8231       else
8232         case ${MACOSX_DEPLOYMENT_TARGET} in
8233           10.[012])
8234             allow_undefined_flag='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
8235             ;;
8236           10.*)
8237             allow_undefined_flag='-Wl,-undefined -Wl,dynamic_lookup'
8238             ;;
8239         esac
8240       fi
8241       ;;
8242     esac
8243     output_verbose_link_cmd='echo'
8244     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
8245     _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
8246     # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
8247     _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
8248     _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
8249     _LT_AC_TAGVAR(hardcode_direct, $1)=no
8250     _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
8251     _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
8252     _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
8253     _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8254   else
8255     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8256   fi  
8257     ;;  
8258 esac
8259 AC_MSG_RESULT([$enable_shared])
8260
8261 AC_MSG_CHECKING([whether to build static libraries])
8262 # Make sure either enable_shared or enable_static is yes.
8263 test "$enable_shared" = yes || enable_static=yes
8264 AC_MSG_RESULT([$enable_static])
8265
8266 AC_LIBTOOL_CONFIG($1)
8267
8268 AC_LANG_POP
8269 CC="$lt_save_CC"
8270 ])# AC_LIBTOOL_LANG_C_CONFIG
8271
8272
8273 # AC_LIBTOOL_LANG_CXX_CONFIG
8274 # --------------------------
8275 # Ensure that the configuration vars for the C compiler are
8276 # suitably defined.  Those variables are subsequently used by
8277 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
8278 AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
8279 AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
8280 [AC_LANG_PUSH(C++)
8281 AC_REQUIRE([AC_PROG_CXX])
8282 AC_REQUIRE([AC_PROG_CXXCPP])
8283
8284 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8285 _LT_AC_TAGVAR(allow_undefined_flag, $1)=
8286 _LT_AC_TAGVAR(always_export_symbols, $1)=no
8287 _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
8288 _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
8289 _LT_AC_TAGVAR(hardcode_direct, $1)=no
8290 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
8291 _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
8292 _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
8293 _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
8294 _LT_AC_TAGVAR(hardcode_automatic, $1)=no
8295 _LT_AC_TAGVAR(module_cmds, $1)=
8296 _LT_AC_TAGVAR(module_expsym_cmds, $1)=
8297 _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
8298 _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8299 _LT_AC_TAGVAR(no_undefined_flag, $1)=
8300 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
8301 _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8302
8303 # Dependencies to place before and after the object being linked:
8304 _LT_AC_TAGVAR(predep_objects, $1)=
8305 _LT_AC_TAGVAR(postdep_objects, $1)=
8306 _LT_AC_TAGVAR(predeps, $1)=
8307 _LT_AC_TAGVAR(postdeps, $1)=
8308 _LT_AC_TAGVAR(compiler_lib_search_path, $1)=
8309
8310 # Source file extension for C++ test sources.
8311 ac_ext=cc
8312
8313 # Object file extension for compiled C++ test sources.
8314 objext=o
8315 _LT_AC_TAGVAR(objext, $1)=$objext
8316
8317 # Code to be used in simple compile tests
8318 lt_simple_compile_test_code="int some_variable = 0;\n"
8319
8320 # Code to be used in simple link tests
8321 lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
8322
8323 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8324 _LT_AC_SYS_COMPILER
8325
8326 # Allow CC to be a program name with arguments.
8327 lt_save_CC=$CC
8328 lt_save_LD=$LD
8329 lt_save_GCC=$GCC
8330 GCC=$GXX
8331 lt_save_with_gnu_ld=$with_gnu_ld
8332 lt_save_path_LD=$lt_cv_path_LD
8333 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
8334   lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
8335 else
8336   unset lt_cv_prog_gnu_ld
8337 fi
8338 if test -n "${lt_cv_path_LDCXX+set}"; then
8339   lt_cv_path_LD=$lt_cv_path_LDCXX
8340 else
8341   unset lt_cv_path_LD
8342 fi
8343 test -z "${LDCXX+set}" || LD=$LDCXX
8344 CC=${CXX-"c++"}
8345 compiler=$CC
8346 _LT_AC_TAGVAR(compiler, $1)=$CC
8347 cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
8348
8349 # We don't want -fno-exception wen compiling C++ code, so set the
8350 # no_builtin_flag separately
8351 if test "$GXX" = yes; then
8352   _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
8353 else
8354   _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
8355 fi
8356
8357 if test "$GXX" = yes; then
8358   # Set up default GNU C++ configuration
8359
8360   AC_PROG_LD
8361
8362   # Check if GNU C++ uses GNU ld as the underlying linker, since the
8363   # archiving commands below assume that GNU ld is being used.
8364   if test "$with_gnu_ld" = yes; then
8365     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
8366     _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8367
8368     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
8369     _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
8370
8371     # If archive_cmds runs LD, not CC, wlarc should be empty
8372     # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
8373     #     investigate it a little bit more. (MM)
8374     wlarc='${wl}'
8375
8376     # ancient GNU ld didn't support --whole-archive et. al.
8377     if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
8378         grep 'no-whole-archive' > /dev/null; then
8379       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
8380     else
8381       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
8382     fi
8383   else
8384     with_gnu_ld=no
8385     wlarc=
8386
8387     # A generic and very simple default shared library creation
8388     # command for GNU C++ for the case where it uses the native
8389     # linker, instead of GNU ld.  If possible, this setting should
8390     # overridden to take advantage of the native linker features on
8391     # the platform it is being used on.
8392     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $lib'
8393   fi
8394
8395   # Commands to make compiler produce verbose output that lists
8396   # what "hidden" libraries, object files and flags are used when
8397   # linking a shared library.
8398   output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
8399
8400 else
8401   GXX=no
8402   with_gnu_ld=no
8403   wlarc=
8404 fi
8405
8406 # PORTME: fill in a description of your system's C++ link characteristics
8407 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
8408 _LT_AC_TAGVAR(ld_shlibs, $1)=yes
8409 case $host_os in
8410   aix3*)
8411     # FIXME: insert proper C++ library support
8412     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8413     ;;
8414   aix4* | aix5*)
8415     if test "$host_cpu" = ia64; then
8416       # On IA64, the linker does run time linking by default, so we don't
8417       # have to do anything special.
8418       aix_use_runtimelinking=no
8419       exp_sym_flag='-Bexport'
8420       no_entry_flag=""
8421     else
8422       # KDE requires run time linking.  Make it the default.
8423       aix_use_runtimelinking=yes
8424       exp_sym_flag='-bexport'
8425       no_entry_flag='-bnoentry'
8426     fi
8427
8428     # When large executables or shared objects are built, AIX ld can
8429     # have problems creating the table of contents.  If linking a library
8430     # or program results in "error TOC overflow" add -mminimal-toc to
8431     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
8432     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
8433
8434     _LT_AC_TAGVAR(archive_cmds, $1)=''
8435     _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8436     _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
8437     _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8438
8439     if test "$GXX" = yes; then
8440       case $host_os in aix4.[012]|aix4.[012].*)
8441       # We only want to do this on AIX 4.2 and lower, the check
8442       # below for broken collect2 doesn't work under 4.3+
8443         collect2name=`${CC} -print-prog-name=collect2`
8444         if test -f "$collect2name" && \
8445            strings "$collect2name" | grep resolve_lib_name >/dev/null
8446         then
8447           # We have reworked collect2
8448           _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8449         else
8450           # We have old collect2
8451           _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
8452           # It fails to find uninstalled libraries when the uninstalled
8453           # path is not listed in the libpath.  Setting hardcode_minus_L
8454           # to unsupported forces relinking
8455           _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
8456           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8457           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
8458         fi
8459       esac
8460       shared_flag='-shared'
8461     else
8462       # not using gcc
8463       if test "$host_cpu" = ia64; then
8464         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
8465         # chokes on -Wl,-G. The following line is correct:
8466         shared_flag='-G'
8467       else
8468         if test "$aix_use_runtimelinking" = yes; then
8469           shared_flag='-qmkshrobj ${wl}-G'
8470         else
8471           shared_flag='-qmkshrobj'
8472         fi
8473       fi
8474     fi
8475
8476     # Let the compiler handle the export list.
8477     _LT_AC_TAGVAR(always_export_symbols, $1)=no
8478     if test "$aix_use_runtimelinking" = yes; then
8479       # Warning - without using the other runtime loading flags (-brtl),
8480       # -berok will link without error, but may produce a broken library.
8481       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
8482       # Determine the default libpath from the value encoded in an empty executable.
8483       _LT_AC_SYS_LIBPATH_AIX
8484       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
8485
8486       _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
8487       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
8488      else
8489       if test "$host_cpu" = ia64; then
8490         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
8491         _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
8492         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
8493       else
8494         # Determine the default libpath from the value encoded in an empty executable.
8495         _LT_AC_SYS_LIBPATH_AIX
8496         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
8497         # Warning - without using the other run time loading flags,
8498         # -berok will link without error, but may produce a broken library.
8499         _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
8500         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
8501         # -bexpall does not export symbols beginning with underscore (_)
8502         _LT_AC_TAGVAR(always_export_symbols, $1)=yes
8503         # Exported symbols can be pulled into shared objects from archives
8504         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
8505         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
8506         # This is similar to how AIX traditionally builds it's shared libraries.
8507         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
8508       fi
8509     fi
8510     ;;
8511   chorus*)
8512     case $cc_basename in
8513       *)
8514         # FIXME: insert proper C++ library support
8515         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8516         ;;
8517     esac
8518     ;;
8519
8520   cygwin* | mingw* | pw32*)
8521     # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
8522     # as there is no search path for DLLs.
8523     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8524     _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
8525     _LT_AC_TAGVAR(always_export_symbols, $1)=no
8526     _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8527
8528     if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
8529       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
8530       # If the export-symbols file already is a .def file (1st line
8531       # is EXPORTS), use it as is; otherwise, prepend...
8532       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
8533         cp $export_symbols $output_objdir/$soname.def;
8534       else
8535         echo EXPORTS > $output_objdir/$soname.def;
8536         cat $export_symbols >> $output_objdir/$soname.def;
8537       fi~
8538       $CC -shared -nostdlib $output_objdir/$soname.def $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
8539     else
8540       _LT_AC_TAGVAR(ld_shlibs, $1)=no
8541     fi
8542   ;;
8543
8544   darwin* | rhapsody*)
8545   if test "$GXX" = yes; then
8546     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8547     case "$host_os" in
8548     rhapsody* | darwin1.[[012]])
8549       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
8550       ;;
8551     *) # Darwin 1.3 on
8552       if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
8553         allow_undefined_flag='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
8554       else
8555         case ${MACOSX_DEPLOYMENT_TARGET} in
8556           10.[012])
8557             allow_undefined_flag='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
8558             ;;
8559           10.*)
8560             allow_undefined_flag='-Wl,-undefined -Wl,dynamic_lookup'
8561             ;;
8562         esac
8563       fi
8564       ;;
8565     esac
8566     lt_int_apple_cc_single_mod=no
8567     output_verbose_link_cmd='echo'
8568     if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
8569       lt_int_apple_cc_single_mod=yes
8570     fi
8571     if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
8572       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
8573     else
8574       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
8575     fi
8576     _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
8577
8578     # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
8579     if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
8580       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
8581     else
8582       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
8583     fi
8584     _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
8585     _LT_AC_TAGVAR(hardcode_direct, $1)=no
8586     _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
8587     _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
8588     _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
8589     _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8590   else
8591     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8592   fi
8593     ;;
8594
8595   dgux*)
8596     case $cc_basename in
8597       ec++)
8598         # FIXME: insert proper C++ library support
8599         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8600         ;;
8601       ghcx)
8602         # Green Hills C++ Compiler
8603         # FIXME: insert proper C++ library support
8604         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8605         ;;
8606       *)
8607         # FIXME: insert proper C++ library support
8608         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8609         ;;
8610     esac
8611     ;;
8612   freebsd[12]*)
8613     # C++ shared libraries reported to be fairly broken before switch to ELF
8614     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8615     ;;
8616   freebsd-elf*)
8617     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8618     ;;
8619   freebsd*)
8620     # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
8621     # conventions
8622     _LT_AC_TAGVAR(ld_shlibs, $1)=yes
8623     ;;
8624   gnu*)
8625     ;;
8626   hpux9*)
8627     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
8628     _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8629     _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8630     _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8631     _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
8632                                 # but as the default
8633                                 # location of the library.
8634
8635     case $cc_basename in
8636     CC)
8637       # FIXME: insert proper C++ library support
8638       _LT_AC_TAGVAR(ld_shlibs, $1)=no
8639       ;;
8640     aCC)
8641       _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
8642       # Commands to make compiler produce verbose output that lists
8643       # what "hidden" libraries, object files and flags are used when
8644       # linking a shared library.
8645       #
8646       # There doesn't appear to be a way to prevent this compiler from
8647       # explicitly linking system object files so we need to strip them
8648       # from the output so that they don't get included in the library
8649       # dependencies.
8650       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'
8651       ;;
8652     *)
8653       if test "$GXX" = yes; then
8654         _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
8655       else
8656         # FIXME: insert proper C++ library support
8657         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8658       fi
8659       ;;
8660     esac
8661     ;;
8662   hpux10*|hpux11*)
8663     if test $with_gnu_ld = no; then
8664       case "$host_cpu" in
8665       hppa*64*)
8666         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
8667         _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
8668         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8669         ;;
8670       ia64*)
8671         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8672         ;;
8673       *)
8674         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
8675         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8676         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8677         ;;
8678       esac
8679     fi
8680     case "$host_cpu" in
8681     hppa*64*)
8682       _LT_AC_TAGVAR(hardcode_direct, $1)=no
8683       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8684       ;;
8685     ia64*)
8686       _LT_AC_TAGVAR(hardcode_direct, $1)=no
8687       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8688       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
8689                                               # but as the default
8690                                               # location of the library.
8691       ;;
8692     *)
8693       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8694       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
8695                                               # but as the default
8696                                               # location of the library.
8697       ;;
8698     esac
8699
8700     case $cc_basename in
8701       CC)
8702         # FIXME: insert proper C++ library support
8703         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8704         ;;
8705       aCC)
8706         case "$host_cpu" in
8707         hppa*64*|ia64*)
8708           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
8709           ;;
8710         *)
8711           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
8712           ;;
8713         esac
8714         # Commands to make compiler produce verbose output that lists
8715         # what "hidden" libraries, object files and flags are used when
8716         # linking a shared library.
8717         #
8718         # There doesn't appear to be a way to prevent this compiler from
8719         # explicitly linking system object files so we need to strip them
8720         # from the output so that they don't get included in the library
8721         # dependencies.
8722         output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
8723         ;;
8724       *)
8725         if test "$GXX" = yes; then
8726           if test $with_gnu_ld = no; then
8727             case "$host_cpu" in
8728             ia64*|hppa*64*)
8729               _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
8730               ;;
8731             *)
8732               _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
8733               ;;
8734             esac
8735           fi
8736         else
8737           # FIXME: insert proper C++ library support
8738           _LT_AC_TAGVAR(ld_shlibs, $1)=no
8739         fi
8740         ;;
8741     esac
8742     ;;
8743   irix5* | irix6*)
8744     case $cc_basename in
8745       CC)
8746         # SGI C++
8747         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
8748
8749         # Archives containing C++ object files must be created using
8750         # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
8751         # necessary to make sure instantiated templates are included
8752         # in the archive.
8753         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
8754         ;;
8755       *)
8756         if test "$GXX" = yes; then
8757           if test "$with_gnu_ld" = no; then
8758             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
8759           else
8760             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
8761           fi
8762         fi
8763         _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8764         ;;
8765     esac
8766     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8767     _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8768     ;;
8769   linux*)
8770     case $cc_basename in
8771       KCC)
8772         # Kuck and Associates, Inc. (KAI) C++ Compiler
8773
8774         # KCC will only create a shared library if the output file
8775         # ends with ".so" (or ".sl" for HP-UX), so rename the library
8776         # to its proper name (with version) after linking.
8777         _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
8778         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
8779         # Commands to make compiler produce verbose output that lists
8780         # what "hidden" libraries, object files and flags are used when
8781         # linking a shared library.
8782         #
8783         # There doesn't appear to be a way to prevent this compiler from
8784         # explicitly linking system object files so we need to strip them
8785         # from the output so that they don't get included in the library
8786         # dependencies.
8787         output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
8788
8789         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
8790         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
8791
8792         # Archives containing C++ object files must be created using
8793         # "CC -Bstatic", where "CC" is the KAI C++ compiler.
8794         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
8795         ;;
8796       icpc)
8797         # Intel C++
8798         with_gnu_ld=yes
8799         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8800         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
8801         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8802         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8803         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
8804         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
8805         ;;
8806       cxx)
8807         # Compaq C++
8808         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
8809         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
8810
8811         runpath_var=LD_RUN_PATH
8812         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
8813         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8814
8815         # Commands to make compiler produce verbose output that lists
8816         # what "hidden" libraries, object files and flags are used when
8817         # linking a shared library.
8818         #
8819         # There doesn't appear to be a way to prevent this compiler from
8820         # explicitly linking system object files so we need to strip them
8821         # from the output so that they don't get included in the library
8822         # dependencies.
8823         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'
8824         ;;
8825     esac
8826     ;;
8827   lynxos*)
8828     # FIXME: insert proper C++ library support
8829     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8830     ;;
8831   m88k*)
8832     # FIXME: insert proper C++ library support
8833     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8834     ;;
8835   mvs*)
8836     case $cc_basename in
8837       cxx)
8838         # FIXME: insert proper C++ library support
8839         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8840         ;;
8841       *)
8842         # FIXME: insert proper C++ library support
8843         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8844         ;;
8845     esac
8846     ;;
8847   netbsd*)
8848     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
8849       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
8850       wlarc=
8851       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8852       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8853       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8854     fi
8855     # Workaround some broken pre-1.5 toolchains
8856     output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
8857     ;;
8858   osf3*)
8859     case $cc_basename in
8860       KCC)
8861         # Kuck and Associates, Inc. (KAI) C++ Compiler
8862
8863         # KCC will only create a shared library if the output file
8864         # ends with ".so" (or ".sl" for HP-UX), so rename the library
8865         # to its proper name (with version) after linking.
8866         _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
8867
8868         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8869         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8870
8871         # Archives containing C++ object files must be created using
8872         # "CC -Bstatic", where "CC" is the KAI C++ compiler.
8873         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
8874
8875         ;;
8876       RCC)
8877         # Rational C++ 2.4.1
8878         # FIXME: insert proper C++ library support
8879         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8880         ;;
8881       cxx)
8882         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8883         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
8884
8885         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8886         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8887
8888         # Commands to make compiler produce verbose output that lists
8889         # what "hidden" libraries, object files and flags are used when
8890         # linking a shared library.
8891         #
8892         # There doesn't appear to be a way to prevent this compiler from
8893         # explicitly linking system object files so we need to strip them
8894         # from the output so that they don't get included in the library
8895         # dependencies.
8896         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'
8897         ;;
8898       *)
8899         if test "$GXX" = yes && test "$with_gnu_ld" = no; then
8900           _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8901           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
8902
8903           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8904           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8905
8906           # Commands to make compiler produce verbose output that lists
8907           # what "hidden" libraries, object files and flags are used when
8908           # linking a shared library.
8909           output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
8910
8911         else
8912           # FIXME: insert proper C++ library support
8913           _LT_AC_TAGVAR(ld_shlibs, $1)=no
8914         fi
8915         ;;
8916     esac
8917     ;;
8918   osf4* | osf5*)
8919     case $cc_basename in
8920       KCC)
8921         # Kuck and Associates, Inc. (KAI) C++ Compiler
8922
8923         # KCC will only create a shared library if the output file
8924         # ends with ".so" (or ".sl" for HP-UX), so rename the library
8925         # to its proper name (with version) after linking.
8926         _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib'
8927
8928         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8929         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8930
8931         # Archives containing C++ object files must be created using
8932         # the KAI C++ compiler.
8933         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
8934         ;;
8935       RCC)
8936         # Rational C++ 2.4.1
8937         # FIXME: insert proper C++ library support
8938         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8939         ;;
8940       cxx)
8941         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
8942         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
8943         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
8944           echo "-hidden">> $lib.exp~
8945           $CC -shared$allow_undefined_flag $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~
8946           $rm $lib.exp'
8947
8948         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
8949         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8950
8951         # Commands to make compiler produce verbose output that lists
8952         # what "hidden" libraries, object files and flags are used when
8953         # linking a shared library.
8954         #
8955         # There doesn't appear to be a way to prevent this compiler from
8956         # explicitly linking system object files so we need to strip them
8957         # from the output so that they don't get included in the library
8958         # dependencies.
8959         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'
8960         ;;
8961       *)
8962         if test "$GXX" = yes && test "$with_gnu_ld" = no; then
8963           _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8964          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
8965
8966           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8967           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8968
8969           # Commands to make compiler produce verbose output that lists
8970           # what "hidden" libraries, object files and flags are used when
8971           # linking a shared library.
8972           output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
8973
8974         else
8975           # FIXME: insert proper C++ library support
8976           _LT_AC_TAGVAR(ld_shlibs, $1)=no
8977         fi
8978         ;;
8979     esac
8980     ;;
8981   psos*)
8982     # FIXME: insert proper C++ library support
8983     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8984     ;;
8985   sco*)
8986     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8987     case $cc_basename in
8988       CC)
8989         # FIXME: insert proper C++ library support
8990         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8991         ;;
8992       *)
8993         # FIXME: insert proper C++ library support
8994         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8995         ;;
8996     esac
8997     ;;
8998   sunos4*)
8999     case $cc_basename in
9000       CC)
9001         # Sun C++ 4.x
9002         # FIXME: insert proper C++ library support
9003         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9004         ;;
9005       lcc)
9006         # Lucid
9007         # FIXME: insert proper C++ library support
9008         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9009         ;;
9010       *)
9011         # FIXME: insert proper C++ library support
9012         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9013         ;;
9014     esac
9015     ;;
9016   solaris*)
9017     case $cc_basename in
9018       CC)
9019         # Sun C++ 4.2, 5.x and Centerline C++
9020         _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
9021         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
9022         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
9023         $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
9024
9025         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9026         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9027         case $host_os in
9028           solaris2.[0-5] | solaris2.[0-5].*) ;;
9029           *)
9030             # The C++ compiler is used as linker so we must use $wl
9031             # flag to pass the commands to the underlying system
9032             # linker.
9033             # Supported since Solaris 2.6 (maybe 2.5.1?)
9034             _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
9035             ;;
9036         esac
9037         _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
9038
9039         # Commands to make compiler produce verbose output that lists
9040         # what "hidden" libraries, object files and flags are used when
9041         # linking a shared library.
9042         #
9043         # There doesn't appear to be a way to prevent this compiler from
9044         # explicitly linking system object files so we need to strip them
9045         # from the output so that they don't get included in the library
9046         # dependencies.
9047         output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
9048
9049         # Archives containing C++ object files must be created using
9050         # "CC -xar", where "CC" is the Sun C++ compiler.  This is
9051         # necessary to make sure instantiated templates are included
9052         # in the archive.
9053         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
9054         ;;
9055       gcx)
9056         # Green Hills C++ Compiler
9057         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
9058
9059         # The C++ compiler must be used to create the archive.
9060         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
9061         ;;
9062       *)
9063         # GNU C++ compiler with Solaris linker
9064         if test "$GXX" = yes && test "$with_gnu_ld" = no; then
9065           _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
9066           if $CC --version | grep -v '^2\.7' > /dev/null; then
9067             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
9068             _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
9069                 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
9070
9071             # Commands to make compiler produce verbose output that lists
9072             # what "hidden" libraries, object files and flags are used when
9073             # linking a shared library.
9074             output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
9075           else
9076             # g++ 2.7 appears to require `-G' NOT `-shared' on this
9077             # platform.
9078             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
9079             _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
9080                 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
9081
9082             # Commands to make compiler produce verbose output that lists
9083             # what "hidden" libraries, object files and flags are used when
9084             # linking a shared library.
9085             output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
9086           fi
9087
9088           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
9089         fi
9090         ;;
9091     esac
9092     ;;
9093   sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
9094     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9095     ;;
9096   tandem*)
9097     case $cc_basename in
9098       NCC)
9099         # NonStop-UX NCC 3.20
9100         # FIXME: insert proper C++ library support
9101         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9102         ;;
9103       *)
9104         # FIXME: insert proper C++ library support
9105         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9106         ;;
9107     esac
9108     ;;
9109   vxworks*)
9110     # FIXME: insert proper C++ library support
9111     _LT_AC_TAGVAR(ld_shlibs, $1)=no
9112     ;;
9113   *)
9114     # FIXME: insert proper C++ library support
9115     _LT_AC_TAGVAR(ld_shlibs, $1)=no
9116     ;;
9117 esac
9118 AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
9119 test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
9120
9121 _LT_AC_TAGVAR(GCC, $1)="$GXX"
9122 _LT_AC_TAGVAR(LD, $1)="$LD"
9123
9124 ## CAVEAT EMPTOR:
9125 ## There is no encapsulation within the following macros, do not change
9126 ## the running order or otherwise move them around unless you know exactly
9127 ## what you are doing...
9128 AC_LIBTOOL_POSTDEP_PREDEP($1)
9129 AC_LIBTOOL_PROG_COMPILER_PIC($1)
9130 AC_LIBTOOL_PROG_CC_C_O($1)
9131 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
9132 AC_LIBTOOL_PROG_LD_SHLIBS($1)
9133 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
9134 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
9135 AC_LIBTOOL_SYS_LIB_STRIP
9136 AC_LIBTOOL_DLOPEN_SELF($1)
9137
9138 AC_LIBTOOL_CONFIG($1)
9139
9140 AC_LANG_POP
9141 CC=$lt_save_CC
9142 LDCXX=$LD
9143 LD=$lt_save_LD
9144 GCC=$lt_save_GCC
9145 with_gnu_ldcxx=$with_gnu_ld
9146 with_gnu_ld=$lt_save_with_gnu_ld
9147 lt_cv_path_LDCXX=$lt_cv_path_LD
9148 lt_cv_path_LD=$lt_save_path_LD
9149 lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
9150 lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
9151 ])# AC_LIBTOOL_LANG_CXX_CONFIG
9152
9153 # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
9154 # ------------------------
9155 # Figure out "hidden" library dependencies from verbose
9156 # compiler output when linking a shared library.
9157 # Parse the compiler output and extract the necessary
9158 # objects, libraries and library flags.
9159 AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
9160 dnl we can't use the lt_simple_compile_test_code here,
9161 dnl because it contains code intended for an executable,
9162 dnl not a library.  It's possible we should let each
9163 dnl tag define a new lt_????_link_test_code variable,
9164 dnl but it's only used here...
9165 ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
9166 int a;
9167 void foo (void) { a = 0; }
9168 EOF
9169 ],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
9170 class Foo
9171 {
9172 public:
9173   Foo (void) { a = 0; }
9174 private:
9175   int a;
9176 };
9177 EOF
9178 ],[$1],[F77],[cat > conftest.$ac_ext <<EOF
9179       subroutine foo
9180       implicit none
9181       integer*4 a
9182       a=0
9183       return
9184       end
9185 EOF
9186 ],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
9187 public class foo {
9188   private int a;
9189   public void bar (void) {
9190     a = 0;
9191   }
9192 };
9193 EOF
9194 ])
9195 dnl Parse the compiler output and extract the necessary
9196 dnl objects, libraries and library flags.
9197 if AC_TRY_EVAL(ac_compile); then
9198   # Parse the compiler output and extract the necessary
9199   # objects, libraries and library flags.
9200
9201   # Sentinel used to keep track of whether or not we are before
9202   # the conftest object file.
9203   pre_test_object_deps_done=no
9204
9205   # The `*' in the case matches for architectures that use `case' in
9206   # $output_verbose_cmd can trigger glob expansion during the loop
9207   # eval without this substitution.
9208   output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
9209
9210   for p in `eval $output_verbose_link_cmd`; do
9211     case $p in
9212
9213     -L* | -R* | -l*)
9214        # Some compilers place space between "-{L,R}" and the path.
9215        # Remove the space.
9216        if test $p = "-L" \
9217           || test $p = "-R"; then
9218          prev=$p
9219          continue
9220        else
9221          prev=
9222        fi
9223
9224        if test "$pre_test_object_deps_done" = no; then
9225          case $p in
9226          -L* | -R*)
9227            # Internal compiler library paths should come after those
9228            # provided the user.  The postdeps already come after the
9229            # user supplied libs so there is no need to process them.
9230            if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
9231              _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
9232            else
9233              _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
9234            fi
9235            ;;
9236          # The "-l" case would never come before the object being
9237          # linked, so don't bother handling this case.
9238          esac
9239        else
9240          if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
9241            _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
9242          else
9243            _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
9244          fi
9245        fi
9246        ;;
9247
9248     *.$objext|*.$libext)
9249        # This assumes that the test object file only shows up
9250        # once in the compiler output.
9251        if test "$p" = "conftest.$objext"; then
9252          pre_test_object_deps_done=yes
9253          continue
9254        fi
9255
9256        if test "$pre_test_object_deps_done" = no; then
9257          if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
9258            _LT_AC_TAGVAR(predep_objects, $1)="$p"
9259          else
9260            _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
9261          fi
9262        else
9263          if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
9264            _LT_AC_TAGVAR(postdep_objects, $1)="$p"
9265          else
9266            _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
9267          fi
9268        fi
9269        ;;
9270
9271     *) ;; # Ignore the rest.
9272
9273     esac
9274   done
9275
9276   # Clean up.
9277   rm -f a.out a.exe
9278 else
9279   echo "libtool.m4: error: problem compiling $1 test program"
9280 fi
9281
9282 $rm -f confest.$objext
9283
9284 case " $_LT_AC_TAGVAR(postdeps, $1) " in
9285 *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
9286 esac
9287 ])# AC_LIBTOOL_POSTDEP_PREDEP
9288
9289 # AC_LIBTOOL_LANG_F77_CONFIG
9290 # ------------------------
9291 # Ensure that the configuration vars for the C compiler are
9292 # suitably defined.  Those variables are subsequently used by
9293 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
9294 AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
9295 AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
9296 [AC_REQUIRE([AC_PROG_F77])
9297 AC_LANG_PUSH(Fortran 77)
9298
9299 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9300 _LT_AC_TAGVAR(allow_undefined_flag, $1)=
9301 _LT_AC_TAGVAR(always_export_symbols, $1)=no
9302 _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
9303 _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
9304 _LT_AC_TAGVAR(hardcode_direct, $1)=no
9305 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
9306 _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
9307 _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
9308 _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
9309 _LT_AC_TAGVAR(hardcode_automatic, $1)=no
9310 _LT_AC_TAGVAR(module_cmds, $1)=
9311 _LT_AC_TAGVAR(module_expsym_cmds, $1)=
9312 _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
9313 _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
9314 _LT_AC_TAGVAR(no_undefined_flag, $1)=
9315 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
9316 _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
9317
9318 # Source file extension for f77 test sources.
9319 ac_ext=f
9320
9321 # Object file extension for compiled f77 test sources.
9322 objext=o
9323 _LT_AC_TAGVAR(objext, $1)=$objext
9324
9325 # Code to be used in simple compile tests
9326 lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
9327
9328 # Code to be used in simple link tests
9329 lt_simple_link_test_code="      program t\n      end\n"
9330
9331 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
9332 _LT_AC_SYS_COMPILER
9333
9334 # Allow CC to be a program name with arguments.
9335 lt_save_CC="$CC"
9336 CC=${F77-"f77"}
9337 compiler=$CC
9338 _LT_AC_TAGVAR(compiler, $1)=$CC
9339 cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
9340
9341 AC_MSG_CHECKING([if libtool supports shared libraries])
9342 AC_MSG_RESULT([$can_build_shared])
9343
9344 AC_MSG_CHECKING([whether to build shared libraries])
9345 test "$can_build_shared" = "no" && enable_shared=no
9346
9347 # On AIX, shared libraries and static libraries use the same namespace, and
9348 # are all built from PIC.
9349 case "$host_os" in
9350 aix3*)
9351   test "$enable_shared" = yes && enable_static=no
9352   if test -n "$RANLIB"; then
9353     archive_cmds="$archive_cmds~\$RANLIB \$lib"
9354     postinstall_cmds='$RANLIB $lib'
9355   fi
9356   ;;
9357 aix4*)
9358   test "$enable_shared" = yes && enable_static=no
9359   ;;
9360 esac
9361 AC_MSG_RESULT([$enable_shared])
9362
9363 AC_MSG_CHECKING([whether to build static libraries])
9364 # Make sure either enable_shared or enable_static is yes.
9365 test "$enable_shared" = yes || enable_static=yes
9366 AC_MSG_RESULT([$enable_static])
9367
9368 test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
9369
9370 _LT_AC_TAGVAR(GCC, $1)="$G77"
9371 _LT_AC_TAGVAR(LD, $1)="$LD"
9372
9373 AC_LIBTOOL_PROG_COMPILER_PIC($1)
9374 AC_LIBTOOL_PROG_CC_C_O($1)
9375 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
9376 AC_LIBTOOL_PROG_LD_SHLIBS($1)
9377 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
9378 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
9379 AC_LIBTOOL_SYS_LIB_STRIP
9380
9381
9382 AC_LIBTOOL_CONFIG($1)
9383
9384 AC_LANG_POP
9385 CC="$lt_save_CC"
9386 ])# AC_LIBTOOL_LANG_F77_CONFIG
9387
9388
9389 # AC_LIBTOOL_LANG_GCJ_CONFIG
9390 # --------------------------
9391 # Ensure that the configuration vars for the C compiler are
9392 # suitably defined.  Those variables are subsequently used by
9393 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
9394 AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
9395 AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
9396 [AC_LANG_SAVE
9397
9398 # Source file extension for Java test sources.
9399 ac_ext=java
9400
9401 # Object file extension for compiled Java test sources.
9402 objext=o
9403 _LT_AC_TAGVAR(objext, $1)=$objext
9404
9405 # Code to be used in simple compile tests
9406 lt_simple_compile_test_code="class foo {}\n"
9407
9408 # Code to be used in simple link tests
9409 lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
9410
9411 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
9412 _LT_AC_SYS_COMPILER
9413
9414 # Allow CC to be a program name with arguments.
9415 lt_save_CC="$CC"
9416 CC=${GCJ-"gcj"}
9417 compiler=$CC
9418 _LT_AC_TAGVAR(compiler, $1)=$CC
9419
9420 # GCJ did not exist at the time GCC didn't implicitly link libc in.
9421 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9422
9423 ## CAVEAT EMPTOR:
9424 ## There is no encapsulation within the following macros, do not change
9425 ## the running order or otherwise move them around unless you know exactly
9426 ## what you are doing...
9427 AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
9428 AC_LIBTOOL_PROG_COMPILER_PIC($1)
9429 AC_LIBTOOL_PROG_CC_C_O($1)
9430 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
9431 AC_LIBTOOL_PROG_LD_SHLIBS($1)
9432 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
9433 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
9434 AC_LIBTOOL_SYS_LIB_STRIP
9435 AC_LIBTOOL_DLOPEN_SELF($1)
9436
9437 AC_LIBTOOL_CONFIG($1)
9438
9439 AC_LANG_RESTORE
9440 CC="$lt_save_CC"
9441 ])# AC_LIBTOOL_LANG_GCJ_CONFIG
9442
9443
9444 # AC_LIBTOOL_LANG_RC_CONFIG
9445 # --------------------------
9446 # Ensure that the configuration vars for the Windows resource compiler are
9447 # suitably defined.  Those variables are subsequently used by
9448 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
9449 AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
9450 AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
9451 [AC_LANG_SAVE
9452
9453 # Source file extension for RC test sources.
9454 ac_ext=rc
9455
9456 # Object file extension for compiled RC test sources.
9457 objext=o
9458 _LT_AC_TAGVAR(objext, $1)=$objext
9459
9460 # Code to be used in simple compile tests
9461 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
9462
9463 # Code to be used in simple link tests
9464 lt_simple_link_test_code="$lt_simple_compile_test_code"
9465
9466 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
9467 _LT_AC_SYS_COMPILER
9468
9469 # Allow CC to be a program name with arguments.
9470 lt_save_CC="$CC"
9471 CC=${RC-"windres"}
9472 compiler=$CC
9473 _LT_AC_TAGVAR(compiler, $1)=$CC
9474 _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
9475
9476 AC_LIBTOOL_CONFIG($1)
9477
9478 AC_LANG_RESTORE
9479 CC="$lt_save_CC"
9480 ])# AC_LIBTOOL_LANG_RC_CONFIG
9481
9482
9483 # AC_LIBTOOL_CONFIG([TAGNAME])
9484 # ----------------------------
9485 # If TAGNAME is not passed, then create an initial libtool script
9486 # with a default configuration from the untagged config vars.  Otherwise
9487 # add code to config.status for appending the configuration named by
9488 # TAGNAME from the matching tagged config vars.
9489 AC_DEFUN([AC_LIBTOOL_CONFIG],
9490 [# The else clause should only fire when bootstrapping the
9491 # libtool distribution, otherwise you forgot to ship ltmain.sh
9492 # with your package, and you will get complaints that there are
9493 # no rules to generate ltmain.sh.
9494 if test -f "$ltmain"; then
9495   # See if we are running on zsh, and set the options which allow our commands through
9496   # without removal of \ escapes.
9497   if test -n "${ZSH_VERSION+set}" ; then
9498     setopt NO_GLOB_SUBST
9499   fi  
9500   # Now quote all the things that may contain metacharacters while being
9501   # careful not to overquote the AC_SUBSTed values.  We take copies of the
9502   # variables and quote the copies for generation of the libtool script.
9503   for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
9504     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
9505     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
9506     deplibs_check_method reload_flag reload_cmds need_locks \
9507     lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
9508     lt_cv_sys_global_symbol_to_c_name_address \
9509     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
9510     old_postinstall_cmds old_postuninstall_cmds \
9511     _LT_AC_TAGVAR(compiler, $1) \
9512     _LT_AC_TAGVAR(CC, $1) \
9513     _LT_AC_TAGVAR(LD, $1) \
9514     _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
9515     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
9516     _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
9517     _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
9518     _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
9519     _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
9520     _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
9521     _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
9522     _LT_AC_TAGVAR(old_archive_cmds, $1) \
9523     _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
9524     _LT_AC_TAGVAR(predep_objects, $1) \
9525     _LT_AC_TAGVAR(postdep_objects, $1) \
9526     _LT_AC_TAGVAR(predeps, $1) \
9527     _LT_AC_TAGVAR(postdeps, $1) \
9528     _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
9529     _LT_AC_TAGVAR(archive_cmds, $1) \
9530     _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
9531     _LT_AC_TAGVAR(postinstall_cmds, $1) \
9532     _LT_AC_TAGVAR(postuninstall_cmds, $1) \
9533     _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
9534     _LT_AC_TAGVAR(allow_undefined_flag, $1) \
9535     _LT_AC_TAGVAR(no_undefined_flag, $1) \
9536     _LT_AC_TAGVAR(export_symbols_cmds, $1) \
9537     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
9538     _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
9539     _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
9540     _LT_AC_TAGVAR(hardcode_automatic, $1) \
9541     _LT_AC_TAGVAR(module_cmds, $1) \
9542     _LT_AC_TAGVAR(module_expsym_cmds, $1) \
9543     _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
9544     _LT_AC_TAGVAR(exclude_expsyms, $1) \
9545     _LT_AC_TAGVAR(include_expsyms, $1); do
9546
9547     case $var in
9548     _LT_AC_TAGVAR(old_archive_cmds, $1) | \
9549     _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
9550     _LT_AC_TAGVAR(archive_cmds, $1) | \
9551     _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
9552     _LT_AC_TAGVAR(module_cmds, $1) | \
9553     _LT_AC_TAGVAR(module_expsym_cmds, $1) | \   
9554     _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
9555     _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
9556     extract_expsyms_cmds | reload_cmds | finish_cmds | \
9557     postinstall_cmds | postuninstall_cmds | \
9558     old_postinstall_cmds | old_postuninstall_cmds | \
9559     sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
9560       # Double-quote double-evaled strings.
9561       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
9562       ;;
9563     *)
9564       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
9565       ;;
9566     esac
9567   done
9568
9569   case $lt_echo in
9570   *'\[$]0 --fallback-echo"')
9571     lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
9572     ;;
9573   esac
9574
9575 ifelse([$1], [],
9576   [cfgfile="${ofile}T"
9577   trap "$rm \"$cfgfile\"; exit 1" 1 2 15
9578   $rm -f "$cfgfile"
9579   AC_MSG_NOTICE([creating $ofile])],
9580   [cfgfile="$ofile"])
9581
9582   cat <<__EOF__ >> "$cfgfile"
9583 ifelse([$1], [],
9584 [#! $SHELL
9585
9586 # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
9587 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
9588 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
9589 #
9590 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
9591 # Free Software Foundation, Inc.
9592 #
9593 # This file is part of GNU Libtool:
9594 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
9595 #
9596 # This program is free software; you can redistribute it and/or modify
9597 # it under the terms of the GNU General Public License as published by
9598 # the Free Software Foundation; either version 2 of the License, or
9599 # (at your option) any later version.
9600 #
9601 # This program is distributed in the hope that it will be useful, but
9602 # WITHOUT ANY WARRANTY; without even the implied warranty of
9603 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9604 # General Public License for more details.
9605 #
9606 # You should have received a copy of the GNU General Public License
9607 # along with this program; if not, write to the Free Software
9608 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
9609 #
9610 # As a special exception to the GNU General Public License, if you
9611 # distribute this file as part of a program that contains a
9612 # configuration script generated by Autoconf, you may include it under
9613 # the same distribution terms that you use for the rest of that program.
9614
9615 # A sed program that does not truncate output.
9616 SED=$lt_SED
9617
9618 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
9619 Xsed="$SED -e s/^X//"
9620
9621 # The HP-UX ksh and POSIX shell print the target directory to stdout
9622 # if CDPATH is set.
9623 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
9624
9625 # The names of the tagged configurations supported by this script.
9626 available_tags=
9627
9628 # ### BEGIN LIBTOOL CONFIG],
9629 [# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
9630
9631 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
9632
9633 # Shell to use when invoking shell scripts.
9634 SHELL=$lt_SHELL
9635
9636 # Whether or not to build shared libraries.
9637 build_libtool_libs=$enable_shared
9638
9639 # Whether or not to build static libraries.
9640 build_old_libs=$enable_static
9641
9642 # Whether or not to add -lc for building shared libraries.
9643 build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
9644
9645 # Whether or not to disallow shared libs when runtime libs are static
9646 allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
9647
9648 # Whether or not to optimize for fast installation.
9649 fast_install=$enable_fast_install
9650
9651 # The host system.
9652 host_alias=$host_alias
9653 host=$host
9654
9655 # An echo program that does not interpret backslashes.
9656 echo=$lt_echo
9657
9658 # The archiver.
9659 AR=$lt_AR
9660 AR_FLAGS=$lt_AR_FLAGS
9661
9662 # A C compiler.
9663 LTCC=$lt_LTCC
9664
9665 # A language-specific compiler.
9666 CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
9667
9668 # Is the compiler the GNU C compiler?
9669 with_gcc=$_LT_AC_TAGVAR(GCC, $1)
9670
9671 # An ERE matcher.
9672 EGREP=$lt_EGREP
9673
9674 # The linker used to build libraries.
9675 LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
9676
9677 # Whether we need hard or soft links.
9678 LN_S=$lt_LN_S
9679
9680 # A BSD-compatible nm program.
9681 NM=$lt_NM
9682
9683 # A symbol stripping program
9684 STRIP=$STRIP
9685
9686 # Used to examine libraries when file_magic_cmd begins "file"
9687 MAGIC_CMD=$MAGIC_CMD
9688
9689 # Used on cygwin: DLL creation program.
9690 DLLTOOL="$DLLTOOL"
9691
9692 # Used on cygwin: object dumper.
9693 OBJDUMP="$OBJDUMP"
9694
9695 # Used on cygwin: assembler.
9696 AS="$AS"
9697
9698 # The name of the directory that contains temporary libtool files.
9699 objdir=$objdir
9700
9701 # How to create reloadable object files.
9702 reload_flag=$lt_reload_flag
9703 reload_cmds=$lt_reload_cmds
9704
9705 # How to pass a linker flag through the compiler.
9706 wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
9707
9708 # Object file suffix (normally "o").
9709 objext="$ac_objext"
9710
9711 # Old archive suffix (normally "a").
9712 libext="$libext"
9713
9714 # Shared library suffix (normally ".so").
9715 shrext='$shrext'
9716
9717 # Executable file suffix (normally "").
9718 exeext="$exeext"
9719
9720 # Additional compiler flags for building library objects.
9721 pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
9722 pic_mode=$pic_mode
9723
9724 # What is the maximum length of a command?
9725 max_cmd_len=$lt_cv_sys_max_cmd_len
9726
9727 # Does compiler simultaneously support -c and -o options?
9728 compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
9729
9730 # Must we lock files when doing compilation ?
9731 need_locks=$lt_need_locks
9732
9733 # Do we need the lib prefix for modules?
9734 need_lib_prefix=$need_lib_prefix
9735
9736 # Do we need a version for libraries?
9737 need_version=$need_version
9738
9739 # Whether dlopen is supported.
9740 dlopen_support=$enable_dlopen
9741
9742 # Whether dlopen of programs is supported.
9743 dlopen_self=$enable_dlopen_self
9744
9745 # Whether dlopen of statically linked programs is supported.
9746 dlopen_self_static=$enable_dlopen_self_static
9747
9748 # Compiler flag to prevent dynamic linking.
9749 link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
9750
9751 # Compiler flag to turn off builtin functions.
9752 no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
9753
9754 # Compiler flag to allow reflexive dlopens.
9755 export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
9756
9757 # Compiler flag to generate shared objects directly from archives.
9758 whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
9759
9760 # Compiler flag to generate thread-safe objects.
9761 thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
9762
9763 # Library versioning type.
9764 version_type=$version_type
9765
9766 # Format of library name prefix.
9767 libname_spec=$lt_libname_spec
9768
9769 # List of archive names.  First name is the real one, the rest are links.
9770 # The last name is the one that the linker finds with -lNAME.
9771 library_names_spec=$lt_library_names_spec
9772
9773 # The coded name of the library, if different from the real name.
9774 soname_spec=$lt_soname_spec
9775
9776 # Commands used to build and install an old-style archive.
9777 RANLIB=$lt_RANLIB
9778 old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
9779 old_postinstall_cmds=$lt_old_postinstall_cmds
9780 old_postuninstall_cmds=$lt_old_postuninstall_cmds
9781
9782 # Create an old-style archive from a shared archive.
9783 old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
9784
9785 # Create a temporary old-style archive to link instead of a shared archive.
9786 old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
9787
9788 # Commands used to build and install a shared archive.
9789 archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
9790 archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
9791 postinstall_cmds=$lt_postinstall_cmds
9792 postuninstall_cmds=$lt_postuninstall_cmds
9793
9794 # Commands used to build a loadable module (assumed same as above if empty)
9795 module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
9796 module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
9797
9798 # Commands to strip libraries.
9799 old_striplib=$lt_old_striplib
9800 striplib=$lt_striplib
9801
9802 # Dependencies to place before the objects being linked to create a
9803 # shared library.
9804 predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
9805
9806 # Dependencies to place after the objects being linked to create a
9807 # shared library.
9808 postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
9809
9810 # Dependencies to place before the objects being linked to create a
9811 # shared library.
9812 predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
9813
9814 # Dependencies to place after the objects being linked to create a
9815 # shared library.
9816 postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
9817
9818 # The library search path used internally by the compiler when linking
9819 # a shared library.
9820 compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
9821
9822 # Method to check whether dependent libraries are shared objects.
9823 deplibs_check_method=$lt_deplibs_check_method
9824
9825 # Command to use when deplibs_check_method == file_magic.
9826 file_magic_cmd=$lt_file_magic_cmd
9827
9828 # Flag that allows shared libraries with undefined symbols to be built.
9829 allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
9830
9831 # Flag that forces no undefined symbols.
9832 no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
9833
9834 # Commands used to finish a libtool library installation in a directory.
9835 finish_cmds=$lt_finish_cmds
9836
9837 # Same as above, but a single script fragment to be evaled but not shown.
9838 finish_eval=$lt_finish_eval
9839
9840 # Take the output of nm and produce a listing of raw symbols and C names.
9841 global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
9842
9843 # Transform the output of nm in a proper C declaration
9844 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
9845
9846 # Transform the output of nm in a C name address pair
9847 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
9848
9849 # This is the shared library runtime path variable.
9850 runpath_var=$runpath_var
9851
9852 # This is the shared library path variable.
9853 shlibpath_var=$shlibpath_var
9854
9855 # Is shlibpath searched before the hard-coded library search path?
9856 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
9857
9858 # How to hardcode a shared library path into an executable.
9859 hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
9860
9861 # Whether we should hardcode library paths into libraries.
9862 hardcode_into_libs=$hardcode_into_libs
9863
9864 # Flag to hardcode \$libdir into a binary during linking.
9865 # This must work even if \$libdir does not exist.
9866 hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
9867
9868 # If ld is used when linking, flag to hardcode \$libdir into
9869 # a binary during linking. This must work even if \$libdir does
9870 # not exist.
9871 hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
9872
9873 # Whether we need a single -rpath flag with a separated argument.
9874 hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
9875
9876 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
9877 # resulting binary.
9878 hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
9879
9880 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
9881 # resulting binary.
9882 hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
9883
9884 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
9885 # the resulting binary.
9886 hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
9887
9888 # Set to yes if building a shared library automatically hardcodes DIR into the library
9889 # and all subsequent libraries and executables linked against it.
9890 hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
9891
9892 # Variables whose values should be saved in libtool wrapper scripts and
9893 # restored at relink time.
9894 variables_saved_for_relink="$variables_saved_for_relink"
9895
9896 # Whether libtool must link a program against all its dependency libraries.
9897 link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
9898
9899 # Compile-time system search path for libraries
9900 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
9901
9902 # Run-time system search path for libraries
9903 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
9904
9905 # Fix the shell variable \$srcfile for the compiler.
9906 fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
9907
9908 # Set to yes if exported symbols are required.
9909 always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
9910
9911 # The commands to list exported symbols.
9912 export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
9913
9914 # The commands to extract the exported symbol list from a shared archive.
9915 extract_expsyms_cmds=$lt_extract_expsyms_cmds
9916
9917 # Symbols that should not be listed in the preloaded symbols.
9918 exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
9919
9920 # Symbols that must always be exported.
9921 include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
9922
9923 ifelse([$1],[],
9924 [# ### END LIBTOOL CONFIG],
9925 [# ### END LIBTOOL TAG CONFIG: $tagname])
9926
9927 __EOF__
9928
9929 ifelse([$1],[], [
9930   case $host_os in
9931   aix3*)
9932     cat <<\EOF >> "$cfgfile"
9933
9934 # AIX sometimes has problems with the GCC collect2 program.  For some
9935 # reason, if we set the COLLECT_NAMES environment variable, the problems
9936 # vanish in a puff of smoke.
9937 if test "X${COLLECT_NAMES+set}" != Xset; then
9938   COLLECT_NAMES=
9939   export COLLECT_NAMES
9940 fi
9941 EOF
9942     ;;
9943   esac
9944
9945   # We use sed instead of cat because bash on DJGPP gets confused if
9946   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
9947   # text mode, it properly converts lines to CR/LF.  This bash problem
9948   # is reportedly fixed, but why not run on old versions too?
9949   sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
9950
9951   mv -f "$cfgfile" "$ofile" || \
9952     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
9953   chmod +x "$ofile"
9954 ])
9955 else
9956   # If there is no Makefile yet, we rely on a make rule to execute
9957   # `config.status --recheck' to rerun these tests and create the
9958   # libtool script then.
9959   test -f Makefile && make "$ltmain"
9960 fi
9961 ])# AC_LIBTOOL_CONFIG
9962
9963
9964 # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
9965 # -------------------------------------------
9966 AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
9967 [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
9968
9969 _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
9970
9971 if test "$GCC" = yes; then
9972   _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
9973
9974   AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
9975     lt_cv_prog_compiler_rtti_exceptions,
9976     [-fno-rtti -fno-exceptions], [],
9977     [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
9978 fi
9979 ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
9980
9981
9982 # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
9983 # ---------------------------------
9984 AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
9985 [AC_REQUIRE([AC_CANONICAL_HOST])
9986 AC_REQUIRE([AC_PROG_NM])
9987 AC_REQUIRE([AC_OBJEXT])
9988 # Check for command to grab the raw symbol name followed by C symbol from nm.
9989 AC_MSG_CHECKING([command to parse $NM output from $compiler object])
9990 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
9991 [
9992 # These are sane defaults that work on at least a few old systems.
9993 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
9994
9995 # Character class describing NM global symbol codes.
9996 symcode='[[BCDEGRST]]'
9997
9998 # Regexp to match symbols that can be accessed directly from C.
9999 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
10000
10001 # Transform the above into a raw symbol and a C symbol.
10002 symxfrm='\1 \2\3 \3'
10003
10004 # Transform an extracted symbol line into a proper C declaration
10005 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
10006
10007 # Transform an extracted symbol line into symbol name and symbol address
10008 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'"
10009
10010 # Define system-specific variables.
10011 case $host_os in
10012 aix*)
10013   symcode='[[BCDT]]'
10014   ;;
10015 cygwin* | mingw* | pw32*)
10016   symcode='[[ABCDGISTW]]'
10017   ;;
10018 hpux*) # Its linker distinguishes data from code symbols
10019   if test "$host_cpu" = ia64; then
10020     symcode='[[ABCDEGRST]]'
10021   fi
10022   lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
10023   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'"
10024   ;;
10025 irix* | nonstopux*)
10026   symcode='[[BCDEGRST]]'
10027   ;;
10028 osf*)
10029   symcode='[[BCDEGQRST]]'
10030   ;;
10031 solaris* | sysv5*)
10032   symcode='[[BDT]]'
10033   ;;
10034 sysv4)
10035   symcode='[[DFNSTU]]'
10036   ;;
10037 esac
10038
10039 # Handle CRLF in mingw tool chain
10040 opt_cr=
10041 case $build_os in
10042 mingw*)
10043   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
10044   ;;
10045 esac
10046
10047 # If we're using GNU nm, then use its standard symbol codes.
10048 case `$NM -V 2>&1` in
10049 *GNU* | *'with BFD'*)
10050   symcode='[[ABCDGISTW]]' ;;
10051 esac
10052
10053 # Try without a prefix undercore, then with it.
10054 for ac_symprfx in "" "_"; do
10055
10056   # Write the raw and C identifiers.
10057   lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[      ]]\($symcode$symcode*\)[[       ]][[    ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
10058
10059   # Check to see that the pipe works correctly.
10060   pipe_works=no
10061
10062   rm -f conftest*
10063   cat > conftest.$ac_ext <<EOF
10064 #ifdef __cplusplus
10065 extern "C" {
10066 #endif
10067 char nm_test_var;
10068 void nm_test_func(){}
10069 #ifdef __cplusplus
10070 }
10071 #endif
10072 int main(){nm_test_var='a';nm_test_func();return(0);}
10073 EOF
10074
10075   if AC_TRY_EVAL(ac_compile); then
10076     # Now try to grab the symbols.
10077     nlist=conftest.nm
10078     if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
10079       # Try sorting and uniquifying the output.
10080       if sort "$nlist" | uniq > "$nlist"T; then
10081         mv -f "$nlist"T "$nlist"
10082       else
10083         rm -f "$nlist"T
10084       fi
10085
10086       # Make sure that we snagged all the symbols we need.
10087       if grep ' nm_test_var$' "$nlist" >/dev/null; then
10088         if grep ' nm_test_func$' "$nlist" >/dev/null; then
10089           cat <<EOF > conftest.$ac_ext
10090 #ifdef __cplusplus
10091 extern "C" {
10092 #endif
10093
10094 EOF
10095           # Now generate the symbol file.
10096           eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
10097
10098           cat <<EOF >> conftest.$ac_ext
10099 #if defined (__STDC__) && __STDC__
10100 # define lt_ptr_t void *
10101 #else
10102 # define lt_ptr_t char *
10103 # define const
10104 #endif
10105
10106 /* The mapping between symbol names and symbols. */
10107 const struct {
10108   const char *name;
10109   lt_ptr_t address;
10110 }
10111 lt_preloaded_symbols[[]] =
10112 {
10113 EOF
10114           $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
10115           cat <<\EOF >> conftest.$ac_ext
10116   {0, (lt_ptr_t) 0}
10117 };
10118
10119 #ifdef __cplusplus
10120 }
10121 #endif
10122 EOF
10123           # Now try linking the two files.
10124           mv conftest.$ac_objext conftstm.$ac_objext
10125           lt_save_LIBS="$LIBS"
10126           lt_save_CFLAGS="$CFLAGS"
10127           LIBS="conftstm.$ac_objext"
10128           CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
10129           if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
10130             pipe_works=yes
10131           fi
10132           LIBS="$lt_save_LIBS"
10133           CFLAGS="$lt_save_CFLAGS"
10134         else
10135           echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
10136         fi
10137       else
10138         echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
10139       fi
10140     else
10141       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
10142     fi
10143   else
10144     echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
10145     cat conftest.$ac_ext >&5
10146   fi
10147   rm -f conftest* conftst*
10148
10149   # Do not use the global_symbol_pipe unless it works.
10150   if test "$pipe_works" = yes; then
10151     break
10152   else
10153     lt_cv_sys_global_symbol_pipe=
10154   fi
10155 done
10156 ])
10157 if test -z "$lt_cv_sys_global_symbol_pipe"; then
10158   lt_cv_sys_global_symbol_to_cdecl=
10159 fi
10160 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
10161   AC_MSG_RESULT(failed)
10162 else
10163   AC_MSG_RESULT(ok)
10164 fi
10165 ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
10166
10167
10168 # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
10169 # ---------------------------------------
10170 AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
10171 [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
10172 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
10173 _LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
10174
10175 AC_MSG_CHECKING([for $compiler option to produce PIC])
10176  ifelse([$1],[CXX],[
10177   # C++ specific cases for pic, static, wl, etc.
10178   if test "$GXX" = yes; then
10179     _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10180     _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
10181
10182     case $host_os in
10183     aix*)
10184       # All AIX code is PIC.
10185       if test "$host_cpu" = ia64; then
10186         # AIX 5 now supports IA64 processor
10187         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10188       fi
10189       ;;
10190     amigaos*)
10191       # FIXME: we need at least 68020 code to build shared libraries, but
10192       # adding the `-m68020' flag to GCC prevents building anything better,
10193       # like `-m68040'.
10194       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
10195       ;;
10196     beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
10197       # PIC is the default for these OSes.
10198       ;;
10199     mingw* | os2* | pw32*)
10200       # This hack is so that the source file can tell whether it is being
10201       # built for inclusion in a dll (and should export symbols for example).
10202       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
10203       ;;
10204     darwin* | rhapsody*)
10205       # PIC is the default on this platform
10206       # Common symbols not allowed in MH_DYLIB files
10207       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
10208       ;;
10209     *djgpp*)
10210       # DJGPP does not support shared libraries at all
10211       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
10212       ;;
10213     sysv4*MP*)
10214       if test -d /usr/nec; then
10215         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
10216       fi
10217       ;;
10218     hpux*)
10219       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
10220       # not for PA HP-UX.
10221       case "$host_cpu" in
10222       hppa*64*|ia64*)
10223         ;;
10224       *)
10225         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10226         ;;
10227       esac
10228       ;;
10229     *)
10230       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10231       ;;
10232     esac
10233   else
10234     case $host_os in
10235       aix4* | aix5*)
10236         # All AIX code is PIC.
10237         if test "$host_cpu" = ia64; then
10238           # AIX 5 now supports IA64 processor
10239           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10240         else
10241           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
10242         fi
10243         ;;
10244       chorus*)
10245         case $cc_basename in
10246         cxch68)
10247           # Green Hills C++ Compiler
10248           # _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"
10249           ;;
10250         esac
10251         ;;
10252       dgux*)
10253         case $cc_basename in
10254           ec++)
10255             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10256             ;;
10257           ghcx)
10258             # Green Hills C++ Compiler
10259             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
10260             ;;
10261           *)
10262             ;;
10263         esac
10264         ;;
10265       freebsd*)
10266         # FreeBSD uses GNU C++
10267         ;;
10268       hpux9* | hpux10* | hpux11*)
10269         case $cc_basename in
10270           CC)
10271             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10272             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
10273             if test "$host_cpu" != ia64; then
10274               _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
10275             fi
10276             ;;
10277           aCC)
10278             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10279             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
10280             case "$host_cpu" in
10281             hppa*64*|ia64*)
10282               # +Z the default
10283               ;;
10284             *)
10285               _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
10286               ;;
10287             esac
10288             ;;
10289           *)
10290             ;;
10291         esac
10292         ;;
10293       irix5* | irix6* | nonstopux*)
10294         case $cc_basename in
10295           CC)
10296             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10297             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
10298             # CC pic flag -KPIC is the default.
10299             ;;
10300           *)
10301             ;;
10302         esac
10303         ;;
10304       linux*)
10305         case $cc_basename in
10306           KCC)
10307             # KAI C++ Compiler
10308             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
10309             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10310             ;;
10311           icpc)
10312             # Intel C++
10313             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10314             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10315             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
10316             ;; 
10317           cxx)
10318             # Compaq C++
10319             # Make sure the PIC flag is empty.  It appears that all Alpha
10320             # Linux and Compaq Tru64 Unix objects are PIC.
10321             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
10322             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
10323             ;;
10324           *)
10325             ;;
10326         esac
10327         ;;
10328       lynxos*)
10329         ;;
10330       m88k*)
10331         ;;
10332       mvs*)
10333         case $cc_basename in
10334           cxx)
10335             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
10336             ;;
10337           *)
10338             ;;
10339         esac
10340         ;;
10341       netbsd*)
10342         ;;
10343       osf3* | osf4* | osf5*)
10344         case $cc_basename in
10345           KCC)
10346             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
10347             ;;
10348           RCC)
10349             # Rational C++ 2.4.1
10350             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
10351             ;;
10352           cxx)
10353             # Digital/Compaq C++
10354             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10355             # Make sure the PIC flag is empty.  It appears that all Alpha
10356             # Linux and Compaq Tru64 Unix objects are PIC.
10357             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
10358             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
10359             ;;
10360           *)
10361             ;;
10362         esac
10363         ;;
10364       psos*)
10365         ;;
10366       sco*)
10367         case $cc_basename in
10368           CC)
10369             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10370             ;;
10371           *)
10372             ;;
10373         esac
10374         ;;
10375       solaris*)
10376         case $cc_basename in
10377           CC)
10378             # Sun C++ 4.2, 5.x and Centerline C++
10379             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10380             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10381             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
10382             ;;
10383           gcx)
10384             # Green Hills C++ Compiler
10385             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
10386             ;;
10387           *)
10388             ;;
10389         esac
10390         ;;
10391       sunos4*)
10392         case $cc_basename in
10393           CC)
10394             # Sun C++ 4.x
10395             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
10396             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10397             ;;
10398           lcc)
10399             # Lucid
10400             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
10401             ;;
10402           *)
10403             ;;
10404         esac
10405         ;;
10406       tandem*)
10407         case $cc_basename in
10408           NCC)
10409             # NonStop-UX NCC 3.20
10410             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10411             ;;
10412           *)
10413             ;;
10414         esac
10415         ;;
10416       unixware*)
10417         ;;
10418       vxworks*)
10419         ;;
10420       *)
10421         _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
10422         ;;
10423     esac
10424   fi
10425 ],
10426 [
10427   if test "$GCC" = yes; then
10428     _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10429     _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
10430
10431     case $host_os in
10432       aix*)
10433       # All AIX code is PIC.
10434       if test "$host_cpu" = ia64; then
10435         # AIX 5 now supports IA64 processor
10436         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10437       fi
10438       ;;
10439
10440     amigaos*)
10441       # FIXME: we need at least 68020 code to build shared libraries, but
10442       # adding the `-m68020' flag to GCC prevents building anything better,
10443       # like `-m68040'.
10444       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
10445       ;;
10446
10447     beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
10448       # PIC is the default for these OSes.
10449       ;;
10450
10451     mingw* | pw32* | os2*)
10452       # This hack is so that the source file can tell whether it is being
10453       # built for inclusion in a dll (and should export symbols for example).
10454       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
10455       ;;
10456
10457     darwin* | rhapsody*)
10458       # PIC is the default on this platform
10459       # Common symbols not allowed in MH_DYLIB files
10460       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
10461       ;;
10462
10463     msdosdjgpp*)
10464       # Just because we use GCC doesn't mean we suddenly get shared libraries
10465       # on systems that don't support them.
10466       _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
10467       enable_shared=no
10468       ;;
10469
10470     sysv4*MP*)
10471       if test -d /usr/nec; then
10472         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
10473       fi
10474       ;;
10475
10476     hpux*)
10477       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
10478       # not for PA HP-UX.
10479       case "$host_cpu" in
10480       hppa*64*|ia64*)
10481         # +Z the default
10482         ;;
10483       *)
10484         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10485         ;;
10486       esac
10487       ;;
10488
10489     *)
10490       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10491       ;;
10492     esac
10493   else
10494     # PORTME Check for flag to pass linker flags through the system compiler.
10495     case $host_os in
10496     aix*)
10497       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10498       if test "$host_cpu" = ia64; then
10499         # AIX 5 now supports IA64 processor
10500         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10501       else
10502         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
10503       fi
10504       ;;
10505
10506     mingw* | pw32* | os2*)
10507       # This hack is so that the source file can tell whether it is being
10508       # built for inclusion in a dll (and should export symbols for example).
10509       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
10510       ;;
10511
10512     hpux9* | hpux10* | hpux11*)
10513       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10514       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
10515       # not for PA HP-UX.
10516       case "$host_cpu" in
10517       hppa*64*|ia64*)
10518         # +Z the default
10519         ;;
10520       *)
10521         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
10522         ;;
10523       esac
10524       # Is there a better lt_prog_compiler_static that works with the bundled CC?
10525       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
10526       ;;
10527
10528     irix5* | irix6* | nonstopux*)
10529       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10530       # PIC (with -KPIC) is the default.
10531       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
10532       ;;
10533
10534     newsos6)
10535       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10536       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10537       ;;
10538
10539     linux*)
10540       case $CC in
10541       icc* | ecc*)
10542         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10543         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10544         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
10545         ;;
10546       ccc*)
10547         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10548         # All Alpha code is PIC.
10549         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
10550         ;;
10551       esac
10552       ;;
10553
10554     osf3* | osf4* | osf5*)
10555       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10556       # All OSF/1 code is PIC.
10557       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
10558       ;;
10559
10560     sco3.2v5*)
10561       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
10562       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
10563       ;;
10564
10565     solaris*)
10566       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10567       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10568       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10569       ;;
10570
10571     sunos4*)
10572       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
10573       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
10574       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10575       ;;
10576
10577     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
10578       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10579       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10580       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10581       ;;
10582
10583     sysv4*MP*)
10584       if test -d /usr/nec ;then
10585         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
10586         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10587       fi
10588       ;;
10589
10590     uts4*)
10591       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
10592       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10593       ;;
10594
10595     *)
10596       _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
10597       ;;
10598     esac
10599   fi
10600 ])
10601 AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
10602
10603 #
10604 # Check to make sure the PIC flag actually works.
10605 #
10606 if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
10607   AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
10608     _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
10609     [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
10610     [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
10611      "" | " "*) ;;
10612      *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
10613      esac],
10614     [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
10615      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
10616 fi
10617 case "$host_os" in
10618   # For platforms which do not support PIC, -DPIC is meaningless:
10619   *djgpp*)
10620     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
10621     ;;
10622   *)
10623     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
10624     ;;
10625 esac
10626 ])
10627
10628
10629 # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
10630 # ------------------------------------
10631 # See if the linker supports building shared libraries.
10632 AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
10633 [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
10634 ifelse([$1],[CXX],[
10635   _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
10636   case $host_os in
10637   aix4* | aix5*)
10638     # If we're using GNU nm, then we don't want the "-C" option.
10639     # -C means demangle to AIX nm, but means don't demangle with GNU nm
10640     if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
10641       _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'
10642     else
10643       _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'
10644     fi
10645     ;;
10646   pw32*)
10647     _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
10648   ;;
10649   cygwin* | mingw*)
10650     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
10651   ;;
10652   *)
10653     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
10654   ;;
10655   esac
10656 ],[
10657   runpath_var=
10658   _LT_AC_TAGVAR(allow_undefined_flag, $1)=
10659   _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
10660   _LT_AC_TAGVAR(archive_cmds, $1)=
10661   _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
10662   _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
10663   _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
10664   _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
10665   _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
10666   _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
10667   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
10668   _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
10669   _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
10670   _LT_AC_TAGVAR(hardcode_direct, $1)=no
10671   _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
10672   _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
10673   _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
10674   _LT_AC_TAGVAR(hardcode_automatic, $1)=no
10675   _LT_AC_TAGVAR(module_cmds, $1)=
10676   _LT_AC_TAGVAR(module_expsym_cmds, $1)=  
10677   _LT_AC_TAGVAR(always_export_symbols, $1)=no
10678   _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
10679   # include_expsyms should be a list of space-separated symbols to be *always*
10680   # included in the symbol list
10681   _LT_AC_TAGVAR(include_expsyms, $1)=
10682   # exclude_expsyms can be an extended regexp of symbols to exclude
10683   # it will be wrapped by ` (' and `)$', so one must not match beginning or
10684   # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
10685   # as well as any symbol that contains `d'.
10686   _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
10687   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
10688   # platforms (ab)use it in PIC code, but their linkers get confused if
10689   # the symbol is explicitly referenced.  Since portable code cannot
10690   # rely on this symbol name, it's probably fine to never include it in
10691   # preloaded symbol tables.
10692   extract_expsyms_cmds=
10693
10694   case $host_os in
10695   cygwin* | mingw* | pw32*)
10696     # FIXME: the MSVC++ port hasn't been tested in a loooong time
10697     # When not using gcc, we currently assume that we are using
10698     # Microsoft Visual C++.
10699     if test "$GCC" != yes; then
10700       with_gnu_ld=no
10701     fi
10702     ;;
10703   openbsd*)
10704     with_gnu_ld=no
10705     ;;
10706   esac
10707
10708   _LT_AC_TAGVAR(ld_shlibs, $1)=yes
10709   if test "$with_gnu_ld" = yes; then
10710     # If archive_cmds runs LD, not CC, wlarc should be empty
10711     wlarc='${wl}'
10712
10713     # See if GNU ld supports shared libraries.
10714     case $host_os in
10715     aix3* | aix4* | aix5*)
10716       # On AIX/PPC, the GNU linker is very broken
10717       if test "$host_cpu" != ia64; then
10718         _LT_AC_TAGVAR(ld_shlibs, $1)=no
10719         cat <<EOF 1>&2
10720
10721 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
10722 *** to be unable to reliably create shared libraries on AIX.
10723 *** Therefore, libtool is disabling shared libraries support.  If you
10724 *** really care for shared libraries, you may want to modify your PATH
10725 *** so that a non-GNU linker is found, and then restart.
10726
10727 EOF
10728       fi
10729       ;;
10730
10731     amigaos*)
10732       _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)'
10733       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10734       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10735
10736       # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
10737       # that the semantics of dynamic libraries on AmigaOS, at least up
10738       # to version 4, is to share data among multiple programs linked
10739       # with the same dynamic library.  Since this doesn't match the
10740       # behavior of shared libraries on other platforms, we can't use
10741       # them.
10742       _LT_AC_TAGVAR(ld_shlibs, $1)=no
10743       ;;
10744
10745     beos*)
10746       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
10747         _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
10748         # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
10749         # support --undefined.  This deserves some investigation.  FIXME
10750         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
10751       else
10752         _LT_AC_TAGVAR(ld_shlibs, $1)=no
10753       fi
10754       ;;
10755
10756     cygwin* | mingw* | pw32*)
10757       # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
10758       # as there is no search path for DLLs.
10759       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10760       _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
10761       _LT_AC_TAGVAR(always_export_symbols, $1)=no
10762       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10763       _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
10764
10765       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
10766         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
10767         # If the export-symbols file already is a .def file (1st line
10768         # is EXPORTS), use it as is; otherwise, prepend...
10769         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
10770           cp $export_symbols $output_objdir/$soname.def;
10771         else
10772           echo EXPORTS > $output_objdir/$soname.def;
10773           cat $export_symbols >> $output_objdir/$soname.def;
10774         fi~
10775         $CC -shared $output_objdir/$soname.def $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
10776       else
10777         ld_shlibs=no
10778       fi
10779       ;;
10780
10781     netbsd*)
10782       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
10783         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
10784         wlarc=
10785       else
10786         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
10787         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
10788       fi
10789       ;;
10790
10791     solaris* | sysv5*)
10792       if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
10793         _LT_AC_TAGVAR(ld_shlibs, $1)=no
10794         cat <<EOF 1>&2
10795
10796 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
10797 *** create shared libraries on Solaris systems.  Therefore, libtool
10798 *** is disabling shared libraries support.  We urge you to upgrade GNU
10799 *** binutils to release 2.9.1 or newer.  Another option is to modify
10800 *** your PATH or compiler configuration so that the native linker is
10801 *** used, and then restart.
10802
10803 EOF
10804       elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
10805         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
10806         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
10807       else
10808         _LT_AC_TAGVAR(ld_shlibs, $1)=no
10809       fi
10810       ;;
10811
10812     sunos4*)
10813       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
10814       wlarc=
10815       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10816       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10817       ;;
10818
10819     *)
10820       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
10821         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
10822         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
10823       else
10824         _LT_AC_TAGVAR(ld_shlibs, $1)=no
10825       fi
10826       ;;
10827     esac
10828
10829     if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
10830       runpath_var=LD_RUN_PATH
10831       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
10832       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
10833       # ancient GNU ld didn't support --whole-archive et. al.
10834       if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
10835         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
10836       else
10837         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
10838       fi
10839     fi
10840   else
10841     # PORTME fill in a description of your system's linker (not GNU ld)
10842     case $host_os in
10843     aix3*)
10844       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
10845       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
10846       _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'
10847       # Note: this linker hardcodes the directories in LIBPATH if there
10848       # are no directories specified by -L.
10849       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10850       if test "$GCC" = yes && test -z "$link_static_flag"; then
10851         # Neither direct hardcoding nor static linking is supported with a
10852         # broken collect2.
10853         _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
10854       fi
10855       ;;
10856
10857     aix4* | aix5*)
10858       if test "$host_cpu" = ia64; then
10859         # On IA64, the linker does run time linking by default, so we don't
10860         # have to do anything special.
10861         aix_use_runtimelinking=no
10862         exp_sym_flag='-Bexport'
10863         no_entry_flag=""
10864       else
10865         # If we're using GNU nm, then we don't want the "-C" option.
10866         # -C means demangle to AIX nm, but means don't demangle with GNU nm
10867         if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
10868           _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'
10869         else
10870           _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'
10871         fi
10872
10873         # KDE requires run time linking.  Make it the default.
10874         aix_use_runtimelinking=yes
10875         exp_sym_flag='-bexport'
10876         no_entry_flag='-bnoentry'
10877       fi
10878
10879       # When large executables or shared objects are built, AIX ld can
10880       # have problems creating the table of contents.  If linking a library
10881       # or program results in "error TOC overflow" add -mminimal-toc to
10882       # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
10883       # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
10884
10885       _LT_AC_TAGVAR(archive_cmds, $1)=''
10886       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10887       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
10888       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
10889
10890       if test "$GCC" = yes; then
10891         case $host_os in aix4.[012]|aix4.[012].*)
10892         # We only want to do this on AIX 4.2 and lower, the check
10893         # below for broken collect2 doesn't work under 4.3+
10894           collect2name=`${CC} -print-prog-name=collect2`
10895           if test -f "$collect2name" && \
10896            strings "$collect2name" | grep resolve_lib_name >/dev/null
10897           then
10898           # We have reworked collect2
10899           _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10900           else
10901           # We have old collect2
10902           _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
10903           # It fails to find uninstalled libraries when the uninstalled
10904           # path is not listed in the libpath.  Setting hardcode_minus_L
10905           # to unsupported forces relinking
10906           _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10907           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10908           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
10909           fi
10910         esac
10911         shared_flag='-shared'
10912       else
10913         # not using gcc
10914         if test "$host_cpu" = ia64; then
10915         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
10916         # chokes on -Wl,-G. The following line is correct:
10917           shared_flag='-G'
10918         else
10919         if test "$aix_use_runtimelinking" = yes; then
10920             shared_flag='-qmkshrobj ${wl}-G'
10921           else
10922             shared_flag='-qmkshrobj'
10923         fi
10924         fi
10925       fi
10926
10927       # Let the compiler handle the export list.
10928       _LT_AC_TAGVAR(always_export_symbols, $1)=no
10929       if test "$aix_use_runtimelinking" = yes; then
10930         # Warning - without using the other runtime loading flags (-brtl),
10931         # -berok will link without error, but may produce a broken library.
10932         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
10933        # Determine the default libpath from the value encoded in an empty executable.
10934         _LT_AC_SYS_LIBPATH_AIX
10935         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
10936         _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
10937         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
10938        else
10939         if test "$host_cpu" = ia64; then
10940           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
10941           _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
10942           _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
10943         else
10944          # Determine the default libpath from the value encoded in an empty executable.
10945          _LT_AC_SYS_LIBPATH_AIX
10946          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
10947           # Warning - without using the other run time loading flags,
10948           # -berok will link without error, but may produce a broken library.
10949           _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
10950           _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
10951           # -bexpall does not export symbols beginning with underscore (_)
10952           _LT_AC_TAGVAR(always_export_symbols, $1)=yes
10953           # Exported symbols can be pulled into shared objects from archives
10954           _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
10955           _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
10956           # This is similar to how AIX traditionally builds it's shared libraries.
10957           _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $compiler_flags $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
10958         fi
10959       fi
10960       ;;
10961
10962     amigaos*)
10963       _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)'
10964       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10965       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10966       # see comment about different semantics on the GNU ld section
10967       _LT_AC_TAGVAR(ld_shlibs, $1)=no
10968       ;;
10969
10970     bsdi4*)
10971       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
10972       ;;
10973
10974     cygwin* | mingw* | pw32*)
10975       # When not using gcc, we currently assume that we are using
10976       # Microsoft Visual C++.
10977       # hardcode_libdir_flag_spec is actually meaningless, as there is
10978       # no search path for DLLs.
10979       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
10980       _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
10981       # Tell ltmain to make .lib files, not .a files.
10982       libext=lib
10983       # Tell ltmain to make .dll files, not .so files.
10984       shrext=".dll"
10985       # FIXME: Setting linknames here is a bad hack.
10986       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $compiler_flags $libobjs `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
10987       # The linker will automatically build a .lib file if we build a DLL.
10988       _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
10989       # FIXME: Should let the user specify the lib program.
10990       _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
10991       fix_srcfile_path='`cygpath -w "$srcfile"`'
10992       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
10993       ;;
10994
10995     darwin* | rhapsody*)
10996     if test "$GXX" = yes ; then
10997       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
10998       case "$host_os" in
10999       rhapsody* | darwin1.[[012]])
11000         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
11001         ;;
11002       *) # Darwin 1.3 on
11003         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
11004           allow_undefined_flag='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
11005         else
11006           case ${MACOSX_DEPLOYMENT_TARGET} in
11007             10.[012])
11008               allow_undefined_flag='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
11009               ;;
11010             10.*)
11011               allow_undefined_flag='-Wl,-undefined -Wl,dynamic_lookup'
11012               ;;
11013           esac
11014         fi
11015         ;;
11016       esac
11017         lt_int_apple_cc_single_mod=no
11018         output_verbose_link_cmd='echo'
11019         if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
11020           lt_int_apple_cc_single_mod=yes
11021         fi
11022         if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
11023           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
11024         else
11025         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring'
11026       fi
11027       _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
11028       # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
11029         if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
11030           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
11031         else
11032           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $compiler_flags $deplibs -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
11033         fi
11034           _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $compiler_flags $libobjs $deplibs~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
11035       _LT_AC_TAGVAR(hardcode_direct, $1)=no
11036       _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
11037       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
11038       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
11039       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
11040     else  
11041       _LT_AC_TAGVAR(ld_shlibs, $1)=no
11042     fi  
11043       ;;
11044
11045     dgux*)
11046       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11047       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11048       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11049       ;;
11050
11051     freebsd1*)
11052       _LT_AC_TAGVAR(ld_shlibs, $1)=no
11053       ;;
11054
11055     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
11056     # support.  Future versions do this automatically, but an explicit c++rt0.o
11057     # does not break anything, and helps significantly (at the cost of a little
11058     # extra space).
11059     freebsd2.2*)
11060       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
11061       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11062       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11063       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11064       ;;
11065
11066     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
11067     freebsd2*)
11068       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
11069       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11070       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11071       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11072       ;;
11073
11074     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
11075     freebsd*)
11076       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $compiler_flags $libobjs $deplibs'
11077       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11078       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11079       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11080       ;;
11081
11082     hpux9*)
11083       if test "$GCC" = yes; then
11084         _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $compiler_flags $libobjs $deplibs~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
11085       else
11086         _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'
11087       fi
11088       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
11089       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11090       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11091
11092       # hardcode_minus_L: Not really in the search PATH,
11093       # but as the default location of the library.
11094       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11095       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
11096       ;;
11097
11098     hpux10* | hpux11*)
11099       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
11100         case "$host_cpu" in
11101         hppa*64*|ia64*)
11102           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
11103           ;;
11104         *)
11105           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $libobjs $deplibs'
11106           ;;
11107         esac
11108       else
11109         case "$host_cpu" in
11110         hppa*64*|ia64*)
11111           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
11112           ;;
11113         *)
11114           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
11115           ;;
11116         esac
11117       fi
11118       if test "$with_gnu_ld" = no; then
11119         case "$host_cpu" in
11120         hppa*64*)
11121           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
11122           _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
11123           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11124           _LT_AC_TAGVAR(hardcode_direct, $1)=no
11125           _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11126           ;;
11127         ia64*)
11128           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11129           _LT_AC_TAGVAR(hardcode_direct, $1)=no
11130           _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11131
11132           # hardcode_minus_L: Not really in the search PATH,
11133           # but as the default location of the library.
11134           _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11135           ;;
11136         *)
11137           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
11138           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11139           _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11140           _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
11141
11142           # hardcode_minus_L: Not really in the search PATH,
11143           # but as the default location of the library.
11144           _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11145           ;;
11146         esac
11147       fi
11148       ;;
11149
11150     irix5* | irix6* | nonstopux*)
11151       if test "$GCC" = yes; then
11152         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
11153       else
11154         _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'
11155         _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
11156       fi
11157       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11158       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11159       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
11160       ;;
11161
11162     netbsd*)
11163       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
11164         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
11165       else
11166         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
11167       fi
11168       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11169       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11170       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11171       ;;
11172
11173     newsos6)
11174       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11175       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11176       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11177       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11178       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11179       ;;
11180
11181     openbsd*)
11182       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11183       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11184       if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
11185         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
11186         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
11187         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
11188       else
11189        case $host_os in
11190          openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
11191            _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
11192            _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11193            ;;
11194          *)
11195            _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
11196            _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
11197            ;;
11198        esac
11199       fi
11200       ;;
11201
11202     os2*)
11203       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11204       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11205       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
11206       _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 $compiler_flags $libobjs $deplibs$output_objdir/$libname.def'
11207       _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
11208       ;;
11209
11210     osf3*)
11211       if test "$GCC" = yes; then
11212         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
11213         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
11214       else
11215         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
11216         _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'
11217       fi
11218       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11219       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11220       ;;
11221
11222     osf4* | osf5*)      # as osf3* with the addition of -msym flag
11223       if test "$GCC" = yes; then
11224         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
11225         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $compiler_flags $libobjs $deplibs ${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'
11226         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11227       else
11228         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
11229         _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'
11230         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
11231         $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'
11232
11233         # Both c and cxx compiler support -rpath directly
11234         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
11235       fi
11236       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11237       ;;
11238
11239     sco3.2v5*)
11240       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11241       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11242       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
11243       runpath_var=LD_RUN_PATH
11244       hardcode_runpath_var=yes
11245       ;;
11246
11247     solaris*)
11248       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
11249       if test "$GCC" = yes; then
11250         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
11251         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
11252           $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs~$rm $lib.exp'
11253       else
11254         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
11255         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
11256         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
11257       fi
11258       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11259       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11260       case $host_os in
11261       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
11262       *) # Supported since Solaris 2.6 (maybe 2.5.1?)
11263         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
11264       esac
11265       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
11266       ;;
11267
11268     sunos4*)
11269       if test "x$host_vendor" = xsequent; then
11270         # Use $CC to link under sequent, because it throws in some extra .o
11271         # files that make .init and .fini sections work.
11272         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $compiler_flags $libobjs $deplibs'
11273       else
11274         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
11275       fi
11276       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11277       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11278       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11279       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11280       ;;
11281
11282     sysv4)
11283       case $host_vendor in
11284         sni)
11285           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11286           _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
11287         ;;
11288         siemens)
11289           ## LD is ld it makes a PLAMLIB
11290           ## CC just makes a GrossModule.
11291           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
11292           _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
11293           _LT_AC_TAGVAR(hardcode_direct, $1)=no
11294         ;;
11295         motorola)
11296           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11297           _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
11298         ;;
11299       esac
11300       runpath_var='LD_RUN_PATH'
11301       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11302       ;;
11303
11304     sysv4.3*)
11305       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11306       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11307       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
11308       ;;
11309
11310     sysv4*MP*)
11311       if test -d /usr/nec; then
11312         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11313         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11314         runpath_var=LD_RUN_PATH
11315         hardcode_runpath_var=yes
11316         _LT_AC_TAGVAR(ld_shlibs, $1)=yes
11317       fi
11318       ;;
11319
11320     sysv4.2uw2*)
11321       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
11322       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11323       _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
11324       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11325       hardcode_runpath_var=yes
11326       runpath_var=LD_RUN_PATH
11327       ;;
11328
11329    sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
11330       _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
11331       if test "$GCC" = yes; then
11332         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
11333       else
11334         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
11335       fi
11336       runpath_var='LD_RUN_PATH'
11337       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11338       ;;
11339
11340     sysv5*)
11341       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
11342       # $CC -shared without GNU ld will not create a library from C++
11343       # object files and a static libstdc++, better avoid it by now
11344       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
11345       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
11346                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
11347       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
11348       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11349       runpath_var='LD_RUN_PATH'
11350       ;;
11351
11352     uts4*)
11353       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11354       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11355       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11356       ;;
11357
11358     *)
11359       _LT_AC_TAGVAR(ld_shlibs, $1)=no
11360       ;;
11361     esac
11362   fi
11363 ])
11364 AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
11365 test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
11366
11367 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
11368 if test "$GCC" = yes; then
11369   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
11370 fi
11371
11372 #
11373 # Do we need to explicitly link libc?
11374 #
11375 case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
11376 x|xyes)
11377   # Assume -lc should be added
11378   _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
11379
11380   if test "$enable_shared" = yes && test "$GCC" = yes; then
11381     case $_LT_AC_TAGVAR(archive_cmds, $1) in
11382     *'~'*)
11383       # FIXME: we may have to deal with multi-command sequences.
11384       ;;
11385     '$CC '*)
11386       # Test whether the compiler implicitly links with -lc since on some
11387       # systems, -lgcc has to come before -lc. If gcc already passes -lc
11388       # to ld, don't add -lc before -lgcc.
11389       AC_MSG_CHECKING([whether -lc should be explicitly linked in])
11390       $rm conftest*
11391       printf "$lt_simple_compile_test_code" > conftest.$ac_ext
11392   
11393       if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
11394         soname=conftest
11395         lib=conftest
11396         libobjs=conftest.$ac_objext
11397         deplibs=
11398         wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
11399         compiler_flags=-v
11400         linker_flags=-v
11401         verstring=
11402         output_objdir=.
11403         libname=conftest
11404         lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
11405         _LT_AC_TAGVAR(allow_undefined_flag, $1)=
11406         if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
11407         then
11408           _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
11409         else
11410           _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
11411         fi
11412         _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
11413       else
11414         cat conftest.err 1>&5
11415       fi
11416       $rm conftest*
11417       AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
11418       ;;
11419     esac
11420   fi
11421   ;;
11422 esac
11423 ])# AC_LIBTOOL_PROG_LD_SHLIBS
11424
11425
11426 # _LT_AC_FILE_LTDLL_C
11427 # -------------------
11428 # Be careful that the start marker always follows a newline.
11429 AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
11430 # /* ltdll.c starts here */
11431 # #define WIN32_LEAN_AND_MEAN
11432 # #include <windows.h>
11433 # #undef WIN32_LEAN_AND_MEAN
11434 # #include <stdio.h>
11435 #
11436 # #ifndef __CYGWIN__
11437 # #  ifdef __CYGWIN32__
11438 # #    define __CYGWIN__ __CYGWIN32__
11439 # #  endif
11440 # #endif
11441 #
11442 # #ifdef __cplusplus
11443 # extern "C" {
11444 # #endif
11445 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
11446 # #ifdef __cplusplus
11447 # }
11448 # #endif
11449 #
11450 # #ifdef __CYGWIN__
11451 # #include <cygwin/cygwin_dll.h>
11452 # DECLARE_CYGWIN_DLL( DllMain );
11453 # #endif
11454 # HINSTANCE __hDllInstance_base;
11455 #
11456 # BOOL APIENTRY
11457 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
11458 # {
11459 #   __hDllInstance_base = hInst;
11460 #   return TRUE;
11461 # }
11462 # /* ltdll.c ends here */
11463 ])# _LT_AC_FILE_LTDLL_C
11464
11465
11466 # _LT_AC_TAGVAR(VARNAME, [TAGNAME])
11467 # ---------------------------------
11468 AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
11469
11470
11471 # old names
11472 AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
11473 AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
11474 AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
11475 AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
11476 AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
11477 AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
11478 AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
11479
11480 # This is just to silence aclocal about the macro not being used
11481 ifelse([AC_DISABLE_FAST_INSTALL])
11482
11483 AC_DEFUN([LT_AC_PROG_GCJ],
11484 [AC_CHECK_TOOL(GCJ, gcj, no)
11485   test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
11486   AC_SUBST(GCJFLAGS)
11487 ])
11488
11489 AC_DEFUN([LT_AC_PROG_RC],
11490 [AC_CHECK_TOOL(RC, windres, no)
11491 ])
11492
11493 ############################################################
11494 # NOTE: This macro has been submitted for inclusion into   #
11495 #  GNU Autoconf as AC_PROG_SED.  When it is available in   #
11496 #  a released version of Autoconf we should remove this    #
11497 #  macro and use it instead.                               #
11498 ############################################################
11499 # LT_AC_PROG_SED
11500 # --------------
11501 # Check for a fully-functional sed program, that truncates
11502 # as few characters as possible.  Prefer GNU sed if found.
11503 AC_DEFUN([LT_AC_PROG_SED],
11504 [AC_MSG_CHECKING([for a sed that does not truncate output])
11505 AC_CACHE_VAL(lt_cv_path_SED,
11506 [# Loop through the user's path and test for sed and gsed.
11507 # Then use that list of sed's as ones to test for truncation.
11508 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11509 for as_dir in $PATH
11510 do
11511   IFS=$as_save_IFS
11512   test -z "$as_dir" && as_dir=.
11513   for lt_ac_prog in sed gsed; do
11514     for ac_exec_ext in '' $ac_executable_extensions; do
11515       if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
11516         lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
11517       fi
11518     done
11519   done
11520 done
11521 lt_ac_max=0
11522 lt_ac_count=0
11523 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
11524 # along with /bin/sed that truncates output.
11525 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
11526   test ! -f $lt_ac_sed && break
11527   cat /dev/null > conftest.in
11528   lt_ac_count=0
11529   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
11530   # Check for GNU sed and select it if it is found.
11531   if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
11532     lt_cv_path_SED=$lt_ac_sed
11533     break
11534   fi
11535   while true; do
11536     cat conftest.in conftest.in >conftest.tmp
11537     mv conftest.tmp conftest.in
11538     cp conftest.in conftest.nl
11539     echo >>conftest.nl
11540     $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
11541     cmp -s conftest.out conftest.nl || break
11542     # 10000 chars as input seems more than enough
11543     test $lt_ac_count -gt 10 && break
11544     lt_ac_count=`expr $lt_ac_count + 1`
11545     if test $lt_ac_count -gt $lt_ac_max; then
11546       lt_ac_max=$lt_ac_count
11547       lt_cv_path_SED=$lt_ac_sed
11548     fi
11549   done
11550 done
11551 ])
11552 SED=$lt_cv_path_SED
11553 AC_MSG_RESULT([$SED])
11554 ])