Add walkgirl (external).
[amarok_sonynw.git] / acinclude.m4
bloba0ff2564872434338a9c2b43d71b3c41e510a12d
1 ##   -*- autoconf -*-
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)
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.
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.
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., 51 Franklin Street, Fifth Floor,
20 dnl    Boston, MA 02110-1301, USA.
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.
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],
34 AC_REQUIRE([KDE_CHECK_LIB64])
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
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
89 if test "$ac_x_libraries" = NO; then
90   # Check for the libraries.
92   test -z "$x_direct_test_library" && x_direct_test_library=Xt
93   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
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     ; \
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
155 dnl ------------------------------------------------------------------------
156 dnl Find a file (or one of more files in a list of dirs)
157 dnl ------------------------------------------------------------------------
159 AC_DEFUN([AC_FIND_FILE],
161 $3=NO
162 for i in $2;
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
176 dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs,
177 dnl     if-not-found, test-parameter, prepend-path)
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],
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_%'`
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
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
224         eval "kde_cv_path_$kde_cache=$kde_cv_path"
226         ])
228       eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
230    fi
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
239    fi
242 AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
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.
254 AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
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.
267 AC_DEFUN([KDE_CHECK_UIC_FLAG],
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>
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     ])
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
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 ------------------------------------------------------------------------
302 AC_DEFUN([AC_PATH_QT_MOC_UIC],
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
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
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)
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
339    AC_SUBST(MOC)
340    AC_SUBST(UIC)
342    UIC_TR="i18n"
343    if test $kde_qtver = 3; then
344      UIC_TR="tr2i18n"
345    fi
347    AC_SUBST(UIC_TR)
350 AC_DEFUN([KDE_1_CHECK_PATHS],
352   KDE_1_CHECK_PATH_HEADERS
354   KDE_TEST_RPATH=
356   if test -n "$USE_RPATH"; then
358      if test -n "$kde_libraries"; then
359        KDE_TEST_RPATH="-R $kde_libraries"
360      fi
362      if test -n "$qt_libraries"; then
363        KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
364      fi
366      if test -n "$x_libraries"; then
367        KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
368      fi
370      KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
371   fi
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'
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.])
385 if eval `KDEDIR= ./conftest 2>&5`; then
386   kde_result=done
387 else
388   kde_result=problems
391 KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
392 kde_have_all_paths=yes
394 KDE_SET_PATHS($kde_result)
398 AC_DEFUN([KDE_SET_PATHS],
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"
426 AC_DEFUN([KDE_SET_DEFAULT_PATHS],
428 if test "$1" = "default"; then
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
501   KDE_SET_PATHS(defaults)
503 else
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
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
532 AC_DEFUN([KDE_MISSING_PROG_ERROR],
534     AC_MSG_ERROR([The important program $1 was not found!
535 Please check whether you installed KDE correctly.
539 AC_DEFUN([KDE_MISSING_ARTS_ERROR],
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).
547 AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
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
561 AC_DEFUN([KDE_SUBST_PROGRAMS],
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
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])
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; then
594                 kde33ornewer=
595               fi
596               if test "$KDECONFIG" != "compiled"; then
597                 if test `$KDECONFIG --version | grep KDE | sed 's/KDE: \(...\).*/\1/'` = 3.2; then
598                   kde33ornewer=
599                 fi
600               fi
601             fi
602         fi
604         if test -n "$kde32ornewer"; then
605             KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)])
606             KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
607         fi
608         if test -n "$kde33ornewer"; then
609             KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)])
610             AC_SUBST(MAKEKDEWIDGETS)
611         fi
612         KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
614         if test -n "$MEINPROC" -a "$MEINPROC" != "compiled"; then
615             kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
616             test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
617             AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
618             if test "$KDE_XSL_STYLESHEET" = "NO"; then
619                 KDE_XSL_STYLESHEET=""
620             else
621                 KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
622             fi
623         fi
625         DCOP_DEPENDENCIES='$(DCOPIDL)'
626         if test -n "$kde32ornewer"; then
627             KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
628             DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
629             AC_SUBST(KCONFIG_COMPILER)
630             AC_SUBST(KCFG_DEPENDENCIES)
631             AC_SUBST(DCOPIDLNG)
632         fi
633         AC_SUBST(DCOPIDL)
634         AC_SUBST(DCOPIDL2CPP)
635         AC_SUBST(DCOP_DEPENDENCIES)
636         AC_SUBST(MCOPIDL)
637         AC_SUBST(ARTSCCONFIG)
638         AC_SUBST(MEINPROC)
639         AC_SUBST(KDE_XSL_STYLESHEET)
640         AC_SUBST(XMLLINT)
641 ])dnl
643 AC_DEFUN([AC_CREATE_KFSSTND],
645 AC_REQUIRE([AC_CHECK_RPATH])
647 AC_MSG_CHECKING([for KDE paths])
648 kde_result=""
649 kde_cached_paths=yes
650 AC_CACHE_VAL(kde_cv_all_paths,
652   KDE_SET_DEFAULT_PATHS($1)
653   kde_cached_paths=no
655 eval "$kde_cv_all_paths"
656 KDE_CHECK_PATHS_FOR_COMPLETENESS
657 if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
658   # wrong values were cached, may be, we can set better ones
659   kde_result=
660   kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
661   kde_datadir= kde_locale=  kde_cgidir=  kde_confdir= kde_kcfgdir=
662   kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
663   kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
664   kde_have_all_paths=
665   kde_styledir=
666   kde_widgetdir=
667   xdg_appsdir = xdg_menudir= xdg_directorydir= 
668   KDE_SET_DEFAULT_PATHS($1)
669   eval "$kde_cv_all_paths"
670   KDE_CHECK_PATHS_FOR_COMPLETENESS
671   kde_result="$kde_result (cache overridden)"
673 if test "$kde_have_all_paths" = "no"; then
674   AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
675 Since it had compiled and linked before, it must be a strange problem on your system.
676 Look at config.log for details. If you are not able to fix this, look at
677 http://www.kde.org/faq/installation.html or any www.kde.org mirror.
678 (If you're using an egcs version on Linux, you may update binutils!)
680 else
681   rm -f conftest*
682   AC_MSG_RESULT($kde_result)
685 bindir=$kde_bindir
687 KDE_SUBST_PROGRAMS
691 AC_DEFUN([AC_SUBST_KFSSTND],
693 AC_SUBST(kde_htmldir)
694 AC_SUBST(kde_appsdir)
695 AC_SUBST(kde_icondir)
696 AC_SUBST(kde_sounddir)
697 AC_SUBST(kde_datadir)
698 AC_SUBST(kde_locale)
699 AC_SUBST(kde_confdir)
700 AC_SUBST(kde_kcfgdir)
701 AC_SUBST(kde_mimedir)
702 AC_SUBST(kde_wallpaperdir)
703 AC_SUBST(kde_bindir)
704 dnl X Desktop Group standards
705 AC_SUBST(xdg_appsdir)
706 AC_SUBST(xdg_menudir)
707 AC_SUBST(xdg_directorydir)
708 dnl for KDE 2
709 AC_SUBST(kde_templatesdir)
710 AC_SUBST(kde_servicesdir)
711 AC_SUBST(kde_servicetypesdir)
712 AC_SUBST(kde_moduledir)
713 AC_SUBST(kdeinitdir, '$(kde_moduledir)')
714 AC_SUBST(kde_styledir)
715 AC_SUBST(kde_widgetdir)
716 if test "$kde_qtver" = 1; then
717   kde_minidir="$kde_icondir/mini"
718 else
719 # for KDE 1 - this breaks KDE2 apps using minidir, but
720 # that's the plan ;-/
721   kde_minidir="/dev/null"
723 dnl AC_SUBST(kde_minidir)
724 dnl AC_SUBST(kde_cgidir)
725 dnl AC_SUBST(kde_toolbardir)
728 AC_DEFUN([KDE_MISC_TESTS],
730    dnl Checks for libraries.
731    AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD 
732    AC_SUBST(LIBUTIL)
733    AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
734    AC_SUBST(LIBCOMPAT)
735    kde_have_crypt=
736    AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
737       AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
738         AC_MSG_WARN([you have no crypt in either libcrypt or libc.
739 You should install libcrypt from another source or configure with PAM
740 support])
741         kde_have_crypt=no
742       ]))
743    AC_SUBST(LIBCRYPT)
744    if test $kde_have_crypt = yes; then
745       AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
746    fi
747    AC_CHECK_SOCKLEN_T
748    AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
749    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
750       AC_CHECK_LIB(dnet_stub, dnet_ntoa,
751         [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
752    fi
753    AC_CHECK_FUNC(inet_ntoa)
754    if test $ac_cv_func_inet_ntoa = no; then
755      AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
756    fi
757    AC_CHECK_FUNC(connect)
758    if test $ac_cv_func_connect = no; then
759       AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
760         $X_EXTRA_LIBS)
761    fi
763    AC_CHECK_FUNC(remove)
764    if test $ac_cv_func_remove = no; then
765       AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
766    fi
768    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
769    AC_CHECK_FUNC(shmat, ,
770      AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
771    
772    # more headers that need to be explicitly included on darwin
773    AC_CHECK_HEADERS(sys/types.h stdint.h)
775    # sys/bitypes.h is needed for uint32_t and friends on Tru64
776    AC_CHECK_HEADERS(sys/bitypes.h)
778    # darwin requires a poll emulation library
779    AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
781    # for some image handling on Mac OS X
782    AC_CHECK_HEADERS(Carbon/Carbon.h)
784    # CoreAudio framework
785    AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
786      AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
787      FRAMEWORK_COREAUDIO="-Wl,-framework,CoreAudio"
788    ])
790    AC_CHECK_RES_INIT
791    AC_SUBST(LIB_POLL)
792    AC_SUBST(FRAMEWORK_COREAUDIO)
793    LIBSOCKET="$X_EXTRA_LIBS"
794    AC_SUBST(LIBSOCKET)
795    AC_SUBST(X_EXTRA_LIBS)
796    AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
797    AC_SUBST(LIBUCB)
799    case $host in  dnl this *is* LynxOS specific
800    *-*-lynxos* )
801         AC_MSG_CHECKING([LynxOS header file wrappers])
802         [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
803         AC_MSG_RESULT(disabled)
804         AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
805          ;;
806     esac
808    KDE_CHECK_TYPES
809    KDE_CHECK_LIBDL
810    KDE_CHECK_STRLCPY
811    KDE_CHECK_PIE_SUPPORT
813 # darwin needs this to initialize the environment
814 AC_CHECK_HEADERS(crt_externs.h)
815 AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
817 AH_VERBATIM(_DARWIN_ENVIRON,
819 #if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
820 # include <sys/time.h>
821 # include <crt_externs.h>
822 # define environ (*_NSGetEnviron())
823 #endif
826 AH_VERBATIM(_AIX_STRINGS_H_BZERO,
829  * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
830  * that defines bzero.
831  */
833 #if defined(_AIX)
834 #include <strings.h>
835 #endif
838 AC_CHECK_FUNCS([vsnprintf snprintf])
840 AH_VERBATIM(_TRU64,[
842  * On HP-UX, the declaration of vsnprintf() is needed every time !
843  */
845 #if !defined(HAVE_VSNPRINTF) || defined(hpux)
846 #if __STDC__
847 #include <stdarg.h>
848 #include <stdlib.h>
849 #else
850 #include <varargs.h>
851 #endif
852 #ifdef __cplusplus
853 extern "C"
854 #endif
855 int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
856 #ifdef __cplusplus
857 extern "C"
858 #endif
859 int snprintf(char *str, size_t n, char const *fmt, ...);
860 #endif
865 dnl ------------------------------------------------------------------------
866 dnl Find the header files and libraries for X-Windows. Extended the
867 dnl macro AC_PATH_X
868 dnl ------------------------------------------------------------------------
870 AC_DEFUN([K_PATH_X],
872 AC_REQUIRE([KDE_MISC_TESTS])dnl
873 AC_REQUIRE([KDE_CHECK_LIB64])
875 AC_ARG_ENABLE(
876   embedded,
877   AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
878   kde_use_qt_emb=$enableval,
879   kde_use_qt_emb=no
882 AC_ARG_ENABLE(
883   qtopia,
884   AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
885   kde_use_qt_emb_palm=$enableval,
886   kde_use_qt_emb_palm=no
889 AC_ARG_ENABLE(
890   mac,
891   AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
892   kde_use_qt_mac=$enableval,
893   kde_use_qt_mac=no
896 # used to disable x11-specific stuff on special platforms
897 AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
899 if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
901 AC_MSG_CHECKING(for X)
903 AC_CACHE_VAL(kde_cv_have_x,
904 [# One or both of the vars are not set, and there is no cached value.
905 if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
906    kde_x_includes=NO
907 else
908    kde_x_includes=$x_includes
910 if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
911    kde_x_libraries=NO
912 else
913    kde_x_libraries=$x_libraries
916 # below we use the standard autoconf calls
917 ac_x_libraries=$kde_x_libraries
918 ac_x_includes=$kde_x_includes
920 KDE_PATH_X_DIRECT
921 dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
922 dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
923 dnl location. The correct location is /usr/lib32 or an undefined value
924 dnl (the linker is smart enough to pick the correct default library).
925 dnl Things work just fine if you use just AC_PATH_X_DIRECT.
926 dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
927 dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
928 dnl x_includes should be left alone.
929 case "$host" in
930 mips-sgi-irix6*)
931   ;;
932 *-*-solaris*)
933   ;;
935   _AC_PATH_X_XMKMF
936   if test -z "$ac_x_includes"; then
937     ac_x_includes="."
938   fi
939   if test -z "$ac_x_libraries"; then
940     ac_x_libraries="/usr/lib${kdelibsuff}"
941   fi
942 esac
943 #from now on we use our own again
945 # when the user already gave --x-includes, we ignore
946 # what the standard autoconf macros told us.
947 if test "$kde_x_includes" = NO; then
948   kde_x_includes=$ac_x_includes
951 # for --x-libraries too
952 if test "$kde_x_libraries" = NO; then
953   kde_x_libraries=$ac_x_libraries
956 if test "$kde_x_includes" = NO; then
957   AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
960 if test "$kde_x_libraries" = NO; then
961   AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
964 # Record where we found X for the cache.
965 kde_cv_have_x="have_x=yes \
966          kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
967 ])dnl
969 eval "$kde_cv_have_x"
971 if test "$have_x" != yes; then
972   AC_MSG_RESULT($have_x)
973   no_x=yes
974 else
975   AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
978 if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
979   X_INCLUDES=""
980   x_includes="."; dnl better than nothing :-
981  else
982   x_includes=$kde_x_includes
983   X_INCLUDES="-I$x_includes"
986 if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE || test "$kde_x_libraries" = "/usr/lib"; then
987   X_LDFLAGS=""
988   x_libraries="/usr/lib"; dnl better than nothing :-
989  else
990   x_libraries=$kde_x_libraries
991   X_LDFLAGS="-L$x_libraries"
993 all_includes="$X_INCLUDES"
994 all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
996 # Check for libraries that X11R6 Xt/Xaw programs need.
997 ac_save_LDFLAGS="$LDFLAGS"
998 LDFLAGS="$LDFLAGS $X_LDFLAGS"
999 # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
1000 # check for ICE first), but we must link in the order -lSM -lICE or
1001 # we get undefined symbols.  So assume we have SM if we have ICE.
1002 # These have to be linked with before -lX11, unlike the other
1003 # libraries we check for below, so use a different variable.
1004 #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
1005 AC_CHECK_LIB(ICE, IceConnectionNumber,
1006   [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
1007 LDFLAGS="$ac_save_LDFLAGS"
1009 LIB_X11='-lX11 $(LIBSOCKET)'
1011 AC_MSG_CHECKING(for libXext)
1012 AC_CACHE_VAL(kde_cv_have_libXext,
1014 kde_ldflags_safe="$LDFLAGS"
1015 kde_libs_safe="$LIBS"
1017 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
1018 LIBS="-lXext -lX11 $LIBSOCKET"
1020 AC_TRY_LINK([
1021 #include <stdio.h>
1022 #ifdef STDC_HEADERS
1023 # include <stdlib.h>
1024 #endif
1027 printf("hello Xext\n");
1029 kde_cv_have_libXext=yes,
1030 kde_cv_have_libXext=no
1033 LDFLAGS=$kde_ldflags_safe
1034 LIBS=$kde_libs_safe
1037 AC_MSG_RESULT($kde_cv_have_libXext)
1039 if test "$kde_cv_have_libXext" = "no"; then
1040   AC_MSG_ERROR([We need a working libXext to proceed. Since configure
1041 can't find it itself, we stop here assuming that make wouldn't find
1042 them either.])
1045 LIB_XEXT="-lXext"
1046 QTE_NORTTI=""
1048 elif test "$kde_use_qt_emb" = "yes"; then
1049   dnl We're using QT Embedded
1050   CPPFLAGS=-DQWS
1051   CXXFLAGS="$CXXFLAGS -fno-rtti"
1052   QTE_NORTTI="-fno-rtti -DQWS"
1053   X_PRE_LIBS=""
1054   LIB_X11=""
1055   LIB_XEXT=""
1056   LIB_XRENDER=""
1057   LIBSM=""
1058   X_INCLUDES=""
1059   X_LDFLAGS=""
1060   x_includes=""
1061   x_libraries=""
1062 elif test "$kde_use_qt_mac" = "yes"; then
1063   dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
1064   dnl be included to get the information) --Sam
1065   CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
1066   CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
1067   X_PRE_LIBS=""
1068   LIB_X11=""
1069   LIB_XEXT=""
1070   LIB_XRENDER=""
1071   LIBSM=""
1072   X_INCLUDES=""
1073   X_LDFLAGS=""
1074   x_includes=""
1075   x_libraries=""
1077 AC_SUBST(X_PRE_LIBS)
1078 AC_SUBST(LIB_X11)
1079 AC_SUBST(LIB_XRENDER)
1080 AC_SUBST(LIBSM)
1081 AC_SUBST(X_INCLUDES)
1082 AC_SUBST(X_LDFLAGS)
1083 AC_SUBST(x_includes)
1084 AC_SUBST(x_libraries)
1085 AC_SUBST(QTE_NORTTI)
1086 AC_SUBST(LIB_XEXT)
1090 AC_DEFUN([KDE_PRINT_QT_PROGRAM],
1092 AC_REQUIRE([KDE_USE_QT])
1093 cat > conftest.$ac_ext <<EOF
1094 #include "confdefs.h"
1095 #include <qglobal.h>
1096 #include <qapplication.h>
1098 if test "$kde_qtver" = "2"; then
1099 cat >> conftest.$ac_ext <<EOF
1100 #include <qevent.h>
1101 #include <qstring.h>
1102 #include <qstyle.h>
1105 if test $kde_qtsubver -gt 0; then
1106 cat >> conftest.$ac_ext <<EOF
1107 #if QT_VERSION < 210
1108 #error 1
1109 #endif
1114 if test "$kde_qtver" = "3"; then
1115 cat >> conftest.$ac_ext <<EOF
1116 #include <qcursor.h>
1117 #include <qstylefactory.h>
1118 #include <private/qucomextra_p.h>
1122 echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
1123 cat >> conftest.$ac_ext <<EOF
1124 #error 1
1125 #endif
1127 int main() {
1129 if test "$kde_qtver" = "2"; then
1130 cat >> conftest.$ac_ext <<EOF
1131     QStringList *t = new QStringList();
1132     Q_UNUSED(t);
1134 if test $kde_qtsubver -gt 0; then
1135 cat >> conftest.$ac_ext <<EOF
1136     QString s;
1137     s.setLatin1("Elvis is alive", 14);
1141 if test "$kde_qtver" = "3"; then
1142 cat >> conftest.$ac_ext <<EOF
1143     (void)QStyleFactory::create(QString::null);
1144     QCursor c(Qt::WhatsThisCursor);
1147 cat >> conftest.$ac_ext <<EOF
1148     return 0;
1153 AC_DEFUN([KDE_USE_QT],
1155 if test -z "$1"; then
1156   # Current default Qt version: 3.3
1157   kde_qtver=3
1158   kde_qtsubver=3
1159 else
1160   kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
1161   # following is the check if subversion isnt found in passed argument
1162   if test "$kde_qtsubver" = "$1"; then
1163     kde_qtsubver=1
1164   fi
1165   kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
1166   if test "$kde_qtver" = "1"; then
1167     kde_qtsubver=42
1168   fi
1171 if test -z "$2"; then
1172   if test "$kde_qtver" = "2"; then
1173     if test $kde_qtsubver -gt 0; then
1174       kde_qt_minversion=">= Qt 2.2.2"
1175     else
1176       kde_qt_minversion=">= Qt 2.0.2"
1177     fi
1178   fi
1179   if test "$kde_qtver" = "3"; then
1180     if test $kde_qtsubver -gt 0; then
1181          if test $kde_qtsubver -gt 1; then
1182             if test $kde_qtsubver -gt 2; then
1183                 kde_qt_minversion=">= Qt 3.3 and < 4.0"
1184             else
1185                 kde_qt_minversion=">= Qt 3.2 and < 4.0"
1186             fi
1187          else
1188             kde_qt_minversion=">= Qt 3.1 (20021021) and < 4.0"
1189          fi
1190     else
1191       kde_qt_minversion=">= Qt 3.0 and < 4.0"
1192     fi
1193   fi
1194   if test "$kde_qtver" = "1"; then
1195     kde_qt_minversion=">= 1.42 and < 2.0"
1196   fi
1197 else
1198    kde_qt_minversion="$2"
1201 if test -z "$3"; then
1202    if test $kde_qtver = 3; then
1203      if test $kde_qtsubver -gt 0; then
1204        kde_qt_verstring="QT_VERSION >= 0x03@VER@00 && QT_VERSION < 0x040000"
1205        qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
1206        kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
1207      else
1208        kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000"
1209      fi
1210    fi
1211    if test $kde_qtver = 2; then
1212      if test $kde_qtsubver -gt 0; then
1213        kde_qt_verstring="QT_VERSION >= 222"
1214      else
1215        kde_qt_verstring="QT_VERSION >= 200"
1216      fi
1217    fi
1218    if test $kde_qtver = 1; then
1219     kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
1220    fi
1221 else
1222    kde_qt_verstring="$3"
1225 if test $kde_qtver = 4; then
1226   kde_qt_dirs="$QTDIR /usr/lib/qt4 /usr/lib/qt /usr/share/qt4"
1228 if test $kde_qtver = 3; then
1229   kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3"
1231 if test $kde_qtver = 2; then
1232    kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
1234 if test $kde_qtver = 1; then
1235    kde_qt_dirs="$QTDIR /usr/lib/qt"
1239 AC_DEFUN([KDE_CHECK_QT_DIRECT],
1241 AC_REQUIRE([KDE_USE_QT])
1242 AC_MSG_CHECKING([if Qt compiles without flags])
1243 AC_CACHE_VAL(kde_cv_qt_direct,
1245 AC_LANG_SAVE
1246 AC_LANG_CPLUSPLUS
1247 ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
1248 ac_LIBRARY_PATH="$LIBRARY_PATH"
1249 ac_cxxflags_safe="$CXXFLAGS"
1250 ac_ldflags_safe="$LDFLAGS"
1251 ac_libs_safe="$LIBS"
1253 CXXFLAGS="$CXXFLAGS -I$qt_includes"
1254 LDFLAGS="$LDFLAGS $X_LDFLAGS"
1255 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1256 LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
1257 else
1258 LIBS="$LIBQT $LIBSOCKET"
1260 LD_LIBRARY_PATH=
1261 export LD_LIBRARY_PATH
1262 LIBRARY_PATH=
1263 export LIBRARY_PATH
1265 KDE_PRINT_QT_PROGRAM
1267 if AC_TRY_EVAL(ac_link) && test -s conftest; then
1268   kde_cv_qt_direct="yes"
1269 else
1270   kde_cv_qt_direct="no"
1271   echo "configure: failed program was:" >&AC_FD_CC
1272   cat conftest.$ac_ext >&AC_FD_CC
1275 rm -f conftest*
1276 CXXFLAGS="$ac_cxxflags_safe"
1277 LDFLAGS="$ac_ldflags_safe"
1278 LIBS="$ac_libs_safe"
1280 LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
1281 export LD_LIBRARY_PATH
1282 LIBRARY_PATH="$ac_LIBRARY_PATH"
1283 export LIBRARY_PATH
1284 AC_LANG_RESTORE
1287 if test "$kde_cv_qt_direct" = "yes"; then
1288   AC_MSG_RESULT(yes)
1289   $1
1290 else
1291   AC_MSG_RESULT(no)
1292   $2
1296 dnl ------------------------------------------------------------------------
1297 dnl Try to find the Qt headers and libraries.
1298 dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
1299 dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
1300 dnl ------------------------------------------------------------------------
1302 AC_DEFUN([AC_PATH_QT_1_3],
1304 AC_REQUIRE([K_PATH_X])
1305 AC_REQUIRE([KDE_USE_QT])
1306 AC_REQUIRE([KDE_CHECK_LIB64])
1308 dnl ------------------------------------------------------------------------
1309 dnl Add configure flag to enable linking to MT version of Qt library.
1310 dnl ------------------------------------------------------------------------
1312 AC_ARG_ENABLE(
1313   mt,
1314   AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]),
1315   kde_use_qt_mt=$enableval,
1316   [
1317     if test $kde_qtver = 3; then
1318       kde_use_qt_mt=yes
1319     else
1320       kde_use_qt_mt=no
1321     fi
1322   ]
1325 USING_QT_MT=""
1327 dnl ------------------------------------------------------------------------
1328 dnl If we not get --disable-qt-mt then adjust some vars for the host.
1329 dnl ------------------------------------------------------------------------
1331 KDE_MT_LDFLAGS=
1332 KDE_MT_LIBS=
1333 if test "x$kde_use_qt_mt" = "xyes"; then
1334   KDE_CHECK_THREADING
1335   if test "x$kde_use_threading" = "xyes"; then
1336     CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
1337     KDE_MT_LDFLAGS="$USE_THREADS"
1338     KDE_MT_LIBS="$LIBPTHREAD"
1339   else
1340     kde_use_qt_mt=no
1341   fi
1343 AC_SUBST(KDE_MT_LDFLAGS)
1344 AC_SUBST(KDE_MT_LIBS)
1346 kde_qt_was_given=yes
1348 dnl ------------------------------------------------------------------------
1349 dnl If we haven't been told how to link to Qt, we work it out for ourselves.
1350 dnl ------------------------------------------------------------------------
1351 if test -z "$LIBQT_GLOB"; then
1352   if test "x$kde_use_qt_emb" = "xyes"; then
1353     LIBQT_GLOB="libqte.*"
1354   else
1355     LIBQT_GLOB="libqt.*"
1356   fi
1359 dnl ------------------------------------------------------------
1360 dnl If we got --enable-embedded then adjust the Qt library name.
1361 dnl ------------------------------------------------------------
1362 if test "x$kde_use_qt_emb" = "xyes"; then
1363   qtlib="qte"
1364 else
1365   qtlib="qt"
1368 kde_int_qt="-l$qtlib"
1370 if test -z "$LIBQPE"; then
1371 dnl ------------------------------------------------------------
1372 dnl If we got --enable-palmtop then add -lqpe to the link line
1373 dnl ------------------------------------------------------------
1374   if test "x$kde_use_qt_emb" = "xyes"; then
1375     if test "x$kde_use_qt_emb_palm" = "xyes"; then
1376       LIB_QPE="-lqpe"
1377     else
1378       LIB_QPE=""
1379     fi
1380   else
1381     LIB_QPE=""
1382   fi
1385 dnl ------------------------------------------------------------------------
1386 dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
1387 dnl ------------------------------------------------------------------------
1389 if test "x$kde_use_qt_mt" = "xyes"; then
1390   LIBQT="-l$qtlib-mt"
1391   kde_int_qt="-l$qtlib-mt"
1392   LIBQT_GLOB="lib$qtlib-mt.*"
1393   USING_QT_MT="using -mt"
1394 else
1395   LIBQT="-l$qtlib"
1398 if test $kde_qtver != 1; then
1400   AC_REQUIRE([AC_FIND_PNG])
1401   AC_REQUIRE([AC_FIND_JPEG])
1402   LIBQT="$LIBQT $LIBPNG $LIBJPEG"
1405 if test $kde_qtver = 3; then
1406   AC_REQUIRE([KDE_CHECK_LIBDL])
1407   LIBQT="$LIBQT $LIBDL"
1410 AC_MSG_CHECKING([for Qt])
1412 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1413 LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
1415 ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
1416 qt_libraries=""
1417 qt_includes=""
1418 AC_ARG_WITH(qt-dir,
1419     AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]),
1420     [  ac_qt_includes="$withval"/include
1421        ac_qt_libraries="$withval"/lib${kdelibsuff}
1422        ac_qt_bindir="$withval"/bin
1423     ])
1425 AC_ARG_WITH(qt-includes,
1426     AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]),
1427     [
1428        ac_qt_includes="$withval"
1429     ])
1431 kde_qt_libs_given=no
1433 AC_ARG_WITH(qt-libraries,
1434     AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]),
1435     [  ac_qt_libraries="$withval"
1436        kde_qt_libs_given=yes
1437     ])
1439 AC_CACHE_VAL(ac_cv_have_qt,
1440 [#try to guess Qt locations
1442 qt_incdirs=""
1443 for dir in $kde_qt_dirs; do
1444    qt_incdirs="$qt_incdirs $dir/include $dir"
1445 done
1446 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"
1447 if test ! "$ac_qt_includes" = "NO"; then
1448    qt_incdirs="$ac_qt_includes $qt_incdirs"
1451 if test "$kde_qtver" != "1"; then
1452   kde_qt_header=qstyle.h
1453 else
1454   kde_qt_header=qglobal.h
1457 AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
1458 ac_qt_includes="$qt_incdir"
1460 qt_libdirs=""
1461 for dir in $kde_qt_dirs; do
1462    qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir"
1463 done
1464 qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
1465 if test ! "$ac_qt_libraries" = "NO"; then
1466   qt_libdir=$ac_qt_libraries
1467 else
1468   qt_libdirs="$ac_qt_libraries $qt_libdirs"
1469   # if the Qt was given, the chance is too big that libqt.* doesn't exist
1470   qt_libdir=NONE
1471   for dir in $qt_libdirs; do
1472     try="ls -1 $dir/${LIBQT_GLOB}"
1473     if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
1474   done
1476 for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
1477   if test -e "$a"; then
1478     LIBQT="$LIBQT ${kde_int_qt}_incremental"
1479     break
1480   fi
1481 done
1483 ac_qt_libraries="$qt_libdir"
1485 AC_LANG_SAVE
1486 AC_LANG_CPLUSPLUS
1488 ac_cxxflags_safe="$CXXFLAGS"
1489 ac_ldflags_safe="$LDFLAGS"
1490 ac_libs_safe="$LIBS"
1492 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
1493 LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
1494 LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
1496 KDE_PRINT_QT_PROGRAM
1498 if AC_TRY_EVAL(ac_link) && test -s conftest; then
1499   rm -f conftest*
1500 else
1501   echo "configure: failed program was:" >&AC_FD_CC
1502   cat conftest.$ac_ext >&AC_FD_CC
1503   ac_qt_libraries="NO"
1505 rm -f conftest*
1506 CXXFLAGS="$ac_cxxflags_safe"
1507 LDFLAGS="$ac_ldflags_safe"
1508 LIBS="$ac_libs_safe"
1510 AC_LANG_RESTORE
1511 if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
1512   ac_cv_have_qt="have_qt=no"
1513   ac_qt_notfound=""
1514   missing_qt_mt=""
1515   if test "$ac_qt_includes" = NO; then
1516     if test "$ac_qt_libraries" = NO; then
1517       ac_qt_notfound="(headers and libraries)";
1518     else
1519       ac_qt_notfound="(headers)";
1520     fi
1521   else
1522     if test "x$kde_use_qt_mt" = "xyes"; then
1523        missing_qt_mt="
1524 Make sure that you have compiled Qt with thread support!"
1525        ac_qt_notfound="(library $qtlib-mt)";
1526     else
1527        ac_qt_notfound="(library $qtlib)";
1528     fi
1529   fi
1531   AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
1532 For more details about this problem, look at the end of config.log.$missing_qt_mt])
1533 else
1534   have_qt="yes"
1538 eval "$ac_cv_have_qt"
1540 if test "$have_qt" != yes; then
1541   AC_MSG_RESULT([$have_qt]);
1542 else
1543   ac_cv_have_qt="have_qt=yes \
1544     ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
1545   AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
1547   qt_libraries="$ac_qt_libraries"
1548   qt_includes="$ac_qt_includes"
1551 if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
1552      KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
1555 AC_SUBST(qt_libraries)
1556 AC_SUBST(qt_includes)
1558 if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
1559  QT_INCLUDES=""
1560 else
1561  QT_INCLUDES="-I$qt_includes"
1562  all_includes="$QT_INCLUDES $all_includes"
1565 if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
1566  QT_LDFLAGS=""
1567 else
1568  QT_LDFLAGS="-L$qt_libraries"
1569  all_libraries="$QT_LDFLAGS $all_libraries"
1571 test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
1573 AC_SUBST(QT_INCLUDES)
1574 AC_SUBST(QT_LDFLAGS)
1575 AC_PATH_QT_MOC_UIC
1577 KDE_CHECK_QT_JPEG
1579 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1580 LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
1581 else
1582 LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
1584 test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
1585 for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
1586   if test -e "$a"; then
1587      LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
1588      break
1589   fi
1590 done
1592 AC_SUBST(LIB_QT)
1593 AC_SUBST(LIB_QPE)
1595 AC_SUBST(kde_qtver)
1598 AC_DEFUN([AC_PATH_QT],
1600 AC_PATH_QT_1_3
1603 AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
1605 AC_REQUIRE([AC_PATH_QT_MOC_UIC])
1607 if test x$ac_uic_supports_libpath = xyes; then
1609 AC_MSG_CHECKING([if UIC has KDE plugins available])
1610 AC_CACHE_VAL(kde_cv_uic_plugins,
1612 cat > actest.ui << EOF
1613 <!DOCTYPE UI><UI version="3.0" stdsetdef="1">
1614 <class>NewConnectionDialog</class>
1615 <widget class="QDialog">
1616    <widget class="KLineEdit">
1617         <property name="name">
1618            <cstring>testInput</cstring>
1619         </property>
1620    </widget>
1621 </widget>
1622 </UI>
1624        
1627 kde_cv_uic_plugins=no
1628 kde_line="$UIC_PATH -L $kde_widgetdir"
1629 if test x$ac_uic_supports_nounload = xyes; then
1630    kde_line="$kde_line -nounload"
1632 kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
1633 if AC_TRY_EVAL(kde_line); then
1634         # if you're trying to debug this check and think it's incorrect,
1635         # better check your installation. The check _is_ correct - your
1636         # installation is not.
1637         if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
1638                 kde_cv_uic_plugins=yes
1639         fi
1641 rm -f actest.ui actest.cpp
1644 AC_MSG_RESULT([$kde_cv_uic_plugins])
1645 if test "$kde_cv_uic_plugins" != yes; then
1646         AC_MSG_ERROR([
1647 you need to install kdelibs first.
1649 If you did install kdelibs, then the Qt version that is picked up by
1650 this configure is not the same version you used to compile kdelibs. 
1651 The Qt Plugin installed by kdelibs is *ONLY* loadable if it is the 
1652 _same Qt version_, compiled with the _same compiler_ and the same Qt
1653 configuration settings.
1659 AC_DEFUN([KDE_CHECK_FINAL],
1661   AC_ARG_ENABLE(final,
1662         AC_HELP_STRING([--enable-final],
1663                        [build size optimized apps (experimental - needs lots of memory)]),
1664         kde_use_final=$enableval, kde_use_final=no)
1666   if test "x$kde_use_final" = "xyes"; then
1667       KDE_USE_FINAL_TRUE=""
1668       KDE_USE_FINAL_FALSE="#"
1669    else
1670       KDE_USE_FINAL_TRUE="#"
1671       KDE_USE_FINAL_FALSE=""
1672   fi
1673   AC_SUBST(KDE_USE_FINAL_TRUE)
1674   AC_SUBST(KDE_USE_FINAL_FALSE)
1677 AC_DEFUN([KDE_CHECK_CLOSURE],
1679   AC_ARG_ENABLE(closure,
1680                 AC_HELP_STRING([--enable-closure],[delay template instantiation]),
1681         kde_use_closure=$enableval, kde_use_closure=no)
1683   KDE_NO_UNDEFINED=""
1684   if test "x$kde_use_closure" = "xyes"; then
1685        KDE_USE_CLOSURE_TRUE=""
1686        KDE_USE_CLOSURE_FALSE="#"
1687 #       CXXFLAGS="$CXXFLAGS $REPO"
1688   else
1689        KDE_USE_CLOSURE_TRUE="#"
1690        KDE_USE_CLOSURE_FALSE=""
1691        KDE_NO_UNDEFINED=""
1692        case $host in 
1693          *-*-linux-gnu)
1694            KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
1695                 [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
1696                 [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
1697                 [KDE_NO_UNDEFINED=""])],
1698             [KDE_NO_UNDEFINED=""])
1699            ;;
1700        esac
1701   fi
1702   AC_SUBST(KDE_USE_CLOSURE_TRUE)
1703   AC_SUBST(KDE_USE_CLOSURE_FALSE)
1704   AC_SUBST(KDE_NO_UNDEFINED)
1707 dnl Check if the linker supports --enable-new-dtags and --as-needed
1708 AC_DEFUN([KDE_CHECK_NEW_LDFLAGS],
1710   AC_ARG_ENABLE(new_ldflags,
1711                 AC_HELP_STRING([--enable-new-ldflags],
1712                 [enable the new linker flags]),
1713         kde_use_new_ldflags=$enableval, 
1714         kde_use_new_ldflags=no)
1716   LDFLAGS_AS_NEEDED=""
1717   LDFLAGS_NEW_DTAGS=""
1718   if test "x$kde_use_new_ldflags" = "xyes"; then
1719        LDFLAGS_NEW_DTAGS=""
1720        KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags],
1721                 [LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],)
1723        KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
1724                 [LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
1725   fi
1726   AC_SUBST(LDFLAGS_AS_NEEDED)
1727   AC_SUBST(LDFLAGS_NEW_DTAGS)
1730 AC_DEFUN([KDE_CHECK_NMCHECK],
1732   AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
1733         kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
1735   if test "$kde_use_nmcheck" = "yes"; then
1736       KDE_USE_NMCHECK_TRUE=""
1737       KDE_USE_NMCHECK_FALSE="#"
1738    else
1739       KDE_USE_NMCHECK_TRUE="#"
1740       KDE_USE_NMCHECK_FALSE=""
1741   fi
1742   AC_SUBST(KDE_USE_NMCHECK_TRUE)
1743   AC_SUBST(KDE_USE_NMCHECK_FALSE)
1746 AC_DEFUN([KDE_EXPAND_MAKEVAR], [
1747 savex=$exec_prefix
1748 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1749 tmp=$$2
1750 while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
1751 exec_prefix=$savex
1754 dnl ------------------------------------------------------------------------
1755 dnl Now, the same with KDE
1756 dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
1757 dnl and $(kde_includes) will be the kdehdrlocation (if needed)
1758 dnl ------------------------------------------------------------------------
1760 AC_DEFUN([AC_BASE_PATH_KDE],
1762 AC_REQUIRE([KDE_CHECK_STL])
1763 AC_REQUIRE([AC_PATH_QT])dnl
1764 AC_REQUIRE([KDE_CHECK_LIB64])
1766 AC_CHECK_RPATH
1767 AC_MSG_CHECKING([for KDE])
1769 if test "${prefix}" != NONE; then
1770   kde_includes=${includedir}
1771   KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
1773   kde_libraries=${libdir}
1774   KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
1776 else
1777   ac_kde_includes=
1778   ac_kde_libraries=
1779   kde_libraries=""
1780   kde_includes=""
1783 AC_CACHE_VAL(ac_cv_have_kde,
1784 [#try to guess kde locations
1786 if test "$kde_qtver" = 1; then
1787   kde_check_header="ksock.h"
1788   kde_check_lib="libkdecore.la"
1789 else
1790   kde_check_header="ksharedptr.h"
1791   kde_check_lib="libkio.la"
1794 if test -z "$1"; then
1796 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"
1797 test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
1798 kde_incdirs="$ac_kde_includes $kde_incdirs"
1799 AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
1800 ac_kde_includes="$kde_incdir"
1802 if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
1803   AC_MSG_ERROR([
1804 in the prefix, you've chosen, are no KDE headers installed. This will fail.
1805 So, check this please and use another prefix!])
1808 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}"
1809 test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
1810 kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
1811 AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
1812 ac_kde_libraries="$kde_libdir"
1814 kde_widgetdir=NO
1815 dnl this might be somewhere else
1816 AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
1818 if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
1819 AC_MSG_ERROR([
1820 in the prefix, you've chosen, are no KDE libraries installed. This will fail.
1821 So, check this please and use another prefix!])
1824 if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
1825 AC_MSG_ERROR([
1826 I can't find the designer plugins. These are required and should have been installed
1827 by kdelibs])
1830 if test -n "$kde_widgetdir"; then
1831     kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
1835 if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
1836   ac_cv_have_kde="have_kde=no"
1837 else
1838   ac_cv_have_kde="have_kde=yes \
1839     ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1842 else dnl test -z $1, e.g. from kdelibs
1844   ac_cv_have_kde="have_kde=no"
1847 ])dnl
1849 eval "$ac_cv_have_kde"
1851 if test "$have_kde" != "yes"; then
1852  if test "${prefix}" = NONE; then
1853   ac_kde_prefix="$ac_default_prefix"
1854  else
1855   ac_kde_prefix="$prefix"
1856  fi
1857  if test "$exec_prefix" = NONE; then
1858   ac_kde_exec_prefix="$ac_kde_prefix"
1859   AC_MSG_RESULT([will be installed in $ac_kde_prefix])
1860  else
1861   ac_kde_exec_prefix="$exec_prefix"
1862   AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
1863  fi
1865  kde_libraries="${libdir}"
1866  kde_includes="${includedir}"
1868 else
1869   ac_cv_have_kde="have_kde=yes \
1870     ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1871   AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
1873   kde_libraries="$ac_kde_libraries"
1874   kde_includes="$ac_kde_includes"
1876 AC_SUBST(kde_libraries)
1877 AC_SUBST(kde_includes)
1879 if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes"  || test "$kde_includes" = "/usr/include"; then
1880  KDE_INCLUDES=""
1881 else
1882  KDE_INCLUDES="-I$kde_includes"
1883  all_includes="$KDE_INCLUDES $all_includes"
1886 KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
1888 KDE_LDFLAGS="-L$kde_libraries"
1889 if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then 
1890  all_libraries="$KDE_LDFLAGS $all_libraries"
1893 AC_SUBST(KDE_LDFLAGS)
1894 AC_SUBST(KDE_INCLUDES)
1896 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1898 all_libraries="$all_libraries $USER_LDFLAGS"
1899 all_includes="$all_includes $USER_INCLUDES"
1900 AC_SUBST(all_includes)
1901 AC_SUBST(all_libraries)
1903 if test -z "$1"; then
1904 KDE_CHECK_UIC_PLUGINS
1907 ac_kde_libraries="$kde_libdir"
1909 AC_SUBST(AUTODIRS)
1914 AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
1916 AC_MSG_CHECKING(for extra includes)
1917 AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
1918   kde_use_extra_includes="$withval",
1919   kde_use_extra_includes=NONE
1921 kde_extra_includes=
1922 if test -n "$kde_use_extra_includes" && \
1923    test "$kde_use_extra_includes" != "NONE"; then
1925    ac_save_ifs=$IFS
1926    IFS=':'
1927    for dir in $kde_use_extra_includes; do
1928      kde_extra_includes="$kde_extra_includes $dir"
1929      USER_INCLUDES="$USER_INCLUDES -I$dir"
1930    done
1931    IFS=$ac_save_ifs
1932    kde_use_extra_includes="added"
1933 else
1934    kde_use_extra_includes="no"
1936 AC_SUBST(USER_INCLUDES)
1938 AC_MSG_RESULT($kde_use_extra_includes)
1940 kde_extra_libs=
1941 AC_MSG_CHECKING(for extra libs)
1942 AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
1943   kde_use_extra_libs=$withval,
1944   kde_use_extra_libs=NONE
1946 if test -n "$kde_use_extra_libs" && \
1947    test "$kde_use_extra_libs" != "NONE"; then
1949    ac_save_ifs=$IFS
1950    IFS=':'
1951    for dir in $kde_use_extra_libs; do
1952      kde_extra_libs="$kde_extra_libs $dir"
1953      KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
1954      USER_LDFLAGS="$USER_LDFLAGS -L$dir"
1955    done
1956    IFS=$ac_save_ifs
1957    kde_use_extra_libs="added"
1958 else
1959    kde_use_extra_libs="no"
1962 AC_SUBST(USER_LDFLAGS)
1964 AC_MSG_RESULT($kde_use_extra_libs)
1968 AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
1970     AC_MSG_CHECKING([for KDE headers installed])
1971     AC_LANG_SAVE
1972     AC_LANG_CPLUSPLUS
1973 cat > conftest.$ac_ext <<EOF
1974 #ifdef STDC_HEADERS
1975 # include <stdlib.h>
1976 #endif
1977 #include <stdio.h>
1978 #include "confdefs.h"
1979 #include <kapp.h>
1981 int main() {
1982     printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
1983     printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
1984     printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
1985     printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
1986     printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
1987     printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
1988     printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
1989     printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
1990     printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
1991     printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
1992     printf("kde_wallpaperdir=\\"%s\\"\n",
1993         KApplication::kde_wallpaperdir().data());
1994     printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
1995     printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
1996     printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
1997     printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
1998     printf("kde_moduledir=\\"/tmp/dummy\\"\n");
1999     printf("kde_styledir=\\"/tmp/dummy\\"\n");
2000     printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
2001     printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
2002     printf("xdg_menudir=\\"/tmp/dummy\\"\n");
2003     printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
2004     printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
2005     return 0;
2006     }
2009  ac_save_CPPFLAGS=$CPPFLAGS
2010  CPPFLAGS="$all_includes $CPPFLAGS"
2011  if AC_TRY_EVAL(ac_compile); then
2012    AC_MSG_RESULT(yes)
2013  else
2014    AC_MSG_ERROR([your system is not able to compile a small KDE application!
2015 Check, if you installed the KDE header files correctly.
2016 For more details about this problem, look at the end of config.log.])
2017   fi
2018   CPPFLAGS=$ac_save_CPPFLAGS
2020   AC_LANG_RESTORE
2023 AC_DEFUN([KDE_CHECK_KDEQTADDON],
2025 AC_MSG_CHECKING(for kde-qt-addon)
2026 AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
2028  kde_ldflags_safe="$LDFLAGS"
2029  kde_libs_safe="$LIBS"
2030  kde_cxxflags_safe="$CXXFLAGS"
2032  LIBS="-lkde-qt-addon $LIBQT $LIBS"
2033  CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
2034  LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
2036  AC_TRY_LINK([
2037    #include <qdom.h>
2038  ],
2040    QDomDocument doc;
2041  ],
2042   kde_cv_have_kdeqtaddon=yes,
2043   kde_cv_have_kdeqtaddon=no
2046  LDFLAGS=$kde_ldflags_safe
2047  LIBS=$kde_libs_safe
2048  CXXFLAGS=$kde_cxxflags_safe
2051 AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
2053 if test "$kde_cv_have_kdeqtaddon" = "no"; then
2054   AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
2055 It is a separate package (and CVS module) named kde-qt-addon.])
2059 AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
2061    AC_REQUIRE([KDE_MISC_TESTS])
2062    AC_REQUIRE([KDE_CHECK_LIBDL])
2063    AC_REQUIRE([K_PATH_X])
2065 if test $kde_qtver = 3; then
2066    case $host in 
2067                *cygwin*) lib_kded="-lkdeinit_kded" ;;
2068                *) lib_kded="" ;;
2069        esac
2070    AC_SUBST(LIB_KDED, $lib_kded)
2071    AC_SUBST(LIB_KDECORE, "-lkdecore")
2072    AC_SUBST(LIB_KDEUI, "-lkdeui")
2073    AC_SUBST(LIB_KIO, "-lkio")
2074    AC_SUBST(LIB_KJS, "-lkjs")
2075    AC_SUBST(LIB_SMB, "-lsmb")
2076    AC_SUBST(LIB_KAB, "-lkab")
2077    AC_SUBST(LIB_KABC, "-lkabc")
2078    AC_SUBST(LIB_KHTML, "-lkhtml")
2079    AC_SUBST(LIB_KSPELL, "-lkspell")
2080    AC_SUBST(LIB_KPARTS, "-lkparts")
2081    AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2082    AC_SUBST(LIB_KUTILS, "-lkutils")
2083    AC_SUBST(LIB_KDEPIM, "-lkdepim")
2084    AC_SUBST(LIB_KIMPROXY, "-lkimproxy")
2085    AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
2086    AC_SUBST(LIB_KDNSSD, "-lkdnssd")
2087    AC_SUBST(LIB_KUNITTEST, "-lkunittest")
2088 # these are for backward compatibility
2089    AC_SUBST(LIB_KSYCOCA, "-lkio")
2090    AC_SUBST(LIB_KFILE, "-lkio")
2091 elif test $kde_qtver = 2; then
2092    AC_SUBST(LIB_KDECORE, "-lkdecore")
2093    AC_SUBST(LIB_KDEUI, "-lkdeui")
2094    AC_SUBST(LIB_KIO, "-lkio")
2095    AC_SUBST(LIB_KSYCOCA, "-lksycoca")
2096    AC_SUBST(LIB_SMB, "-lsmb")
2097    AC_SUBST(LIB_KFILE, "-lkfile")
2098    AC_SUBST(LIB_KAB, "-lkab")
2099    AC_SUBST(LIB_KHTML, "-lkhtml")
2100    AC_SUBST(LIB_KSPELL, "-lkspell")
2101    AC_SUBST(LIB_KPARTS, "-lkparts")
2102    AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2103 else
2104    AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
2105    AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
2106    AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
2107    AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
2108    AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
2112 AC_DEFUN([AC_PATH_KDE],
2114   AC_BASE_PATH_KDE
2115   AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
2116   [
2117   if test "$enableval" = "no";
2118     then ac_use_path_checking="default"
2119     else ac_use_path_checking=""
2120   fi
2121   ],
2122   [
2123   if test "$kde_qtver" = 1;
2124     then ac_use_path_checking=""
2125     else ac_use_path_checking="default"
2126   fi
2127   ]
2128   )
2130   AC_CREATE_KFSSTND($ac_use_path_checking)
2132   AC_SUBST_KFSSTND
2133   KDE_CREATE_LIBS_ALIASES
2136 dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
2137 AC_DEFUN([KDE_CHECK_FUNC_EXT],
2139 AC_MSG_CHECKING(for $1)
2140 AC_CACHE_VAL(kde_cv_func_$1,
2142 AC_LANG_SAVE
2143 AC_LANG_CPLUSPLUS
2144 save_CXXFLAGS="$CXXFLAGS"
2145 kde_safe_LIBS="$LIBS"
2146 LIBS="$LIBS $X_EXTRA_LIBS"
2147 if test "$GXX" = "yes"; then
2148 CXXFLAGS="$CXXFLAGS -pedantic-errors"
2150 AC_TRY_COMPILE([
2156 kde_cv_func_$1=yes,
2157 kde_cv_func_$1=no)
2158 CXXFLAGS="$save_CXXFLAGS"
2159 LIBS="$kde_safe_LIBS"
2160 AC_LANG_RESTORE
2163 AC_MSG_RESULT($kde_cv_func_$1)
2165 AC_MSG_CHECKING([if $1 needs custom prototype])
2166 AC_CACHE_VAL(kde_cv_proto_$1,
2168 if test "x$kde_cv_func_$1" = xyes; then
2169   kde_cv_proto_$1=no
2170 else
2171   case "$1" in
2172         setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
2173                 kde_cv_proto_$1="yes - in libkdefakes"
2174                 ;;
2175         *)
2176                 kde_cv_proto_$1=unknown
2177                 ;;
2178   esac
2181 if test "x$kde_cv_proto_$1" = xunknown; then
2183 AC_LANG_SAVE
2184 AC_LANG_CPLUSPLUS
2185   kde_safe_libs=$LIBS
2186   LIBS="$LIBS $X_EXTRA_LIBS"
2187   AC_TRY_LINK([
2190 extern "C" $4;
2195 [ kde_cv_func_$1=yes
2196   kde_cv_proto_$1=yes ],
2197   [kde_cv_proto_$1="$1 unavailable"]
2199 LIBS=$kde_safe_libs
2200 AC_LANG_RESTORE
2203 AC_MSG_RESULT($kde_cv_proto_$1)
2205 if test "x$kde_cv_func_$1" = xyes; then
2206   AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
2207   $6
2209 if test "x$kde_cv_proto_$1" = xno; then
2210   AC_DEFINE(HAVE_$5_PROTO, 1,
2211   [Define if you have the $1 prototype])
2214 AH_VERBATIM([_HAVE_$5_PROTO],
2216 #if !defined(HAVE_$5_PROTO)
2217 #ifdef __cplusplus
2218 extern "C" {
2219 #endif
2221 #ifdef __cplusplus
2223 #endif
2224 #endif
2228 AC_DEFUN([AC_CHECK_SETENV],
2230         KDE_CHECK_FUNC_EXT(setenv, [
2231 #include <stdlib.h>
2232 ], 
2233                 [setenv("VAR", "VALUE", 1);],
2234                 [int setenv (const char *, const char *, int)],
2235                 [SETENV])
2238 AC_DEFUN([AC_CHECK_UNSETENV],
2240         KDE_CHECK_FUNC_EXT(unsetenv, [
2241 #include <stdlib.h>
2242 ], 
2243                 [unsetenv("VAR");],
2244                 [void unsetenv (const char *)],
2245                 [UNSETENV])
2248 AC_DEFUN([AC_CHECK_GETDOMAINNAME],
2250         KDE_CHECK_FUNC_EXT(getdomainname, [
2251 #include <stdlib.h>
2252 #include <unistd.h>
2253 #include <netdb.h>
2254 ], 
2255                 [
2256 char buffer[200];
2257 getdomainname(buffer, 200);
2258 ],      
2259                 [#include <sys/types.h>
2260                 int getdomainname (char *, size_t)],
2261                 [GETDOMAINNAME])
2264 AC_DEFUN([AC_CHECK_GETHOSTNAME],
2266         KDE_CHECK_FUNC_EXT(gethostname, [
2267 #include <stdlib.h>
2268 #include <unistd.h>
2269 ], 
2270                 [
2271 char buffer[200];
2272 gethostname(buffer, 200);
2273 ],      
2274                 [int gethostname (char *, unsigned int)],
2275                 [GETHOSTNAME])
2278 AC_DEFUN([AC_CHECK_USLEEP],
2280         KDE_CHECK_FUNC_EXT(usleep, [
2281 #include <unistd.h>
2282 ], 
2283                 [
2284 usleep(200);
2285 ],      
2286                 [int usleep (unsigned int)],
2287                 [USLEEP])
2291 AC_DEFUN([AC_CHECK_RANDOM],
2293         KDE_CHECK_FUNC_EXT(random, [
2294 #include <stdlib.h>
2295 ], 
2296                 [
2297 random();
2298 ],      
2299                 [long int random(void)],
2300                 [RANDOM])
2302         KDE_CHECK_FUNC_EXT(srandom, [
2303 #include <stdlib.h>
2304 ], 
2305                 [
2306 srandom(27);
2307 ],      
2308                 [void srandom(unsigned int)],
2309                 [SRANDOM])
2313 AC_DEFUN([AC_CHECK_INITGROUPS],
2315         KDE_CHECK_FUNC_EXT(initgroups, [
2316 #include <sys/types.h>
2317 #include <unistd.h>
2318 #include <grp.h>
2320         [
2321 char buffer[200];
2322 initgroups(buffer, 27);
2324         [int initgroups(const char *, gid_t)],
2325         [INITGROUPS])
2328 AC_DEFUN([AC_CHECK_MKSTEMPS],
2330         KDE_CHECK_FUNC_EXT(mkstemps, [
2331 #include <stdlib.h>
2332 #include <unistd.h>
2334         [
2335 mkstemps("/tmp/aaaXXXXXX", 6);
2337         [int mkstemps(char *, int)],
2338         [MKSTEMPS])
2341 AC_DEFUN([AC_CHECK_MKSTEMP],
2343         KDE_CHECK_FUNC_EXT(mkstemp, [
2344 #include <stdlib.h>
2345 #include <unistd.h>
2347         [
2348 mkstemp("/tmp/aaaXXXXXX");
2350         [int mkstemp(char *)],
2351         [MKSTEMP])
2354 AC_DEFUN([AC_CHECK_MKDTEMP],
2356         KDE_CHECK_FUNC_EXT(mkdtemp, [
2357 #include <stdlib.h>
2358 #include <unistd.h>
2360         [
2361 mkdtemp("/tmp/aaaXXXXXX");
2363         [char *mkdtemp(char *)],
2364         [MKDTEMP])
2368 AC_DEFUN([AC_CHECK_RES_INIT],
2370   AC_MSG_CHECKING([if res_init needs -lresolv])
2371   kde_libs_safe="$LIBS"
2372   LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
2373   AC_TRY_LINK(
2374     [
2375 #include <sys/types.h>
2376 #include <netinet/in.h>
2377 #include <arpa/nameser.h>
2378 #include <resolv.h>
2379     ],
2380     [
2381       res_init(); 
2382     ],
2383     [
2384       LIBRESOLV="-lresolv"
2385       AC_MSG_RESULT(yes)
2386       AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2387     ],
2388     [ AC_MSG_RESULT(no) ]
2389   )
2390   LIBS=$kde_libs_safe
2391   AC_SUBST(LIBRESOLV)
2393   KDE_CHECK_FUNC_EXT(res_init,
2394     [
2395 #include <sys/types.h>
2396 #include <netinet/in.h>
2397 #include <arpa/nameser.h>
2398 #include <resolv.h>
2399     ],
2400     [res_init()],
2401     [int res_init(void)],
2402     [RES_INIT])
2405 AC_DEFUN([AC_CHECK_STRLCPY],
2407         KDE_CHECK_FUNC_EXT(strlcpy, [
2408 #include <string.h>
2410 [ char buf[20];
2411   strlcpy(buf, "KDE function test", sizeof(buf));
2413         [unsigned long strlcpy(char*, const char*, unsigned long)],
2414         [STRLCPY])
2417 AC_DEFUN([AC_CHECK_STRLCAT],
2419         KDE_CHECK_FUNC_EXT(strlcat, [
2420 #include <string.h>
2422 [ char buf[20];
2423   buf[0]='\0';
2424   strlcat(buf, "KDE function test", sizeof(buf));
2426         [unsigned long strlcat(char*, const char*, unsigned long)],
2427         [STRLCAT])
2430 AC_DEFUN([AC_CHECK_RES_QUERY],
2432         KDE_CHECK_FUNC_EXT(res_query, [
2433 #include <sys/types.h>
2434 #include <netinet/in.h>
2435 #include <arpa/nameser.h>
2436 #include <resolv.h>
2437 #include <netdb.h>
2440 res_query(NULL, 0, 0, NULL, 0);
2442         [int res_query(const char *, int, int, unsigned char *, int)],
2443         [RES_QUERY])
2446 AC_DEFUN([AC_CHECK_DN_SKIPNAME],
2448         KDE_CHECK_FUNC_EXT(dn_skipname, [
2449 #include <sys/types.h>
2450 #include <netinet/in.h>
2451 #include <arpa/nameser.h>
2452 #include <resolv.h>
2455 dn_skipname (NULL, NULL);
2457         [int dn_skipname (unsigned char *, unsigned char *)],
2458         [DN_SKIPNAME])
2462 AC_DEFUN([AC_FIND_GIF],
2463    [AC_MSG_CHECKING([for giflib])
2464 AC_CACHE_VAL(ac_cv_lib_gif,
2465 [ac_save_LIBS="$LIBS"
2466 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2467 LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
2468 else
2469 LIBS="$all_libraries -lgif"
2471 AC_TRY_LINK(dnl
2473 #ifdef __cplusplus
2474 extern "C" {
2475 #endif
2476 int GifLastError(void);
2477 #ifdef __cplusplus
2479 #endif
2480 /* We use char because int might match the return type of a gcc2
2481     builtin and then its argument prototype would still apply.  */
2483             [return GifLastError();],
2484             eval "ac_cv_lib_gif=yes",
2485             eval "ac_cv_lib_gif=no")
2486 LIBS="$ac_save_LIBS"
2487 ])dnl
2488 if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
2489   AC_MSG_RESULT(yes)
2490   AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
2491 else
2492   AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
2496 AC_DEFUN([KDE_FIND_JPEG_HELPER],
2498 AC_MSG_CHECKING([for libjpeg$2])
2499 AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
2501 ac_save_LIBS="$LIBS"
2502 LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
2503 ac_save_CFLAGS="$CFLAGS"
2504 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2505 AC_TRY_LINK(
2507 #ifdef __cplusplus
2508 extern "C" {
2509 #endif
2510 void jpeg_CreateDecompress();
2511 #ifdef __cplusplus
2513 #endif
2515 [jpeg_CreateDecompress();],
2516             eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
2517             eval "ac_cv_lib_jpeg_$1=no")
2518 LIBS="$ac_save_LIBS"
2519 CFLAGS="$ac_save_CFLAGS"
2522 if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
2523   LIBJPEG="$ac_cv_lib_jpeg_$1"
2524   AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
2525 else
2526   AC_MSG_RESULT(no)
2527   $3
2532 AC_DEFUN([AC_FIND_JPEG],
2534 dnl first look for libraries
2535 KDE_FIND_JPEG_HELPER(6b, 6b,
2536    KDE_FIND_JPEG_HELPER(normal, [],
2537     [
2538        LIBJPEG=
2539     ]
2540    )
2543 dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
2544 dnl requires system dependent includes loaded before it)
2545 jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
2546 AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
2547 test "x$jpeg_incdir" = xNO && jpeg_incdir=
2549 dnl if headers _and_ libraries are missing, this is no error, and we
2550 dnl continue with a warning (the user will get no jpeg support in khtml)
2551 dnl if only one is missing, it means a configuration error, but we still
2552 dnl only warn
2553 if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
2554   AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
2555 else
2556   if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
2557     AC_MSG_WARN([
2558 There is an installation error in jpeg support. You seem to have only one
2559 of either the headers _or_ the libraries installed. You may need to either
2560 provide correct --with-extra-... options, or the development package of
2561 libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
2562 Disabling JPEG support.
2564   else
2565     AC_MSG_WARN([libjpeg not found. disable JPEG support.])
2566   fi
2567   jpeg_incdir=
2568   LIBJPEG=
2571 AC_SUBST(LIBJPEG)
2572 AH_VERBATIM(_AC_CHECK_JPEG,
2574  * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
2575  * headers and I'm too lazy to write a configure test as long as only
2576  * unixware is related
2577  */
2578 #ifdef _UNIXWARE
2579 #define HAVE_BOOLEAN
2580 #endif
2584 AC_DEFUN([KDE_CHECK_QT_JPEG],
2586 if test -n "$LIBJPEG"; then
2587 AC_MSG_CHECKING([if Qt needs $LIBJPEG])
2588 AC_CACHE_VAL(kde_cv_qt_jpeg,
2590 AC_LANG_SAVE
2591 AC_LANG_CPLUSPLUS
2592 ac_save_LIBS="$LIBS"
2593 LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
2594 LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
2595 ac_save_CXXFLAGS="$CXXFLAGS"
2596 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2597 AC_TRY_LINK(
2598 [#include <qapplication.h>],
2599             [
2600             int argc;
2601             char** argv;
2602             QApplication app(argc, argv);],
2603             eval "kde_cv_qt_jpeg=no",
2604             eval "kde_cv_qt_jpeg=yes")
2605 LIBS="$ac_save_LIBS"
2606 CXXFLAGS="$ac_save_CXXFLAGS"
2607 AC_LANG_RESTORE
2611 if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
2612   AC_MSG_RESULT(yes)
2613   LIBJPEG_QT='$(LIBJPEG)'
2614 else
2615   AC_MSG_RESULT(no)
2616   LIBJPEG_QT=
2621 AC_DEFUN([AC_FIND_ZLIB],
2623 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2624 AC_MSG_CHECKING([for libz])
2625 AC_CACHE_VAL(ac_cv_lib_z,
2627 kde_save_LIBS="$LIBS"
2628 LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
2629 kde_save_CFLAGS="$CFLAGS"
2630 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2631 AC_TRY_LINK(dnl
2633 #include<zlib.h>
2636   char buf[42];
2637   gzFile f = (gzFile) 0;
2638   /* this would segfault.. but we only link, don't run */
2639   (void) gzgets(f, buf, sizeof(buf));
2641   return (zlibVersion() == ZLIB_VERSION); 
2643             eval "ac_cv_lib_z='-lz'",
2644             eval "ac_cv_lib_z=no")
2645 LIBS="$kde_save_LIBS"
2646 CFLAGS="$kde_save_CFLAGS"
2647 ])dnl
2648 if test ! "$ac_cv_lib_z" = no; then
2649   AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
2650   LIBZ="$ac_cv_lib_z"
2651   AC_MSG_RESULT($ac_cv_lib_z)
2652 else
2653   AC_MSG_ERROR(not found. 
2654           Possibly configure picks up an outdated version
2655           installed by XFree86. Remove it from your system.
2657           Check your installation and look into config.log)
2658   LIBZ=""
2660 AC_SUBST(LIBZ)
2663 AC_DEFUN([KDE_TRY_TIFFLIB],
2665 AC_MSG_CHECKING([for libtiff $1])
2667 AC_CACHE_VAL(kde_cv_libtiff_$1,
2669 AC_LANG_SAVE
2670 AC_LANG_CPLUSPLUS
2671 kde_save_LIBS="$LIBS"
2672 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2673 LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
2674 else
2675 LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
2677 kde_save_CXXFLAGS="$CXXFLAGS"
2678 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2680 AC_TRY_LINK(dnl
2682 #include<tiffio.h>
2684     [return (TIFFOpen( "", "r") == 0); ],
2686     kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
2687 ], [
2688     kde_cv_libtiff_$1=no
2691 LIBS="$kde_save_LIBS"
2692 CXXFLAGS="$kde_save_CXXFLAGS"
2693 AC_LANG_RESTORE
2696 if test "$kde_cv_libtiff_$1" = "no"; then
2697     AC_MSG_RESULT(no)
2698     LIBTIFF=""
2699     $3
2700 else
2701     LIBTIFF="$kde_cv_libtiff_$1"
2702     AC_MSG_RESULT(yes)
2703     AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
2704     $2
2709 AC_DEFUN([AC_FIND_TIFF],
2711 AC_REQUIRE([K_PATH_X])
2712 AC_REQUIRE([AC_FIND_ZLIB])
2713 AC_REQUIRE([AC_FIND_JPEG])
2714 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2716 KDE_TRY_TIFFLIB(tiff, [],
2717    KDE_TRY_TIFFLIB(tiff34))
2719 AC_SUBST(LIBTIFF)
2722 AC_DEFUN([KDE_FIND_LIBEXR],
2724 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2725 AC_REQUIRE([AC_FIND_ZLIB])
2726 AC_CACHE_VAL(ac_cv_libexr,
2728   if test -z "$PKG_CONFIG"; then
2729     AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2730   fi
2732   AC_MSG_CHECKING([for OpenEXR libraries])
2734   if test "$PKG_CONFIG" = "no" ; then
2735      AC_MSG_RESULT(no)
2736      echo "*** The pkg-config script could not be found. Make sure it is"
2737      echo "*** in your path, or set the PKG_CONFIG environment variable"
2738      echo "*** to the full path to pkg-config."
2739      echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
2740   else
2741      if !(`$PKG_CONFIG --exists OpenEXR`) ; then
2742         AC_MSG_RESULT(no)
2743         EXRSTATUS=no
2744      else
2745         if !(`$PKG_CONFIG --atleast-version="1.1.1" OpenEXR`) ; then
2746            AC_MSG_RESULT(no)
2747            EXRSTATUS=old
2748         else
2749            kde_save_LIBS="$LIBS"
2750            LIBS="$LIBS $all_libraries $USER_LDFLAGS `pkg-config --libs OpenEXR` $LIBZ"
2751            AC_LANG_SAVE
2752            AC_LANG_CPLUSPLUS
2753            kde_save_CXXFLAGS="$CXXFLAGS"
2754            EXR_FLAGS=`$PKG_CONFIG --cflags OpenEXR`
2755            CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES $EXR_FLAGS"
2757            AC_TRY_LINK(dnl
2758                [
2759                #include <ImfRgbaFile.h>
2760                ],
2761                [
2762                using namespace Imf;
2763                RgbaInputFile file ("dummy");
2764                return 0;
2765                ],
2766                eval "ac_cv_libexr='`pkg-config --libs OpenEXR`'",
2767                eval "ac_cv_libexr=no"
2768            )
2769            LIBS="$kde_save_LIBS"
2770            CXXFLAGS="$kde_save_CXXFLAGS"
2771            AC_LANG_RESTORE
2772            ])dnl
2773            if eval "test ! \"`echo $ac_cv_libexr`\" = no"; then
2774                AC_DEFINE_UNQUOTED(HAVE_EXR, 1, [Define if you have OpenEXR])
2775                LIB_EXR="$ac_cv_libexr"
2776                AC_MSG_RESULT($ac_cv_libexr)
2777            else
2778                AC_MSG_RESULT(no)
2779                LIB_EXR=""
2780            fi
2781         fi
2782      fi
2783   fi
2784   AC_SUBST(LIB_EXR)
2785   AC_SUBST(EXR_FLAGS)
2790 AC_DEFUN([AC_FIND_PNG],
2792 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2793 AC_REQUIRE([AC_FIND_ZLIB])
2794 AC_MSG_CHECKING([for libpng])
2795 AC_CACHE_VAL(ac_cv_lib_png,
2797 kde_save_LIBS="$LIBS"
2798 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2799 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
2800 else
2801 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
2803 kde_save_CFLAGS="$CFLAGS"
2804 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2806 AC_TRY_LINK(dnl
2807     [
2808     #include<png.h>
2809     ],
2810     [
2811     png_structp png_ptr = png_create_read_struct(  /* image ptr */
2812                 PNG_LIBPNG_VER_STRING, 0, 0, 0 );
2813     return( png_ptr != 0 );
2814     ],
2815     eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
2816     eval "ac_cv_lib_png=no"
2818 LIBS="$kde_save_LIBS"
2819 CFLAGS="$kde_save_CFLAGS"
2820 ])dnl
2821 if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
2822   AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
2823   LIBPNG="$ac_cv_lib_png"
2824   AC_SUBST(LIBPNG)
2825   AC_MSG_RESULT($ac_cv_lib_png)
2826 else
2827   AC_MSG_RESULT(no)
2828   LIBPNG=""
2829   AC_SUBST(LIBPNG)
2834 AC_DEFUN([AC_FIND_JASPER],
2836 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2837 AC_REQUIRE([AC_FIND_JPEG])
2838 AC_MSG_CHECKING([for jasper])
2839 AC_CACHE_VAL(ac_cv_jasper,
2841 kde_save_LIBS="$LIBS"
2842 LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
2843 kde_save_CFLAGS="$CFLAGS"
2844 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2846 AC_TRY_LINK(dnl
2847     [
2848     #include<jasper/jasper.h>
2849     ],
2850     [
2851     return( jas_init() );
2852     ],
2853     eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
2854     eval "ac_cv_jasper=no"
2856 LIBS="$kde_save_LIBS"
2857 CFLAGS="$kde_save_CFLAGS"
2858 ])dnl
2859 if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
2860   AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
2861   LIB_JASPER="$ac_cv_jasper"
2862   AC_MSG_RESULT($ac_cv_jasper)
2863 else
2864   AC_MSG_RESULT(no)
2865   LIB_JASPER=""
2867 AC_SUBST(LIB_JASPER)
2870 AC_DEFUN([AC_CHECK_BOOL],
2872   AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
2875 AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
2877 AC_MSG_CHECKING(if you need GNU extensions)
2878 AC_CACHE_VAL(ac_cv_gnu_extensions,
2880 cat > conftest.c << EOF
2881 #include <features.h>
2883 #ifdef __GNU_LIBRARY__
2885 #endif
2888 if (eval "$ac_cpp conftest.c") 2>&5 |
2889   egrep "yes" >/dev/null 2>&1; then
2890   rm -rf conftest*
2891   ac_cv_gnu_extensions=yes
2892 else
2893   ac_cv_gnu_extensions=no
2897 AC_MSG_RESULT($ac_cv_gnu_extensions)
2898 if test "$ac_cv_gnu_extensions" = "yes"; then
2899   AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
2903 AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
2905 AC_MSG_CHECKING([whether $CXX supports -$1])
2906 kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
2907 AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
2909   AC_LANG_SAVE
2910   AC_LANG_CPLUSPLUS
2911   save_CXXFLAGS="$CXXFLAGS"
2912   CXXFLAGS="$CXXFLAGS -$1"
2913   AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
2914   CXXFLAGS="$save_CXXFLAGS"
2915   AC_LANG_RESTORE
2917 if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
2918  AC_MSG_RESULT(yes)
2920  $2
2921 else
2922  AC_MSG_RESULT(no)
2924  $3
2928 AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
2930 AC_MSG_CHECKING([whether $CC supports -$1])
2931 kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
2932 AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
2934   AC_LANG_SAVE
2935   AC_LANG_C
2936   save_CFLAGS="$CFLAGS"
2937   CFLAGS="$CFLAGS -$1"
2938   AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
2939   CFLAGS="$save_CFLAGS"
2940   AC_LANG_RESTORE
2942 if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
2943  AC_MSG_RESULT(yes)
2945  $2
2946 else
2947  AC_MSG_RESULT(no)
2949  $3
2954 dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
2955 dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
2956 dnl it's all white-space separated
2957 AC_DEFUN([AC_REMOVE_FORBIDDEN],
2958 [ __val=$$1
2959   __forbid=" $2 "
2960   if test -n "$__val"; then
2961     __new=""
2962     ac_save_IFS=$IFS
2963     IFS="       "
2964     for i in $__val; do
2965       case "$__forbid" in
2966         *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
2967         *) # Careful to not add spaces, where there were none, because otherwise
2968            # libtool gets confused, if we change e.g. CXX
2969            if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
2970       esac
2971     done
2972     IFS=$ac_save_IFS
2973     $1=$__new
2974   fi
2978 AC_DEFUN([KDE_CHECK_FOR_BAD_COMPILER],
2980   AC_MSG_CHECKING([whether $CC is blacklisted])
2982   dnl In theory we have tu run this test against $CC and $CXX
2983   dnl in C and in C++ mode, because its perfectly legal for
2984   dnl the user to mix compiler versions, since C has a defined
2985   dnl ABI. 
2986   dnl 
2987   dnl For now, we assume the user is not on crack.
2989   AC_TRY_COMPILE([
2990 #ifdef __GNUC__
2991 #if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0
2992 choke me
2993 #endif
2994 #endif
2995 ], ,
2996   kde_bad_compiler=no, 
2997   kde_bad_compiler=yes
3000   AC_MSG_RESULT($kde_bad_compiler)
3002 if test "$kde_bad_compiler" = "yes"; then
3003   AC_MSG_ERROR([
3005 This particular compiler version is blacklisted because it
3006 is known to miscompile KDE. Please use a newer version, or
3007 if that is not yet available, choose an older version. 
3009 Please do not report a bug or bother us reporting this
3010 configure error. We know about it, and we introduced
3011 it by intention to avoid untraceable bugs or crashes in KDE.
3019 AC_DEFUN([KDE_CHECK_FOR_OPT_NOINLINE_MATCH],
3021   AC_CACHE_CHECK([whether system headers can cope with -O2 -fno-inline],
3022     kde_cv_opt_noinline_match,
3023   [
3024   kde_cv_opt_noinline_match=irrelevant
3025   dnl if we don't use both -O2 and -fno-inline, this check is moot
3026   if echo "$CFLAGS" | grep -e -O2 >/dev/null 2>/dev/null \
3027      && echo "$CFLAGS" | grep -e -fno-inline >/dev/null 2>/dev/null ; then
3029     ac_cflags_save="$CFLAGS"
3030     CFLAGS="$CFLAGS -D_USE_GNU"
3032     AC_TRY_LINK([
3033   #include <string.h>
3034 ], [  const char *pt, *et;
3035   et = __extension__      ({ char __a0, __a1, __a2;       (__builtin_constant_p (  ";,"  ) && ((size_t)(const void *)((   ";,"   )+ 1) - (size_t)(const void *)(   ";,"   ) == 1)        ? ((__a0 =((__const char  *) (  ";,"  ))[0], __a0 == '\0')     ? ((void) (  pt ),((void *)0) )        : ((__a1 = ((__const char *) (  ";,"  ))[1], __a1== '\0')      ? (__extension__ (__builtin_constant_p (  __a0 ) && ( __a0 ) == '\0'   ? (char *) __rawmemchr (   pt  ,   __a0)       : strchr(   pt  ,   __a0 )))   : ((__a2 = ((__const char *) (  ";,"  ))[2], __a2 == '\0')      ? __strpbrk_c2 (  pt , __a0, __a1)      :(((__const char *) (  ";,"  ))[3] == '\0'     ? __strpbrk_c3 (  pt ,__a0, __a1, __a2): strpbrk (  pt ,   ";,"  ))))) : strpbrk (  pt ,  ";,"  )); }) ;
3037     kde_cv_opt_noinline_match=yes,
3038     kde_cv_opt_noinline_match=no
3039     )
3041     CFLAGS="$ac_cflags_save"
3042   fi
3043   ])
3047 dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
3048 AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
3049 [dnl
3050 if test "x$kde_use_qt_emb" != "xyes"; then
3051  AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
3052  AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
3053 else
3054  AC_REMOVE_FORBIDDEN(CXX, [-rpath])
3055  AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
3059 AC_DEFUN([AC_CHECK_COMPILERS],
3061   AC_ARG_ENABLE(debug,
3062                 AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
3063   [
3064     case $enableval in
3065       yes)
3066         kde_use_debug_code="yes"
3067         kde_use_debug_define=no
3068         ;;
3069       full)
3070         kde_use_debug_code="full"
3071         kde_use_debug_define=no
3072         ;;
3073       *)
3074         kde_use_debug_code="no"
3075         kde_use_debug_define=yes
3076         ;;
3077     esac
3078   ], 
3079     [kde_use_debug_code="no"
3080       kde_use_debug_define=no
3081   ])
3083   dnl Just for configure --help
3084   AC_ARG_ENABLE(dummyoption,
3085                 AC_HELP_STRING([--disable-debug],
3086                                [disables debug output and debug symbols [default=no]]),
3087                 [],[])
3089   AC_ARG_ENABLE(strict,
3090                 AC_HELP_STRING([--enable-strict],
3091                               [compiles with strict compiler options (may not work!)]),
3092    [
3093     if test $enableval = "no"; then
3094          kde_use_strict_options="no"
3095        else
3096          kde_use_strict_options="yes"
3097     fi
3098    ], [kde_use_strict_options="no"])
3100   AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
3101    [
3102     if test $enableval = "no"; then
3103          kde_use_warnings="no"
3104        else
3105          kde_use_warnings="yes"
3106     fi
3107    ], [kde_use_warnings="yes"])
3109   dnl enable warnings for debug build
3110   if test "$kde_use_debug_code" != "no"; then
3111     kde_use_warnings=yes
3112   fi
3114   AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
3115     [kde_use_profiling=$enableval],
3116     [kde_use_profiling="no"]
3117   )
3119   dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
3120   CFLAGS=" $CFLAGS"
3122   AC_PROG_CC 
3124   AC_PROG_CPP
3126   if test "$GCC" = "yes"; then
3127     if test "$kde_use_debug_code" != "no"; then
3128       if test $kde_use_debug_code = "full"; then
3129         CFLAGS="-g3 -fno-inline $CFLAGS"
3130       else
3131         CFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CFLAGS"
3132       fi
3133     else
3134       CFLAGS="-O2 $CFLAGS"
3135     fi
3136   fi
3138   if test "$kde_use_debug_define" = "yes"; then
3139     CFLAGS="-DNDEBUG $CFLAGS"
3140   fi
3143   case "$host" in
3144   *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
3145   *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
3146   esac
3148   if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
3149      LDFLAGS=""
3150   fi
3152   CXXFLAGS=" $CXXFLAGS"
3154   AC_PROG_CXX
3156   KDE_CHECK_FOR_BAD_COMPILER
3158   if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
3159     if test "$kde_use_debug_code" != "no"; then
3160       if test "$CXX" = "KCC"; then
3161         CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
3162       else
3163         if test "$kde_use_debug_code" = "full"; then
3164           CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
3165         else
3166           CXXFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CXXFLAGS"
3167         fi
3168       fi
3169       KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
3171       dnl convenience compiler flags
3172       KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
3173       AC_SUBST(WOVERLOADED_VIRTUAL)
3174     else
3175       if test "$CXX" = "KCC"; then
3176         CXXFLAGS="+K3 $CXXFLAGS"
3177       else
3178         CXXFLAGS="-O2 $CXXFLAGS"
3179       fi
3180     fi
3181   fi
3183   if test "$kde_use_debug_define" = "yes"; then
3184     CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
3185   fi  
3187   if test "$kde_use_profiling" = "yes"; then
3188     KDE_CHECK_COMPILER_FLAG(pg,
3189     [
3190       CFLAGS="-pg $CFLAGS"
3191       CXXFLAGS="-pg $CXXFLAGS"
3192     ])
3193   fi
3195   if test "$kde_use_warnings" = "yes"; then
3196       if test "$GCC" = "yes"; then
3197         CXXFLAGS="-Wall -W -Wpointer-arith $CXXFLAGS"
3198         case $host in
3199           *-*-linux-gnu)        
3200             CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
3201             CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts $CXXFLAGS"
3202             KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
3203             KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
3204           ;;
3205         esac
3206         KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
3207         KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
3208         dnl ### FIXME: revert for KDE 4
3209         KDE_CHECK_COMPILER_FLAG(Wno-non-virtual-dtor,[CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"])
3210      fi
3211   fi
3213   if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
3214     CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
3215   fi
3217   AC_ARG_ENABLE(pch,
3218      AC_HELP_STRING([--enable-pch],
3219                     [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
3220     [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
3222   HAVE_GCC_VISIBILITY=0
3223   AC_SUBST([HAVE_GCC_VISIBILITY])
3225   if test "$GXX" = "yes"; then
3226     gcc_no_reorder_blocks=NO
3227     KDE_CHECK_COMPILER_FLAG(fno-reorder-blocks,[gcc_no_reorder_blocks=YES])
3228     if test $kde_use_debug_code != "no" && \
3229        test $kde_use_debug_code != "full" && \
3230        test "YES" = "$gcc_no_reorder_blocks" ; then
3231           CXXFLAGS="$CXXFLAGS -fno-reorder-blocks"
3232           CFLAGS="$CFLAGS -fno-reorder-blocks"
3233     fi
3234     KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
3235     KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
3236     KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
3237     KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS=       )
3238     ENABLE_PERMISSIVE_FLAG="-fpermissive"
3240     if test "$kde_use_pch" = "yes"; then
3241         AC_MSG_CHECKING(whether gcc supports precompiling c header files)
3242         echo >conftest.h
3243         if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
3244             kde_gcc_supports_pch=yes
3245             AC_MSG_RESULT(yes)
3246         else
3247             kde_gcc_supports_pch=no
3248             AC_MSG_RESULT(no)
3249         fi
3250         if test "$kde_gcc_supports_pch" = "yes"; then
3251             AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
3252             if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
3253                 kde_gcc_supports_pch=yes
3254                 AC_MSG_RESULT(yes)
3255             else
3256                 kde_gcc_supports_pch=no
3257                 AC_MSG_RESULT(no)
3258             fi
3259         fi
3260         rm -f conftest.h conftest.h.gch
3261     fi
3263     KDE_CHECK_FOR_OPT_NOINLINE_MATCH
3264     if test "x$kde_cv_opt_noinline_match" = "xno" ; then
3265        CFLAGS="`echo "$CFLAGS" | sed "s/ -fno-inline//"`"
3266     fi
3267   fi
3268   AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
3269   if test "$CXX" = "KCC"; then
3270     dnl unfortunately we currently cannot disable exception support in KCC
3271     dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
3272     dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
3273     dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS=   )
3275     if test "$kde_use_pch" = "yes"; then
3276       dnl TODO: support --pch-dir!
3277       KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
3278       dnl the below works (but the dir must exist), but it's
3279       dnl useless for a whole package.
3280       dnl The are precompiled headers for each source file, so when compiling
3281       dnl from scratch, it doesn't make a difference, and they take up
3282       dnl around ~5Mb _per_ sourcefile.
3283       dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
3284       dnl   [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
3285     fi
3286     dnl this flag controls inlining. by default KCC inlines in optimisation mode
3287     dnl all implementations that are defined inside the class {} declaration. 
3288     dnl because of templates-compatibility with broken gcc compilers, this
3289     dnl can cause excessive inlining. This flag limits it to a sane level
3290     KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
3291     KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
3292     KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
3293     KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
3294     dnl Some source files are shared between multiple executables
3295     dnl (or libraries) and some of those need template instantiations.
3296     dnl In that case KCC needs to compile those sources with
3297     dnl --one_instantiation_per_object.  To make it easy for us we compile
3298     dnl _all_ objects with that flag (--one_per is a shorthand).
3299     KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
3300   fi
3301   AC_SUBST(USE_EXCEPTIONS)
3302   dnl obsolete macro - provided to keep things going
3303   USE_RTTI=
3304   AC_SUBST(USE_RTTI)
3306   case "$host" in
3307       *-*-irix*)  test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
3308       *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
3309       *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
3310       *-*-solaris*) 
3311         if test "$GXX" = yes; then
3312           libstdcpp=`$CXX -print-file-name=libstdc++.so`
3313           if test ! -f $libstdcpp; then
3314              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])
3315           fi
3316         fi
3317         ;;
3318   esac
3320   AC_VALIDIFY_CXXFLAGS
3322   AC_PROG_CXXCPP
3324   if test "$GCC" = yes; then
3325      NOOPT_CFLAGS=-O0
3326   fi
3327   KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
3329   AC_ARG_ENABLE(coverage,
3330     AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
3331       if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
3332         ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
3333         ac_coverage_linker="-lgcc"
3334       elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
3335         ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
3336         ac_coverage_linker=""
3337       else
3338         AC_MSG_ERROR([coverage with your compiler is not supported])
3339       fi
3340       CFLAGS="$CFLAGS $ac_coverage_compiler"
3341       CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
3342       LDFLAGS="$LDFLAGS $ac_coverage_linker"
3343     ])
3345   AC_SUBST(NOOPT_CXXFLAGS)
3346   AC_SUBST(NOOPT_CFLAGS)
3347   AC_SUBST(ENABLE_PERMISSIVE_FLAG)
3349   KDE_CHECK_NEW_LDFLAGS
3350   KDE_CHECK_FINAL
3351   KDE_CHECK_CLOSURE
3352   KDE_CHECK_NMCHECK
3354   ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
3357 AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG],
3358   [
3359     AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug,
3360       [
3361         AC_LANG_SAVE
3362         AC_LANG_CPLUSPLUS
3364         safe_CXXFLAGS=$CXXFLAGS
3365         safe_LDFLAGS=$LDFLAGS
3366         CXXFLAGS="$CXXFLAGS -fPIC -fvisibility-inlines-hidden -O0"
3367         LDFLAGS="$LDFLAGS -shared -fPIC"
3369         AC_TRY_LINK(
3370         [
3371           /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
3372           #include <string>
3373           int some_function( void ) __attribute__ ((visibility("default")));
3374           int some_function( void )
3375           {
3376             std::string s("blafasel");
3377             return 0;
3378           }
3379         ], [/* elvis is alive */],
3380         kde_cv_val_gcc_visibility_bug=no, kde_cv_val_gcc_visibility_bug=yes)
3382         CXXFLAGS=$safe_CXXFLAGS
3383         LDFLAGS=$safe_LDFLAGS
3384         AC_LANG_RESTORE
3385       ]
3386     )
3388     if test x$kde_cv_val_gcc_visibility_bug = xno; then
3389       CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
3390     fi
3391   ]
3394 AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
3396   AC_BEFORE([AC_PATH_QT_1_3], [KDE_ENABLE_HIDDEN_VISIBILITY])
3398   AC_MSG_CHECKING([grepping for visibility push/pop in headers])
3400   if test "x$GXX" = "xyes"; then
3401     AC_LANG_SAVE
3402     AC_LANG_CPLUSPLUS
3403     AC_EGREP_CPP(
3404        [GCC visibility push],
3405        [ #include <exception> 
3406        ], 
3407     [
3408       AC_MSG_RESULT(yes)
3409       kde_stdc_visibility_patched=yes ],
3410     [ 
3411       AC_MSG_RESULT(no)
3412       AC_MSG_WARN([Your libstdc++ doesn't appear to be patched for 
3413                    visibility support. Disabling -fvisibility=hidden])
3415       kde_stdc_visibility_patched=no ])
3417     AC_LANG_RESTORE
3419     kde_have_gcc_visibility=no
3420     KDE_CHECK_COMPILER_FLAG(fvisibility=hidden, 
3421     [
3422       kde_have_gcc_visibility=yes
3423       dnl the whole toolchain is just a mess, gcc is just too buggy
3424       dnl to handle STL with visibility enabled. Lets reconsider 
3425       dnl when gcc 4.2 is out or when things get fixed in the compiler.
3426       dnl Contact mueller@kde.org for details.
3427       AC_ARG_ENABLE(gcc-hidden-visibility,
3428         AC_HELP_STRING([--enable-gcc-hidden-visibility],[toolchain hidden visibility [default=no]]),
3429           [kde_have_gcc_visibility=$enableval],
3430           [kde_have_gcc_visibility=no])
3432       AC_CACHE_CHECK([if Qt is patched for -fvisibility], kde_cv_val_qt_gcc_visibility_patched,
3433         [
3434           AC_LANG_SAVE
3435           AC_LANG_CPLUSPLUS
3437           safe_CXXFLAGS=$CXXFLAGS
3438           CXXFLAGS="$CXXFLAGS $all_includes"
3440           AC_TRY_COMPILE(
3441           [
3442 #include <qglobal.h>
3443 #if Q_EXPORT - 0 != 0
3444 /* if this compiles, then Q_EXPORT is undefined */
3445 /* if Q_EXPORT is nonempty, this will break compilation */
3446 #endif
3447           ], [/* elvis is alive */],
3448           kde_cv_val_qt_gcc_visibility_patched=no, kde_cv_val_qt_gcc_visibility_patched=yes)
3450           CXXFLAGS=$safe_CXXFLAGS
3451           AC_LANG_RESTORE
3452         ]
3453       )
3455       if test x$kde_have_gcc_visibility = "xyes" && test x$kde_stdc_visibility_patched = "xyes" && test x$kde_cv_val_qt_gcc_visibility_patched = "xyes"; then
3456         CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
3457         KDE_CHECK_VISIBILITY_GCC_BUG
3458         HAVE_GCC_VISIBILITY=1
3459         AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
3460       fi
3461     ])
3462   fi
3465 AC_DEFUN([KDE_ADD_DEPENDENCIES],
3467    [A]M_DEPENDENCIES(CC)
3468    [A]M_DEPENDENCIES(CXX)
3471 dnl just a wrapper to clean up configure.in
3472 AC_DEFUN([KDE_PROG_LIBTOOL],
3474 AC_REQUIRE([AC_CHECK_COMPILERS])
3475 AC_REQUIRE([AC_ENABLE_SHARED])
3476 AC_REQUIRE([AC_ENABLE_STATIC])
3478 AC_REQUIRE([AC_LIBTOOL_DLOPEN])
3479 AC_REQUIRE([KDE_CHECK_LIB64])
3481 AC_OBJEXT
3482 AC_EXEEXT
3484 AM_PROG_LIBTOOL
3485 AC_LIBTOOL_CXX
3487 LIBTOOL_SHELL="/bin/sh ./libtool"
3488 #  LIBTOOL="$LIBTOOL --silent"
3489 KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
3490 AC_SUBST(KDE_PLUGIN)
3492 # This hack ensures that libtool creates shared libs for kunittest plugins. By default check_LTLIBRARIES makes static libs.
3493 KDE_CHECK_PLUGIN="\$(KDE_PLUGIN) -rpath \$(libdir)"
3494 AC_SUBST(KDE_CHECK_PLUGIN)
3496 # we patch configure quite some so we better keep that consistent for incremental runs 
3497 AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
3500 AC_DEFUN([KDE_CHECK_LIB64],
3502     AC_ARG_ENABLE(libsuffix,
3503         AC_HELP_STRING([--enable-libsuffix],
3504             [/lib directory suffix (64,32,none,auto[=default])]),
3505             kdelibsuff=$enableval, kdelibsuff="auto")
3506     
3507     if test "$kdelibsuff" = "auto"; then
3508     
3509 cat > conftest.c << EOF
3510 #include <stdio.h>
3511 int main() {
3512  return 0;
3515         kdelibsuff=`$CC conftest.c -o conftest.out; ldd conftest.out |sed -ne '/libc.so/{
3516     s,.*/lib\([[^\/]]*\)/.*,\1, 
3517     p 
3519         rm -rf conftest.*
3520     fi  
3521         
3522     if test "$kdelibsuff" = "no" || test "$kdelibsuff" = "none"; then
3523        kdelibsuff=
3524     fi
3525     if test -z "$kdelibsuff"; then
3526         AC_MSG_RESULT([not using lib directory suffix])
3527         AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
3528     else
3529         if test "$libdir" = '${exec_prefix}/lib'; then
3530             libdir="$libdir${kdelibsuff}"
3531             AC_SUBST([libdir], ["$libdir"])  dnl ugly hack for lib64 platforms
3532         fi
3533         AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${kdelibsuff}"], Suffix for lib directories)
3534         AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
3535     fi
3538 AC_DEFUN([KDE_CHECK_TYPES],
3539 [  AC_CHECK_SIZEOF(int, 4)dnl
3540    AC_CHECK_SIZEOF(short)dnl
3541   AC_CHECK_SIZEOF(long, 4)dnl
3542   AC_CHECK_SIZEOF(char *, 4)dnl
3543 ])dnl
3545 dnl Not used - kept for compat only?
3546 AC_DEFUN([KDE_DO_IT_ALL],
3548 AC_CANONICAL_SYSTEM
3549 AC_ARG_PROGRAM
3550 AM_INIT_AUTOMAKE($1, $2)
3551 AM_DISABLE_LIBRARIES
3552 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
3553 AC_CHECK_COMPILERS
3554 KDE_PROG_LIBTOOL
3555 AM_KDE_WITH_NLS
3556 AC_PATH_KDE
3559 AC_DEFUN([AC_CHECK_RPATH],
3561 AC_MSG_CHECKING(for rpath)
3562 AC_ARG_ENABLE(rpath,
3563       AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
3564       USE_RPATH=$enableval, USE_RPATH=yes)
3566 if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
3568   KDE_RPATH="-R \$(libdir)"
3570   if test "$kde_libraries" != "$libdir"; then
3571       KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)"
3572   fi
3574   if test -n "$qt_libraries"; then
3575     KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
3576   fi
3577   dnl $x_libraries is set to /usr/lib in case
3578   if test -n "$X_LDFLAGS"; then
3579     X_RPATH="-R \$(x_libraries)"
3580     KDE_RPATH="$KDE_RPATH $X_RPATH"
3581   fi
3582   if test -n "$KDE_EXTRA_RPATH"; then
3583     KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
3584   fi
3586 AC_SUBST(KDE_EXTRA_RPATH)
3587 AC_SUBST(KDE_RPATH)
3588 AC_SUBST(X_RPATH)
3589 AC_MSG_RESULT($USE_RPATH)
3592 dnl Check for the type of the third argument of getsockname
3593 AC_DEFUN([AC_CHECK_SOCKLEN_T],
3595    AC_MSG_CHECKING(for socklen_t)
3596    AC_CACHE_VAL(kde_cv_socklen_t,
3597    [
3598       AC_LANG_PUSH(C++)
3599       kde_cv_socklen_t=no
3600       AC_TRY_COMPILE([
3601          #include <sys/types.h>
3602          #include <sys/socket.h>
3603       ],
3604       [
3605          socklen_t len;
3606          getpeername(0,0,&len);
3607       ],
3608       [
3609          kde_cv_socklen_t=yes
3610          kde_cv_socklen_t_equiv=socklen_t
3611       ])
3612       AC_LANG_POP(C++)
3613    ])
3614    AC_MSG_RESULT($kde_cv_socklen_t)
3615    if test $kde_cv_socklen_t = no; then
3616       AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
3617       AC_CACHE_VAL(kde_cv_socklen_t_equiv,
3618       [
3619          kde_cv_socklen_t_equiv=int
3620          AC_LANG_PUSH(C++)
3621          for t in int size_t unsigned long "unsigned long"; do
3622             AC_TRY_COMPILE([
3623                #include <sys/types.h>
3624                #include <sys/socket.h>
3625             ],
3626             [
3627                $t len;
3628                getpeername(0,0,&len);
3629             ],
3630             [
3631                kde_cv_socklen_t_equiv="$t"
3632                break
3633             ])
3634          done
3635          AC_LANG_POP(C++)
3636       ])
3637       AC_MSG_RESULT($kde_cv_socklen_t_equiv)
3638    fi
3639    AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
3640                      [type to use in place of socklen_t if not defined])
3641    AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
3642                      [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
3645 dnl This is a merge of some macros out of the gettext aclocal.m4
3646 dnl since we don't need anything, I took the things we need
3647 dnl the copyright for them is:
3648 dnl >
3649 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3650 dnl This Makefile.in is free software; the Free Software Foundation
3651 dnl gives unlimited permission to copy and/or distribute it,
3652 dnl with or without modifications, as long as this notice is preserved.
3654 dnl This program is distributed in the hope that it will be useful,
3655 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
3656 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
3657 dnl PARTICULAR PURPOSE.
3658 dnl >
3659 dnl for this file it is relicensed under LGPL
3661 AC_DEFUN([AM_KDE_WITH_NLS],
3662   [
3663     dnl If we use NLS figure out what method
3665     AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
3666         [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
3667     AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
3669      if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
3670         AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
3671         GMSGFMT=":"
3672       fi
3673       MSGFMT=$GMSGFMT
3674       AC_SUBST(GMSGFMT)
3675       AC_SUBST(MSGFMT)
3677       AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
3678         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
3680       dnl Test whether we really found GNU xgettext.
3681       if test "$XGETTEXT" != ":"; then
3682         dnl If it is no GNU xgettext we define it as : so that the
3683         dnl Makefiles still can work.
3684         if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
3685           : ;
3686         else
3687           AC_MSG_RESULT(
3688             [found xgettext programs is not GNU xgettext; ignore it])
3689           XGETTEXT=":"
3690         fi
3691       fi
3692      AC_SUBST(XGETTEXT)
3694   ])
3696 # Search path for a program which passes the given test.
3697 # Ulrich Drepper <drepper@cygnus.com>, 1996.
3699 # serial 1
3700 # Stephan Kulow: I appended a _KDE against name conflicts
3702 dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
3703 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3704 AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
3705 [# Extract the first word of "$2", so it can be a program name with args.
3706 set dummy $2; ac_word=[$]2
3707 AC_MSG_CHECKING([for $ac_word])
3708 AC_CACHE_VAL(ac_cv_path_$1,
3709 [case "[$]$1" in
3710   /*)
3711   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3712   ;;
3713   *)
3714   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3715   for ac_dir in ifelse([$5], , $PATH, [$5]); do
3716     test -z "$ac_dir" && ac_dir=.
3717     if test -f $ac_dir/$ac_word; then
3718       if [$3]; then
3719         ac_cv_path_$1="$ac_dir/$ac_word"
3720         break
3721       fi
3722     fi
3723   done
3724   IFS="$ac_save_ifs"
3725 dnl If no 4th arg is given, leave the cache variable unset,
3726 dnl so AC_PATH_PROGS will keep looking.
3727 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3728 ])dnl
3729   ;;
3730 esac])dnl
3731 $1="$ac_cv_path_$1"
3732 if test -n "[$]$1"; then
3733   AC_MSG_RESULT([$]$1)
3734 else
3735   AC_MSG_RESULT(no)
3737 AC_SUBST($1)dnl
3741 # Check whether LC_MESSAGES is available in <locale.h>.
3742 # Ulrich Drepper <drepper@cygnus.com>, 1995.
3744 # serial 1
3746 AC_DEFUN([AM_LC_MESSAGES],
3747   [if test $ac_cv_header_locale_h = yes; then
3748     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
3749       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
3750        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
3751     if test $am_cv_val_LC_MESSAGES = yes; then
3752       AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
3753     fi
3754   fi])
3756 dnl From Jim Meyering.
3757 dnl FIXME: migrate into libit.
3759 AC_DEFUN([AM_FUNC_OBSTACK],
3760 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
3761  [AC_TRY_LINK([#include "obstack.h"],
3762               [struct obstack *mem;obstack_free(mem,(char *) 0)],
3763               am_cv_func_obstack=yes,
3764               am_cv_func_obstack=no)])
3765  if test $am_cv_func_obstack = yes; then
3766    AC_DEFINE(HAVE_OBSTACK)
3767  else
3768    LIBOBJS="$LIBOBJS obstack.o"
3769  fi
3772 dnl From Jim Meyering.  Use this if you use the GNU error.[ch].
3773 dnl FIXME: Migrate into libit
3775 AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
3776 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
3777  [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
3778               am_cv_lib_error_at_line=yes,
3779               am_cv_lib_error_at_line=no)])
3780  if test $am_cv_lib_error_at_line = no; then
3781    LIBOBJS="$LIBOBJS error.o"
3782  fi
3783  AC_SUBST(LIBOBJS)dnl
3786 # Macro to add for using GNU gettext.
3787 # Ulrich Drepper <drepper@cygnus.com>, 1995.
3789 # serial 1
3790 # Stephan Kulow: I put a KDE in it to avoid name conflicts
3792 AC_DEFUN([AM_KDE_GNU_GETTEXT],
3793   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3794    AC_REQUIRE([AC_PROG_RANLIB])dnl
3795    AC_REQUIRE([AC_HEADER_STDC])dnl
3796    AC_REQUIRE([AC_TYPE_OFF_T])dnl
3797    AC_REQUIRE([AC_TYPE_SIZE_T])dnl
3798    AC_REQUIRE([AC_FUNC_ALLOCA])dnl
3799    AC_REQUIRE([AC_FUNC_MMAP])dnl
3800    AC_REQUIRE([AM_KDE_WITH_NLS])dnl
3801    AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
3802    AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
3803 __argz_count __argz_stringify __argz_next])
3805    AC_MSG_CHECKING(for stpcpy)
3806    AC_CACHE_VAL(kde_cv_func_stpcpy,
3807    [
3808    kde_safe_cxxflags=$CXXFLAGS
3809    CXXFLAGS="-Werror"
3810    AC_LANG_SAVE
3811    AC_LANG_CPLUSPLUS
3812    AC_TRY_COMPILE([
3813    #include <string.h>
3814    ],
3815    [
3816    char buffer[200];
3817    stpcpy(buffer, buffer);
3818    ],
3819    kde_cv_func_stpcpy=yes,
3820    kde_cv_func_stpcpy=no)
3821    AC_LANG_RESTORE
3822    CXXFLAGS=$kde_safe_cxxflags
3823    ])
3824    AC_MSG_RESULT($kde_cv_func_stpcpy)
3825    if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
3826      AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
3827    fi
3829    AM_LC_MESSAGES
3831    if test "x$CATOBJEXT" != "x"; then
3832      if test "x$ALL_LINGUAS" = "x"; then
3833        LINGUAS=
3834      else
3835        AC_MSG_CHECKING(for catalogs to be installed)
3836        NEW_LINGUAS=
3837        for lang in ${LINGUAS=$ALL_LINGUAS}; do
3838          case "$ALL_LINGUAS" in
3839           *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
3840          esac
3841        done
3842        LINGUAS=$NEW_LINGUAS
3843        AC_MSG_RESULT($LINGUAS)
3844      fi
3846      dnl Construct list of names of catalog files to be constructed.
3847      if test -n "$LINGUAS"; then
3848        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
3849      fi
3850    fi
3852   ])
3854 AC_DEFUN([AC_HAVE_XPM],
3855  [AC_REQUIRE_CPP()dnl
3856   AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3858  test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
3859  test -z "$XPM_INCLUDE" && XPM_INCLUDE=
3861  AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
3862         xpm_test=$withval, xpm_test="yes")
3863  if test "x$xpm_test" = xno; then
3864    ac_cv_have_xpm=no
3865  else
3866    AC_MSG_CHECKING(for XPM)
3867    AC_CACHE_VAL(ac_cv_have_xpm,
3868    [
3869     ac_save_ldflags="$LDFLAGS"
3870     ac_save_cflags="$CFLAGS"
3871     if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
3872       LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
3873     else
3874       LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
3875     fi
3876     CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
3877     test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
3878     AC_TRY_LINK([#include <X11/xpm.h>],[],
3879         ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
3880     LDFLAGS="$ac_save_ldflags"
3881     CFLAGS="$ac_save_cflags"
3882    ])dnl
3884   if test "$ac_cv_have_xpm" = no; then
3885     AC_MSG_RESULT(no)
3886     XPM_LDFLAGS=""
3887     XPMINC=""
3888     $2
3889   else
3890     AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
3891     if test "$XPM_LDFLAGS" = ""; then
3892        XPMLIB='-lXpm $(LIB_X11)'
3893     else
3894        XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
3895     fi
3896     if test "$XPM_INCLUDE" = ""; then
3897        XPMINC=""
3898     else
3899        XPMINC="-I$XPM_INCLUDE"
3900     fi
3901     AC_MSG_RESULT(yes)
3902     $1
3903   fi
3904  fi
3905  AC_SUBST(XPMINC)
3906  AC_SUBST(XPMLIB)
3909 AC_DEFUN([AC_HAVE_DPMS],
3910  [AC_REQUIRE_CPP()dnl
3911   AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3913  test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
3914  test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
3915  DPMS_LIB=
3917  AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
3918         dpms_test=$withval, dpms_test="yes")
3919  if test "x$dpms_test" = xno; then
3920    ac_cv_have_dpms=no
3921  else
3922    AC_MSG_CHECKING(for DPMS)
3923    dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
3924    dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
3925    AC_CACHE_VAL(ac_cv_have_dpms,
3926    [
3927     if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
3928       AC_MSG_RESULT(no)
3929       ac_cv_have_dpms="no"
3930     else
3931       ac_save_ldflags="$LDFLAGS"
3932       ac_save_cflags="$CFLAGS"
3933       ac_save_libs="$LIBS"
3934       LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries"
3935       LIBS="-lX11 -lXext $LIBSOCKET"
3936       CFLAGS="$CFLAGS $X_INCLUDES"
3937       test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3938       AC_TRY_LINK([
3939           #include <X11/Xproto.h>
3940           #include <X11/X.h>
3941           #include <X11/Xlib.h>
3942           #include <X11/extensions/dpms.h>
3943           int foo_test_dpms()
3944           { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3945           ac_cv_have_dpms="yes", [
3946               LIBS="-lXdpms $LIBS"
3947               AC_TRY_LINK([
3948                   #include <X11/Xproto.h>
3949                   #include <X11/X.h>
3950                   #include <X11/Xlib.h>
3951                   #include <X11/extensions/dpms.h>
3952                   int foo_test_dpms()
3953                   { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3954                   [
3955                   ac_cv_have_dpms="-lXdpms"
3956                   ],ac_cv_have_dpms="no")
3957               ])
3958       LDFLAGS="$ac_save_ldflags"
3959       CFLAGS="$ac_save_cflags"
3960       LIBS="$ac_save_libs"
3961     fi
3962    ])dnl
3964   if test "$ac_cv_have_dpms" = no; then
3965     AC_MSG_RESULT(no)
3966     DPMS_LDFLAGS=""
3967     DPMSINC=""
3968     $2
3969   else
3970     AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
3971     if test "$ac_cv_have_dpms" = "-lXdpms"; then
3972        DPMS_LIB="-lXdpms"
3973     fi
3974     if test "$DPMS_LDFLAGS" = ""; then
3975        DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
3976     else
3977        DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
3978     fi
3979     if test "$DPMS_INCLUDE" = ""; then
3980        DPMSINC=""
3981     else
3982        DPMSINC="-I$DPMS_INCLUDE"
3983     fi
3984     AC_MSG_RESULT(yes)
3985     $1
3986   fi
3987  fi
3988  ac_save_cflags="$CFLAGS"
3989  CFLAGS="$CFLAGS $X_INCLUDES"
3990  test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3991  AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
3992    [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
3993  AC_CHECK_DECL(DPMSCapable,
3994    AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
3995    [#include <X11/Xlib.h>
3996    #include <X11/extensions/dpms.h>])
3997  AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
3998    [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
3999  AC_CHECK_DECL(DPMSInfo,
4000    AC_DEFINE(HAVE_DPMSINFO_PROTO),,
4001    [#include <X11/Xlib.h>
4002    #include <X11/extensions/dpms.h>])
4003  CFLAGS="$ac_save_cflags"
4004  AC_SUBST(DPMSINC)
4005  AC_SUBST(DPMSLIB)
4008 AC_DEFUN([AC_HAVE_GL],
4009  [AC_REQUIRE_CPP()dnl
4010   AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
4012  test -z "$GL_LDFLAGS" && GL_LDFLAGS=
4013  test -z "$GL_INCLUDE" && GL_INCLUDE=
4015  AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
4016         gl_test=$withval, gl_test="yes")
4017  if test "x$kde_use_qt_emb" = "xyes"; then
4018    # GL and Qt Embedded is a no-go for now.
4019    ac_cv_have_gl=no
4020  elif test "x$gl_test" = xno; then
4021    ac_cv_have_gl=no
4022  else
4023    AC_MSG_CHECKING(for GL)
4024    AC_CACHE_VAL(ac_cv_have_gl,
4025    [
4026     AC_LANG_SAVE
4027     AC_LANG_CPLUSPLUS
4028     ac_save_ldflags=$LDFLAGS
4029     ac_save_cxxflags=$CXXFLAGS
4030     ac_save_libs=$LIBS
4031     LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries"
4032     LIBS="$LIBS -lGL -lGLU"
4033     test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LIBS="$LIBS -lX11"
4034     LIBS="$LIBS $LIB_XEXT -lm $LIBSOCKET"
4035     CXXFLAGS="$CFLAGS $X_INCLUDES"
4036     test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
4037     AC_TRY_LINK([#include <GL/gl.h>
4038 #include <GL/glu.h>
4039 ], [],
4040         ac_cv_have_gl="yes", ac_cv_have_gl="no")
4041     AC_LANG_RESTORE
4042     LDFLAGS=$ac_save_ldflags
4043     CXXFLAGS=$ac_save_cxxflags
4044     LIBS=$ac_save_libs
4045    ])dnl
4047   if test "$ac_cv_have_gl" = "no"; then
4048     AC_MSG_RESULT(no)
4049     GL_LDFLAGS=""
4050     GLINC=""
4051     $2
4052   else
4053     AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
4054     if test "$GL_LDFLAGS" = ""; then
4055        GLLIB='-lGLU -lGL $(LIB_X11)'
4056     else
4057        GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
4058     fi
4059     if test "$GL_INCLUDE" = ""; then
4060        GLINC=""
4061     else
4062        GLINC="-I$GL_INCLUDE"
4063     fi
4064     AC_MSG_RESULT($ac_cv_have_gl)
4065     $1
4066   fi
4067  fi
4068  AC_SUBST(GLINC)
4069  AC_SUBST(GLLIB)
4073  dnl shadow password and PAM magic - maintained by ossi@kde.org
4075 AC_DEFUN([KDE_PAM], [
4076   AC_REQUIRE([KDE_CHECK_LIBDL])
4078   want_pam=
4079   AC_ARG_WITH(pam,
4080     AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
4081     [ if test "x$withval" = "xyes"; then
4082         want_pam=yes
4083         pam_service=kde
4084       elif test "x$withval" = "xno"; then
4085         want_pam=no
4086       else
4087         want_pam=yes
4088         pam_service=$withval
4089       fi
4090     ], [ pam_service=kde ])
4092   use_pam=
4093   PAMLIBS=
4094   if test "x$want_pam" != xno; then
4095     AC_CHECK_LIB(pam, pam_start, [
4096       AC_CHECK_HEADER(security/pam_appl.h,
4097         [ pam_header=security/pam_appl.h ],
4098         [ AC_CHECK_HEADER(pam/pam_appl.h,
4099             [ pam_header=pam/pam_appl.h ],
4100             [
4101     AC_MSG_WARN([PAM detected, but no headers found!
4102 Make sure you have the necessary development packages installed.])
4103             ]
4104           )
4105         ]
4106       )
4107     ], , $LIBDL)
4108     if test -z "$pam_header"; then
4109       if test "x$want_pam" = xyes; then
4110         AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
4111       fi
4112     else
4113       AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
4114       PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
4115       use_pam=yes
4117       dnl darwin claims to be something special
4118       if test "$pam_header" = "pam/pam_appl.h"; then
4119         AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
4120       fi
4122       dnl test whether struct pam_message is const (Linux) or not (Sun)
4123       AC_MSG_CHECKING(for const pam_message)
4124       AC_EGREP_HEADER([struct pam_message], $pam_header,
4125         [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
4126                           [AC_MSG_RESULT([const: Linux-type PAM])],
4127                           [AC_MSG_RESULT([nonconst: Sun-type PAM])
4128                           AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
4129                           )],
4130         [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
4131     fi
4132   fi
4134   AC_SUBST(PAMLIBS)
4137 dnl DEF_PAM_SERVICE(arg name, full name, define name)
4138 AC_DEFUN([DEF_PAM_SERVICE], [
4139   AC_ARG_WITH($1-pam,
4140     AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
4141     [ if test "x$use_pam" = xyes; then
4142         $3_PAM_SERVICE=$withval
4143       else
4144         AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
4145 You may want to enforce it by using --with-pam.])
4146       fi
4147     ], 
4148     [ if test "x$use_pam" = xyes; then
4149         $3_PAM_SERVICE="$pam_service"
4150       fi
4151     ])
4152     if test -n "$$3_PAM_SERVICE"; then
4153       AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
4154       AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
4155     fi
4156     AC_SUBST($3_PAM_SERVICE)
4159 AC_DEFUN([KDE_SHADOWPASSWD], [
4160   AC_REQUIRE([KDE_PAM])
4162   AC_CHECK_LIB(shadow, getspent,
4163     [ LIBSHADOW="-lshadow"
4164       ac_use_shadow=yes
4165     ],
4166     [ dnl for UnixWare
4167       AC_CHECK_LIB(gen, getspent, 
4168         [ LIBGEN="-lgen"
4169           ac_use_shadow=yes
4170         ], 
4171         [ AC_CHECK_FUNC(getspent, 
4172             [ ac_use_shadow=yes ],
4173             [ ac_use_shadow=no ])
4174         ])
4175     ])
4176   AC_SUBST(LIBSHADOW)
4177   AC_SUBST(LIBGEN)
4178   
4179   AC_MSG_CHECKING([for shadow passwords])
4181   AC_ARG_WITH(shadow,
4182     AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
4183     [ if test "x$withval" != "xno"; then
4184         use_shadow=yes
4185       else
4186         use_shadow=no
4187       fi
4188     ], [
4189       use_shadow="$ac_use_shadow"
4190     ])
4192   if test "x$use_shadow" = xyes; then
4193     AC_MSG_RESULT(yes)
4194     AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
4195   else
4196     AC_MSG_RESULT(no)
4197     LIBSHADOW=
4198     LIBGEN=
4199   fi
4201   dnl finally make the relevant binaries setuid root, if we have shadow passwds.
4202   dnl this still applies, if we could use it indirectly through pam.
4203   if test "x$use_shadow" = xyes || 
4204      ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
4205       case $host in
4206       *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
4207         SETUIDFLAGS="-m 4755 -o root";;
4208       *)
4209         SETUIDFLAGS="-m 4755";;
4210       esac
4211   fi
4212   AC_SUBST(SETUIDFLAGS)
4216 AC_DEFUN([KDE_PASSWDLIBS], [
4217   AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
4218   AC_REQUIRE([KDE_PAM])
4219   AC_REQUIRE([KDE_SHADOWPASSWD])
4221   if test "x$use_pam" = "xyes"; then 
4222     PASSWDLIBS="$PAMLIBS"
4223   else
4224     PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
4225   fi
4227   dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
4228   dnl /etc/master.passwd holds the actual passwords.  /etc/master.passwd requires
4229   dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
4230   dnl may need to read /etc/master.passwd).
4231   case $host in
4232   *-*-freebsd*)
4233     SETUIDFLAGS="-m 4755 -o root"
4234     ;;
4235   *)
4236     ;;
4237   esac
4239   AC_SUBST(PASSWDLIBS)
4242 AC_DEFUN([KDE_CHECK_LIBDL],
4244 AC_CHECK_LIB(dl, dlopen, [
4245 LIBDL="-ldl"
4246 ac_cv_have_dlfcn=yes
4249 AC_CHECK_LIB(dld, shl_unload, [
4250 LIBDL="-ldld"
4251 ac_cv_have_shload=yes
4254 AC_SUBST(LIBDL)
4257 AC_DEFUN([KDE_CHECK_DLOPEN],
4259 KDE_CHECK_LIBDL
4260 AC_CHECK_HEADERS(dlfcn.h dl.h)
4261 if test "$ac_cv_header_dlfcn_h" = "no"; then
4262   ac_cv_have_dlfcn=no
4265 if test "$ac_cv_header_dl_h" = "no"; then
4266   ac_cv_have_shload=no
4269 dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
4270 dnl (MM)
4271 AC_ARG_ENABLE(dlopen,
4272 AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
4273 enable_dlopen=$enableval,
4274 enable_dlopen=yes)
4276 # override the user's opinion, if we know it better ;)
4277 if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
4278   enable_dlopen=no
4281 if test "$ac_cv_have_dlfcn" = "yes"; then
4282   AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
4285 if test "$ac_cv_have_shload" = "yes"; then
4286   AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
4289 if test "$enable_dlopen" = no ; then
4290   test -n "$1" && eval $1
4291 else
4292   test -n "$2" && eval $2
4297 AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
4299 KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
4300 KDE_PROG_LIBTOOL
4301 AC_MSG_CHECKING([dynamic loading])
4302 eval "`egrep '^build_libtool_libs=' libtool`"
4303 if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
4304   dynamic_loading=yes
4305   AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
4306 else
4307   dynamic_loading=no
4309 AC_MSG_RESULT($dynamic_loading)
4310 if test "$dynamic_loading" = "yes"; then
4311   $1
4312 else
4313   $2
4317 AC_DEFUN([KDE_ADD_INCLUDES],
4319 if test -z "$1"; then
4320   test_include="Pix.h"
4321 else
4322   test_include="$1"
4325 AC_MSG_CHECKING([for libg++ ($test_include)])
4327 AC_CACHE_VAL(kde_cv_libgpp_includes,
4329 kde_cv_libgpp_includes=no
4331    for ac_dir in               \
4332                                \
4333      /usr/include/g++          \
4334      /usr/include              \
4335      /usr/unsupported/include  \
4336      /opt/include              \
4337      $extra_include            \
4338      ; \
4339    do
4340      if test -r "$ac_dir/$test_include"; then
4341        kde_cv_libgpp_includes=$ac_dir
4342        break
4343      fi
4344    done
4347 AC_MSG_RESULT($kde_cv_libgpp_includes)
4348 if test "$kde_cv_libgpp_includes" != "no"; then
4349   all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
4354 AC_DEFUN([KDE_CHECK_LIBPTHREAD],
4356   dnl This code is here specifically to handle the
4357   dnl various flavors of threading library on FreeBSD
4358   dnl 4-, 5-, and 6-, and the (weird) rules around it.
4359   dnl There may be an environment PTHREAD_LIBS that 
4360   dnl specifies what to use; otherwise, search for it.
4361   dnl -pthread is special cased and unsets LIBPTHREAD
4362   dnl below if found.
4363   LIBPTHREAD=""
4365   if test -n "$PTHREAD_LIBS"; then
4366     if test "x$PTHREAD_LIBS" = "x-pthread" ; then
4367       LIBPTHREAD="PTHREAD"
4368     else
4369       PTHREAD_LIBS_save="$PTHREAD_LIBS"
4370       PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
4371       AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
4372       KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
4373           LIBPTHREAD="$PTHREAD_LIBS_save"])
4374       PTHREAD_LIBS="$PTHREAD_LIBS_save"
4375     fi
4376   fi
4378   dnl Is this test really needed, in the face of the Tru64 test below?
4379   if test -z "$LIBPTHREAD"; then
4380     AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
4381   fi
4383   dnl This is a special Tru64 check, see BR 76171 issue #18.
4384   if test -z "$LIBPTHREAD" ; then
4385     AC_MSG_CHECKING([for pthread_create in -lpthread])
4386     kde_safe_libs=$LIBS
4387     LIBS="$LIBS -lpthread"
4388     AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
4389         AC_MSG_RESULT(yes)
4390         LIBPTHREAD="-lpthread"],[
4391         AC_MSG_RESULT(no)])
4392     LIBS=$kde_safe_libs
4393   fi
4395   dnl Un-special-case for FreeBSD.
4396   if test "x$LIBPTHREAD" = "xPTHREAD" ; then
4397     LIBPTHREAD=""
4398   fi
4400   AC_SUBST(LIBPTHREAD)
4403 AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
4405       USE_THREADS=""
4406       if test -z "$LIBPTHREAD"; then
4407         KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
4408       fi
4410     AH_VERBATIM(__svr_define, [
4411 #if defined(__SVR4) && !defined(__svr4__)
4412 #define __svr4__ 1
4413 #endif
4415     case $host_os in
4416         solaris*)
4417                 KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
4418                 CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
4419                 ;;
4420         freebsd*)
4421                 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
4422                 ;;
4423         aix*)
4424                 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
4425                 LIBPTHREAD="$LIBPTHREAD -lc_r"
4426                 ;;
4427         linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
4428                 if test "$CXX" = "KCC"; then
4429                   CXXFLAGS="$CXXFLAGS --thread_safe"
4430                   NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
4431                 fi
4432                 ;;
4433         *)
4434                 ;;
4435     esac
4436     AC_SUBST(USE_THREADS)
4437     AC_SUBST(LIBPTHREAD)
4440 AC_DEFUN([KDE_CHECK_THREADING],
4442   AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4443   AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
4444   dnl default is yes if libpthread is found and no if no libpthread is available
4445   if test -z "$LIBPTHREAD"; then
4446     if test -z "$USE_THREADS"; then
4447       kde_check_threading_default=no
4448     else
4449       kde_check_threading_default=yes
4450     fi
4451   else
4452     kde_check_threading_default=yes
4453   fi
4454   AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
4455    kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
4456   if test "x$kde_use_threading" = "xyes"; then
4457     AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
4458   fi
4461 AC_DEFUN([KDE_TRY_LINK_PYTHON],
4463 if test "$kde_python_link_found" = no; then
4465 if test "$1" = normal; then
4466   AC_MSG_CHECKING(if a Python application links)
4467 else
4468   AC_MSG_CHECKING(if Python depends on $2)
4471 AC_CACHE_VAL(kde_cv_try_link_python_$1,
4473 kde_save_cflags="$CFLAGS"
4474 CFLAGS="$CFLAGS $PYTHONINC"
4475 kde_save_libs="$LIBS"
4476 LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
4477 kde_save_ldflags="$LDFLAGS"
4478 LDFLAGS="$LDFLAGS $PYTHONLIB"
4480 AC_TRY_LINK(
4482 #include <Python.h>
4484         PySys_SetArgv(1, 0);
4486         [kde_cv_try_link_python_$1=yes],
4487         [kde_cv_try_link_python_$1=no]
4489 CFLAGS="$kde_save_cflags"
4490 LIBS="$kde_save_libs"
4491 LDFLAGS="$kde_save_ldflags"
4494 if test "$kde_cv_try_link_python_$1" = "yes"; then
4495   AC_MSG_RESULT(yes)
4496   kde_python_link_found=yes
4497   if test ! "$1" = normal; then
4498     LIBPYTHON="$LIBPYTHON $2"
4499   fi
4500   $3
4501 else
4502   AC_MSG_RESULT(no)
4503   $4
4510 AC_DEFUN([KDE_CHECK_PYTHON_DIR],
4512 AC_MSG_CHECKING([for Python directory])
4514 AC_CACHE_VAL(kde_cv_pythondir,
4516   if test -z "$PYTHONDIR"; then
4517     kde_cv_pythondir=/usr/local
4518   else
4519     kde_cv_pythondir="$PYTHONDIR"
4520   fi
4523 AC_ARG_WITH(pythondir,
4524 AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
4526   ac_python_dir=$withval
4527 ], ac_python_dir=$kde_cv_pythondir
4530 AC_MSG_RESULT($ac_python_dir)
4533 AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
4535 AC_REQUIRE([KDE_CHECK_LIBDL])
4536 AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4537 AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
4539 if test -z "$1"; then
4540   version="1.5"
4541 else
4542   version="$1"
4545 AC_MSG_CHECKING([for Python$version])
4547 python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
4548 AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
4549 if test ! -r $python_incdir/Python.h; then
4550   AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
4551   python_incdir=$python_incdir/python$version
4552   if test ! -r $python_incdir/Python.h; then
4553     python_incdir=no
4554   fi
4557 PYTHONINC=-I$python_incdir
4559 python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs"
4560 AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
4561 if test ! -r $python_libdir/libpython$version.so; then
4562   AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
4563   if test ! -r $python_libdir/libpython$version.a; then
4564     AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
4565     python_libdir=$python_libdir/python$version/config
4566     if test ! -r $python_libdir/libpython$version.a; then
4567       python_libdir=no
4568     fi
4569   fi
4572 PYTHONLIB=-L$python_libdir
4573 kde_orig_LIBPYTHON=$LIBPYTHON
4574 if test -z "$LIBPYTHON"; then
4575   LIBPYTHON=-lpython$version
4578 AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
4579 python_moddir=$python_moddir/python$version
4580 if test ! -r $python_moddir/copy.py; then
4581   python_moddir=no
4584 PYTHONMODDIR=$python_moddir
4586 AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
4588 if test x$python_incdir = xno ||  test x$python_libdir = xno ||  test x$python_moddir = xno; then
4589    LIBPYTHON=$kde_orig_LIBPYTHON
4590    test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
4591    test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
4592    $2
4593 else 
4594   dnl Note: this test is very weak
4595   kde_python_link_found=no
4596   KDE_TRY_LINK_PYTHON(normal)
4597   KDE_TRY_LINK_PYTHON(m, -lm)
4598   KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
4599   KDE_TRY_LINK_PYTHON(tcl, -ltcl)
4600   KDE_TRY_LINK_PYTHON(db2, -ldb2)
4601   KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
4602   KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
4603   KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
4604   KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
4605   KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
4606   KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
4607   KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
4608   KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
4609         [AC_MSG_WARN([it seems, Python depends on another library.
4610     Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
4611     and contact the authors to let them know about this problem])
4612         ])
4614   LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
4615   AC_SUBST(PYTHONINC)
4616   AC_SUBST(PYTHONLIB)
4617   AC_SUBST(LIBPYTHON)
4618   AC_SUBST(PYTHONMODDIR)
4619   AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
4625 AC_DEFUN([KDE_CHECK_PYTHON],
4627   KDE_CHECK_PYTHON_INTERN("2.5",
4628     [KDE_CHECK_PYTHON_INTERN("2.4",
4629      [KDE_CHECK_PYTHON_INTERN("2.3", 
4630        [KDE_CHECK_PYTHON_INTERN("2.2", 
4631          [KDE_CHECK_PYTHON_INTERN("2.1", 
4632            [KDE_CHECK_PYTHON_INTERN("2.0", 
4633              [KDE_CHECK_PYTHON_INTERN($1, $2) ])
4634            ])
4635          ])
4636        ])
4637      ])
4638   ])
4641 AC_DEFUN([KDE_CHECK_STL],
4643     AC_LANG_SAVE
4644     AC_LANG_CPLUSPLUS
4645     ac_save_CXXFLAGS="$CXXFLAGS"
4646     CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
4648     AC_MSG_CHECKING([if C++ programs can be compiled])
4649     AC_CACHE_VAL(kde_cv_stl_works,
4650     [
4651       AC_TRY_COMPILE([
4652 #include <string>
4653 using namespace std;
4655   string astring="Hallo Welt.";
4656   astring.erase(0, 6); // now astring is "Welt"
4657   return 0;
4658 ], kde_cv_stl_works=yes,
4659    kde_cv_stl_works=no)
4662    AC_MSG_RESULT($kde_cv_stl_works)
4664    if test "$kde_cv_stl_works" = "yes"; then
4665      # back compatible
4666          AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
4667    else
4668          AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
4669 Check config.log for details - if you're using a Linux distribution you might miss
4670 a package named similar to libstdc++-dev.])
4671    fi
4673    CXXFLAGS="$ac_save_CXXFLAGS"
4674    AC_LANG_RESTORE
4677 AC_DEFUN([AC_FIND_QIMGIO],
4678    [AC_REQUIRE([AC_FIND_JPEG])
4679 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
4680 AC_MSG_CHECKING([for qimgio])
4681 AC_CACHE_VAL(ac_cv_lib_qimgio,
4683 AC_LANG_SAVE
4684 AC_LANG_CPLUSPLUS
4685 ac_save_LIBS="$LIBS"
4686 ac_save_CXXFLAGS="$CXXFLAGS"
4687 LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
4688 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
4689 AC_TRY_RUN(dnl
4691 #include <qimageio.h>
4692 #include <qstring.h>
4693 int main() {
4694                 QString t = "hallo";
4695                 t.fill('t');
4696                 qInitImageIO();
4699             ac_cv_lib_qimgio=yes,
4700             ac_cv_lib_qimgio=no,
4701             ac_cv_lib_qimgio=no)
4702 LIBS="$ac_save_LIBS"
4703 CXXFLAGS="$ac_save_CXXFLAGS"
4704 AC_LANG_RESTORE
4705 ])dnl
4706 if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
4707   LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
4708   AC_MSG_RESULT(yes)
4709   AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
4710   AC_SUBST(LIBQIMGIO)
4711 else
4712   AC_MSG_RESULT(not found)
4716 AC_DEFUN([AM_DISABLE_LIBRARIES],
4718     AC_PROVIDE([AM_ENABLE_STATIC])
4719     AC_PROVIDE([AM_ENABLE_SHARED])
4720     enable_static=no
4721     enable_shared=yes
4725 AC_DEFUN([AC_CHECK_UTMP_FILE],
4727     AC_MSG_CHECKING([for utmp file])
4729     AC_CACHE_VAL(kde_cv_utmp_file,
4730     [
4731     kde_cv_utmp_file=no
4733     for ac_file in    \
4734                       \
4735         /var/run/utmp \
4736         /var/adm/utmp \
4737         /etc/utmp     \
4738      ; \
4739     do
4740      if test -r "$ac_file"; then
4741        kde_cv_utmp_file=$ac_file
4742        break
4743      fi
4744     done
4745     ])
4747     if test "$kde_cv_utmp_file" != "no"; then
4748         AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
4749         $1
4750         AC_MSG_RESULT($kde_cv_utmp_file)
4751     else
4752         $2
4753         AC_MSG_RESULT([non found])
4754     fi
4758 AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
4761 DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
4762 TOPSUBDIRS=""
4764 if test ! -s $srcdir/subdirs; then
4765   dnl Note: Makefile.common creates subdirs, so this is just a fallback
4766   files=`cd $srcdir && ls -1`
4767   dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
4768   for i in $dirs; do
4769     echo $i >> $srcdir/subdirs
4770   done
4773 ac_topsubdirs=
4774 if test -s $srcdir/inst-apps; then
4775   ac_topsubdirs="`cat $srcdir/inst-apps`"
4776 elif test -s $srcdir/subdirs; then
4777   ac_topsubdirs="`cat $srcdir/subdirs`"
4780 for i in $ac_topsubdirs; do
4781   AC_MSG_CHECKING([if $i should be compiled])
4782   if test -d $srcdir/$i; then
4783     install_it="yes"
4784     for j in $DO_NOT_COMPILE; do
4785       if test $i = $j; then
4786         install_it="no"
4787       fi
4788     done
4789   else
4790     install_it="no"
4791   fi
4792   AC_MSG_RESULT($install_it)
4793   vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
4794   if test $install_it = "yes"; then
4795     TOPSUBDIRS="$TOPSUBDIRS $i"
4796     eval "$vari""_SUBDIR_included=yes"
4797   else
4798     eval "$vari""_SUBDIR_included=no"
4799   fi
4800 done
4802 AC_SUBST(TOPSUBDIRS)
4805 AC_DEFUN([KDE_CHECK_NAMESPACES],
4807 AC_MSG_CHECKING(whether C++ compiler supports namespaces)
4808 AC_LANG_SAVE
4809 AC_LANG_CPLUSPLUS
4810 AC_TRY_COMPILE([
4813 namespace Foo {
4814   extern int i;
4815   namespace Bar {
4816     extern int i;
4817   }
4820 int Foo::i = 0;
4821 int Foo::Bar::i = 1;
4823   AC_MSG_RESULT(yes)
4824   AC_DEFINE(HAVE_NAMESPACES)
4825 ], [
4826 AC_MSG_RESULT(no)
4828 AC_LANG_RESTORE
4831 dnl ------------------------------------------------------------------------
4832 dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
4833 dnl ------------------------------------------------------------------------
4835 AC_DEFUN([AC_CHECK_S_ISSOCK],
4837 AC_MSG_CHECKING(for S_ISSOCK)
4838 AC_CACHE_VAL(ac_cv_have_s_issock,
4840 AC_TRY_LINK(
4842 #include <sys/stat.h>
4845 struct stat buff;
4846 int b = S_ISSOCK( buff.st_mode );
4848 ac_cv_have_s_issock=yes,
4849 ac_cv_have_s_issock=no)
4851 AC_MSG_RESULT($ac_cv_have_s_issock)
4852 if test "$ac_cv_have_s_issock" = "yes"; then
4853   AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
4856 AH_VERBATIM(_ISSOCK,
4858 #ifndef HAVE_S_ISSOCK
4859 #define HAVE_S_ISSOCK
4860 #define S_ISSOCK(mode) (1==0)
4861 #endif
4866 dnl ------------------------------------------------------------------------
4867 dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
4868 dnl ------------------------------------------------------------------------
4870 AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
4872 AC_MSG_CHECKING(for MAXPATHLEN)
4873 AC_CACHE_VAL(ac_cv_maxpathlen,
4875 cat > conftest.$ac_ext <<EOF
4876 #ifdef STDC_HEADERS
4877 # include <stdlib.h>
4878 #endif
4879 #include <stdio.h>
4880 #include <sys/param.h>
4881 #ifndef MAXPATHLEN
4882 #define MAXPATHLEN 1024
4883 #endif
4885 KDE_HELLO MAXPATHLEN
4889 ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
4891 if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
4892     ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
4893 else
4894     ac_cv_maxpathlen=1024
4897 rm conftest.*
4900 AC_MSG_RESULT($ac_cv_maxpathlen)
4901 AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
4904 AC_DEFUN([KDE_CHECK_HEADER],
4906    kde_safe_cppflags=$CPPFLAGS
4907    CPPFLAGS="$CPPFLAGS $all_includes"
4908    AC_LANG_SAVE
4909    AC_LANG_CPLUSPLUS
4910    AC_CHECK_HEADER([$1], [$2], [$3], [$4])
4911    AC_LANG_RESTORE
4912    CPPFLAGS=$kde_safe_cppflags
4915 AC_DEFUN([KDE_CHECK_HEADERS],
4917    AH_CHECK_HEADERS([$1])
4918    AC_LANG_SAVE
4919    kde_safe_cppflags=$CPPFLAGS
4920    CPPFLAGS="$CPPFLAGS $all_includes"
4921    AC_LANG_CPLUSPLUS
4922    AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
4923    CPPFLAGS=$kde_safe_cppflags
4924    AC_LANG_RESTORE
4927 AC_DEFUN([KDE_FAST_CONFIGURE],
4929   dnl makes configure fast (needs perl)
4930   AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
4931       with_fast_perl=$enableval, with_fast_perl=yes)
4934 AC_DEFUN([KDE_CONF_FILES],
4936   val=
4937   if test -f $srcdir/configure.files ; then
4938     val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
4939   fi
4940   CONF_FILES=
4941   if test -n "$val" ; then
4942     for i in $val ; do
4943       CONF_FILES="$CONF_FILES $i"
4944     done
4945   fi
4946   AC_SUBST(CONF_FILES)
4947 ])dnl
4949 dnl This sets the prefix, for arts and kdelibs
4950 dnl Do NOT use in any other module.
4951 dnl It only looks at --prefix, KDEDIR and falls back to /usr/local/kde
4952 AC_DEFUN([KDE_SET_PREFIX_CORE],
4954   unset CDPATH
4955   dnl make $KDEDIR the default for the installation
4956   AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
4958   if test "x$prefix" = "xNONE"; then
4959     prefix=$ac_default_prefix
4960     ac_configure_args="$ac_configure_args --prefix=$prefix"
4961   fi
4962   # And delete superfluous '/' to make compares easier
4963   prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4964   exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4966   kde_libs_prefix='$(prefix)'
4967   kde_libs_htmldir='$(kde_htmldir)'
4968   AC_SUBST(kde_libs_prefix)
4969   AC_SUBST(kde_libs_htmldir)
4970   KDE_FAST_CONFIGURE
4971   KDE_CONF_FILES
4975 AC_DEFUN([KDE_SET_PREFIX],
4977   unset CDPATH
4978   dnl We can't give real code to that macro, only a value.
4979   dnl It only matters for --help, since we set the prefix in this function anyway.
4980   AC_PREFIX_DEFAULT(${KDEDIR:-the kde prefix})
4982   KDE_SET_DEFAULT_BINDIRS
4983   if test "x$prefix" = "xNONE"; then
4984     dnl no prefix given: look for kde-config in the PATH and deduce the prefix from it
4985     KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
4986   else
4987     dnl prefix given: look for kde-config, preferrably in prefix, otherwise in PATH
4988     kde_save_PATH="$PATH"
4989     PATH="$exec_prefix/bin:$prefix/bin:$PATH"
4990     KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
4991     PATH="$kde_save_PATH"
4992   fi
4994   kde_libs_prefix=`$KDECONFIG --prefix`
4995   if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
4996        AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
4997                     This means it has been moved since you installed it.
4998                     This won't work. Please recompile kdelibs for the new prefix.
4999                     ])
5000   fi
5001   kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
5003   AC_MSG_CHECKING([where to install])
5004   if test "x$prefix" = "xNONE"; then
5005     prefix=$kde_libs_prefix
5006     AC_MSG_RESULT([$prefix (as returned by kde-config)])
5007   else
5008     dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
5009     given_prefix=$prefix
5010     AC_MSG_RESULT([$prefix (as requested)])
5011   fi
5013   # And delete superfluous '/' to make compares easier
5014   prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
5015   exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
5016   given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
5018   AC_SUBST(KDECONFIG)
5019   AC_SUBST(kde_libs_prefix)
5020   AC_SUBST(kde_libs_htmldir)
5022   KDE_FAST_CONFIGURE
5023   KDE_CONF_FILES
5026 pushdef([AC_PROG_INSTALL],
5028   dnl our own version, testing for a -p flag
5029   popdef([AC_PROG_INSTALL])
5030   dnl as AC_PROG_INSTALL works as it works we first have
5031   dnl to save if the user didn't specify INSTALL, as the
5032   dnl autoconf one overwrites INSTALL and we have no chance to find
5033   dnl out afterwards
5034   test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
5035   test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
5036   test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
5037   AC_PROG_INSTALL
5039   if test -z "$kde_save_INSTALL_given" ; then
5040     # OK, user hasn't given any INSTALL, autoconf found one for us
5041     # now we test, if it supports the -p flag
5042     AC_MSG_CHECKING(for -p flag to install)
5043     rm -f confinst.$$.* > /dev/null 2>&1
5044     echo "Testtest" > confinst.$$.orig
5045     ac_res=no
5046     if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
5047       if test -f confinst.$$.new ; then
5048         # OK, -p seems to do no harm to install
5049         INSTALL="${INSTALL} -p"
5050         ac_res=yes
5051       fi
5052     fi
5053     rm -f confinst.$$.*
5054     AC_MSG_RESULT($ac_res)
5055   fi
5056   dnl the following tries to resolve some signs and wonders coming up
5057   dnl with different autoconf/automake versions
5058   dnl e.g.:
5059   dnl  *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
5060   dnl   and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
5061   dnl   it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
5062   dnl  *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
5063   dnl   INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
5064   dnl   install-@DIR@PROGRAMS targets to explicitly use that flag
5065   dnl  *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
5066   dnl   INSTALL_SCRIPT, which breaks with automake <= 1.4
5067   dnl  *autoconf >2.13 (since 10.Apr 1999) has not that failure
5068   dnl  *sometimes KDE does not use the install-@DIR@PROGRAM targets from
5069   dnl   automake (due to broken Makefile.am or whatever) to install programs,
5070   dnl   and so does not see the -s flag in automake > 1.4
5071   dnl to clean up that mess we:
5072   dnl  +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
5073   dnl   which cleans KDE's program with automake > 1.4;
5074   dnl  +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
5075   dnl   with automake<=1.4
5076   dnl  note that dues to this sometimes two '-s' flags are used (if KDE
5077   dnl   properly uses install-@DIR@PROGRAMS, but I don't care
5078   dnl
5079   dnl And to all this comes, that I even can't write in comments variable
5080   dnl  names used by automake, because it is so stupid to think I wanted to
5081   dnl  _use_ them, therefor I have written A_M_... instead of AM_
5082   dnl hmm, I wanted to say something ... ahh yes: Arghhh.
5084   if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
5085     INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
5086   fi
5087   if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
5088     INSTALL_SCRIPT='${INSTALL}'
5089   fi
5090 ])dnl
5092 AC_DEFUN([KDE_LANG_CPLUSPLUS],
5093 [AC_LANG_CPLUSPLUS
5094 ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
5095 pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
5098 pushdef([AC_LANG_CPLUSPLUS],
5099 [popdef([AC_LANG_CPLUSPLUS])
5100 KDE_LANG_CPLUSPLUS
5103 AC_DEFUN([KDE_CHECK_LONG_LONG],
5105 AC_MSG_CHECKING(for long long)
5106 AC_CACHE_VAL(kde_cv_c_long_long,
5108   AC_LANG_SAVE
5109   AC_LANG_CPLUSPLUS
5110   AC_TRY_LINK([], [
5111   long long foo = 0;
5112   foo = foo+1;
5113   ],
5114   kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
5115   AC_LANG_RESTORE
5117 AC_MSG_RESULT($kde_cv_c_long_long)
5118 if test "$kde_cv_c_long_long" = yes; then
5119    AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
5123 AC_DEFUN([KDE_CHECK_LIB],
5125      kde_save_LDFLAGS="$LDFLAGS"
5126      dnl AC_CHECK_LIB modifies LIBS, so save it here
5127      kde_save_LIBS="$LIBS"
5128      LDFLAGS="$LDFLAGS $all_libraries"
5129      case $host_os in
5130       aix*) LDFLAGS="-brtl $LDFLAGS"
5131         test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
5132         ;;
5133      esac
5134      AC_CHECK_LIB($1, $2, $3, $4, $5)
5135      LDFLAGS="$kde_save_LDFLAGS"
5136      LIBS="$kde_save_LIBS"
5139 AC_DEFUN([KDE_JAVA_PREFIX],
5141         dir=`dirname "$1"`
5142         base=`basename "$1"`
5143         list=`ls -1 $dir 2> /dev/null`
5144         for entry in $list; do 
5145                 if test -d $dir/$entry/bin; then
5146                         case $entry in
5147                            $base)
5148                                 javadirs="$javadirs $dir/$entry/bin"
5149                                 ;;
5150                         esac
5151                 elif test -d $dir/$entry/jre/bin; then
5152                         case $entry in
5153                            $base)
5154                                 javadirs="$javadirs $dir/$entry/jre/bin"
5155                                 ;;
5156                         esac
5157                 fi
5158         done
5161 dnl KDE_CHEC_JAVA_DIR(onlyjre)
5162 AC_DEFUN([KDE_CHECK_JAVA_DIR],
5165 AC_ARG_WITH(java,
5166 AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
5167 [  ac_java_dir=$withval
5168 ], ac_java_dir=""
5171 AC_MSG_CHECKING([for Java])
5173 dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
5174 if test "x$ac_java_dir" = "xno"; then
5175    kde_java_bindir=no
5176    kde_java_includedir=no
5177    kde_java_libjvmdir=no
5178    kde_java_libgcjdir=no
5179    kde_java_libhpidir=no
5180 else
5181   if test "x$ac_java_dir" = "x"; then
5182      
5183      
5184       dnl No option set -> collect list of candidate paths
5185       if test -n "$JAVA_HOME"; then
5186         KDE_JAVA_PREFIX($JAVA_HOME)
5187       fi
5188       KDE_JAVA_PREFIX(/usr/j2se)
5189       KDE_JAVA_PREFIX(/usr/lib/j2se)
5190       KDE_JAVA_PREFIX(/usr/j*dk*)
5191       KDE_JAVA_PREFIX(/usr/lib/j*dk*)
5192       KDE_JAVA_PREFIX(/opt/j*sdk*)
5193       KDE_JAVA_PREFIX(/usr/lib/java*)
5194       KDE_JAVA_PREFIX(/usr/java*)
5195       KDE_JAVA_PREFIX(/usr/java/j*dk*)
5196       KDE_JAVA_PREFIX(/usr/java/j*re*)
5197       KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
5198       KDE_JAVA_PREFIX(/usr/lib/SunJava*)
5199       KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
5200       KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
5201       KDE_JAVA_PREFIX(/opt/java*)
5203       kde_cv_path="NONE"
5204       kde_save_IFS=$IFS
5205       IFS=':'
5206       for dir in $PATH; do
5207           if test -d "$dir"; then
5208               javadirs="$javadirs $dir"
5209           fi
5210       done
5211       IFS=$kde_save_IFS
5212       jredirs=
5214       dnl Now javadirs contains a list of paths that exist, all ending with bin/
5215       for dir in $javadirs; do
5216           dnl Check for the java executable
5217           if test -x "$dir/java"; then
5218               sane_path=$(cd $dir; /bin/pwd)
5219               dnl And also check for a libjvm.so somewhere under there
5220               dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
5221               if test "$sane_path" != "/usr/bin"; then
5222                   libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
5223                   if test ! -f $libjvmdir/libjvm.so; then continue; fi
5224                   jredirs="$jredirs $dir"
5225               fi
5226           fi
5227       done
5229       dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
5230       JAVAC=
5231       JAVA=
5232       kde_java_bindir=no
5233       for dir in $jredirs; do
5234           JAVA="$dir/java"
5235           kde_java_bindir=$dir
5236           if test -x "$dir/javac"; then
5237                 JAVAC="$dir/javac"
5238                 break
5239           fi
5240       done
5242       if test -n "$JAVAC"; then
5243           dnl this substitution might not work - well, we test for jni.h below
5244           kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
5245       else
5246           kde_java_includedir=no
5247       fi
5248   else
5249     dnl config option set
5250     kde_java_bindir=$ac_java_dir/bin
5251     if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
5252         kde_java_includedir=no
5253     else
5254         kde_java_includedir=$ac_java_dir/include
5255     fi
5256   fi
5259 dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
5260 if test "x$kde_java_bindir" != "xno"; then
5262   dnl Look for libjvm.so
5263   kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
5264   dnl Look for libgcj.so
5265   kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
5266   dnl Look for libhpi.so and avoid green threads
5267   kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
5269   dnl Now check everything's fine under there
5270   dnl the include dir is our flag for having the JDK
5271   if test -d "$kde_java_includedir"; then
5272     if test ! -x "$kde_java_bindir/javac"; then
5273       AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
5274     fi
5275     if test ! -x "$kde_java_bindir/javah"; then
5276       AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5277     fi
5278     if test ! -x "$kde_java_bindir/jar"; then
5279       AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5280     fi
5281     if test ! -r "$kde_java_includedir/jni.h"; then
5282       AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
5283     fi
5285     jni_includes="-I$kde_java_includedir"
5286     dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
5287     dnl and under linux here.. 
5288     
5289     dnl not needed for gcj
5291     if test "x$kde_java_libgcjdir" = "x"; then 
5292       test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
5293       test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
5294       test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
5295     fi
5297   else
5298     JAVAC=
5299     jni_includes=
5300   fi
5302   if test "x$kde_java_libgcjdir" = "x"; then 
5303      if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
5304         AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
5305      fi 
5306   else
5307      if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
5308         AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
5309      fi 
5310   fi
5312   if test ! -x "$kde_java_bindir/java"; then
5313       AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5314   fi
5316   dnl not needed for gcj compile
5318   if test "x$kde_java_libgcjdir" = "x"; then 
5319       if test ! -r "$kde_java_libhpidir/libhpi.so"; then
5320         AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
5321       fi
5322   fi
5324   if test -n "$jni_includes"; then
5325     dnl Check for JNI version
5326     AC_LANG_SAVE
5327     AC_LANG_CPLUSPLUS
5328     ac_cxxflags_safe="$CXXFLAGS"
5329     CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
5331     AC_TRY_COMPILE([
5332   #include <jni.h>
5333               ],
5334               [
5335   #ifndef JNI_VERSION_1_2
5336   Syntax Error
5337   #endif
5338               ],[ kde_jni_works=yes ],
5339               [ kde_jni_works=no ])
5341     if test $kde_jni_works = no; then
5342       AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
5343                     You need to have Java Development Kit (JDK) version 1.2. 
5345                     Use --with-java to specify another location.
5346                     Use --without-java to configure without java support.
5347                     Or download a newer JDK and try again. 
5348                     See e.g. http://java.sun.com/products/jdk/1.2 ])
5349     fi
5351     CXXFLAGS="$ac_cxxflags_safe"    
5352     AC_LANG_RESTORE
5354     dnl All tests ok, inform and subst the variables
5356     JAVAC=$kde_java_bindir/javac
5357     JAVAH=$kde_java_bindir/javah
5358     JAR=$kde_java_bindir/jar
5359     AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5360     if test "x$kde_java_libgcjdir" = "x"; then 
5361       JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
5362     else
5363       JVMLIBS="-L$kde_java_libgcjdir -lgcj"
5364     fi
5365     AC_MSG_RESULT([java JDK in $kde_java_bindir])
5367   else
5368       AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5369       AC_MSG_RESULT([java JRE in $kde_java_bindir])
5370   fi
5371 elif test -d "/Library/Java/Home"; then
5372   kde_java_bindir="/Library/Java/Home/bin"
5373   jni_includes="-I/Library/Java/Home/include"
5375   JAVAC=$kde_java_bindir/javac
5376   JAVAH=$kde_java_bindir/javah
5377   JAR=$kde_java_bindir/jar
5378   JVMLIBS="-Wl,-framework,JavaVM"
5380   AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5381   AC_MSG_RESULT([Apple Java Framework])
5382 else
5383   AC_MSG_RESULT([none found])
5386 AC_SUBST(JAVAC)
5387 AC_SUBST(JAVAH)
5388 AC_SUBST(JAR)
5389 AC_SUBST(JVMLIBS)
5390 AC_SUBST(jni_includes)
5392 # for backward compat
5393 kde_cv_java_includedir=$kde_java_includedir
5394 kde_cv_java_bindir=$kde_java_bindir
5397 dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
5398 dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
5399 dnl big packages, m4_foreach is dog-slow.  So use our own version of
5400 dnl it.  (matz@kde.org)
5401 m4_define([mm_foreach],
5402 [m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
5403 m4_define([mm_car], [[$1]])
5404 m4_define([mm_car2], [[$@]])
5405 m4_define([_mm_foreach],
5406 [m4_if(m4_quote($2), [], [],
5407        [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
5408                                                    mm_car2(m4_shift($2)),
5409                                                    [$3])])])
5410 m4_define([AC_FOREACH],
5411 [mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
5413 AC_DEFUN([KDE_NEED_FLEX],
5415 kde_libs_safe=$LIBS
5416 LIBS="$LIBS $USER_LDFLAGS"
5417 AM_PROG_LEX
5418 LIBS=$kde_libs_safe
5419 if test -z "$LEXLIB"; then
5420     AC_MSG_ERROR([You need to have flex installed.])
5422 AC_SUBST(LEXLIB)
5425 AC_DEFUN([AC_PATH_QTOPIA],
5427   dnl TODO: use AC_CACHE_VAL
5429   if test -z "$1"; then
5430     qtopia_minver_maj=1
5431     qtopia_minver_min=5
5432     qtopia_minver_pat=0
5433   else
5434     qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
5435     qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
5436     qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
5437   fi
5439   qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
5440   qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
5442   AC_REQUIRE([AC_PATH_QT])
5444   AC_MSG_CHECKING([for Qtopia])
5446   LIB_QTOPIA="-lqpe"
5447   AC_SUBST(LIB_QTOPIA)
5449   kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
5451   ac_qtopia_incdir=NO
5453   AC_ARG_WITH(qtopia-dir,
5454               AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]),
5455               [  ac_qtopia_incdir="$withval"/include] ) 
5456   
5457   qtopia_incdirs=""
5458   for dir in $kde_qtopia_dirs; do
5459     qtopia_incdirs="$qtopia_incdirs $dir/include"
5460   done
5462   if test ! "$ac_qtopia_incdir" = "NO"; then
5463     qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
5464   fi
5466   qtopia_incdir=""
5467   AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
5468   ac_qtopia_incdir="$qtopia_incdir"
5470   if test -z "$qtopia_incdir"; then
5471     AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
5472   fi
5474   qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
5475   qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
5476   qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
5478   qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
5479   qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
5480   if test "$qtopia_ver" -lt "$qtopia_minver"; then
5481     AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
5482 is required.])
5483   fi
5485   AC_LANG_SAVE
5486   AC_LANG_CPLUSPLUS
5488   ac_cxxflags_safe="$CXXFLAGS"
5489   ac_ldflags_safe="$LDFLAGS"
5490   ac_libs_safe="$LIBS"
5492   CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
5493   LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
5494   LIBS="$LIBS $LIB_QTOPIA $LIBQT"
5496   cat > conftest.$ac_ext <<EOF
5497 #include "confdefs.h"
5498 #include <qpe/qpeapplication.h>
5499 #include <qpe/version.h>
5501 int main( int argc, char **argv )
5503     QPEApplication app( argc, argv );
5504     return 0;
5508   if AC_TRY_EVAL(ac_link) && test -s conftest; then
5509     rm -f conftest*
5510   else
5511     rm -f conftest*
5512     AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
5513 the end of config.log])
5514   fi
5516   CXXFLAGS="$ac_cxxflags_safe"
5517   LDFLAGS="$ac_ldflags_safe"
5518   LIBS="$ac_libs_safe"
5520   AC_LANG_RESTORE
5522   QTOPIA_INCLUDES="-I$qtopia_incdir"
5523   AC_SUBST(QTOPIA_INCLUDES)
5525   AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
5529 AC_DEFUN([KDE_INIT_DOXYGEN],
5531 AC_MSG_CHECKING([for Qt docs])
5532 kde_qtdir=
5533 if test "${with_qt_dir+set}" = set; then
5534   kde_qtdir="$with_qt_dir"
5537 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)
5538 AC_MSG_RESULT($QTDOCDIR)
5540 AC_SUBST(QTDOCDIR)
5542 KDE_FIND_PATH(dot, DOT, [], [])
5543 if test -n "$DOT"; then
5544   KDE_HAVE_DOT="YES"
5545 else
5546   KDE_HAVE_DOT="NO"
5548 AC_SUBST(KDE_HAVE_DOT)
5549 KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
5550 AC_SUBST(DOXYGEN)
5552 DOXYGEN_PROJECT_NAME="$1"
5553 DOXYGEN_PROJECT_NUMBER="$2"
5554 AC_SUBST(DOXYGEN_PROJECT_NAME)
5555 AC_SUBST(DOXYGEN_PROJECT_NUMBER)
5557 KDE_HAS_DOXYGEN=no
5558 if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
5559   KDE_HAS_DOXYGEN=yes
5561 AC_SUBST(KDE_HAS_DOXYGEN)
5566 AC_DEFUN([AC_FIND_BZIP2],
5568 AC_MSG_CHECKING([for bzDecompress in libbz2])
5569 AC_CACHE_VAL(ac_cv_lib_bzip2,
5571 AC_LANG_SAVE
5572 AC_LANG_CPLUSPLUS
5573 kde_save_LIBS="$LIBS"
5574 LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
5575 kde_save_CXXFLAGS="$CXXFLAGS"
5576 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
5577 AC_TRY_LINK(dnl
5579 #define BZ_NO_STDIO
5580 #include<bzlib.h>
5582             [ bz_stream s; (void) bzDecompress(&s); ],
5583             eval "ac_cv_lib_bzip2='-lbz2'",
5584             eval "ac_cv_lib_bzip2=no")
5585 LIBS="$kde_save_LIBS"
5586 CXXFLAGS="$kde_save_CXXFLAGS"
5587 AC_LANG_RESTORE
5588 ])dnl
5589 AC_MSG_RESULT($ac_cv_lib_bzip2)
5591 if test ! "$ac_cv_lib_bzip2" = no; then
5592   BZIP2DIR=bzip2
5594   LIBBZ2="$ac_cv_lib_bzip2"
5595   AC_SUBST(LIBBZ2)
5597 else
5599    cxx_shared_flag=
5600    ld_shared_flag=
5601    KDE_CHECK_COMPILER_FLAG(shared, [
5602         ld_shared_flag="-shared"
5603    ])
5604    KDE_CHECK_COMPILER_FLAG(fPIC, [
5605         cxx_shared_flag="-fPIC"
5606    ])
5608    AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
5609    AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
5610    [
5611    AC_LANG_SAVE
5612    AC_LANG_CPLUSPLUS
5613    kde_save_LIBS="$LIBS"
5614    LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
5615    kde_save_CXXFLAGS="$CXXFLAGS"
5616    CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
5618    AC_TRY_LINK(dnl
5619    [
5620    #define BZ_NO_STDIO
5621    #include<bzlib.h>
5622    ],
5623                [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
5624                eval "ac_cv_lib_bzip2_prefix='-lbz2'",
5625                eval "ac_cv_lib_bzip2_prefix=no")
5626    LIBS="$kde_save_LIBS"
5627    CXXFLAGS="$kde_save_CXXFLAGS"
5628    AC_LANG_RESTORE
5629    ])dnl
5631    AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
5632    
5633    if test ! "$ac_cv_lib_bzip2_prefix" = no; then
5634      BZIP2DIR=bzip2
5635     
5636      LIBBZ2="$ac_cv_lib_bzip2_prefix"
5637      AC_SUBST(LIBBZ2)
5639      AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
5640    dnl else, we just ignore this
5641    fi
5644 AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
5647 dnl ------------------------------------------------------------------------
5648 dnl Try to find the SSL headers and libraries.
5649 dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
5650 dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
5651 dnl ------------------------------------------------------------------------
5653 AC_DEFUN([KDE_CHECK_SSL],
5655 LIBSSL="-lssl -lcrypto"
5656 AC_REQUIRE([KDE_CHECK_LIB64])
5658 ac_ssl_includes=NO ac_ssl_libraries=NO
5659 ssl_libraries=""
5660 ssl_includes=""
5661 AC_ARG_WITH(ssl-dir,
5662     AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
5663     [  ac_ssl_includes="$withval"/include
5664        ac_ssl_libraries="$withval"/lib$kdelibsuff
5665     ])
5667 want_ssl=yes
5668 AC_ARG_WITH(ssl,
5669     AC_HELP_STRING([--without-ssl],[disable SSL checks]),
5670     [want_ssl=$withval])
5672 if test $want_ssl = yes; then
5674 AC_MSG_CHECKING(for OpenSSL)
5676 AC_CACHE_VAL(ac_cv_have_ssl,
5677 [#try to guess OpenSSL locations
5678   
5679   ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
5680   ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
5681   AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
5682   ac_ssl_includes="$ssl_incdir"
5684   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"
5685   if test ! "$ac_ssl_libraries" = "NO"; then
5686     ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
5687   fi
5689   test=NONE
5690   ssl_libdir=NONE
5691   for dir in $ssl_libdirs; do
5692     try="ls -1 $dir/libssl*"
5693     if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
5694   done
5696   ac_ssl_libraries="$ssl_libdir"
5698   ac_ldflags_safe="$LDFLAGS"
5699   ac_libs_safe="$LIBS"
5701   LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
5702   LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
5704   AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
5705   ac_ssl_rsaref="yes"
5706   ,
5707   ac_ssl_rsaref="no"
5708   )
5710   LDFLAGS="$ac_ldflags_safe"
5711   LIBS="$ac_libs_safe"
5713   if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
5714     have_ssl=no
5715   else
5716     have_ssl=yes;
5717   fi
5719   ])
5721   eval "$ac_cv_have_ssl"
5723   AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
5725   AC_MSG_CHECKING([whether OpenSSL uses rsaref])
5726   AC_MSG_RESULT($ac_ssl_rsaref)
5728   AC_MSG_CHECKING([for easter eggs])
5729   AC_MSG_RESULT([none found])
5731 else
5732   have_ssl=no
5735 if test "$have_ssl" = yes; then
5736   AC_MSG_CHECKING(for OpenSSL version)
5737   dnl Check for SSL version
5738   AC_CACHE_VAL(ac_cv_ssl_version,
5739   [
5741     cat >conftest.$ac_ext <<EOF
5742 #include <openssl/opensslv.h>
5743 #include <stdio.h>
5744     int main() {
5746 #ifndef OPENSSL_VERSION_NUMBER
5747       printf("ssl_version=\\"error\\"\n");
5748 #else
5749       if (OPENSSL_VERSION_NUMBER < 0x00906000)
5750         printf("ssl_version=\\"old\\"\n");
5751       else
5752         printf("ssl_version=\\"ok\\"\n");
5753 #endif
5754      return (0);
5755     }
5758     ac_save_CPPFLAGS=$CPPFLAGS
5759     if test "$ac_ssl_includes" != "/usr/include"; then
5760         CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
5761     fi
5763     if AC_TRY_EVAL(ac_link); then 
5765       if eval `./conftest 2>&5`; then
5766         if test $ssl_version = error; then
5767           AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
5768         else
5769           if test $ssl_version = old; then
5770             AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
5771             have_ssl=no
5772           fi
5773         fi
5774         ac_cv_ssl_version="ssl_version=$ssl_version"
5775       else
5776         AC_MSG_ERROR([Your system couldn't run a small SSL test program.
5777         Check config.log, and if you can't figure it out, send a mail to 
5778         David Faure <faure@kde.org>, attaching your config.log])
5779       fi
5781     else
5782       AC_MSG_ERROR([Your system couldn't link a small SSL test program.
5783       Check config.log, and if you can't figure it out, send a mail to 
5784       David Faure <faure@kde.org>, attaching your config.log])
5785     fi 
5786     CPPFLAGS=$ac_save_CPPFLAGS
5788   ])
5790   eval "$ac_cv_ssl_version"
5791   AC_MSG_RESULT($ssl_version)
5794 if test "$have_ssl" != yes; then
5795   LIBSSL="";
5796 else
5797   AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
5798   ac_cv_have_ssl="have_ssl=yes \
5799     ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
5800   
5801   
5802   ssl_libraries="$ac_ssl_libraries"
5803   ssl_includes="$ac_ssl_includes"
5805   if test "$ac_ssl_rsaref" = yes; then
5806     LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref" 
5807   fi
5809   if test $ssl_version = "old"; then
5810     AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
5811   fi
5814 SSL_INCLUDES=
5816 if test "$ssl_includes" = "/usr/include"; then
5817   if test -f /usr/kerberos/include/krb5.h; then
5818         SSL_INCLUDES="-I/usr/kerberos/include"
5819   fi
5820 elif test  "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
5821   SSL_INCLUDES="-I$ssl_includes"
5824 if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
5825  SSL_LDFLAGS=""
5826 else
5827  SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
5830 AC_SUBST(SSL_INCLUDES)
5831 AC_SUBST(SSL_LDFLAGS)
5832 AC_SUBST(LIBSSL)
5835 AC_DEFUN([KDE_CHECK_STRLCPY],
5837   AC_REQUIRE([AC_CHECK_STRLCAT])
5838   AC_REQUIRE([AC_CHECK_STRLCPY])
5839   AC_CHECK_SIZEOF(size_t)
5840   AC_CHECK_SIZEOF(unsigned long)
5842   AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
5843   AC_TRY_COMPILE(,[
5844     #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
5845        choke me
5846     #endif
5847     ],AC_MSG_RESULT([yes]),[
5848       AC_MSG_RESULT(no)
5849       AC_MSG_ERROR([
5850        Apparently on your system our assumption sizeof size_t == sizeof unsigned long 
5851        does not apply. Please mail kde-devel@kde.org with a description of your system!
5852       ])
5853   ])
5856 AC_DEFUN([KDE_CHECK_BINUTILS],
5858   AC_MSG_CHECKING([if ld supports unversioned version maps])
5860   kde_save_LDFLAGS="$LDFLAGS"
5861   LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
5862   echo "{ local: extern \"C++\" { foo }; };" > conftest.map
5863   AC_TRY_LINK([int foo;],
5865 #ifdef __INTEL_COMPILER
5866 icc apparently does not support libtools version-info and version-script
5867 at the same time. Dunno where the bug is, but until somebody figured out,
5868 better disable the optional version scripts.
5869 #endif
5871   foo = 42;
5872 ], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
5873   LDFLAGS="$kde_save_LDFLAGS"
5874   rm -f conftest.map
5875   AM_CONDITIONAL(include_VERSION_SCRIPT, 
5876     [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
5878   AC_MSG_RESULT($kde_supports_versionmaps)
5881 AC_DEFUN([AM_PROG_OBJC],[
5882 AC_CHECK_PROGS(OBJC, gcc, gcc)
5883 test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
5884 if test "x${OBJCFLAGS-unset}" = xunset; then
5885    OBJCFLAGS="-g -O2"
5887 AC_SUBST(OBJCFLAGS)
5888 _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
5891 AC_DEFUN([KDE_CHECK_PERL],
5893         KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
5894                     AC_MSG_ERROR([No Perl found in your $PATH.
5895 We need perl to generate some code.])
5896         ])
5897     AC_SUBST(PERL)
5900 AC_DEFUN([KDE_CHECK_LARGEFILE],
5902 AC_SYS_LARGEFILE
5903 if test "$ac_cv_sys_file_offset_bits" != no; then
5904   CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
5907 if test "x$ac_cv_sys_large_files" != "xno"; then
5908   CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
5913 dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
5914 dnl which allows to search for libs that get installed into the KDE prefix.
5916 dnl Syntax:  KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
5917 dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
5918 dnl also defines KSTUFF_PKG_ERRORS on error
5919 AC_DEFUN([KDE_PKG_CHECK_MODULES], [
5921    PKG_CONFIG_PATH="$prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
5922    if test "$prefix" != "$kde_libs_prefix"; then
5923        PKG_CONFIG_PATH="$kde_libs_prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
5924    fi
5925    export PKG_CONFIG_PATH
5926    PKG_CHECK_MODULES([$1],[$2],[$3],[$4])
5930 dnl Check for PIE support in the compiler and linker
5931 AC_DEFUN([KDE_CHECK_PIE_SUPPORT],
5933   AC_CACHE_CHECK([for PIE support], kde_cv_val_pie_support,
5934   [
5935     AC_LANG_SAVE
5936     AC_LANG_CPLUSPLUS
5937     safe_CXXFLAGS=$CXXFLAGS
5938     safe_LDFLAGS=$LDFLAGS
5939     CXXFLAGS="$CXXFLAGS -fPIE"
5940     LDFLAGS="$LDFLAGS -pie"
5942     AC_TRY_LINK([int foo;], [], [kde_cv_val_pie_support=yes], [kde_cv_val_pie_support=no])
5944     CXXFLAGS=$safe_CXXFLAGS
5945     LDFLAGS=$safe_LDFLAGS
5946     AC_LANG_RESTORE
5947   ])
5949   AC_MSG_CHECKING(if enabling -pie/fPIE support)
5951   AC_ARG_ENABLE(pie,
5952     AC_HELP_STRING([--enable-pie],[platform supports PIE linking [default=detect]]),
5953       [kde_has_pie_support=$enableval],
5954       [kde_has_pie_support=detect])
5956   if test "$kde_has_pie_support" = "detect"; then
5957     kde_has_pie_support=$kde_cv_val_pie_support
5958   fi
5960   AC_MSG_RESULT([$kde_has_pie_support])
5962   KDE_USE_FPIE=""
5963   KDE_USE_PIE=""
5965   AC_SUBST([KDE_USE_FPIE])
5966   AC_SUBST([KDE_USE_PIE])
5968   if test "$kde_has_pie_support" = "yes"; then
5969     KDE_USE_FPIE="-fPIE"
5970     KDE_USE_PIE="-pie"
5971   fi
5973 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
5974 ## Copyright 1996, 1997, 1998, 1999, 2000, 2001
5975 ## Free Software Foundation, Inc.
5976 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5978 ## This program is free software; you can redistribute it and/or modify
5979 ## it under the terms of the GNU General Public License as published by
5980 ## the Free Software Foundation; either version 2 of the License, or
5981 ## (at your option) any later version.
5983 ## This program is distributed in the hope that it will be useful, but
5984 ## WITHOUT ANY WARRANTY; without even the implied warranty of
5985 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
5986 ## General Public License for more details.
5988 ## You should have received a copy of the GNU General Public License
5989 ## along with this program; if not, write to the Free Software
5990 ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
5992 ## As a special exception to the GNU General Public License, if you
5993 ## distribute this file as part of a program that contains a
5994 ## configuration script generated by Autoconf, you may include it under
5995 ## the same distribution terms that you use for the rest of that program.
5997 # serial 47 AC_PROG_LIBTOOL
6000 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
6001 # -----------------------------------------------------------
6002 # If this macro is not defined by Autoconf, define it here.
6003 m4_ifdef([AC_PROVIDE_IFELSE],
6004          [],
6005          [m4_define([AC_PROVIDE_IFELSE],
6006                  [m4_ifdef([AC_PROVIDE_$1],
6007                            [$2], [$3])])])
6010 # AC_PROG_LIBTOOL
6011 # ---------------
6012 AC_DEFUN([AC_PROG_LIBTOOL],
6013 [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
6014 dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
6015 dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
6016   AC_PROVIDE_IFELSE([AC_PROG_CXX],
6017     [AC_LIBTOOL_CXX],
6018     [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
6019   ])])
6020 dnl And a similar setup for Fortran 77 support
6021   AC_PROVIDE_IFELSE([AC_PROG_F77],
6022     [AC_LIBTOOL_F77],
6023     [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
6024 ])])
6026 dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
6027 dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
6028 dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
6029   AC_PROVIDE_IFELSE([AC_PROG_GCJ],
6030     [AC_LIBTOOL_GCJ],
6031     [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
6032       [AC_LIBTOOL_GCJ],
6033       [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
6034         [AC_LIBTOOL_GCJ],
6035       [ifdef([AC_PROG_GCJ],
6036              [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
6037        ifdef([A][M_PROG_GCJ],
6038              [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
6039        ifdef([LT_AC_PROG_GCJ],
6040              [define([LT_AC_PROG_GCJ],
6041                 defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
6042 ])])# AC_PROG_LIBTOOL
6045 # _AC_PROG_LIBTOOL
6046 # ----------------
6047 AC_DEFUN([_AC_PROG_LIBTOOL],
6048 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
6049 AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
6050 AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
6051 AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
6053 # This can be used to rebuild libtool when needed
6054 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
6056 # Always use our own libtool.
6057 LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'
6058 AC_SUBST(LIBTOOL)dnl
6060 # Prevent multiple expansion
6061 define([AC_PROG_LIBTOOL], [])
6062 ])# _AC_PROG_LIBTOOL
6065 # AC_LIBTOOL_SETUP
6066 # ----------------
6067 AC_DEFUN([AC_LIBTOOL_SETUP],
6068 [AC_PREREQ(2.50)dnl
6069 AC_REQUIRE([AC_ENABLE_SHARED])dnl
6070 AC_REQUIRE([AC_ENABLE_STATIC])dnl
6071 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
6072 AC_REQUIRE([AC_CANONICAL_HOST])dnl
6073 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
6074 AC_REQUIRE([AC_PROG_CC])dnl
6075 AC_REQUIRE([AC_PROG_LD])dnl
6076 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
6077 AC_REQUIRE([AC_PROG_NM])dnl
6079 AC_REQUIRE([AC_PROG_LN_S])dnl
6080 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
6081 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
6082 AC_REQUIRE([AC_OBJEXT])dnl
6083 AC_REQUIRE([AC_EXEEXT])dnl
6086 AC_LIBTOOL_SYS_MAX_CMD_LEN
6087 AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
6088 AC_LIBTOOL_OBJDIR
6090 AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
6091 _LT_AC_PROG_ECHO_BACKSLASH
6093 case $host_os in
6094 aix3*)
6095   # AIX sometimes has problems with the GCC collect2 program.  For some
6096   # reason, if we set the COLLECT_NAMES environment variable, the problems
6097   # vanish in a puff of smoke.
6098   if test "X${COLLECT_NAMES+set}" != Xset; then
6099     COLLECT_NAMES=
6100     export COLLECT_NAMES
6101   fi
6102   ;;
6103 esac
6105 # Sed substitution that helps us do robust quoting.  It backslashifies
6106 # metacharacters that are still active within double-quoted strings.
6107 Xsed='sed -e s/^X//'
6108 [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
6110 # Same as above, but do not quote variable references.
6111 [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
6113 # Sed substitution to delay expansion of an escaped shell variable in a
6114 # double_quote_subst'ed string.
6115 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
6117 # Sed substitution to avoid accidental globbing in evaled expressions
6118 no_glob_subst='s/\*/\\\*/g'
6120 # Constants:
6121 rm="rm -f"
6123 # Global variables:
6124 default_ofile=libtool
6125 can_build_shared=yes
6127 # All known linkers require a `.a' archive for static linking (except M$VC,
6128 # which needs '.lib').
6129 libext=a
6130 ltmain="$ac_aux_dir/ltmain.sh"
6131 ofile="$default_ofile"
6132 with_gnu_ld="$lt_cv_prog_gnu_ld"
6134 AC_CHECK_TOOL(AR, ar, false)
6135 AC_CHECK_TOOL(RANLIB, ranlib, :)
6136 AC_CHECK_TOOL(STRIP, strip, :)
6138 old_CC="$CC"
6139 old_CFLAGS="$CFLAGS"
6141 # Set sane defaults for various variables
6142 test -z "$AR" && AR=ar
6143 test -z "$AR_FLAGS" && AR_FLAGS=cru
6144 test -z "$AS" && AS=as
6145 test -z "$CC" && CC=cc
6146 test -z "$LTCC" && LTCC=$CC
6147 test -z "$DLLTOOL" && DLLTOOL=dlltool
6148 test -z "$LD" && LD=ld
6149 test -z "$LN_S" && LN_S="ln -s"
6150 test -z "$MAGIC_CMD" && MAGIC_CMD=file
6151 test -z "$NM" && NM=nm
6152 test -z "$SED" && SED=sed
6153 test -z "$OBJDUMP" && OBJDUMP=objdump
6154 test -z "$RANLIB" && RANLIB=:
6155 test -z "$STRIP" && STRIP=:
6156 test -z "$ac_objext" && ac_objext=o
6158 # Determine commands to create old-style static archives.
6159 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
6160 old_postinstall_cmds='chmod 644 $oldlib'
6161 old_postuninstall_cmds=
6163 if test -n "$RANLIB"; then
6164   case $host_os in
6165   openbsd*)
6166     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
6167     ;;
6168   *)
6169     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
6170     ;;
6171   esac
6172   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
6175 # Only perform the check for file, if the check method requires it
6176 case $deplibs_check_method in
6177 file_magic*)
6178   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
6179     AC_PATH_MAGIC
6180   fi
6181   ;;
6182 esac
6184 AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
6185 AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
6186 enable_win32_dll=yes, enable_win32_dll=no)
6188 AC_ARG_ENABLE([libtool-lock],
6189     [AC_HELP_STRING([--disable-libtool-lock],
6190         [avoid locking (might break parallel builds)])])
6191 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
6193 AC_ARG_WITH([pic],
6194     [AC_HELP_STRING([--with-pic],
6195         [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
6196     [pic_mode="$withval"],
6197     [pic_mode=default])
6198 test -z "$pic_mode" && pic_mode=default
6200 # Use C for the default configuration in the libtool script
6201 tagname=
6202 AC_LIBTOOL_LANG_C_CONFIG
6203 _LT_AC_TAGCONFIG
6204 ])# AC_LIBTOOL_SETUP
6207 # _LT_AC_SYS_COMPILER
6208 # -------------------
6209 AC_DEFUN([_LT_AC_SYS_COMPILER],
6210 [AC_REQUIRE([AC_PROG_CC])dnl
6212 # If no C compiler was specified, use CC.
6213 LTCC=${LTCC-"$CC"}
6215 # Allow CC to be a program name with arguments.
6216 compiler=$CC
6217 ])# _LT_AC_SYS_COMPILER
6220 # _LT_AC_SYS_LIBPATH_AIX
6221 # ----------------------
6222 # Links a minimal program and checks the executable
6223 # for the system default hardcoded library path. In most cases,
6224 # this is /usr/lib:/lib, but when the MPI compilers are used
6225 # the location of the communication and MPI libs are included too.
6226 # If we don't find anything, use the default library path according
6227 # to the aix ld manual.
6228 AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
6229 [AC_LINK_IFELSE(AC_LANG_PROGRAM,[
6230 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
6232 # Check for a 64-bit object if we didn't find anything.
6233 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; }
6234 }'`; fi],[])
6235 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
6236 ])# _LT_AC_SYS_LIBPATH_AIX
6239 # _LT_AC_SHELL_INIT(ARG)
6240 # ----------------------
6241 AC_DEFUN([_LT_AC_SHELL_INIT],
6242 [ifdef([AC_DIVERSION_NOTICE],
6243              [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
6244          [AC_DIVERT_PUSH(NOTICE)])
6246 AC_DIVERT_POP
6247 ])# _LT_AC_SHELL_INIT
6250 # _LT_AC_PROG_ECHO_BACKSLASH
6251 # --------------------------
6252 # Add some code to the start of the generated configure script which
6253 # will find an echo command which doesn't interpret backslashes.
6254 AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
6255 [_LT_AC_SHELL_INIT([
6256 # Check that we are running under the correct shell.
6257 SHELL=${CONFIG_SHELL-/bin/sh}
6259 case X$ECHO in
6260 X*--fallback-echo)
6261   # Remove one level of quotation (which was required for Make).
6262   ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
6263   ;;
6264 esac
6266 echo=${ECHO-echo}
6267 if test "X[$]1" = X--no-reexec; then
6268   # Discard the --no-reexec flag, and continue.
6269   shift
6270 elif test "X[$]1" = X--fallback-echo; then
6271   # Avoid inline document here, it may be left over
6272   :
6273 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
6274   # Yippee, $echo works!
6275   :
6276 else
6277   # Restart under the correct shell.
6278   exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
6281 if test "X[$]1" = X--fallback-echo; then
6282   # used as fallback echo
6283   shift
6284   cat <<EOF
6285 [$]*
6287   exit 0
6290 # The HP-UX ksh and POSIX shell print the target directory to stdout
6291 # if CDPATH is set.
6292 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
6294 if test -z "$ECHO"; then
6295 if test "X${echo_test_string+set}" != Xset; then
6296 # find a string as large as possible, as long as the shell can cope with it
6297   for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
6298     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
6299     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
6300        echo_test_string="`eval $cmd`" &&
6301        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
6302     then
6303       break
6304     fi
6305   done
6308 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
6309    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
6310    test "X$echo_testing_string" = "X$echo_test_string"; then
6311   :
6312 else
6313   # The Solaris, AIX, and Digital Unix default echo programs unquote
6314   # backslashes.  This makes it impossible to quote backslashes using
6315   #   echo "$something" | sed 's/\\/\\\\/g'
6316   #
6317   # So, first we look for a working echo in the user's PATH.
6319   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
6320   for dir in $PATH /usr/ucb; do
6321     IFS="$lt_save_ifs"
6322     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
6323        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
6324        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
6325        test "X$echo_testing_string" = "X$echo_test_string"; then
6326       echo="$dir/echo"
6327       break
6328     fi
6329   done
6330   IFS="$lt_save_ifs"
6332   if test "X$echo" = Xecho; then
6333     # We didn't find a better echo, so look for alternatives.
6334     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
6335        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
6336        test "X$echo_testing_string" = "X$echo_test_string"; then
6337       # This shell has a builtin print -r that does the trick.
6338       echo='print -r'
6339     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
6340          test "X$CONFIG_SHELL" != X/bin/ksh; then
6341       # If we have ksh, try running configure again with it.
6342       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
6343       export ORIGINAL_CONFIG_SHELL
6344       CONFIG_SHELL=/bin/ksh
6345       export CONFIG_SHELL
6346       exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
6347     else
6348       # Try using printf.
6349       echo='printf %s\n'
6350       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
6351          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
6352          test "X$echo_testing_string" = "X$echo_test_string"; then
6353         # Cool, printf works
6354         :
6355       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
6356            test "X$echo_testing_string" = 'X\t' &&
6357            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
6358            test "X$echo_testing_string" = "X$echo_test_string"; then
6359         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
6360         export CONFIG_SHELL
6361         SHELL="$CONFIG_SHELL"
6362         export SHELL
6363         echo="$CONFIG_SHELL [$]0 --fallback-echo"
6364       elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
6365            test "X$echo_testing_string" = 'X\t' &&
6366            echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
6367            test "X$echo_testing_string" = "X$echo_test_string"; then
6368         echo="$CONFIG_SHELL [$]0 --fallback-echo"
6369       else
6370         # maybe with a smaller string...
6371         prev=:
6373         for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
6374           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
6375           then
6376             break
6377           fi
6378           prev="$cmd"
6379         done
6381         if test "$prev" != 'sed 50q "[$]0"'; then
6382           echo_test_string=`eval $prev`
6383           export echo_test_string
6384           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
6385         else
6386           # Oops.  We lost completely, so just stick with echo.
6387           echo=echo
6388         fi
6389       fi
6390     fi
6391   fi
6395 # Copy echo and quote the copy suitably for passing to libtool from
6396 # the Makefile, instead of quoting the original, which is used later.
6397 ECHO=$echo
6398 if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
6399    ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
6402 AC_SUBST(ECHO)
6403 ])])# _LT_AC_PROG_ECHO_BACKSLASH
6406 # _LT_AC_LOCK
6407 # -----------
6408 AC_DEFUN([_LT_AC_LOCK],
6409 [AC_ARG_ENABLE([libtool-lock],
6410     [AC_HELP_STRING([--disable-libtool-lock],
6411         [avoid locking (might break parallel builds)])])
6412 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
6414 # Some flags need to be propagated to the compiler or linker for good
6415 # libtool support.
6416 case $host in
6417 ia64-*-hpux*)
6418   # Find out which ABI we are using.
6419   echo 'int i;' > conftest.$ac_ext
6420   if AC_TRY_EVAL(ac_compile); then
6421     case `/usr/bin/file conftest.$ac_objext` in
6422     *ELF-32*)
6423       HPUX_IA64_MODE="32"
6424       ;;
6425     *ELF-64*)
6426       HPUX_IA64_MODE="64"
6427       ;;
6428     esac
6429   fi
6430   rm -rf conftest*
6431   ;;
6432 *-*-irix6*)
6433   # Find out which ABI we are using.
6434   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
6435   if AC_TRY_EVAL(ac_compile); then
6436    if test "$lt_cv_prog_gnu_ld" = yes; then
6437     case `/usr/bin/file conftest.$ac_objext` in
6438     *32-bit*)
6439       LD="${LD-ld} -melf32bsmip"
6440       ;;
6441     *N32*)
6442       LD="${LD-ld} -melf32bmipn32"
6443       ;;
6444     *64-bit*)
6445       LD="${LD-ld} -melf64bmip"
6446       ;;
6447     esac
6448    else
6449     case `/usr/bin/file conftest.$ac_objext` in
6450     *32-bit*)
6451       LD="${LD-ld} -32"
6452       ;;
6453     *N32*)
6454       LD="${LD-ld} -n32"
6455       ;;
6456     *64-bit*)
6457       LD="${LD-ld} -64"
6458       ;;
6459     esac
6460    fi
6461   fi
6462   rm -rf conftest*
6463   ;;
6465 x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
6466   # Find out which ABI we are using.
6467   echo 'int i;' > conftest.$ac_ext
6468   if AC_TRY_EVAL(ac_compile); then
6469     case "`/usr/bin/file conftest.o`" in
6470     *32-bit*)
6471       LINUX_64_MODE="32"
6472       case $host in
6473         x86_64-*linux*)
6474           LD="${LD-ld} -m elf_i386"
6475           ;;
6476         ppc64-*linux*)
6477           LD="${LD-ld} -m elf32ppclinux"
6478           ;;
6479         s390x-*linux*)
6480           LD="${LD-ld} -m elf_s390"
6481           ;;
6482         sparc64-*linux*)
6483           LD="${LD-ld} -m elf32_sparc"
6484           ;;
6485       esac
6486       ;;
6487     *64-bit*)
6488       LINUX_64_MODE="64"
6489       case $host in
6490         x86_64-*linux*)
6491           LD="${LD-ld} -m elf_x86_64"
6492           ;;
6493         ppc*-*linux*|powerpc*-*linux*)
6494           LD="${LD-ld} -m elf64ppc"
6495           ;;
6496         s390*-*linux*)
6497           LD="${LD-ld} -m elf64_s390"
6498           ;;
6499         sparc*-*linux*)
6500           LD="${LD-ld} -m elf64_sparc"
6501           ;;
6502       esac
6503       ;;
6504     esac
6505   fi
6506   rm -rf conftest*
6507   ;;
6509 *-*-sco3.2v5*)
6510   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
6511   SAVE_CFLAGS="$CFLAGS"
6512   CFLAGS="$CFLAGS -belf"
6513   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
6514     [AC_LANG_PUSH(C)
6515      AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
6516      AC_LANG_POP])
6517   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
6518     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
6519     CFLAGS="$SAVE_CFLAGS"
6520   fi
6521   ;;
6522 AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
6523 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
6524   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
6525   AC_CHECK_TOOL(AS, as, false)
6526   AC_CHECK_TOOL(OBJDUMP, objdump, false)
6527   ;;
6528   ])
6529 esac
6531 need_locks="$enable_libtool_lock"
6533 ])# _LT_AC_LOCK
6536 # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
6537 #               [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
6538 # ----------------------------------------------------------------
6539 # Check whether the given compiler option works
6540 AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
6541 [AC_REQUIRE([LT_AC_PROG_SED])
6542 AC_CACHE_CHECK([$1], [$2],
6543   [$2=no
6544   ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
6545    printf "$lt_simple_compile_test_code" > conftest.$ac_ext
6546    lt_compiler_flag="$3"
6547    # Insert the option either (1) after the last *FLAGS variable, or
6548    # (2) before a word containing "conftest.", or (3) at the end.
6549    # Note that $ac_compile itself does not contain backslashes and begins
6550    # with a dollar sign (not a hyphen), so the echo should work correctly.
6551    # The option is referenced via a variable to avoid confusing sed.
6552    lt_compile=`echo "$ac_compile" | $SED \
6553    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
6554    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
6555    -e 's:$: $lt_compiler_flag:'`
6556    (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
6557    (eval "$lt_compile" 2>conftest.err)
6558    ac_status=$?
6559    cat conftest.err >&AS_MESSAGE_LOG_FD
6560    echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
6561    if (exit $ac_status) && test -s "$ac_outfile"; then
6562      # The compiler can only warn and ignore the option if not recognized
6563      # So say no if there are warnings
6564      if test ! -s conftest.err; then
6565        $2=yes
6566      fi
6567    fi
6568    $rm conftest*
6571 if test x"[$]$2" = xyes; then
6572     ifelse([$5], , :, [$5])
6573 else
6574     ifelse([$6], , :, [$6])
6576 ])# AC_LIBTOOL_COMPILER_OPTION
6579 # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
6580 #                          [ACTION-SUCCESS], [ACTION-FAILURE])
6581 # ------------------------------------------------------------
6582 # Check whether the given compiler option works
6583 AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
6584 [AC_CACHE_CHECK([$1], [$2],
6585   [$2=no
6586    save_LDFLAGS="$LDFLAGS"
6587    LDFLAGS="$LDFLAGS $3"
6588    printf "$lt_simple_link_test_code" > conftest.$ac_ext
6589    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
6590      # The compiler can only warn and ignore the option if not recognized
6591      # So say no if there are warnings
6592      if test -s conftest.err; then
6593        # Append any errors to the config.log.
6594        cat conftest.err 1>&AS_MESSAGE_LOG_FD
6595      else
6596        $2=yes
6597      fi
6598    fi
6599    $rm conftest*
6600    LDFLAGS="$save_LDFLAGS"
6603 if test x"[$]$2" = xyes; then
6604     ifelse([$4], , :, [$4])
6605 else
6606     ifelse([$5], , :, [$5])
6608 ])# AC_LIBTOOL_LINKER_OPTION
6611 # AC_LIBTOOL_SYS_MAX_CMD_LEN
6612 # --------------------------
6613 AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
6614 [# find the maximum length of command line arguments
6615 AC_MSG_CHECKING([the maximum length of command line arguments])
6616 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
6617   i=0
6618   testring="ABCD"
6620   case $build_os in
6621   msdosdjgpp*)
6622     # On DJGPP, this test can blow up pretty badly due to problems in libc
6623     # (any single argument exceeding 2000 bytes causes a buffer overrun
6624     # during glob expansion).  Even if it were fixed, the result of this
6625     # check would be larger than it should be.
6626     lt_cv_sys_max_cmd_len=12288;    # 12K is about right
6627     ;;
6629   gnu*)
6630     # Under GNU Hurd, this test is not required because there is
6631     # no limit to the length of command line arguments.
6632     # Libtool will interpret -1 as no limit whatsoever
6633     lt_cv_sys_max_cmd_len=-1;
6634     ;;
6636   cygwin* | mingw*)
6637     # On Win9x/ME, this test blows up -- it succeeds, but takes
6638     # about 5 minutes as the teststring grows exponentially.
6639     # Worse, since 9x/ME are not pre-emptively multitasking,
6640     # you end up with a "frozen" computer, even though with patience
6641     # the test eventually succeeds (with a max line length of 256k).
6642     # Instead, let's just punt: use the minimum linelength reported by
6643     # all of the supported platforms: 8192 (on NT/2K/XP).
6644     lt_cv_sys_max_cmd_len=8192;
6645     ;;
6647  *)
6648     # If test is not a shell built-in, we'll probably end up computing a
6649     # maximum length that is only half of the actual maximum length, but
6650     # we can't tell.
6651     while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
6652                = "XX$testring") >/dev/null 2>&1 &&
6653             new_result=`expr "X$testring" : ".*" 2>&1` &&
6654             lt_cv_sys_max_cmd_len=$new_result &&
6655             test $i != 17 # 1/2 MB should be enough
6656     do
6657       i=`expr $i + 1`
6658       testring=$testring$testring
6659     done
6660     testring=
6661     # Add a significant safety factor because C++ compilers can tack on massive
6662     # amounts of additional arguments before passing them to the linker.
6663     # It appears as though 1/2 is a usable value.
6664     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
6665     ;;
6666   esac
6668 if test -n $lt_cv_sys_max_cmd_len ; then
6669   AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
6670 else
6671   AC_MSG_RESULT(none)
6673 ])# AC_LIBTOOL_SYS_MAX_CMD_LEN
6676 # _LT_AC_CHECK_DLFCN
6677 # --------------------
6678 AC_DEFUN([_LT_AC_CHECK_DLFCN],
6679 [AC_CHECK_HEADERS(dlfcn.h)dnl
6680 ])# _LT_AC_CHECK_DLFCN
6683 # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
6684 #                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
6685 # ------------------------------------------------------------------
6686 AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
6687 [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
6688 if test "$cross_compiling" = yes; then :
6689   [$4]
6690 else
6691   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
6692   lt_status=$lt_dlunknown
6693   cat > conftest.$ac_ext <<EOF
6694 [#line __oline__ "configure"
6695 #include "confdefs.h"
6697 #if HAVE_DLFCN_H
6698 #include <dlfcn.h>
6699 #endif
6701 #include <stdio.h>
6703 #ifdef RTLD_GLOBAL
6704 #  define LT_DLGLOBAL           RTLD_GLOBAL
6705 #else
6706 #  ifdef DL_GLOBAL
6707 #    define LT_DLGLOBAL         DL_GLOBAL
6708 #  else
6709 #    define LT_DLGLOBAL         0
6710 #  endif
6711 #endif
6713 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
6714    find out it does not work in some platform. */
6715 #ifndef LT_DLLAZY_OR_NOW
6716 #  ifdef RTLD_LAZY
6717 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
6718 #  else
6719 #    ifdef DL_LAZY
6720 #      define LT_DLLAZY_OR_NOW          DL_LAZY
6721 #    else
6722 #      ifdef RTLD_NOW
6723 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
6724 #      else
6725 #        ifdef DL_NOW
6726 #          define LT_DLLAZY_OR_NOW      DL_NOW
6727 #        else
6728 #          define LT_DLLAZY_OR_NOW      0
6729 #        endif
6730 #      endif
6731 #    endif
6732 #  endif
6733 #endif
6735 #ifdef __cplusplus
6736 extern "C" void exit (int);
6737 #endif
6739 void fnord() { int i=42;}
6740 int main ()
6742   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
6743   int status = $lt_dlunknown;
6745   if (self)
6746     {
6747       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
6748       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
6749       /* dlclose (self); */
6750     }
6752     exit (status);
6755   if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
6756     (./conftest; exit; ) 2>/dev/null
6757     lt_status=$?
6758     case x$lt_status in
6759       x$lt_dlno_uscore) $1 ;;
6760       x$lt_dlneed_uscore) $2 ;;
6761       x$lt_unknown|x*) $3 ;;
6762     esac
6763   else :
6764     # compilation failed
6765     $3
6766   fi
6768 rm -fr conftest*
6769 ])# _LT_AC_TRY_DLOPEN_SELF
6772 # AC_LIBTOOL_DLOPEN_SELF
6773 # -------------------
6774 AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
6775 [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
6776 if test "x$enable_dlopen" != xyes; then
6777   enable_dlopen=unknown
6778   enable_dlopen_self=unknown
6779   enable_dlopen_self_static=unknown
6780 else
6781   lt_cv_dlopen=no
6782   lt_cv_dlopen_libs=
6784   case $host_os in
6785   beos*)
6786     lt_cv_dlopen="load_add_on"
6787     lt_cv_dlopen_libs=
6788     lt_cv_dlopen_self=yes
6789     ;;
6791   mingw* | pw32*)
6792     lt_cv_dlopen="LoadLibrary"
6793     lt_cv_dlopen_libs=
6794    ;;
6796   cygwin*)
6797     lt_cv_dlopen="dlopen"
6798     lt_cv_dlopen_libs=
6799    ;;
6801   darwin*)
6802   # if libdl is installed we need to link against it
6803     AC_CHECK_LIB([dl], [dlopen],
6804                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
6805     lt_cv_dlopen="dyld"
6806     lt_cv_dlopen_libs=
6807     lt_cv_dlopen_self=yes
6808     ])
6809    ;;
6810     
6811   *)
6812     AC_CHECK_FUNC([shl_load],
6813           [lt_cv_dlopen="shl_load"],
6814       [AC_CHECK_LIB([dld], [shl_load],
6815             [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
6816         [AC_CHECK_FUNC([dlopen],
6817               [lt_cv_dlopen="dlopen"],
6818           [AC_CHECK_LIB([dl], [dlopen],
6819                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
6820             [AC_CHECK_LIB([svld], [dlopen],
6821                   [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
6822               [AC_CHECK_LIB([dld], [dld_link],
6823                     [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
6824               ])
6825             ])
6826           ])
6827         ])
6828       ])
6829     ;;
6830   esac
6832   if test "x$lt_cv_dlopen" != xno; then
6833     enable_dlopen=yes
6834   else
6835     enable_dlopen=no
6836   fi
6838   case $lt_cv_dlopen in
6839   dlopen)
6840     save_CPPFLAGS="$CPPFLAGS"
6841     test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
6843     save_LDFLAGS="$LDFLAGS"
6844     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
6846     save_LIBS="$LIBS"
6847     LIBS="$lt_cv_dlopen_libs $LIBS"
6849     AC_CACHE_CHECK([whether a program can dlopen itself],
6850           lt_cv_dlopen_self, [dnl
6851           _LT_AC_TRY_DLOPEN_SELF(
6852             lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
6853             lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
6854     ])
6856     if test "x$lt_cv_dlopen_self" = xyes; then
6857       LDFLAGS="$LDFLAGS $link_static_flag"
6858       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
6859           lt_cv_dlopen_self_static, [dnl
6860           _LT_AC_TRY_DLOPEN_SELF(
6861             lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
6862             lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
6863       ])
6864     fi
6866     CPPFLAGS="$save_CPPFLAGS"
6867     LDFLAGS="$save_LDFLAGS"
6868     LIBS="$save_LIBS"
6869     ;;
6870   esac
6872   case $lt_cv_dlopen_self in
6873   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
6874   *) enable_dlopen_self=unknown ;;
6875   esac
6877   case $lt_cv_dlopen_self_static in
6878   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
6879   *) enable_dlopen_self_static=unknown ;;
6880   esac
6882 ])# AC_LIBTOOL_DLOPEN_SELF
6885 # AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
6886 # ---------------------------------
6887 # Check to see if options -c and -o are simultaneously supported by compiler
6888 AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
6889 [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
6890 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
6891   [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
6892   [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
6893    $rm -r conftest 2>/dev/null
6894    mkdir conftest
6895    cd conftest
6896    mkdir out
6897    printf "$lt_simple_compile_test_code" > conftest.$ac_ext
6899    # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
6900    # that will create temporary files in the current directory regardless of
6901    # the output directory.  Thus, making CWD read-only will cause this test
6902    # to fail, enabling locking or at least warning the user not to do parallel
6903    # builds.
6904    chmod -w .
6906    lt_compiler_flag="-o out/conftest2.$ac_objext"
6907    # Insert the option either (1) after the last *FLAGS variable, or
6908    # (2) before a word containing "conftest.", or (3) at the end.
6909    # Note that $ac_compile itself does not contain backslashes and begins
6910    # with a dollar sign (not a hyphen), so the echo should work correctly.
6911    lt_compile=`echo "$ac_compile" | $SED \
6912    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
6913    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
6914    -e 's:$: $lt_compiler_flag:'`
6915    (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
6916    (eval "$lt_compile" 2>out/conftest.err)
6917    ac_status=$?
6918    cat out/conftest.err >&AS_MESSAGE_LOG_FD
6919    echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
6920    if (exit $ac_status) && test -s out/conftest2.$ac_objext
6921    then
6922      # The compiler can only warn and ignore the option if not recognized
6923      # So say no if there are warnings
6924      if test ! -s out/conftest.err; then
6925        _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
6926      fi
6927    fi
6928    chmod u+w .
6929    $rm conftest* out/*
6930    rmdir out
6931    cd ..
6932    rmdir conftest
6933    $rm conftest*
6935 ])# AC_LIBTOOL_PROG_CC_C_O
6938 # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
6939 # -----------------------------------------
6940 # Check to see if we can do hard links to lock some files if needed
6941 AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
6942 [AC_REQUIRE([_LT_AC_LOCK])dnl
6944 hard_links="nottested"
6945 if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
6946   # do not overwrite the value of need_locks provided by the user
6947   AC_MSG_CHECKING([if we can lock with hard links])
6948   hard_links=yes
6949   $rm conftest*
6950   ln conftest.a conftest.b 2>/dev/null && hard_links=no
6951   touch conftest.a
6952   ln conftest.a conftest.b 2>&5 || hard_links=no
6953   ln conftest.a conftest.b 2>/dev/null && hard_links=no
6954   AC_MSG_RESULT([$hard_links])
6955   if test "$hard_links" = no; then
6956     AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
6957     need_locks=warn
6958   fi
6959 else
6960   need_locks=no
6962 ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
6965 # AC_LIBTOOL_OBJDIR
6966 # -----------------
6967 AC_DEFUN([AC_LIBTOOL_OBJDIR],
6968 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
6969 [rm -f .libs 2>/dev/null
6970 mkdir .libs 2>/dev/null
6971 if test -d .libs; then
6972   lt_cv_objdir=.libs
6973 else
6974   # MS-DOS does not allow filenames that begin with a dot.
6975   lt_cv_objdir=_libs
6977 rmdir .libs 2>/dev/null])
6978 objdir=$lt_cv_objdir
6979 ])# AC_LIBTOOL_OBJDIR
6982 # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
6983 # ----------------------------------------------
6984 # Check hardcoding attributes.
6985 AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
6986 [AC_MSG_CHECKING([how to hardcode library paths into programs])
6987 _LT_AC_TAGVAR(hardcode_action, $1)=
6988 if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
6989    test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
6990    test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
6992   # We can hardcode non-existant directories.
6993   if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
6994      # If the only mechanism to avoid hardcoding is shlibpath_var, we
6995      # have to relink, otherwise we might link with an installed library
6996      # when we should be linking with a yet-to-be-installed one
6997      ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
6998      test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
6999     # Linking always hardcodes the temporary library directory.
7000     _LT_AC_TAGVAR(hardcode_action, $1)=relink
7001   else
7002     # We can link without hardcoding, and we can hardcode nonexisting dirs.
7003     _LT_AC_TAGVAR(hardcode_action, $1)=immediate
7004   fi
7005 else
7006   # We cannot hardcode anything, or else we can only hardcode existing
7007   # directories.
7008   _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
7010 AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
7012 if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
7013   # Fast installation is not supported
7014   enable_fast_install=no
7015 elif test "$shlibpath_overrides_runpath" = yes ||
7016      test "$enable_shared" = no; then
7017   # Fast installation is not necessary
7018   enable_fast_install=needless
7020 ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
7023 # AC_LIBTOOL_SYS_LIB_STRIP
7024 # ------------------------
7025 AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
7026 [striplib=
7027 old_striplib=
7028 AC_MSG_CHECKING([whether stripping libraries is possible])
7029 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
7030   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
7031   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
7032   AC_MSG_RESULT([yes])
7033 else
7034 # FIXME - insert some real tests, host_os isn't really good enough
7035   case $host_os in
7036    darwin*)
7037        if test -n "$STRIP" ; then
7038          striplib="$STRIP -x"
7039          AC_MSG_RESULT([yes])
7040        else
7041   AC_MSG_RESULT([no])
7043        ;;
7044    *)
7045   AC_MSG_RESULT([no])
7046     ;;
7047   esac  
7049 ])# AC_LIBTOOL_SYS_LIB_STRIP
7052 # AC_LIBTOOL_SYS_DYNAMIC_LINKER
7053 # -----------------------------
7054 # PORTME Fill in your ld.so characteristics
7055 AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
7056 [AC_MSG_CHECKING([dynamic linker characteristics])
7057 library_names_spec=
7058 libname_spec='lib$name'
7059 soname_spec=
7060 shrext=".so"
7061 postinstall_cmds=
7062 postuninstall_cmds=
7063 finish_cmds=
7064 finish_eval=
7065 shlibpath_var=
7066 shlibpath_overrides_runpath=unknown
7067 version_type=none
7068 dynamic_linker="$host_os ld.so"
7069 sys_lib_dlsearch_path_spec="/lib /usr/lib"
7070 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
7071 need_lib_prefix=unknown
7072 hardcode_into_libs=no
7074 # when you set need_version to no, make sure it does not cause -set_version
7075 # flags to be left without arguments
7076 need_version=unknown
7078 case $host_os in
7079 aix3*)
7080   version_type=linux
7081   library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
7082   shlibpath_var=LIBPATH
7084   # AIX 3 has no versioning support, so we append a major version to the name.
7085   soname_spec='${libname}${release}${shared_ext}$major'
7086   ;;
7088 aix4* | aix5*)
7089   version_type=linux
7090   need_lib_prefix=no
7091   need_version=no
7092   hardcode_into_libs=yes
7093   if test "$host_cpu" = ia64; then
7094     # AIX 5 supports IA64
7095     library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
7096     shlibpath_var=LD_LIBRARY_PATH
7097   else
7098     # With GCC up to 2.95.x, collect2 would create an import file
7099     # for dependence libraries.  The import file would start with
7100     # the line `#! .'.  This would cause the generated library to
7101     # depend on `.', always an invalid library.  This was fixed in
7102     # development snapshots of GCC prior to 3.0.
7103     case $host_os in
7104       aix4 | aix4.[[01]] | aix4.[[01]].*)
7105       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
7106            echo ' yes '
7107            echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
7108         :
7109       else
7110         can_build_shared=no
7111       fi
7112       ;;
7113     esac
7114     # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
7115     # soname into executable. Probably we can add versioning support to
7116     # collect2, so additional links can be useful in future.
7117     if test "$aix_use_runtimelinking" = yes; then
7118       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
7119       # instead of lib<name>.a to let people know that these are not
7120       # typical AIX shared libraries.
7121       library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7122     else
7123       # We preserve .a as extension for shared libraries through AIX4.2
7124       # and later when we are not doing run time linking.
7125       library_names_spec='${libname}${release}.a $libname.a'
7126       soname_spec='${libname}${release}${shared_ext}$major'
7127     fi
7128     shlibpath_var=LIBPATH
7129   fi
7130   ;;
7132 amigaos*)
7133   library_names_spec='$libname.ixlibrary $libname.a'
7134   # Create ${libname}_ixlibrary.a entries in /sys/libs.
7135   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'
7136   ;;
7138 beos*)
7139   library_names_spec='${libname}${shared_ext}'
7140   dynamic_linker="$host_os ld.so"
7141   shlibpath_var=LIBRARY_PATH
7142   ;;
7144 bsdi4*)
7145   version_type=linux
7146   need_version=no
7147   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7148   soname_spec='${libname}${release}${shared_ext}$major'
7149   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
7150   shlibpath_var=LD_LIBRARY_PATH
7151   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
7152   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
7153   # the default ld.so.conf also contains /usr/contrib/lib and
7154   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
7155   # libtool to hard-code these into programs
7156   ;;
7158 cygwin* | mingw* | pw32*)
7159   version_type=windows
7160   shrext=".dll"
7161   need_version=no
7162   need_lib_prefix=no
7164   case $GCC,$host_os in
7165   yes,cygwin* | yes,mingw* | yes,pw32*)
7166     library_names_spec='$libname.dll.a'
7167     # DLL is installed to $(libdir)/../bin by postinstall_cmds
7168     postinstall_cmds='base_file=`basename \${file}`~
7169       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
7170       dldir=$destdir/`dirname \$dlpath`~
7171       test -d \$dldir || mkdir -p \$dldir~
7172       $install_prog $dir/$dlname \$dldir/$dlname'
7173     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
7174       dlpath=$dir/\$dldll~
7175        $rm \$dlpath'
7176     shlibpath_overrides_runpath=yes
7178     case $host_os in
7179     cygwin*)
7180       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
7181       soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
7182       sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
7183       ;;
7184     mingw*)
7185       # MinGW DLLs use traditional 'lib' prefix
7186       soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
7187       sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
7188       if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
7189         # It is most probably a Windows format PATH printed by
7190         # mingw gcc, but we are running on Cygwin. Gcc prints its search
7191         # path with ; separators, and with drive letters. We can handle the
7192         # drive letters (cygwin fileutils understands them), so leave them,
7193         # especially as we might pass files found there to a mingw objdump,
7194         # which wouldn't understand a cygwinified path. Ahh.
7195         sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
7196       else
7197         sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
7198       fi
7199       ;;
7200     pw32*)
7201       # pw32 DLLs use 'pw' prefix rather than 'lib'
7202       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
7203       ;;
7204     esac
7205     ;;
7207   *)
7208     library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
7209     ;;
7210   esac
7211   dynamic_linker='Win32 ld.exe'
7212   # FIXME: first we should search . and the directory the executable is in
7213   shlibpath_var=PATH
7214   ;;
7216 darwin* | rhapsody*)
7217   dynamic_linker="$host_os dyld"
7218   version_type=darwin
7219   need_lib_prefix=no
7220   need_version=no
7221   library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
7222   soname_spec='${libname}${release}${major}$shared_ext'
7223   shlibpath_overrides_runpath=yes
7224   shlibpath_var=DYLD_LIBRARY_PATH
7225   shrext='$(test .$module = .yes && echo .so || echo .dylib)'
7226   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
7227   if test "$GCC" = yes; then
7228     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"`
7229   else
7230     sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
7231   fi
7232   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
7233   ;;
7235 dgux*)
7236   version_type=linux
7237   need_lib_prefix=no
7238   need_version=no
7239   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
7240   soname_spec='${libname}${release}${shared_ext}$major'
7241   shlibpath_var=LD_LIBRARY_PATH
7242   ;;
7244 freebsd1*)
7245   dynamic_linker=no
7246   ;;
7248 kfreebsd*-gnu*)
7249   version_type=linux
7250   need_lib_prefix=no
7251   need_version=no
7252   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
7253   soname_spec='${libname}${release}${shared_ext}$major'
7254   shlibpath_var=LD_LIBRARY_PATH
7255   shlibpath_overrides_runpath=no
7256   hardcode_into_libs=yes
7257   dynamic_linker='GNU ld.so'
7258   ;;
7260 freebsd*)
7261   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
7262   version_type=freebsd-$objformat
7263   case $version_type in
7264     freebsd-elf*)
7265       library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
7266       need_version=no
7267       need_lib_prefix=no
7268       ;;
7269     freebsd-*)
7270       library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
7271       need_version=yes
7272       ;;
7273   esac
7274   shlibpath_var=LD_LIBRARY_PATH
7275   case $host_os in
7276   freebsd2*)
7277     shlibpath_overrides_runpath=yes
7278     ;;
7279   freebsd3.[01]* | freebsdelf3.[01]*)
7280     shlibpath_overrides_runpath=yes
7281     hardcode_into_libs=yes
7282     ;;
7283   *) # from 3.2 on
7284     shlibpath_overrides_runpath=no
7285     hardcode_into_libs=yes
7286     ;;
7287   esac
7288   ;;
7290 gnu*)
7291   version_type=linux
7292   need_lib_prefix=no
7293   need_version=no
7294   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
7295   soname_spec='${libname}${release}${shared_ext}$major'
7296   shlibpath_var=LD_LIBRARY_PATH
7297   hardcode_into_libs=yes
7298   ;;
7300 hpux9* | hpux10* | hpux11*)
7301   # Give a soname corresponding to the major version so that dld.sl refuses to
7302   # link against other versions.
7303   version_type=sunos
7304   need_lib_prefix=no
7305   need_version=no
7306   case "$host_cpu" in
7307   ia64*)
7308     shrext='.so'
7309     hardcode_into_libs=yes
7310     dynamic_linker="$host_os dld.so"
7311     shlibpath_var=LD_LIBRARY_PATH
7312     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
7313     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7314     soname_spec='${libname}${release}${shared_ext}$major'
7315     if test "X$HPUX_IA64_MODE" = X32; then
7316       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
7317     else
7318       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
7319     fi
7320     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
7321     ;;
7322    hppa*64*)
7323      shrext='.sl'
7324      hardcode_into_libs=yes
7325      dynamic_linker="$host_os dld.sl"
7326      shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
7327      shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
7328      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7329      soname_spec='${libname}${release}${shared_ext}$major'
7330      sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
7331      sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
7332      ;;
7333    *)
7334     shrext='.sl'
7335     dynamic_linker="$host_os dld.sl"
7336     shlibpath_var=SHLIB_PATH
7337     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
7338     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7339     soname_spec='${libname}${release}${shared_ext}$major'
7340     ;;
7341   esac
7342   # HP-UX runs *really* slowly unless shared libraries are mode 555.
7343   postinstall_cmds='chmod 555 $lib'
7344   ;;
7346 irix5* | irix6* | nonstopux*)
7347   case $host_os in
7348     nonstopux*) version_type=nonstopux ;;
7349     *)
7350         if test "$lt_cv_prog_gnu_ld" = yes; then
7351                 version_type=linux
7352         else
7353                 version_type=irix
7354         fi ;;
7355   esac
7356   need_lib_prefix=no
7357   need_version=no
7358   soname_spec='${libname}${release}${shared_ext}$major'
7359   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
7360   case $host_os in
7361   irix5* | nonstopux*)
7362     libsuff= shlibsuff=
7363     ;;
7364   *)
7365     case $LD in # libtool.m4 will add one of these switches to LD
7366     *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
7367       libsuff= shlibsuff= libmagic=32-bit;;
7368     *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
7369       libsuff=32 shlibsuff=N32 libmagic=N32;;
7370     *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
7371       libsuff=64 shlibsuff=64 libmagic=64-bit;;
7372     *) libsuff= shlibsuff= libmagic=never-match;;
7373     esac
7374     ;;
7375   esac
7376   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
7377   shlibpath_overrides_runpath=no
7378   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
7379   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
7380   hardcode_into_libs=yes
7381   ;;
7383 # No shared lib support for Linux oldld, aout, or coff.
7384 linux*oldld* | linux*aout* | linux*coff*)
7385   dynamic_linker=no
7386   ;;
7388 # This must be Linux ELF.
7389 linux*)
7390   version_type=linux
7391   need_lib_prefix=no
7392   need_version=no
7393   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7394   soname_spec='${libname}${release}${shared_ext}$major'
7395   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
7396   libsuff=
7397   if test "x$LINUX_64_MODE" = x64; then
7398     # Some platforms are per default 64-bit, so there's no /lib64
7399     if test -d /lib64 -a ! -h /lib64; then
7400       libsuff=64
7401     fi
7402   fi
7403   shlibpath_var=LD_LIBRARY_PATH
7404   shlibpath_overrides_runpath=no
7405   sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
7406   sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
7407   # This implies no fast_install, which is unacceptable.
7408   # Some rework will be needed to allow for fast_install
7409   # before this can be enabled.
7410   hardcode_into_libs=yes
7412   # We used to test for /lib/ld.so.1 and disable shared libraries on
7413   # powerpc, because MkLinux only supported shared libraries with the
7414   # GNU dynamic linker.  Since this was broken with cross compilers,
7415   # most powerpc-linux boxes support dynamic linking these days and
7416   # people can always --disable-shared, the test was removed, and we
7417   # assume the GNU/Linux dynamic linker is in use.
7418   dynamic_linker='GNU/Linux ld.so'
7419   ;;
7421 netbsd*)
7422   version_type=sunos
7423   need_lib_prefix=no
7424   need_version=no
7425   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
7426     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
7427     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
7428     dynamic_linker='NetBSD (a.out) ld.so'
7429   else
7430     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
7431     soname_spec='${libname}${release}${shared_ext}$major'
7432     dynamic_linker='NetBSD ld.elf_so'
7433   fi
7434   shlibpath_var=LD_LIBRARY_PATH
7435   shlibpath_overrides_runpath=yes
7436   hardcode_into_libs=yes
7437   ;;
7439 newsos6)
7440   version_type=linux
7441   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7442   shlibpath_var=LD_LIBRARY_PATH
7443   shlibpath_overrides_runpath=yes
7444   ;;
7446 nto-qnx*)
7447   version_type=linux
7448   need_lib_prefix=no
7449   need_version=no
7450   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7451   soname_spec='${libname}${release}${shared_ext}$major'
7452   shlibpath_var=LD_LIBRARY_PATH
7453   shlibpath_overrides_runpath=yes
7454   ;;
7456 openbsd*)
7457   version_type=sunos
7458   need_lib_prefix=no
7459   need_version=no
7460   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
7461   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
7462   shlibpath_var=LD_LIBRARY_PATH
7463   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7464     case $host_os in
7465       openbsd2.[[89]] | openbsd2.[[89]].*)
7466         shlibpath_overrides_runpath=no
7467         ;;
7468       *)
7469         shlibpath_overrides_runpath=yes
7470         ;;
7471       esac
7472   else
7473     shlibpath_overrides_runpath=yes
7474   fi
7475   ;;
7477 os2*)
7478   libname_spec='$name'
7479   shrext=".dll"
7480   need_lib_prefix=no
7481   library_names_spec='$libname${shared_ext} $libname.a'
7482   dynamic_linker='OS/2 ld.exe'
7483   shlibpath_var=LIBPATH
7484   ;;
7486 osf3* | osf4* | osf5*)
7487   version_type=osf
7488   need_lib_prefix=no
7489   need_version=no
7490   soname_spec='${libname}${release}${shared_ext}$major'
7491   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7492   shlibpath_var=LD_LIBRARY_PATH
7493   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
7494   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
7495   ;;
7497 sco3.2v5*)
7498   version_type=osf
7499   soname_spec='${libname}${release}${shared_ext}$major'
7500   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7501   shlibpath_var=LD_LIBRARY_PATH
7502   ;;
7504 solaris*)
7505   version_type=linux
7506   need_lib_prefix=no
7507   need_version=no
7508   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7509   soname_spec='${libname}${release}${shared_ext}$major'
7510   shlibpath_var=LD_LIBRARY_PATH
7511   shlibpath_overrides_runpath=yes
7512   hardcode_into_libs=yes
7513   # ldd complains unless libraries are executable
7514   postinstall_cmds='chmod +x $lib'
7515   ;;
7517 sunos4*)
7518   version_type=sunos
7519   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
7520   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
7521   shlibpath_var=LD_LIBRARY_PATH
7522   shlibpath_overrides_runpath=yes
7523   if test "$with_gnu_ld" = yes; then
7524     need_lib_prefix=no
7525   fi
7526   need_version=yes
7527   ;;
7529 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
7530   version_type=linux
7531   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7532   soname_spec='${libname}${release}${shared_ext}$major'
7533   shlibpath_var=LD_LIBRARY_PATH
7534   case $host_vendor in
7535     sni)
7536       shlibpath_overrides_runpath=no
7537       need_lib_prefix=no
7538       export_dynamic_flag_spec='${wl}-Blargedynsym'
7539       runpath_var=LD_RUN_PATH
7540       ;;
7541     siemens)
7542       need_lib_prefix=no
7543       ;;
7544     motorola)
7545       need_lib_prefix=no
7546       need_version=no
7547       shlibpath_overrides_runpath=no
7548       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
7549       ;;
7550   esac
7551   ;;
7553 sysv4*MP*)
7554   if test -d /usr/nec ;then
7555     version_type=linux
7556     library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
7557     soname_spec='$libname${shared_ext}.$major'
7558     shlibpath_var=LD_LIBRARY_PATH
7559   fi
7560   ;;
7562 uts4*)
7563   version_type=linux
7564   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
7565   soname_spec='${libname}${release}${shared_ext}$major'
7566   shlibpath_var=LD_LIBRARY_PATH
7567   ;;
7570   dynamic_linker=no
7571   ;;
7572 esac
7573 AC_MSG_RESULT([$dynamic_linker])
7574 test "$dynamic_linker" = no && can_build_shared=no
7575 ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
7578 # _LT_AC_TAGCONFIG
7579 # ----------------
7580 AC_DEFUN([_LT_AC_TAGCONFIG],
7581 [AC_ARG_WITH([tags],
7582     [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
7583         [include additional configurations @<:@automatic@:>@])],
7584     [tagnames="$withval"])
7586 if test -f "$ltmain" && test -n "$tagnames"; then
7587   if test ! -f "${ofile}"; then
7588     AC_MSG_WARN([output file `$ofile' does not exist])
7589   fi
7591   if test -z "$LTCC"; then
7592     eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
7593     if test -z "$LTCC"; then
7594       AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
7595     else
7596       AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
7597     fi
7598   fi
7600   # Extract list of available tagged configurations in $ofile.
7601   # Note that this assumes the entire list is on one line.
7602   available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
7604   lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7605   for tagname in $tagnames; do
7606     IFS="$lt_save_ifs"
7607     # Check whether tagname contains only valid characters
7608     case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
7609     "") ;;
7610     *)  AC_MSG_ERROR([invalid tag name: $tagname])
7611         ;;
7612     esac
7614     if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
7615     then
7616       AC_MSG_ERROR([tag name \"$tagname\" already exists])
7617     fi
7619     # Update the list of available tags.
7620     if test -n "$tagname"; then
7621       echo appending configuration tag \"$tagname\" to $ofile
7623       case $tagname in
7624       CXX)
7625         if test -n "$CXX" && test "X$CXX" != "Xno"; then
7626           AC_LIBTOOL_LANG_CXX_CONFIG
7627         else
7628           tagname=""
7629         fi
7630         ;;
7632       F77)
7633         if test -n "$F77" && test "X$F77" != "Xno"; then
7634           AC_LIBTOOL_LANG_F77_CONFIG
7635         else
7636           tagname=""
7637         fi
7638         ;;
7640       GCJ)
7641         if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
7642           AC_LIBTOOL_LANG_GCJ_CONFIG
7643         else
7644           tagname=""
7645         fi
7646         ;;
7648       RC)
7649         AC_LIBTOOL_LANG_RC_CONFIG
7650         ;;
7652       *)
7653         AC_MSG_ERROR([Unsupported tag name: $tagname])
7654         ;;
7655       esac
7657       # Append the new tag name to the list of available tags.
7658       if test -n "$tagname" ; then
7659       available_tags="$available_tags $tagname"
7660     fi
7661     fi
7662   done
7663   IFS="$lt_save_ifs"
7665   # Now substitute the updated list of available tags.
7666   if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
7667     mv "${ofile}T" "$ofile"
7668     chmod +x "$ofile"
7669   else
7670     rm -f "${ofile}T"
7671     AC_MSG_ERROR([unable to update list of available tagged configurations.])
7672   fi
7674 ])# _LT_AC_TAGCONFIG
7677 # AC_LIBTOOL_DLOPEN
7678 # -----------------
7679 # enable checks for dlopen support
7680 AC_DEFUN([AC_LIBTOOL_DLOPEN],
7681  [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
7682 ])# AC_LIBTOOL_DLOPEN
7685 # AC_LIBTOOL_WIN32_DLL
7686 # --------------------
7687 # declare package support for building win32 dll's
7688 AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
7689 [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
7690 ])# AC_LIBTOOL_WIN32_DLL
7693 # AC_ENABLE_SHARED([DEFAULT])
7694 # ---------------------------
7695 # implement the --enable-shared flag
7696 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7697 AC_DEFUN([AC_ENABLE_SHARED],
7698 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
7699 AC_ARG_ENABLE([shared],
7700     [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
7701         [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
7702     [p=${PACKAGE-default}
7703     case $enableval in
7704     yes) enable_shared=yes ;;
7705     no) enable_shared=no ;;
7706     *)
7707       enable_shared=no
7708       # Look at the argument we got.  We use all the common list separators.
7709       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7710       for pkg in $enableval; do
7711         IFS="$lt_save_ifs"
7712         if test "X$pkg" = "X$p"; then
7713           enable_shared=yes
7714         fi
7715       done
7716       IFS="$lt_save_ifs"
7717       ;;
7718     esac],
7719     [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
7720 ])# AC_ENABLE_SHARED
7723 # AC_DISABLE_SHARED
7724 # -----------------
7725 #- set the default shared flag to --disable-shared
7726 AC_DEFUN([AC_DISABLE_SHARED],
7727 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7728 AC_ENABLE_SHARED(no)
7729 ])# AC_DISABLE_SHARED
7732 # AC_ENABLE_STATIC([DEFAULT])
7733 # ---------------------------
7734 # implement the --enable-static flag
7735 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7736 AC_DEFUN([AC_ENABLE_STATIC],
7737 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
7738 AC_ARG_ENABLE([static],
7739     [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
7740         [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
7741     [p=${PACKAGE-default}
7742     case $enableval in
7743     yes) enable_static=yes ;;
7744     no) enable_static=no ;;
7745     *)
7746      enable_static=no
7747       # Look at the argument we got.  We use all the common list separators.
7748       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7749       for pkg in $enableval; do
7750         IFS="$lt_save_ifs"
7751         if test "X$pkg" = "X$p"; then
7752           enable_static=yes
7753         fi
7754       done
7755       IFS="$lt_save_ifs"
7756       ;;
7757     esac],
7758     [enable_static=]AC_ENABLE_STATIC_DEFAULT)
7759 ])# AC_ENABLE_STATIC
7762 # AC_DISABLE_STATIC
7763 # -----------------
7764 # set the default static flag to --disable-static
7765 AC_DEFUN([AC_DISABLE_STATIC],
7766 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7767 AC_ENABLE_STATIC(no)
7768 ])# AC_DISABLE_STATIC
7771 # AC_ENABLE_FAST_INSTALL([DEFAULT])
7772 # ---------------------------------
7773 # implement the --enable-fast-install flag
7774 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7775 AC_DEFUN([AC_ENABLE_FAST_INSTALL],
7776 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
7777 AC_ARG_ENABLE([fast-install],
7778     [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
7779     [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
7780     [p=${PACKAGE-default}
7781     case $enableval in
7782     yes) enable_fast_install=yes ;;
7783     no) enable_fast_install=no ;;
7784     *)
7785       enable_fast_install=no
7786       # Look at the argument we got.  We use all the common list separators.
7787       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7788       for pkg in $enableval; do
7789         IFS="$lt_save_ifs"
7790         if test "X$pkg" = "X$p"; then
7791           enable_fast_install=yes
7792         fi
7793       done
7794       IFS="$lt_save_ifs"
7795       ;;
7796     esac],
7797     [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
7798 ])# AC_ENABLE_FAST_INSTALL
7801 # AC_DISABLE_FAST_INSTALL
7802 # -----------------------
7803 # set the default to --disable-fast-install
7804 AC_DEFUN([AC_DISABLE_FAST_INSTALL],
7805 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7806 AC_ENABLE_FAST_INSTALL(no)
7807 ])# AC_DISABLE_FAST_INSTALL
7810 # AC_LIBTOOL_PICMODE([MODE])
7811 # --------------------------
7812 # implement the --with-pic flag
7813 # MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
7814 AC_DEFUN([AC_LIBTOOL_PICMODE],
7815 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7816 pic_mode=ifelse($#,1,$1,default)
7817 ])# AC_LIBTOOL_PICMODE
7820 # AC_PROG_EGREP
7821 # -------------
7822 # This is predefined starting with Autoconf 2.54, so this conditional
7823 # definition can be removed once we require Autoconf 2.54 or later.
7824 m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
7825 [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
7826    [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
7827     then ac_cv_prog_egrep='grep -E'
7828     else ac_cv_prog_egrep='egrep'
7829     fi])
7830  EGREP=$ac_cv_prog_egrep
7831  AC_SUBST([EGREP])
7832 ])])
7835 # AC_PATH_TOOL_PREFIX
7836 # -------------------
7837 # find a file program which can recognise shared library
7838 AC_DEFUN([AC_PATH_TOOL_PREFIX],
7839 [AC_REQUIRE([AC_PROG_EGREP])dnl
7840 AC_MSG_CHECKING([for $1])
7841 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
7842 [case $MAGIC_CMD in
7843 [[\\/*] |  ?:[\\/]*])
7844   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
7845   ;;
7847   lt_save_MAGIC_CMD="$MAGIC_CMD"
7848   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7849 dnl $ac_dummy forces splitting on constant user-supplied paths.
7850 dnl POSIX.2 word splitting is done only on the output of word expansions,
7851 dnl not every word.  This closes a longstanding sh security hole.
7852   ac_dummy="ifelse([$2], , $PATH, [$2])"
7853   for ac_dir in $ac_dummy; do
7854     IFS="$lt_save_ifs"
7855     test -z "$ac_dir" && ac_dir=.
7856     if test -f $ac_dir/$1; then
7857       lt_cv_path_MAGIC_CMD="$ac_dir/$1"
7858       if test -n "$file_magic_test_file"; then
7859         case $deplibs_check_method in
7860         "file_magic "*)
7861           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
7862           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7863           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
7864             $EGREP "$file_magic_regex" > /dev/null; then
7865             :
7866           else
7867             cat <<EOF 1>&2
7869 *** Warning: the command libtool uses to detect shared libraries,
7870 *** $file_magic_cmd, produces output that libtool cannot recognize.
7871 *** The result is that libtool may fail to recognize shared libraries
7872 *** as such.  This will affect the creation of libtool libraries that
7873 *** depend on shared libraries, but programs linked with such libtool
7874 *** libraries will work regardless of this problem.  Nevertheless, you
7875 *** may want to report the problem to your system manager and/or to
7876 *** bug-libtool@gnu.org
7879           fi ;;
7880         esac
7881       fi
7882       break
7883     fi
7884   done
7885   IFS="$lt_save_ifs"
7886   MAGIC_CMD="$lt_save_MAGIC_CMD"
7887   ;;
7888 esac])
7889 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7890 if test -n "$MAGIC_CMD"; then
7891   AC_MSG_RESULT($MAGIC_CMD)
7892 else
7893   AC_MSG_RESULT(no)
7895 ])# AC_PATH_TOOL_PREFIX
7898 # AC_PATH_MAGIC
7899 # -------------
7900 # find a file program which can recognise a shared library
7901 AC_DEFUN([AC_PATH_MAGIC],
7902 [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
7903 if test -z "$lt_cv_path_MAGIC_CMD"; then
7904   if test -n "$ac_tool_prefix"; then
7905     AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
7906   else
7907     MAGIC_CMD=:
7908   fi
7910 ])# AC_PATH_MAGIC
7913 # AC_PROG_LD
7914 # ----------
7915 # find the pathname to the GNU or non-GNU linker
7916 AC_DEFUN([AC_PROG_LD],
7917 [AC_ARG_WITH([gnu-ld],
7918     [AC_HELP_STRING([--with-gnu-ld],
7919         [assume the C compiler uses GNU ld @<:@default=no@:>@])],
7920     [test "$withval" = no || with_gnu_ld=yes],
7921     [with_gnu_ld=no])
7922 AC_REQUIRE([LT_AC_PROG_SED])dnl
7923 AC_REQUIRE([AC_PROG_CC])dnl
7924 AC_REQUIRE([AC_CANONICAL_HOST])dnl
7925 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
7926 ac_prog=ld
7927 if test "$GCC" = yes; then
7928   # Check if gcc -print-prog-name=ld gives a path.
7929   AC_MSG_CHECKING([for ld used by $CC])
7930   case $host in
7931   *-*-mingw*)
7932     # gcc leaves a trailing carriage return which upsets mingw
7933     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
7934   *)
7935     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
7936   esac
7937   case $ac_prog in
7938     # Accept absolute paths.
7939     [[\\/]]* | ?:[[\\/]]*)
7940       re_direlt='/[[^/]][[^/]]*/\.\./'
7941       # Canonicalize the pathname of ld
7942       ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
7943       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
7944         ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
7945       done
7946       test -z "$LD" && LD="$ac_prog"
7947       ;;
7948   "")
7949     # If it fails, then pretend we aren't using GCC.
7950     ac_prog=ld
7951     ;;
7952   *)
7953     # If it is relative, then search for the first ld in PATH.
7954     with_gnu_ld=unknown
7955     ;;
7956   esac
7957 elif test "$with_gnu_ld" = yes; then
7958   AC_MSG_CHECKING([for GNU ld])
7959 else
7960   AC_MSG_CHECKING([for non-GNU ld])
7962 AC_CACHE_VAL(lt_cv_path_LD,
7963 [if test -z "$LD"; then
7964   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7965   for ac_dir in $PATH; do
7966     IFS="$lt_save_ifs"
7967     test -z "$ac_dir" && ac_dir=.
7968     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
7969       lt_cv_path_LD="$ac_dir/$ac_prog"
7970       # Check to see if the program is GNU ld.  I'd rather use --version,
7971       # but apparently some GNU ld's only accept -v.
7972       # Break only if it was the GNU/non-GNU ld that we prefer.
7973       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
7974       *GNU* | *'with BFD'*)
7975         test "$with_gnu_ld" != no && break
7976         ;;
7977       *)
7978         test "$with_gnu_ld" != yes && break
7979         ;;
7980       esac
7981     fi
7982   done
7983   IFS="$lt_save_ifs"
7984 else
7985   lt_cv_path_LD="$LD" # Let the user override the test with a path.
7986 fi])
7987 LD="$lt_cv_path_LD"
7988 if test -n "$LD"; then
7989   AC_MSG_RESULT($LD)
7990 else
7991   AC_MSG_RESULT(no)
7993 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
7994 AC_PROG_LD_GNU
7995 ])# AC_PROG_LD
7998 # AC_PROG_LD_GNU
7999 # --------------
8000 AC_DEFUN([AC_PROG_LD_GNU],
8001 [AC_REQUIRE([AC_PROG_EGREP])dnl
8002 AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
8003 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
8004 case `$LD -v 2>&1 </dev/null` in
8005 *GNU* | *'with BFD'*)
8006   lt_cv_prog_gnu_ld=yes
8007   ;;
8009   lt_cv_prog_gnu_ld=no
8010   ;;
8011 esac])
8012 with_gnu_ld=$lt_cv_prog_gnu_ld
8013 ])# AC_PROG_LD_GNU
8016 # AC_PROG_LD_RELOAD_FLAG
8017 # ----------------------
8018 # find reload flag for linker
8019 #   -- PORTME Some linkers may need a different reload flag.
8020 AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
8021 [AC_CACHE_CHECK([for $LD option to reload object files],
8022   lt_cv_ld_reload_flag,
8023   [lt_cv_ld_reload_flag='-r'])
8024 reload_flag=$lt_cv_ld_reload_flag
8025 case $reload_flag in
8026 "" | " "*) ;;
8027 *) reload_flag=" $reload_flag" ;;
8028 esac
8029 reload_cmds='$LD$reload_flag -o $output$reload_objs'
8030 ])# AC_PROG_LD_RELOAD_FLAG
8033 # AC_DEPLIBS_CHECK_METHOD
8034 # -----------------------
8035 # how to check for library dependencies
8036 #  -- PORTME fill in with the dynamic library characteristics
8037 AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
8038 [AC_CACHE_CHECK([how to recognise dependent libraries],
8039 lt_cv_deplibs_check_method,
8040 [lt_cv_file_magic_cmd='$MAGIC_CMD'
8041 lt_cv_file_magic_test_file=
8042 lt_cv_deplibs_check_method='unknown'
8043 # Need to set the preceding variable on all platforms that support
8044 # interlibrary dependencies.
8045 # 'none' -- dependencies not supported.
8046 # `unknown' -- same as none, but documents that we really don't know.
8047 # 'pass_all' -- all dependencies passed with no checks.
8048 # 'test_compile' -- check by making test program.
8049 # 'file_magic [[regex]]' -- check by looking for files in library path
8050 # which responds to the $file_magic_cmd with a given extended regex.
8051 # If you have `file' or equivalent on your system and you're not sure
8052 # whether `pass_all' will *always* work, you probably want this one.
8054 case $host_os in
8055 aix4* | aix5*)
8056   lt_cv_deplibs_check_method=pass_all
8057   ;;
8059 beos*)
8060   lt_cv_deplibs_check_method=pass_all
8061   ;;
8063 bsdi4*)
8064   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
8065   lt_cv_file_magic_cmd='/usr/bin/file -L'
8066   lt_cv_file_magic_test_file=/shlib/libc.so
8067   ;;
8069 cygwin*)
8070   lt_cv_deplibs_check_method=pass_all
8071   ;;
8072   
8073 mingw* | pw32*)
8074   # win32_libid is a shell function defined in ltmain.sh
8075   lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
8076   lt_cv_file_magic_cmd='win32_libid'
8077   ;;
8079 darwin* | rhapsody*)
8080   # this will be overwritten by pass_all, but leave it in just in case
8081   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
8082   lt_cv_file_magic_cmd='/usr/bin/file -L'
8083   case "$host_os" in
8084   rhapsody* | darwin1.[[012]])
8085     lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
8086     ;;
8087   *) # Darwin 1.3 on
8088     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
8089     ;;
8090   esac
8091   lt_cv_deplibs_check_method=pass_all
8092   ;;
8094 freebsd* | kfreebsd*-gnu)
8095   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
8096     case $host_cpu in
8097     i*86 )
8098       # Not sure whether the presence of OpenBSD here was a mistake.
8099       # Let's accept both of them until this is cleared up.
8100       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
8101       lt_cv_file_magic_cmd=/usr/bin/file
8102       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
8103       ;;
8104     esac
8105   else
8106     lt_cv_deplibs_check_method=pass_all
8107   fi
8108   ;;
8110 gnu*)
8111   lt_cv_deplibs_check_method=pass_all
8112   ;;
8114 hpux10.20* | hpux11*)
8115   lt_cv_file_magic_cmd=/usr/bin/file
8116   case "$host_cpu" in
8117   ia64*)
8118     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
8119     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
8120     ;;
8121   hppa*64*)
8122     [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]']
8123     lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
8124     ;;
8125   *)
8126     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
8127     lt_cv_file_magic_test_file=/usr/lib/libc.sl
8128     ;;
8129   esac
8130   ;;
8132 irix5* | irix6* | nonstopux*)
8133   case $host_os in
8134   irix5* | nonstopux*)
8135     # this will be overridden with pass_all, but let us keep it just in case
8136     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
8137     ;;
8138   *)
8139     case $LD in
8140     *-32|*"-32 ") libmagic=32-bit;;
8141     *-n32|*"-n32 ") libmagic=N32;;
8142     *-64|*"-64 ") libmagic=64-bit;;
8143     *) libmagic=never-match;;
8144     esac
8145     # this will be overridden with pass_all, but let us keep it just in case
8146     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
8147     ;;
8148   esac
8149   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
8150   lt_cv_deplibs_check_method=pass_all
8151   ;;
8153 # This must be Linux ELF.
8154 linux*)
8155   case $host_cpu in
8156   alpha* | hppa* | i*86 | ia64* | m68* | mips* | powerpc* | sparc* | s390* | sh* | x86_64* )
8157     lt_cv_deplibs_check_method=pass_all ;;
8158   # the debian people say, arm and glibc 2.3.1 works for them with pass_all
8159   arm* )
8160     lt_cv_deplibs_check_method=pass_all ;;
8161   *)
8162     # glibc up to 2.1.1 does not perform some relocations on ARM
8163     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
8164   esac
8165   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
8166   ;;
8168 netbsd*)
8169   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
8170     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
8171   else
8172     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
8173   fi
8174   ;;
8176 newos6*)
8177   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
8178   lt_cv_file_magic_cmd=/usr/bin/file
8179   lt_cv_file_magic_test_file=/usr/lib/libnls.so
8180   ;;
8182 nto-qnx*)
8183   lt_cv_deplibs_check_method=unknown
8184   ;;
8186 openbsd*)
8187   lt_cv_file_magic_cmd=/usr/bin/file
8188   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
8189   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
8190     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
8191   else
8192     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
8193   fi
8194   ;;
8196 osf3* | osf4* | osf5*)
8197   # this will be overridden with pass_all, but let us keep it just in case
8198   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
8199   lt_cv_file_magic_test_file=/shlib/libc.so
8200   lt_cv_deplibs_check_method=pass_all
8201   ;;
8203 sco3.2v5*)
8204   lt_cv_deplibs_check_method=pass_all
8205   ;;
8207 solaris*)
8208   lt_cv_deplibs_check_method=pass_all
8209   lt_cv_file_magic_test_file=/lib/libc.so
8210   ;;
8212 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
8213   case $host_vendor in
8214   motorola)
8215     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]]'
8216     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
8217     ;;
8218   ncr)
8219     lt_cv_deplibs_check_method=pass_all
8220     ;;
8221   sequent)
8222     lt_cv_file_magic_cmd='/bin/file'
8223     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
8224     ;;
8225   sni)
8226     lt_cv_file_magic_cmd='/bin/file'
8227     lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
8228     lt_cv_file_magic_test_file=/lib/libc.so
8229     ;;
8230   siemens)
8231     lt_cv_deplibs_check_method=pass_all
8232     ;;
8233   esac
8234   ;;
8236 sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
8237   lt_cv_deplibs_check_method=pass_all
8238   ;;
8239 esac
8241 file_magic_cmd=$lt_cv_file_magic_cmd
8242 deplibs_check_method=$lt_cv_deplibs_check_method
8243 test -z "$deplibs_check_method" && deplibs_check_method=unknown
8244 ])# AC_DEPLIBS_CHECK_METHOD
8247 # AC_PROG_NM
8248 # ----------
8249 # find the pathname to a BSD-compatible name lister
8250 AC_DEFUN([AC_PROG_NM],
8251 [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
8252 [if test -n "$NM"; then
8253   # Let the user override the test.
8254   lt_cv_path_NM="$NM"
8255 else
8256   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
8257   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
8258     IFS="$lt_save_ifs"
8259     test -z "$ac_dir" && ac_dir=.
8260     tmp_nm="$ac_dir/${ac_tool_prefix}nm"
8261     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
8262       # Check to see if the nm accepts a BSD-compat flag.
8263       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
8264       #   nm: unknown option "B" ignored
8265       # Tru64's nm complains that /dev/null is an invalid object file
8266       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
8267       */dev/null* | *'Invalid file or object type'*)
8268         lt_cv_path_NM="$tmp_nm -B"
8269         break
8270         ;;
8271       *)
8272         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
8273         */dev/null*)
8274           lt_cv_path_NM="$tmp_nm -p"
8275           break
8276           ;;
8277         *)
8278           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
8279           continue # so that we can try to find one that supports BSD flags
8280           ;;
8281         esac
8282       esac
8283     fi
8284   done
8285   IFS="$lt_save_ifs"
8286   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
8287 fi])
8288 NM="$lt_cv_path_NM"
8289 ])# AC_PROG_NM
8292 # AC_CHECK_LIBM
8293 # -------------
8294 # check for math library
8295 AC_DEFUN([AC_CHECK_LIBM],
8296 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
8297 LIBM=
8298 case $host in
8299 *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
8300   # These system don't have libm, or don't need it
8301   ;;
8302 *-ncr-sysv4.3*)
8303   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
8304   AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
8305   ;;
8307   AC_CHECK_LIB(m, cos, LIBM="-lm")
8308   ;;
8309 esac
8310 ])# AC_CHECK_LIBM
8313 # AC_LIBLTDL_CONVENIENCE([DIRECTORY])
8314 # -----------------------------------
8315 # sets LIBLTDL to the link flags for the libltdl convenience library and
8316 # LTDLINCL to the include flags for the libltdl header and adds
8317 # --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
8318 # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
8319 # DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
8320 # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
8321 # '${top_srcdir}/' (note the single quotes!).  If your package is not
8322 # flat and you're not using automake, define top_builddir and
8323 # top_srcdir appropriately in the Makefiles.
8324 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
8325 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
8326   case $enable_ltdl_convenience in
8327   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
8328   "") enable_ltdl_convenience=yes
8329       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
8330   esac
8331   LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
8332   LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
8333   # For backwards non-gettext consistent compatibility...
8334   INCLTDL="$LTDLINCL"
8335 ])# AC_LIBLTDL_CONVENIENCE
8338 # AC_LIBLTDL_INSTALLABLE([DIRECTORY])
8339 # -----------------------------------
8340 # sets LIBLTDL to the link flags for the libltdl installable library and
8341 # LTDLINCL to the include flags for the libltdl header and adds
8342 # --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
8343 # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
8344 # DIRECTORY is not provided and an installed libltdl is not found, it is
8345 # assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
8346 # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
8347 # quotes!).  If your package is not flat and you're not using automake,
8348 # define top_builddir and top_srcdir appropriately in the Makefiles.
8349 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
8350 AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
8351 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
8352   AC_CHECK_LIB(ltdl, lt_dlinit,
8353   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
8354   [if test x"$enable_ltdl_install" = xno; then
8355      AC_MSG_WARN([libltdl not installed, but installation disabled])
8356    else
8357      enable_ltdl_install=yes
8358    fi
8359   ])
8360   if test x"$enable_ltdl_install" = x"yes"; then
8361     ac_configure_args="$ac_configure_args --enable-ltdl-install"
8362     LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
8363     LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
8364   else
8365     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
8366     LIBLTDL="-lltdl"
8367     LTDLINCL=
8368   fi
8369   # For backwards non-gettext consistent compatibility...
8370   INCLTDL="$LTDLINCL"
8371 ])# AC_LIBLTDL_INSTALLABLE
8374 # AC_LIBTOOL_CXX
8375 # --------------
8376 # enable support for C++ libraries
8377 AC_DEFUN([AC_LIBTOOL_CXX],
8378 [AC_REQUIRE([_LT_AC_LANG_CXX])
8379 ])# AC_LIBTOOL_CXX
8382 # _LT_AC_LANG_CXX
8383 # ---------------
8384 AC_DEFUN([_LT_AC_LANG_CXX],
8385 [AC_REQUIRE([AC_PROG_CXX])
8386 AC_REQUIRE([AC_PROG_CXXCPP])
8387 _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
8388 ])# _LT_AC_LANG_CXX
8391 # AC_LIBTOOL_F77
8392 # --------------
8393 # enable support for Fortran 77 libraries
8394 AC_DEFUN([AC_LIBTOOL_F77],
8395 [AC_REQUIRE([_LT_AC_LANG_F77])
8396 ])# AC_LIBTOOL_F77
8399 # _LT_AC_LANG_F77
8400 # ---------------
8401 AC_DEFUN([_LT_AC_LANG_F77],
8402 [AC_REQUIRE([AC_PROG_F77])
8403 _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
8404 ])# _LT_AC_LANG_F77
8407 # AC_LIBTOOL_GCJ
8408 # --------------
8409 # enable support for GCJ libraries
8410 AC_DEFUN([AC_LIBTOOL_GCJ],
8411 [AC_REQUIRE([_LT_AC_LANG_GCJ])
8412 ])# AC_LIBTOOL_GCJ
8415 # _LT_AC_LANG_GCJ
8416 # ---------------
8417 AC_DEFUN([_LT_AC_LANG_GCJ],
8418 [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
8419   [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
8420     [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
8421       [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
8422          [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
8423            [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
8424 _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
8425 ])# _LT_AC_LANG_GCJ
8428 # AC_LIBTOOL_RC
8429 # --------------
8430 # enable support for Windows resource files
8431 AC_DEFUN([AC_LIBTOOL_RC],
8432 [AC_REQUIRE([LT_AC_PROG_RC])
8433 _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
8434 ])# AC_LIBTOOL_RC
8437 # AC_LIBTOOL_LANG_C_CONFIG
8438 # ------------------------
8439 # Ensure that the configuration vars for the C compiler are
8440 # suitably defined.  Those variables are subsequently used by
8441 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
8442 AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
8443 AC_DEFUN([_LT_AC_LANG_C_CONFIG],
8444 [lt_save_CC="$CC"
8445 AC_LANG_PUSH(C)
8447 # Source file extension for C test sources.
8448 ac_ext=c
8450 # Object file extension for compiled C test sources.
8451 objext=o
8452 _LT_AC_TAGVAR(objext, $1)=$objext
8454 # Code to be used in simple compile tests
8455 lt_simple_compile_test_code="int some_variable = 0;\n"
8457 # Code to be used in simple link tests
8458 lt_simple_link_test_code='int main(){return(0);}\n'
8460 _LT_AC_SYS_COMPILER
8463 # Check for any special shared library compilation flags.
8465 _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
8466 if test "$GCC" = no; then
8467   case $host_os in
8468   sco3.2v5*)
8469     _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
8470     ;;
8471   esac
8473 if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
8474   AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
8475   if echo "$old_CC $old_CFLAGS " | grep "[[     ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[      ]]" >/dev/null; then :
8476   else
8477     AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
8478     _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
8479   fi
8484 # Check to make sure the static flag actually works.
8486 AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
8487   _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
8488   $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
8489   [],
8490   [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
8493 ## CAVEAT EMPTOR:
8494 ## There is no encapsulation within the following macros, do not change
8495 ## the running order or otherwise move them around unless you know exactly
8496 ## what you are doing...
8497 AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
8498 AC_LIBTOOL_PROG_COMPILER_PIC($1)
8499 AC_LIBTOOL_PROG_CC_C_O($1)
8500 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
8501 AC_LIBTOOL_PROG_LD_SHLIBS($1)
8502 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
8503 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
8504 AC_LIBTOOL_SYS_LIB_STRIP
8505 AC_LIBTOOL_DLOPEN_SELF($1)
8507 # Report which librarie types wil actually be built
8508 AC_MSG_CHECKING([if libtool supports shared libraries])
8509 AC_MSG_RESULT([$can_build_shared])
8511 AC_MSG_CHECKING([whether to build shared libraries])
8512 test "$can_build_shared" = "no" && enable_shared=no
8514 # On AIX, shared libraries and static libraries use the same namespace, and
8515 # are all built from PIC.
8516 case "$host_os" in
8517 aix3*)
8518   test "$enable_shared" = yes && enable_static=no
8519   if test -n "$RANLIB"; then
8520     archive_cmds="$archive_cmds~\$RANLIB \$lib"
8521     postinstall_cmds='$RANLIB $lib'
8522   fi
8523   ;;
8525 aix4*)
8526   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8527     test "$enable_shared" = yes && enable_static=no
8528   fi
8529   ;;
8530   darwin* | rhapsody*)
8531   if test "$GCC" = yes; then
8532     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8533     case "$host_os" in
8534     rhapsody* | darwin1.[[012]])
8535       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
8536       ;;
8537     *) # Darwin 1.3 on
8538       if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
8539         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
8540       else
8541         case ${MACOSX_DEPLOYMENT_TARGET} in
8542           10.[012])
8543             _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
8544             ;;
8545           10.*)
8546             _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
8547             ;;
8548         esac
8549       fi
8550       ;;
8551     esac
8552     output_verbose_link_cmd='echo'
8553     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
8554     _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
8555     # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
8556     _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}'
8557     _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}'
8558     _LT_AC_TAGVAR(hardcode_direct, $1)=no
8559     _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
8560     _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
8561     _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
8562     _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8563   else
8564     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8565   fi  
8566     ;;  
8567 esac
8568 AC_MSG_RESULT([$enable_shared])
8570 AC_MSG_CHECKING([whether to build static libraries])
8571 # Make sure either enable_shared or enable_static is yes.
8572 test "$enable_shared" = yes || enable_static=yes
8573 AC_MSG_RESULT([$enable_static])
8575 AC_LIBTOOL_CONFIG($1)
8577 AC_LANG_POP
8578 CC="$lt_save_CC"
8579 ])# AC_LIBTOOL_LANG_C_CONFIG
8582 # AC_LIBTOOL_LANG_CXX_CONFIG
8583 # --------------------------
8584 # Ensure that the configuration vars for the C compiler are
8585 # suitably defined.  Those variables are subsequently used by
8586 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
8587 AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
8588 AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
8589 [AC_LANG_PUSH(C++)
8590 AC_REQUIRE([AC_PROG_CXX])
8591 AC_REQUIRE([AC_PROG_CXXCPP])
8593 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8594 _LT_AC_TAGVAR(allow_undefined_flag, $1)=
8595 _LT_AC_TAGVAR(always_export_symbols, $1)=no
8596 _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
8597 _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
8598 _LT_AC_TAGVAR(hardcode_direct, $1)=no
8599 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
8600 _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
8601 _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
8602 _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
8603 _LT_AC_TAGVAR(hardcode_automatic, $1)=no
8604 _LT_AC_TAGVAR(module_cmds, $1)=
8605 _LT_AC_TAGVAR(module_expsym_cmds, $1)=
8606 _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
8607 _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8608 _LT_AC_TAGVAR(no_undefined_flag, $1)=
8609 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
8610 _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8612 # Dependencies to place before and after the object being linked:
8613 _LT_AC_TAGVAR(predep_objects, $1)=
8614 _LT_AC_TAGVAR(postdep_objects, $1)=
8615 _LT_AC_TAGVAR(predeps, $1)=
8616 _LT_AC_TAGVAR(postdeps, $1)=
8617 _LT_AC_TAGVAR(compiler_lib_search_path, $1)=
8619 # Source file extension for C++ test sources.
8620 ac_ext=cc
8622 # Object file extension for compiled C++ test sources.
8623 objext=o
8624 _LT_AC_TAGVAR(objext, $1)=$objext
8626 # Code to be used in simple compile tests
8627 lt_simple_compile_test_code="int some_variable = 0;\n"
8629 # Code to be used in simple link tests
8630 lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
8632 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8633 _LT_AC_SYS_COMPILER
8635 # Allow CC to be a program name with arguments.
8636 lt_save_CC=$CC
8637 lt_save_LD=$LD
8638 lt_save_GCC=$GCC
8639 GCC=$GXX
8640 lt_save_with_gnu_ld=$with_gnu_ld
8641 lt_save_path_LD=$lt_cv_path_LD
8642 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
8643   lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
8644 else
8645   unset lt_cv_prog_gnu_ld
8647 if test -n "${lt_cv_path_LDCXX+set}"; then
8648   lt_cv_path_LD=$lt_cv_path_LDCXX
8649 else
8650   unset lt_cv_path_LD
8652 test -z "${LDCXX+set}" || LD=$LDCXX
8653 CC=${CXX-"c++"}
8654 compiler=$CC
8655 _LT_AC_TAGVAR(compiler, $1)=$CC
8656 cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
8658 # We don't want -fno-exception wen compiling C++ code, so set the
8659 # no_builtin_flag separately
8660 if test "$GXX" = yes; then
8661   _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
8662 else
8663   _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
8666 if test "$GXX" = yes; then
8667   # Set up default GNU C++ configuration
8669   AC_PROG_LD
8671   # Check if GNU C++ uses GNU ld as the underlying linker, since the
8672   # archiving commands below assume that GNU ld is being used.
8673   if test "$with_gnu_ld" = yes; then
8674     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
8675     _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'
8677     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
8678     _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
8680     # If archive_cmds runs LD, not CC, wlarc should be empty
8681     # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
8682     #     investigate it a little bit more. (MM)
8683     wlarc='${wl}'
8685     # ancient GNU ld didn't support --whole-archive et. al.
8686     if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
8687         grep 'no-whole-archive' > /dev/null; then
8688       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
8689     else
8690       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
8691     fi
8692   else
8693     with_gnu_ld=no
8694     wlarc=
8696     # A generic and very simple default shared library creation
8697     # command for GNU C++ for the case where it uses the native
8698     # linker, instead of GNU ld.  If possible, this setting should
8699     # overridden to take advantage of the native linker features on
8700     # the platform it is being used on.
8701     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $lib'
8702   fi
8704   # Commands to make compiler produce verbose output that lists
8705   # what "hidden" libraries, object files and flags are used when
8706   # linking a shared library.
8707   output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
8709 else
8710   GXX=no
8711   with_gnu_ld=no
8712   wlarc=
8715 # PORTME: fill in a description of your system's C++ link characteristics
8716 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
8717 _LT_AC_TAGVAR(ld_shlibs, $1)=yes
8718 case $host_os in
8719   aix3*)
8720     # FIXME: insert proper C++ library support
8721     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8722     ;;
8723   aix4* | aix5*)
8724     if test "$host_cpu" = ia64; then
8725       # On IA64, the linker does run time linking by default, so we don't
8726       # have to do anything special.
8727       aix_use_runtimelinking=no
8728       exp_sym_flag='-Bexport'
8729       no_entry_flag=""
8730     else
8731       # KDE requires run time linking.  Make it the default.
8732       aix_use_runtimelinking=yes
8733       exp_sym_flag='-bexport'
8734       no_entry_flag='-bnoentry'
8735     fi
8737     # When large executables or shared objects are built, AIX ld can
8738     # have problems creating the table of contents.  If linking a library
8739     # or program results in "error TOC overflow" add -mminimal-toc to
8740     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
8741     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
8743     _LT_AC_TAGVAR(archive_cmds, $1)=''
8744     _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8745     _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
8746     _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8748     if test "$GXX" = yes; then
8749       case $host_os in aix4.[012]|aix4.[012].*)
8750       # We only want to do this on AIX 4.2 and lower, the check
8751       # below for broken collect2 doesn't work under 4.3+
8752         collect2name=`${CC} -print-prog-name=collect2`
8753         if test -f "$collect2name" && \
8754            strings "$collect2name" | grep resolve_lib_name >/dev/null
8755         then
8756           # We have reworked collect2
8757           _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8758         else
8759           # We have old collect2
8760           _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
8761           # It fails to find uninstalled libraries when the uninstalled
8762           # path is not listed in the libpath.  Setting hardcode_minus_L
8763           # to unsupported forces relinking
8764           _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
8765           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8766           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
8767         fi
8768       esac
8769       shared_flag='-shared'
8770     else
8771       # not using gcc
8772       if test "$host_cpu" = ia64; then
8773         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
8774         # chokes on -Wl,-G. The following line is correct:
8775         shared_flag='-G'
8776       else
8777         if test "$aix_use_runtimelinking" = yes; then
8778           shared_flag='-qmkshrobj ${wl}-G'
8779         else
8780           shared_flag='-qmkshrobj'
8781         fi
8782       fi
8783     fi
8785     # Let the compiler handle the export list.
8786     _LT_AC_TAGVAR(always_export_symbols, $1)=no
8787     if test "$aix_use_runtimelinking" = yes; then
8788       # Warning - without using the other runtime loading flags (-brtl),
8789       # -berok will link without error, but may produce a broken library.
8790       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
8791       # Determine the default libpath from the value encoded in an empty executable.
8792       _LT_AC_SYS_LIBPATH_AIX
8793       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
8795       _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"
8796       _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"
8797      else
8798       if test "$host_cpu" = ia64; then
8799         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
8800         _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
8801         _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"
8802       else
8803         # Determine the default libpath from the value encoded in an empty executable.
8804         _LT_AC_SYS_LIBPATH_AIX
8805         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
8806         # Warning - without using the other run time loading flags,
8807         # -berok will link without error, but may produce a broken library.
8808         _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
8809         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
8810         # -bexpall does not export symbols beginning with underscore (_)
8811         _LT_AC_TAGVAR(always_export_symbols, $1)=yes
8812         # Exported symbols can be pulled into shared objects from archives
8813         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
8814         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
8815         # This is similar to how AIX traditionally builds it's shared libraries.
8816         _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'
8817       fi
8818     fi
8819     ;;
8820   chorus*)
8821     case $cc_basename in
8822       *)
8823         # FIXME: insert proper C++ library support
8824         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8825         ;;
8826     esac
8827     ;;
8829   cygwin* | mingw* | pw32*)
8830     # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
8831     # as there is no search path for DLLs.
8832     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8833     _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
8834     _LT_AC_TAGVAR(always_export_symbols, $1)=no
8835     _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
8837     if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
8838       _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'
8839       # If the export-symbols file already is a .def file (1st line
8840       # is EXPORTS), use it as is; otherwise, prepend...
8841       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
8842         cp $export_symbols $output_objdir/$soname.def;
8843       else
8844         echo EXPORTS > $output_objdir/$soname.def;
8845         cat $export_symbols >> $output_objdir/$soname.def;
8846       fi~
8847       $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'
8848     else
8849       _LT_AC_TAGVAR(ld_shlibs, $1)=no
8850     fi
8851   ;;
8853   darwin* | rhapsody*)
8854   if test "$GXX" = yes; then
8855     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8856     case "$host_os" in
8857     rhapsody* | darwin1.[[012]])
8858       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
8859       ;;
8860     *) # Darwin 1.3 on
8861       if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
8862         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
8863       else
8864         case ${MACOSX_DEPLOYMENT_TARGET} in
8865           10.[012])
8866             _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
8867             ;;
8868           10.*)
8869             _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
8870             ;;
8871         esac
8872       fi
8873       ;;
8874     esac
8875     lt_int_apple_cc_single_mod=no
8876     output_verbose_link_cmd='echo'
8877     if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
8878       lt_int_apple_cc_single_mod=yes
8879     fi
8880     if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
8881       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
8882     else
8883       _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'
8884     fi
8885     _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
8887     # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
8888     if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
8889       _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}'
8890     else
8891       _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}'
8892     fi
8893     _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}'
8894     _LT_AC_TAGVAR(hardcode_direct, $1)=no
8895     _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
8896     _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
8897     _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
8898     _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8899   else
8900     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8901   fi
8902     ;;
8904   dgux*)
8905     case $cc_basename in
8906       ec++)
8907         # FIXME: insert proper C++ library support
8908         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8909         ;;
8910       ghcx)
8911         # Green Hills C++ Compiler
8912         # FIXME: insert proper C++ library support
8913         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8914         ;;
8915       *)
8916         # FIXME: insert proper C++ library support
8917         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8918         ;;
8919     esac
8920     ;;
8921   freebsd[12]*)
8922     # C++ shared libraries reported to be fairly broken before switch to ELF
8923     _LT_AC_TAGVAR(ld_shlibs, $1)=no
8924     ;;
8925   freebsd-elf*)
8926     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8927     ;;
8928   freebsd* | kfreebsd*-gnu)
8929     # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
8930     # conventions
8931     _LT_AC_TAGVAR(ld_shlibs, $1)=yes
8932     ;;
8933   gnu*)
8934     ;;
8935   hpux9*)
8936     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
8937     _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8938     _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8939     _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8940     _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
8941                                 # but as the default
8942                                 # location of the library.
8944     case $cc_basename in
8945     CC)
8946       # FIXME: insert proper C++ library support
8947       _LT_AC_TAGVAR(ld_shlibs, $1)=no
8948       ;;
8949     aCC)
8950       _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'
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 -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'
8960       ;;
8961     *)
8962       if test "$GXX" = yes; then
8963         _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'
8964       else
8965         # FIXME: insert proper C++ library support
8966         _LT_AC_TAGVAR(ld_shlibs, $1)=no
8967       fi
8968       ;;
8969     esac
8970     ;;
8971   hpux10*|hpux11*)
8972     if test $with_gnu_ld = no; then
8973       case "$host_cpu" in
8974       hppa*64*)
8975         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
8976         _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
8977         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8978         ;;
8979       ia64*)
8980         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8981         ;;
8982       *)
8983         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
8984         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8985         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8986         ;;
8987       esac
8988     fi
8989     case "$host_cpu" in
8990     hppa*64*)
8991       _LT_AC_TAGVAR(hardcode_direct, $1)=no
8992       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8993       ;;
8994     ia64*)
8995       _LT_AC_TAGVAR(hardcode_direct, $1)=no
8996       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8997       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
8998                                               # but as the default
8999                                               # location of the library.
9000       ;;
9001     *)
9002       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
9003       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
9004                                               # but as the default
9005                                               # location of the library.
9006       ;;
9007     esac
9009     case $cc_basename in
9010       CC)
9011         # FIXME: insert proper C++ library support
9012         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9013         ;;
9014       aCC)
9015         case "$host_cpu" in
9016         hppa*64*|ia64*)
9017           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
9018           ;;
9019         *)
9020           _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'
9021           ;;
9022         esac
9023         # Commands to make compiler produce verbose output that lists
9024         # what "hidden" libraries, object files and flags are used when
9025         # linking a shared library.
9026         #
9027         # There doesn't appear to be a way to prevent this compiler from
9028         # explicitly linking system object files so we need to strip them
9029         # from the output so that they don't get included in the library
9030         # dependencies.
9031         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'
9032         ;;
9033       *)
9034         if test "$GXX" = yes; then
9035           if test $with_gnu_ld = no; then
9036             case "$host_cpu" in
9037             ia64*|hppa*64*)
9038               _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
9039               ;;
9040             *)
9041               _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'
9042               ;;
9043             esac
9044           fi
9045         else
9046           # FIXME: insert proper C++ library support
9047           _LT_AC_TAGVAR(ld_shlibs, $1)=no
9048         fi
9049         ;;
9050     esac
9051     ;;
9052   irix5* | irix6*)
9053     case $cc_basename in
9054       CC)
9055         # SGI C++
9056         _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'
9058         # Archives containing C++ object files must be created using
9059         # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
9060         # necessary to make sure instantiated templates are included
9061         # in the archive.
9062         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
9063         ;;
9064       *)
9065         if test "$GXX" = yes; then
9066           if test "$with_gnu_ld" = no; then
9067             _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'
9068           else
9069             _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'
9070           fi
9071         fi
9072         _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
9073         ;;
9074     esac
9075     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
9076     _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9077     ;;
9078   linux*)
9079     case $cc_basename in
9080       KCC)
9081         # Kuck and Associates, Inc. (KAI) C++ Compiler
9083         # KCC will only create a shared library if the output file
9084         # ends with ".so" (or ".sl" for HP-UX), so rename the library
9085         # to its proper name (with version) after linking.
9086         _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'
9087         _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'
9088         # Commands to make compiler produce verbose output that lists
9089         # what "hidden" libraries, object files and flags are used when
9090         # linking a shared library.
9091         #
9092         # There doesn't appear to be a way to prevent this compiler from
9093         # explicitly linking system object files so we need to strip them
9094         # from the output so that they don't get included in the library
9095         # dependencies.
9096         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'
9098         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
9099         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
9101         # Archives containing C++ object files must be created using
9102         # "CC -Bstatic", where "CC" is the KAI C++ compiler.
9103         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
9104         ;;
9105       icpc)
9106         # Intel C++
9107         with_gnu_ld=yes
9108         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9109         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
9110         _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'
9111         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
9112         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
9113         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
9114         ;;
9115       cxx)
9116         # Compaq C++
9117         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib'
9118         _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'
9120         runpath_var=LD_RUN_PATH
9121         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
9122         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9124         # Commands to make compiler produce verbose output that lists
9125         # what "hidden" libraries, object files and flags are used when
9126         # linking a shared library.
9127         #
9128         # There doesn't appear to be a way to prevent this compiler from
9129         # explicitly linking system object files so we need to strip them
9130         # from the output so that they don't get included in the library
9131         # dependencies.
9132         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'
9133         ;;
9134     esac
9135     ;;
9136   lynxos*)
9137     # FIXME: insert proper C++ library support
9138     _LT_AC_TAGVAR(ld_shlibs, $1)=no
9139     ;;
9140   m88k*)
9141     # FIXME: insert proper C++ library support
9142     _LT_AC_TAGVAR(ld_shlibs, $1)=no
9143     ;;
9144   mvs*)
9145     case $cc_basename in
9146       cxx)
9147         # FIXME: insert proper C++ library support
9148         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9149         ;;
9150       *)
9151         # FIXME: insert proper C++ library support
9152         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9153         ;;
9154     esac
9155     ;;
9156   netbsd*)
9157     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
9158       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
9159       wlarc=
9160       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9161       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
9162       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9163     fi
9164     # Workaround some broken pre-1.5 toolchains
9165     output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
9166     ;;
9167   osf3*)
9168     case $cc_basename in
9169       KCC)
9170         # Kuck and Associates, Inc. (KAI) C++ Compiler
9172         # KCC will only create a shared library if the output file
9173         # ends with ".so" (or ".sl" for HP-UX), so rename the library
9174         # to its proper name (with version) after linking.
9175         _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'
9177         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
9178         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9180         # Archives containing C++ object files must be created using
9181         # "CC -Bstatic", where "CC" is the KAI C++ compiler.
9182         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
9184         ;;
9185       RCC)
9186         # Rational C++ 2.4.1
9187         # FIXME: insert proper C++ library support
9188         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9189         ;;
9190       cxx)
9191         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
9192         _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'
9194         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
9195         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9197         # Commands to make compiler produce verbose output that lists
9198         # what "hidden" libraries, object files and flags are used when
9199         # linking a shared library.
9200         #
9201         # There doesn't appear to be a way to prevent this compiler from
9202         # explicitly linking system object files so we need to strip them
9203         # from the output so that they don't get included in the library
9204         # dependencies.
9205         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'
9206         ;;
9207       *)
9208         if test "$GXX" = yes && test "$with_gnu_ld" = no; then
9209           _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
9210           _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'
9212           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
9213           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9215           # Commands to make compiler produce verbose output that lists
9216           # what "hidden" libraries, object files and flags are used when
9217           # linking a shared library.
9218           output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
9220         else
9221           # FIXME: insert proper C++ library support
9222           _LT_AC_TAGVAR(ld_shlibs, $1)=no
9223         fi
9224         ;;
9225     esac
9226     ;;
9227   osf4* | osf5*)
9228     case $cc_basename in
9229       KCC)
9230         # Kuck and Associates, Inc. (KAI) C++ Compiler
9232         # KCC will only create a shared library if the output file
9233         # ends with ".so" (or ".sl" for HP-UX), so rename the library
9234         # to its proper name (with version) after linking.
9235         _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'
9237         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
9238         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9240         # Archives containing C++ object files must be created using
9241         # the KAI C++ compiler.
9242         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
9243         ;;
9244       RCC)
9245         # Rational C++ 2.4.1
9246         # FIXME: insert proper C++ library support
9247         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9248         ;;
9249       cxx)
9250         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
9251         _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'
9252         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
9253           echo "-hidden">> $lib.exp~
9254           $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~
9255           $rm $lib.exp'
9257         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
9258         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9260         # Commands to make compiler produce verbose output that lists
9261         # what "hidden" libraries, object files and flags are used when
9262         # linking a shared library.
9263         #
9264         # There doesn't appear to be a way to prevent this compiler from
9265         # explicitly linking system object files so we need to strip them
9266         # from the output so that they don't get included in the library
9267         # dependencies.
9268         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'
9269         ;;
9270       *)
9271         if test "$GXX" = yes && test "$with_gnu_ld" = no; then
9272           _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
9273          _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'
9275           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
9276           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
9278           # Commands to make compiler produce verbose output that lists
9279           # what "hidden" libraries, object files and flags are used when
9280           # linking a shared library.
9281           output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
9283         else
9284           # FIXME: insert proper C++ library support
9285           _LT_AC_TAGVAR(ld_shlibs, $1)=no
9286         fi
9287         ;;
9288     esac
9289     ;;
9290   psos*)
9291     # FIXME: insert proper C++ library support
9292     _LT_AC_TAGVAR(ld_shlibs, $1)=no
9293     ;;
9294   sco*)
9295     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9296     case $cc_basename in
9297       CC)
9298         # FIXME: insert proper C++ library support
9299         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9300         ;;
9301       *)
9302         # FIXME: insert proper C++ library support
9303         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9304         ;;
9305     esac
9306     ;;
9307   sunos4*)
9308     case $cc_basename in
9309       CC)
9310         # Sun C++ 4.x
9311         # FIXME: insert proper C++ library support
9312         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9313         ;;
9314       lcc)
9315         # Lucid
9316         # FIXME: insert proper C++ library support
9317         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9318         ;;
9319       *)
9320         # FIXME: insert proper C++ library support
9321         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9322         ;;
9323     esac
9324     ;;
9325   solaris*)
9326     case $cc_basename in
9327       CC)
9328         # Sun C++ 4.2, 5.x and Centerline C++
9329         _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
9330         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects'
9331         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
9332         $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'
9334         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
9335         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
9336         case $host_os in
9337           solaris2.[0-5] | solaris2.[0-5].*) ;;
9338           *)
9339             # The C++ compiler is used as linker so we must use $wl
9340             # flag to pass the commands to the underlying system
9341             # linker.
9342             # Supported since Solaris 2.6 (maybe 2.5.1?)
9343             _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
9344             ;;
9345         esac
9346         _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
9348         # Commands to make compiler produce verbose output that lists
9349         # what "hidden" libraries, object files and flags are used when
9350         # linking a shared library.
9351         #
9352         # There doesn't appear to be a way to prevent this compiler from
9353         # explicitly linking system object files so we need to strip them
9354         # from the output so that they don't get included in the library
9355         # dependencies.
9356         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'
9358         # Archives containing C++ object files must be created using
9359         # "CC -xar", where "CC" is the Sun C++ compiler.  This is
9360         # necessary to make sure instantiated templates are included
9361         # in the archive.
9362         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
9363         ;;
9364       gcx)
9365         # Green Hills C++ Compiler
9366         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
9368         # The C++ compiler must be used to create the archive.
9369         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
9370         ;;
9371       *)
9372         # GNU C++ compiler with Solaris linker
9373         if test "$GXX" = yes && test "$with_gnu_ld" = no; then
9374           _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
9375           if $CC --version | grep -v '^2\.7' > /dev/null; then
9376             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
9377             _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
9378                 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
9380             # Commands to make compiler produce verbose output that lists
9381             # what "hidden" libraries, object files and flags are used when
9382             # linking a shared library.
9383             output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
9384           else
9385             # g++ 2.7 appears to require `-G' NOT `-shared' on this
9386             # platform.
9387             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib'
9388             _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
9389                 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$rm $lib.exp'
9391             # Commands to make compiler produce verbose output that lists
9392             # what "hidden" libraries, object files and flags are used when
9393             # linking a shared library.
9394             output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
9395           fi
9397           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
9398         fi
9399         ;;
9400     esac
9401     ;;
9402   sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
9403     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9404     ;;
9405   tandem*)
9406     case $cc_basename in
9407       NCC)
9408         # NonStop-UX NCC 3.20
9409         # FIXME: insert proper C++ library support
9410         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9411         ;;
9412       *)
9413         # FIXME: insert proper C++ library support
9414         _LT_AC_TAGVAR(ld_shlibs, $1)=no
9415         ;;
9416     esac
9417     ;;
9418   vxworks*)
9419     # FIXME: insert proper C++ library support
9420     _LT_AC_TAGVAR(ld_shlibs, $1)=no
9421     ;;
9422   *)
9423     # FIXME: insert proper C++ library support
9424     _LT_AC_TAGVAR(ld_shlibs, $1)=no
9425     ;;
9426 esac
9427 AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
9428 test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
9430 _LT_AC_TAGVAR(GCC, $1)="$GXX"
9431 _LT_AC_TAGVAR(LD, $1)="$LD"
9433 ## CAVEAT EMPTOR:
9434 ## There is no encapsulation within the following macros, do not change
9435 ## the running order or otherwise move them around unless you know exactly
9436 ## what you are doing...
9437 AC_LIBTOOL_POSTDEP_PREDEP($1)
9438 AC_LIBTOOL_PROG_COMPILER_PIC($1)
9439 AC_LIBTOOL_PROG_CC_C_O($1)
9440 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
9441 AC_LIBTOOL_PROG_LD_SHLIBS($1)
9442 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
9443 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
9444 AC_LIBTOOL_SYS_LIB_STRIP
9445 AC_LIBTOOL_DLOPEN_SELF($1)
9447 AC_LIBTOOL_CONFIG($1)
9449 AC_LANG_POP
9450 CC=$lt_save_CC
9451 LDCXX=$LD
9452 LD=$lt_save_LD
9453 GCC=$lt_save_GCC
9454 with_gnu_ldcxx=$with_gnu_ld
9455 with_gnu_ld=$lt_save_with_gnu_ld
9456 lt_cv_path_LDCXX=$lt_cv_path_LD
9457 lt_cv_path_LD=$lt_save_path_LD
9458 lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
9459 lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
9460 ])# AC_LIBTOOL_LANG_CXX_CONFIG
9462 # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
9463 # ------------------------
9464 # Figure out "hidden" library dependencies from verbose
9465 # compiler output when linking a shared library.
9466 # Parse the compiler output and extract the necessary
9467 # objects, libraries and library flags.
9468 AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
9469 dnl we can't use the lt_simple_compile_test_code here,
9470 dnl because it contains code intended for an executable,
9471 dnl not a library.  It's possible we should let each
9472 dnl tag define a new lt_????_link_test_code variable,
9473 dnl but it's only used here...
9474 ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
9475 int a;
9476 void foo (void) { a = 0; }
9478 ],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
9479 class Foo
9481 public:
9482   Foo (void) { a = 0; }
9483 private:
9484   int a;
9487 ],[$1],[F77],[cat > conftest.$ac_ext <<EOF
9488       subroutine foo
9489       implicit none
9490       integer*4 a
9491       a=0
9492       return
9493       end
9495 ],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
9496 public class foo {
9497   private int a;
9498   public void bar (void) {
9499     a = 0;
9500   }
9504 dnl Parse the compiler output and extract the necessary
9505 dnl objects, libraries and library flags.
9506 if AC_TRY_EVAL(ac_compile); then
9507   # Parse the compiler output and extract the necessary
9508   # objects, libraries and library flags.
9510   # Sentinel used to keep track of whether or not we are before
9511   # the conftest object file.
9512   pre_test_object_deps_done=no
9514   # The `*' in the case matches for architectures that use `case' in
9515   # $output_verbose_cmd can trigger glob expansion during the loop
9516   # eval without this substitution.
9517   output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
9519   for p in `eval $output_verbose_link_cmd`; do
9520     case $p in
9522     -L* | -R* | -l*)
9523        # Some compilers place space between "-{L,R}" and the path.
9524        # Remove the space.
9525        if test $p = "-L" \
9526           || test $p = "-R"; then
9527          prev=$p
9528          continue
9529        else
9530          prev=
9531        fi
9533        if test "$pre_test_object_deps_done" = no; then
9534          case $p in
9535          -L* | -R*)
9536            # Internal compiler library paths should come after those
9537            # provided the user.  The postdeps already come after the
9538            # user supplied libs so there is no need to process them.
9539            if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
9540              _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
9541            else
9542              _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
9543            fi
9544            ;;
9545          # The "-l" case would never come before the object being
9546          # linked, so don't bother handling this case.
9547          esac
9548        else
9549          if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
9550            _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
9551          else
9552            _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
9553          fi
9554        fi
9555        ;;
9557     *.$objext|*.$libext)
9558        # This assumes that the test object file only shows up
9559        # once in the compiler output.
9560        if test "$p" = "conftest.$objext"; then
9561          pre_test_object_deps_done=yes
9562          continue
9563        fi
9565        if test "$pre_test_object_deps_done" = no; then
9566          if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
9567            _LT_AC_TAGVAR(predep_objects, $1)="$p"
9568          else
9569            _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
9570          fi
9571        else
9572          if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
9573            _LT_AC_TAGVAR(postdep_objects, $1)="$p"
9574          else
9575            _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
9576          fi
9577        fi
9578        ;;
9580     *) ;; # Ignore the rest.
9582     esac
9583   done
9585   # Clean up.
9586   rm -f a.out a.exe
9587 else
9588   echo "libtool.m4: error: problem compiling $1 test program"
9591 $rm -f confest.$objext
9593 case " $_LT_AC_TAGVAR(postdeps, $1) " in
9594 *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
9595 esac
9596 ])# AC_LIBTOOL_POSTDEP_PREDEP
9598 # AC_LIBTOOL_LANG_F77_CONFIG
9599 # ------------------------
9600 # Ensure that the configuration vars for the C compiler are
9601 # suitably defined.  Those variables are subsequently used by
9602 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
9603 AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
9604 AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
9605 [AC_REQUIRE([AC_PROG_F77])
9606 AC_LANG_PUSH(Fortran 77)
9608 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9609 _LT_AC_TAGVAR(allow_undefined_flag, $1)=
9610 _LT_AC_TAGVAR(always_export_symbols, $1)=no
9611 _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
9612 _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
9613 _LT_AC_TAGVAR(hardcode_direct, $1)=no
9614 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
9615 _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
9616 _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
9617 _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
9618 _LT_AC_TAGVAR(hardcode_automatic, $1)=no
9619 _LT_AC_TAGVAR(module_cmds, $1)=
9620 _LT_AC_TAGVAR(module_expsym_cmds, $1)=
9621 _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
9622 _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
9623 _LT_AC_TAGVAR(no_undefined_flag, $1)=
9624 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
9625 _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
9627 # Source file extension for f77 test sources.
9628 ac_ext=f
9630 # Object file extension for compiled f77 test sources.
9631 objext=o
9632 _LT_AC_TAGVAR(objext, $1)=$objext
9634 # Code to be used in simple compile tests
9635 lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
9637 # Code to be used in simple link tests
9638 lt_simple_link_test_code="      program t\n      end\n"
9640 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
9641 _LT_AC_SYS_COMPILER
9643 # Allow CC to be a program name with arguments.
9644 lt_save_CC="$CC"
9645 CC=${F77-"f77"}
9646 compiler=$CC
9647 _LT_AC_TAGVAR(compiler, $1)=$CC
9648 cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
9650 AC_MSG_CHECKING([if libtool supports shared libraries])
9651 AC_MSG_RESULT([$can_build_shared])
9653 AC_MSG_CHECKING([whether to build shared libraries])
9654 test "$can_build_shared" = "no" && enable_shared=no
9656 # On AIX, shared libraries and static libraries use the same namespace, and
9657 # are all built from PIC.
9658 case "$host_os" in
9659 aix3*)
9660   test "$enable_shared" = yes && enable_static=no
9661   if test -n "$RANLIB"; then
9662     archive_cmds="$archive_cmds~\$RANLIB \$lib"
9663     postinstall_cmds='$RANLIB $lib'
9664   fi
9665   ;;
9666 aix4*)
9667   test "$enable_shared" = yes && enable_static=no
9668   ;;
9669 esac
9670 AC_MSG_RESULT([$enable_shared])
9672 AC_MSG_CHECKING([whether to build static libraries])
9673 # Make sure either enable_shared or enable_static is yes.
9674 test "$enable_shared" = yes || enable_static=yes
9675 AC_MSG_RESULT([$enable_static])
9677 test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
9679 _LT_AC_TAGVAR(GCC, $1)="$G77"
9680 _LT_AC_TAGVAR(LD, $1)="$LD"
9682 AC_LIBTOOL_PROG_COMPILER_PIC($1)
9683 AC_LIBTOOL_PROG_CC_C_O($1)
9684 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
9685 AC_LIBTOOL_PROG_LD_SHLIBS($1)
9686 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
9687 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
9688 AC_LIBTOOL_SYS_LIB_STRIP
9691 AC_LIBTOOL_CONFIG($1)
9693 AC_LANG_POP
9694 CC="$lt_save_CC"
9695 ])# AC_LIBTOOL_LANG_F77_CONFIG
9698 # AC_LIBTOOL_LANG_GCJ_CONFIG
9699 # --------------------------
9700 # Ensure that the configuration vars for the C compiler are
9701 # suitably defined.  Those variables are subsequently used by
9702 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
9703 AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
9704 AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
9705 [AC_LANG_SAVE
9707 # Source file extension for Java test sources.
9708 ac_ext=java
9710 # Object file extension for compiled Java test sources.
9711 objext=o
9712 _LT_AC_TAGVAR(objext, $1)=$objext
9714 # Code to be used in simple compile tests
9715 lt_simple_compile_test_code="class foo {}\n"
9717 # Code to be used in simple link tests
9718 lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
9720 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
9721 _LT_AC_SYS_COMPILER
9723 # Allow CC to be a program name with arguments.
9724 lt_save_CC="$CC"
9725 CC=${GCJ-"gcj"}
9726 compiler=$CC
9727 _LT_AC_TAGVAR(compiler, $1)=$CC
9729 # GCJ did not exist at the time GCC didn't implicitly link libc in.
9730 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
9732 ## CAVEAT EMPTOR:
9733 ## There is no encapsulation within the following macros, do not change
9734 ## the running order or otherwise move them around unless you know exactly
9735 ## what you are doing...
9736 AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
9737 AC_LIBTOOL_PROG_COMPILER_PIC($1)
9738 AC_LIBTOOL_PROG_CC_C_O($1)
9739 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
9740 AC_LIBTOOL_PROG_LD_SHLIBS($1)
9741 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
9742 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
9743 AC_LIBTOOL_SYS_LIB_STRIP
9744 AC_LIBTOOL_DLOPEN_SELF($1)
9746 AC_LIBTOOL_CONFIG($1)
9748 AC_LANG_RESTORE
9749 CC="$lt_save_CC"
9750 ])# AC_LIBTOOL_LANG_GCJ_CONFIG
9753 # AC_LIBTOOL_LANG_RC_CONFIG
9754 # --------------------------
9755 # Ensure that the configuration vars for the Windows resource compiler are
9756 # suitably defined.  Those variables are subsequently used by
9757 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
9758 AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
9759 AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
9760 [AC_LANG_SAVE
9762 # Source file extension for RC test sources.
9763 ac_ext=rc
9765 # Object file extension for compiled RC test sources.
9766 objext=o
9767 _LT_AC_TAGVAR(objext, $1)=$objext
9769 # Code to be used in simple compile tests
9770 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
9772 # Code to be used in simple link tests
9773 lt_simple_link_test_code="$lt_simple_compile_test_code"
9775 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
9776 _LT_AC_SYS_COMPILER
9778 # Allow CC to be a program name with arguments.
9779 lt_save_CC="$CC"
9780 CC=${RC-"windres"}
9781 compiler=$CC
9782 _LT_AC_TAGVAR(compiler, $1)=$CC
9783 _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
9785 AC_LIBTOOL_CONFIG($1)
9787 AC_LANG_RESTORE
9788 CC="$lt_save_CC"
9789 ])# AC_LIBTOOL_LANG_RC_CONFIG
9792 # AC_LIBTOOL_CONFIG([TAGNAME])
9793 # ----------------------------
9794 # If TAGNAME is not passed, then create an initial libtool script
9795 # with a default configuration from the untagged config vars.  Otherwise
9796 # add code to config.status for appending the configuration named by
9797 # TAGNAME from the matching tagged config vars.
9798 AC_DEFUN([AC_LIBTOOL_CONFIG],
9799 [# The else clause should only fire when bootstrapping the
9800 # libtool distribution, otherwise you forgot to ship ltmain.sh
9801 # with your package, and you will get complaints that there are
9802 # no rules to generate ltmain.sh.
9803 if test -f "$ltmain"; then
9804   # See if we are running on zsh, and set the options which allow our commands through
9805   # without removal of \ escapes.
9806   if test -n "${ZSH_VERSION+set}" ; then
9807     setopt NO_GLOB_SUBST
9808   fi  
9809   # Now quote all the things that may contain metacharacters while being
9810   # careful not to overquote the AC_SUBSTed values.  We take copies of the
9811   # variables and quote the copies for generation of the libtool script.
9812   for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
9813     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
9814     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
9815     deplibs_check_method reload_flag reload_cmds need_locks \
9816     lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
9817     lt_cv_sys_global_symbol_to_c_name_address \
9818     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
9819     old_postinstall_cmds old_postuninstall_cmds \
9820     _LT_AC_TAGVAR(compiler, $1) \
9821     _LT_AC_TAGVAR(CC, $1) \
9822     _LT_AC_TAGVAR(LD, $1) \
9823     _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
9824     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
9825     _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
9826     _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
9827     _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
9828     _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
9829     _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
9830     _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
9831     _LT_AC_TAGVAR(old_archive_cmds, $1) \
9832     _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
9833     _LT_AC_TAGVAR(predep_objects, $1) \
9834     _LT_AC_TAGVAR(postdep_objects, $1) \
9835     _LT_AC_TAGVAR(predeps, $1) \
9836     _LT_AC_TAGVAR(postdeps, $1) \
9837     _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
9838     _LT_AC_TAGVAR(archive_cmds, $1) \
9839     _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
9840     _LT_AC_TAGVAR(postinstall_cmds, $1) \
9841     _LT_AC_TAGVAR(postuninstall_cmds, $1) \
9842     _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
9843     _LT_AC_TAGVAR(allow_undefined_flag, $1) \
9844     _LT_AC_TAGVAR(no_undefined_flag, $1) \
9845     _LT_AC_TAGVAR(export_symbols_cmds, $1) \
9846     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
9847     _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
9848     _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
9849     _LT_AC_TAGVAR(hardcode_automatic, $1) \
9850     _LT_AC_TAGVAR(module_cmds, $1) \
9851     _LT_AC_TAGVAR(module_expsym_cmds, $1) \
9852     _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
9853     _LT_AC_TAGVAR(exclude_expsyms, $1) \
9854     _LT_AC_TAGVAR(include_expsyms, $1); do
9856     case $var in
9857     _LT_AC_TAGVAR(old_archive_cmds, $1) | \
9858     _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
9859     _LT_AC_TAGVAR(archive_cmds, $1) | \
9860     _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
9861     _LT_AC_TAGVAR(module_cmds, $1) | \
9862     _LT_AC_TAGVAR(module_expsym_cmds, $1) | \   
9863     _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
9864     _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
9865     extract_expsyms_cmds | reload_cmds | finish_cmds | \
9866     postinstall_cmds | postuninstall_cmds | \
9867     old_postinstall_cmds | old_postuninstall_cmds | \
9868     sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
9869       # Double-quote double-evaled strings.
9870       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
9871       ;;
9872     *)
9873       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
9874       ;;
9875     esac
9876   done
9878   case $lt_echo in
9879   *'\[$]0 --fallback-echo"')
9880     lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
9881     ;;
9882   esac
9884 ifelse([$1], [],
9885   [cfgfile="${ofile}T"
9886   trap "$rm \"$cfgfile\"; exit 1" 1 2 15
9887   $rm -f "$cfgfile"
9888   AC_MSG_NOTICE([creating $ofile])],
9889   [cfgfile="$ofile"])
9891   cat <<__EOF__ >> "$cfgfile"
9892 ifelse([$1], [],
9893 [#! $SHELL
9895 # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
9896 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
9897 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
9899 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
9900 # Free Software Foundation, Inc.
9902 # This file is part of GNU Libtool:
9903 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
9905 # This program is free software; you can redistribute it and/or modify
9906 # it under the terms of the GNU General Public License as published by
9907 # the Free Software Foundation; either version 2 of the License, or
9908 # (at your option) any later version.
9910 # This program is distributed in the hope that it will be useful, but
9911 # WITHOUT ANY WARRANTY; without even the implied warranty of
9912 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9913 # General Public License for more details.
9915 # You should have received a copy of the GNU General Public License
9916 # along with this program; if not, write to the Free Software
9917 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
9919 # As a special exception to the GNU General Public License, if you
9920 # distribute this file as part of a program that contains a
9921 # configuration script generated by Autoconf, you may include it under
9922 # the same distribution terms that you use for the rest of that program.
9924 # A sed program that does not truncate output.
9925 SED=$lt_SED
9927 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
9928 Xsed="$SED -e s/^X//"
9930 # The HP-UX ksh and POSIX shell print the target directory to stdout
9931 # if CDPATH is set.
9932 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
9934 # The names of the tagged configurations supported by this script.
9935 available_tags=
9937 # ### BEGIN LIBTOOL CONFIG],
9938 [# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
9940 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
9942 # Shell to use when invoking shell scripts.
9943 SHELL=$lt_SHELL
9945 # Whether or not to build shared libraries.
9946 build_libtool_libs=$enable_shared
9948 # Whether or not to build static libraries.
9949 build_old_libs=$enable_static
9951 # Whether or not to add -lc for building shared libraries.
9952 build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
9954 # Whether or not to disallow shared libs when runtime libs are static
9955 allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
9957 # Whether or not to optimize for fast installation.
9958 fast_install=$enable_fast_install
9960 # The host system.
9961 host_alias=$host_alias
9962 host=$host
9964 # An echo program that does not interpret backslashes.
9965 echo=$lt_echo
9967 # The archiver.
9968 AR=$lt_AR
9969 AR_FLAGS=$lt_AR_FLAGS
9971 # A C compiler.
9972 LTCC=$lt_LTCC
9974 # A language-specific compiler.
9975 CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
9977 # Is the compiler the GNU C compiler?
9978 with_gcc=$_LT_AC_TAGVAR(GCC, $1)
9980 # An ERE matcher.
9981 EGREP=$lt_EGREP
9983 # The linker used to build libraries.
9984 LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
9986 # Whether we need hard or soft links.
9987 LN_S=$lt_LN_S
9989 # A BSD-compatible nm program.
9990 NM=$lt_NM
9992 # A symbol stripping program
9993 STRIP=$STRIP
9995 # Used to examine libraries when file_magic_cmd begins "file"
9996 MAGIC_CMD=$MAGIC_CMD
9998 # Used on cygwin: DLL creation program.
9999 DLLTOOL="$DLLTOOL"
10001 # Used on cygwin: object dumper.
10002 OBJDUMP="$OBJDUMP"
10004 # Used on cygwin: assembler.
10005 AS="$AS"
10007 # The name of the directory that contains temporary libtool files.
10008 objdir=$objdir
10010 # How to create reloadable object files.
10011 reload_flag=$lt_reload_flag
10012 reload_cmds=$lt_reload_cmds
10014 # How to pass a linker flag through the compiler.
10015 wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
10017 # Object file suffix (normally "o").
10018 objext="$ac_objext"
10020 # Old archive suffix (normally "a").
10021 libext="$libext"
10023 # Shared library suffix (normally ".so").
10024 shrext='$shrext'
10026 # Executable file suffix (normally "").
10027 exeext="$exeext"
10029 # Additional compiler flags for building library objects.
10030 pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
10031 pic_mode=$pic_mode
10033 # What is the maximum length of a command?
10034 max_cmd_len=$lt_cv_sys_max_cmd_len
10036 # Does compiler simultaneously support -c and -o options?
10037 compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
10039 # Must we lock files when doing compilation ?
10040 need_locks=$lt_need_locks
10042 # Do we need the lib prefix for modules?
10043 need_lib_prefix=$need_lib_prefix
10045 # Do we need a version for libraries?
10046 need_version=$need_version
10048 # Whether dlopen is supported.
10049 dlopen_support=$enable_dlopen
10051 # Whether dlopen of programs is supported.
10052 dlopen_self=$enable_dlopen_self
10054 # Whether dlopen of statically linked programs is supported.
10055 dlopen_self_static=$enable_dlopen_self_static
10057 # Compiler flag to prevent dynamic linking.
10058 link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
10060 # Compiler flag to turn off builtin functions.
10061 no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
10063 # Compiler flag to allow reflexive dlopens.
10064 export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
10066 # Compiler flag to generate shared objects directly from archives.
10067 whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
10069 # Compiler flag to generate thread-safe objects.
10070 thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
10072 # Library versioning type.
10073 version_type=$version_type
10075 # Format of library name prefix.
10076 libname_spec=$lt_libname_spec
10078 # List of archive names.  First name is the real one, the rest are links.
10079 # The last name is the one that the linker finds with -lNAME.
10080 library_names_spec=$lt_library_names_spec
10082 # The coded name of the library, if different from the real name.
10083 soname_spec=$lt_soname_spec
10085 # Commands used to build and install an old-style archive.
10086 RANLIB=$lt_RANLIB
10087 old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
10088 old_postinstall_cmds=$lt_old_postinstall_cmds
10089 old_postuninstall_cmds=$lt_old_postuninstall_cmds
10091 # Create an old-style archive from a shared archive.
10092 old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
10094 # Create a temporary old-style archive to link instead of a shared archive.
10095 old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
10097 # Commands used to build and install a shared archive.
10098 archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
10099 archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
10100 postinstall_cmds=$lt_postinstall_cmds
10101 postuninstall_cmds=$lt_postuninstall_cmds
10103 # Commands used to build a loadable module (assumed same as above if empty)
10104 module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
10105 module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
10107 # Commands to strip libraries.
10108 old_striplib=$lt_old_striplib
10109 striplib=$lt_striplib
10111 # Dependencies to place before the objects being linked to create a
10112 # shared library.
10113 predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
10115 # Dependencies to place after the objects being linked to create a
10116 # shared library.
10117 postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
10119 # Dependencies to place before the objects being linked to create a
10120 # shared library.
10121 predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
10123 # Dependencies to place after the objects being linked to create a
10124 # shared library.
10125 postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
10127 # The library search path used internally by the compiler when linking
10128 # a shared library.
10129 compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
10131 # Method to check whether dependent libraries are shared objects.
10132 deplibs_check_method=$lt_deplibs_check_method
10134 # Command to use when deplibs_check_method == file_magic.
10135 file_magic_cmd=$lt_file_magic_cmd
10137 # Flag that allows shared libraries with undefined symbols to be built.
10138 allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
10140 # Flag that forces no undefined symbols.
10141 no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
10143 # Commands used to finish a libtool library installation in a directory.
10144 finish_cmds=$lt_finish_cmds
10146 # Same as above, but a single script fragment to be evaled but not shown.
10147 finish_eval=$lt_finish_eval
10149 # Take the output of nm and produce a listing of raw symbols and C names.
10150 global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
10152 # Transform the output of nm in a proper C declaration
10153 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
10155 # Transform the output of nm in a C name address pair
10156 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
10158 # This is the shared library runtime path variable.
10159 runpath_var=$runpath_var
10161 # This is the shared library path variable.
10162 shlibpath_var=$shlibpath_var
10164 # Is shlibpath searched before the hard-coded library search path?
10165 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
10167 # How to hardcode a shared library path into an executable.
10168 hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
10170 # Whether we should hardcode library paths into libraries.
10171 hardcode_into_libs=$hardcode_into_libs
10173 # Flag to hardcode \$libdir into a binary during linking.
10174 # This must work even if \$libdir does not exist.
10175 hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
10177 # If ld is used when linking, flag to hardcode \$libdir into
10178 # a binary during linking. This must work even if \$libdir does
10179 # not exist.
10180 hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
10182 # Whether we need a single -rpath flag with a separated argument.
10183 hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
10185 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
10186 # resulting binary.
10187 hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
10189 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
10190 # resulting binary.
10191 hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
10193 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
10194 # the resulting binary.
10195 hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
10197 # Set to yes if building a shared library automatically hardcodes DIR into the library
10198 # and all subsequent libraries and executables linked against it.
10199 hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
10201 # Variables whose values should be saved in libtool wrapper scripts and
10202 # restored at relink time.
10203 variables_saved_for_relink="$variables_saved_for_relink"
10205 # Whether libtool must link a program against all its dependency libraries.
10206 link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
10208 # Compile-time system search path for libraries
10209 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
10211 # Run-time system search path for libraries
10212 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
10214 # Fix the shell variable \$srcfile for the compiler.
10215 fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
10217 # Set to yes if exported symbols are required.
10218 always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
10220 # The commands to list exported symbols.
10221 export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
10223 # The commands to extract the exported symbol list from a shared archive.
10224 extract_expsyms_cmds=$lt_extract_expsyms_cmds
10226 # Symbols that should not be listed in the preloaded symbols.
10227 exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
10229 # Symbols that must always be exported.
10230 include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
10232 ifelse([$1],[],
10233 [# ### END LIBTOOL CONFIG],
10234 [# ### END LIBTOOL TAG CONFIG: $tagname])
10236 __EOF__
10238 ifelse([$1],[], [
10239   case $host_os in
10240   aix3*)
10241     cat <<\EOF >> "$cfgfile"
10243 # AIX sometimes has problems with the GCC collect2 program.  For some
10244 # reason, if we set the COLLECT_NAMES environment variable, the problems
10245 # vanish in a puff of smoke.
10246 if test "X${COLLECT_NAMES+set}" != Xset; then
10247   COLLECT_NAMES=
10248   export COLLECT_NAMES
10251     ;;
10252   esac
10254   # We use sed instead of cat because bash on DJGPP gets confused if
10255   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
10256   # text mode, it properly converts lines to CR/LF.  This bash problem
10257   # is reportedly fixed, but why not run on old versions too?
10258   sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
10260   mv -f "$cfgfile" "$ofile" || \
10261     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
10262   chmod +x "$ofile"
10264 else
10265   # If there is no Makefile yet, we rely on a make rule to execute
10266   # `config.status --recheck' to rerun these tests and create the
10267   # libtool script then.
10268   test -f Makefile && make "$ltmain"
10270 ])# AC_LIBTOOL_CONFIG
10273 # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
10274 # -------------------------------------------
10275 AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
10276 [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
10278 _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
10280 if test "$GCC" = yes; then
10281   _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
10283   AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
10284     lt_cv_prog_compiler_rtti_exceptions,
10285     [-fno-rtti -fno-exceptions], [],
10286     [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
10288 ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
10291 # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
10292 # ---------------------------------
10293 AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
10294 [AC_REQUIRE([AC_CANONICAL_HOST])
10295 AC_REQUIRE([AC_PROG_NM])
10296 AC_REQUIRE([AC_OBJEXT])
10297 # Check for command to grab the raw symbol name followed by C symbol from nm.
10298 AC_MSG_CHECKING([command to parse $NM output from $compiler object])
10299 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
10301 # These are sane defaults that work on at least a few old systems.
10302 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
10304 # Character class describing NM global symbol codes.
10305 symcode='[[BCDEGRST]]'
10307 # Regexp to match symbols that can be accessed directly from C.
10308 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
10310 # Transform the above into a raw symbol and a C symbol.
10311 symxfrm='\1 \2\3 \3'
10313 # Transform an extracted symbol line into a proper C declaration
10314 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
10316 # Transform an extracted symbol line into symbol name and symbol address
10317 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'"
10319 # Define system-specific variables.
10320 case $host_os in
10321 aix*)
10322   symcode='[[BCDT]]'
10323   ;;
10324 cygwin* | mingw* | pw32*)
10325   symcode='[[ABCDGISTW]]'
10326   ;;
10327 hpux*) # Its linker distinguishes data from code symbols
10328   if test "$host_cpu" = ia64; then
10329     symcode='[[ABCDEGRST]]'
10330   fi
10331   lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
10332   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'"
10333   ;;
10334 irix* | nonstopux*)
10335   symcode='[[BCDEGRST]]'
10336   ;;
10337 osf*)
10338   symcode='[[BCDEGQRST]]'
10339   ;;
10340 solaris* | sysv5*)
10341   symcode='[[BDT]]'
10342   ;;
10343 sysv4)
10344   symcode='[[DFNSTU]]'
10345   ;;
10346 esac
10348 # Handle CRLF in mingw tool chain
10349 opt_cr=
10350 case $build_os in
10351 mingw*)
10352   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
10353   ;;
10354 esac
10356 # If we're using GNU nm, then use its standard symbol codes.
10357 case `$NM -V 2>&1` in
10358 *GNU* | *'with BFD'*)
10359   symcode='[[ABCDGISTW]]' ;;
10360 esac
10362 # Try without a prefix undercore, then with it.
10363 for ac_symprfx in "" "_"; do
10365   # Write the raw and C identifiers.
10366   lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[      ]]\($symcode$symcode*\)[[       ]][[    ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
10368   # Check to see that the pipe works correctly.
10369   pipe_works=no
10371   rm -f conftest*
10372   cat > conftest.$ac_ext <<EOF
10373 #ifdef __cplusplus
10374 extern "C" {
10375 #endif
10376 char nm_test_var;
10377 void nm_test_func(){}
10378 #ifdef __cplusplus
10380 #endif
10381 int main(){nm_test_var='a';nm_test_func();return(0);}
10384   if AC_TRY_EVAL(ac_compile); then
10385     # Now try to grab the symbols.
10386     nlist=conftest.nm
10387     if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
10388       # Try sorting and uniquifying the output.
10389       if sort "$nlist" | uniq > "$nlist"T; then
10390         mv -f "$nlist"T "$nlist"
10391       else
10392         rm -f "$nlist"T
10393       fi
10395       # Make sure that we snagged all the symbols we need.
10396       if grep ' nm_test_var$' "$nlist" >/dev/null; then
10397         if grep ' nm_test_func$' "$nlist" >/dev/null; then
10398           cat <<EOF > conftest.$ac_ext
10399 #ifdef __cplusplus
10400 extern "C" {
10401 #endif
10404           # Now generate the symbol file.
10405           eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
10407           cat <<EOF >> conftest.$ac_ext
10408 #if defined (__STDC__) && __STDC__
10409 # define lt_ptr_t void *
10410 #else
10411 # define lt_ptr_t char *
10412 # define const
10413 #endif
10415 /* The mapping between symbol names and symbols. */
10416 const struct {
10417   const char *name;
10418   lt_ptr_t address;
10420 lt_preloaded_symbols[[]] =
10423           $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
10424           cat <<\EOF >> conftest.$ac_ext
10425   {0, (lt_ptr_t) 0}
10428 #ifdef __cplusplus
10430 #endif
10432           # Now try linking the two files.
10433           mv conftest.$ac_objext conftstm.$ac_objext
10434           lt_save_LIBS="$LIBS"
10435           lt_save_CFLAGS="$CFLAGS"
10436           LIBS="conftstm.$ac_objext"
10437           CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
10438           if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
10439             pipe_works=yes
10440           fi
10441           LIBS="$lt_save_LIBS"
10442           CFLAGS="$lt_save_CFLAGS"
10443         else
10444           echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
10445         fi
10446       else
10447         echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
10448       fi
10449     else
10450       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
10451     fi
10452   else
10453     echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
10454     cat conftest.$ac_ext >&5
10455   fi
10456   rm -f conftest* conftst*
10458   # Do not use the global_symbol_pipe unless it works.
10459   if test "$pipe_works" = yes; then
10460     break
10461   else
10462     lt_cv_sys_global_symbol_pipe=
10463   fi
10464 done
10466 if test -z "$lt_cv_sys_global_symbol_pipe"; then
10467   lt_cv_sys_global_symbol_to_cdecl=
10469 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
10470   AC_MSG_RESULT(failed)
10471 else
10472   AC_MSG_RESULT(ok)
10474 ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
10477 # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
10478 # ---------------------------------------
10479 AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
10480 [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
10481 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
10482 _LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
10484 AC_MSG_CHECKING([for $compiler option to produce PIC])
10485  ifelse([$1],[CXX],[
10486   # C++ specific cases for pic, static, wl, etc.
10487   if test "$GXX" = yes; then
10488     _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10489     _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
10491     case $host_os in
10492     aix*)
10493       # All AIX code is PIC.
10494       if test "$host_cpu" = ia64; then
10495         # AIX 5 now supports IA64 processor
10496         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10497       fi
10498       ;;
10499     amigaos*)
10500       # FIXME: we need at least 68020 code to build shared libraries, but
10501       # adding the `-m68020' flag to GCC prevents building anything better,
10502       # like `-m68040'.
10503       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
10504       ;;
10505     beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
10506       # PIC is the default for these OSes.
10507       ;;
10508     mingw* | os2* | pw32*)
10509       # This hack is so that the source file can tell whether it is being
10510       # built for inclusion in a dll (and should export symbols for example).
10511       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
10512       ;;
10513     darwin* | rhapsody*)
10514       # PIC is the default on this platform
10515       # Common symbols not allowed in MH_DYLIB files
10516       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
10517       ;;
10518     *djgpp*)
10519       # DJGPP does not support shared libraries at all
10520       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
10521       ;;
10522     sysv4*MP*)
10523       if test -d /usr/nec; then
10524         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
10525       fi
10526       ;;
10527     hpux*)
10528       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
10529       # not for PA HP-UX.
10530       case "$host_cpu" in
10531       hppa*64*|ia64*)
10532         ;;
10533       *)
10534         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10535         ;;
10536       esac
10537       ;;
10538     *)
10539       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10540       ;;
10541     esac
10542   else
10543     case $host_os in
10544       aix4* | aix5*)
10545         # All AIX code is PIC.
10546         if test "$host_cpu" = ia64; then
10547           # AIX 5 now supports IA64 processor
10548           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10549         else
10550           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
10551         fi
10552         ;;
10553       chorus*)
10554         case $cc_basename in
10555         cxch68)
10556           # Green Hills C++ Compiler
10557           # _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"
10558           ;;
10559         esac
10560         ;;
10561       dgux*)
10562         case $cc_basename in
10563           ec++)
10564             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10565             ;;
10566           ghcx)
10567             # Green Hills C++ Compiler
10568             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
10569             ;;
10570           *)
10571             ;;
10572         esac
10573         ;;
10574       freebsd* | kfreebsd*-gnu)
10575         # FreeBSD uses GNU C++
10576         ;;
10577       hpux9* | hpux10* | hpux11*)
10578         case $cc_basename in
10579           CC)
10580             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10581             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
10582             if test "$host_cpu" != ia64; then
10583               _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
10584             fi
10585             ;;
10586           aCC)
10587             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10588             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
10589             case "$host_cpu" in
10590             hppa*64*|ia64*)
10591               # +Z the default
10592               ;;
10593             *)
10594               _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
10595               ;;
10596             esac
10597             ;;
10598           *)
10599             ;;
10600         esac
10601         ;;
10602       irix5* | irix6* | nonstopux*)
10603         case $cc_basename in
10604           CC)
10605             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10606             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
10607             # CC pic flag -KPIC is the default.
10608             ;;
10609           *)
10610             ;;
10611         esac
10612         ;;
10613       linux*)
10614         case $cc_basename in
10615           KCC)
10616             # KAI C++ Compiler
10617             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
10618             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10619             ;;
10620           icpc)
10621             # Intel C++
10622             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10623             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10624             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
10625             ;; 
10626           cxx)
10627             # Compaq C++
10628             # Make sure the PIC flag is empty.  It appears that all Alpha
10629             # Linux and Compaq Tru64 Unix objects are PIC.
10630             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
10631             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
10632             ;;
10633           *)
10634             ;;
10635         esac
10636         ;;
10637       lynxos*)
10638         ;;
10639       m88k*)
10640         ;;
10641       mvs*)
10642         case $cc_basename in
10643           cxx)
10644             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
10645             ;;
10646           *)
10647             ;;
10648         esac
10649         ;;
10650       netbsd*)
10651         ;;
10652       osf3* | osf4* | osf5*)
10653         case $cc_basename in
10654           KCC)
10655             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
10656             ;;
10657           RCC)
10658             # Rational C++ 2.4.1
10659             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
10660             ;;
10661           cxx)
10662             # Digital/Compaq C++
10663             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10664             # Make sure the PIC flag is empty.  It appears that all Alpha
10665             # Linux and Compaq Tru64 Unix objects are PIC.
10666             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
10667             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
10668             ;;
10669           *)
10670             ;;
10671         esac
10672         ;;
10673       psos*)
10674         ;;
10675       sco*)
10676         case $cc_basename in
10677           CC)
10678             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10679             ;;
10680           *)
10681             ;;
10682         esac
10683         ;;
10684       solaris*)
10685         case $cc_basename in
10686           CC)
10687             # Sun C++ 4.2, 5.x and Centerline C++
10688             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10689             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10690             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
10691             ;;
10692           gcx)
10693             # Green Hills C++ Compiler
10694             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
10695             ;;
10696           *)
10697             ;;
10698         esac
10699         ;;
10700       sunos4*)
10701         case $cc_basename in
10702           CC)
10703             # Sun C++ 4.x
10704             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
10705             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10706             ;;
10707           lcc)
10708             # Lucid
10709             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
10710             ;;
10711           *)
10712             ;;
10713         esac
10714         ;;
10715       tandem*)
10716         case $cc_basename in
10717           NCC)
10718             # NonStop-UX NCC 3.20
10719             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10720             ;;
10721           *)
10722             ;;
10723         esac
10724         ;;
10725       unixware*)
10726         ;;
10727       vxworks*)
10728         ;;
10729       *)
10730         _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
10731         ;;
10732     esac
10733   fi
10736   if test "$GCC" = yes; then
10737     _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10738     _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
10740     case $host_os in
10741       aix*)
10742       # All AIX code is PIC.
10743       if test "$host_cpu" = ia64; then
10744         # AIX 5 now supports IA64 processor
10745         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10746       fi
10747       ;;
10749     amigaos*)
10750       # FIXME: we need at least 68020 code to build shared libraries, but
10751       # adding the `-m68020' flag to GCC prevents building anything better,
10752       # like `-m68040'.
10753       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
10754       ;;
10756     beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
10757       # PIC is the default for these OSes.
10758       ;;
10760     mingw* | pw32* | os2*)
10761       # This hack is so that the source file can tell whether it is being
10762       # built for inclusion in a dll (and should export symbols for example).
10763       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
10764       ;;
10766     darwin* | rhapsody*)
10767       # PIC is the default on this platform
10768       # Common symbols not allowed in MH_DYLIB files
10769       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
10770       ;;
10772     msdosdjgpp*)
10773       # Just because we use GCC doesn't mean we suddenly get shared libraries
10774       # on systems that don't support them.
10775       _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
10776       enable_shared=no
10777       ;;
10779     sysv4*MP*)
10780       if test -d /usr/nec; then
10781         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
10782       fi
10783       ;;
10785     hpux*)
10786       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
10787       # not for PA HP-UX.
10788       case "$host_cpu" in
10789       hppa*64*|ia64*)
10790         # +Z the default
10791         ;;
10792       *)
10793         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10794         ;;
10795       esac
10796       ;;
10798     *)
10799       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
10800       ;;
10801     esac
10802   else
10803     # PORTME Check for flag to pass linker flags through the system compiler.
10804     case $host_os in
10805     aix*)
10806       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10807       if test "$host_cpu" = ia64; then
10808         # AIX 5 now supports IA64 processor
10809         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10810       else
10811         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
10812       fi
10813       ;;
10815     mingw* | pw32* | os2*)
10816       # This hack is so that the source file can tell whether it is being
10817       # built for inclusion in a dll (and should export symbols for example).
10818       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
10819       ;;
10821     hpux9* | hpux10* | hpux11*)
10822       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10823       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
10824       # not for PA HP-UX.
10825       case "$host_cpu" in
10826       hppa*64*|ia64*)
10827         # +Z the default
10828         ;;
10829       *)
10830         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
10831         ;;
10832       esac
10833       # Is there a better lt_prog_compiler_static that works with the bundled CC?
10834       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
10835       ;;
10837     irix5* | irix6* | nonstopux*)
10838       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10839       # PIC (with -KPIC) is the default.
10840       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
10841       ;;
10843     newsos6)
10844       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10845       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10846       ;;
10848     linux*)
10849       case $CC in
10850       icc* | ecc*)
10851         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10852         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10853         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
10854         ;;
10855       ccc*)
10856         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10857         # All Alpha code is PIC.
10858         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
10859         ;;
10860       esac
10861       ;;
10863     osf3* | osf4* | osf5*)
10864       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10865       # All OSF/1 code is PIC.
10866       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
10867       ;;
10869     sco3.2v5*)
10870       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
10871       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
10872       ;;
10874     solaris*)
10875       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10876       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10877       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10878       ;;
10880     sunos4*)
10881       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
10882       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
10883       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10884       ;;
10886     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
10887       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
10888       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
10889       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10890       ;;
10892     sysv4*MP*)
10893       if test -d /usr/nec ;then
10894         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
10895         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10896       fi
10897       ;;
10899     uts4*)
10900       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
10901       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
10902       ;;
10904     *)
10905       _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
10906       ;;
10907     esac
10908   fi
10910 AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
10913 # Check to make sure the PIC flag actually works.
10915 if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
10916   AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
10917     _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
10918     [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
10919     [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
10920      "" | " "*) ;;
10921      *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
10922      esac],
10923     [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
10924      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
10926 case "$host_os" in
10927   # For platforms which do not support PIC, -DPIC is meaningless:
10928   *djgpp*)
10929     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
10930     ;;
10931   *)
10932     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
10933     ;;
10934 esac
10938 # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
10939 # ------------------------------------
10940 # See if the linker supports building shared libraries.
10941 AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
10942 [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
10943 ifelse([$1],[CXX],[
10944   _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
10945   case $host_os in
10946   aix4* | aix5*)
10947     # If we're using GNU nm, then we don't want the "-C" option.
10948     # -C means demangle to AIX nm, but means don't demangle with GNU nm
10949     if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
10950       _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'
10951     else
10952       _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'
10953     fi
10954     ;;
10955   pw32*)
10956     _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
10957   ;;
10958   cygwin* | mingw*)
10959     _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'
10960   ;;
10961   *)
10962     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
10963   ;;
10964   esac
10966   runpath_var=
10967   _LT_AC_TAGVAR(allow_undefined_flag, $1)=
10968   _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
10969   _LT_AC_TAGVAR(archive_cmds, $1)=
10970   _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
10971   _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
10972   _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
10973   _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
10974   _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
10975   _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
10976   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
10977   _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
10978   _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
10979   _LT_AC_TAGVAR(hardcode_direct, $1)=no
10980   _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
10981   _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
10982   _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
10983   _LT_AC_TAGVAR(hardcode_automatic, $1)=no
10984   _LT_AC_TAGVAR(module_cmds, $1)=
10985   _LT_AC_TAGVAR(module_expsym_cmds, $1)=  
10986   _LT_AC_TAGVAR(always_export_symbols, $1)=no
10987   _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
10988   # include_expsyms should be a list of space-separated symbols to be *always*
10989   # included in the symbol list
10990   _LT_AC_TAGVAR(include_expsyms, $1)=
10991   # exclude_expsyms can be an extended regexp of symbols to exclude
10992   # it will be wrapped by ` (' and `)$', so one must not match beginning or
10993   # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
10994   # as well as any symbol that contains `d'.
10995   _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
10996   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
10997   # platforms (ab)use it in PIC code, but their linkers get confused if
10998   # the symbol is explicitly referenced.  Since portable code cannot
10999   # rely on this symbol name, it's probably fine to never include it in
11000   # preloaded symbol tables.
11001   extract_expsyms_cmds=
11003   case $host_os in
11004   cygwin* | mingw* | pw32*)
11005     # FIXME: the MSVC++ port hasn't been tested in a loooong time
11006     # When not using gcc, we currently assume that we are using
11007     # Microsoft Visual C++.
11008     if test "$GCC" != yes; then
11009       with_gnu_ld=no
11010     fi
11011     ;;
11012   openbsd*)
11013     with_gnu_ld=no
11014     ;;
11015   esac
11017   _LT_AC_TAGVAR(ld_shlibs, $1)=yes
11018   if test "$with_gnu_ld" = yes; then
11019     # If archive_cmds runs LD, not CC, wlarc should be empty
11020     wlarc='${wl}'
11022     # See if GNU ld supports shared libraries.
11023     case $host_os in
11024     aix3* | aix4* | aix5*)
11025       # On AIX/PPC, the GNU linker is very broken
11026       if test "$host_cpu" != ia64; then
11027         _LT_AC_TAGVAR(ld_shlibs, $1)=no
11028         cat <<EOF 1>&2
11030 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
11031 *** to be unable to reliably create shared libraries on AIX.
11032 *** Therefore, libtool is disabling shared libraries support.  If you
11033 *** really care for shared libraries, you may want to modify your PATH
11034 *** so that a non-GNU linker is found, and then restart.
11037       fi
11038       ;;
11040     amigaos*)
11041       _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)'
11042       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11043       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11045       # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
11046       # that the semantics of dynamic libraries on AmigaOS, at least up
11047       # to version 4, is to share data among multiple programs linked
11048       # with the same dynamic library.  Since this doesn't match the
11049       # behavior of shared libraries on other platforms, we can't use
11050       # them.
11051       _LT_AC_TAGVAR(ld_shlibs, $1)=no
11052       ;;
11054     beos*)
11055       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
11056         _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
11057         # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
11058         # support --undefined.  This deserves some investigation.  FIXME
11059         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
11060       else
11061         _LT_AC_TAGVAR(ld_shlibs, $1)=no
11062       fi
11063       ;;
11065     cygwin* | mingw* | pw32*)
11066       # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
11067       # as there is no search path for DLLs.
11068       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11069       _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
11070       _LT_AC_TAGVAR(always_export_symbols, $1)=no
11071       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
11072       _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'
11074       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
11075         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
11076         # If the export-symbols file already is a .def file (1st line
11077         # is EXPORTS), use it as is; otherwise, prepend...
11078         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
11079           cp $export_symbols $output_objdir/$soname.def;
11080         else
11081           echo EXPORTS > $output_objdir/$soname.def;
11082           cat $export_symbols >> $output_objdir/$soname.def;
11083         fi~
11084         $CC -shared $output_objdir/$soname.def $compiler_flags $libobjs $deplibs -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
11085       else
11086         ld_shlibs=no
11087       fi
11088       ;;
11090     netbsd*)
11091       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
11092         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
11093         wlarc=
11094       else
11095         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
11096         _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'
11097       fi
11098       ;;
11100     solaris* | sysv5*)
11101       if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
11102         _LT_AC_TAGVAR(ld_shlibs, $1)=no
11103         cat <<EOF 1>&2
11105 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
11106 *** create shared libraries on Solaris systems.  Therefore, libtool
11107 *** is disabling shared libraries support.  We urge you to upgrade GNU
11108 *** binutils to release 2.9.1 or newer.  Another option is to modify
11109 *** your PATH or compiler configuration so that the native linker is
11110 *** used, and then restart.
11113       elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
11114         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
11115         _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'
11116       else
11117         _LT_AC_TAGVAR(ld_shlibs, $1)=no
11118       fi
11119       ;;
11121     sunos4*)
11122       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
11123       wlarc=
11124       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11125       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11126       ;;
11128     *)
11129       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
11130         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib'
11131         _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'
11132       else
11133         _LT_AC_TAGVAR(ld_shlibs, $1)=no
11134       fi
11135       ;;
11136     esac
11138     if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
11139       runpath_var=LD_RUN_PATH
11140       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
11141       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
11142       # ancient GNU ld didn't support --whole-archive et. al.
11143       if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
11144         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
11145       else
11146         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
11147       fi
11148     fi
11149   else
11150     # PORTME fill in a description of your system's linker (not GNU ld)
11151     case $host_os in
11152     aix3*)
11153       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
11154       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
11155       _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'
11156       # Note: this linker hardcodes the directories in LIBPATH if there
11157       # are no directories specified by -L.
11158       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11159       if test "$GCC" = yes && test -z "$link_static_flag"; then
11160         # Neither direct hardcoding nor static linking is supported with a
11161         # broken collect2.
11162         _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
11163       fi
11164       ;;
11166     aix4* | aix5*)
11167       if test "$host_cpu" = ia64; then
11168         # On IA64, the linker does run time linking by default, so we don't
11169         # have to do anything special.
11170         aix_use_runtimelinking=no
11171         exp_sym_flag='-Bexport'
11172         no_entry_flag=""
11173       else
11174         # If we're using GNU nm, then we don't want the "-C" option.
11175         # -C means demangle to AIX nm, but means don't demangle with GNU nm
11176         if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
11177           _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'
11178         else
11179           _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'
11180         fi
11182         # KDE requires run time linking.  Make it the default.
11183         aix_use_runtimelinking=yes
11184         exp_sym_flag='-bexport'
11185         no_entry_flag='-bnoentry'
11186       fi
11188       # When large executables or shared objects are built, AIX ld can
11189       # have problems creating the table of contents.  If linking a library
11190       # or program results in "error TOC overflow" add -mminimal-toc to
11191       # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
11192       # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
11194       _LT_AC_TAGVAR(archive_cmds, $1)=''
11195       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11196       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
11197       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
11199       if test "$GCC" = yes; then
11200         case $host_os in aix4.[012]|aix4.[012].*)
11201         # We only want to do this on AIX 4.2 and lower, the check
11202         # below for broken collect2 doesn't work under 4.3+
11203           collect2name=`${CC} -print-prog-name=collect2`
11204           if test -f "$collect2name" && \
11205            strings "$collect2name" | grep resolve_lib_name >/dev/null
11206           then
11207           # We have reworked collect2
11208           _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11209           else
11210           # We have old collect2
11211           _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
11212           # It fails to find uninstalled libraries when the uninstalled
11213           # path is not listed in the libpath.  Setting hardcode_minus_L
11214           # to unsupported forces relinking
11215           _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11216           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11217           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
11218           fi
11219         esac
11220         shared_flag='-shared'
11221       else
11222         # not using gcc
11223         if test "$host_cpu" = ia64; then
11224         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
11225         # chokes on -Wl,-G. The following line is correct:
11226           shared_flag='-G'
11227         else
11228         if test "$aix_use_runtimelinking" = yes; then
11229             shared_flag='-qmkshrobj ${wl}-G'
11230           else
11231             shared_flag='-qmkshrobj'
11232         fi
11233         fi
11234       fi
11236       # Let the compiler handle the export list.
11237       _LT_AC_TAGVAR(always_export_symbols, $1)=no
11238       if test "$aix_use_runtimelinking" = yes; then
11239         # Warning - without using the other runtime loading flags (-brtl),
11240         # -berok will link without error, but may produce a broken library.
11241         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
11242        # Determine the default libpath from the value encoded in an empty executable.
11243         _LT_AC_SYS_LIBPATH_AIX
11244         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
11245         _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"
11246         _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"
11247        else
11248         if test "$host_cpu" = ia64; then
11249           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
11250           _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
11251           _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"
11252         else
11253          # Determine the default libpath from the value encoded in an empty executable.
11254          _LT_AC_SYS_LIBPATH_AIX
11255          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
11256           # Warning - without using the other run time loading flags,
11257           # -berok will link without error, but may produce a broken library.
11258           _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
11259           _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
11260           # -bexpall does not export symbols beginning with underscore (_)
11261           _LT_AC_TAGVAR(always_export_symbols, $1)=yes
11262           # Exported symbols can be pulled into shared objects from archives
11263           _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
11264           _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
11265           # This is similar to how AIX traditionally builds it's shared libraries.
11266           _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'
11267         fi
11268       fi
11269       ;;
11271     amigaos*)
11272       _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)'
11273       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11274       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11275       # see comment about different semantics on the GNU ld section
11276       _LT_AC_TAGVAR(ld_shlibs, $1)=no
11277       ;;
11279     bsdi4*)
11280       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
11281       ;;
11283     cygwin* | mingw* | pw32*)
11284       # When not using gcc, we currently assume that we are using
11285       # Microsoft Visual C++.
11286       # hardcode_libdir_flag_spec is actually meaningless, as there is
11287       # no search path for DLLs.
11288       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
11289       _LT_AC_TAGVAR(allow_undefined_flag, $1)=no
11290       # Tell ltmain to make .lib files, not .a files.
11291       libext=lib
11292       # Tell ltmain to make .dll files, not .so files.
11293       shrext=".dll"
11294       # FIXME: Setting linknames here is a bad hack.
11295       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $compiler_flags $libobjs `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
11296       # The linker will automatically build a .lib file if we build a DLL.
11297       _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
11298       # FIXME: Should let the user specify the lib program.
11299       _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
11300       fix_srcfile_path='`cygpath -w "$srcfile"`'
11301       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
11302       ;;
11304     darwin* | rhapsody*)
11305     if test "$GXX" = yes ; then
11306       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
11307       case "$host_os" in
11308       rhapsody* | darwin1.[[012]])
11309         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,suppress'
11310         ;;
11311       *) # Darwin 1.3 on
11312         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
11313           _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
11314         else
11315           case ${MACOSX_DEPLOYMENT_TARGET} in
11316             10.[012])
11317               _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-flat_namespace -Wl,-undefined -Wl,suppress'
11318               ;;
11319             10.*)
11320               _LT_AC_TAGVAR(allow_undefined_flag, $1)='-Wl,-undefined -Wl,dynamic_lookup'
11321               ;;
11322           esac
11323         fi
11324         ;;
11325       esac
11326         lt_int_apple_cc_single_mod=no
11327         output_verbose_link_cmd='echo'
11328         if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
11329           lt_int_apple_cc_single_mod=yes
11330         fi
11331         if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
11332           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $compiler_flags $libobjs $deplibs -install_name $rpath/$soname $verstring'
11333         else
11334         _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'
11335       fi
11336       _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $compiler_flags $libobjs $deplibs'
11337       # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
11338         if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
11339           _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}'
11340         else
11341           _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}'
11342         fi
11343           _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}'
11344       _LT_AC_TAGVAR(hardcode_direct, $1)=no
11345       _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
11346       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
11347       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
11348       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
11349     else  
11350       _LT_AC_TAGVAR(ld_shlibs, $1)=no
11351     fi  
11352       ;;
11354     dgux*)
11355       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11356       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11357       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11358       ;;
11360     freebsd1*)
11361       _LT_AC_TAGVAR(ld_shlibs, $1)=no
11362       ;;
11364     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
11365     # support.  Future versions do this automatically, but an explicit c++rt0.o
11366     # does not break anything, and helps significantly (at the cost of a little
11367     # extra space).
11368     freebsd2.2*)
11369       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
11370       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11371       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11372       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11373       ;;
11375     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
11376     freebsd2*)
11377       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
11378       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11379       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11380       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11381       ;;
11383     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
11384     freebsd* | kfreebsd*-gnu)
11385       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $compiler_flags $libobjs $deplibs'
11386       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11387       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11388       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11389       ;;
11391     hpux9*)
11392       if test "$GCC" = yes; then
11393         _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'
11394       else
11395         _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'
11396       fi
11397       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
11398       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11399       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11401       # hardcode_minus_L: Not really in the search PATH,
11402       # but as the default location of the library.
11403       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11404       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
11405       ;;
11407     hpux10* | hpux11*)
11408       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
11409         case "$host_cpu" in
11410         hppa*64*|ia64*)
11411           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
11412           ;;
11413         *)
11414           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $compiler_flags $libobjs $deplibs'
11415           ;;
11416         esac
11417       else
11418         case "$host_cpu" in
11419         hppa*64*|ia64*)
11420           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
11421           ;;
11422         *)
11423           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
11424           ;;
11425         esac
11426       fi
11427       if test "$with_gnu_ld" = no; then
11428         case "$host_cpu" in
11429         hppa*64*)
11430           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
11431           _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
11432           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11433           _LT_AC_TAGVAR(hardcode_direct, $1)=no
11434           _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11435           ;;
11436         ia64*)
11437           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11438           _LT_AC_TAGVAR(hardcode_direct, $1)=no
11439           _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11441           # hardcode_minus_L: Not really in the search PATH,
11442           # but as the default location of the library.
11443           _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11444           ;;
11445         *)
11446           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
11447           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11448           _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11449           _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
11451           # hardcode_minus_L: Not really in the search PATH,
11452           # but as the default location of the library.
11453           _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11454           ;;
11455         esac
11456       fi
11457       ;;
11459     irix5* | irix6* | nonstopux*)
11460       if test "$GCC" = yes; then
11461         _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'
11462       else
11463         _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'
11464         _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
11465       fi
11466       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11467       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11468       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
11469       ;;
11471     netbsd*)
11472       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
11473         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
11474       else
11475         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
11476       fi
11477       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11478       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11479       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11480       ;;
11482     newsos6)
11483       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11484       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11485       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11486       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11487       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11488       ;;
11490     openbsd*)
11491       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11492       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11493       if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
11494         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
11495         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
11496         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
11497       else
11498        case $host_os in
11499          openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
11500            _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
11501            _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11502            ;;
11503          *)
11504            _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $compiler_flags $libobjs $deplibs'
11505            _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
11506            ;;
11507        esac
11508       fi
11509       ;;
11511     os2*)
11512       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11513       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11514       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
11515       _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'
11516       _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
11517       ;;
11519     osf3*)
11520       if test "$GCC" = yes; then
11521         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
11522         _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'
11523       else
11524         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
11525         _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'
11526       fi
11527       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11528       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11529       ;;
11531     osf4* | osf5*)      # as osf3* with the addition of -msym flag
11532       if test "$GCC" = yes; then
11533         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
11534         _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'
11535         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
11536       else
11537         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
11538         _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'
11539         _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~
11540         $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'
11542         # Both c and cxx compiler support -rpath directly
11543         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
11544       fi
11545       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
11546       ;;
11548     sco3.2v5*)
11549       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11550       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11551       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
11552       runpath_var=LD_RUN_PATH
11553       hardcode_runpath_var=yes
11554       ;;
11556     solaris*)
11557       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
11558       if test "$GCC" = yes; then
11559         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
11560         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
11561           $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs~$rm $lib.exp'
11562       else
11563         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
11564         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
11565         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
11566       fi
11567       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
11568       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11569       case $host_os in
11570       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
11571       *) # Supported since Solaris 2.6 (maybe 2.5.1?)
11572         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
11573       esac
11574       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
11575       ;;
11577     sunos4*)
11578       if test "x$host_vendor" = xsequent; then
11579         # Use $CC to link under sequent, because it throws in some extra .o
11580         # files that make .init and .fini sections work.
11581         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $compiler_flags $libobjs $deplibs'
11582       else
11583         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
11584       fi
11585       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11586       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11587       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
11588       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11589       ;;
11591     sysv4)
11592       case $host_vendor in
11593         sni)
11594           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11595           _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
11596         ;;
11597         siemens)
11598           ## LD is ld it makes a PLAMLIB
11599           ## CC just makes a GrossModule.
11600           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
11601           _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
11602           _LT_AC_TAGVAR(hardcode_direct, $1)=no
11603         ;;
11604         motorola)
11605           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11606           _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
11607         ;;
11608       esac
11609       runpath_var='LD_RUN_PATH'
11610       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11611       ;;
11613     sysv4.3*)
11614       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11615       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11616       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
11617       ;;
11619     sysv4*MP*)
11620       if test -d /usr/nec; then
11621         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11622         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11623         runpath_var=LD_RUN_PATH
11624         hardcode_runpath_var=yes
11625         _LT_AC_TAGVAR(ld_shlibs, $1)=yes
11626       fi
11627       ;;
11629     sysv4.2uw2*)
11630       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
11631       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
11632       _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
11633       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11634       hardcode_runpath_var=yes
11635       runpath_var=LD_RUN_PATH
11636       ;;
11638    sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
11639       _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
11640       if test "$GCC" = yes; then
11641         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
11642       else
11643         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $compiler_flags $libobjs $deplibs'
11644       fi
11645       runpath_var='LD_RUN_PATH'
11646       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11647       ;;
11649     sysv5*)
11650       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
11651       # $CC -shared without GNU ld will not create a library from C++
11652       # object files and a static libstdc++, better avoid it by now
11653       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
11654       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
11655                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
11656       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
11657       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11658       runpath_var='LD_RUN_PATH'
11659       ;;
11661     uts4*)
11662       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
11663       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
11664       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
11665       ;;
11667     *)
11668       _LT_AC_TAGVAR(ld_shlibs, $1)=no
11669       ;;
11670     esac
11671   fi
11673 AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
11674 test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
11676 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
11677 if test "$GCC" = yes; then
11678   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
11682 # Do we need to explicitly link libc?
11684 case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
11685 x|xyes)
11686   # Assume -lc should be added
11687   _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
11689   if test "$enable_shared" = yes && test "$GCC" = yes; then
11690     case $_LT_AC_TAGVAR(archive_cmds, $1) in
11691     *'~'*)
11692       # FIXME: we may have to deal with multi-command sequences.
11693       ;;
11694     '$CC '*)
11695       # Test whether the compiler implicitly links with -lc since on some
11696       # systems, -lgcc has to come before -lc. If gcc already passes -lc
11697       # to ld, don't add -lc before -lgcc.
11698       AC_MSG_CHECKING([whether -lc should be explicitly linked in])
11699       $rm conftest*
11700       printf "$lt_simple_compile_test_code" > conftest.$ac_ext
11701   
11702       if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
11703         soname=conftest
11704         lib=conftest
11705         libobjs=conftest.$ac_objext
11706         deplibs=
11707         wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
11708         compiler_flags=-v
11709         linker_flags=-v
11710         verstring=
11711         output_objdir=.
11712         libname=conftest
11713         lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
11714         _LT_AC_TAGVAR(allow_undefined_flag, $1)=
11715         if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
11716         then
11717           _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
11718         else
11719           _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
11720         fi
11721         _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
11722       else
11723         cat conftest.err 1>&5
11724       fi
11725       $rm conftest*
11726       AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
11727       ;;
11728     esac
11729   fi
11730   ;;
11731 esac
11732 ])# AC_LIBTOOL_PROG_LD_SHLIBS
11735 # _LT_AC_FILE_LTDLL_C
11736 # -------------------
11737 # Be careful that the start marker always follows a newline.
11738 AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
11739 # /* ltdll.c starts here */
11740 # #define WIN32_LEAN_AND_MEAN
11741 # #include <windows.h>
11742 # #undef WIN32_LEAN_AND_MEAN
11743 # #include <stdio.h>
11745 # #ifndef __CYGWIN__
11746 # #  ifdef __CYGWIN32__
11747 # #    define __CYGWIN__ __CYGWIN32__
11748 # #  endif
11749 # #endif
11751 # #ifdef __cplusplus
11752 # extern "C" {
11753 # #endif
11754 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
11755 # #ifdef __cplusplus
11756 # }
11757 # #endif
11759 # #ifdef __CYGWIN__
11760 # #include <cygwin/cygwin_dll.h>
11761 # DECLARE_CYGWIN_DLL( DllMain );
11762 # #endif
11763 # HINSTANCE __hDllInstance_base;
11765 # BOOL APIENTRY
11766 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
11767 # {
11768 #   __hDllInstance_base = hInst;
11769 #   return TRUE;
11770 # }
11771 # /* ltdll.c ends here */
11772 ])# _LT_AC_FILE_LTDLL_C
11775 # _LT_AC_TAGVAR(VARNAME, [TAGNAME])
11776 # ---------------------------------
11777 AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
11780 # old names
11781 AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
11782 AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
11783 AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
11784 AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
11785 AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
11786 AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
11787 AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
11789 # This is just to silence aclocal about the macro not being used
11790 ifelse([AC_DISABLE_FAST_INSTALL])
11792 AC_DEFUN([LT_AC_PROG_GCJ],
11793 [AC_CHECK_TOOL(GCJ, gcj, no)
11794   test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
11795   AC_SUBST(GCJFLAGS)
11798 AC_DEFUN([LT_AC_PROG_RC],
11799 [AC_CHECK_TOOL(RC, windres, no)
11802 ############################################################
11803 # NOTE: This macro has been submitted for inclusion into   #
11804 #  GNU Autoconf as AC_PROG_SED.  When it is available in   #
11805 #  a released version of Autoconf we should remove this    #
11806 #  macro and use it instead.                               #
11807 ############################################################
11808 # LT_AC_PROG_SED
11809 # --------------
11810 # Check for a fully-functional sed program, that truncates
11811 # as few characters as possible.  Prefer GNU sed if found.
11812 AC_DEFUN([LT_AC_PROG_SED],
11813 [AC_MSG_CHECKING([for a sed that does not truncate output])
11814 AC_CACHE_VAL(lt_cv_path_SED,
11815 [# Loop through the user's path and test for sed and gsed.
11816 # Then use that list of sed's as ones to test for truncation.
11817 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11818 for as_dir in $PATH
11820   IFS=$as_save_IFS
11821   test -z "$as_dir" && as_dir=.
11822   for lt_ac_prog in sed gsed; do
11823     for ac_exec_ext in '' $ac_executable_extensions; do
11824       if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
11825         lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
11826       fi
11827     done
11828   done
11829 done
11830 lt_ac_max=0
11831 lt_ac_count=0
11832 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
11833 # along with /bin/sed that truncates output.
11834 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
11835   test ! -f $lt_ac_sed && break
11836   cat /dev/null > conftest.in
11837   lt_ac_count=0
11838   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
11839   # Check for GNU sed and select it if it is found.
11840   if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
11841     lt_cv_path_SED=$lt_ac_sed
11842     break
11843   fi
11844   while true; do
11845     cat conftest.in conftest.in >conftest.tmp
11846     mv conftest.tmp conftest.in
11847     cp conftest.in conftest.nl
11848     echo >>conftest.nl
11849     $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
11850     cmp -s conftest.out conftest.nl || break
11851     # 10000 chars as input seems more than enough
11852     test $lt_ac_count -gt 10 && break
11853     lt_ac_count=`expr $lt_ac_count + 1`
11854     if test $lt_ac_count -gt $lt_ac_max; then
11855       lt_ac_max=$lt_ac_count
11856       lt_cv_path_SED=$lt_ac_sed
11857     fi
11858   done
11859 done
11861 SED=$lt_cv_path_SED
11862 AC_MSG_RESULT([$SED])