1# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*-
2
3# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
4# Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14
15dnl    This file is part of the KDE libraries/packages
16dnl    Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
17dnl              (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
18
19dnl    This file is free software; you can redistribute it and/or
20dnl    modify it under the terms of the GNU Library General Public
21dnl    License as published by the Free Software Foundation; either
22dnl    version 2 of the License, or (at your option) any later version.
23
24dnl    This library is distributed in the hope that it will be useful,
25dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
26dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27dnl    Library General Public License for more details.
28
29dnl    You should have received a copy of the GNU Library General Public License
30dnl    along with this library; see the file COPYING.LIB.  If not, write to
31dnl    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
32dnl    Boston, MA 02111-1307, USA.
33
34dnl IMPORTANT NOTE:
35dnl Please do not modify this file unless you expect your modifications to be
36dnl carried into every other module in the repository.
37dnl
38dnl Single-module modifications are best placed in configure.in for kdelibs
39dnl and kdebase or configure.in.in if present.
40
41dnl ------------------------------------------------------------------------
42dnl Forward compatibility macros (make autoconf 2.13 look like 2.50),
43dnl thanks to Raja R Harinath.
44dnl ------------------------------------------------------------------------
45dnl
46
47dnl START FILE SDL.m4
48
49# Configure paths for SDL
50# Sam Lantinga 9/21/99
51# stolen from Manish Singh
52# stolen back from Frank Belew
53# stolen from Manish Singh
54# Shamelessly stolen from Owen Taylor
55
56dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
57dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
58dnl
59AC_DEFUN(AM_PATH_SDL,
60[dnl
61dnl Get the cflags and libraries from the sdl-config script
62dnl
63AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
64            sdl_prefix="$withval", sdl_prefix="")
65AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
66            sdl_exec_prefix="$withval", sdl_exec_prefix="")
67AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
68		    , enable_sdltest=yes)
69
70  if test x$sdl_exec_prefix != x ; then
71     sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
72     if test x${SDL_CONFIG+set} != xset ; then
73        SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
74     fi
75  fi
76  if test x$sdl_prefix != x ; then
77     sdl_args="$sdl_args --prefix=$sdl_prefix"
78     if test x${SDL_CONFIG+set} != xset ; then
79        SDL_CONFIG=$sdl_prefix/bin/sdl-config
80     fi
81  fi
82
83  AC_REQUIRE([AC_CANONICAL_TARGET])
84  PATH="$prefix/bin:$prefix/usr/bin:$PATH"
85  AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
86  min_sdl_version=ifelse([$1], ,0.11.0,$1)
87  AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
88  no_sdl=""
89  if test "$SDL_CONFIG" = "no" ; then
90    no_sdl=yes
91  else
92    SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
93    SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
94
95    sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
96           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
97    sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
98           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
99    sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
100           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
101    if test "x$enable_sdltest" = "xyes" ; then
102      ac_save_CFLAGS="$CFLAGS"
103      ac_save_CXXFLAGS="$CXXFLAGS"
104      ac_save_LIBS="$LIBS"
105      CFLAGS="$CFLAGS $SDL_CFLAGS"
106      CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
107      LIBS="$LIBS $SDL_LIBS"
108dnl
109dnl Now check if the installed SDL is sufficiently new. (Also sanity
110dnl checks the results of sdl-config to some extent
111dnl
112      rm -f conf.sdltest
113      AC_TRY_RUN([
114#include <stdio.h>
115#include <stdlib.h>
116#include <string.h>
117#include "SDL.h"
118
119char*
120my_strdup (char *str)
121{
122  char *new_str;
123
124  if (str)
125    {
126      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
127      strcpy (new_str, str);
128    }
129  else
130    new_str = NULL;
131
132  return new_str;
133}
134
135int main (int argc, char *argv[])
136{
137  int major, minor, micro;
138  char *tmp_version;
139
140  /* This hangs on some systems (?)
141  system ("touch conf.sdltest");
142  */
143  { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
144
145  /* HP/UX 9 (%@#!) writes to sscanf strings */
146  tmp_version = my_strdup("$min_sdl_version");
147  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
148     printf("%s, bad version string\n", "$min_sdl_version");
149     exit(1);
150   }
151
152   if (($sdl_major_version > major) ||
153      (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
154      (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
155    {
156      return 0;
157    }
158  else
159    {
160      printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
161      printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
162      printf("*** best to upgrade to the required version.\n");
163      printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
164      printf("*** to point to the correct copy of sdl-config, and remove the file\n");
165      printf("*** config.cache before re-running configure\n");
166      return 1;
167    }
168}
169
170],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
171       CFLAGS="$ac_save_CFLAGS"
172       CXXFLAGS="$ac_save_CXXFLAGS"
173       LIBS="$ac_save_LIBS"
174     fi
175  fi
176  if test "x$no_sdl" = x ; then
177     AC_MSG_RESULT(yes)
178     ifelse([$2], , :, [$2])
179  else
180     AC_MSG_RESULT(no)
181     if test "$SDL_CONFIG" = "no" ; then
182       echo "*** The sdl-config script installed by SDL could not be found"
183       echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
184       echo "*** your path, or set the SDL_CONFIG environment variable to the"
185       echo "*** full path to sdl-config."
186     else
187       if test -f conf.sdltest ; then
188        :
189       else
190          echo "*** Could not run SDL test program, checking why..."
191          CFLAGS="$CFLAGS $SDL_CFLAGS"
192          CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
193          LIBS="$LIBS $SDL_LIBS"
194          AC_TRY_LINK([
195#include <stdio.h>
196#include "SDL.h"
197
198int main(int argc, char *argv[])
199{ return 0; }
200#undef  main
201#define main K_and_R_C_main
202],      [ return 0; ],
203        [ echo "*** The test program compiled, but did not run. This usually means"
204          echo "*** that the run-time linker is not finding SDL or finding the wrong"
205          echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
206          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
207          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
208          echo "*** is required on your system"
209	  echo "***"
210          echo "*** If you have an old version installed, it is best to remove it, although"
211          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
212        [ echo "*** The test program failed to compile or link. See the file config.log for the"
213          echo "*** exact error that occured. This usually means SDL was incorrectly installed"
214          echo "*** or that you have moved SDL since it was installed. In the latter case, you"
215          echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
216          CFLAGS="$ac_save_CFLAGS"
217          CXXFLAGS="$ac_save_CXXFLAGS"
218          LIBS="$ac_save_LIBS"
219       fi
220     fi
221     SDL_CFLAGS=""
222     SDL_LIBS=""
223     ifelse([$3], , :, [$3])
224  fi
225  AC_SUBST(SDL_CFLAGS)
226  AC_SUBST(SDL_LIBS)
227  rm -f conf.sdltest
228])
229
230dnl END FILE SDL.m4
231
232ifdef([_AC_PATH_X_XMKMF],[],
233   [AC_DEFUN([_AC_PATH_X_XMKMF],[AC_PATH_X_XMKMF])])
234ifdef([AC_OUTPUT_SUBDIRS],[],
235   [AC_DEFUN([AC_OUTPUT_SUBDIRS],[subdirs=$1; _AC_OUTPUT_SUBDIRS])])
236
237# KDE_PATH_X_DIRECT
238dnl Internal subroutine of AC_PATH_X.
239dnl Set ac_x_includes and/or ac_x_libraries.
240AC_DEFUN(KDE_PATH_X_DIRECT,
241[
242AC_REQUIRE([KDE_CHECK_LIB64])
243
244if test "$ac_x_includes" = NO; then
245  # Guess where to find include files, by looking for this one X11 .h file.
246  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
247
248  # First, try using that file with no special directory specified.
249AC_TRY_CPP([#include <$x_direct_test_include>],
250[# We can compile using X headers with no special include directory.
251ac_x_includes=],
252[# Look for the header file in a standard set of common directories.
253# Check X11 before X11Rn because it is often a symlink to the current release.
254  for ac_dir in               \
255    /usr/X11/include          \
256    /usr/X11R6/include        \
257    /usr/X11R5/include        \
258    /usr/X11R4/include        \
259                              \
260    /usr/include/X11          \
261    /usr/include/X11R6        \
262    /usr/include/X11R5        \
263    /usr/include/X11R4        \
264                              \
265    /usr/local/X11/include    \
266    /usr/local/X11R6/include  \
267    /usr/local/X11R5/include  \
268    /usr/local/X11R4/include  \
269                              \
270    /usr/local/include/X11    \
271    /usr/local/include/X11R6  \
272    /usr/local/include/X11R5  \
273    /usr/local/include/X11R4  \
274                              \
275    /usr/X386/include         \
276    /usr/x386/include         \
277    /usr/XFree86/include/X11  \
278                              \
279    /usr/include              \
280    /usr/local/include        \
281    /usr/unsupported/include  \
282    /usr/athena/include       \
283    /usr/local/x11r5/include  \
284    /usr/lpp/Xamples/include  \
285                              \
286    /usr/openwin/include      \
287    /usr/openwin/share/include \
288    ; \
289  do
290    if test -r "$ac_dir/$x_direct_test_include"; then
291      ac_x_includes=$ac_dir
292      break
293    fi
294  done])
295fi # $ac_x_includes = NO
296
297if test "$ac_x_libraries" = NO; then
298  # Check for the libraries.
299
300  test -z "$x_direct_test_library" && x_direct_test_library=Xt
301  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
302
303  # See if we find them without any special options.
304  # Don't add to $LIBS permanently.
305  ac_save_LIBS="$LIBS"
306  LIBS="-l$x_direct_test_library $LIBS"
307AC_TRY_LINK(, [${x_direct_test_function}()],
308[LIBS="$ac_save_LIBS"
309# We can link X programs with no special library path.
310ac_x_libraries=],
311[LIBS="$ac_save_LIBS"
312# First see if replacing the include by lib works.
313# Check X11 before X11Rn because it is often a symlink to the current release.
314for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \
315    /usr/X11/lib${kdelibsuff}           \
316    /usr/X11R6/lib${kdelibsuff}         \
317    /usr/X11R5/lib${kdelibsuff}         \
318    /usr/X11R4/lib${kdelibsuff}         \
319                                        \
320    /usr/lib${kdelibsuff}/X11           \
321    /usr/lib${kdelibsuff}/X11R6         \
322    /usr/lib${kdelibsuff}/X11R5         \
323    /usr/lib${kdelibsuff}/X11R4         \
324                                        \
325    /usr/local/X11/lib${kdelibsuff}     \
326    /usr/local/X11R6/lib${kdelibsuff}   \
327    /usr/local/X11R5/lib${kdelibsuff}   \
328    /usr/local/X11R4/lib${kdelibsuff}   \
329                                        \
330    /usr/local/lib${kdelibsuff}/X11     \
331    /usr/local/lib${kdelibsuff}/X11R6   \
332    /usr/local/lib${kdelibsuff}/X11R5   \
333    /usr/local/lib${kdelibsuff}/X11R4   \
334                                        \
335    /usr/X386/lib${kdelibsuff}          \
336    /usr/x386/lib${kdelibsuff}          \
337    /usr/XFree86/lib${kdelibsuff}/X11   \
338                                        \
339    /usr/lib${kdelibsuff}               \
340    /usr/local/lib${kdelibsuff}         \
341    /usr/unsupported/lib${kdelibsuff}   \
342    /usr/athena/lib${kdelibsuff}        \
343    /usr/local/x11r5/lib${kdelibsuff}   \
344    /usr/lpp/Xamples/lib${kdelibsuff}   \
345    /lib/usr/lib${kdelibsuff}/X11       \
346                                        \
347    /usr/openwin/lib${kdelibsuff}       \
348    /usr/openwin/share/lib${kdelibsuff} \
349    ; \
350do
351dnl Don't even attempt the hair of trying to link an X program!
352  for ac_extension in a so sl; do
353    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
354      ac_x_libraries=$ac_dir
355      break 2
356    fi
357  done
358done])
359fi # $ac_x_libraries = NO
360])
361
362
363dnl ------------------------------------------------------------------------
364dnl Find a file (or one of more files in a list of dirs)
365dnl ------------------------------------------------------------------------
366dnl
367AC_DEFUN(AC_FIND_FILE,
368[
369$3=NO
370for i in $2;
371do
372  for j in $1;
373  do
374    echo "configure: __oline__: $i/$j" >&AC_FD_CC
375    if test -r "$i/$j"; then
376      echo "taking that" >&AC_FD_CC
377      $3=$i
378      break 2
379    fi
380  done
381done
382])
383
384dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,
385dnl	if-not-found, test-parameter)
386AC_DEFUN(KDE_FIND_PATH,
387[
388   AC_MSG_CHECKING([for $1])
389   if test -n "$$2"; then
390        kde_cv_path="$$2";
391   else
392        kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
393
394        AC_CACHE_VAL(kde_cv_path_$kde_cache,
395        [
396        kde_cv_path="NONE"
397	dirs="$3"
398	kde_save_IFS=$IFS
399	IFS=':'
400	for dir in $PATH; do
401	  dirs="$dirs $dir"
402        done
403	IFS=$kde_save_IFS
404
405        for dir in $dirs; do
406	  if test -x "$dir/$1"; then
407	    if test -n "$5"
408	    then
409              evalstr="$dir/$1 $5 2>&1 "
410	      if eval $evalstr; then
411                kde_cv_path="$dir/$1"
412                break
413	      fi
414            else
415		kde_cv_path="$dir/$1"
416                break
417	    fi
418          fi
419        done
420
421        eval "kde_cv_path_$kde_cache=$kde_cv_path"
422
423        ])
424
425      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
426
427   fi
428
429   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
430      AC_MSG_RESULT(not found)
431      $4
432   else
433      AC_MSG_RESULT($kde_cv_path)
434      $2=$kde_cv_path
435
436   fi
437])
438
439AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
440[
441    AC_MSG_ERROR([No Qt meta object compiler (moc) found!
442Please check whether you installed Qt correctly.
443You need to have a running moc binary.
444configure tried to run $ac_cv_path_moc and the test didn't
445succeed. If configure shouldn't have tried this one, set
446the environment variable MOC to the right one before running
447configure.
448])
449])
450
451AC_DEFUN(KDE_UIC_ERROR_MESSAGE,
452[
453    AC_MSG_WARN([No Qt ui compiler (uic) found!
454Please check whether you installed Qt correctly.
455You need to have a running uic binary.
456configure tried to run $ac_cv_path_uic and the test didn't
457succeed. If configure shouldn't have tried this one, set
458the environment variable UIC to the right one before running
459configure.
460])
461])
462
463
464AC_DEFUN(KDE_CHECK_UIC_FLAG,
465[
466    AC_MSG_CHECKING([whether uic supports -$1 ])
467    kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
468    AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
469    [
470        cat >conftest.ui <<EOT
471        <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
472EOT
473        ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
474        if AC_TRY_EVAL(ac_uic_testrun); then
475            eval "kde_cv_prog_uic_$kde_cache=yes"
476        else
477            eval "kde_cv_prog_uic_$kde_cache=no"
478        fi
479        rm -f conftest*
480    ])
481
482    if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
483        AC_MSG_RESULT([yes])
484        :
485        $3
486    else
487        AC_MSG_RESULT([no])
488        :
489        $4
490    fi
491])
492
493
494dnl ------------------------------------------------------------------------
495dnl Find the meta object compiler and the ui compiler in the PATH,
496dnl in $QTDIR/bin, and some more usual places
497dnl ------------------------------------------------------------------------
498dnl
499AC_DEFUN(AC_PATH_QT_MOC_UIC,
500[
501   qt_bindirs=""
502   for dir in $kde_qt_dirs; do
503      qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
504   done
505   qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
506   if test ! "$ac_qt_bindir" = "NO"; then
507      qt_bindirs="$ac_qt_bindir $qt_bindirs"
508   fi
509
510   KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
511   if test -z "$UIC_NOT_NEEDED"; then
512     KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
513     if test -z "$UIC_PATH" ; then
514       KDE_UIC_ERROR_MESSAGE
515       exit 1
516     elif test $kde_qtver = 3; then
517       KDE_CHECK_UIC_FLAG(L,[/nonexistant],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
518       KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
519
520       UIC=$UIC_PATH
521       if test x$ac_uic_supports_libpath = xyes; then
522           UIC="$UIC -L \$(kde_widgetdir)"
523       fi
524       if test x$ac_uic_supports_nounload = xyes; then
525           UIC="$UIC -nounload"
526       fi
527     fi
528   else
529     UIC="echo uic not available: "
530   fi
531
532   AC_SUBST(MOC)
533   AC_SUBST(UIC)
534
535   UIC_TR="i18n"
536   if test $kde_qtver = 3; then
537     UIC_TR="tr2i18n"
538   fi
539
540   AC_SUBST(UIC_TR)
541])
542
543AC_DEFUN(KDE_1_CHECK_PATHS,
544[
545  KDE_1_CHECK_PATH_HEADERS
546
547  KDE_TEST_RPATH=
548
549  if test -n "$USE_RPATH"; then
550
551     if test -n "$kde_libraries"; then
552       KDE_TEST_RPATH="-R $kde_libraries"
553     fi
554
555     if test -n "$qt_libraries"; then
556       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
557     fi
558
559     if test -n "$x_libraries"; then
560       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
561     fi
562
563     KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
564  fi
565
566AC_MSG_CHECKING([for KDE libraries installed])
567ac_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'
568
569if AC_TRY_EVAL(ac_link) && test -s conftest; then
570  AC_MSG_RESULT(yes)
571else
572  AC_MSG_ERROR([your system fails at linking a small KDE application!
573Check, if your compiler is installed correctly and if you have used the
574same compiler to compile Qt and kdelibs as you did use now.
575For more details about this problem, look at the end of config.log.])
576fi
577
578if eval `KDEDIR= ./conftest 2>&5`; then
579  kde_result=done
580else
581  kde_result=problems
582fi
583
584KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
585kde_have_all_paths=yes
586
587KDE_SET_PATHS($kde_result)
588
589])
590
591AC_DEFUN(KDE_SET_PATHS,
592[
593  kde_cv_all_paths="kde_have_all_paths=\"yes\" \
594	kde_htmldir=\"$kde_htmldir\" \
595	kde_appsdir=\"$kde_appsdir\" \
596	kde_icondir=\"$kde_icondir\" \
597	kde_sounddir=\"$kde_sounddir\" \
598	kde_datadir=\"$kde_datadir\" \
599	kde_locale=\"$kde_locale\" \
600	kde_cgidir=\"$kde_cgidir\" \
601	kde_confdir=\"$kde_confdir\" \
602	kde_mimedir=\"$kde_mimedir\" \
603	kde_toolbardir=\"$kde_toolbardir\" \
604	kde_wallpaperdir=\"$kde_wallpaperdir\" \
605	kde_templatesdir=\"$kde_templatesdir\" \
606	kde_bindir=\"$kde_bindir\" \
607	kde_servicesdir=\"$kde_servicesdir\" \
608	kde_servicetypesdir=\"$kde_servicetypesdir\" \
609	kde_moduledir=\"$kde_moduledir\" \
610   kde_styledir=\"$kde_styledir\" \
611	kde_widgetdir=\"$kde_widgetdir\" \
612	kde_result=$1"
613])
614
615AC_DEFUN(KDE_SET_DEFAULT_PATHS,
616[
617if test "$1" = "default"; then
618
619  if test -z "$kde_htmldir"; then
620    kde_htmldir='\${prefix}/share/doc/HTML'
621  fi
622  if test -z "$kde_appsdir"; then
623    kde_appsdir='\${prefix}/share/applnk'
624  fi
625  if test -z "$kde_icondir"; then
626    kde_icondir='\${prefix}/share/icons'
627  fi
628  if test -z "$kde_sounddir"; then
629    kde_sounddir='\${prefix}/share/sounds'
630  fi
631  if test -z "$kde_datadir"; then
632    kde_datadir='\${prefix}/share/apps'
633  fi
634  if test -z "$kde_locale"; then
635    kde_locale='\${prefix}/share/locale'
636  fi
637  if test -z "$kde_cgidir"; then
638    kde_cgidir='\${exec_prefix}/cgi-bin'
639  fi
640  if test -z "$kde_confdir"; then
641    kde_confdir='\${prefix}/share/config'
642  fi
643  if test -z "$kde_mimedir"; then
644    kde_mimedir='\${prefix}/share/mimelnk'
645  fi
646  if test -z "$kde_toolbardir"; then
647    kde_toolbardir='\${prefix}/share/toolbar'
648  fi
649  if test -z "$kde_wallpaperdir"; then
650    kde_wallpaperdir='\${prefix}/share/wallpapers'
651  fi
652  if test -z "$kde_templatesdir"; then
653    kde_templatesdir='\${prefix}/share/templates'
654  fi
655  if test -z "$kde_bindir"; then
656    kde_bindir='\${exec_prefix}/bin'
657  fi
658  if test -z "$kde_servicesdir"; then
659    kde_servicesdir='\${prefix}/share/services'
660  fi
661  if test -z "$kde_servicetypesdir"; then
662    kde_servicetypesdir='\${prefix}/share/servicetypes'
663  fi
664  if test -z "$kde_moduledir"; then
665    if test "$kde_qtver" = "2"; then
666      kde_moduledir='\${libdir}/kde2'
667    else
668      kde_moduledir='\${libdir}/kde3'
669    fi
670  fi
671  if test -z "$kde_styledir"; then
672    kde_styledir='\${libdir}/kde3/plugins/styles'
673  fi
674  if test -z "$kde_widgetdir"; then
675    kde_widgetdir='\${libdir}/kde3/plugins/designer'
676  fi
677
678  KDE_SET_PATHS(defaults)
679
680else
681
682  if test $kde_qtver = 1; then
683     AC_MSG_RESULT([compiling])
684     KDE_1_CHECK_PATHS
685  else
686     AC_MSG_ERROR([path checking not yet supported for KDE 2])
687  fi
688
689fi
690])
691
692AC_DEFUN(KDE_CHECK_PATHS_FOR_COMPLETENESS,
693[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
694   test -z "$kde_icondir" || test -z "$kde_sounddir" ||
695   test -z "$kde_datadir" || test -z "$kde_locale"  ||
696   test -z "$kde_cgidir"  || test -z "$kde_confdir" ||
697   test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
698   test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
699   test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
700   test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
701   test -z "$kde_styledir" || test -z "kde_widgetdir"
702   test "x$kde_have_all_paths" != "xyes"; then
703     kde_have_all_paths=no
704  fi
705])
706
707AC_DEFUN(KDE_MISSING_PROG_ERROR,
708[
709    AC_MSG_ERROR([The important program $1 was not found!
710Please check whether you installed KDE correctly.
711])
712])
713
714AC_DEFUN(KDE_MISSING_ARTS_ERROR,
715[
716    AC_MSG_ERROR([The important program $1 was not found!
717Please check whether you installed aRts correctly.
718])
719])
720
721AC_DEFUN(KDE_SUBST_PROGRAMS,
722[
723
724        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"
725        test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
726        if test -n "$KDEDIRS"; then
727           kde_save_IFS=$IFS
728           IFS=:
729           for dir in $KDEDIRS; do
730                kde_default_bindirs="$dir/bin $kde_default_bindirs "
731           done
732           IFS=$kde_save_IFS
733        fi
734        kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
735        KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
736        KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
737        KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
738        KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
739        KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs])
740        KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
741
742        if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then
743 	    kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
744            test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
745            AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
746	    if test "$KDE_XSL_STYLESHEET" = "NO"; then
747		KDE_XSL_STYLESHEET=""
748	    else
749                KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
750	    fi
751        fi
752
753        DCOP_DEPENDENCIES='$(DCOPIDL)'
754        AC_SUBST(DCOPIDL)
755        AC_SUBST(DCOPIDL2CPP)
756        AC_SUBST(DCOP_DEPENDENCIES)
757        AC_SUBST(MCOPIDL)
758        AC_SUBST(ARTSCCONFIG)
759        AC_SUBST(KDECONFIG)
760	AC_SUBST(MEINPROC)
761 	AC_SUBST(KDE_XSL_STYLESHEET)
762
763        if test -x "$KDECONFIG"; then # it can be "compiled"
764          kde_libs_prefix=`$KDECONFIG --prefix`
765          if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
766               AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
767                          This means it has been moved since you installed it.
768                          This won't work. Please recompile kdelibs for the new prefix.
769                          ])
770           fi
771           kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
772        else
773           kde_libs_prefix='$(prefix)'
774           kde_libs_htmldir='$(kde_htmldir)'
775        fi
776        AC_SUBST(kde_libs_prefix)
777        AC_SUBST(kde_libs_htmldir)
778])dnl
779
780AC_DEFUN(AC_CREATE_KFSSTND,
781[
782AC_REQUIRE([AC_CHECK_RPATH])
783
784AC_MSG_CHECKING([for KDE paths])
785kde_result=""
786kde_cached_paths=yes
787AC_CACHE_VAL(kde_cv_all_paths,
788[
789  KDE_SET_DEFAULT_PATHS($1)
790  kde_cached_paths=no
791])
792eval "$kde_cv_all_paths"
793KDE_CHECK_PATHS_FOR_COMPLETENESS
794if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
795  # wrong values were cached, may be, we can set better ones
796  kde_result=
797  kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
798  kde_datadir= kde_locale=  kde_cgidir=  kde_confdir=
799  kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
800  kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
801  kde_have_all_paths=
802  kde_styledir=
803  kde_widgetdir=
804  KDE_SET_DEFAULT_PATHS($1)
805  eval "$kde_cv_all_paths"
806  KDE_CHECK_PATHS_FOR_COMPLETENESS
807  kde_result="$kde_result (cache overridden)"
808fi
809if test "$kde_have_all_paths" = "no"; then
810  AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
811Since it had compiled and linked before, it must be a strange problem on your system.
812Look at config.log for details. If you are not able to fix this, look at
813http://www.kde.org/faq/installation.html or any www.kde.org mirror.
814(If you're using an egcs version on Linux, you may update binutils!)
815])
816else
817  rm -f conftest*
818  AC_MSG_RESULT($kde_result)
819fi
820
821bindir=$kde_bindir
822
823KDE_SUBST_PROGRAMS
824
825])
826
827AC_DEFUN(AC_SUBST_KFSSTND,
828[
829AC_SUBST(kde_htmldir)
830AC_SUBST(kde_appsdir)
831AC_SUBST(kde_icondir)
832AC_SUBST(kde_sounddir)
833AC_SUBST(kde_datadir)
834AC_SUBST(kde_locale)
835AC_SUBST(kde_confdir)
836AC_SUBST(kde_mimedir)
837AC_SUBST(kde_wallpaperdir)
838AC_SUBST(kde_bindir)
839dnl for KDE 2
840AC_SUBST(kde_templatesdir)
841AC_SUBST(kde_servicesdir)
842AC_SUBST(kde_servicetypesdir)
843AC_SUBST(kde_moduledir)
844AC_SUBST(kde_styledir)
845AC_SUBST(kde_widgetdir)
846if test "$kde_qtver" = 1; then
847  kde_minidir="$kde_icondir/mini"
848else
849# for KDE 1 - this breaks KDE2 apps using minidir, but
850# that's the plan ;-/
851  kde_minidir="/dev/null"
852fi
853dnl AC_SUBST(kde_minidir)
854dnl AC_SUBST(kde_cgidir)
855dnl AC_SUBST(kde_toolbardir)
856])
857
858AC_DEFUN(KDE_MISC_TESTS,
859[
860   AC_LANG_C
861   dnl Checks for libraries.
862   AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
863   AC_SUBST(LIBUTIL)
864   AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
865   AC_SUBST(LIBCOMPAT)
866   kde_have_crypt=
867   AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
868      AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
869        AC_MSG_WARN([you have no crypt in either libcrypt or libc.
870You should install libcrypt from another source or configure with PAM
871support])
872	kde_have_crypt=no
873      ]))
874   AC_SUBST(LIBCRYPT)
875   if test $kde_have_crypt = yes; then
876      AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
877   fi
878   AC_CHECK_SOCKLEN_T
879   AC_LANG_C
880   AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
881   if test $ac_cv_lib_dnet_dnet_ntoa = no; then
882      AC_CHECK_LIB(dnet_stub, dnet_ntoa,
883        [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
884   fi
885   AC_CHECK_FUNC(inet_ntoa)
886   if test $ac_cv_func_inet_ntoa = no; then
887     AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
888   fi
889   AC_CHECK_FUNC(connect)
890   if test $ac_cv_func_connect = no; then
891      AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
892        $X_EXTRA_LIBS)
893   fi
894
895   AC_CHECK_FUNC(remove)
896   if test $ac_cv_func_remove = no; then
897      AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
898   fi
899
900   # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
901   AC_CHECK_FUNC(shmat, ,
902     AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
903
904   # darwin needs this to initialize the environment
905   AC_CHECK_HEADERS(crt_externs.h)
906   AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
907
908   # more headers that need to be explicitly included on darwin
909   AC_CHECK_HEADERS(sys/types.h stdint.h)
910
911   # darwin requires a poll emulation library
912   AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
913
914   # CoreAudio framework
915   AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
916     AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
917     FRAMEWORK_COREAUDIO="-framework CoreAudio"
918   ])
919
920   AC_CHECK_RES_INIT
921   AC_SUBST(LIB_POLL)
922   AC_SUBST(FRAMEWORK_COREAUDIO)
923   LIBSOCKET="$X_EXTRA_LIBS"
924   AC_SUBST(LIBSOCKET)
925   AC_SUBST(X_EXTRA_LIBS)
926   AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
927   AC_SUBST(LIBUCB)
928
929   case $host in  dnl this *is* LynxOS specific
930   *-*-lynxos* )
931        AC_MSG_CHECKING([LynxOS header file wrappers])
932        [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
933        AC_MSG_RESULT(disabled)
934        AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
935         ;;
936    esac
937
938   KDE_CHECK_TYPES
939   KDE_CHECK_LIBDL
940
941AH_VERBATIM(_AIX_STRINGS_H_BZERO,
942[
943/*
944 * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
945 * that defines bzero.
946 */
947
948#if defined(_AIX)
949#include <strings.h>
950#endif
951])
952
953AC_CHECK_FUNCS([vsnprintf snprintf])
954
955AH_VERBATIM(_TRU64,[
956/*
957 * On HP-UX, the declaration of vsnprintf() is needed every time !
958 */
959
960#if !defined(HAVE_VSNPRINTF) || defined(hpux)
961#if __STDC__
962#include <stdarg.h>
963#include <stdlib.h>
964#else
965#include <varargs.h>
966#endif
967#ifdef __cplusplus
968extern "C"
969#endif
970int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
971#ifdef __cplusplus
972extern "C"
973#endif
974int snprintf(char *str, size_t n, char const *fmt, ...);
975#endif
976])
977
978])
979
980dnl ------------------------------------------------------------------------
981dnl Find the header files and libraries for X-Windows. Extended the
982dnl macro AC_PATH_X
983dnl ------------------------------------------------------------------------
984dnl
985AC_DEFUN(K_PATH_X,
986[
987AC_REQUIRE([KDE_MISC_TESTS])dnl
988AC_REQUIRE([KDE_CHECK_LIB64])
989
990AC_ARG_ENABLE(
991  embedded,
992  [  --enable-embedded       link to Qt-embedded, don't use X],
993  kde_use_qt_emb=$enableval,
994  kde_use_qt_emb=no
995)
996
997AC_ARG_ENABLE(
998  qtopia,
999  [  --enable-qtopia         link to Qt-embedded, link to the Qtopia Environment],
1000  kde_use_qt_emb_palm=$enableval,
1001  kde_use_qt_emb_palm=no
1002)
1003
1004if test "$kde_use_qt_emb" = "no"; then
1005
1006AC_MSG_CHECKING(for X)
1007AC_LANG_SAVE
1008AC_LANG_C
1009AC_CACHE_VAL(kde_cv_have_x,
1010[# One or both of the vars are not set, and there is no cached value.
1011if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
1012   kde_x_includes=NO
1013else
1014   kde_x_includes=$x_includes
1015fi
1016if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
1017   kde_x_libraries=NO
1018else
1019   kde_x_libraries=$x_libraries
1020fi
1021
1022# below we use the standard autoconf calls
1023ac_x_libraries=$kde_x_libraries
1024ac_x_includes=$kde_x_includes
1025
1026KDE_PATH_X_DIRECT
1027dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
1028dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
1029dnl location. The correct location is /usr/lib32 or an undefined value
1030dnl (the linker is smart enough to pick the correct default library).
1031dnl Things work just fine if you use just AC_PATH_X_DIRECT.
1032dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
1033dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
1034dnl x_includes should be left alone.
1035case "$host" in
1036mips-sgi-irix6*)
1037  ;;
1038*-*-solaris*)
1039  ;;
1040*)
1041  _AC_PATH_X_XMKMF
1042  if test -z "$ac_x_includes"; then
1043    ac_x_includes="."
1044  fi
1045  if test -z "$ac_x_libraries"; then
1046    ac_x_libraries="/usr/lib${kdelibsuff}"
1047  fi
1048esac
1049#from now on we use our own again
1050
1051# when the user already gave --x-includes, we ignore
1052# what the standard autoconf macros told us.
1053if test "$kde_x_includes" = NO; then
1054  kde_x_includes=$ac_x_includes
1055fi
1056
1057# for --x-libraries too
1058if test "$kde_x_libraries" = NO; then
1059  kde_x_libraries=$ac_x_libraries
1060fi
1061
1062if test "$kde_x_includes" = NO; then
1063  AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
1064fi
1065
1066if test "$kde_x_libraries" = NO; then
1067  AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
1068fi
1069
1070# Record where we found X for the cache.
1071kde_cv_have_x="have_x=yes \
1072         kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
1073])dnl
1074
1075eval "$kde_cv_have_x"
1076
1077if test "$have_x" != yes; then
1078  AC_MSG_RESULT($have_x)
1079  no_x=yes
1080else
1081  AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
1082fi
1083
1084if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
1085  X_INCLUDES=""
1086  x_includes="."; dnl better than nothing :-
1087 else
1088  x_includes=$kde_x_includes
1089  X_INCLUDES="-I$x_includes"
1090fi
1091
1092if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
1093  X_LDFLAGS=""
1094  x_libraries="/usr/lib"; dnl better than nothing :-
1095 else
1096  x_libraries=$kde_x_libraries
1097  X_LDFLAGS="-L$x_libraries"
1098fi
1099all_includes="$X_INCLUDES"
1100all_libraries="$X_LDFLAGS"
1101
1102AC_SUBST(X_INCLUDES)
1103AC_SUBST(X_LDFLAGS)
1104AC_SUBST(x_libraries)
1105AC_SUBST(x_includes)
1106
1107# Check for libraries that X11R6 Xt/Xaw programs need.
1108ac_save_LDFLAGS="$LDFLAGS"
1109LDFLAGS="$LDFLAGS $X_LDFLAGS"
1110# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
1111# check for ICE first), but we must link in the order -lSM -lICE or
1112# we get undefined symbols.  So assume we have SM if we have ICE.
1113# These have to be linked with before -lX11, unlike the other
1114# libraries we check for below, so use a different variable.
1115#  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
1116AC_CHECK_LIB(ICE, IceConnectionNumber,
1117  [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
1118AC_SUBST(LIBSM)
1119LDFLAGS="$ac_save_LDFLAGS"
1120
1121AC_SUBST(X_PRE_LIBS)
1122
1123LIB_X11='-lX11 $(LIBSOCKET)'
1124AC_SUBST(LIB_X11)
1125
1126AC_MSG_CHECKING(for libXext)
1127AC_CACHE_VAL(kde_cv_have_libXext,
1128[
1129kde_ldflags_safe="$LDFLAGS"
1130kde_libs_safe="$LIBS"
1131
1132LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
1133LIBS="-lXext -lX11 $LIBSOCKET"
1134
1135AC_TRY_LINK([
1136#include <stdio.h>
1137#ifdef STDC_HEADERS
1138# include <stdlib.h>
1139#endif
1140],
1141[
1142printf("hello Xext\n");
1143],
1144kde_cv_have_libXext=yes,
1145kde_cv_have_libXext=no
1146   )
1147
1148LDFLAGS=$kde_ldflags_safe
1149LIBS=$kde_libs_safe
1150 ])
1151
1152AC_MSG_RESULT($kde_cv_have_libXext)
1153
1154if test "$kde_cv_have_libXext" = "no"; then
1155  AC_MSG_ERROR([We need a working libXext to proceed. Since configure
1156can't find it itself, we stop here assuming that make wouldn't find
1157them either.])
1158fi
1159
1160AC_MSG_CHECKING(for Xinerama)
1161
1162 AC_ARG_WITH(xinerama,
1163  [  --with-xinerama         enable support for Xinerama ],
1164  [
1165    no_xinerama=no
1166  ], [
1167    no_xinerama=yes
1168  ]
1169)
1170
1171kde_save_LDFLAGS="$LDFLAGS"
1172kde_save_CFLAGS="$CFLAGS"
1173kde_save_LIBS="$LIBS"
1174LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
1175CFLAGS="$CFLAGS -I$x_includes"
1176LIBS="-lXinerama -lXext"
1177
1178if test "x$no_xinerama" = "xno"; then
1179
1180  AC_CACHE_VAL(ac_cv_have_xinerama,
1181  [
1182	  AC_TRY_LINK([#include <X11/Xlib.h>
1183  			#include <X11/extensions/Xinerama.h>],
1184	  	  [XineramaIsActive(NULL);],
1185		  [ac_cv_have_xinerama="yes"],
1186		  [ac_cv_have_xinerama="no"])
1187  ])
1188else
1189  ac_cv_have_xinerama=no;
1190fi
1191
1192AC_MSG_RESULT($ac_cv_have_xinerama)
1193
1194LIBXINERAMA=""
1195
1196if test "$ac_cv_have_xinerama" = "yes"; then
1197  AC_DEFINE(HAVE_XINERAMA, 1, [Define if you want Xinerama support])
1198  LIBXINERAMA="-lXinerama"
1199fi
1200
1201AC_SUBST(LIBXINERAMA)
1202
1203LDFLAGS="$kde_save_LDFLAGS"
1204CFLAGS="$kde_save_CFLAGS"
1205LIBS="$kde_save_LIBS"
1206
1207LIB_XEXT="-lXext"
1208QTE_NORTTI=""
1209
1210else
1211  dnl We're using QT Embedded
1212  CPPFLAGS=-DQWS
1213  CXXFLAGS="$CXXFLAGS -fno-rtti"
1214  QTE_NORTTI="-fno-rtti -DQWS"
1215  X_PRE_LIBS=""
1216  LIB_X11=""
1217  LIB_XEXT=""
1218  LIBSM=""
1219  X_INCLUDES=""
1220  X_LDFLAGS=""
1221  x_includes=""
1222  x_libraries=""
1223  AC_SUBST(X_PRE_LIBS)
1224  AC_SUBST(LIB_X11)
1225  AC_SUBST(LIBSM)
1226  AC_SUBST(X_INCLUDES)
1227  AC_SUBST(X_LDFLAGS)
1228  AC_SUBST(x_includes)
1229  AC_SUBST(x_libraries)
1230fi
1231AC_SUBST(QTE_NORTTI)
1232AC_SUBST(LIB_XEXT)
1233
1234
1235AC_LANG_RESTORE
1236
1237])
1238
1239AC_DEFUN(KDE_PRINT_QT_PROGRAM,
1240[
1241AC_REQUIRE([KDE_USE_QT])
1242cat > conftest.$ac_ext <<EOF
1243#include "confdefs.h"
1244#include <qglobal.h>
1245#include <qapplication.h>
1246EOF
1247if test "$kde_qtver" = "2"; then
1248cat >> conftest.$ac_ext <<EOF
1249#include <qevent.h>
1250#include <qstring.h>
1251#include <qstyle.h>
1252EOF
1253
1254if test $kde_qtsubver -gt 0; then
1255cat >> conftest.$ac_ext <<EOF
1256#if QT_VERSION < 210
1257#error 1
1258#endif
1259EOF
1260fi
1261fi
1262
1263if test "$kde_qtver" = "3"; then
1264cat >> conftest.$ac_ext <<EOF
1265#include <qcursor.h>
1266#include <qstylefactory.h>
1267#include <private/qucomextra_p.h>
1268EOF
1269fi
1270
1271echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
1272cat >> conftest.$ac_ext <<EOF
1273#error 1
1274#endif
1275
1276int main() {
1277EOF
1278if test "$kde_qtver" = "2"; then
1279cat >> conftest.$ac_ext <<EOF
1280    QStringList *t = new QStringList();
1281    Q_UNUSED(t);
1282EOF
1283if test $kde_qtsubver -gt 0; then
1284cat >> conftest.$ac_ext <<EOF
1285    QString s;
1286    s.setLatin1("Elvis is alive", 14);
1287EOF
1288fi
1289fi
1290if test "$kde_qtver" = "3"; then
1291cat >> conftest.$ac_ext <<EOF
1292    (void)QStyleFactory::create(QString::null);
1293    QCursor c(Qt::WhatsThisCursor);
1294EOF
1295fi
1296cat >> conftest.$ac_ext <<EOF
1297    return 0;
1298}
1299EOF
1300])
1301
1302AC_DEFUN(KDE_USE_QT,
1303[
1304if test -z "$1"; then
1305  # Current default Qt version: 3.1
1306  kde_qtver=3
1307  kde_qtsubver=1
1308else
1309  kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
1310  # following is the check if subversion isnt found in passed argument
1311  if test "$kde_qtsubver" = "$1"; then
1312    kde_qtsubver=1
1313  fi
1314  kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
1315  if test "$kde_qtver" = "1"; then
1316    kde_qtsubver=42
1317  fi
1318fi
1319
1320if test -z "$2"; then
1321  if test "$kde_qtver" = "2"; then
1322    if test $kde_qtsubver -gt 0; then
1323      kde_qt_minversion=">= Qt 2.2.2"
1324    else
1325      kde_qt_minversion=">= Qt 2.0.2"
1326    fi
1327  fi
1328  if test "$kde_qtver" = "3"; then
1329    if test $kde_qtsubver -gt 0; then
1330      kde_qt_minversion=">= Qt 3.1 (20021021)"
1331    else
1332      kde_qt_minversion=">= Qt 3.0"
1333    fi
1334  fi
1335  if test "$kde_qtver" = "1"; then
1336    kde_qt_minversion=">= 1.42 and < 2.0"
1337  fi
1338else
1339   kde_qt_minversion=$2
1340fi
1341
1342if test -z "$3"; then
1343   if test $kde_qtver = 3; then
1344     if test $kde_qtsubver -gt 0; then
1345       kde_qt_verstring="QT_VERSION >= 0x030100"
1346     else
1347       kde_qt_verstring="QT_VERSION >= 300"
1348     fi
1349   fi
1350   if test $kde_qtver = 2; then
1351     if test $kde_qtsubver -gt 0; then
1352       kde_qt_verstring="QT_VERSION >= 222"
1353     else
1354       kde_qt_verstring="QT_VERSION >= 200"
1355     fi
1356   fi
1357   if test $kde_qtver = 1; then
1358    kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
1359   fi
1360else
1361   kde_qt_verstring=$3
1362fi
1363
1364if test $kde_qtver = 3; then
1365  kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt"
1366fi
1367if test $kde_qtver = 2; then
1368   kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
1369fi
1370if test $kde_qtver = 1; then
1371   kde_qt_dirs="$QTDIR /usr/lib/qt"
1372fi
1373])
1374
1375AC_DEFUN(KDE_CHECK_QT_DIRECT,
1376[
1377AC_REQUIRE([KDE_USE_QT])
1378AC_MSG_CHECKING([if Qt compiles without flags])
1379AC_CACHE_VAL(kde_cv_qt_direct,
1380[
1381AC_LANG_SAVE
1382AC_LANG_CPLUSPLUS
1383ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
1384ac_LIBRARY_PATH="$LIBRARY_PATH"
1385ac_cxxflags_safe="$CXXFLAGS"
1386ac_ldflags_safe="$LDFLAGS"
1387ac_libs_safe="$LIBS"
1388
1389CXXFLAGS="$CXXFLAGS -I$qt_includes"
1390LDFLAGS="$LDFLAGS $X_LDFLAGS"
1391if test "x$kde_use_qt_emb" != "xyes"; then
1392LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
1393else
1394LIBS="$LIBQT $LIBSOCKET"
1395fi
1396LD_LIBRARY_PATH=
1397export LD_LIBRARY_PATH
1398LIBRARY_PATH=
1399export LIBRARY_PATH
1400
1401KDE_PRINT_QT_PROGRAM
1402
1403if AC_TRY_EVAL(ac_link) && test -s conftest; then
1404  kde_cv_qt_direct="yes"
1405else
1406  kde_cv_qt_direct="no"
1407  echo "configure: failed program was:" >&AC_FD_CC
1408  cat conftest.$ac_ext >&AC_FD_CC
1409fi
1410
1411rm -f conftest*
1412CXXFLAGS="$ac_cxxflags_safe"
1413LDFLAGS="$ac_ldflags_safe"
1414LIBS="$ac_libs_safe"
1415
1416LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
1417export LD_LIBRARY_PATH
1418LIBRARY_PATH="$ac_LIBRARY_PATH"
1419export LIBRARY_PATH
1420AC_LANG_RESTORE
1421])
1422
1423if test "$kde_cv_qt_direct" = "yes"; then
1424  AC_MSG_RESULT(yes)
1425  $1
1426else
1427  AC_MSG_RESULT(no)
1428  $2
1429fi
1430])
1431
1432dnl ------------------------------------------------------------------------
1433dnl Try to find the Qt headers and libraries.
1434dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
1435dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
1436dnl ------------------------------------------------------------------------
1437dnl
1438AC_DEFUN(AC_PATH_QT_1_3,
1439[
1440AC_REQUIRE([K_PATH_X])
1441AC_REQUIRE([KDE_USE_QT])
1442AC_REQUIRE([KDE_CHECK_LIB64])
1443
1444dnl ------------------------------------------------------------------------
1445dnl Add configure flag to enable linking to MT version of Qt library.
1446dnl ------------------------------------------------------------------------
1447
1448AC_ARG_ENABLE(
1449  mt,
1450  [  --disable-mt            link to non-threaded Qt (deprecated)],
1451  kde_use_qt_mt=$enableval,
1452  [
1453    if test $kde_qtver = 3; then
1454      kde_use_qt_mt=yes
1455    else
1456      kde_use_qt_mt=no
1457    fi
1458  ]
1459)
1460
1461USING_QT_MT=""
1462
1463dnl ------------------------------------------------------------------------
1464dnl If we not get --disable-qt-mt then adjust some vars for the host.
1465dnl ------------------------------------------------------------------------
1466
1467KDE_MT_LDFLAGS=
1468KDE_MT_LIBS=
1469if test "x$kde_use_qt_mt" = "xyes"; then
1470  KDE_CHECK_THREADING
1471  if test "x$kde_use_threading" = "xyes"; then
1472    CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
1473    KDE_MT_LDFLAGS="$USE_THREADS"
1474    KDE_MT_LIBS="$LIBPTHREAD"
1475  else
1476    kde_use_qt_mt=no
1477  fi
1478fi
1479AC_SUBST(KDE_MT_LDFLAGS)
1480AC_SUBST(KDE_MT_LIBS)
1481
1482kde_qt_was_given=yes
1483
1484dnl ------------------------------------------------------------------------
1485dnl If we haven't been told how to link to Qt, we work it out for ourselves.
1486dnl ------------------------------------------------------------------------
1487if test -z "$LIBQT_GLOB"; then
1488  if test "x$kde_use_qt_emb" = "xyes"; then
1489    LIBQT_GLOB="libqte.*"
1490  else
1491    LIBQT_GLOB="libqt.*"
1492  fi
1493fi
1494
1495if test -z "$LIBQT"; then
1496dnl ------------------------------------------------------------
1497dnl If we got --enable-embedded then adjust the Qt library name.
1498dnl ------------------------------------------------------------
1499  if test "x$kde_use_qt_emb" = "xyes"; then
1500    qtlib="qte"
1501  else
1502    qtlib="qt"
1503  fi
1504
1505  kde_int_qt="-l$qtlib"
1506else
1507  kde_int_qt="$LIBQT"
1508  kde_lib_qt_set=yes
1509fi
1510
1511if test -z "$LIBQPE"; then
1512dnl ------------------------------------------------------------
1513dnl If we got --enable-palmtop then add -lqpe to the link line
1514dnl ------------------------------------------------------------
1515  if test "x$kde_use_qt_emb" = "xyes"; then
1516    if test "x$kde_use_qt_emb_palm" = "xyes"; then
1517      LIB_QPE="-lqpe"
1518    else
1519      LIB_QPE=""
1520    fi
1521  else
1522    LIB_QPE=""
1523  fi
1524fi
1525
1526dnl ------------------------------------------------------------------------
1527dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
1528dnl ------------------------------------------------------------------------
1529
1530if test "x$kde_use_qt_mt" = "xyes"; then
1531  if test -z "$LIBQT"; then
1532    LIBQT="-l$qtlib-mt"
1533    kde_int_qt="-l$qtlib-mt"
1534  else
1535    LIBQT="$qtlib-mt"
1536    kde_int_qt="$qtlib-mt"
1537  fi
1538  LIBQT_GLOB="lib$qtlib-mt.*"
1539  USING_QT_MT="using -mt"
1540else
1541  LIBQT="-l$qtlib"
1542fi
1543
1544if test $kde_qtver != 1; then
1545
1546  AC_REQUIRE([AC_FIND_PNG])
1547  AC_REQUIRE([AC_FIND_JPEG])
1548  LIBQT="$LIBQT $LIBPNG $LIBJPEG"
1549fi
1550
1551if test $kde_qtver = 3; then
1552  AC_REQUIRE([KDE_CHECK_LIBDL])
1553  LIBQT="$LIBQT $LIBDL"
1554fi
1555
1556AC_MSG_CHECKING([for Qt])
1557
1558if test "x$kde_use_qt_emb" != "xyes"; then
1559LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
1560fi
1561ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
1562qt_libraries=""
1563qt_includes=""
1564AC_ARG_WITH(qt-dir,
1565    [  --with-qt-dir=DIR       where the root of Qt is installed ],
1566    [  ac_qt_includes="$withval"/include
1567       ac_qt_libraries="$withval"/lib${kdelibsuff}
1568       ac_qt_bindir="$withval"/bin
1569    ])
1570
1571AC_ARG_WITH(qt-includes,
1572    [  --with-qt-includes=DIR  where the Qt includes are. ],
1573    [
1574       ac_qt_includes="$withval"
1575    ])
1576
1577kde_qt_libs_given=no
1578
1579AC_ARG_WITH(qt-libraries,
1580    [  --with-qt-libraries=DIR where the Qt library is installed.],
1581    [  ac_qt_libraries="$withval"
1582       kde_qt_libs_given=yes
1583    ])
1584
1585AC_CACHE_VAL(ac_cv_have_qt,
1586[#try to guess Qt locations
1587
1588qt_incdirs=""
1589for dir in $kde_qt_dirs; do
1590   qt_incdirs="$qt_incdirs $dir/include $dir"
1591done
1592qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 $x_includes"
1593if test ! "$ac_qt_includes" = "NO"; then
1594   qt_incdirs="$ac_qt_includes $qt_incdirs"
1595fi
1596
1597if test "$kde_qtver" != "1"; then
1598  kde_qt_header=qstyle.h
1599else
1600  kde_qt_header=qglobal.h
1601fi
1602
1603AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
1604ac_qt_includes="$qt_incdir"
1605
1606qt_libdirs=""
1607for dir in $kde_qt_dirs; do
1608   qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir"
1609done
1610qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
1611if test ! "$ac_qt_libraries" = "NO"; then
1612  qt_libdir=$ac_qt_libraries
1613else
1614  qt_libdirs="$ac_qt_libraries $qt_libdirs"
1615  # if the Qt was given, the chance is too big that libqt.* doesn't exist
1616  qt_libdir=NONE
1617  for dir in $qt_libdirs; do
1618    try="ls -1 $dir/${LIBQT_GLOB}"
1619    if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
1620  done
1621fi
1622
1623ac_qt_libraries="$qt_libdir"
1624
1625AC_LANG_SAVE
1626AC_LANG_CPLUSPLUS
1627
1628ac_cxxflags_safe="$CXXFLAGS"
1629ac_ldflags_safe="$LDFLAGS"
1630ac_libs_safe="$LIBS"
1631
1632CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
1633LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
1634LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
1635
1636KDE_PRINT_QT_PROGRAM
1637
1638if AC_TRY_EVAL(ac_link) && test -s conftest; then
1639  rm -f conftest*
1640else
1641  echo "configure: failed program was:" >&AC_FD_CC
1642  cat conftest.$ac_ext >&AC_FD_CC
1643  ac_qt_libraries="NO"
1644fi
1645rm -f conftest*
1646CXXFLAGS="$ac_cxxflags_safe"
1647LDFLAGS="$ac_ldflags_safe"
1648LIBS="$ac_libs_safe"
1649
1650AC_LANG_RESTORE
1651if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
1652  ac_cv_have_qt="have_qt=no"
1653  ac_qt_notfound=""
1654  missing_qt_mt=""
1655  if test "$ac_qt_includes" = NO; then
1656    if test "$ac_qt_libraries" = NO; then
1657      ac_qt_notfound="(headers and libraries)";
1658    else
1659      ac_qt_notfound="(headers)";
1660    fi
1661  else
1662    if test "x$kde_use_qt_mt" = "xyes"; then
1663       missing_qt_mt="
1664Make sure that you have compiled Qt with thread support!"
1665       ac_qt_notfound="(library $qtlib-mt)";
1666    else
1667       ac_qt_notfound="(library $qtlib)";
1668    fi
1669  fi
1670
1671  AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
1672For more details about this problem, look at the end of config.log.$missing_qt_mt])
1673else
1674  have_qt="yes"
1675fi
1676])
1677
1678eval "$ac_cv_have_qt"
1679
1680if test "$have_qt" != yes; then
1681  AC_MSG_RESULT([$have_qt]);
1682else
1683  ac_cv_have_qt="have_qt=yes \
1684    ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
1685  AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
1686
1687  qt_libraries="$ac_qt_libraries"
1688  qt_includes="$ac_qt_includes"
1689fi
1690
1691if test ! "$kde_qt_libs_given" = "yes"; then
1692KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
1693fi
1694
1695AC_SUBST(qt_libraries)
1696AC_SUBST(qt_includes)
1697
1698if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
1699 QT_INCLUDES=""
1700else
1701 QT_INCLUDES="-I$qt_includes"
1702 all_includes="$QT_INCLUDES $all_includes"
1703fi
1704
1705if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
1706 QT_LDFLAGS=""
1707else
1708 QT_LDFLAGS="-L$qt_libraries"
1709 all_libraries="$all_libraries $QT_LDFLAGS"
1710fi
1711test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
1712
1713AC_SUBST(QT_INCLUDES)
1714AC_SUBST(QT_LDFLAGS)
1715AC_PATH_QT_MOC_UIC
1716
1717KDE_CHECK_QT_JPEG
1718
1719if test "x$kde_use_qt_emb" != "xyes"; then
1720LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
1721else
1722LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG)'
1723fi
1724test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
1725
1726AC_SUBST(LIB_QT)
1727AC_SUBST(LIB_QPE)
1728
1729AC_SUBST(kde_qtver)
1730])
1731
1732AC_DEFUN(AC_PATH_QT,
1733[
1734AC_PATH_QT_1_3
1735])
1736
1737AC_DEFUN(KDE_CHECK_UIC_PLUGINS,
1738[
1739AC_REQUIRE([AC_PATH_QT_MOC_UIC])
1740
1741if test x$ac_uic_supports_libpath = xyes; then
1742
1743AC_MSG_CHECKING([if UIC has KDE plugins available])
1744AC_CACHE_VAL(kde_cv_uic_plugins,
1745[
1746cat > actest.ui << EOF
1747<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
1748<class>NewConnectionDialog</class>
1749<widget class="QDialog">
1750   <widget class="KLineEdit">
1751        <property name="name">
1752           <cstring>testInput</cstring>
1753        </property>
1754   </widget>
1755</widget>
1756</UI>
1757EOF
1758
1759
1760
1761kde_cv_uic_plugins=no
1762kde_line="$UIC_PATH -L $kde_widgetdir"
1763if test x$ac_uic_supports_nounload = xyes; then
1764   kde_line="$kde_line -nounload"
1765fi
1766kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
1767if AC_TRY_EVAL(kde_line); then
1768	if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
1769		kde_cv_uic_plugins=yes
1770	fi
1771fi
1772rm -f actest.ui actest.cpp
1773])
1774
1775if test "$kde_cv_uic_plugins" = yes; then
1776	AC_MSG_RESULT([yes])
1777else
1778	AC_MSG_ERROR([not found - you need to install kdelibs first.])
1779fi
1780fi
1781])
1782
1783AC_DEFUN(KDE_CHECK_FINAL,
1784[
1785  AC_ARG_ENABLE(final, [  --enable-final          build size optimized apps (experimental - needs lots of memory)],
1786	kde_use_final=$enableval, kde_use_final=no)
1787
1788  KDE_COMPILER_REPO
1789  if test "x$kde_use_final" = "xyes"; then
1790      KDE_USE_FINAL_TRUE=""
1791      KDE_USE_FINAL_FALSE="#"
1792   else
1793      KDE_USE_FINAL_TRUE="#"
1794      KDE_USE_FINAL_FALSE=""
1795  fi
1796  AC_SUBST(KDE_USE_FINAL_TRUE)
1797  AC_SUBST(KDE_USE_FINAL_FALSE)
1798
1799  AC_ARG_ENABLE(closure, [  --disable-closure       don't delay template instantiation],
1800  	kde_use_closure=$enableval, kde_use_closure=yes)
1801
1802  if test "x$kde_use_closure" = "xyes"; then
1803       KDE_USE_CLOSURE_TRUE=""
1804       KDE_USE_CLOSURE_FALSE="#"
1805#       CXXFLAGS="$CXXFLAGS $REPO"
1806  else
1807       KDE_USE_CLOSURE_TRUE="#"
1808       KDE_USE_CLOSURE_FALSE=""
1809  fi
1810  AC_SUBST(KDE_USE_CLOSURE_TRUE)
1811  AC_SUBST(KDE_USE_CLOSURE_FALSE)
1812])
1813
1814dnl ------------------------------------------------------------------------
1815dnl Now, the same with KDE
1816dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
1817dnl and $(kde_includes) will be the kdehdrlocation (if needed)
1818dnl ------------------------------------------------------------------------
1819dnl
1820AC_DEFUN(AC_BASE_PATH_KDE,
1821[
1822AC_PREREQ([2.13])
1823AC_REQUIRE([AC_PATH_QT])dnl
1824AC_REQUIRE([KDE_CHECK_LIB64])
1825
1826AC_CHECK_RPATH
1827AC_MSG_CHECKING([for KDE])
1828
1829if test "${prefix}" != NONE; then
1830  kde_includes=${prefix}/include
1831  ac_kde_includes=$prefix/include
1832
1833  if test "${exec_prefix}" != NONE; then
1834     kde_libraries=${libdir}
1835     ac_kde_libraries=$libdir
1836     if test "$ac_kde_libraries" = '${exec_prefix}/lib'${kdelibsuff}; then
1837	ac_kde_libraries=$exec_prefix/lib${kdelibsuff}
1838     fi
1839  else
1840     kde_libraries=${prefix}/lib${kdelibsuff}
1841     ac_kde_libraries=$prefix/lib${kdelibsuff}
1842  fi
1843else
1844  ac_kde_includes=
1845  ac_kde_libraries=
1846  kde_libraries=""
1847  kde_includes=""
1848fi
1849
1850AC_CACHE_VAL(ac_cv_have_kde,
1851[#try to guess kde locations
1852
1853if test "$kde_qtver" = 1; then
1854  kde_check_header="ksock.h"
1855  kde_check_lib="libkdecore.la"
1856else
1857  kde_check_header="ksharedptr.h"
1858  kde_check_lib="libkio.la"
1859fi
1860
1861if test -z "$1"; then
1862
1863kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes"
1864test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
1865kde_incdirs="$ac_kde_includes $kde_incdirs"
1866AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
1867ac_kde_includes="$kde_incdir"
1868
1869if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
1870  AC_MSG_ERROR([
1871in the prefix, you've chosen, are no KDE headers installed. This will fail.
1872So, check this please and use another prefix!])
1873fi
1874
1875kde_libdirs="/usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}"
1876test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
1877kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
1878AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
1879ac_kde_libraries="$kde_libdir"
1880
1881kde_widgetdir=NO
1882dnl this might be somewhere else
1883AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
1884
1885if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
1886AC_MSG_ERROR([
1887in the prefix, you've chosen, are no KDE libraries installed. This will fail.
1888So, check this please and use another prefix!])
1889fi
1890
1891if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
1892AC_MSG_ERROR([
1893I can't find the designer plugins. These are required and should have been installed
1894by kdelibs])
1895fi
1896
1897if test -n "$kde_widgetdir"; then
1898    kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
1899fi
1900
1901
1902if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
1903  ac_cv_have_kde="have_kde=no"
1904else
1905  ac_cv_have_kde="have_kde=yes \
1906    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1907fi
1908
1909else dnl test -z $1
1910
1911  ac_cv_have_kde="have_kde=no"
1912
1913fi
1914])dnl
1915
1916eval "$ac_cv_have_kde"
1917
1918if test "$have_kde" != "yes"; then
1919 if test "${prefix}" = NONE; then
1920  ac_kde_prefix="$ac_default_prefix"
1921 else
1922  ac_kde_prefix="$prefix"
1923 fi
1924 if test "$exec_prefix" = NONE; then
1925  ac_kde_exec_prefix="$ac_kde_prefix"
1926  AC_MSG_RESULT([will be installed in $ac_kde_prefix])
1927 else
1928  ac_kde_exec_prefix="$exec_prefix"
1929  AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
1930 fi
1931
1932 kde_libraries="${libdir}"
1933 kde_includes=${ac_kde_prefix}/include
1934
1935else
1936  ac_cv_have_kde="have_kde=yes \
1937    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1938  AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
1939
1940  kde_libraries="$ac_kde_libraries"
1941  kde_includes="$ac_kde_includes"
1942fi
1943AC_SUBST(kde_libraries)
1944AC_SUBST(kde_includes)
1945
1946if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes"  || test "$kde_includes" = "/usr/include"; then
1947 KDE_INCLUDES=""
1948else
1949 KDE_INCLUDES="-I$kde_includes"
1950 all_includes="$KDE_INCLUDES $all_includes"
1951fi
1952
1953KDE_LDFLAGS="-L$kde_libraries"
1954if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
1955 all_libraries="$all_libraries $KDE_LDFLAGS"
1956fi
1957
1958AC_SUBST(KDE_LDFLAGS)
1959AC_SUBST(KDE_INCLUDES)
1960
1961AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1962
1963all_libraries="$all_libraries $USER_LDFLAGS"
1964all_includes="$all_includes $USER_INCLUDES"
1965AC_SUBST(all_includes)
1966AC_SUBST(all_libraries)
1967
1968if test -z "$1"; then
1969KDE_CHECK_UIC_PLUGINS
1970fi
1971
1972ac_kde_libraries="$kde_libdir"
1973
1974AC_SUBST(AUTODIRS)
1975
1976
1977])
1978
1979AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
1980[
1981AC_MSG_CHECKING(for extra includes)
1982AC_ARG_WITH(extra-includes, [  --with-extra-includes=DIR
1983                          adds non standard include paths],
1984  kde_use_extra_includes="$withval",
1985  kde_use_extra_includes=NONE
1986)
1987kde_extra_includes=
1988if test -n "$kde_use_extra_includes" && \
1989   test "$kde_use_extra_includes" != "NONE"; then
1990
1991   ac_save_ifs=$IFS
1992   IFS=':'
1993   for dir in $kde_use_extra_includes; do
1994     kde_extra_includes="$kde_extra_includes $dir"
1995     USER_INCLUDES="$USER_INCLUDES -I$dir"
1996   done
1997   IFS=$ac_save_ifs
1998   kde_use_extra_includes="added"
1999else
2000   kde_use_extra_includes="no"
2001fi
2002AC_SUBST(USER_INCLUDES)
2003
2004AC_MSG_RESULT($kde_use_extra_includes)
2005
2006kde_extra_libs=
2007AC_MSG_CHECKING(for extra libs)
2008AC_ARG_WITH(extra-libs, [  --with-extra-libs=DIR   adds non standard library paths],
2009  kde_use_extra_libs=$withval,
2010  kde_use_extra_libs=NONE
2011)
2012if test -n "$kde_use_extra_libs" && \
2013   test "$kde_use_extra_libs" != "NONE"; then
2014
2015   ac_save_ifs=$IFS
2016   IFS=':'
2017   for dir in $kde_use_extra_libs; do
2018     kde_extra_libs="$kde_extra_libs $dir"
2019     KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
2020     USER_LDFLAGS="$USER_LDFLAGS -L$dir"
2021   done
2022   IFS=$ac_save_ifs
2023   kde_use_extra_libs="added"
2024else
2025   kde_use_extra_libs="no"
2026fi
2027
2028AC_SUBST(USER_LDFLAGS)
2029
2030AC_MSG_RESULT($kde_use_extra_libs)
2031
2032])
2033
2034AC_DEFUN(KDE_1_CHECK_PATH_HEADERS,
2035[
2036    AC_MSG_CHECKING([for KDE headers installed])
2037    AC_LANG_SAVE
2038    AC_LANG_CPLUSPLUS
2039cat > conftest.$ac_ext <<EOF
2040#ifdef STDC_HEADERS
2041# include <stdlib.h>
2042#endif
2043#include <stdio.h>
2044#include "confdefs.h"
2045#include <kapp.h>
2046
2047int main() {
2048    printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
2049    printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
2050    printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
2051    printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
2052    printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
2053    printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
2054    printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
2055    printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
2056    printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
2057    printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
2058    printf("kde_wallpaperdir=\\"%s\\"\n",
2059	KApplication::kde_wallpaperdir().data());
2060    printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
2061    printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
2062    printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
2063    printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
2064    printf("kde_moduledir=\\"/tmp/dummy\\"\n");
2065    printf("kde_styledir=\\"/tmp/dummy\\"\n");
2066    printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
2067    return 0;
2068    }
2069EOF
2070
2071 ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
2072 if AC_TRY_EVAL(ac_compile); then
2073   AC_MSG_RESULT(yes)
2074 else
2075   AC_MSG_ERROR([your system is not able to compile a small KDE application!
2076Check, if you installed the KDE header files correctly.
2077For more details about this problem, look at the end of config.log.])
2078  fi
2079
2080  AC_LANG_RESTORE
2081])
2082
2083AC_DEFUN(KDE_CHECK_KDEQTADDON,
2084[
2085AC_MSG_CHECKING(for kde-qt-addon)
2086AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
2087[
2088 kde_ldflags_safe="$LDFLAGS"
2089 kde_libs_safe="$LIBS"
2090 kde_cxxflags_safe="$CXXFLAGS"
2091
2092 LIBS="-lkde-qt-addon $LIBQT $LIBS"
2093 CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
2094 LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
2095
2096 AC_TRY_LINK([
2097   #include <qdom.h>
2098 ],
2099 [
2100   QDomDocument doc;
2101 ],
2102  kde_cv_have_kdeqtaddon=yes,
2103  kde_cv_have_kdeqtaddon=no
2104 )
2105
2106 LDFLAGS=$kde_ldflags_safe
2107 LIBS=$kde_libs_safe
2108 CXXFLAGS=$kde_cxxflags_safe
2109])
2110
2111AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
2112
2113if test "$kde_cv_have_kdeqtaddon" = "no"; then
2114  AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
2115It is a separate package (and CVS module) named kde-qt-addon.])
2116fi
2117])
2118
2119AC_DEFUN(KDE_CHECK_KIMGIO,
2120[
2121   AC_REQUIRE([AC_BASE_PATH_KDE])
2122   AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2123   AC_REQUIRE([AC_FIND_TIFF])
2124   AC_REQUIRE([AC_FIND_JPEG])
2125   AC_REQUIRE([AC_FIND_PNG])
2126   AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
2127
2128   if test "$1" = "existance"; then
2129     AC_LANG_SAVE
2130     AC_LANG_CPLUSPLUS
2131     kde_save_LIBS="$LIBS"
2132     LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
2133     AC_CHECK_LIB(kimgio, kimgioRegister, [
2134      LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
2135     LIBS="$kde_save_LIBS"
2136     AC_LANG_RESTORE
2137   else
2138     LIBKIMGIO_EXISTS=yes
2139   fi
2140
2141   if test "$LIBKIMGIO_EXISTS" = "yes"; then
2142     LIB_KIMGIO='-lkimgio'
2143   else
2144     LIB_KIMGIO=''
2145   fi
2146   AC_SUBST(LIB_KIMGIO)
2147])
2148
2149AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
2150[
2151   AC_REQUIRE([KDE_MISC_TESTS])
2152   AC_REQUIRE([KDE_CHECK_LIBDL])
2153   AC_REQUIRE([K_PATH_X])
2154
2155if test $kde_qtver = 3; then
2156   AC_SUBST(LIB_KDECORE, "-lkdecore")
2157   AC_SUBST(LIB_KDEUI, "-lkdeui")
2158   AC_SUBST(LIB_KIO, "-lkio")
2159   AC_SUBST(LIB_SMB, "-lsmb")
2160   AC_SUBST(LIB_KAB, "-lkab")
2161   AC_SUBST(LIB_KABC, "-lkabc")
2162   AC_SUBST(LIB_KHTML, "-lkhtml")
2163   AC_SUBST(LIB_KSPELL, "-lkspell")
2164   AC_SUBST(LIB_KPARTS, "-lkparts")
2165   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2166# these are for backward compatibility
2167   AC_SUBST(LIB_KSYCOCA, "-lkio")
2168   AC_SUBST(LIB_KFILE, "-lkio")
2169elif test $kde_qtver = 2; then
2170   AC_SUBST(LIB_KDECORE, "-lkdecore")
2171   AC_SUBST(LIB_KDEUI, "-lkdeui")
2172   AC_SUBST(LIB_KIO, "-lkio")
2173   AC_SUBST(LIB_KSYCOCA, "-lksycoca")
2174   AC_SUBST(LIB_SMB, "-lsmb")
2175   AC_SUBST(LIB_KFILE, "-lkfile")
2176   AC_SUBST(LIB_KAB, "-lkab")
2177   AC_SUBST(LIB_KHTML, "-lkhtml")
2178   AC_SUBST(LIB_KSPELL, "-lkspell")
2179   AC_SUBST(LIB_KPARTS, "-lkparts")
2180   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2181else
2182   AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
2183   AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
2184   AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
2185   AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
2186   AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
2187fi
2188])
2189
2190AC_DEFUN(AC_PATH_KDE,
2191[
2192  AC_BASE_PATH_KDE
2193  AC_ARG_ENABLE(path-check, [  --disable-path-check    don't try to find out, where to install],
2194  [
2195  if test "$enableval" = "no";
2196    then ac_use_path_checking="default"
2197    else ac_use_path_checking=""
2198  fi
2199  ],
2200  [
2201  if test "$kde_qtver" = 1;
2202    then ac_use_path_checking=""
2203    else ac_use_path_checking="default"
2204  fi
2205  ]
2206  )
2207
2208  AC_CREATE_KFSSTND($ac_use_path_checking)
2209
2210  AC_SUBST_KFSSTND
2211  KDE_CREATE_LIBS_ALIASES
2212])
2213
2214dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
2215AC_DEFUN(KDE_CHECK_FUNC_EXT,
2216[
2217AC_MSG_CHECKING(for $1)
2218AC_CACHE_VAL(kde_cv_func_$1,
2219[
2220AC_LANG_SAVE
2221AC_LANG_CPLUSPLUS
2222save_CXXFLAGS="$CXXFLAGS"
2223kde_safe_LIBS="$LIBS"
2224LIBS="$LIBS $X_EXTRA_LIBS"
2225if test "$GXX" = "yes"; then
2226  CXXFLAGS="$CXXFLAGS -pedantic-errors"
2227fi
2228AC_TRY_COMPILE([
2229$2
2230],
2231[
2232$3
2233],
2234kde_cv_func_$1=yes,
2235kde_cv_func_$1=no)
2236CXXFLAGS="$save_CXXFLAGS"
2237LIBS=$kde_safe_LIBS
2238AC_LANG_RESTORE
2239])
2240
2241AC_MSG_RESULT($kde_cv_func_$1)
2242
2243AC_MSG_CHECKING([if $1 needs custom prototype])
2244AC_CACHE_VAL(kde_cv_proto_$1,
2245[
2246if test "x$kde_cv_func_$1" = xyes; then
2247  kde_cv_proto_$1=no
2248else
2249  case "$1" in
2250	setenv|unsetenv|usleep|getdomainname|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
2251		kde_cv_proto_$1="yes - in libkdefakes"
2252		;;
2253	*)
2254		kde_cv_proto_$1=unknown
2255		;;
2256  esac
2257fi
2258
2259if test "x$kde_cv_proto_$1" = xunknown; then
2260
2261AC_LANG_SAVE
2262AC_LANG_CPLUSPLUS
2263  kde_safe_libs=$LIBS
2264  LIBS="$LIBS $X_EXTRA_LIBS"
2265  AC_TRY_LINK([
2266$2
2267
2268extern "C" $4;
2269],
2270[
2271$3
2272],
2273[ kde_cv_func_$1=yes
2274  kde_cv_proto_$1=yes ],
2275  [kde_cv_proto_$1="$1 unavailable"]
2276)
2277LIBS=$kde_safe_libs
2278AC_LANG_RESTORE
2279fi
2280])
2281AC_MSG_RESULT($kde_cv_proto_$1)
2282
2283if test "x$kde_cv_func_$1" = xyes; then
2284  AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
2285  $6
2286fi
2287if test "x$kde_cv_proto_$1" = xno; then
2288  AC_DEFINE(HAVE_$5_PROTO, 1,
2289  [Define if you have the $1 prototype])
2290fi
2291
2292AH_VERBATIM([_HAVE_$5_PROTO],
2293[
2294#if !defined(HAVE_$5_PROTO)
2295#ifdef __cplusplus
2296extern "C"
2297#endif
2298$4;
2299#endif
2300])
2301])
2302
2303AC_DEFUN(AC_CHECK_SETENV,
2304[
2305	KDE_CHECK_FUNC_EXT(setenv, [
2306#include <stdlib.h>
2307],
2308		[setenv("VAR", "VALUE", 1);],
2309	        [int setenv (const char *, const char *, int)],
2310		[SETENV])
2311])
2312
2313AC_DEFUN(AC_CHECK_UNSETENV,
2314[
2315	KDE_CHECK_FUNC_EXT(unsetenv, [
2316#include <stdlib.h>
2317],
2318		[unsetenv("VAR");],
2319	        [void unsetenv (const char *)],
2320		[UNSETENV])
2321])
2322
2323AC_DEFUN(AC_CHECK_GETDOMAINNAME,
2324[
2325	KDE_CHECK_FUNC_EXT(getdomainname, [
2326#include <stdlib.h>
2327#include <unistd.h>
2328],
2329		[
2330char buffer[200];
2331getdomainname(buffer, 200);
2332],
2333	        [int getdomainname (char *, unsigned int)],
2334		[GETDOMAINNAME])
2335])
2336
2337AC_DEFUN(AC_CHECK_GETHOSTNAME,
2338[
2339	KDE_CHECK_FUNC_EXT(gethostname, [
2340#include <stdlib.h>
2341#include <unistd.h>
2342],
2343		[
2344char buffer[200];
2345gethostname(buffer, 200);
2346],
2347	        [int gethostname (char *, unsigned int)],
2348		[GETHOSTNAME])
2349])
2350
2351AC_DEFUN(AC_CHECK_USLEEP,
2352[
2353	KDE_CHECK_FUNC_EXT(usleep, [
2354#include <unistd.h>
2355],
2356		[
2357usleep(200);
2358],
2359	        [int usleep (unsigned int)],
2360		[USLEEP])
2361])
2362
2363
2364AC_DEFUN(AC_CHECK_RANDOM,
2365[
2366	KDE_CHECK_FUNC_EXT(random, [
2367#include <stdlib.h>
2368],
2369		[
2370random();
2371],
2372	        [long int random(void)],
2373		[RANDOM])
2374
2375	KDE_CHECK_FUNC_EXT(srandom, [
2376#include <stdlib.h>
2377],
2378		[
2379srandom(27);
2380],
2381	        [void srandom(unsigned int)],
2382		[SRANDOM])
2383
2384])
2385
2386AC_DEFUN(AC_CHECK_INITGROUPS,
2387[
2388	KDE_CHECK_FUNC_EXT(initgroups, [
2389#include <sys/types.h>
2390#include <unistd.h>
2391#include <grp.h>
2392],
2393	[
2394char buffer[200];
2395initgroups(buffer, 27);
2396],
2397	[int initgroups(const char *, gid_t)],
2398	[INITGROUPS])
2399])
2400
2401AC_DEFUN(AC_CHECK_MKSTEMP,
2402[
2403	KDE_CHECK_FUNC_EXT(mkstemp, [
2404#include <stdlib.h>
2405],
2406	[
2407mkstemp("/tmp/aaaXXXXXX");
2408],
2409	[int mkstemp(char *)],
2410	[MKSTEMP])
2411])
2412
2413AC_DEFUN(AC_CHECK_MKSTEMPS,
2414[
2415	KDE_CHECK_FUNC_EXT(mkstemps, [
2416#include <stdlib.h>
2417#include <unistd.h>
2418],
2419	[
2420mkstemps("/tmp/aaaXXXXXX", 6);
2421],
2422	[int mkstemps(char *, int)],
2423	[MKSTEMPS])
2424])
2425
2426AC_DEFUN(AC_CHECK_RES_INIT,
2427[
2428  AC_MSG_CHECKING([if res_init needs -lresolv])
2429  kde_libs_safe="$LIBS"
2430  LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
2431  AC_TRY_LINK(
2432    [
2433#include <sys/types.h>
2434#include <netinet/in.h>
2435#include <arpa/nameser.h>
2436#include <resolv.h>
2437    ],
2438    [
2439      res_init();
2440    ],
2441    [
2442      LIBRESOLV="-lresolv"
2443      AC_MSG_RESULT(yes)
2444      AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2445    ],
2446    [ AC_MSG_RESULT(no) ]
2447  )
2448  LIBS=$kde_libs_safe
2449  AC_SUBST(LIBRESOLV)
2450
2451  AC_MSG_CHECKING([if res_init is available])
2452  AC_TRY_COMPILE(
2453    [
2454#include <sys/types.h>
2455#include <netinet/in.h>
2456#include <arpa/nameser.h>
2457#include <resolv.h>
2458    ],
2459    [
2460      res_init();
2461    ],
2462    [
2463      AC_MSG_RESULT(yes)
2464      AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2465    ],
2466    [ AC_MSG_RESULT(no) ]
2467  )
2468])
2469
2470AC_DEFUN(AC_CHECK_STRLCPY,
2471[
2472	KDE_CHECK_FUNC_EXT(strlcpy, [
2473#include <string.h>
2474],
2475[ char buf[20];
2476  strlcpy(buf, "KDE function test", sizeof(buf));
2477],
2478 	[unsigned long strlcpy(char*, const char*, unsigned long)],
2479	[STRLCPY])
2480])
2481
2482AC_DEFUN(AC_CHECK_STRLCAT,
2483[
2484	KDE_CHECK_FUNC_EXT(strlcat, [
2485#include <string.h>
2486],
2487[ char buf[20];
2488  buf[0]='\0';
2489  strlcat(buf, "KDE function test", sizeof(buf));
2490],
2491 	[unsigned long strlcat(char*, const char*, unsigned long)],
2492	[STRLCAT])
2493])
2494
2495AC_DEFUN(AC_FIND_GIF,
2496   [AC_MSG_CHECKING([for giflib])
2497AC_CACHE_VAL(ac_cv_lib_gif,
2498[ac_save_LIBS="$LIBS"
2499if test "x$kde_use_qt_emb" != "xyes"; then
2500LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
2501else
2502LIBS="$all_libraries -lgif"
2503fi
2504AC_TRY_LINK(dnl
2505[
2506#ifdef __cplusplus
2507extern "C" {
2508#endif
2509int GifLastError(void);
2510#ifdef __cplusplus
2511}
2512#endif
2513/* We use char because int might match the return type of a gcc2
2514    builtin and then its argument prototype would still apply.  */
2515],
2516            [return GifLastError();],
2517            eval "ac_cv_lib_gif=yes",
2518            eval "ac_cv_lib_gif=no")
2519LIBS="$ac_save_LIBS"
2520])dnl
2521if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
2522  AC_MSG_RESULT(yes)
2523  AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
2524else
2525  AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
2526fi
2527])
2528
2529AC_DEFUN(KDE_FIND_JPEG_HELPER,
2530[
2531AC_MSG_CHECKING([for libjpeg$2])
2532AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
2533[
2534AC_LANG_C
2535ac_save_LIBS="$LIBS"
2536LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
2537ac_save_CFLAGS="$CFLAGS"
2538CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2539AC_TRY_LINK(
2540[/* Override any gcc2 internal prototype to avoid an error.  */
2541struct jpeg_decompress_struct;
2542typedef struct jpeg_decompress_struct * j_decompress_ptr;
2543typedef int size_t;
2544#ifdef __cplusplus
2545extern "C" {
2546#endif
2547    void jpeg_CreateDecompress(j_decompress_ptr cinfo,
2548                                    int version, size_t structsize);
2549#ifdef __cplusplus
2550}
2551#endif
2552/* We use char because int might match the return type of a gcc2
2553    builtin and then its argument prototype would still apply.  */
2554],
2555            [jpeg_CreateDecompress(0L, 0, 0);],
2556            eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
2557            eval "ac_cv_lib_jpeg_$1=no")
2558LIBS="$ac_save_LIBS"
2559CFLAGS="$ac_save_CFLAGS"
2560])
2561
2562if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
2563  LIBJPEG="$ac_cv_lib_jpeg_$1"
2564  AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
2565else
2566  AC_MSG_RESULT(no)
2567  $3
2568fi
2569
2570])
2571
2572AC_DEFUN(AC_FIND_JPEG,
2573[
2574dnl first look for libraries
2575KDE_FIND_JPEG_HELPER(6b, 6b,
2576   KDE_FIND_JPEG_HELPER(normal, [],
2577    [
2578       LIBJPEG=
2579    ]
2580   )
2581)
2582
2583dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
2584dnl requires system dependent includes loaded before it)
2585jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
2586AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
2587test "x$jpeg_incdir" = xNO && jpeg_incdir=
2588
2589dnl if headers _and_ libraries are missing, this is no error, and we
2590dnl continue with a warning (the user will get no jpeg support in khtml)
2591dnl if only one is missing, it means a configuration error, but we still
2592dnl only warn
2593if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
2594  AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
2595else
2596  if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
2597    AC_MSG_WARN([
2598There is an installation error in jpeg support. You seem to have only one
2599of either the headers _or_ the libraries installed. You may need to either
2600provide correct --with-extra-... options, or the development package of
2601libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
2602Disabling JPEG support.
2603])
2604  else
2605    AC_MSG_WARN([libjpeg not found. disable JPEG support.])
2606  fi
2607  jpeg_incdir=
2608  LIBJPEG=
2609fi
2610
2611AC_SUBST(LIBJPEG)
2612AH_VERBATIM(_AC_CHECK_JPEG,
2613[/*
2614 * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
2615 * headers and I'm too lazy to write a configure test as long as only
2616 * unixware is related
2617 */
2618#ifdef _UNIXWARE
2619#define HAVE_BOOLEAN
2620#endif
2621])
2622])
2623
2624AC_DEFUN(KDE_CHECK_QT_JPEG,
2625[
2626AC_MSG_CHECKING([if Qt needs $LIBJPEG])
2627AC_CACHE_VAL(kde_cv_qt_jpeg,
2628[
2629AC_LANG_SAVE
2630AC_LANG_CPLUSPLUS
2631ac_save_LIBS="$LIBS"
2632LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
2633LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
2634ac_save_CXXFLAGS="$CXXFLAGS"
2635CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2636AC_TRY_LINK(
2637[#include <qapplication.h>],
2638            [
2639            int argc;
2640            char** argv;
2641            QApplication app(argc, argv);],
2642            eval "kde_cv_qt_jpeg=no",
2643            eval "kde_cv_qt_jpeg=yes")
2644LIBS="$ac_save_LIBS"
2645CXXFLAGS="$ac_save_CXXFLAGS"
2646AC_LANG_RESTORE
2647])
2648
2649if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
2650  AC_MSG_RESULT(yes)
2651  LIBJPEG_QT='$(LIBJPEG)'
2652else
2653  AC_MSG_RESULT(no)
2654  LIBJPEG_QT=
2655fi
2656
2657])
2658
2659AC_DEFUN(AC_FIND_ZLIB,
2660[
2661AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2662AC_MSG_CHECKING([for libz])
2663AC_CACHE_VAL(ac_cv_lib_z,
2664[
2665AC_LANG_C
2666kde_save_LIBS="$LIBS"
2667LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
2668kde_save_CFLAGS="$CFLAGS"
2669CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2670AC_TRY_LINK(dnl
2671[
2672#include<zlib.h>
2673],
2674            [return (zlibVersion() == ZLIB_VERSION); ],
2675            eval "ac_cv_lib_z='-lz'",
2676            eval "ac_cv_lib_z=no")
2677LIBS="$kde_save_LIBS"
2678CFLAGS="$kde_save_CFLAGS"
2679])dnl
2680if test ! "$ac_cv_lib_z" = no; then
2681  AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
2682  LIBZ="$ac_cv_lib_z"
2683  AC_SUBST(LIBZ)
2684  AC_MSG_RESULT($ac_cv_lib_z)
2685else
2686  AC_MSG_ERROR(not found. Check your installation and look into config.log)
2687  LIBZ=""
2688  AC_SUBST(LIBZ)
2689fi
2690])
2691
2692AC_DEFUN(KDE_TRY_TIFFLIB,
2693[
2694AC_MSG_CHECKING([for libtiff $1])
2695
2696AC_CACHE_VAL(kde_cv_libtiff_$1,
2697[
2698AC_LANG_SAVE
2699AC_LANG_CPLUSPLUS
2700kde_save_LIBS="$LIBS"
2701if test "x$kde_use_qt_emb" != "xyes"; then
2702LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
2703else
2704LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
2705fi
2706kde_save_CXXFLAGS="$CXXFLAGS"
2707CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2708
2709AC_TRY_LINK(dnl
2710[
2711#include<tiffio.h>
2712],
2713    [return (TIFFOpen( "", "r") == 0); ],
2714[
2715    kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
2716], [
2717    kde_cv_libtiff_$1=no
2718])
2719
2720LIBS="$kde_save_LIBS"
2721CXXFLAGS="$kde_save_CXXFLAGS"
2722AC_LANG_RESTORE
2723])
2724
2725if test "$kde_cv_libtiff_$1" = "no"; then
2726    AC_MSG_RESULT(no)
2727    LIBTIFF=""
2728    $3
2729else
2730    LIBTIFF="$kde_cv_libtiff_$1"
2731    AC_MSG_RESULT(yes)
2732    AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
2733    $2
2734fi
2735
2736])
2737
2738AC_DEFUN(AC_FIND_TIFF,
2739[
2740AC_REQUIRE([K_PATH_X])
2741AC_REQUIRE([AC_FIND_ZLIB])
2742AC_REQUIRE([AC_FIND_JPEG])
2743AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2744
2745KDE_TRY_TIFFLIB(tiff, [],
2746   KDE_TRY_TIFFLIB(tiff34))
2747
2748AC_SUBST(LIBTIFF)
2749])
2750
2751
2752AC_DEFUN(AC_FIND_PNG,
2753[
2754AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2755AC_REQUIRE([AC_FIND_ZLIB])
2756AC_MSG_CHECKING([for libpng])
2757AC_CACHE_VAL(ac_cv_lib_png,
2758[
2759kde_save_LIBS="$LIBS"
2760if test "x$kde_use_qt_emb" != "xyes"; then
2761LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
2762else
2763LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
2764fi
2765kde_save_CFLAGS="$CFLAGS"
2766CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2767AC_LANG_C
2768AC_TRY_LINK(dnl
2769    [
2770    #include<png.h>
2771    ],
2772    [
2773    png_structp png_ptr = png_create_read_struct(  /* image ptr */
2774		PNG_LIBPNG_VER_STRING, 0, 0, 0 );
2775    return( png_ptr != 0 );
2776    ],
2777    eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
2778    eval "ac_cv_lib_png=no"
2779)
2780LIBS="$kde_save_LIBS"
2781CFLAGS="$kde_save_CFLAGS"
2782])dnl
2783if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
2784  AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
2785  LIBPNG="$ac_cv_lib_png"
2786  AC_SUBST(LIBPNG)
2787  AC_MSG_RESULT($ac_cv_lib_png)
2788else
2789  AC_MSG_RESULT(no)
2790  LIBPNG=""
2791  AC_SUBST(LIBPNG)
2792fi
2793])
2794
2795AC_DEFUN(AC_CHECK_BOOL,
2796[
2797  AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
2798])
2799
2800AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
2801[
2802AC_MSG_CHECKING(if you need GNU extensions)
2803AC_CACHE_VAL(ac_cv_gnu_extensions,
2804[
2805cat > conftest.c << EOF
2806#include <features.h>
2807
2808#ifdef __GNU_LIBRARY__
2809yes
2810#endif
2811EOF
2812
2813if (eval "$ac_cpp conftest.c") 2>&5 |
2814  egrep "yes" >/dev/null 2>&1; then
2815  rm -rf conftest*
2816  ac_cv_gnu_extensions=yes
2817else
2818  ac_cv_gnu_extensions=no
2819fi
2820])
2821
2822AC_MSG_RESULT($ac_cv_gnu_extensions)
2823if test "$ac_cv_gnu_extensions" = "yes"; then
2824  AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
2825fi
2826])
2827
2828AC_DEFUN(KDE_CHECK_COMPILER_FLAG,
2829[
2830AC_MSG_CHECKING(whether $CXX supports -$1)
2831kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
2832AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
2833[
2834  AC_LANG_SAVE
2835  AC_LANG_CPLUSPLUS
2836  save_CXXFLAGS="$CXXFLAGS"
2837  CXXFLAGS="$CXXFLAGS -$1"
2838  AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
2839  CXXFLAGS="$save_CXXFLAGS"
2840  AC_LANG_RESTORE
2841])
2842if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
2843 AC_MSG_RESULT(yes)
2844 :
2845 $2
2846else
2847 AC_MSG_RESULT(no)
2848 :
2849 $3
2850fi
2851])
2852
2853dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
2854dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
2855dnl it's all white-space separated
2856AC_DEFUN(AC_REMOVE_FORBIDDEN,
2857[ __val=$$1
2858  __forbid=" $2 "
2859  if test -n "$__val"; then
2860    __new=""
2861    ac_save_IFS=$IFS
2862    IFS=" 	"
2863    for i in $__val; do
2864      case "$__forbid" in
2865        *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
2866	*) # Careful to not add spaces, where there were none, because otherwise
2867	   # libtool gets confused, if we change e.g. CXX
2868	   if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
2869      esac
2870    done
2871    IFS=$ac_save_IFS
2872    $1=$__new
2873  fi
2874])
2875
2876dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
2877AC_DEFUN(AC_VALIDIFY_CXXFLAGS,
2878[dnl
2879if test "x$kde_use_qt_emb" != "xyes"; then
2880 AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
2881 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
2882else
2883 AC_REMOVE_FORBIDDEN(CXX, [-rpath])
2884 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
2885fi
2886])
2887
2888AC_DEFUN(AC_CHECK_COMPILERS,
2889[
2890  AC_ARG_ENABLE(debug,[  --enable-debug[=ARG]    enables debug symbols (yes|no|full) [default=no]],
2891  [
2892    case $enableval in
2893      yes)
2894        kde_use_debug_code="yes"
2895        kde_use_debug_define=no
2896        ;;
2897      full)
2898        kde_use_debug_code="full"
2899        kde_use_debug_define=no
2900        ;;
2901      *)
2902        kde_use_debug_code="no"
2903        kde_use_debug_define=yes
2904        ;;
2905    esac
2906  ],
2907    [kde_use_debug_code="no"
2908      kde_use_debug_define=no
2909  ])
2910
2911  dnl Just for configure --help
2912  AC_ARG_ENABLE(dummyoption,[  --disable-debug         disables debug output and debug symbols [default=no]],[],[])
2913
2914  AC_ARG_ENABLE(strict,[  --enable-strict         compiles with strict compiler options (may not work!)],
2915   [
2916    if test $enableval = "no"; then
2917         kde_use_strict_options="no"
2918       else
2919         kde_use_strict_options="yes"
2920    fi
2921   ], [kde_use_strict_options="no"])
2922
2923  AC_ARG_ENABLE(warnings,[  --disable-warnings      disables compilation with -Wall and similiar],
2924   [
2925    if test $enableval = "no"; then
2926         kde_use_warnings="no"
2927       else
2928         kde_use_warnings="yes"
2929    fi
2930   ], [kde_use_warnings="yes"])
2931
2932  dnl enable warnings for debug build
2933  if test "$kde_use_debug_code" != "no"; then
2934    kde_use_warnings=yes
2935  fi
2936
2937  AC_ARG_ENABLE(profile,[  --enable-profile        creates profiling infos [default=no]],
2938    [kde_use_profiling=$enableval],
2939    [kde_use_profiling="no"]
2940  )
2941
2942  dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
2943  CFLAGS=" $CFLAGS"
2944
2945  AC_PROG_CC
2946
2947  AC_PROG_CPP
2948
2949  if test "$GCC" = "yes"; then
2950    if test "$kde_use_debug_code" != "no"; then
2951      if test $kde_use_debug_code = "full"; then
2952        CFLAGS="-g3 $CFLAGS"
2953      else
2954        CFLAGS="-g -O2 $CFLAGS"
2955      fi
2956    else
2957      CFLAGS="-O2 $CFLAGS"
2958    fi
2959  fi
2960
2961  if test "$kde_use_debug_define" = "yes"; then
2962    CFLAGS="-DNDEBUG $CFLAGS"
2963  fi
2964
2965
2966  case "$host" in
2967  *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
2968  *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
2969  esac
2970
2971  if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
2972     LDFLAGS=""
2973  fi
2974
2975  CXXFLAGS=" $CXXFLAGS"
2976
2977  AC_PROG_CXX
2978
2979  if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
2980    if test "$kde_use_debug_code" != "no"; then
2981      if test "$CXX" = "KCC"; then
2982        CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
2983      else
2984        if test "$kde_use_debug_code" = "full"; then
2985          CXXFLAGS="-g3 $CXXFLAGS"
2986        else
2987          CXXFLAGS="-g -O2 $CXXFLAGS"
2988        fi
2989      fi
2990      KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
2991
2992      dnl convenience compiler flags
2993      KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
2994      AC_SUBST(WOVERLOADED_VIRTUAL)
2995    else
2996      if test "$CXX" = "KCC"; then
2997        CXXFLAGS="+K3 $CXXFLAGS"
2998      else
2999        CXXFLAGS="-O2 $CXXFLAGS"
3000      fi
3001    fi
3002  fi
3003
3004  if test "$kde_use_debug_define" = "yes"; then
3005    CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
3006  fi
3007
3008  if test "$kde_use_profiling" = "yes"; then
3009    KDE_CHECK_COMPILER_FLAG(pg,
3010    [
3011      CFLAGS="-pg $CFLAGS"
3012      CXXFLAGS="-pg $CXXFLAGS"
3013    ])
3014  fi
3015
3016  if test "$kde_use_warnings" = "yes"; then
3017      if test "$GCC" = "yes"; then
3018        case $host in
3019          *-*-linux-gnu)
3020            CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
3021            CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion $CXXFLAGS"
3022          ;;
3023        esac
3024        CXXFLAGS="-Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
3025        KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
3026        KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
3027        KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
3028     fi
3029  fi
3030
3031  if test "$GCC" = "yes" && test "$kde_use_strict_options" = "yes"; then
3032    CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
3033  fi
3034
3035  if test "$GXX" = "yes"; then
3036    KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
3037    KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
3038    KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS=	)
3039  fi
3040  if test "$CXX" = "KCC"; then
3041    dnl unfortunately we currently cannot disable exception support in KCC
3042    dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
3043    dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
3044    dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS=	)
3045
3046    AC_ARG_ENABLE(pch,[  --enable-pch            enables precompiled header support (currently only KCC) [default=no]],
3047    [
3048      kde_use_pch=$enableval
3049    ],[kde_use_pch=no])
3050
3051    if test "$kde_use_pch" = "yes"; then
3052      dnl TODO: support --pch-dir!
3053      KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
3054      dnl the below works (but the dir must exist), but it's
3055      dnl useless for a whole package.
3056      dnl The are precompiled headers for each source file, so when compiling
3057      dnl from scratch, it doesn't make a difference, and they take up
3058      dnl around ~5Mb _per_ sourcefile.
3059      dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
3060      dnl   [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
3061    fi
3062    dnl this flag controls inlining. by default KCC inlines in optimisation mode
3063    dnl all implementations that are defined inside the class {} declaration.
3064    dnl because of templates-compatibility with broken gcc compilers, this
3065    dnl can cause excessive inlining. This flag limits it to a sane level
3066    KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
3067    KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
3068    KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
3069    KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
3070    dnl Some source files are shared between multiple executables
3071    dnl (or libraries) and some of those need template instantiations.
3072    dnl In that case KCC needs to compile those sources with
3073    dnl --one_instantiation_per_object.  To make it easy for us we compile
3074    dnl _all_ objects with that flag (--one_per is a shorthand).
3075    KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
3076  fi
3077  AC_SUBST(USE_EXCEPTIONS)
3078  dnl obsolete macro - provided to keep things going
3079  USE_RTTI=
3080  AC_SUBST(USE_RTTI)
3081
3082  case "$host" in
3083      *-*-irix*)  test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
3084      *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
3085      *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
3086      *-*-solaris*)
3087        if test "$GXX" = yes; then
3088          libstdcpp=`$CXX -print-file-name=libstdc++.so`
3089          if test ! -f $libstdcpp; then
3090             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])
3091          fi
3092        fi
3093        ;;
3094  esac
3095
3096  AC_VALIDIFY_CXXFLAGS
3097
3098  AC_PROG_CXXCPP
3099
3100  if test "$GCC" = yes; then
3101     NOOPT_CXXFLAGS=-O0
3102     NOOPT_CFLAGS=-O0
3103  fi
3104
3105  AC_SUBST(NOOPT_CXXFLAGS)
3106  AC_SUBST(NOOPT_CFLAGS)
3107
3108  KDE_CHECK_FINAL
3109
3110  ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
3111])
3112
3113AC_DEFUN(KDE_ADD_DEPENDENCIES,
3114[
3115   [A]M_DEPENDENCIES(CC)
3116   [A]M_DEPENDENCIES(CXX)
3117])
3118
3119dnl just a wrapper to clean up configure.in
3120AC_DEFUN(KDE_PROG_LIBTOOL,
3121[
3122AC_REQUIRE([AC_CHECK_COMPILERS])
3123AC_REQUIRE([AC_ENABLE_SHARED])
3124AC_REQUIRE([AC_ENABLE_STATIC])
3125
3126AC_REQUIRE([AC_LIBTOOL_DLOPEN])
3127AC_REQUIRE([KDE_CHECK_LIB64])
3128
3129AC_LANG_SAVE
3130AC_LANG_C
3131AC_OBJEXT
3132AC_EXEEXT
3133AC_LANG_RESTORE
3134
3135AM_PROG_LIBTOOL
3136AC_LIBTOOL_CXX
3137
3138LIBTOOL_SHELL="/bin/sh ./libtool"
3139#  LIBTOOL="$LIBTOOL --silent"
3140KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
3141AC_SUBST(KDE_PLUGIN)
3142
3143AC_ARG_ENABLE(objprelink, [  --enable-objprelink     prelink apps using objprelink (obsolete)],
3144       kde_use_objprelink=$enableval, kde_use_objprelink=no)
3145  if test "x$kde_use_objprelink" = "xyes"; then
3146        AC_MSG_WARN([
3147------------------------------------------------------------
3148Configuration option --enable-objprelink is no longer useful.
3149See http:://objprelink.sourceforge.net for details:
31501- Recent binutils are fast enough to do without objprelink.
31512- Newer versions of objprelink do not need this option.
3152------------------------------------------------------------
3153])
3154  fi
3155])
3156
3157AC_DEFUN(KDE_CHECK_LIB64,
3158[
3159    kdelibsuff=none
3160    AC_ARG_ENABLE(libsuffix,
3161        AC_HELP_STRING([--enable-libsuffix],
3162            [/lib directory suffix (64,32,none)]),
3163            kdelibsuff=$enableval)
3164    if test "$kdelibsuff" = "none"; then
3165        if test -d /lib64 ; then
3166            kdelibsuff=64
3167        else
3168            kdelibsuff=
3169        fi
3170    fi
3171    if test -z "$kdelibsuff"; then
3172        AC_MSG_RESULT([not using lib directory suffix])
3173        AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
3174    else
3175        if test "$libdir" = '${exec_prefix}/lib'; then
3176            libdir="$libdir${kdelibsuff}"
3177            AC_SUBST([libdir], ["$libdir"])  dnl ugly hack for lib64 platforms
3178        fi
3179        AC_DEFINE_UNQUOTED(KDELIBSUFF, ["\"${kdelibsuff}\""], Suffix for lib directories)
3180        AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
3181    fi
3182])
3183
3184AC_DEFUN(KDE_CHECK_TYPES,
3185[  AC_CHECK_SIZEOF(int, 4)dnl
3186  AC_CHECK_SIZEOF(long, 4)dnl
3187  AC_CHECK_SIZEOF(char *, 4)dnl
3188  AC_CHECK_SIZEOF(char, 1)dnl
3189])dnl
3190
3191AC_DEFUN(KDE_DO_IT_ALL,
3192[
3193AC_CANONICAL_SYSTEM
3194AC_ARG_PROGRAM
3195AM_INIT_AUTOMAKE($1, $2)
3196AM_DISABLE_LIBRARIES
3197AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
3198AC_CHECK_COMPILERS
3199KDE_PROG_LIBTOOL
3200AM_KDE_WITH_NLS
3201AC_PATH_KDE
3202])
3203
3204AC_DEFUN(AC_CHECK_RPATH,
3205[
3206AC_MSG_CHECKING(for rpath)
3207AC_ARG_ENABLE(rpath,
3208      [  --disable-rpath         do not use the rpath feature of ld],
3209      USE_RPATH=$enableval, USE_RPATH=yes)
3210
3211if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
3212
3213  KDE_RPATH="-R \$(kde_libraries)"
3214
3215  if test -n "$qt_libraries"; then
3216    KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
3217  fi
3218  dnl $x_libraries is set to /usr/lib in case
3219  if test -n "$X_LDFLAGS"; then
3220    KDE_RPATH="$KDE_RPATH -R \$(x_libraries)"
3221  fi
3222  if test -n "$KDE_EXTRA_RPATH"; then
3223    KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
3224  fi
3225fi
3226AC_SUBST(KDE_EXTRA_RPATH)
3227AC_SUBST(KDE_RPATH)
3228AC_MSG_RESULT($USE_RPATH)
3229])
3230
3231dnl Check for the type of the third argument of getsockname
3232AC_DEFUN(AC_CHECK_SOCKLEN_T, [
3233  AC_MSG_CHECKING(for socklen_t)
3234  AC_CACHE_VAL(ac_cv_socklen_t, [
3235    AC_LANG_SAVE
3236    AC_LANG_CPLUSPLUS
3237    AC_TRY_COMPILE([
3238#include <sys/types.h>
3239#include <sys/socket.h>
3240      ],[
3241socklen_t a=0;
3242getsockname(0,(struct sockaddr*)0, &a);
3243      ],
3244      ac_cv_socklen_t=socklen_t,
3245      AC_TRY_COMPILE([
3246#include <sys/types.h>
3247#include <sys/socket.h>
3248        ],[
3249int a=0;
3250getsockname(0,(struct sockaddr*)0, &a);
3251        ],
3252        ac_cv_socklen_t=int,
3253        ac_cv_socklen_t=size_t
3254      )
3255    )
3256    AC_LANG_RESTORE
3257  ])
3258
3259  AC_MSG_RESULT($ac_cv_socklen_t)
3260  if test "$ac_cv_socklen_t" != "socklen_t"; then
3261    AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t,
3262        [Define the real type of socklen_t])
3263  fi
3264  AC_DEFINE_UNQUOTED(ksize_t, socklen_t, [Compatibility define])
3265
3266])
3267
3268dnl This is a merge of some macros out of the gettext aclocal.m4
3269dnl since we don't need anything, I took the things we need
3270dnl the copyright for them is:
3271dnl >
3272dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3273dnl This Makefile.in is free software; the Free Software Foundation
3274dnl gives unlimited permission to copy and/or distribute it,
3275dnl with or without modifications, as long as this notice is preserved.
3276
3277dnl This program is distributed in the hope that it will be useful,
3278dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
3279dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
3280dnl PARTICULAR PURPOSE.
3281dnl >
3282dnl for this file it is relicensed under LGPL
3283
3284AC_DEFUN(AM_KDE_WITH_NLS,
3285  [
3286    dnl If we use NLS figure out what method
3287
3288    AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
3289        [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
3290    AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
3291
3292     if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
3293        AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
3294        GMSGFMT=":"
3295      fi
3296      MSGFMT=$GMSGFMT
3297      AC_SUBST(GMSGFMT)
3298      AC_SUBST(MSGFMT)
3299
3300      AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
3301	[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
3302
3303      dnl Test whether we really found GNU xgettext.
3304      if test "$XGETTEXT" != ":"; then
3305	dnl If it is no GNU xgettext we define it as : so that the
3306	dnl Makefiles still can work.
3307	if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
3308	  : ;
3309	else
3310	  AC_MSG_RESULT(
3311	    [found xgettext programs is not GNU xgettext; ignore it])
3312	  XGETTEXT=":"
3313	fi
3314      fi
3315     AC_SUBST(XGETTEXT)
3316
3317  ])
3318
3319# Search path for a program which passes the given test.
3320# Ulrich Drepper <drepper@cygnus.com>, 1996.
3321
3322# serial 1
3323# Stephan Kulow: I appended a _KDE against name conflicts
3324
3325dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
3326dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3327AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
3328[# Extract the first word of "$2", so it can be a program name with args.
3329set dummy $2; ac_word=[$]2
3330AC_MSG_CHECKING([for $ac_word])
3331AC_CACHE_VAL(ac_cv_path_$1,
3332[case "[$]$1" in
3333  /*)
3334  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3335  ;;
3336  *)
3337  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3338  for ac_dir in ifelse([$5], , $PATH, [$5]); do
3339    test -z "$ac_dir" && ac_dir=.
3340    if test -f $ac_dir/$ac_word; then
3341      if [$3]; then
3342	ac_cv_path_$1="$ac_dir/$ac_word"
3343	break
3344      fi
3345    fi
3346  done
3347  IFS="$ac_save_ifs"
3348dnl If no 4th arg is given, leave the cache variable unset,
3349dnl so AC_PATH_PROGS will keep looking.
3350ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3351])dnl
3352  ;;
3353esac])dnl
3354$1="$ac_cv_path_$1"
3355if test -n "[$]$1"; then
3356  AC_MSG_RESULT([$]$1)
3357else
3358  AC_MSG_RESULT(no)
3359fi
3360AC_SUBST($1)dnl
3361])
3362
3363
3364# Check whether LC_MESSAGES is available in <locale.h>.
3365# Ulrich Drepper <drepper@cygnus.com>, 1995.
3366
3367# serial 1
3368
3369AC_DEFUN(AM_LC_MESSAGES,
3370  [if test $ac_cv_header_locale_h = yes; then
3371    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
3372      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
3373       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
3374    if test $am_cv_val_LC_MESSAGES = yes; then
3375      AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
3376    fi
3377  fi])
3378
3379dnl From Jim Meyering.
3380dnl FIXME: migrate into libit.
3381
3382AC_DEFUN([AM_FUNC_OBSTACK],
3383[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
3384 [AC_TRY_LINK([#include "obstack.h"],
3385	      [struct obstack *mem;obstack_free(mem,(char *) 0)],
3386	      am_cv_func_obstack=yes,
3387	      am_cv_func_obstack=no)])
3388 if test $am_cv_func_obstack = yes; then
3389   AC_DEFINE(HAVE_OBSTACK)
3390 else
3391   LIBOBJS="$LIBOBJS obstack.o"
3392 fi
3393])
3394
3395dnl From Jim Meyering.  Use this if you use the GNU error.[ch].
3396dnl FIXME: Migrate into libit
3397
3398AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
3399[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
3400 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
3401              am_cv_lib_error_at_line=yes,
3402	      am_cv_lib_error_at_line=no)])
3403 if test $am_cv_lib_error_at_line = no; then
3404   LIBOBJS="$LIBOBJS error.o"
3405 fi
3406 AC_SUBST(LIBOBJS)dnl
3407])
3408
3409# Macro to add for using GNU gettext.
3410# Ulrich Drepper <drepper@cygnus.com>, 1995.
3411
3412# serial 1
3413# Stephan Kulow: I put a KDE in it to avoid name conflicts
3414
3415AC_DEFUN(AM_KDE_GNU_GETTEXT,
3416  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3417   AC_REQUIRE([AC_PROG_RANLIB])dnl
3418   AC_REQUIRE([AC_HEADER_STDC])dnl
3419   AC_REQUIRE([AC_TYPE_OFF_T])dnl
3420   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
3421   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
3422   AC_REQUIRE([AC_FUNC_MMAP])dnl
3423   AC_REQUIRE([AM_KDE_WITH_NLS])dnl
3424   AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
3425   AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
3426__argz_count __argz_stringify __argz_next])
3427
3428   AC_MSG_CHECKING(for stpcpy)
3429   AC_CACHE_VAL(kde_cv_func_stpcpy,
3430   [
3431   kde_safe_cxxflags=$CXXFLAGS
3432   CXXFLAGS="-Wmissing-prototypes -Werror"
3433   AC_LANG_SAVE
3434   AC_LANG_CPLUSPLUS
3435   AC_TRY_COMPILE([
3436   #include <string.h>
3437   ],
3438   [
3439   char buffer[200];
3440   stpcpy(buffer, buffer);
3441   ],
3442   kde_cv_func_stpcpy=yes,
3443   kde_cv_func_stpcpy=no)
3444   AC_LANG_RESTORE
3445   CXXFLAGS=$kde_safe_cxxflags
3446   ])
3447   AC_MSG_RESULT($kde_cv_func_stpcpy)
3448   if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
3449     AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
3450   fi
3451
3452   AM_LC_MESSAGES
3453
3454   if test "x$CATOBJEXT" != "x"; then
3455     if test "x$ALL_LINGUAS" = "x"; then
3456       LINGUAS=
3457     else
3458       AC_MSG_CHECKING(for catalogs to be installed)
3459       NEW_LINGUAS=
3460       for lang in ${LINGUAS=$ALL_LINGUAS}; do
3461         case "$ALL_LINGUAS" in
3462          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
3463         esac
3464       done
3465       LINGUAS=$NEW_LINGUAS
3466       AC_MSG_RESULT($LINGUAS)
3467     fi
3468
3469     dnl Construct list of names of catalog files to be constructed.
3470     if test -n "$LINGUAS"; then
3471       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
3472     fi
3473   fi
3474
3475  ])
3476
3477AC_DEFUN(AC_HAVE_XPM,
3478 [AC_REQUIRE_CPP()dnl
3479  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3480
3481 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
3482 test -z "$XPM_INCLUDE" && XPM_INCLUDE=
3483
3484 AC_ARG_WITH(xpm, [  --without-xpm           disable color pixmap XPM tests],
3485	xpm_test=$withval, xpm_test="yes")
3486 if test "x$xpm_test" = xno; then
3487   ac_cv_have_xpm=no
3488 else
3489   AC_MSG_CHECKING(for XPM)
3490   AC_CACHE_VAL(ac_cv_have_xpm,
3491   [
3492    AC_LANG_C
3493    ac_save_ldflags="$LDFLAGS"
3494    ac_save_cflags="$CFLAGS"
3495    if test "x$kde_use_qt_emb" != "xyes"; then
3496      LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
3497    else
3498      LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
3499    fi
3500    CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
3501    test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
3502    AC_TRY_LINK([#include <X11/xpm.h>],[],
3503	ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
3504    LDFLAGS="$ac_save_ldflags"
3505    CFLAGS="$ac_save_cflags"
3506   ])dnl
3507
3508  if test "$ac_cv_have_xpm" = no; then
3509    AC_MSG_RESULT(no)
3510    XPM_LDFLAGS=""
3511    XPMINC=""
3512    $2
3513  else
3514    AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
3515    if test "$XPM_LDFLAGS" = ""; then
3516       XPMLIB='-lXpm $(LIB_X11)'
3517    else
3518       XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
3519    fi
3520    if test "$XPM_INCLUDE" = ""; then
3521       XPMINC=""
3522    else
3523       XPMINC="-I$XPM_INCLUDE"
3524    fi
3525    AC_MSG_RESULT(yes)
3526    $1
3527  fi
3528 fi
3529 AC_SUBST(XPMINC)
3530 AC_SUBST(XPMLIB)
3531])
3532
3533AC_DEFUN(AC_HAVE_DPMS,
3534 [AC_REQUIRE_CPP()dnl
3535  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3536
3537 test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
3538 test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
3539 DPMS_LIB=
3540
3541 AC_ARG_WITH(dpms, [  --without-dpms          disable DPMS power saving],
3542	dpms_test=$withval, dpms_test="yes")
3543 if test "x$dpms_test" = xno; then
3544   ac_cv_have_dpms=no
3545 else
3546   AC_MSG_CHECKING(for DPMS)
3547   dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
3548   dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
3549   AC_CACHE_VAL(ac_cv_have_dpms,
3550   [
3551    if test "x$kde_use_qt_emb" = "xyes"; then
3552      AC_MSG_RESULT(no)
3553      ac_cv_have_dpms="no"
3554    else
3555      AC_LANG_C
3556      ac_save_ldflags="$LDFLAGS"
3557      ac_save_cflags="$CFLAGS"
3558      ac_save_libs="$LIBS"
3559      LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
3560      CFLAGS="$CFLAGS $X_INCLUDES"
3561      test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3562      AC_TRY_LINK([
3563	  #include <X11/Xproto.h>
3564	  #include <X11/X.h>
3565	  #include <X11/Xlib.h>
3566	  #include <X11/extensions/dpms.h>
3567	  int foo_test_dpms()
3568	  { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3569	  ac_cv_have_dpms="yes", [
3570              LDFLAGS="$ac_save_ldflags"
3571              CFLAGS="$ac_save_cflags"
3572              LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
3573              LIBS="$LIBS -lXdpms"
3574              CFLAGS="$CFLAGS $X_INCLUDES"
3575              test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3576              AC_TRY_LINK([
3577	          #include <X11/Xproto.h>
3578        	  #include <X11/X.h>
3579        	  #include <X11/Xlib.h>
3580        	  #include <X11/extensions/dpms.h>
3581        	  int foo_test_dpms()
3582        	  { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3583        	  [
3584                  ac_cv_have_dpms="-lXdpms"
3585                  ],ac_cv_have_dpms="no")
3586              ])
3587      LDFLAGS="$ac_save_ldflags"
3588      CFLAGS="$ac_save_cflags"
3589      LIBS="$ac_save_libs"
3590    fi
3591   ])dnl
3592
3593  if test "$ac_cv_have_dpms" = no; then
3594    AC_MSG_RESULT(no)
3595    DPMS_LDFLAGS=""
3596    DPMSINC=""
3597    $2
3598  else
3599    AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
3600    if test "$ac_cv_have_dpms" = "-lXdpms"; then
3601       DPMS_LIB="-lXdpms"
3602    fi
3603    if test "$DPMS_LDFLAGS" = ""; then
3604       DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
3605    else
3606       DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
3607    fi
3608    if test "$DPMS_INCLUDE" = ""; then
3609       DPMSINC=""
3610    else
3611       DPMSINC="-I$DPMS_INCLUDE"
3612    fi
3613    AC_MSG_RESULT(yes)
3614    $1
3615  fi
3616 fi
3617 AC_SUBST(DPMSINC)
3618 AC_SUBST(DPMSLIB)
3619])
3620
3621AC_DEFUN(AC_HAVE_GL,
3622 [AC_REQUIRE_CPP()dnl
3623  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3624
3625 test -z "$GL_LDFLAGS" && GL_LDFLAGS=
3626 test -z "$GL_INCLUDE" && GL_INCLUDE=
3627
3628 AC_ARG_WITH(gl, [  --without-gl            disable 3D GL modes],
3629	gl_test=$withval, gl_test="yes")
3630 if test "x$kde_use_qt_emb" = "xyes"; then
3631   # GL and Qt Embedded is a no-go for now.
3632   ac_cv_have_gl=no
3633 elif test "x$gl_test" = xno; then
3634   ac_cv_have_gl=no
3635 else
3636   AC_MSG_CHECKING(for GL)
3637   AC_CACHE_VAL(ac_cv_have_gl,
3638   [
3639    AC_LANG_SAVE
3640    AC_LANG_CPLUSPLUS
3641    ac_save_ldflags="$LDFLAGS"
3642    ac_save_cxxflags="$CXXFLAGS"
3643    LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU"
3644    test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3645    LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3646    CXXFLAGS="$CFLAGS $X_INCLUDES"
3647    test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3648    AC_TRY_LINK([#include <GL/gl.h>
3649#include <GL/glu.h>
3650], [],
3651	ac_cv_have_gl="mesa", ac_cv_have_gl="no")
3652    if test "x$ac_cv_have_gl" = "xno"; then
3653      LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGLU -lGL"
3654      test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3655      LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3656      CXXFLAGS="$ac_save_cflags $X_INCLUDES"
3657      test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3658      AC_TRY_LINK([#include <GL/gl.h>
3659#include <GL/glu.h>
3660], [],
3661	  ac_cv_have_gl="yes", ac_cv_have_gl="no")
3662    fi
3663    AC_LANG_RESTORE
3664    LDFLAGS="$ac_save_ldflags"
3665    CXXFLAGS="$ac_save_cxxflags"
3666   ])dnl
3667
3668  if test "$ac_cv_have_gl" = "no"; then
3669    AC_MSG_RESULT(no)
3670    GL_LDFLAGS=""
3671    GLINC=""
3672    $2
3673  else
3674    AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
3675    if test "$GL_LDFLAGS" = ""; then
3676       if test "$ac_cv_have_gl" = "mesa"; then
3677          GLLIB='-lMesaGLU -lMesaGL $(LIB_X11)'
3678       else
3679          GLLIB='-lGLU -lGL $(LIB_X11)'
3680       fi
3681    else
3682       if test "$ac_cv_have_gl" = "mesa"; then
3683          GLLIB="$GL_LDFLAGS -lMesaGLU -lMesaGL "'$(LIB_X11)'
3684       else
3685          GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
3686       fi
3687    fi
3688    if test "$GL_INCLUDE" = ""; then
3689       GLINC=""
3690    else
3691       GLINC="-I$GL_INCLUDE"
3692    fi
3693    AC_MSG_RESULT($ac_cv_have_gl)
3694    $1
3695  fi
3696 fi
3697 AC_SUBST(GLINC)
3698 AC_SUBST(GLLIB)
3699])
3700
3701
3702 dnl shadow password and PAM magic - maintained by ossi@kde.org
3703
3704AC_DEFUN(KDE_PAM, [
3705  AC_REQUIRE([KDE_CHECK_LIBDL])
3706
3707  AC_ARG_WITH(pam,
3708    [  --with-pam[=ARG]        enable support for PAM: ARG=[yes|no|service name]],
3709    [ if test "x$withval" = "xyes"; then
3710        use_pam=yes
3711        pam_service=kde
3712      elif test "x$withval" = "xno"; then
3713        use_pam=no
3714      else
3715        use_pam=yes
3716        pam_service=$withval
3717      fi
3718      ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
3719    ], [
3720      AC_CACHE_VAL(ac_cv_path_pam,
3721        [ use_pam=no
3722          AC_CHECK_LIB(pam, pam_start,
3723            [ AC_CHECK_HEADER(security/pam_appl.h,
3724                [ use_pam=yes
3725                  pam_service=kde ])
3726            ], , $LIBDL)
3727          ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
3728        ])
3729    ])
3730  eval "$ac_cv_path_pam"
3731
3732  AC_MSG_CHECKING(for PAM)
3733  if test "x$use_pam" = xno; then
3734    AC_MSG_RESULT(no)
3735    PAMLIBS=""
3736  else
3737    AC_MSG_RESULT(yes)
3738    AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
3739    PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
3740
3741    dnl test whether struct pam_message is const (Linux) or not (Sun)
3742    AC_MSG_CHECKING(for const pam_message)
3743    AC_EGREP_HEADER([struct pam_message], security/pam_appl.h,
3744      [ AC_EGREP_HEADER([const struct pam_message], security/pam_appl.h,
3745                        [AC_MSG_RESULT([const: Linux-type PAM])],
3746                        [AC_MSG_RESULT([nonconst: Sun-type PAM])
3747                        AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
3748                        )],
3749      [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
3750  fi
3751
3752  AC_SUBST(PAMLIBS)
3753])
3754
3755dnl DEF_PAM_SERVICE(arg name, full name, define name)
3756AC_DEFUN(DEF_PAM_SERVICE, [
3757  AC_ARG_WITH($1-pam,
3758    [  --with-$1-pam=[val]    override PAM service from --with-pam for $2],
3759    [ if test "x$use_pam" = xyes; then
3760        $3_PAM_SERVICE="$withval"
3761      else
3762        AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
3763You may want to enforce it by using --with-pam.])
3764      fi
3765    ],
3766    [ if test "x$use_pam" = xyes; then
3767        $3_PAM_SERVICE="$pam_service"
3768      fi
3769    ])
3770    if test -n "$$3_PAM_SERVICE"; then
3771      AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
3772      AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
3773    fi
3774    AC_SUBST($3_PAM_SERVICE)
3775])
3776
3777AC_DEFUN(KDE_SHADOWPASSWD, [
3778  AC_REQUIRE([KDE_PAM])
3779
3780  AC_CHECK_LIB(shadow, getspent,
3781    [ LIBSHADOW="-lshadow"
3782      ac_use_shadow=yes
3783    ],
3784    [ dnl for UnixWare
3785      AC_CHECK_LIB(gen, getspent,
3786        [ LIBGEN="-lgen"
3787          ac_use_shadow=yes
3788        ],
3789        [ AC_CHECK_FUNC(getspent,
3790            [ ac_use_shadow=yes ],
3791            [ ac_use_shadow=no ])
3792	])
3793    ])
3794  AC_SUBST(LIBSHADOW)
3795  AC_SUBST(LIBGEN)
3796
3797  AC_MSG_CHECKING([for shadow passwords])
3798
3799  AC_ARG_WITH(shadow,
3800    [  --with-shadow		  If you want shadow password support ],
3801    [ if test "x$withval" != "xno"; then
3802        use_shadow=yes
3803      else
3804        use_shadow=no
3805      fi
3806    ], [
3807      use_shadow="$ac_use_shadow"
3808    ])
3809
3810  if test "x$use_shadow" = xyes; then
3811    AC_MSG_RESULT(yes)
3812    AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
3813  else
3814    AC_MSG_RESULT(no)
3815    LIBSHADOW=
3816    LIBGEN=
3817  fi
3818
3819  dnl finally make the relevant binaries setuid root, if we have shadow passwds.
3820  dnl this still applies, if we could use it indirectly through pam.
3821  if test "x$use_shadow" = xyes ||
3822     ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
3823      case $host in
3824      *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
3825	SETUIDFLAGS="-m 4755 -o root";;
3826      *)
3827	SETUIDFLAGS="-m 4755";;
3828      esac
3829  fi
3830  AC_SUBST(SETUIDFLAGS)
3831
3832])
3833
3834AC_DEFUN(KDE_PASSWDLIBS, [
3835  AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
3836  AC_REQUIRE([KDE_PAM])
3837  AC_REQUIRE([KDE_SHADOWPASSWD])
3838
3839  if test "x$use_pam" = "xyes"; then
3840    PASSWDLIBS="$PAMLIBS"
3841  else
3842    PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
3843  fi
3844
3845  dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
3846  dnl /etc/master.passwd holds the actual passwords.  /etc/master.passwd requires
3847  dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
3848  dnl may need to read /etc/master.passwd).
3849  case $host in
3850  *-*-freebsd*)
3851    SETUIDFLAGS="-m 4755 -o root"
3852    ;;
3853  *)
3854    ;;
3855  esac
3856
3857  AC_SUBST(PASSWDLIBS)
3858])
3859
3860AC_DEFUN(KDE_CHECK_LIBDL,
3861[
3862AC_CHECK_LIB(dl, dlopen, [
3863LIBDL="-ldl"
3864ac_cv_have_dlfcn=yes
3865])
3866
3867AC_CHECK_LIB(dld, shl_unload, [
3868LIBDL="-ldld"
3869ac_cv_have_shload=yes
3870])
3871
3872AC_SUBST(LIBDL)
3873])
3874
3875AC_DEFUN(KDE_CHECK_DLOPEN,
3876[
3877KDE_CHECK_LIBDL
3878AC_CHECK_HEADERS(dlfcn.h dl.h)
3879if test "$ac_cv_header_dlfcn_h" = "no"; then
3880  ac_cv_have_dlfcn=no
3881fi
3882
3883if test "$ac_cv_header_dl_h" = "no"; then
3884  ac_cv_have_shload=no
3885fi
3886
3887dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
3888dnl (MM)
3889AC_ARG_ENABLE(dlopen,
3890[  --disable-dlopen        link statically [default=no]] ,
3891enable_dlopen=$enableval,
3892enable_dlopen=yes)
3893
3894# override the user's opinion, if we know it better ;)
3895if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
3896  enable_dlopen=no
3897fi
3898
3899if test "$ac_cv_have_dlfcn" = "yes"; then
3900  AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
3901fi
3902
3903if test "$ac_cv_have_shload" = "yes"; then
3904  AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
3905fi
3906
3907if test "$enable_dlopen" = no ; then
3908  test -n "$1" && eval $1
3909else
3910  test -n "$2" && eval $2
3911fi
3912
3913])
3914
3915AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
3916[
3917KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
3918KDE_PROG_LIBTOOL
3919AC_MSG_CHECKING([dynamic loading])
3920eval "`egrep '^build_libtool_libs=' libtool`"
3921if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
3922  dynamic_loading=yes
3923  AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
3924else
3925  dynamic_loading=no
3926fi
3927AC_MSG_RESULT($dynamic_loading)
3928if test "$dynamic_loading" = "yes"; then
3929  $1
3930else
3931  $2
3932fi
3933])
3934
3935AC_DEFUN(KDE_ADD_INCLUDES,
3936[
3937if test -z "$1"; then
3938  test_include="Pix.h"
3939else
3940  test_include="$1"
3941fi
3942
3943AC_MSG_CHECKING([for libg++ ($test_include)])
3944
3945AC_CACHE_VAL(kde_cv_libgpp_includes,
3946[
3947kde_cv_libgpp_includes=no
3948
3949   for ac_dir in               \
3950                               \
3951     /usr/include/g++          \
3952     /usr/include              \
3953     /usr/unsupported/include  \
3954     /opt/include              \
3955     $extra_include            \
3956     ; \
3957   do
3958     if test -r "$ac_dir/$test_include"; then
3959       kde_cv_libgpp_includes=$ac_dir
3960       break
3961     fi
3962   done
3963])
3964
3965AC_MSG_RESULT($kde_cv_libgpp_includes)
3966if test "$kde_cv_libgpp_includes" != "no"; then
3967  all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
3968fi
3969])
3970])
3971
3972
3973AC_DEFUN(KDE_CHECK_MICO,
3974[
3975AC_REQUIRE([KDE_CHECK_LIBDL])
3976AC_REQUIRE([KDE_MISC_TESTS])
3977AC_MSG_CHECKING(for MICO)
3978
3979if test -z "$MICODIR"; then
3980    kde_micodir=/usr/local
3981 else
3982    kde_micodir="$MICODIR"
3983fi
3984
3985AC_ARG_WITH(micodir,
3986  [  --with-micodir=micodir  where mico is installed ],
3987  kde_micodir=$withval,
3988  kde_micodir=$kde_micodir
3989)
3990
3991AC_CACHE_VAL(kde_cv_mico_incdir,
3992[
3993  mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes"
3994AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir)
3995
3996])
3997kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'`
3998
3999if test ! -r  $kde_micodir/include/CORBA.h; then
4000  AC_MSG_ERROR([No CORBA.h found, specify another micodir])
4001fi
4002
4003AC_MSG_RESULT($kde_micodir)
4004
4005MICO_INCLUDES=-I$kde_micodir/include
4006AC_SUBST(MICO_INCLUDES)
4007MICO_LDFLAGS=-L$kde_micodir/lib
4008AC_SUBST(MICO_LDFLAGS)
4009micodir=$kde_micodir
4010AC_SUBST(micodir)
4011
4012AC_MSG_CHECKING([for MICO version])
4013AC_CACHE_VAL(kde_cv_mico_version,
4014[
4015AC_LANG_C
4016cat >conftest.$ac_ext <<EOF
4017#include <stdio.h>
4018#include <mico/version.h>
4019int main() {
4020
4021   printf("MICO_VERSION=%s\n",MICO_VERSION);
4022   return (0);
4023}
4024EOF
4025ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
4026if AC_TRY_EVAL(ac_compile); then
4027  if eval `./conftest 2>&5`; then
4028    kde_cv_mico_version=$MICO_VERSION
4029  else
4030    AC_MSG_ERROR([your system is not able to execute a small application to
4031    find MICO version! Check $kde_micodir/include/mico/version.h])
4032  fi
4033else
4034  AC_MSG_ERROR([your system is not able to compile a small application to
4035  find MICO version! Check $kde_micodir/include/mico/version.h])
4036fi
4037])
4038
4039dnl installed MICO version
4040mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
4041mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
4042mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
4043
4044if test "x$1" = "x"; then
4045 req_version="2.3.0"
4046else
4047 req_version=$1
4048fi
4049
4050dnl required MICO version
4051req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
4052req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
4053req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
4054
4055if test "$mico_v_maj" -lt "$req_v_maj" || \
4056   ( test "$mico_v_maj" -eq "$req_v_maj" && \
4057        test "$mico_v_mid" -lt "$req_v_mid" ) || \
4058   ( test "$mico_v_mid" -eq "$req_v_mid" && \
4059        test "$mico_v_min" -lt "$req_v_min" )
4060
4061then
4062  AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \
4063at least is required. You should upgrade MICO.])
4064else
4065  AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)])
4066fi
4067
4068LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL"
4069AC_SUBST(LIBMICO)
4070if test -z "$IDL"; then
4071  IDL='$(kde_bindir)/cuteidl'
4072fi
4073AC_SUBST(IDL)
4074IDL_DEPENDENCIES='$(kde_includes)/CUTE.h'
4075AC_SUBST(IDL_DEPENDENCIES)
4076
4077idldir="\$(includedir)/idl"
4078AC_SUBST(idldir)
4079
4080])
4081
4082AC_DEFUN(KDE_CHECK_MINI_STL,
4083[
4084AC_REQUIRE([KDE_CHECK_MICO])
4085
4086AC_MSG_CHECKING(if we use mico's mini-STL)
4087AC_CACHE_VAL(kde_cv_have_mini_stl,
4088[
4089AC_LANG_SAVE
4090AC_LANG_CPLUSPLUS
4091kde_save_cxxflags="$CXXFLAGS"
4092CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
4093AC_TRY_COMPILE(
4094[
4095#include <mico/config.h>
4096],
4097[
4098#ifdef HAVE_MINI_STL
4099#error "nothing"
4100#endif
4101],
4102kde_cv_have_mini_stl=no,
4103kde_cv_have_mini_stl=yes)
4104CXXFLAGS="$kde_save_cxxflags"
4105AC_LANG_RESTORE
4106])
4107
4108if test "x$kde_cv_have_mini_stl" = "xyes"; then
4109   AC_MSG_RESULT(yes)
4110   $1
4111else
4112   AC_MSG_RESULT(no)
4113   $2
4114fi
4115])
4116
4117])
4118
4119
4120AC_DEFUN(KDE_CHECK_LIBPTHREAD,
4121[
4122AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
4123AC_SUBST(LIBPTHREAD)
4124])
4125
4126AC_DEFUN(KDE_CHECK_PTHREAD_OPTION,
4127[
4128    AC_ARG_ENABLE(kernel-threads, [  --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.],
4129	kde_use_kernthreads=$enableval, kde_use_kernthreads=no)
4130
4131    if test "$kde_use_kernthreads" = "yes"; then
4132      ac_save_CXXFLAGS="$CXXFLAGS"
4133      ac_save_CFLAGS="$CFLAGS"
4134      CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
4135      CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
4136      AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
4137      CXXFLAGS="$ac_save_CXXFLAGS"
4138      CFLAGS="$ac_save_CFLAGS"
4139      if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then
4140        kde_use_kernthreads=no
4141      else
4142        dnl Add proper -I and -l statements
4143        AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD
4144        if test "x$LIBPTHREAD" = "x"; then
4145          kde_use_kernthreads=no
4146        else
4147          USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
4148        fi
4149      fi
4150    else
4151      USE_THREADS=""
4152      if test -z "$LIBPTHREAD"; then
4153        KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] )
4154      fi
4155    fi
4156
4157    AH_VERBATIM(__svr_define, [
4158#if defined(__SVR4) && !defined(__svr4__)
4159#define __svr4__ 1
4160#endif
4161])
4162    case $host_os in
4163 	solaris*)
4164		KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
4165                CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
4166    		;;
4167        freebsd*)
4168                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
4169                ;;
4170        aix*)
4171                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
4172                LIBPTHREAD="$LIBPTHREAD -lc_r"
4173                ;;
4174        linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
4175                if test "$CXX" = "KCC"; then
4176                  CXXFLAGS="$CXXFLAGS --thread_safe"
4177		  NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
4178                fi
4179                ;;
4180	*)
4181		;;
4182    esac
4183    AC_SUBST(USE_THREADS)
4184    AC_SUBST(LIBPTHREAD)
4185])
4186
4187AC_DEFUN(KDE_CHECK_THREADING,
4188[
4189  AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4190  AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
4191  dnl default is yes if libpthread is found and no if no libpthread is available
4192  if test -z "$LIBPTHREAD"; then
4193    if test -z "$USE_THREADS"; then
4194      kde_check_threading_default=no
4195    else
4196      kde_check_threading_default=yes
4197    fi
4198  else
4199    kde_check_threading_default=yes
4200  fi
4201  AC_ARG_ENABLE(threading, [  --disable-threading     disables threading even if libpthread found ],
4202   kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
4203  if test "x$kde_use_threading" = "xyes"; then
4204    AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
4205  fi
4206])
4207
4208AC_DEFUN(KDE_TRY_LINK_PYTHON,
4209[
4210if test "$kde_python_link_found" = no; then
4211
4212if test "$1" = normal; then
4213  AC_MSG_CHECKING(if a Python application links)
4214else
4215  AC_MSG_CHECKING(if Python depends on $2)
4216fi
4217
4218AC_CACHE_VAL(kde_cv_try_link_python_$1,
4219[
4220AC_LANG_SAVE
4221AC_LANG_C
4222kde_save_cflags="$CFLAGS"
4223CFLAGS="$CFLAGS $PYTHONINC"
4224kde_save_libs="$LIBS"
4225LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
4226kde_save_ldflags="$LDFLAGS"
4227LDFLAGS="$LDFLAGS $PYTHONLIB"
4228
4229AC_TRY_LINK(
4230[
4231#include <Python.h>
4232],[
4233	PySys_SetArgv(1, 0);
4234],
4235	[kde_cv_try_link_python_$1=yes],
4236	[kde_cv_try_link_python_$1=no]
4237)
4238CFLAGS="$kde_save_cflags"
4239LIBS="$kde_save_libs"
4240LDFLAGS="$kde_save_ldflags"
4241])
4242
4243if test "$kde_cv_try_link_python_$1" = "yes"; then
4244  AC_MSG_RESULT(yes)
4245  kde_python_link_found=yes
4246  if test ! "$1" = normal; then
4247    LIBPYTHON="$LIBPYTHON $2"
4248  fi
4249  $3
4250else
4251  AC_MSG_RESULT(no)
4252  $4
4253fi
4254AC_LANG_RESTORE
4255
4256fi
4257
4258])
4259
4260AC_DEFUN(KDE_CHECK_PYTHON_DIR,
4261[
4262AC_MSG_CHECKING([for Python directory])
4263
4264AC_CACHE_VAL(kde_cv_pythondir,
4265[
4266  if test -z "$PYTHONDIR"; then
4267    kde_cv_pythondir=/usr/local
4268  else
4269    kde_cv_pythondir="$PYTHONDIR"
4270  fi
4271])
4272
4273AC_ARG_WITH(pythondir,
4274[  --with-pythondir=pythondir   use python installed in pythondir ],
4275[
4276  ac_python_dir=$withval
4277], ac_python_dir=$kde_cv_pythondir
4278)
4279
4280AC_MSG_RESULT($ac_python_dir)
4281])
4282
4283AC_DEFUN(KDE_CHECK_PYTHON_INTERN,
4284[
4285AC_REQUIRE([KDE_CHECK_LIBDL])
4286AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4287AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
4288
4289if test -z "$1"; then
4290  version="1.5"
4291else
4292  version="$1"
4293fi
4294
4295AC_MSG_CHECKING([for Python$version])
4296
4297python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
4298AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
4299if test ! -r $python_incdir/Python.h; then
4300  AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
4301  python_incdir=$python_incdir/python$version
4302  if test ! -r $python_incdir/Python.h; then
4303    python_incdir=no
4304  fi
4305fi
4306
4307PYTHONINC=-I$python_incdir
4308
4309python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
4310AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
4311if test ! -r $python_libdir/libpython$version.a; then
4312  AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
4313  python_libdir=$python_libdir/python$version/config
4314  if test ! -r $python_libdir/libpython$version.a; then
4315    python_libdir=no
4316  fi
4317fi
4318
4319PYTHONLIB=-L$python_libdir
4320kde_orig_LIBPYTHON=$LIBPYTHON
4321if test -z "$LIBPYTHON"; then
4322  LIBPYTHON=-lpython$version
4323fi
4324
4325python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
4326AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
4327python_moddir=$python_moddir/python$version
4328if test ! -r $python_moddir/copy.py; then
4329  python_moddir=no
4330fi
4331
4332PYTHONMODDIR=$python_moddir
4333
4334AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
4335
4336if test x$python_incdir = xno ||  test x$python_libdir = xno ||  test x$python_moddir = xno; then
4337   LIBPYTHON=$kde_orig_LIBPYTHON
4338   test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
4339   test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
4340   $2
4341else
4342  dnl Note: this test is very weak
4343  kde_python_link_found=no
4344  KDE_TRY_LINK_PYTHON(normal)
4345  KDE_TRY_LINK_PYTHON(m, -lm)
4346  KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
4347  KDE_TRY_LINK_PYTHON(tcl, -ltcl)
4348  KDE_TRY_LINK_PYTHON(db2, -ldb2)
4349  KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
4350  KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
4351  KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
4352  KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
4353  KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
4354  KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
4355  KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
4356	[AC_MSG_WARN([it seems, Python depends on another library.
4357    Pleae set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
4358    and contact the authors to let them know about this problem])
4359	])
4360
4361  LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
4362  AC_SUBST(PYTHONINC)
4363  AC_SUBST(PYTHONLIB)
4364  AC_SUBST(LIBPYTHON)
4365  AC_SUBST(PYTHONMODDIR)
4366  AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
4367fi
4368
4369])
4370
4371
4372AC_DEFUN(KDE_CHECK_PYTHON,
4373[
4374  KDE_CHECK_PYTHON_INTERN("2.2",
4375    [KDE_CHECK_PYTHON_INTERN("2.1",
4376      [KDE_CHECK_PYTHON_INTERN("2.0", [ KDE_CHECK_PYTHON_INTERN($1, $2) ])
4377  ])])
4378])
4379
4380AC_DEFUN(KDE_CHECK_STL_SGI,
4381[
4382    AC_MSG_CHECKING([if STL implementation is SGI like])
4383    AC_CACHE_VAL(kde_cv_stl_type_sgi,
4384    [
4385      AC_TRY_COMPILE([
4386#include <string>
4387using namespace std;
4388],[
4389  string astring="Hallo Welt.";
4390  astring.erase(0, 6); // now astring is "Welt"
4391  return 0;
4392], kde_cv_stl_type_sgi=yes,
4393   kde_cv_stl_type_sgi=no)
4394])
4395
4396   AC_MSG_RESULT($kde_cv_stl_type_sgi)
4397
4398   if test "$kde_cv_stl_type_sgi" = "yes"; then
4399	AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
4400   fi
4401])
4402
4403AC_DEFUN(KDE_CHECK_STL_HP,
4404[
4405    AC_MSG_CHECKING([if STL implementation is HP like])
4406    AC_CACHE_VAL(kde_cv_stl_type_hp,
4407    [
4408      AC_TRY_COMPILE([
4409#include <string>
4410using namespace std;
4411],[
4412  string astring="Hello World";
4413  astring.remove(0, 6); // now astring is "World"
4414  return 0;
4415], kde_cv_stl_type_hp=yes,
4416   kde_cv_stl_type_hp=no)
4417])
4418   AC_MSG_RESULT($kde_cv_stl_type_hp)
4419
4420   if test "$kde_cv_stl_type_hp" = "yes"; then
4421	AC_DEFINE_UNQUOTED(HAVE_HP_STL, 1, [Define if you have a STL implementation by HP])
4422   fi
4423])
4424
4425AC_DEFUN(KDE_CHECK_STL,
4426[
4427    AC_LANG_SAVE
4428    AC_LANG_CPLUSPLUS
4429    ac_save_CXXFLAGS="$CXXFLAGS"
4430    CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
4431    KDE_CHECK_STL_SGI
4432
4433    if test "$kde_cv_stl_type_sgi" = "no"; then
4434       KDE_CHECK_STL_HP
4435
4436       if test "$kde_cv_stl_type_hp" = "no"; then
4437         AC_MSG_ERROR("no known STL type found - did you forget to install libstdc++[-devel] ?")
4438       fi
4439    fi
4440
4441    CXXFLAGS="$ac_save_CXXFLAGS"
4442    AC_LANG_RESTORE
4443])
4444
4445AC_DEFUN(AC_FIND_QIMGIO,
4446   [AC_REQUIRE([AC_FIND_JPEG])
4447AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
4448AC_MSG_CHECKING([for qimgio])
4449AC_CACHE_VAL(ac_cv_lib_qimgio,
4450[
4451AC_LANG_SAVE
4452AC_LANG_CPLUSPLUS
4453ac_save_LIBS="$LIBS"
4454ac_save_CXXFLAGS="$CXXFLAGS"
4455LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
4456CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
4457AC_TRY_RUN(dnl
4458[
4459#include <qimageio.h>
4460#include <qstring.h>
4461int main() {
4462		QString t = "hallo";
4463		t.fill('t');
4464		qInitImageIO();
4465}
4466],
4467            ac_cv_lib_qimgio=yes,
4468            ac_cv_lib_qimgio=no,
4469	    ac_cv_lib_qimgio=no)
4470LIBS="$ac_save_LIBS"
4471CXXFLAGS="$ac_save_CXXFLAGS"
4472AC_LANG_RESTORE
4473])dnl
4474if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
4475  LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
4476  AC_MSG_RESULT(yes)
4477  AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
4478  AC_SUBST(LIBQIMGIO)
4479else
4480  AC_MSG_RESULT(not found)
4481fi
4482])
4483
4484AC_DEFUN(KDE_CHECK_ANSI,
4485[
4486])
4487
4488AC_DEFUN(KDE_CHECK_INSURE,
4489[
4490  AC_ARG_ENABLE(insure, [  --enable-insure             use insure++ for debugging [default=no]],
4491  [
4492  if test $enableval = "no"; dnl
4493	then ac_use_insure="no"
4494	else ac_use_insure="yes"
4495   fi
4496  ], [ac_use_insure="no"])
4497
4498  AC_MSG_CHECKING(if we will use Insure++ to debug)
4499  AC_MSG_RESULT($ac_use_insure)
4500  if test "$ac_use_insure" = "yes"; dnl
4501       then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
4502   fi
4503])
4504
4505AC_DEFUN(AM_DISABLE_LIBRARIES,
4506[
4507    AC_PROVIDE([AM_ENABLE_STATIC])
4508    AC_PROVIDE([AM_ENABLE_SHARED])
4509    enable_static=no
4510    enable_shared=yes
4511])
4512
4513
4514AC_DEFUN(AC_CHECK_UTMP_FILE,
4515[
4516    AC_MSG_CHECKING([for utmp file])
4517
4518    AC_CACHE_VAL(kde_cv_utmp_file,
4519    [
4520    kde_cv_utmp_file=no
4521
4522    for ac_file in    \
4523                      \
4524	/var/run/utmp \
4525	/var/adm/utmp \
4526	/etc/utmp     \
4527     ; \
4528    do
4529     if test -r "$ac_file"; then
4530       kde_cv_utmp_file=$ac_file
4531       break
4532     fi
4533    done
4534    ])
4535
4536    if test "$kde_cv_utmp_file" != "no"; then
4537	AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
4538	$1
4539	AC_MSG_RESULT($kde_cv_utmp_file)
4540    else
4541    	$2
4542	AC_MSG_RESULT([non found])
4543    fi
4544])
4545
4546
4547AC_DEFUN(KDE_CREATE_SUBDIRSLIST,
4548[
4549
4550DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
4551
4552if test ! -s $srcdir/subdirs; then
4553  dnl Note: Makefile.common creates subdirs, so this is just a fallback
4554  TOPSUBDIRS=""
4555  files=`cd $srcdir && ls -1`
4556  dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
4557  for i in $dirs; do
4558    echo $i >> $srcdir/subdirs
4559  done
4560fi
4561
4562if test -s $srcdir/inst-apps; then
4563  ac_topsubdirs="`cat $srcdir/inst-apps`"
4564else
4565  ac_topsubdirs="`cat $srcdir/subdirs`"
4566fi
4567
4568for i in $ac_topsubdirs; do
4569  AC_MSG_CHECKING([if $i should be compiled])
4570  if test -d $srcdir/$i; then
4571    install_it="yes"
4572    for j in $DO_NOT_COMPILE; do
4573      if test $i = $j; then
4574        install_it="no"
4575      fi
4576    done
4577  else
4578    install_it="no"
4579  fi
4580  AC_MSG_RESULT($install_it)
4581  vari=`echo $i | sed -e 's,[[-+.]],_,g'`
4582  if test $install_it = "yes"; then
4583    TOPSUBDIRS="$TOPSUBDIRS $i"
4584    eval "$vari""_SUBDIR_included=yes"
4585  else
4586    eval "$vari""_SUBDIR_included=no"
4587  fi
4588done
4589
4590AC_SUBST(TOPSUBDIRS)
4591])
4592
4593AC_DEFUN(KDE_CHECK_NAMESPACES,
4594[
4595AC_MSG_CHECKING(whether C++ compiler supports namespaces)
4596AC_LANG_SAVE
4597AC_LANG_CPLUSPLUS
4598AC_TRY_COMPILE([
4599],
4600[
4601namespace Foo {
4602  extern int i;
4603  namespace Bar {
4604    extern int i;
4605  }
4606}
4607
4608int Foo::i = 0;
4609int Foo::Bar::i = 1;
4610],[
4611  AC_MSG_RESULT(yes)
4612  AC_DEFINE(HAVE_NAMESPACES)
4613], [
4614AC_MSG_RESULT(no)
4615])
4616AC_LANG_RESTORE
4617])
4618
4619AC_DEFUN(KDE_CHECK_NEWLIBS,
4620[
4621
4622])
4623
4624dnl ------------------------------------------------------------------------
4625dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
4626dnl ------------------------------------------------------------------------
4627dnl
4628AC_DEFUN(AC_CHECK_S_ISSOCK,
4629[
4630AC_MSG_CHECKING(for S_ISSOCK)
4631AC_CACHE_VAL(ac_cv_have_s_issock,
4632[
4633AC_LANG_SAVE
4634AC_LANG_C
4635AC_TRY_LINK(
4636[
4637#include <sys/stat.h>
4638],
4639[
4640struct stat buff;
4641int b = S_ISSOCK( buff.st_mode );
4642],
4643ac_cv_have_s_issock=yes,
4644ac_cv_have_s_issock=no)
4645AC_LANG_RESTORE
4646])
4647AC_MSG_RESULT($ac_cv_have_s_issock)
4648if test "$ac_cv_have_s_issock" = "yes"; then
4649  AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
4650fi
4651
4652AH_VERBATIM(_ISSOCK,
4653[
4654#ifndef HAVE_S_ISSOCK
4655#define HAVE_S_ISSOCK
4656#define S_ISSOCK(mode) (1==0)
4657#endif
4658])
4659
4660])
4661
4662dnl ------------------------------------------------------------------------
4663dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
4664dnl ------------------------------------------------------------------------
4665dnl
4666AC_DEFUN(AC_CHECK_KDEMAXPATHLEN,
4667[
4668AC_MSG_CHECKING(for MAXPATHLEN)
4669AC_CACHE_VAL(ac_cv_maxpathlen,
4670[
4671AC_LANG_C
4672cat > conftest.$ac_ext <<EOF
4673#ifdef STDC_HEADERS
4674# include <stdlib.h>
4675#endif
4676#include <stdio.h>
4677#include <sys/param.h>
4678#ifndef MAXPATHLEN
4679#define MAXPATHLEN 1024
4680#endif
4681
4682KDE_HELLO MAXPATHLEN
4683
4684EOF
4685
4686ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
4687
4688if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
4689    ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
4690else
4691    ac_cv_maxpathlen=1024
4692fi
4693
4694rm conftest.*
4695
4696])
4697AC_MSG_RESULT($ac_cv_maxpathlen)
4698AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
4699])
4700
4701dnl -------------------------------------------------------------------------
4702dnl See if the compiler supports a template repository         bero@redhat.de
4703dnl -------------------------------------------------------------------------
4704AC_DEFUN(KDE_COMPILER_REPO,
4705[
4706  REPO=""
4707  NOREPO=""
4708
4709  KDE_CHECK_COMPILER_FLAG(frepo,
4710   [
4711     REPO="-frepo"
4712     NOREPO="-fno-repo"
4713   ])
4714
4715  if test -z "$REPO"; then
4716  KDE_CHECK_COMPILER_FLAG(instances=explicit,
4717  [
4718     REPO="-instances=explicit"
4719     NOREPO="-instances=extern"
4720  ])
4721  fi
4722
4723  if test -n "$REPO"; then
4724     AC_DEFINE_UNQUOTED(HAVE_TEMPLATE_REPOSITORY, 1,
4725		[C++ compiler supports template repository])
4726     $1
4727  fi
4728
4729  AC_SUBST(REPO)
4730  AC_SUBST(NOREPO)
4731])
4732
4733AC_DEFUN(KDE_CHECK_HEADER,
4734[
4735   AC_LANG_SAVE
4736   kde_safe_cppflags=$CPPFLAGS
4737   CPPFLAGS="$CPPFLAGS $all_includes"
4738   AC_LANG_CPLUSPLUS
4739   AC_CHECK_HEADER($1, $2, $3)
4740   CPPFLAGS=$kde_safe_cppflags
4741   AC_LANG_RESTORE
4742])
4743
4744AC_DEFUN(KDE_CHECK_HEADERS,
4745[
4746   AH_CHECK_HEADERS([$1])
4747   AC_LANG_SAVE
4748   kde_safe_cppflags=$CPPFLAGS
4749   CPPFLAGS="$CPPFLAGS $all_includes"
4750   AC_LANG_CPLUSPLUS
4751   AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
4752   CPPFLAGS=$kde_safe_cppflags
4753   AC_LANG_RESTORE
4754])
4755
4756AC_DEFUN(KDE_FAST_CONFIGURE,
4757[
4758  dnl makes configure fast (needs perl)
4759  AC_ARG_ENABLE(fast-perl, [  --disable-fast-perl     disable fast Makefile generation (needs perl)],
4760      with_fast_perl=$enableval, with_fast_perl=yes)
4761])
4762
4763AC_DEFUN(KDE_CONF_FILES,
4764[
4765  val=
4766  if test -f $srcdir/configure.files ; then
4767    val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
4768  fi
4769  CONF_FILES=
4770  if test -n "$val" ; then
4771    for i in $val ; do
4772      CONF_FILES="$CONF_FILES $i"
4773    done
4774  fi
4775  AC_SUBST(CONF_FILES)
4776])dnl
4777
4778AC_DEFUN(KDE_SET_PREFIX,
4779[
4780  unset CDPATH
4781  dnl make $KDEDIR the default for the installation
4782  AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
4783
4784  if test "x$prefix" = "xNONE"; then
4785    prefix=$ac_default_prefix
4786    ac_configure_args="$ac_configure_args --prefix=$prefix"
4787  fi
4788  # And delete superflous '/' to make compares easier
4789  prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4790  exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4791  KDE_FAST_CONFIGURE
4792  KDE_CONF_FILES
4793])
4794
4795pushdef([AC_PROG_INSTALL],
4796[
4797  dnl our own version, testing for a -p flag
4798  popdef([AC_PROG_INSTALL])
4799  dnl as AC_PROG_INSTALL works as it works we first have
4800  dnl to save if the user didn't specify INSTALL, as the
4801  dnl autoconf one overwrites INSTALL and we have no chance to find
4802  dnl out afterwards
4803  test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
4804  test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
4805  test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
4806  AC_PROG_INSTALL
4807
4808  if test -z "$kde_save_INSTALL_given" ; then
4809    # OK, user hasn't given any INSTALL, autoconf found one for us
4810    # now we test, if it supports the -p flag
4811    AC_MSG_CHECKING(for -p flag to install)
4812    rm -f confinst.$$.* > /dev/null 2>&1
4813    echo "Testtest" > confinst.$$.orig
4814    ac_res=no
4815    if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
4816      if test -f confinst.$$.new ; then
4817        # OK, -p seems to do no harm to install
4818	INSTALL="${INSTALL} -p"
4819	ac_res=yes
4820      fi
4821    fi
4822    rm -f confinst.$$.*
4823    AC_MSG_RESULT($ac_res)
4824  fi
4825  dnl the following tries to resolve some signs and wonders coming up
4826  dnl with different autoconf/automake versions
4827  dnl e.g.:
4828  dnl  *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
4829  dnl   and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
4830  dnl   it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
4831  dnl  *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
4832  dnl   INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
4833  dnl   install-@DIR@PROGRAMS targets to explicitly use that flag
4834  dnl  *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
4835  dnl   INSTALL_SCRIPT, which breaks with automake <= 1.4
4836  dnl  *autoconf >2.13 (since 10.Apr 1999) has not that failure
4837  dnl  *sometimes KDE does not use the install-@DIR@PROGRAM targets from
4838  dnl   automake (due to broken Makefile.am or whatever) to install programs,
4839  dnl   and so does not see the -s flag in automake > 1.4
4840  dnl to clean up that mess we:
4841  dnl  +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
4842  dnl   which cleans KDE's program with automake > 1.4;
4843  dnl  +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
4844  dnl   with automake<=1.4
4845  dnl  note that dues to this sometimes two '-s' flags are used (if KDE
4846  dnl   properly uses install-@DIR@PROGRAMS, but I don't care
4847  dnl
4848  dnl And to all this comes, that I even can't write in comments variable
4849  dnl  names used by automake, because it is so stupid to think I wanted to
4850  dnl  _use_ them, therefor I have written A_M_... instead of AM_
4851  dnl hmm, I wanted to say something ... ahh yes: Arghhh.
4852
4853  if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
4854    INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
4855  fi
4856  if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
4857    INSTALL_SCRIPT='${INSTALL}'
4858  fi
4859])dnl
4860
4861AC_DEFUN(KDE_LANG_CPLUSPLUS,
4862[AC_LANG_CPLUSPLUS
4863ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
4864pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
4865])
4866
4867pushdef([AC_LANG_CPLUSPLUS],
4868[popdef([AC_LANG_CPLUSPLUS])
4869KDE_LANG_CPLUSPLUS
4870])
4871
4872AC_DEFUN(KDE_CHECK_LONG_LONG,
4873[
4874AC_MSG_CHECKING(for long long)
4875AC_CACHE_VAL(kde_cv_c_long_long,
4876[
4877  AC_LANG_SAVE
4878  AC_LANG_CPLUSPLUS
4879  AC_TRY_LINK([], [
4880  long long foo = 0;
4881  foo = foo+1;
4882  ],
4883  kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
4884  AC_LANG_RESTORE
4885])
4886AC_MSG_RESULT($kde_cv_c_long_long)
4887if test "$kde_cv_c_long_long" = yes; then
4888   AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
4889fi
4890])
4891
4892AC_DEFUN(KDE_CHECK_LIB,
4893[
4894     kde_save_LDFLAGS="$LDFLAGS"
4895     dnl AC_CHECK_LIB modifies LIBS, so save it here
4896     kde_save_LIBS="$LIBS"
4897     LDFLAGS="$LDFLAGS $all_libraries"
4898     case $host_os in
4899      aix*) LDFLAGS="-brtl $LDFLAGS"
4900	test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
4901	;;
4902     esac
4903     AC_CHECK_LIB($1, $2, $3, $4, $5)
4904     LDFLAGS="$kde_save_LDFLAGS"
4905     LIBS="$kde_save_LIBS"
4906])
4907
4908AC_DEFUN(KDE_JAVA_PREFIX,
4909[
4910	dir=`dirname "$1"`
4911	base=`basename "$1"`
4912	list=`ls -1 $dir 2> /dev/null`
4913	for entry in $list; do
4914		if test -d $dir/$entry/bin; then
4915			case $entry in
4916			   $base)
4917				javadirs="$javadirs $dir/$entry/bin"
4918				;;
4919			esac
4920		elif test -d $dir/$entry/jre/bin; then
4921			case $entry in
4922			   $base)
4923				javadirs="$javadirs $dir/$entry/jre/bin"
4924				;;
4925			esac
4926		fi
4927	done
4928])
4929
4930dnl KDE_CHEC_JAVA_DIR(onlyjre)
4931AC_DEFUN(KDE_CHECK_JAVA_DIR,
4932[
4933
4934AC_ARG_WITH(java,
4935[  --with-java=javadir     use java installed in javadir, --without-java disables ],
4936[  ac_java_dir=$withval
4937], ac_java_dir=""
4938)
4939
4940AC_MSG_CHECKING([for Java])
4941
4942dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
4943if test "x$ac_java_dir" = "xno"; then
4944   kde_java_bindir=no
4945   kde_java_includedir=no
4946   kde_java_libjvmdir=no
4947   kde_java_libhpidir=no
4948else
4949  if test "x$ac_java_dir" = "x"; then
4950
4951
4952      dnl No option set -> look in $PATH
4953      KDE_JAVA_PREFIX(/usr/j2se)
4954      KDE_JAVA_PREFIX(/usr/j*dk*)
4955      KDE_JAVA_PREFIX(/usr/lib/j*dk*)
4956      KDE_JAVA_PREFIX(/opt/j*sdk*)
4957      KDE_JAVA_PREFIX(/usr/lib/java*)
4958      KDE_JAVA_PREFIX(/usr/java*)
4959      KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
4960      KDE_JAVA_PREFIX(/usr/lib/SunJava*)
4961      KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
4962      KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
4963      KDE_JAVA_PREFIX(/opt/java*)
4964
4965      kde_cv_path="NONE"
4966      kde_save_IFS=$IFS
4967      IFS=':'
4968      for dir in $PATH; do
4969	  javadirs="$javadirs $dir"
4970      done
4971      IFS=$kde_save_IFS
4972      jredirs=
4973
4974      for dir in $javadirs; do
4975	  if test ! -d $dir; then break; fi
4976          if test -x "$dir/java"; then
4977                libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4978		if test ! -f $libjvmdir/libjvm.so; then continue; fi
4979		jredirs="$jredirs $dir"
4980	  fi
4981      done
4982
4983      JAVAC=
4984      JAVA=
4985      kde_java_bindir=no
4986      for dir in $jredirs; do
4987	  JAVA="$dir/java"
4988	  kde_java_bindir=$dir
4989	  if test -x "$dir/javac"; then
4990		JAVAC="$dir/javac"
4991                break
4992	  fi
4993      done
4994
4995      if test -n "$JAVAC"; then
4996          dnl this substitution might not work - well, we test for jni.h below
4997          kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
4998      else
4999          kde_java_includedir=no
5000      fi
5001  else
5002    dnl config option set
5003    kde_java_bindir=$ac_java_dir/bin
5004    if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
5005	kde_java_includedir=no
5006    else
5007        kde_java_includedir=$ac_java_dir/include
5008    fi
5009  fi
5010fi
5011
5012dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
5013if test "x$kde_java_bindir" != "xno"; then
5014
5015  dnl Look for libjvm.so
5016  kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
5017  dnl Look for libhpi.so and avoid green threads
5018  kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
5019
5020  dnl Now check everything's fine under there
5021  dnl the include dir is our flag for having the JDK
5022  if test -d "$kde_java_includedir"; then
5023    if test ! -x "$kde_java_bindir/javac"; then
5024      AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
5025    fi
5026    if test ! -x "$kde_java_bindir/javah"; then
5027      AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5028    fi
5029    if test ! -x "$kde_java_bindir/jar"; then
5030      AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5031    fi
5032    if test ! -r "$kde_java_includedir/jni.h"; then
5033      AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
5034    fi
5035
5036    jni_includes="-I$kde_java_includedir"
5037    dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
5038    dnl and under linux here..
5039    test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
5040    test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
5041    test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
5042
5043  else
5044    JAVAC=
5045    jni_includes=
5046  fi
5047
5048  if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
5049     AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
5050  fi
5051
5052  if test ! -x "$kde_java_bindir/java"; then
5053      AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5054  fi
5055
5056  if test ! -r "$kde_java_libhpidir/libhpi.so"; then
5057    AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
5058  fi
5059
5060  if test -n "$jni_includes"; then
5061    dnl Check for JNI version
5062    AC_LANG_SAVE
5063    AC_LANG_CPLUSPLUS
5064    ac_cxxflags_safe="$CXXFLAGS"
5065    CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
5066
5067    AC_TRY_COMPILE([
5068  #include <jni.h>
5069	      ],
5070	      [
5071  #ifndef JNI_VERSION_1_2
5072  Syntax Error
5073  #endif
5074	      ],[ kde_jni_works=yes ],
5075	      [ kde_jni_works=no ])
5076
5077    if test $kde_jni_works = no; then
5078      AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
5079		    You need to have Java Development Kit (JDK) version 1.2.
5080
5081		    Use --with-java to specify another location.
5082		    Use --without-java to configure without java support.
5083		    Or download a newer JDK and try again.
5084		    See e.g. http://java.sun.com/products/jdk/1.2 ])
5085    fi
5086
5087    CXXFLAGS="$ac_cxxflags_safe"
5088    AC_LANG_RESTORE
5089
5090    dnl All tests ok, inform and subst the variables
5091
5092    JAVAC=$kde_java_bindir/javac
5093    JAVAH=$kde_java_bindir/javah
5094    JAR=$kde_java_bindir/jar
5095    AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5096    JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
5097    AC_MSG_RESULT([java JDK in $kde_java_bindir])
5098
5099  else
5100      AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5101      AC_MSG_RESULT([java JRE in $kde_java_bindir])
5102  fi
5103else # no
5104  AC_MSG_RESULT([none found])
5105fi
5106
5107AC_SUBST(JAVAC)
5108AC_SUBST(JAVAH)
5109AC_SUBST(JAR)
5110AC_SUBST(JVMLIBS)
5111AC_SUBST(jni_includes)
5112
5113# for backward compat
5114kde_cv_java_includedir=$kde_java_includedir
5115kde_cv_java_bindir=$kde_java_bindir
5116])
5117
5118dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
5119dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
5120dnl big packages, m4_foreach is dog-slow.  So use our own version of
5121dnl it.  (matz@kde.org)
5122m4_define([mm_foreach],
5123[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
5124m4_define([mm_car], [[$1]])
5125m4_define([mm_car2], [[$@]])
5126m4_define([_mm_foreach],
5127[m4_if(m4_quote($2), [], [],
5128       [m4_define([$1], [mm_car($2)])$3[]_mm_foreach([$1],
5129                                                     mm_car2(m4_shift($2)),
5130                                                     [$3])])])
5131m4_define([AC_FOREACH],
5132[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
5133
5134AC_DEFUN(KDE_NEED_FLEX,
5135[
5136kde_libs_safe=$LIBS
5137LIBS="$LIBS $USER_LDFLAGS"
5138AM_PROG_LEX
5139LIBS=$kde_libs_safe
5140if test -z "$LEXLIB"; then
5141    AC_MSG_ERROR([You need to have flex installed.])
5142fi
5143AC_SUBST(LEXLIB)
5144])
5145
5146AC_DEFUN(AC_PATH_QTOPIA,
5147[
5148  dnl TODO: use AC_CACHE_VAL
5149
5150  if test -z "$1"; then
5151    qtopia_minver_maj=1
5152    qtopia_minver_min=5
5153    qtopia_minver_pat=0
5154  else
5155    qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
5156    qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
5157    qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
5158  fi
5159
5160  qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
5161  qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
5162
5163  AC_REQUIRE([AC_PATH_QT])
5164
5165  AC_MSG_CHECKING([for Qtopia])
5166
5167  LIB_QTOPIA="-lqpe"
5168  AC_SUBST(LIB_QTOPIA)
5169
5170  kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
5171
5172  ac_qtopia_incdir=NO
5173
5174  AC_ARG_WITH(qtopia-dir,
5175              [  --with-qtopia-dir=DIR   where the root of Qtopia is installed ],
5176              [  ac_qtopia_incdir="$withval"/include] )
5177
5178  qtopia_incdirs=""
5179  for dir in $kde_qtopia_dirs; do
5180    qtopia_incdirs="$qtopia_incdirs $dir/include"
5181  done
5182
5183  if test ! "$ac_qtopia_incdir" = "NO"; then
5184    qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
5185  fi
5186
5187  qtopia_incdir=""
5188  AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
5189  ac_qtopia_incdir="$qtopia_incdir"
5190
5191  if test -z "$qtopia_incdir"; then
5192    AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
5193  fi
5194
5195  qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
5196  qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
5197  qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
5198
5199  qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
5200  qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
5201  if test "$qtopia_ver" -lt "$qtopia_minver"; then
5202    AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
5203is required.])
5204  fi
5205
5206  AC_LANG_SAVE
5207  AC_LANG_CPLUSPLUS
5208
5209  ac_cxxflags_safe="$CXXFLAGS"
5210  ac_ldflags_safe="$LDFLAGS"
5211  ac_libs_safe="$LIBS"
5212
5213  CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
5214  LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
5215  LIBS="$LIBS $LIB_QTOPIA $LIBQT"
5216
5217  cat > conftest.$ac_ext <<EOF
5218#include "confdefs.h"
5219#include <qpe/qpeapplication.h>
5220#include <qpe/version.h>
5221
5222int main( int argc, char **argv )
5223{
5224    QPEApplication app( argc, argv );
5225    return 0;
5226}
5227EOF
5228
5229  if AC_TRY_EVAL(ac_link) && test -s conftest; then
5230    rm -f conftest*
5231  else
5232    rm -f conftest*
5233    AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
5234the end of config.log])
5235  fi
5236
5237  CXXFLAGS="$ac_cxxflags_safe"
5238  LDFLAGS="$ac_ldflags_safe"
5239  LIBS="$ac_libs_safe"
5240
5241  AC_LANG_RESTORE
5242
5243  QTOPIA_INCLUDES="-I$qtopia_incdir"
5244  AC_SUBST(QTOPIA_INCLUDES)
5245
5246  AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
5247])
5248
5249
5250AC_DEFUN(KDE_INIT_DOXYGEN,
5251[
5252AC_MSG_CHECKING([for Qt docs])
5253kde_qtdir=
5254if test "${with_qt_dir+set}" = set; then
5255  kde_qtdir="$with_qt_dir"
5256fi
5257
5258AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc], QTDOCDIR)
5259AC_MSG_RESULT($QTDOCDIR)
5260
5261AC_SUBST(QTDOCDIR)
5262
5263KDE_FIND_PATH(dot, DOT, [], [])
5264if test -n "$DOT"; then
5265  KDE_HAVE_DOT="YES"
5266else
5267  KDE_HAVE_DOT="NO"
5268fi
5269AC_SUBST(KDE_HAVE_DOT)
5270KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
5271AC_SUBST(DOXYGEN)
5272
5273DOXYGEN_PROJECT_NAME="$1"
5274DOXYGEN_PROJECT_NUMBER="$2"
5275AC_SUBST(DOXYGEN_PROJECT_NAME)
5276AC_SUBST(DOXYGEN_PROJECT_NUMBER)
5277
5278KDE_HAS_DOXYGEN=no
5279if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
5280  KDE_HAS_DOXYGEN=yes
5281fi
5282AC_SUBST(KDE_HAS_DOXYGEN)
5283
5284])
5285
5286
5287AC_DEFUN(AC_FIND_BZIP2,
5288[
5289AC_MSG_CHECKING([for bzDecompress in libbz2])
5290AC_CACHE_VAL(ac_cv_lib_bzip2,
5291[
5292AC_LANG_C
5293kde_save_LIBS="$LIBS"
5294LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
5295kde_save_CFLAGS="$CFLAGS"
5296CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
5297AC_TRY_LINK(dnl
5298[
5299#define BZ_NO_STDIO
5300#include<bzlib.h>
5301],
5302            [ bz_stream s; (void) bzDecompress(&s); ],
5303            eval "ac_cv_lib_bzip2='-lbz2'",
5304            eval "ac_cv_lib_bzip2=no")
5305LIBS="$kde_save_LIBS"
5306CFLAGS="$kde_save_CFLAGS"
5307])dnl
5308AC_MSG_RESULT($ac_cv_lib_bzip2)
5309
5310if test ! "$ac_cv_lib_bzip2" = no; then
5311  BZIP2DIR=bzip2
5312
5313  LIBBZ2="$ac_cv_lib_bzip2"
5314  AC_SUBST(LIBBZ2)
5315
5316else
5317
5318   cxx_shared_flags=
5319   KDE_CHECK_COMPILER_FLAG(shared, [
5320	cxx_shared_flag="-shared"
5321   ])
5322
5323   AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
5324   AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
5325   [
5326   AC_LANG_C
5327   kde_save_LIBS="$LIBS"
5328   LIBS="$all_libraries $USER_LDFLAGS $cxx_shared_flag -lbz2 $LIBSOCKET"
5329   kde_save_CFLAGS="$CFLAGS"
5330   CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
5331
5332   AC_TRY_LINK(dnl
5333   [
5334   #define BZ_NO_STDIO
5335   #include<bzlib.h>
5336   ],
5337               [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
5338               eval "ac_cv_lib_bzip2_prefix='-lbz2'",
5339               eval "ac_cv_lib_bzip2_prefix=no")
5340   LIBS="$kde_save_LIBS"
5341   CFLAGS="$kde_save_CFLAGS"
5342   ])dnl
5343
5344   AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
5345
5346
5347
5348   if test ! "$ac_cv_lib_bzip2_prefix" = no; then
5349     BZIP2DIR=bzip2
5350
5351     LIBBZ2="$ac_cv_lib_bzip2_prefix"
5352     AC_SUBST(LIBBZ2)
5353
5354     AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
5355   dnl else, we just ignore this
5356   fi
5357
5358fi
5359AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
5360])
5361
5362dnl ------------------------------------------------------------------------
5363dnl Try to find the SSL headers and libraries.
5364dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
5365dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
5366dnl ------------------------------------------------------------------------
5367dnl
5368AC_DEFUN(KDE_CHECK_SSL,
5369[
5370LIBSSL="-lssl -lcrypto"
5371AC_REQUIRE([KDE_CHECK_LIB64])
5372
5373ac_ssl_includes=NO ac_ssl_libraries=NO
5374ssl_libraries=""
5375ssl_includes=""
5376AC_ARG_WITH(ssl-dir,
5377    [  --with-ssl-dir=DIR      where the root of OpenSSL is installed],
5378    [  ac_ssl_includes="$withval"/include
5379       ac_ssl_libraries="$withval"/lib$kdelibsuff
5380    ])
5381
5382want_ssl=yes
5383AC_ARG_WITH(ssl,
5384    [  --without-ssl           disable SSL checks],
5385    [want_ssl=$withval])
5386
5387if test $want_ssl = yes; then
5388
5389AC_MSG_CHECKING(for OpenSSL)
5390
5391AC_CACHE_VAL(ac_cv_have_ssl,
5392[#try to guess OpenSSL locations
5393
5394  ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
5395  ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
5396  AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
5397  ac_ssl_includes="$ssl_incdir"
5398
5399  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"
5400  if test ! "$ac_ssl_libraries" = "NO"; then
5401    ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
5402  fi
5403
5404  test=NONE
5405  ssl_libdir=NONE
5406  for dir in $ssl_libdirs; do
5407    try="ls -1 $dir/libssl*"
5408    if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
5409  done
5410
5411  ac_ssl_libraries="$ssl_libdir"
5412
5413  AC_LANG_SAVE
5414  AC_LANG_C
5415
5416  ac_cflags_safe="$CFLAGS"
5417  ac_ldflags_safe="$LDFLAGS"
5418  ac_libs_safe="$LIBS"
5419
5420  CFLAGS="$CFLAGS -I$ssl_incdir $all_includes"
5421  LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
5422  LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
5423
5424  AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
5425  ac_ssl_rsaref="yes"
5426  ,
5427  ac_ssl_rsaref="no"
5428  )
5429
5430  CFLAGS="$ac_cflags_safe"
5431  LDFLAGS="$ac_ldflags_safe"
5432  LIBS="$ac_libs_safe"
5433
5434  AC_LANG_RESTORE
5435
5436  if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
5437    have_ssl=no
5438  else
5439    have_ssl=yes;
5440  fi
5441
5442  ])
5443
5444  eval "$ac_cv_have_ssl"
5445
5446  AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
5447
5448  AC_MSG_CHECKING([whether OpenSSL uses rsaref])
5449  AC_MSG_RESULT($ac_ssl_rsaref)
5450
5451  AC_MSG_CHECKING([for easter eggs])
5452  AC_MSG_RESULT([none found])
5453
5454else
5455  have_ssl=no
5456fi
5457
5458if test "$have_ssl" = yes; then
5459  AC_MSG_CHECKING(for OpenSSL version)
5460  dnl Check for SSL version
5461  AC_CACHE_VAL(ac_cv_ssl_version,
5462  [
5463    AC_LANG_SAVE
5464    AC_LANG_C
5465
5466    cat >conftest.$ac_ext <<EOF
5467#include <openssl/opensslv.h>
5468#include <stdio.h>
5469    int main() {
5470
5471#ifndef OPENSSL_VERSION_NUMBER
5472      printf("ssl_version=\\"error\\"\n");
5473#else
5474      if (OPENSSL_VERSION_NUMBER < 0x00906000)
5475        printf("ssl_version=\\"old\\"\n");
5476      else
5477        printf("ssl_version=\\"ok\\"\n");
5478#endif
5479     return (0);
5480    }
5481EOF
5482
5483    ac_compile='${CC-gcc} $CFLAGS -I$ac_ssl_includes conftest.$ac_ext -o conftest'
5484    if AC_TRY_EVAL(ac_compile); then
5485
5486      if eval `./conftest 2>&5`; then
5487        if test $ssl_version = error; then
5488          AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
5489        else
5490          if test $ssl_version = old; then
5491            AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
5492            have_ssl=no
5493          fi
5494        fi
5495        ac_cv_ssl_version="ssl_version=$ssl_version"
5496      else
5497        AC_MSG_ERROR([Your system couldn't run a small SSL test program.
5498        Check config.log, and if you can't figure it out, send a mail to
5499        David Faure <faure@kde.org>, attaching your config.log])
5500      fi
5501
5502    else
5503      AC_MSG_ERROR([Your system couldn't link a small SSL test program.
5504      Check config.log, and if you can't figure it out, send a mail to
5505      David Faure <faure@kde.org>, attaching your config.log])
5506    fi
5507
5508    AC_LANG_RESTORE
5509
5510  ])
5511
5512  eval "$ac_cv_ssl_version"
5513  AC_MSG_RESULT($ssl_version)
5514fi
5515
5516if test "$have_ssl" != yes; then
5517  LIBSSL="";
5518else
5519  AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
5520  ac_cv_have_ssl="have_ssl=yes \
5521    ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
5522
5523
5524  ssl_libraries="$ac_ssl_libraries"
5525  ssl_includes="$ac_ssl_includes"
5526
5527  if test "$ac_ssl_rsaref" = yes; then
5528    LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref"
5529  fi
5530
5531  if test $ssl_version = "old"; then
5532    AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
5533  fi
5534fi
5535
5536if test "$ssl_includes" = "/usr/include" || test  "$ssl_includes" = "/usr/local/include" || test -z "$ssl_includes"; then
5537 SSL_INCLUDES="";
5538else
5539 SSL_INCLUDES="-I$ssl_includes"
5540fi
5541
5542if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries"; then
5543 SSL_LDFLAGS=""
5544else
5545 SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
5546fi
5547
5548AC_SUBST(SSL_INCLUDES)
5549AC_SUBST(SSL_LDFLAGS)
5550AC_SUBST(LIBSSL)
5551])
5552
5553AC_DEFUN(KDE_CHECK_STRLCPY,
5554[
5555  AC_CHECK_STRLCPY
5556  AC_CHECK_STRLCAT
5557  AC_CHECK_SIZEOF(size_t)
5558  AC_CHECK_SIZEOF(unsigned long)
5559
5560  AC_MSG_CHECKING([sizeof(size_t) == sizeof(unsigned long)])
5561  AC_TRY_COMPILE(,[
5562    #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
5563       choke me
5564    #endif
5565    ],[AC_MSG_RESULT([yes])],[
5566      AC_MSG_RESULT([no])
5567      AC_MSG_ERROR([
5568       Apparently on your system our assumption sizeof(size_t) == sizeof(unsigned long)
5569       does not apply. Please mail kde-devel@kde.org with a description of your system!
5570      ])
5571  ])
5572])
5573
5574# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
5575
5576# serial 47 AC_PROG_LIBTOOL
5577
5578# AC_PROG_LIBTOOL
5579# ---------------
5580AC_DEFUN([AC_PROG_LIBTOOL],
5581[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
5582dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
5583dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
5584  AC_PROVIDE_IFELSE([AC_PROG_CXX],
5585    [AC_LIBTOOL_CXX],
5586    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
5587  ])])
5588
5589dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
5590dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
5591dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
5592  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
5593    [AC_LIBTOOL_GCJ],
5594    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
5595      [AC_LIBTOOL_GCJ],
5596      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
5597	[AC_LIBTOOL_GCJ],
5598      [ifdef([AC_PROG_GCJ],
5599	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
5600       ifdef([A][M_PROG_GCJ],
5601	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
5602       ifdef([LT_AC_PROG_GCJ],
5603	     [define([LT_AC_PROG_GCJ],
5604		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
5605])])# AC_PROG_LIBTOOL
5606
5607
5608# _AC_PROG_LIBTOOL
5609# ----------------
5610AC_DEFUN([_AC_PROG_LIBTOOL],
5611[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
5612AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
5613AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
5614
5615# This can be used to rebuild libtool when needed
5616LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
5617
5618# Always use our own libtool.
5619LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'
5620AC_SUBST(LIBTOOL)dnl
5621
5622# Prevent multiple expansion
5623define([AC_PROG_LIBTOOL], [])
5624])# _AC_PROG_LIBTOOL
5625
5626
5627# AC_LIBTOOL_SETUP
5628# ----------------
5629AC_DEFUN([AC_LIBTOOL_SETUP],
5630[AC_PREREQ(2.50)dnl
5631AC_REQUIRE([AC_ENABLE_SHARED])dnl
5632AC_REQUIRE([AC_ENABLE_STATIC])dnl
5633AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
5634AC_REQUIRE([AC_CANONICAL_HOST])dnl
5635AC_REQUIRE([AC_CANONICAL_BUILD])dnl
5636AC_REQUIRE([AC_PROG_CC])dnl
5637AC_REQUIRE([AC_PROG_LD])dnl
5638AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
5639AC_REQUIRE([AC_PROG_NM])dnl
5640AC_REQUIRE([LT_AC_PROG_SED])dnl
5641
5642AC_REQUIRE([AC_PROG_LN_S])dnl
5643AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
5644# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
5645AC_REQUIRE([AC_OBJEXT])dnl
5646AC_REQUIRE([AC_EXEEXT])dnl
5647dnl
5648
5649AC_LIBTOOL_SYS_MAX_CMD_LEN
5650AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
5651AC_LIBTOOL_OBJDIR
5652
5653AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
5654_LT_AC_PROG_ECHO_BACKSLASH
5655
5656case $host_os in
5657aix3*)
5658  # AIX sometimes has problems with the GCC collect2 program.  For some
5659  # reason, if we set the COLLECT_NAMES environment variable, the problems
5660  # vanish in a puff of smoke.
5661  if test "X${COLLECT_NAMES+set}" != Xset; then
5662    COLLECT_NAMES=
5663    export COLLECT_NAMES
5664  fi
5665  ;;
5666esac
5667
5668# Sed substitution that helps us do robust quoting.  It backslashifies
5669# metacharacters that are still active within double-quoted strings.
5670Xsed='sed -e s/^X//'
5671[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
5672
5673# Same as above, but do not quote variable references.
5674[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
5675
5676# Sed substitution to delay expansion of an escaped shell variable in a
5677# double_quote_subst'ed string.
5678delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
5679
5680# Sed substitution to avoid accidental globbing in evaled expressions
5681no_glob_subst='s/\*/\\\*/g'
5682
5683# Constants:
5684rm="rm -f"
5685
5686# Global variables:
5687default_ofile=libtool
5688can_build_shared=yes
5689
5690# All known linkers require a `.a' archive for static linking (except M$VC,
5691# which needs '.lib').
5692libext=a
5693ltmain="$ac_aux_dir/ltmain.sh"
5694ofile="$default_ofile"
5695with_gnu_ld="$lt_cv_prog_gnu_ld"
5696
5697AC_CHECK_TOOL(RANLIB, ranlib, :)
5698AC_CHECK_TOOL(STRIP, strip, :)
5699
5700old_CC="$CC"
5701old_CFLAGS="$CFLAGS"
5702
5703# Set sane defaults for various variables
5704test -z "$AR" && AR=ar
5705test -z "$AR_FLAGS" && AR_FLAGS=cru
5706test -z "$AS" && AS=as
5707test -z "$CC" && CC=cc
5708test -z "$LTCC" && LTCC=$CC
5709test -z "$DLLTOOL" && DLLTOOL=dlltool
5710test -z "$LD" && LD=ld
5711test -z "$LN_S" && LN_S="ln -s"
5712test -z "$MAGIC_CMD" && MAGIC_CMD=file
5713test -z "$NM" && NM=nm
5714test -z "$SED" && SED=sed
5715test -z "$OBJDUMP" && OBJDUMP=objdump
5716test -z "$RANLIB" && RANLIB=:
5717test -z "$STRIP" && STRIP=:
5718test -z "$ac_objext" && ac_objext=o
5719
5720# Determine commands to create old-style static archives.
5721old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
5722old_postinstall_cmds='chmod 644 $oldlib'
5723old_postuninstall_cmds=
5724
5725if test -n "$RANLIB"; then
5726  case $host_os in
5727  openbsd*)
5728    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
5729    ;;
5730  *)
5731    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
5732    ;;
5733  esac
5734  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
5735fi
5736
5737# Only perform the check for file, if the check method requires it
5738case $deplibs_check_method in
5739file_magic*)
5740  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
5741    AC_PATH_MAGIC
5742  fi
5743  ;;
5744esac
5745
5746ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
5747ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
5748enable_win32_dll=yes, enable_win32_dll=no)
5749
5750AC_ARG_ENABLE([libtool-lock],
5751    [AC_HELP_STRING([--disable-libtool-lock],
5752	[avoid locking (might break parallel builds)])])
5753test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
5754
5755AC_ARG_WITH([pic],
5756    [AC_HELP_STRING([--with-pic],
5757	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
5758    [pic_mode="$withval"],
5759    [pic_mode=default])
5760test -z "$pic_mode" && pic_mode=default
5761
5762# Use C for the default configuration in the libtool script
5763tagname=
5764AC_LIBTOOL_LANG_C_CONFIG
5765_LT_AC_TAGCONFIG
5766])# AC_LIBTOOL_SETUP
5767
5768
5769# _LT_AC_SYS_COMPILER
5770# -------------------
5771AC_DEFUN([_LT_AC_SYS_COMPILER],
5772[AC_REQUIRE([AC_PROG_CC])dnl
5773
5774# If no C compiler was specified, use CC.
5775LTCC=${LTCC-"$CC"}
5776
5777# Allow CC to be a program name with arguments.
5778set dummy $CC
5779compiler="[$]2"
5780])# _LT_AC_SYS_COMPILER
5781
5782
5783# _LT_AC_SYS_LIBPATH_AIX
5784# ----------------------
5785# Links a minimal program and checks the executable
5786# for the system default hardcoded library path. In most cases,
5787# this is /usr/lib:/lib, but when the MPI compilers are used
5788# the location of the communication and MPI libs are included too.
5789# If we don't find anything, use the default library path according
5790# to the aix ld manual.
5791AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
5792[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
5793aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
5794}'`
5795# Check for a 64-bit object if we didn't find anything.
5796if 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; }
5797}'`; fi],[])
5798if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
5799])# _LT_AC_SYS_LIBPATH_AIX
5800
5801
5802# _LT_AC_PROG_ECHO_BACKSLASH
5803# --------------------------
5804# Add some code to the start of the generated configure script which
5805# will find an echo command which doesn't interpret backslashes.
5806AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
5807[ifdef([AC_DIVERSION_NOTICE],
5808	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
5809	 [AC_DIVERT_PUSH(NOTICE)])
5810
5811# Check that we are running under the correct shell.
5812SHELL=${CONFIG_SHELL-/bin/sh}
5813
5814case X$ECHO in
5815X*--fallback-echo)
5816  # Remove one level of quotation (which was required for Make).
5817  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
5818  ;;
5819esac
5820
5821echo=${ECHO-echo}
5822if test "X[$]1" = X--no-reexec; then
5823  # Discard the --no-reexec flag, and continue.
5824  shift
5825elif test "X[$]1" = X--fallback-echo; then
5826  # Avoid inline document here, it may be left over
5827  :
5828elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
5829  # Yippee, $echo works!
5830  :
5831else
5832  # Restart under the correct shell.
5833  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
5834fi
5835
5836if test "X[$]1" = X--fallback-echo; then
5837  # used as fallback echo
5838  shift
5839  cat <<EOF
5840[$]*
5841EOF
5842  exit 0
5843fi
5844
5845# The HP-UX ksh and POSIX shell print the target directory to stdout
5846# if CDPATH is set.
5847if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
5848
5849if test -z "$ECHO"; then
5850if test "X${echo_test_string+set}" != Xset; then
5851# find a string as large as possible, as long as the shell can cope with it
5852  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
5853    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
5854    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
5855       echo_test_string="`eval $cmd`" &&
5856       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
5857    then
5858      break
5859    fi
5860  done
5861fi
5862
5863if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
5864   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
5865   test "X$echo_testing_string" = "X$echo_test_string"; then
5866  :
5867else
5868  # The Solaris, AIX, and Digital Unix default echo programs unquote
5869  # backslashes.  This makes it impossible to quote backslashes using
5870  #   echo "$something" | sed 's/\\/\\\\/g'
5871  #
5872  # So, first we look for a working echo in the user's PATH.
5873
5874  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
5875  for dir in $PATH /usr/ucb; do
5876    IFS="$lt_save_ifs"
5877    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
5878       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
5879       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
5880       test "X$echo_testing_string" = "X$echo_test_string"; then
5881      echo="$dir/echo"
5882      break
5883    fi
5884  done
5885  IFS="$lt_save_ifs"
5886
5887  if test "X$echo" = Xecho; then
5888    # We didn't find a better echo, so look for alternatives.
5889    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
5890       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
5891       test "X$echo_testing_string" = "X$echo_test_string"; then
5892      # This shell has a builtin print -r that does the trick.
5893      echo='print -r'
5894    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
5895	 test "X$CONFIG_SHELL" != X/bin/ksh; then
5896      # If we have ksh, try running configure again with it.
5897      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
5898      export ORIGINAL_CONFIG_SHELL
5899      CONFIG_SHELL=/bin/ksh
5900      export CONFIG_SHELL
5901      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
5902    else
5903      # Try using printf.
5904      echo='printf %s\n'
5905      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
5906	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
5907	 test "X$echo_testing_string" = "X$echo_test_string"; then
5908	# Cool, printf works
5909	:
5910      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
5911	   test "X$echo_testing_string" = 'X\t' &&
5912	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
5913	   test "X$echo_testing_string" = "X$echo_test_string"; then
5914	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
5915	export CONFIG_SHELL
5916	SHELL="$CONFIG_SHELL"
5917	export SHELL
5918	echo="$CONFIG_SHELL [$]0 --fallback-echo"
5919      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
5920	   test "X$echo_testing_string" = 'X\t' &&
5921	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
5922	   test "X$echo_testing_string" = "X$echo_test_string"; then
5923	echo="$CONFIG_SHELL [$]0 --fallback-echo"
5924      else
5925	# maybe with a smaller string...
5926	prev=:
5927
5928	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
5929	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
5930	  then
5931	    break
5932	  fi
5933	  prev="$cmd"
5934	done
5935
5936	if test "$prev" != 'sed 50q "[$]0"'; then
5937	  echo_test_string=`eval $prev`
5938	  export echo_test_string
5939	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
5940	else
5941	  # Oops.  We lost completely, so just stick with echo.
5942	  echo=echo
5943	fi
5944      fi
5945    fi
5946  fi
5947fi
5948fi
5949
5950# Copy echo and quote the copy suitably for passing to libtool from
5951# the Makefile, instead of quoting the original, which is used later.
5952ECHO=$echo
5953if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
5954   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
5955fi
5956
5957AC_SUBST(ECHO)
5958AC_DIVERT_POP
5959])# _LT_AC_PROG_ECHO_BACKSLASH
5960
5961
5962# _LT_AC_LOCK
5963# -----------
5964AC_DEFUN([_LT_AC_LOCK],
5965[AC_ARG_ENABLE([libtool-lock],
5966    [AC_HELP_STRING([--disable-libtool-lock],
5967	[avoid locking (might break parallel builds)])])
5968test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
5969
5970# Some flags need to be propagated to the compiler or linker for good
5971# libtool support.
5972case $host in
5973ia64-*-hpux*)
5974  # Find out which ABI we are using.
5975  echo 'int i;' > conftest.$ac_ext
5976  if AC_TRY_EVAL(ac_compile); then
5977    case `/usr/bin/file conftest.$ac_objext` in
5978    *ELF-32*)
5979      HPUX_IA64_MODE="32"
5980      ;;
5981    *ELF-64*)
5982      HPUX_IA64_MODE="64"
5983      ;;
5984    esac
5985  fi
5986  rm -rf conftest*
5987  ;;
5988*-*-irix6*)
5989  # Find out which ABI we are using.
5990  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
5991  if AC_TRY_EVAL(ac_compile); then
5992    case `/usr/bin/file conftest.$ac_objext` in
5993    *32-bit*)
5994      LD="${LD-ld} -32"
5995      ;;
5996    *N32*)
5997      LD="${LD-ld} -n32"
5998      ;;
5999    *64-bit*)
6000      LD="${LD-ld} -64"
6001      ;;
6002    esac
6003  fi
6004  rm -rf conftest*
6005  ;;
6006
6007*-*-linux*)
6008  # Test if the compiler is 64bit
6009  echo 'int i;' > conftest.$ac_ext
6010  if AC_TRY_EVAL(ac_compile); then
6011    case `/usr/bin/file conftest.$ac_objext` in
6012    *"ELF 32"*)
6013      LINUX_64_MODE="32"
6014      ;;
6015    *"ELF 64"*)
6016      LINUX_64_MODE="64"
6017      ;;
6018    esac
6019  fi
6020  rm -rf conftest*
6021  ;;
6022
6023*-*-sco3.2v5*)
6024  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
6025  SAVE_CFLAGS="$CFLAGS"
6026  CFLAGS="$CFLAGS -belf"
6027  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
6028    [AC_LANG_PUSH(C)
6029     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
6030     AC_LANG_POP])
6031  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
6032    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
6033    CFLAGS="$SAVE_CFLAGS"
6034  fi
6035  ;;
6036ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
6037[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
6038  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
6039  AC_CHECK_TOOL(AS, as, false)
6040  AC_CHECK_TOOL(OBJDUMP, objdump, false)
6041
6042  # recent cygwin and mingw systems supply a stub DllMain which the user
6043  # can override, but on older systems we have to supply one
6044  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
6045    [AC_TRY_LINK([],
6046      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
6047      DllMain (0, 0, 0);],
6048      [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
6049
6050  case $host/$CC in
6051  *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
6052    # old mingw systems require "-dll" to link a DLL, while more recent ones
6053    # require "-mdll"
6054    SAVE_CFLAGS="$CFLAGS"
6055    CFLAGS="$CFLAGS -mdll"
6056    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
6057      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
6058    CFLAGS="$SAVE_CFLAGS" ;;
6059  *-*-cygwin* | *-*-pw32*)
6060    # cygwin systems need to pass --dll to the linker, and not link
6061    # crt.o which will require a WinMain@16 definition.
6062    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
6063  esac
6064  ;;
6065  ])
6066esac
6067
6068need_locks="$enable_libtool_lock"
6069
6070])# _LT_AC_LOCK
6071
6072
6073# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
6074#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
6075# ----------------------------------------------------------------
6076# Check whether the given compiler option works
6077AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
6078[AC_CACHE_CHECK([$1], [$2],
6079  [$2=no
6080  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
6081   save_CFLAGS="$CFLAGS"
6082   CFLAGS="$CFLAGS $3"
6083   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6084   if (eval $ac_compile 2>conftest.err) && test -s $ac_outfile; then
6085     # The compiler can only warn and ignore the option if not recognized
6086     # So say no if there are warnings
6087     if test -s conftest.err; then
6088       # Append any errors to the config.log.
6089       cat conftest.err 1>&AS_MESSAGE_LOG_FD
6090     else
6091       $2=yes
6092     fi
6093   fi
6094   $rm conftest*
6095   CFLAGS="$save_CFLAGS"
6096])
6097
6098if test x"[$]$2" = xyes; then
6099    ifelse([$5], , :, [$5])
6100else
6101    ifelse([$6], , :, [$6])
6102fi
6103])# AC_LIBTOOL_COMPILER_OPTION
6104
6105
6106# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
6107#                          [ACTION-SUCCESS], [ACTION-FAILURE])
6108# ------------------------------------------------------------
6109# Check whether the given compiler option works
6110AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
6111[AC_CACHE_CHECK([$1], [$2],
6112  [$2=no
6113   save_LDFLAGS="$LDFLAGS"
6114   LDFLAGS="$LDFLAGS $3"
6115   echo "$lt_simple_link_test_code" > conftest.$ac_ext
6116   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
6117     # The compiler can only warn and ignore the option if not recognized
6118     # So say no if there are warnings
6119     if test -s conftest.err; then
6120       # Append any errors to the config.log.
6121       cat conftest.err 1>&AS_MESSAGE_LOG_FD
6122     else
6123       $2=yes
6124     fi
6125   fi
6126   $rm conftest*
6127   LDFLAGS="$save_LDFLAGS"
6128])
6129
6130if test x"[$]$2" = xyes; then
6131    ifelse([$4], , :, [$4])
6132else
6133    ifelse([$5], , :, [$5])
6134fi
6135])# AC_LIBTOOL_LINKER_OPTION
6136
6137
6138# AC_LIBTOOL_SYS_MAX_CMD_LEN
6139# --------------------------
6140AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
6141[# find the maximum length of command line arguments
6142AC_MSG_CHECKING([the maximum length of command line arguments])
6143AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
6144  i=0
6145  testring="ABCD"
6146
6147  case $host_os in
6148  msdosdjgpp*)
6149    # On DJGPP, this test can blow up pretty badly due to problems in libc
6150    # (any single argument exceeding 2000 bytes causes a buffer overrun
6151    # during glob expansion).  Even if it were fixed, the result of this
6152    # check would be larger than it should be.
6153    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
6154    ;;
6155
6156  gnu*)
6157    # Under GNU Hurd, this test is not required because there is
6158    # no limit to the length of command line arguments.
6159    # Libtool will interpret -1 as no limit whatsoever
6160    lt_cv_sys_max_cmd_len=-1;
6161    ;;
6162
6163  *)
6164    # If test is not a shell built-in, we'll probably end up computing a
6165    # maximum length that is only half of the actual maximum length, but
6166    # we can't tell.
6167    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
6168	       = "XX$testring") >/dev/null 2>&1 &&
6169	    new_result=`expr "X$testring" : ".*" 2>&1` &&
6170	    lt_cv_sys_max_cmd_len=$new_result &&
6171	    test $i != 17 # 1/2 MB should be enough
6172    do
6173      i=`expr $i + 1`
6174      testring=$testring$testring
6175    done
6176    testring=
6177    # Add a significant safety factor because C++ compilers can tack on massive
6178    # amounts of additional arguments before passing them to the linker.
6179    # It appears as though 1/2 is a usable value.
6180    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
6181    ;;
6182  esac
6183])
6184if test -n $lt_cv_sys_max_cmd_len ; then
6185  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
6186else
6187  AC_MSG_RESULT(none)
6188fi
6189])# AC_LIBTOOL_SYS_MAX_CMD_LEN
6190
6191
6192# _LT_AC_CHECK_DLFCN
6193# --------------------
6194AC_DEFUN([_LT_AC_CHECK_DLFCN],
6195[AC_CHECK_HEADERS(dlfcn.h)dnl
6196])# _LT_AC_CHECK_DLFCN
6197
6198
6199# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
6200#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
6201# ------------------------------------------------------------------
6202AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
6203[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
6204if test "$cross_compiling" = yes; then :
6205  [$4]
6206else
6207  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
6208  lt_status=$lt_dlunknown
6209  cat > conftest.$ac_ext <<EOF
6210[#line __oline__ "configure"
6211#include "confdefs.h"
6212
6213#if HAVE_DLFCN_H
6214#include <dlfcn.h>
6215#endif
6216
6217#include <stdio.h>
6218
6219#ifdef RTLD_GLOBAL
6220#  define LT_DLGLOBAL		RTLD_GLOBAL
6221#else
6222#  ifdef DL_GLOBAL
6223#    define LT_DLGLOBAL		DL_GLOBAL
6224#  else
6225#    define LT_DLGLOBAL		0
6226#  endif
6227#endif
6228
6229/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
6230   find out it does not work in some platform. */
6231#ifndef LT_DLLAZY_OR_NOW
6232#  ifdef RTLD_LAZY
6233#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
6234#  else
6235#    ifdef DL_LAZY
6236#      define LT_DLLAZY_OR_NOW		DL_LAZY
6237#    else
6238#      ifdef RTLD_NOW
6239#        define LT_DLLAZY_OR_NOW	RTLD_NOW
6240#      else
6241#        ifdef DL_NOW
6242#          define LT_DLLAZY_OR_NOW	DL_NOW
6243#        else
6244#          define LT_DLLAZY_OR_NOW	0
6245#        endif
6246#      endif
6247#    endif
6248#  endif
6249#endif
6250
6251#ifdef __cplusplus
6252extern "C" void exit (int);
6253#endif
6254
6255void fnord() { int i=42;}
6256int main ()
6257{
6258  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
6259  int status = $lt_dlunknown;
6260
6261  if (self)
6262    {
6263      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
6264      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
6265      /* dlclose (self); */
6266    }
6267
6268    exit (status);
6269}]
6270EOF
6271  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
6272    (./conftest; exit; ) 2>/dev/null
6273    lt_status=$?
6274    case x$lt_status in
6275      x$lt_dlno_uscore) $1 ;;
6276      x$lt_dlneed_uscore) $2 ;;
6277      x$lt_unknown|x*) $3 ;;
6278    esac
6279  else :
6280    # compilation failed
6281    $3
6282  fi
6283fi
6284rm -fr conftest*
6285])# _LT_AC_TRY_DLOPEN_SELF
6286
6287
6288# AC_LIBTOOL_DLOPEN_SELF
6289# -------------------
6290AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
6291[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
6292if test "x$enable_dlopen" != xyes; then
6293  enable_dlopen=unknown
6294  enable_dlopen_self=unknown
6295  enable_dlopen_self_static=unknown
6296else
6297  lt_cv_dlopen=no
6298  lt_cv_dlopen_libs=
6299
6300  case $host_os in
6301  beos*)
6302    lt_cv_dlopen="load_add_on"
6303    lt_cv_dlopen_libs=
6304    lt_cv_dlopen_self=yes
6305    ;;
6306
6307  cygwin* | mingw* | pw32*)
6308    lt_cv_dlopen="LoadLibrary"
6309    lt_cv_dlopen_libs=
6310   ;;
6311
6312  *)
6313    AC_CHECK_FUNC([shl_load],
6314	  [lt_cv_dlopen="shl_load"],
6315      [AC_CHECK_LIB([dld], [shl_load],
6316	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
6317	[AC_CHECK_FUNC([dlopen],
6318	      [lt_cv_dlopen="dlopen"],
6319	  [AC_CHECK_LIB([dl], [dlopen],
6320		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
6321	    [AC_CHECK_LIB([svld], [dlopen],
6322		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
6323	      [AC_CHECK_LIB([dld], [dld_link],
6324		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
6325	      ])
6326	    ])
6327	  ])
6328	])
6329      ])
6330    ;;
6331  esac
6332
6333  if test "x$lt_cv_dlopen" != xno; then
6334    enable_dlopen=yes
6335  else
6336    enable_dlopen=no
6337  fi
6338
6339  case $lt_cv_dlopen in
6340  dlopen)
6341    save_CPPFLAGS="$CPPFLAGS"
6342    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
6343
6344    save_LDFLAGS="$LDFLAGS"
6345    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
6346
6347    save_LIBS="$LIBS"
6348    LIBS="$lt_cv_dlopen_libs $LIBS"
6349
6350    AC_CACHE_CHECK([whether a program can dlopen itself],
6351	  lt_cv_dlopen_self, [dnl
6352	  _LT_AC_TRY_DLOPEN_SELF(
6353	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
6354	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
6355    ])
6356
6357    if test "x$lt_cv_dlopen_self" = xyes; then
6358      LDFLAGS="$LDFLAGS $link_static_flag"
6359      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
6360    	  lt_cv_dlopen_self_static, [dnl
6361	  _LT_AC_TRY_DLOPEN_SELF(
6362	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
6363	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
6364      ])
6365    fi
6366
6367    CPPFLAGS="$save_CPPFLAGS"
6368    LDFLAGS="$save_LDFLAGS"
6369    LIBS="$save_LIBS"
6370    ;;
6371  esac
6372
6373  case $lt_cv_dlopen_self in
6374  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
6375  *) enable_dlopen_self=unknown ;;
6376  esac
6377
6378  case $lt_cv_dlopen_self_static in
6379  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
6380  *) enable_dlopen_self_static=unknown ;;
6381  esac
6382fi
6383])# AC_LIBTOOL_DLOPEN_SELF
6384
6385
6386# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
6387# ---------------------------------
6388# Check to see if options -c and -o are simultaneously supported by compiler
6389AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
6390[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
6391AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
6392  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
6393  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
6394   $rm -r conftest 2>/dev/null
6395   mkdir conftest
6396   cd conftest
6397   mkdir out
6398   ifelse([$1],[],[save_CFLAGS="$CFLAGS"
6399		   CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"],
6400	  [$1],[CXX],[save_CXXFLAGS="$CXXFLAGS"
6401		   CXXFLAGS="$CXXFLAGS -o out/conftest2.$ac_objext"],
6402	  [$1],[GCJ],[save_GCJFLAGS="$GCJFLAGS"
6403		   GCJFLAGS="$GCJFLAGS -o out/conftest2.$ac_objext"])
6404   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6405
6406   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
6407   # that will create temporary files in the current directory regardless of
6408   # the output directory.  Thus, making CWD read-only will cause this test
6409   # to fail, enabling locking or at least warning the user not to do parallel
6410   # builds.
6411   chmod -w .
6412
6413   if (eval $ac_compile 2>out/conftest.err) && test -s out/conftest2.$ac_objext
6414   then
6415     # The compiler can only warn and ignore the option if not recognized
6416     # So say no if there are warnings
6417     if test -s out/conftest.err; then
6418       # Append any errors to the config.log.
6419       cat out/conftest.err 1>&AS_MESSAGE_LOG_FD
6420     else
6421       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
6422     fi
6423   fi
6424   ifelse([$1],[],[CFLAGS="$save_CFLAGS"],
6425	  [$1],[CXX],[CXXFLAGS="$save_CXXFLAGS"],
6426	  [$1],[GCJ],[GCJFLAGS="$save_GCJFLAGS"])
6427   chmod u+w .
6428   $rm conftest* out/*
6429   rmdir out
6430   cd ..
6431   rmdir conftest
6432   $rm conftest*
6433])
6434])# AC_LIBTOOL_PROG_CC_C_O
6435
6436
6437# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
6438# -----------------------------------------
6439# Check to see if we can do hard links to lock some files if needed
6440AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
6441[AC_REQUIRE([_LT_AC_LOCK])dnl
6442
6443hard_links="nottested"
6444if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
6445  # do not overwrite the value of need_locks provided by the user
6446  AC_MSG_CHECKING([if we can lock with hard links])
6447  hard_links=yes
6448  $rm conftest*
6449  ln conftest.a conftest.b 2>/dev/null && hard_links=no
6450  touch conftest.a
6451  ln conftest.a conftest.b 2>&5 || hard_links=no
6452  ln conftest.a conftest.b 2>/dev/null && hard_links=no
6453  AC_MSG_RESULT([$hard_links])
6454  if test "$hard_links" = no; then
6455    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
6456    need_locks=warn
6457  fi
6458else
6459  need_locks=no
6460fi
6461])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
6462
6463
6464# AC_LIBTOOL_OBJDIR
6465# -----------------
6466AC_DEFUN([AC_LIBTOOL_OBJDIR],
6467[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
6468[rm -f .libs 2>/dev/null
6469mkdir .libs 2>/dev/null
6470if test -d .libs; then
6471  lt_cv_objdir=.libs
6472else
6473  # MS-DOS does not allow filenames that begin with a dot.
6474  lt_cv_objdir=_libs
6475fi
6476rmdir .libs 2>/dev/null])
6477objdir=$lt_cv_objdir
6478])# AC_LIBTOOL_OBJDIR
6479
6480
6481# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
6482# ----------------------------------------------
6483# Check hardcoding attributes.
6484AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
6485[AC_MSG_CHECKING([how to hardcode library paths into programs])
6486_LT_AC_TAGVAR(hardcode_action, $1)=
6487if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
6488   test -n "$_LT_AC_TAGVAR(runpath_var $1)"; then
6489
6490  # We can hardcode non-existant directories.
6491  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
6492     # If the only mechanism to avoid hardcoding is shlibpath_var, we
6493     # have to relink, otherwise we might link with an installed library
6494     # when we should be linking with a yet-to-be-installed one
6495     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
6496     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
6497    # Linking always hardcodes the temporary library directory.
6498    _LT_AC_TAGVAR(hardcode_action, $1)=relink
6499  else
6500    # We can link without hardcoding, and we can hardcode nonexisting dirs.
6501    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
6502  fi
6503else
6504  # We cannot hardcode anything, or else we can only hardcode existing
6505  # directories.
6506  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
6507fi
6508AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
6509
6510if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
6511  # Fast installation is not supported
6512  enable_fast_install=no
6513elif test "$shlibpath_overrides_runpath" = yes ||
6514     test "$enable_shared" = no; then
6515  # Fast installation is not necessary
6516  enable_fast_install=needless
6517fi
6518])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
6519
6520
6521# AC_LIBTOOL_SYS_LIB_STRIP
6522# ------------------------
6523AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
6524[striplib=
6525old_striplib=
6526AC_MSG_CHECKING([whether stripping libraries is possible])
6527if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
6528  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
6529  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
6530  AC_MSG_RESULT([yes])
6531else
6532  AC_MSG_RESULT([no])
6533fi
6534])# AC_LIBTOOL_SYS_LIB_STRIP
6535
6536
6537# AC_LIBTOOL_SYS_DYNAMIC_LINKER
6538# -----------------------------
6539# PORTME Fill in your ld.so characteristics
6540AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
6541[AC_MSG_CHECKING([dynamic linker characteristics])
6542library_names_spec=
6543libname_spec='lib$name'
6544soname_spec=
6545postinstall_cmds=
6546postuninstall_cmds=
6547finish_cmds=
6548finish_eval=
6549shlibpath_var=
6550shlibpath_overrides_runpath=unknown
6551version_type=none
6552dynamic_linker="$host_os ld.so"
6553sys_lib_dlsearch_path_spec="/lib /usr/lib"
6554sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
6555need_lib_prefix=unknown
6556hardcode_into_libs=no
6557
6558# when you set need_version to no, make sure it does not cause -set_version
6559# flags to be left without arguments
6560need_version=unknown
6561
6562case $host_os in
6563aix3*)
6564  version_type=linux
6565  library_names_spec='${libname}${release}.so$versuffix $libname.a'
6566  shlibpath_var=LIBPATH
6567
6568  # AIX 3 has no versioning support, so we append a major version to the name.
6569  soname_spec='${libname}${release}.so$major'
6570  ;;
6571
6572aix4* | aix5*)
6573  version_type=linux
6574  if test "$host_cpu" = ia64; then
6575    # AIX 5 supports IA64
6576    library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
6577    shlibpath_var=LD_LIBRARY_PATH
6578  else
6579    # With GCC up to 2.95.x, collect2 would create an import file
6580    # for dependence libraries.  The import file would start with
6581    # the line `#! .'.  This would cause the generated library to
6582    # depend on `.', always an invalid library.  This was fixed in
6583    # development snapshots of GCC prior to 3.0.
6584    case $host_os in
6585      aix4 | aix4.[[01]] | aix4.[[01]].*)
6586      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
6587	   echo ' yes '
6588	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
6589	:
6590      else
6591	can_build_shared=no
6592      fi
6593      ;;
6594    esac
6595    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
6596    # soname into executable. Probably we can add versioning support to
6597    # collect2, so additional links can be useful in future.
6598    if test "$aix_use_runtimelinking" = yes; then
6599      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
6600      # instead of lib<name>.a to let people know that these are not
6601      # typical AIX shared libraries.
6602      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6603    else
6604      # We preserve .a as extension for shared libraries through AIX4.2
6605      # and later when we are not doing run time linking.
6606      library_names_spec='${libname}${release}.a $libname.a'
6607      soname_spec='${libname}${release}.so$major'
6608    fi
6609    shlibpath_var=LIBPATH
6610  fi
6611  ;;
6612
6613amigaos*)
6614  library_names_spec='$libname.ixlibrary $libname.a'
6615  # Create ${libname}_ixlibrary.a entries in /sys/libs.
6616  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'
6617  ;;
6618
6619beos*)
6620  library_names_spec='${libname}.so'
6621  dynamic_linker="$host_os ld.so"
6622  shlibpath_var=LIBRARY_PATH
6623  ;;
6624
6625bsdi4*)
6626  version_type=linux
6627  need_version=no
6628  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6629  soname_spec='${libname}${release}.so$major'
6630  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
6631  shlibpath_var=LD_LIBRARY_PATH
6632  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
6633  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
6634  # the default ld.so.conf also contains /usr/contrib/lib and
6635  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
6636  # libtool to hard-code these into programs
6637  ;;
6638
6639cygwin* | mingw* | pw32*)
6640  version_type=windows
6641  need_version=no
6642  need_lib_prefix=no
6643  case $GCC,$host_os in
6644  yes,cygwin*)
6645    library_names_spec='$libname.dll.a'
6646    sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib"
6647    soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
6648    postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
6649      dldir=$destdir/`dirname \$dlpath`~
6650      test -d \$dldir || mkdir -p \$dldir~
6651      $install_prog .libs/$dlname \$dldir/$dlname'
6652    postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
6653      dlpath=$dir/\$dldll~
6654       $rm \$dlpath'
6655    ;;
6656  yes,mingw*)
6657    library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
6658    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://"`
6659    if echo "$sys_lib_search_path_spec" | [egrep ';[C-Z]:/' >/dev/null]; then
6660      # It is most probably a Windows format PATH printed by
6661      # mingw gcc, but we are running on Cygwin. Gcc prints its search
6662      # path with ; separators, and with drive letters. We can handle the
6663      # drive letters (cygwin fileutils understands them), so leave them,
6664      # especially as we might pass files found there to a mingw objdump,
6665      # which wouldn't understand a cygwinified path. Ahh.
6666      sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed -e 's/;/ /g'`
6667    else
6668      sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed  -e "s/$PATH_SEPARATOR/ /g"`
6669    fi
6670    ;;
6671  yes,pw32*)
6672    library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6673    ;;
6674  *)
6675    library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
6676    ;;
6677  esac
6678  dynamic_linker='Win32 ld.exe'
6679  # FIXME: first we should search . and the directory the executable is in
6680  shlibpath_var=PATH
6681  ;;
6682
6683darwin* | rhapsody*)
6684  dynamic_linker="$host_os dyld"
6685  version_type=darwin
6686  need_lib_prefix=no
6687  need_version=no
6688  # FIXME: Relying on posixy $() will cause problems for
6689  #        cross-compilation, but unfortunately the echo tests do not
6690  #        yet detect zsh echo's removal of \ escapes.
6691  library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
6692  soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
6693  shlibpath_overrides_runpath=yes
6694  shlibpath_var=DYLD_LIBRARY_PATH
6695  ;;
6696
6697dgux*)
6698  version_type=linux
6699  need_lib_prefix=no
6700  need_version=no
6701  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6702  soname_spec='${libname}${release}.so$major'
6703  shlibpath_var=LD_LIBRARY_PATH
6704  ;;
6705
6706freebsd1*)
6707  dynamic_linker=no
6708  ;;
6709
6710freebsd*)
6711  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
6712  version_type=freebsd-$objformat
6713  case $version_type in
6714    freebsd-elf*)
6715      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
6716      need_version=no
6717      need_lib_prefix=no
6718      ;;
6719    freebsd-*)
6720      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
6721      need_version=yes
6722      ;;
6723  esac
6724  shlibpath_var=LD_LIBRARY_PATH
6725  case $host_os in
6726  freebsd2*)
6727    shlibpath_overrides_runpath=yes
6728    ;;
6729  freebsd3.[01]* | freebsdelf3.[01]*)
6730    shlibpath_overrides_runpath=yes
6731    hardcode_into_libs=yes
6732    ;;
6733  *) # from 3.2 on
6734    shlibpath_overrides_runpath=no
6735    hardcode_into_libs=yes
6736    ;;
6737  esac
6738  ;;
6739
6740gnu*)
6741  version_type=linux
6742  need_lib_prefix=no
6743  need_version=no
6744  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
6745  soname_spec='${libname}${release}.so$major'
6746  shlibpath_var=LD_LIBRARY_PATH
6747  hardcode_into_libs=yes
6748  ;;
6749
6750hpux9* | hpux10* | hpux11*)
6751  # Give a soname corresponding to the major version so that dld.sl refuses to
6752  # link against other versions.
6753  version_type=sunos
6754  need_lib_prefix=no
6755  need_version=no
6756  if test "$host_cpu" = ia64; then
6757    hardcode_into_libs=yes
6758    dynamic_linker="$host_os dld.so"
6759    shlibpath_var=LD_LIBRARY_PATH
6760    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
6761    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6762    soname_spec='${libname}${release}.so$major'
6763    if test "X$HPUX_IA64_MODE" = X32; then
6764      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
6765    else
6766      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
6767    fi
6768    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
6769  else
6770    dynamic_linker="$host_os dld.sl"
6771    shlibpath_var=SHLIB_PATH
6772    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6773    library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
6774    soname_spec='${libname}${release}.sl$major'
6775  fi
6776  # HP-UX runs *really* slowly unless shared libraries are mode 555.
6777  postinstall_cmds='chmod 555 $lib'
6778  ;;
6779
6780irix5* | irix6* | nonstopux*)
6781  case $host_os in
6782    nonstopux*) version_type=nonstopux ;;
6783    *)          version_type=irix ;;
6784  esac
6785  need_lib_prefix=no
6786  need_version=no
6787  soname_spec='${libname}${release}.so$major'
6788  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
6789  case $host_os in
6790  irix5* | nonstopux*)
6791    libsuff= shlibsuff=
6792    ;;
6793  *)
6794    case $LD in # libtool.m4 will add one of these switches to LD
6795    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
6796    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
6797    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
6798    *) libsuff= shlibsuff= libmagic=never-match;;
6799    esac
6800    ;;
6801  esac
6802  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6803  shlibpath_overrides_runpath=no
6804  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
6805  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
6806  ;;
6807
6808# No shared lib support for Linux oldld, aout, or coff.
6809linux*oldld* | linux*aout* | linux*coff*)
6810  dynamic_linker=no
6811  ;;
6812
6813# This must be Linux ELF.
6814linux*)
6815  version_type=linux
6816  need_lib_prefix=no
6817  need_version=no
6818  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6819  soname_spec='${libname}${release}.so$major'
6820  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6821  libsuff=
6822  if test "x$LINUX_64_MODE" = x64; then
6823    # Some platforms are per default 64-bit, so there's no /lib64
6824    if test -d /lib64; then
6825      libsuff=64
6826    fi
6827  fi
6828  shlibpath_var=LD_LIBRARY_PATH
6829  shlibpath_overrides_runpath=no
6830  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
6831  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
6832  # This implies no fast_install, which is unacceptable.
6833  # Some rework will be needed to allow for fast_install
6834  # before this can be enabled.
6835  hardcode_into_libs=yes
6836
6837  # We used to test for /lib/ld.so.1 and disable shared libraries on
6838  # powerpc, because MkLinux only supported shared libraries with the
6839  # GNU dynamic linker.  Since this was broken with cross compilers,
6840  # most powerpc-linux boxes support dynamic linking these days and
6841  # people can always --disable-shared, the test was removed, and we
6842  # assume the GNU/Linux dynamic linker is in use.
6843  dynamic_linker='GNU/Linux ld.so'
6844  ;;
6845
6846netbsd*)
6847  version_type=sunos
6848  need_lib_prefix=no
6849  need_version=no
6850  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6851    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6852    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6853    dynamic_linker='NetBSD (a.out) ld.so'
6854  else
6855    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
6856    soname_spec='${libname}${release}.so$major'
6857    dynamic_linker='NetBSD ld.elf_so'
6858  fi
6859  shlibpath_var=LD_LIBRARY_PATH
6860  shlibpath_overrides_runpath=yes
6861  hardcode_into_libs=yes
6862  ;;
6863
6864newsos6)
6865  version_type=linux
6866  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6867  shlibpath_var=LD_LIBRARY_PATH
6868  shlibpath_overrides_runpath=yes
6869  ;;
6870
6871nto-qnx)
6872  version_type=linux
6873  need_lib_prefix=no
6874  need_version=no
6875  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6876  soname_spec='${libname}${release}.so$major'
6877  shlibpath_var=LD_LIBRARY_PATH
6878  shlibpath_overrides_runpath=yes
6879  ;;
6880
6881openbsd*)
6882  version_type=sunos
6883  need_lib_prefix=no
6884  need_version=no
6885  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6886  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6887  shlibpath_var=LD_LIBRARY_PATH
6888  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6889    case $host_os in
6890      openbsd2.[[89]] | openbsd2.[[89]].*)
6891	shlibpath_overrides_runpath=no
6892	;;
6893      *)
6894	shlibpath_overrides_runpath=yes
6895	;;
6896      esac
6897  else
6898    shlibpath_overrides_runpath=yes
6899  fi
6900  ;;
6901
6902os2*)
6903  libname_spec='$name'
6904  need_lib_prefix=no
6905  library_names_spec='$libname.dll $libname.a'
6906  dynamic_linker='OS/2 ld.exe'
6907  shlibpath_var=LIBPATH
6908  ;;
6909
6910osf3* | osf4* | osf5*)
6911  version_type=osf
6912  need_lib_prefix=no
6913  need_version=no
6914  soname_spec='${libname}${release}.so'
6915  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
6916  shlibpath_var=LD_LIBRARY_PATH
6917  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
6918  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
6919  ;;
6920
6921sco3.2v5*)
6922  version_type=osf
6923  soname_spec='${libname}${release}.so$major'
6924  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6925  shlibpath_var=LD_LIBRARY_PATH
6926  ;;
6927
6928solaris*)
6929  version_type=linux
6930  need_lib_prefix=no
6931  need_version=no
6932  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6933  soname_spec='${libname}${release}.so$major'
6934  shlibpath_var=LD_LIBRARY_PATH
6935  shlibpath_overrides_runpath=yes
6936  hardcode_into_libs=yes
6937  # ldd complains unless libraries are executable
6938  postinstall_cmds='chmod +x $lib'
6939  ;;
6940
6941sunos4*)
6942  version_type=sunos
6943  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6944  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
6945  shlibpath_var=LD_LIBRARY_PATH
6946  shlibpath_overrides_runpath=yes
6947  if test "$with_gnu_ld" = yes; then
6948    need_lib_prefix=no
6949  fi
6950  need_version=yes
6951  ;;
6952
6953sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6954  version_type=linux
6955  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6956  soname_spec='${libname}${release}.so$major'
6957  shlibpath_var=LD_LIBRARY_PATH
6958  case $host_vendor in
6959    sni)
6960      shlibpath_overrides_runpath=no
6961      ;;
6962    motorola)
6963      need_lib_prefix=no
6964      need_version=no
6965      shlibpath_overrides_runpath=no
6966      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
6967      ;;
6968  esac
6969  ;;
6970
6971sysv4*MP*)
6972  if test -d /usr/nec ;then
6973    version_type=linux
6974    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
6975    soname_spec='$libname.so.$major'
6976    shlibpath_var=LD_LIBRARY_PATH
6977  fi
6978  ;;
6979
6980uts4*)
6981  version_type=linux
6982  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6983  soname_spec='${libname}${release}.so$major'
6984  shlibpath_var=LD_LIBRARY_PATH
6985  ;;
6986
6987*)
6988  dynamic_linker=no
6989  ;;
6990esac
6991AC_MSG_RESULT([$dynamic_linker])
6992test "$dynamic_linker" = no && can_build_shared=no
6993])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
6994
6995
6996# _LT_AC_TAGCONFIG
6997# ----------------
6998AC_DEFUN([_LT_AC_TAGCONFIG],
6999[AC_ARG_WITH([tags],
7000    [AC_HELP_STRING([--with-tags=TAGS],
7001	[include additional configurations @<:@CXX,GCJ@:>@])],
7002    [tagnames="$withval"],
7003    [tagnames="CXX,GCJ"
7004    case $host_os in
7005      mingw*|cygwin*) tagnames="$tagnames,RC" ;;
7006    esac])
7007
7008if test -f "$ltmain" && test -n "$tagnames"; then
7009  if test ! -f "${ofile}"; then
7010    AC_MSG_WARN([output file `$ofile' does not exist])
7011  fi
7012
7013  if test -z "$LTCC"; then
7014    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
7015    if test -z "$LTCC"; then
7016      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
7017    else
7018      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
7019    fi
7020  fi
7021
7022  # Extract list of available tagged configurations in $ofile.
7023  # Note that this assumes the entire list is on one line.
7024  available_tags=`grep "^available_tags=" "${ofile}" | sed -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
7025
7026  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7027  for tagname in $tagnames; do
7028    IFS="$lt_save_ifs"
7029    # Check whether tagname contains only valid characters
7030    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
7031    "") ;;
7032    *)  AC_MSG_ERROR([invalid tag name: $tagname])
7033	;;
7034    esac
7035
7036    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
7037    then
7038      AC_MSG_ERROR([tag name \"$tagname\" already exists])
7039    fi
7040
7041    # Update the list of available tags.
7042    if test -n "$tagname"; then
7043      echo appending configuration tag \"$tagname\" to $ofile
7044
7045      case $tagname in
7046      CXX)
7047	AC_LIBTOOL_LANG_CXX_CONFIG
7048	;;
7049
7050      GCJ)
7051	AC_LIBTOOL_LANG_GCJ_CONFIG
7052	;;
7053
7054      RC)
7055	AC_LIBTOOL_LANG_RC_CONFIG
7056	;;
7057
7058      *)
7059	AC_MSG_ERROR([Unsupported tag name: $tagname])
7060	;;
7061      esac
7062
7063      # Append the new tag name to the list of available tags.
7064      available_tags="$available_tags $tagname"
7065    fi
7066  done
7067  IFS="$lt_save_ifs"
7068
7069  # Now substitute the updated list of available tags.
7070  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
7071    mv "${ofile}T" "$ofile"
7072    chmod +x "$ofile"
7073  else
7074    rm -f "${ofile}T"
7075    AC_MSG_ERROR([unable to update list of available tagged configurations.])
7076  fi
7077fi
7078])# _LT_AC_TAGCONFIG
7079
7080
7081# AC_LIBTOOL_DLOPEN
7082# -----------------
7083# enable checks for dlopen support
7084AC_DEFUN([AC_LIBTOOL_DLOPEN],
7085 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
7086])# AC_LIBTOOL_DLOPEN
7087
7088
7089# AC_LIBTOOL_WIN32_DLL
7090# --------------------
7091# declare package support for building win32 dll's
7092AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
7093[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
7094])# AC_LIBTOOL_WIN32_DLL
7095
7096
7097# AC_ENABLE_SHARED([DEFAULT])
7098# ---------------------------
7099# implement the --enable-shared flag
7100# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7101AC_DEFUN([AC_ENABLE_SHARED],
7102[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
7103AC_ARG_ENABLE([shared],
7104    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
7105	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
7106    [p=${PACKAGE-default}
7107    case $enableval in
7108    yes) enable_shared=yes ;;
7109    no) enable_shared=no ;;
7110    *)
7111      enable_shared=no
7112      # Look at the argument we got.  We use all the common list separators.
7113      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7114      for pkg in $enableval; do
7115	IFS="$lt_save_ifs"
7116	if test "X$pkg" = "X$p"; then
7117	  enable_shared=yes
7118	fi
7119      done
7120      IFS="$lt_save_ifs"
7121      ;;
7122    esac],
7123    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
7124])# AC_ENABLE_SHARED
7125
7126
7127# AC_DISABLE_SHARED
7128# -----------------
7129#- set the default shared flag to --disable-shared
7130AC_DEFUN([AC_DISABLE_SHARED],
7131[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7132AC_ENABLE_SHARED(no)
7133])# AC_DISABLE_SHARED
7134
7135
7136# AC_ENABLE_STATIC([DEFAULT])
7137# ---------------------------
7138# implement the --enable-static flag
7139# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7140AC_DEFUN([AC_ENABLE_STATIC],
7141[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
7142AC_ARG_ENABLE([static],
7143    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
7144	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
7145    [p=${PACKAGE-default}
7146    case $enableval in
7147    yes) enable_static=yes ;;
7148    no) enable_static=no ;;
7149    *)
7150     enable_static=no
7151      # Look at the argument we got.  We use all the common list separators.
7152      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7153      for pkg in $enableval; do
7154	IFS="$lt_save_ifs"
7155	if test "X$pkg" = "X$p"; then
7156	  enable_static=yes
7157	fi
7158      done
7159      IFS="$lt_save_ifs"
7160      ;;
7161    esac],
7162    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
7163])# AC_ENABLE_STATIC
7164
7165
7166# AC_DISABLE_STATIC
7167# -----------------
7168# set the default static flag to --disable-static
7169AC_DEFUN([AC_DISABLE_STATIC],
7170[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7171AC_ENABLE_STATIC(no)
7172])# AC_DISABLE_STATIC
7173
7174
7175# AC_ENABLE_FAST_INSTALL([DEFAULT])
7176# ---------------------------------
7177# implement the --enable-fast-install flag
7178# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7179AC_DEFUN([AC_ENABLE_FAST_INSTALL],
7180[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
7181AC_ARG_ENABLE([fast-install],
7182    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
7183    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
7184    [p=${PACKAGE-default}
7185    case $enableval in
7186    yes) enable_fast_install=yes ;;
7187    no) enable_fast_install=no ;;
7188    *)
7189      enable_fast_install=no
7190      # Look at the argument we got.  We use all the common list separators.
7191      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7192      for pkg in $enableval; do
7193	IFS="$lt_save_ifs"
7194	if test "X$pkg" = "X$p"; then
7195	  enable_fast_install=yes
7196	fi
7197      done
7198      IFS="$lt_save_ifs"
7199      ;;
7200    esac],
7201    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
7202])# AC_ENABLE_FAST_INSTALL
7203
7204
7205# AC_DISABLE_FAST_INSTALL
7206# -----------------------
7207# set the default to --disable-fast-install
7208AC_DEFUN([AC_DISABLE_FAST_INSTALL],
7209[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7210AC_ENABLE_FAST_INSTALL(no)
7211])# AC_DISABLE_FAST_INSTALL
7212
7213
7214# AC_LIBTOOL_PICMODE([MODE])
7215# --------------------------
7216# implement the --with-pic flag
7217# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
7218AC_DEFUN([AC_LIBTOOL_PICMODE],
7219[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7220pic_mode=ifelse($#,1,$1,default)
7221])# AC_LIBTOOL_PICMODE
7222
7223
7224# AC_PATH_TOOL_PREFIX
7225# -------------------
7226# find a file program which can recognise shared library
7227AC_DEFUN([AC_PATH_TOOL_PREFIX],
7228[AC_MSG_CHECKING([for $1])
7229AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
7230[case $MAGIC_CMD in
7231[[\\/*] |  ?:[\\/]*])
7232  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
7233  ;;
7234*)
7235  lt_save_MAGIC_CMD="$MAGIC_CMD"
7236  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7237dnl $ac_dummy forces splitting on constant user-supplied paths.
7238dnl POSIX.2 word splitting is done only on the output of word expansions,
7239dnl not every word.  This closes a longstanding sh security hole.
7240  ac_dummy="ifelse([$2], , $PATH, [$2])"
7241  for ac_dir in $ac_dummy; do
7242    IFS="$lt_save_ifs"
7243    test -z "$ac_dir" && ac_dir=.
7244    if test -f $ac_dir/$1; then
7245      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
7246      if test -n "$file_magic_test_file"; then
7247	case $deplibs_check_method in
7248	"file_magic "*)
7249	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
7250	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7251	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
7252	    egrep "$file_magic_regex" > /dev/null; then
7253	    :
7254	  else
7255	    cat <<EOF 1>&2
7256
7257*** Warning: the command libtool uses to detect shared libraries,
7258*** $file_magic_cmd, produces output that libtool cannot recognize.
7259*** The result is that libtool may fail to recognize shared libraries
7260*** as such.  This will affect the creation of libtool libraries that
7261*** depend on shared libraries, but programs linked with such libtool
7262*** libraries will work regardless of this problem.  Nevertheless, you
7263*** may want to report the problem to your system manager and/or to
7264*** bug-libtool@gnu.org
7265
7266EOF
7267	  fi ;;
7268	esac
7269      fi
7270      break
7271    fi
7272  done
7273  IFS="$lt_save_ifs"
7274  MAGIC_CMD="$lt_save_MAGIC_CMD"
7275  ;;
7276esac])
7277MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7278if test -n "$MAGIC_CMD"; then
7279  AC_MSG_RESULT($MAGIC_CMD)
7280else
7281  AC_MSG_RESULT(no)
7282fi
7283])# AC_PATH_TOOL_PREFIX
7284
7285
7286# AC_PATH_MAGIC
7287# -------------
7288# find a file program which can recognise a shared library
7289AC_DEFUN([AC_PATH_MAGIC],
7290[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
7291if test -z "$lt_cv_path_MAGIC_CMD"; then
7292  if test -n "$ac_tool_prefix"; then
7293    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
7294  else
7295    MAGIC_CMD=:
7296  fi
7297fi
7298])# AC_PATH_MAGIC
7299
7300
7301# AC_PROG_LD
7302# ----------
7303# find the path to the GNU or non-GNU linker
7304AC_DEFUN([AC_PROG_LD],
7305[AC_ARG_WITH([gnu-ld],
7306    [AC_HELP_STRING([--with-gnu-ld],
7307	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
7308    [test "$withval" = no || with_gnu_ld=yes],
7309    [with_gnu_ld=no])
7310AC_REQUIRE([AC_PROG_CC])dnl
7311AC_REQUIRE([AC_CANONICAL_HOST])dnl
7312AC_REQUIRE([AC_CANONICAL_BUILD])dnl
7313ac_prog=ld
7314if test "$GCC" = yes; then
7315  # Check if gcc -print-prog-name=ld gives a path.
7316  AC_MSG_CHECKING([for ld used by GCC])
7317  case $host in
7318  *-*-mingw*)
7319    # gcc leaves a trailing carriage return which upsets mingw
7320    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
7321  *)
7322    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
7323  esac
7324  case $ac_prog in
7325    # Accept absolute paths.
7326    [[\\/]]* | ?:[[\\/]]*)
7327      re_direlt='/[[^/]][[^/]]*/\.\./'
7328      # Canonicalize the path of ld
7329      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
7330      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
7331	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
7332      done
7333      test -z "$LD" && LD="$ac_prog"
7334      ;;
7335  "")
7336    # If it fails, then pretend we aren't using GCC.
7337    ac_prog=ld
7338    ;;
7339  *)
7340    # If it is relative, then search for the first ld in PATH.
7341    with_gnu_ld=unknown
7342    ;;
7343  esac
7344elif test "$with_gnu_ld" = yes; then
7345  AC_MSG_CHECKING([for GNU ld])
7346else
7347  AC_MSG_CHECKING([for non-GNU ld])
7348fi
7349AC_CACHE_VAL(lt_cv_path_LD,
7350[if test -z "$LD"; then
7351  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7352  for ac_dir in $PATH; do
7353    IFS="$lt_save_ifs"
7354    test -z "$ac_dir" && ac_dir=.
7355    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
7356      lt_cv_path_LD="$ac_dir/$ac_prog"
7357      # Check to see if the program is GNU ld.  I'd rather use --version,
7358      # but apparently some GNU ld's only accept -v.
7359      # Break only if it was the GNU/non-GNU ld that we prefer.
7360      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
7361	test "$with_gnu_ld" != no && break
7362      else
7363	test "$with_gnu_ld" != yes && break
7364      fi
7365    fi
7366  done
7367  IFS="$lt_save_ifs"
7368else
7369  lt_cv_path_LD="$LD" # Let the user override the test with a path.
7370fi])
7371LD="$lt_cv_path_LD"
7372if test -n "$LD"; then
7373  AC_MSG_RESULT($LD)
7374else
7375  AC_MSG_RESULT(no)
7376fi
7377test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
7378AC_PROG_LD_GNU
7379])# AC_PROG_LD
7380
7381
7382# AC_PROG_LD_GNU
7383# --------------
7384AC_DEFUN([AC_PROG_LD_GNU],
7385[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
7386[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
7387if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
7388  lt_cv_prog_gnu_ld=yes
7389else
7390  lt_cv_prog_gnu_ld=no
7391fi])
7392with_gnu_ld=$lt_cv_prog_gnu_ld
7393])# AC_PROG_LD_GNU
7394
7395
7396# AC_PROG_LD_RELOAD_FLAG
7397# ----------------------
7398# find reload flag for linker
7399#   -- PORTME Some linkers may need a different reload flag.
7400AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
7401[AC_CACHE_CHECK([for $LD option to reload object files],
7402  lt_cv_ld_reload_flag,
7403  [lt_cv_ld_reload_flag='-r'])
7404reload_flag=$lt_cv_ld_reload_flag
7405case $reload_flag in
7406"" | " "*) ;;
7407*) reload_flag=" $reload_flag" ;;
7408esac
7409reload_cmds='$LD$reload_flag -o $output$reload_objs'
7410])# AC_PROG_LD_RELOAD_FLAG
7411
7412
7413# AC_DEPLIBS_CHECK_METHOD
7414# -----------------------
7415# how to check for library dependencies
7416#  -- PORTME fill in with the dynamic library characteristics
7417AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
7418[AC_CACHE_CHECK([how to recognise dependant libraries],
7419lt_cv_deplibs_check_method,
7420[lt_cv_file_magic_cmd='$MAGIC_CMD'
7421lt_cv_file_magic_test_file=
7422lt_cv_deplibs_check_method='unknown'
7423# Need to set the preceding variable on all platforms that support
7424# interlibrary dependencies.
7425# 'none' -- dependencies not supported.
7426# `unknown' -- same as none, but documents that we really don't know.
7427# 'pass_all' -- all dependencies passed with no checks.
7428# 'test_compile' -- check by making test program.
7429# 'file_magic [[regex]]' -- check by looking for files in library path
7430# which responds to the $file_magic_cmd with a given egrep regex.
7431# If you have `file' or equivalent on your system and you're not sure
7432# whether `pass_all' will *always* work, you probably want this one.
7433
7434case $host_os in
7435aix4* | aix5*)
7436  lt_cv_deplibs_check_method=pass_all
7437  ;;
7438
7439beos*)
7440  lt_cv_deplibs_check_method=pass_all
7441  ;;
7442
7443bsdi4*)
7444  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
7445  lt_cv_file_magic_cmd='/usr/bin/file -L'
7446  lt_cv_file_magic_test_file=/shlib/libc.so
7447  ;;
7448
7449cygwin* | mingw* | pw32*)
7450  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
7451  lt_cv_file_magic_cmd='$OBJDUMP -f'
7452  ;;
7453
7454darwin* | rhapsody*)
7455  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
7456  lt_cv_file_magic_cmd='/usr/bin/file -L'
7457  case "$host_os" in
7458  rhapsody* | darwin1.[[012]])
7459    lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
7460    ;;
7461  *) # Darwin 1.3 on
7462    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
7463    ;;
7464  esac
7465  ;;
7466
7467freebsd*)
7468  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
7469    case $host_cpu in
7470    i*86 )
7471      # Not sure whether the presence of OpenBSD here was a mistake.
7472      # Let's accept both of them until this is cleared up.
7473      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
7474      lt_cv_file_magic_cmd=/usr/bin/file
7475      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
7476      ;;
7477    esac
7478  else
7479    lt_cv_deplibs_check_method=pass_all
7480  fi
7481  ;;
7482
7483gnu*)
7484  lt_cv_deplibs_check_method=pass_all
7485  ;;
7486
7487hpux10.20* | hpux11*)
7488  lt_cv_file_magic_cmd=/usr/bin/file
7489  if test "$host_cpu" = ia64; then
7490    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
7491    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
7492  else
7493    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
7494    lt_cv_file_magic_test_file=/usr/lib/libc.sl
7495  fi
7496  ;;
7497
7498irix5* | irix6* | nonstopux*)
7499  case $host_os in
7500  irix5* | nonstopux*)
7501    # this will be overridden with pass_all, but let us keep it just in case
7502    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
7503    ;;
7504  *)
7505    case $LD in
7506    *-32|*"-32 ") libmagic=32-bit;;
7507    *-n32|*"-n32 ") libmagic=N32;;
7508    *-64|*"-64 ") libmagic=64-bit;;
7509    *) libmagic=never-match;;
7510    esac
7511    # this will be overridden with pass_all, but let us keep it just in case
7512    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
7513    ;;
7514  esac
7515  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
7516  lt_cv_deplibs_check_method=pass_all
7517  ;;
7518
7519# This must be Linux ELF.
7520linux*)
7521  case $host_cpu in
7522  alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh* | x86_64* )
7523    lt_cv_deplibs_check_method=pass_all ;;
7524  *)
7525    # glibc up to 2.1.1 does not perform some relocations on ARM
7526    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
7527  esac
7528  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
7529  ;;
7530
7531netbsd*)
7532  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
7533    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
7534  else
7535    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
7536  fi
7537  ;;
7538
7539newos6*)
7540  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
7541  lt_cv_file_magic_cmd=/usr/bin/file
7542  lt_cv_file_magic_test_file=/usr/lib/libnls.so
7543  ;;
7544
7545nto-qnx)
7546  lt_cv_deplibs_check_method=unknown
7547  ;;
7548
7549openbsd*)
7550  lt_cv_file_magic_cmd=/usr/bin/file
7551  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
7552  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7553    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
7554  else
7555    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
7556  fi
7557  ;;
7558
7559osf3* | osf4* | osf5*)
7560  # this will be overridden with pass_all, but let us keep it just in case
7561  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
7562  lt_cv_file_magic_test_file=/shlib/libc.so
7563  lt_cv_deplibs_check_method=pass_all
7564  ;;
7565
7566sco3.2v5*)
7567  lt_cv_deplibs_check_method=pass_all
7568  ;;
7569
7570solaris*)
7571  lt_cv_deplibs_check_method=pass_all
7572  lt_cv_file_magic_test_file=/lib/libc.so
7573  ;;
7574
7575sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
7576  case $host_vendor in
7577  motorola)
7578    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]]'
7579    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
7580    ;;
7581  ncr)
7582    lt_cv_deplibs_check_method=pass_all
7583    ;;
7584  sequent)
7585    lt_cv_file_magic_cmd='/bin/file'
7586    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
7587    ;;
7588  sni)
7589    lt_cv_file_magic_cmd='/bin/file'
7590    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
7591    lt_cv_file_magic_test_file=/lib/libc.so
7592    ;;
7593  esac
7594  ;;
7595
7596sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
7597  lt_cv_deplibs_check_method=pass_all
7598  ;;
7599esac
7600])
7601file_magic_cmd=$lt_cv_file_magic_cmd
7602deplibs_check_method=$lt_cv_deplibs_check_method
7603test -z "$deplibs_check_method" && deplibs_check_method=unknown
7604])# AC_DEPLIBS_CHECK_METHOD
7605
7606
7607# AC_PROG_NM
7608# ----------
7609# find the path to a BSD-compatible name lister
7610AC_DEFUN([AC_PROG_NM],
7611[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
7612[if test -n "$NM"; then
7613  # Let the user override the test.
7614  lt_cv_path_NM="$NM"
7615else
7616  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7617  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
7618    IFS="$lt_save_ifs"
7619    test -z "$ac_dir" && ac_dir=.
7620    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
7621    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
7622      # Check to see if the nm accepts a BSD-compat flag.
7623      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
7624      #   nm: unknown option "B" ignored
7625      # Tru64's nm complains that /dev/null is an invalid object file
7626      if ("$tmp_nm" -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
7627	lt_cv_path_NM="$tmp_nm -B"
7628	break
7629      elif ("$tmp_nm" -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
7630	lt_cv_path_NM="$tmp_nm -p"
7631	break
7632      else
7633	lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
7634	continue # so that we can try to find one that supports BSD flags
7635      fi
7636    fi
7637  done
7638  IFS="$lt_save_ifs"
7639  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
7640fi])
7641NM="$lt_cv_path_NM"
7642])# AC_PROG_NM
7643
7644
7645# AC_CHECK_LIBM
7646# -------------
7647# check for math library
7648AC_DEFUN([AC_CHECK_LIBM],
7649[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7650LIBM=
7651case $host in
7652*-*-beos* | *-*-cygwin* | *-*-pw32*)
7653  # These system don't have libm
7654  ;;
7655*-ncr-sysv4.3*)
7656  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
7657  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
7658  ;;
7659*)
7660  AC_CHECK_LIB(m, main, LIBM="-lm")
7661  ;;
7662esac
7663])# AC_CHECK_LIBM
7664
7665
7666# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
7667# -----------------------------------
7668# sets LIBLTDL to the link flags for the libltdl convenience library and
7669# LTDLINCL to the include flags for the libltdl header and adds
7670# --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
7671# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
7672# DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
7673# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
7674# '${top_srcdir}/' (note the single quotes!).  If your package is not
7675# flat and you're not using automake, define top_builddir and
7676# top_srcdir appropriately in the Makefiles.
7677AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
7678[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7679  case $enable_ltdl_convenience in
7680  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
7681  "") enable_ltdl_convenience=yes
7682      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
7683  esac
7684  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
7685  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
7686  # For backwards non-gettext consistent compatibility...
7687  INCLTDL="$LTDLINCL"
7688])# AC_LIBLTDL_CONVENIENCE
7689
7690
7691# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
7692# -----------------------------------
7693# sets LIBLTDL to the link flags for the libltdl installable library and
7694# LTDLINCL to the include flags for the libltdl header and adds
7695# --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
7696# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
7697# DIRECTORY is not provided and an installed libltdl is not found, it is
7698# assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
7699# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
7700# quotes!).  If your package is not flat and you're not using automake,
7701# define top_builddir and top_srcdir appropriately in the Makefiles.
7702# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
7703AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
7704[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7705  AC_CHECK_LIB(ltdl, main,
7706  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
7707  [if test x"$enable_ltdl_install" = xno; then
7708     AC_MSG_WARN([libltdl not installed, but installation disabled])
7709   else
7710     enable_ltdl_install=yes
7711   fi
7712  ])
7713  if test x"$enable_ltdl_install" = x"yes"; then
7714    ac_configure_args="$ac_configure_args --enable-ltdl-install"
7715    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
7716    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
7717  else
7718    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
7719    LIBLTDL="-lltdl"
7720    LTDLINCL=
7721  fi
7722  # For backwards non-gettext consistent compatibility...
7723  INCLTDL="$LTDLINCL"
7724])# AC_LIBLTDL_INSTALLABLE
7725
7726
7727# If this macro is not defined by Autoconf, define it here.
7728ifdef([AC_PROVIDE_IFELSE],
7729      [],
7730      [define([AC_PROVIDE_IFELSE],
7731	      [ifdef([AC_PROVIDE_$1],
7732		     [$2], [$3])])])
7733
7734
7735# AC_LIBTOOL_CXX
7736# --------------
7737# enable support for C++ libraries
7738AC_DEFUN([AC_LIBTOOL_CXX],
7739[AC_REQUIRE([_LT_AC_LANG_CXX])
7740])# AC_LIBTOOL_CXX
7741
7742
7743# _LT_AC_LANG_CXX
7744# ---------------
7745AC_DEFUN([_LT_AC_LANG_CXX],
7746[AC_REQUIRE([AC_PROG_CXX])
7747AC_REQUIRE([AC_PROG_CXXCPP])
7748])# _LT_AC_LANG_CXX
7749
7750
7751# AC_LIBTOOL_GCJ
7752# --------------
7753# enable support for GCJ libraries
7754AC_DEFUN([AC_LIBTOOL_GCJ],
7755[AC_REQUIRE([_LT_AC_LANG_GCJ])
7756])# AC_LIBTOOL_GCJ
7757
7758
7759# _LT_AC_LANG_GCJ
7760# ---------------
7761AC_DEFUN([_LT_AC_LANG_GCJ],
7762[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
7763  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
7764    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
7765      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
7766	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
7767	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
7768])# _LT_AC_LANG_GCJ
7769
7770
7771# AC_LIBTOOL_RC
7772# --------------
7773# enable support for Windows resource files
7774AC_DEFUN([AC_LIBTOOL_RC],
7775[AC_REQUIRE([AC_PROG_RC])
7776])# AC_LIBTOOL_RC
7777
7778
7779# AC_LIBTOOL_LANG_C_CONFIG
7780# ------------------------
7781# Ensure that the configuration vars for the C compiler are
7782# suitably defined.  Those variables are subsequently used by
7783# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
7784AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
7785AC_DEFUN([_LT_AC_LANG_C_CONFIG],
7786[lt_save_CC="$CC"
7787AC_LANG_PUSH(C)
7788
7789# Source file extension for C test sources.
7790ac_ext=c
7791
7792# Object file extension for compiled C test sources.
7793objext=o
7794_LT_AC_TAGVAR(objext, $1)=$objext
7795
7796# Code to be used in simple compile tests
7797lt_simple_compile_test_code="int some_variable = 0;"
7798
7799# Code to be used in simple link tests
7800lt_simple_link_test_code='main(){return(0);}'
7801
7802_LT_AC_SYS_COMPILER
7803
7804#
7805# Check for any special shared library compilation flags.
7806#
7807_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
7808if test "$GCC" = no; then
7809  case $host_os in
7810  sco3.2v5*)
7811    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
7812    ;;
7813  esac
7814fi
7815if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
7816  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
7817  if echo "$old_CC $old_CFLAGS " | egrep -e "[[ 	]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ 	]]" >/dev/null; then :
7818  else
7819    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
7820    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
7821  fi
7822fi
7823
7824
7825#
7826# Check to make sure the static flag actually works.
7827#
7828AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
7829  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
7830  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
7831  [],
7832  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
7833
7834
7835AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
7836AC_LIBTOOL_PROG_COMPILER_PIC($1)
7837AC_LIBTOOL_PROG_CC_C_O($1)
7838AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
7839AC_LIBTOOL_PROG_LD_SHLIBS($1)
7840AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
7841AC_LIBTOOL_SYS_LIB_STRIP
7842AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
7843AC_LIBTOOL_DLOPEN_SELF($1)
7844
7845# Report which librarie types wil actually be built
7846AC_MSG_CHECKING([if libtool supports shared libraries])
7847AC_MSG_RESULT([$can_build_shared])
7848
7849AC_MSG_CHECKING([whether to build shared libraries])
7850test "$can_build_shared" = "no" && enable_shared=no
7851
7852# On AIX, shared libraries and static libraries use the same namespace, and
7853# are all built from PIC.
7854case "$host_os" in
7855aix3*)
7856  test "$enable_shared" = yes && enable_static=no
7857  if test -n "$RANLIB"; then
7858    archive_cmds="$archive_cmds~\$RANLIB \$lib"
7859    postinstall_cmds='$RANLIB $lib'
7860  fi
7861  ;;
7862
7863aix4*)
7864  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7865    test "$enable_shared" = yes && enable_static=no
7866  fi
7867  ;;
7868esac
7869AC_MSG_RESULT([$enable_shared])
7870
7871AC_MSG_CHECKING([whether to build static libraries])
7872# Make sure either enable_shared or enable_static is yes.
7873test "$enable_shared" = yes || enable_static=yes
7874AC_MSG_RESULT([$enable_static])
7875
7876AC_LIBTOOL_CONFIG($1)
7877
7878AC_LANG_POP
7879CC="$lt_save_CC"
7880])# AC_LIBTOOL_LANG_C_CONFIG
7881
7882
7883# AC_LIBTOOL_LANG_CXX_CONFIG
7884# --------------------------
7885# Ensure that the configuration vars for the C compiler are
7886# suitably defined.  Those variables are subsequently used by
7887# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
7888AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
7889AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
7890[AC_LANG_PUSH(C++)
7891AC_REQUIRE([AC_PROG_CXX])
7892AC_REQUIRE([AC_PROG_CXXCPP])
7893
7894_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
7895_LT_AC_TAGVAR(allow_undefined_flag, $1)=
7896_LT_AC_TAGVAR(always_export_symbols, $1)=no
7897_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
7898_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
7899_LT_AC_TAGVAR(hardcode_direct, $1)=no
7900_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
7901_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
7902_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
7903_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
7904_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7905_LT_AC_TAGVAR(no_undefined_flag, $1)=
7906_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
7907
7908# Dependencies to place before and after the object being linked:
7909_LT_AC_TAGVAR(predep_objects, $1)=
7910_LT_AC_TAGVAR(postdep_objects, $1)=
7911_LT_AC_TAGVAR(predeps, $1)=
7912_LT_AC_TAGVAR(postdeps, $1)=
7913_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
7914
7915# Source file extension for C test sources.
7916ac_ext=cc
7917
7918# Object file extension for compiled C test sources.
7919objext=o
7920_LT_AC_TAGVAR(objext, $1)=$objext
7921
7922# Code to be used in simple compile tests
7923lt_simple_compile_test_code="int some_variable = 0;"
7924
7925# Code to be used in simple link tests
7926lt_simple_link_test_code='int main(int char *[]) { return(0); }'
7927
7928# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7929_LT_AC_SYS_COMPILER
7930
7931# Allow CC to be a program name with arguments.
7932lt_save_CC="$CC"
7933CC=${CXX-"c++"}
7934set dummy $CC
7935compiler="[$]2"
7936_LT_AC_TAGVAR(compiler, $1)=$CC
7937cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
7938
7939# We don't want -fno-exception wen compiling C++ code, so set the
7940# no_builtin_flag separately
7941if test "$GXX" = yes; then
7942  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
7943else
7944  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
7945fi
7946
7947if test "$GXX" = yes; then
7948  # Set up default GNU C++ configuration
7949
7950  # Check if GNU C++ uses GNU ld as the underlying linker, since the
7951  # archiving commands below assume that GNU ld is being used.
7952  if eval "`$CC -print-prog-name=ld` --version 2>&1" | \
7953      egrep 'GNU ld' > /dev/null; then
7954    with_gnu_ld=yes
7955
7956    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7957    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
7958
7959    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
7960    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7961
7962    # If archive_cmds runs LD, not CC, wlarc should be empty
7963    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
7964    #     investigate it a little bit more. (MM)
7965    wlarc='${wl}'
7966
7967    # ancient GNU ld didn't support --whole-archive et. al.
7968    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
7969	egrep 'no-whole-archive' > /dev/null; then
7970      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7971    else
7972      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
7973    fi
7974  else
7975    with_gnu_ld=no
7976    wlarc=
7977
7978    # A generic and very simple default shared library creation
7979    # command for GNU C++ for the case where it uses the native
7980    # linker, instead of GNU ld.  If possible, this setting should
7981    # overridden to take advantage of the native linker features on
7982    # the platform it is being used on.
7983    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7984  fi
7985
7986  # Commands to make compiler produce verbose output that lists
7987  # what "hidden" libraries, object files and flags are used when
7988  # linking a shared library.
7989  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
7990
7991else
7992  GXX=no
7993  with_gnu_ld=no
7994  wlarc=
7995fi
7996
7997# PORTME: fill in a description of your system's C++ link characteristics
7998AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
7999_LT_AC_TAGVAR(ld_shlibs, $1)=yes
8000case $host_os in
8001  aix3*)
8002    # FIXME: insert proper C++ library support
8003    _LT_AC_TAGVAR(ld_shlibs, $1)=no
8004    ;;
8005  aix4* | aix5*)
8006    if test "$host_cpu" = ia64; then
8007      # On IA64, the linker does run time linking by default, so we don't
8008      # have to do anything special.
8009      aix_use_runtimelinking=no
8010      exp_sym_flag='-Bexport'
8011      no_entry_flag=""
8012    else
8013      # KDE requires run time linking.  Make it the default.
8014      aix_use_runtimelinking=yes
8015      exp_sym_flag='-bexport'
8016      no_entry_flag='-bnoentry'
8017    fi
8018
8019    # When large executables or shared objects are built, AIX ld can
8020    # have problems creating the table of contents.  If linking a library
8021    # or program results in "error TOC overflow" add -mminimal-toc to
8022    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
8023    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
8024
8025    _LT_AC_TAGVAR(archive_cmds, $1)=''
8026    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8027    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
8028    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8029
8030    if test "$GXX" = yes; then
8031      case $host_os in aix4.[012]|aix4.[012].*)
8032      # We only want to do this on AIX 4.2 and lower, the check
8033      # below for broken collect2 doesn't work under 4.3+
8034	collect2name=`${CC} -print-prog-name=collect2`
8035	if test -f "$collect2name" && \
8036	   strings "$collect2name" | grep resolve_lib_name >/dev/null
8037	then
8038	  # We have reworked collect2
8039	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8040	else
8041	  # We have old collect2
8042	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
8043	  # It fails to find uninstalled libraries when the uninstalled
8044	  # path is not listed in the libpath.  Setting hardcode_minus_L
8045	  # to unsupported forces relinking
8046	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
8047	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8048	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
8049	fi
8050      esac
8051      shared_flag='-shared'
8052    else
8053      # not using gcc
8054      if test "$host_cpu" = ia64; then
8055	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
8056	# chokes on -Wl,-G. The following line is correct:
8057	shared_flag='-G'
8058      else
8059	if test "$aix_use_runtimelinking" = yes; then
8060	  shared_flag='-qmkshrobj ${wl}-G'
8061	else
8062	  shared_flag='-qmkshrobj'
8063	fi
8064      fi
8065    fi
8066
8067    # Let the compiler handle the export list.
8068    _LT_AC_TAGVAR(always_export_symbols, $1)=no
8069    if test "$aix_use_runtimelinking" = yes; then
8070      # Warning - without using the other runtime loading flags (-brtl),
8071      # -berok will link without error, but may produce a broken library.
8072      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
8073      # Determine the default libpath from the value encoded in an empty executable.
8074      _LT_AC_SYS_LIBPATH_AIX
8075      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
8076
8077      _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
8078      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
8079     else
8080      if test "$host_cpu" = ia64; then
8081	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
8082	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
8083	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
8084      else
8085	# Determine the default libpath from the value encoded in an empty executable.
8086	_LT_AC_SYS_LIBPATH_AIX
8087	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
8088	# Warning - without using the other run time loading flags,
8089	# -berok will link without error, but may produce a broken library.
8090	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
8091	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
8092	# -bexpall does not export symbols beginning with underscore (_)
8093	_LT_AC_TAGVAR(always_export_symbols, $1)=yes
8094	# Exported symbols can be pulled into shared objects from archives
8095	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
8096	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
8097	# This is similar to how AIX traditionally builds it's shared libraries.
8098	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
8099      fi
8100    fi
8101    ;;
8102  chorus*)
8103    case $cc_basename in
8104      *)
8105	# FIXME: insert proper C++ library support
8106	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8107	;;
8108    esac
8109    ;;
8110  dgux*)
8111    case $cc_basename in
8112      ec++)
8113	# FIXME: insert proper C++ library support
8114	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8115	;;
8116      ghcx)
8117	# Green Hills C++ Compiler
8118	# FIXME: insert proper C++ library support
8119	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8120	;;
8121      *)
8122	# FIXME: insert proper C++ library support
8123	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8124	;;
8125    esac
8126    ;;
8127  freebsd[12]*)
8128    # C++ shared libraries reported to be fairly broken before switch to ELF
8129    _LT_AC_TAGVAR(ld_shlibs, $1)=no
8130    ;;
8131  freebsd-elf*)
8132    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8133    ;;
8134  freebsd*)
8135    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
8136    # conventions
8137    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
8138    ;;
8139  gnu*)
8140    ;;
8141  hpux*)
8142    if test $with_gnu_ld = no; then
8143      if test "$host_cpu" = ia64; then
8144	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8145      else
8146	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
8147	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8148	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8149      fi
8150    fi
8151    if test "$host_cpu" = ia64; then
8152      _LT_AC_TAGVAR(hardcode_direct, $1)=no
8153      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8154    else
8155      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8156    fi
8157    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
8158					    # but as the default
8159					    # location of the library.
8160
8161    case $cc_basename in
8162      CC)
8163	# FIXME: insert proper C++ library support
8164	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8165	;;
8166      aCC)
8167	case $host_os in
8168	hpux9*)
8169	  _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
8170	  ;;
8171	*)
8172	  if test "$host_cpu" = ia64; then
8173	    _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
8174	  else
8175	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8176	  fi
8177	  ;;
8178	esac
8179	# Commands to make compiler produce verbose output that lists
8180	# what "hidden" libraries, object files and flags are used when
8181	# linking a shared library.
8182	#
8183	# There doesn't appear to be a way to prevent this compiler from
8184	# explicitly linking system object files so we need to strip them
8185	# from the output so that they don't get included in the library
8186	# dependencies.
8187	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'
8188	;;
8189      *)
8190	if test "$GXX" = yes; then
8191	  if test $with_gnu_ld = no; then
8192	    case $host_os in
8193	    hpux9*)
8194	      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
8195	      ;;
8196	    *)
8197	      if test "$host_cpu" = ia64; then
8198		_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
8199	      else
8200		_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8201	      fi
8202	      ;;
8203	    esac
8204	  fi
8205	else
8206	  # FIXME: insert proper C++ library support
8207	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
8208	fi
8209	;;
8210    esac
8211    ;;
8212  irix5* | irix6*)
8213    case $cc_basename in
8214      CC)
8215	# SGI C++
8216	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
8217
8218	# Archives containing C++ object files must be created using
8219	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
8220	# necessary to make sure instantiated templates are included
8221	# in the archive.
8222	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
8223	;;
8224      *)
8225	if test "$GXX" = yes; then
8226	  if test "$with_gnu_ld" = no; then
8227	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
8228	  else
8229	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
8230	  fi
8231	fi
8232	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8233	;;
8234    esac
8235    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8236    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8237    ;;
8238  linux*)
8239    case $cc_basename in
8240      KCC)
8241	# Kuck and Associates, Inc. (KAI) C++ Compiler
8242
8243	# KCC will only create a shared library if the output file
8244	# ends with ".so" (or ".sl" for HP-UX), so rename the library
8245	# to its proper name (with version) after linking.
8246	_LT_AC_TAGVAR(archive_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
8247	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
8248
8249	# Commands to make compiler produce verbose output that lists
8250	# what "hidden" libraries, object files and flags are used when
8251	# linking a shared library.
8252	#
8253	# There doesn't appear to be a way to prevent this compiler from
8254	# explicitly linking system object files so we need to strip them
8255	# from the output so that they don't get included in the library
8256	# dependencies.
8257	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest.so 2>&1 | egrep "ld"`; rm -f libconftest.so; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
8258
8259	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
8260	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
8261
8262	# Archives containing C++ object files must be created using
8263	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
8264	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
8265	;;
8266      cxx)
8267	# Compaq C++
8268	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
8269	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
8270
8271	runpath_var=LD_RUN_PATH
8272	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
8273	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8274
8275	# Commands to make compiler produce verbose output that lists
8276	# what "hidden" libraries, object files and flags are used when
8277	# linking a shared library.
8278	#
8279	# There doesn't appear to be a way to prevent this compiler from
8280	# explicitly linking system object files so we need to strip them
8281	# from the output so that they don't get included in the library
8282	# dependencies.
8283	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'
8284	;;
8285    esac
8286    ;;
8287  lynxos*)
8288    # FIXME: insert proper C++ library support
8289    _LT_AC_TAGVAR(ld_shlibs, $1)=no
8290    ;;
8291  m88k*)
8292    # FIXME: insert proper C++ library support
8293    _LT_AC_TAGVAR(ld_shlibs, $1)=no
8294    ;;
8295  mvs*)
8296    case $cc_basename in
8297      cxx)
8298	# FIXME: insert proper C++ library support
8299	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8300	;;
8301      *)
8302	# FIXME: insert proper C++ library support
8303	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8304	;;
8305    esac
8306    ;;
8307  netbsd*)
8308    # NetBSD uses g++ - do we need to do anything?
8309    ;;
8310  osf3*)
8311    case $cc_basename in
8312      KCC)
8313	# Kuck and Associates, Inc. (KAI) C++ Compiler
8314
8315	# KCC will only create a shared library if the output file
8316	# ends with ".so" (or ".sl" for HP-UX), so rename the library
8317	# to its proper name (with version) after linking.
8318	_LT_AC_TAGVAR(archive_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
8319
8320	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8321	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8322
8323	# Archives containing C++ object files must be created using
8324	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
8325	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
8326
8327	;;
8328      RCC)
8329	# Rational C++ 2.4.1
8330	# FIXME: insert proper C++ library support
8331	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8332	;;
8333      cxx)
8334	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8335	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
8336
8337	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8338	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8339
8340	# Commands to make compiler produce verbose output that lists
8341	# what "hidden" libraries, object files and flags are used when
8342	# linking a shared library.
8343	#
8344	# There doesn't appear to be a way to prevent this compiler from
8345	# explicitly linking system object files so we need to strip them
8346	# from the output so that they don't get included in the library
8347	# dependencies.
8348	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'
8349	;;
8350      *)
8351	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
8352	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8353	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
8354
8355	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8356	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8357
8358	  # Commands to make compiler produce verbose output that lists
8359	  # what "hidden" libraries, object files and flags are used when
8360	  # linking a shared library.
8361	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
8362
8363	else
8364	  # FIXME: insert proper C++ library support
8365	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
8366	fi
8367	;;
8368    esac
8369    ;;
8370  osf4* | osf5*)
8371    case $cc_basename in
8372      KCC)
8373	# Kuck and Associates, Inc. (KAI) C++ Compiler
8374
8375	# KCC will only create a shared library if the output file
8376	# ends with ".so" (or ".sl" for HP-UX), so rename the library
8377	# to its proper name (with version) after linking.
8378	_LT_AC_TAGVAR(archive_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
8379
8380	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8381	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8382
8383	# Archives containing C++ object files must be created using
8384	# the KAI C++ compiler.
8385	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
8386	;;
8387      RCC)
8388	# Rational C++ 2.4.1
8389	# FIXME: insert proper C++ library support
8390	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8391	;;
8392      cxx)
8393	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
8394	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
8395	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done~
8396	  echo "-hidden">> $lib.exp~
8397	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
8398	  $rm $lib.exp'
8399
8400	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
8401	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8402
8403	# Commands to make compiler produce verbose output that lists
8404	# what "hidden" libraries, object files and flags are used when
8405	# linking a shared library.
8406	#
8407	# There doesn't appear to be a way to prevent this compiler from
8408	# explicitly linking system object files so we need to strip them
8409	# from the output so that they don't get included in the library
8410	# dependencies.
8411	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'
8412	;;
8413      *)
8414	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
8415	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8416	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
8417
8418	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8419	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8420
8421	  # Commands to make compiler produce verbose output that lists
8422	  # what "hidden" libraries, object files and flags are used when
8423	  # linking a shared library.
8424	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
8425
8426	else
8427	  # FIXME: insert proper C++ library support
8428	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
8429	fi
8430	;;
8431    esac
8432    ;;
8433  psos*)
8434    # FIXME: insert proper C++ library support
8435    _LT_AC_TAGVAR(ld_shlibs, $1)=no
8436    ;;
8437  sco*)
8438    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8439    case $cc_basename in
8440      CC)
8441	# FIXME: insert proper C++ library support
8442	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8443	;;
8444      *)
8445	# FIXME: insert proper C++ library support
8446	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8447	;;
8448    esac
8449    ;;
8450  sunos4*)
8451    case $cc_basename in
8452      CC)
8453	# Sun C++ 4.x
8454	# FIXME: insert proper C++ library support
8455	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8456	;;
8457      lcc)
8458	# Lucid
8459	# FIXME: insert proper C++ library support
8460	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8461	;;
8462      *)
8463	# FIXME: insert proper C++ library support
8464	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8465	;;
8466    esac
8467    ;;
8468  solaris*)
8469    case $cc_basename in
8470      CC)
8471	# Sun C++ 4.2, 5.x and Centerline C++
8472	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
8473	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
8474	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
8475	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
8476
8477	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8478	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8479	case $host_os in
8480	  solaris2.[0-5] | solaris2.[0-5].*) ;;
8481	  *)
8482	    # The C++ compiler is used as linker so we must use $wl
8483	    # flag to pass the commands to the underlying system
8484	    # linker.
8485	    # Supported since Solaris 2.6 (maybe 2.5.1?)
8486	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
8487	    ;;
8488	esac
8489	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8490
8491	# Commands to make compiler produce verbose output that lists
8492	# what "hidden" libraries, object files and flags are used when
8493	# linking a shared library.
8494	#
8495	# There doesn't appear to be a way to prevent this compiler from
8496	# explicitly linking system object files so we need to strip them
8497	# from the output so that they don't get included in the library
8498	# dependencies.
8499	output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep "\-R|\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
8500
8501	# Archives containing C++ object files must be created using
8502	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
8503	# necessary to make sure instantiated templates are included
8504	# in the archive.
8505	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
8506	;;
8507      gcx)
8508	# Green Hills C++ Compiler
8509	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
8510
8511	# The C++ compiler must be used to create the archive.
8512	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
8513	;;
8514      *)
8515	# GNU C++ compiler with Solaris linker
8516	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
8517	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
8518	  if $CC --version | egrep -v '^2\.7' > /dev/null; then
8519	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
8520	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
8521		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
8522
8523	    # Commands to make compiler produce verbose output that lists
8524	    # what "hidden" libraries, object files and flags are used when
8525	    # linking a shared library.
8526	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
8527	  else
8528	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
8529	    # platform.
8530	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
8531	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
8532		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
8533
8534	    # Commands to make compiler produce verbose output that lists
8535	    # what "hidden" libraries, object files and flags are used when
8536	    # linking a shared library.
8537	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
8538	  fi
8539
8540	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
8541	fi
8542	;;
8543    esac
8544    ;;
8545  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
8546    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8547    ;;
8548  tandem*)
8549    case $cc_basename in
8550      NCC)
8551	# NonStop-UX NCC 3.20
8552	# FIXME: insert proper C++ library support
8553	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8554	;;
8555      *)
8556	# FIXME: insert proper C++ library support
8557	_LT_AC_TAGVAR(ld_shlibs, $1)=no
8558	;;
8559    esac
8560    ;;
8561  vxworks*)
8562    # FIXME: insert proper C++ library support
8563    _LT_AC_TAGVAR(ld_shlibs, $1)=no
8564    ;;
8565  *)
8566    # FIXME: insert proper C++ library support
8567    _LT_AC_TAGVAR(ld_shlibs, $1)=no
8568    ;;
8569esac
8570AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
8571test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
8572
8573# Figure out "hidden" C++ library dependencies from verbose
8574# compiler output whening linking a shared library.
8575cat > conftest.$ac_ext <<EOF
8576class Foo
8577{
8578public:
8579  Foo (void) { a = 0; }
8580private:
8581  int a;
8582};
8583EOF
8584
8585
8586if AC_TRY_EVAL(ac_compile); then
8587  # Parse the compiler output and extract the necessary
8588  # objects, libraries and library flags.
8589
8590  # Sentinel used to keep track of whether or not we are before
8591  # the conftest object file.
8592  pre_test_object_deps_done=no
8593
8594  # The `*' in the case matches for architectures that use `case' in
8595  # $output_verbose_cmd can trigger glob expansion during the loop
8596  # eval without this substitution.
8597  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
8598
8599  for p in `eval $output_verbose_link_cmd`; do
8600    case $p in
8601
8602    -L* | -R* | -l*)
8603       # Some compilers place space between "-{L,R}" and the path.
8604       # Remove the space.
8605       if test $p = "-L" \
8606	  || test $p = "-R"; then
8607	 prev=$p
8608	 continue
8609       else
8610	 prev=
8611       fi
8612
8613       if test "$pre_test_object_deps_done" = no; then
8614	 case $p in
8615	 -L* | -R*)
8616	   # Internal compiler library paths should come after those
8617	   # provided the user.  The postdeps already come after the
8618	   # user supplied libs so there is no need to process them.
8619	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
8620	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
8621	   else
8622	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
8623	   fi
8624	   ;;
8625	 # The "-l" case would never come before the object being
8626	 # linked, so don't bother handling this case.
8627	 esac
8628       else
8629	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
8630	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
8631	 else
8632	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
8633	 fi
8634       fi
8635       ;;
8636
8637    *.$objext|*.$libext)
8638       # This assumes that the test object file only shows up
8639       # once in the compiler output.
8640       if test "$p" = "conftest.$objext"; then
8641	 pre_test_object_deps_done=yes
8642	 continue
8643       fi
8644
8645       if test "$pre_test_object_deps_done" = no; then
8646	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
8647	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
8648	 else
8649	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
8650	 fi
8651       else
8652	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
8653	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
8654	 else
8655	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
8656	 fi
8657       fi
8658       ;;
8659
8660    *) ;; # Ignore the rest.
8661
8662    esac
8663  done
8664
8665  # Clean up.
8666  rm -f a.out
8667else
8668  echo "libtool.m4: error: problem compiling C++ test program"
8669fi
8670
8671$rm -f confest.$objext
8672
8673case " $_LT_AC_TAGVAR(postdeps, $1) " in
8674*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
8675*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes ;;
8676esac
8677
8678_LT_AC_TAGVAR(GCC, $1)="$GXX"
8679_LT_AC_TAGVAR(LD, $1)="$LD"
8680
8681AC_LIBTOOL_PROG_COMPILER_PIC($1)
8682AC_LIBTOOL_PROG_CC_C_O($1)
8683AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
8684AC_LIBTOOL_PROG_LD_SHLIBS($1)
8685AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
8686AC_LIBTOOL_SYS_LIB_STRIP
8687AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
8688AC_LIBTOOL_DLOPEN_SELF($1)
8689
8690AC_LIBTOOL_CONFIG($1)
8691
8692AC_LANG_POP
8693CC="$lt_save_CC"
8694])# AC_LIBTOOL_LANG_CXX_CONFIG
8695
8696
8697# AC_LIBTOOL_LANG_GCJ_CONFIG
8698# --------------------------
8699# Ensure that the configuration vars for the C compiler are
8700# suitably defined.  Those variables are subsequently used by
8701# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
8702AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
8703AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
8704[AC_LANG_SAVE
8705
8706# Source file extension for C test sources.
8707ac_ext=java
8708
8709# Object file extension for compiled C test sources.
8710objext=o
8711_LT_AC_TAGVAR(objext, $1)=$objext
8712
8713# Code to be used in simple compile tests
8714lt_simple_compile_test_code="class foo {}"
8715
8716# Code to be used in simple link tests
8717lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
8718
8719# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8720_LT_AC_SYS_COMPILER
8721
8722# Allow CC to be a program name with arguments.
8723lt_save_CC="$CC"
8724CC=${GCJ-"gcj"}
8725set dummy $CC
8726compiler="[$]2"
8727_LT_AC_TAGVAR(compiler, $1)=$CC
8728
8729# GCJ did not exist at the time GCC didn't implicitly link libc in.
8730_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8731
8732AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
8733AC_LIBTOOL_PROG_COMPILER_PIC($1)
8734AC_LIBTOOL_PROG_CC_C_O($1)
8735AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
8736AC_LIBTOOL_PROG_LD_SHLIBS($1)
8737AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
8738AC_LIBTOOL_SYS_LIB_STRIP
8739AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
8740AC_LIBTOOL_DLOPEN_SELF($1)
8741
8742AC_LIBTOOL_CONFIG($1)
8743
8744AC_LANG_RESTORE
8745CC="$lt_save_CC"
8746])# AC_LIBTOOL_LANG_GCJ_CONFIG
8747
8748
8749# AC_LIBTOOL_LANG_RC_CONFIG
8750# --------------------------
8751# Ensure that the configuration vars for the Windows resource compiler are
8752# suitably defined.  Those variables are subsequently used by
8753# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
8754AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
8755AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
8756[AC_LANG_SAVE
8757
8758# Source file extension for RC test sources.
8759ac_ext=rc
8760
8761# Object file extension for compiled RC test sources.
8762objext=o
8763_LT_AC_TAGVAR(objext, $1)=$objext
8764
8765# Code to be used in simple compile tests
8766lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8767
8768# Code to be used in simple link tests
8769lt_simple_link_test_code="$lt_simple_compile_test_code"
8770
8771# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8772_LT_AC_SYS_COMPILER
8773
8774# Allow CC to be a program name with arguments.
8775lt_save_CC="$CC"
8776CC=${RC-"windres"}
8777set dummy $CC
8778compiler="[$]2"
8779_LT_AC_TAGVAR(compiler, $1)=$CC
8780_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8781
8782AC_LIBTOOL_CONFIG($1)
8783
8784AC_LANG_RESTORE
8785CC="$lt_save_CC"
8786])# AC_LIBTOOL_LANG_RC_CONFIG
8787
8788
8789# AC_LIBTOOL_CONFIG([TAGNAME])
8790# ----------------------------
8791# If TAGNAME is not passed, then create an initial libtool script
8792# with a default configuration from the untagged config vars.  Otherwise
8793# add code to config.status for appending the configuration named by
8794# TAGNAME from the matching tagged config vars.
8795AC_DEFUN([AC_LIBTOOL_CONFIG],
8796[# The else clause should only fire when bootstrapping the
8797# libtool distribution, otherwise you forgot to ship ltmain.sh
8798# with your package, and you will get complaints that there are
8799# no rules to generate ltmain.sh.
8800if test -f "$ltmain"; then
8801  # Now quote all the things that may contain metacharacters while being
8802  # careful not to overquote the AC_SUBSTed values.  We take copies of the
8803  # variables and quote the copies for generation of the libtool script.
8804  for var in echo old_CC old_CFLAGS AR AR_FLAGS RANLIB LN_S LTCC NM SED SHELL \
8805    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
8806    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
8807    deplibs_check_method reload_flag reload_cmds need_locks \
8808    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
8809    lt_cv_sys_global_symbol_to_c_name_address \
8810    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
8811    old_postinstall_cmds old_postuninstall_cmds \
8812    _LT_AC_TAGVAR(compiler, $1) \
8813    _LT_AC_TAGVAR(CC, $1) \
8814    _LT_AC_TAGVAR(LD, $1) \
8815    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
8816    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
8817    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
8818    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
8819    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
8820    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
8821    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
8822    _LT_AC_TAGVAR(old_archive_cmds, $1) \
8823    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
8824    _LT_AC_TAGVAR(predep_objects, $1) \
8825    _LT_AC_TAGVAR(postdep_objects, $1) \
8826    _LT_AC_TAGVAR(predeps, $1) \
8827    _LT_AC_TAGVAR(postdeps, $1) \
8828    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
8829    _LT_AC_TAGVAR(archive_cmds, $1) \
8830    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
8831    _LT_AC_TAGVAR(postinstall_cmds, $1) \
8832    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
8833    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
8834    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
8835    _LT_AC_TAGVAR(no_undefined_flag, $1) \
8836    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
8837    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
8838    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
8839    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
8840    _LT_AC_TAGVAR(exclude_expsyms, $1) \
8841    _LT_AC_TAGVAR(include_expsyms, $1); do
8842
8843    case $var in
8844    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
8845    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
8846    _LT_AC_TAGVAR(archive_cmds, $1) | \
8847    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
8848    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
8849    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
8850    extract_expsyms_cmds | reload_cmds | finish_cmds | \
8851    postinstall_cmds | postuninstall_cmds | \
8852    old_postinstall_cmds | old_postuninstall_cmds | \
8853    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
8854      # Double-quote double-evaled strings.
8855      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
8856      ;;
8857    *)
8858      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
8859      ;;
8860    esac
8861  done
8862
8863  case $lt_echo in
8864  *'\[$]0 --fallback-echo"')
8865    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
8866    ;;
8867  esac
8868
8869ifelse([$1], [],
8870  [cfgfile="${ofile}T"
8871  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
8872  $rm -f "$cfgfile"
8873  AC_MSG_NOTICE([creating $ofile])],
8874  [cfgfile="$ofile"])
8875
8876  cat <<__EOF__ >> "$cfgfile"
8877ifelse([$1], [],
8878[#! $SHELL
8879
8880# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
8881# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
8882# NOTE: Changes made to this file will be lost: look at ltmain.sh.
8883#
8884# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
8885# Free Software Foundation, Inc.
8886#
8887# This file is part of GNU Libtool:
8888# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8889#
8890# This program is free software; you can redistribute it and/or modify
8891# it under the terms of the GNU General Public License as published by
8892# the Free Software Foundation; either version 2 of the License, or
8893# (at your option) any later version.
8894#
8895# This program is distributed in the hope that it will be useful, but
8896# WITHOUT ANY WARRANTY; without even the implied warranty of
8897# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8898# General Public License for more details.
8899#
8900# You should have received a copy of the GNU General Public License
8901# along with this program; if not, write to the Free Software
8902# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
8903#
8904# As a special exception to the GNU General Public License, if you
8905# distribute this file as part of a program that contains a
8906# configuration script generated by Autoconf, you may include it under
8907# the same distribution terms that you use for the rest of that program.
8908
8909# Sed that helps us avoid accidentally triggering echo(1) options like -n.
8910Xsed="sed -e s/^X//"
8911
8912# The HP-UX ksh and POSIX shell print the target directory to stdout
8913# if CDPATH is set.
8914if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
8915
8916# The names of the tagged configurations supported by this script.
8917available_tags=
8918
8919# ### BEGIN LIBTOOL CONFIG],
8920[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
8921
8922# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
8923
8924# Shell to use when invoking shell scripts.
8925SHELL=$lt_SHELL
8926
8927# Whether or not to build shared libraries.
8928build_libtool_libs=$enable_shared
8929
8930# Whether or not to build static libraries.
8931build_old_libs=$enable_static
8932
8933# Whether or not to add -lc for building shared libraries.
8934build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
8935
8936# Whether or not to optimize for fast installation.
8937fast_install=$enable_fast_install
8938
8939# The host system.
8940host_alias=$host_alias
8941host=$host
8942
8943# An echo program that does not interpret backslashes.
8944echo=$lt_echo
8945
8946# The archiver.
8947AR=$lt_AR
8948AR_FLAGS=$lt_AR_FLAGS
8949
8950# A C compiler.
8951LTCC=$lt_LTCC
8952
8953# A language-specific compiler.
8954CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
8955
8956# Is the compiler the GNU C compiler?
8957with_gcc=$_LT_AC_TAGVAR(GCC, $1)
8958
8959# The linker used to build libraries.
8960LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
8961
8962# Whether we need hard or soft links.
8963LN_S=$lt_LN_S
8964
8965# A BSD-compatible nm program.
8966NM=$lt_NM
8967
8968# A sed program that does not truncate output.
8969SED=$lt_SED
8970
8971# A symbol stripping program
8972STRIP=$STRIP
8973
8974# Used to examine libraries when file_magic_cmd begins "file"
8975MAGIC_CMD=$MAGIC_CMD
8976
8977# Used on cygwin: DLL creation program.
8978DLLTOOL="$DLLTOOL"
8979
8980# Used on cygwin: object dumper.
8981OBJDUMP="$OBJDUMP"
8982
8983# Used on cygwin: assembler.
8984AS="$AS"
8985
8986# The name of the directory that contains temporary libtool files.
8987objdir=$objdir
8988
8989# How to create reloadable object files.
8990reload_flag=$lt_reload_flag
8991reload_cmds=$lt_reload_cmds
8992
8993# How to pass a linker flag through the compiler.
8994wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
8995
8996# Object file suffix (normally "o").
8997objext="$ac_objext"
8998
8999# Old archive suffix (normally "a").
9000libext="$libext"
9001
9002# Executable file suffix (normally "").
9003exeext="$exeext"
9004
9005# Additional compiler flags for building library objects.
9006pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
9007pic_mode=$pic_mode
9008
9009# What is the maximum length of a command?
9010max_cmd_len=$lt_cv_sys_max_cmd_len
9011
9012# Does compiler simultaneously support -c and -o options?
9013compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
9014
9015# Must we lock files when doing compilation ?
9016need_locks=$lt_need_locks
9017
9018# Do we need the lib prefix for modules?
9019need_lib_prefix=$need_lib_prefix
9020
9021# Do we need a version for libraries?
9022need_version=$need_version
9023
9024# Whether dlopen is supported.
9025dlopen_support=$enable_dlopen
9026
9027# Whether dlopen of programs is supported.
9028dlopen_self=$enable_dlopen_self
9029
9030# Whether dlopen of statically linked programs is supported.
9031dlopen_self_static=$enable_dlopen_self_static
9032
9033# Compiler flag to prevent dynamic linking.
9034link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
9035
9036# Compiler flag to turn off builtin functions.
9037no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
9038
9039# Compiler flag to allow reflexive dlopens.
9040export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
9041
9042# Compiler flag to generate shared objects directly from archives.
9043whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
9044
9045# Compiler flag to generate thread-safe objects.
9046thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
9047
9048# Library versioning type.
9049version_type=$version_type
9050
9051# Format of library name prefix.
9052libname_spec=$lt_libname_spec
9053
9054# List of archive names.  First name is the real one, the rest are links.
9055# The last name is the one that the linker finds with -lNAME.
9056library_names_spec=$lt_library_names_spec
9057
9058# The coded name of the library, if different from the real name.
9059soname_spec=$lt_soname_spec
9060
9061# Commands used to build and install an old-style archive.
9062RANLIB=$lt_RANLIB
9063old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
9064old_postinstall_cmds=$lt_old_postinstall_cmds
9065old_postuninstall_cmds=$lt_old_postuninstall_cmds
9066
9067# Create an old-style archive from a shared archive.
9068old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
9069
9070# Create a temporary old-style archive to link instead of a shared archive.
9071old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
9072
9073# Commands used to build and install a shared archive.
9074archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
9075archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
9076postinstall_cmds=$lt_postinstall_cmds
9077postuninstall_cmds=$lt_postuninstall_cmds
9078
9079# Commands to strip libraries.
9080old_striplib=$lt_old_striplib
9081striplib=$lt_striplib
9082
9083# Dependencies to place before the objects being linked to create a
9084# shared library.
9085predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
9086
9087# Dependencies to place after the objects being linked to create a
9088# shared library.
9089postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
9090
9091# Dependencies to place before the objects being linked to create a
9092# shared library.
9093predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
9094
9095# Dependencies to place after the objects being linked to create a
9096# shared library.
9097postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
9098
9099# The library search path used internally by the compiler when linking
9100# a shared library.
9101compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
9102
9103# Method to check whether dependent libraries are shared objects.
9104deplibs_check_method=$lt_deplibs_check_method
9105
9106# Command to use when deplibs_check_method == file_magic.
9107file_magic_cmd=$lt_file_magic_cmd
9108
9109# Flag that allows shared libraries with undefined symbols to be built.
9110allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
9111
9112# Flag that forces no undefined symbols.
9113no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
9114
9115# Commands used to finish a libtool library installation in a directory.
9116finish_cmds=$lt_finish_cmds
9117
9118# Same as above, but a single script fragment to be evaled but not shown.
9119finish_eval=$lt_finish_eval
9120
9121# Take the output of nm and produce a listing of raw symbols and C names.
9122global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
9123
9124# Transform the output of nm in a proper C declaration
9125global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
9126
9127# Transform the output of nm in a C name address pair
9128global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
9129
9130# This is the shared library runtime path variable.
9131runpath_var=$runpath_var
9132
9133# This is the shared library path variable.
9134shlibpath_var=$shlibpath_var
9135
9136# Is shlibpath searched before the hard-coded library search path?
9137shlibpath_overrides_runpath=$shlibpath_overrides_runpath
9138
9139# How to hardcode a shared library path into an executable.
9140hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
9141
9142# Whether we should hardcode library paths into libraries.
9143hardcode_into_libs=$hardcode_into_libs
9144
9145# Flag to hardcode \$libdir into a binary during linking.
9146# This must work even if \$libdir does not exist.
9147hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
9148
9149# Whether we need a single -rpath flag with a separated argument.
9150hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
9151
9152# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
9153# resulting binary.
9154hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
9155
9156# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
9157# resulting binary.
9158hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
9159
9160# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
9161# the resulting binary.
9162hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
9163
9164# Variables whose values should be saved in libtool wrapper scripts and
9165# restored at relink time.
9166variables_saved_for_relink="$variables_saved_for_relink"
9167
9168# Whether libtool must link a program against all its dependency libraries.
9169link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
9170
9171# Compile-time system search path for libraries
9172sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
9173
9174# Run-time system search path for libraries
9175sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
9176
9177# Fix the shell variable \$srcfile for the compiler.
9178fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
9179
9180# Set to yes if exported symbols are required.
9181always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
9182
9183# The commands to list exported symbols.
9184export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
9185
9186# The commands to extract the exported symbol list from a shared archive.
9187extract_expsyms_cmds=$lt_extract_expsyms_cmds
9188
9189# Symbols that should not be listed in the preloaded symbols.
9190exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
9191
9192# Symbols that must always be exported.
9193include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
9194
9195ifelse([$1],[],
9196[# ### END LIBTOOL CONFIG],
9197[# ### END LIBTOOL TAG CONFIG: $tagname])
9198
9199__EOF__
9200
9201ifelse([$1],[], [
9202  case $host_os in
9203  aix3*)
9204    cat <<\EOF >> "$cfgfile"
9205
9206# AIX sometimes has problems with the GCC collect2 program.  For some
9207# reason, if we set the COLLECT_NAMES environment variable, the problems
9208# vanish in a puff of smoke.
9209if test "X${COLLECT_NAMES+set}" != Xset; then
9210  COLLECT_NAMES=
9211  export COLLECT_NAMES
9212fi
9213EOF
9214    ;;
9215
9216  cygwin* | mingw* | pw32* | os2*)
9217    cat <<'EOF' >> "$cfgfile"
9218    # This is a source program that is used to create dlls on Windows
9219    # Don't remove nor modify the starting and closing comments
9220    _LT_AC_FILE_LTDLL_C
9221    # This is a source program that is used to create import libraries
9222    # on Windows for dlls which lack them. Don't remove nor modify the
9223    # starting and closing comments
9224    _LT_AC_FILE_IMPGEN_C
9225EOF
9226    ;;
9227  esac
9228
9229  # We use sed instead of cat because bash on DJGPP gets confused if
9230  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
9231  # text mode, it properly converts lines to CR/LF.  This bash problem
9232  # is reportedly fixed, but why not run on old versions too?
9233  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
9234
9235  mv -f "$cfgfile" "$ofile" || \
9236    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
9237  chmod +x "$ofile"
9238])
9239else
9240  # If there is no Makefile yet, we rely on a make rule to execute
9241  # `config.status --recheck' to rerun these tests and create the
9242  # libtool script then.
9243  test -f Makefile && make "$ltmain"
9244fi
9245])# AC_LIBTOOL_CONFIG
9246
9247
9248# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
9249# -------------------------------------------
9250AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
9251[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
9252
9253_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
9254
9255if test "$GCC" = yes; then
9256  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
9257
9258  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
9259    lt_cv_prog_compiler_rtti_exceptions,
9260    [-fno-rtti -fno-exceptions -c conftest.$ac_ext], [],
9261    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
9262fi
9263])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
9264
9265
9266# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
9267# ---------------------------------
9268AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
9269[AC_REQUIRE([AC_CANONICAL_HOST])
9270AC_REQUIRE([AC_PROG_NM])
9271AC_REQUIRE([AC_OBJEXT])
9272# Check for command to grab the raw symbol name followed by C symbol from nm.
9273AC_MSG_CHECKING([command to parse $NM output from $compiler object])
9274AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
9275[
9276# These are sane defaults that work on at least a few old systems.
9277# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
9278
9279# Character class describing NM global symbol codes.
9280symcode='[[BCDEGRST]]'
9281
9282# Regexp to match symbols that can be accessed directly from C.
9283sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
9284
9285# Transform the above into a raw symbol and a C symbol.
9286symxfrm='\1 \2\3 \3'
9287
9288# Transform an extracted symbol line into a proper C declaration
9289lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
9290
9291# Transform an extracted symbol line into symbol name and symbol address
9292lt_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'"
9293
9294# Define system-specific variables.
9295case $host_os in
9296aix*)
9297  symcode='[[BCDT]]'
9298  ;;
9299cygwin* | mingw* | pw32*)
9300  symcode='[[ABCDGISTW]]'
9301  ;;
9302hpux*) # Its linker distinguishes data from code symbols
9303  if test "$host_cpu" = ia64; then
9304    symcode='[[ABCDEGRST]]'
9305  fi
9306  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
9307  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'"
9308  ;;
9309irix* | nonstopux*)
9310  symcode='[[BCDEGRST]]'
9311  ;;
9312solaris* | sysv5*)
9313  symcode='[[BDT]]'
9314  ;;
9315sysv4)
9316  symcode='[[DFNSTU]]'
9317  ;;
9318esac
9319
9320# Handle CRLF in mingw tool chain
9321opt_cr=
9322case $host_os in
9323mingw*)
9324  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
9325  ;;
9326esac
9327
9328# If we're using GNU nm, then use its standard symbol codes.
9329if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
9330  symcode='[[ABCDGISTW]]'
9331fi
9332
9333# Try without a prefix undercore, then with it.
9334for ac_symprfx in "" "_"; do
9335
9336  # Write the raw and C identifiers.
9337  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
9338
9339  # Check to see that the pipe works correctly.
9340  pipe_works=no
9341
9342  rm -f conftest*
9343  cat > conftest.$ac_ext <<EOF
9344#ifdef __cplusplus
9345extern "C" {
9346#endif
9347char nm_test_var;
9348void nm_test_func(){}
9349#ifdef __cplusplus
9350}
9351#endif
9352int main(){nm_test_var='a';nm_test_func();return(0);}
9353EOF
9354
9355  if AC_TRY_EVAL(ac_compile); then
9356    # Now try to grab the symbols.
9357    nlist=conftest.nm
9358    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
9359      # Try sorting and uniquifying the output.
9360      if sort "$nlist" | uniq > "$nlist"T; then
9361	mv -f "$nlist"T "$nlist"
9362      else
9363	rm -f "$nlist"T
9364      fi
9365
9366      # Make sure that we snagged all the symbols we need.
9367      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
9368	if egrep ' nm_test_func$' "$nlist" >/dev/null; then
9369	  cat <<EOF > conftest.$ac_ext
9370#ifdef __cplusplus
9371extern "C" {
9372#endif
9373
9374EOF
9375	  # Now generate the symbol file.
9376	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
9377
9378	  cat <<EOF >> conftest.$ac_ext
9379#if defined (__STDC__) && __STDC__
9380# define lt_ptr_t void *
9381#else
9382# define lt_ptr_t char *
9383# define const
9384#endif
9385
9386/* The mapping between symbol names and symbols. */
9387const struct {
9388  const char *name;
9389  lt_ptr_t address;
9390}
9391lt_preloaded_symbols[[]] =
9392{
9393EOF
9394	  sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
9395	  cat <<\EOF >> conftest.$ac_ext
9396  {0, (lt_ptr_t) 0}
9397};
9398
9399#ifdef __cplusplus
9400}
9401#endif
9402EOF
9403	  # Now try linking the two files.
9404	  mv conftest.$ac_objext conftstm.$ac_objext
9405	  lt_save_LIBS="$LIBS"
9406	  lt_save_CFLAGS="$CFLAGS"
9407	  LIBS="conftstm.$ac_objext"
9408	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
9409	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
9410	    pipe_works=yes
9411	  fi
9412	  LIBS="$lt_save_LIBS"
9413	  CFLAGS="$lt_save_CFLAGS"
9414	else
9415	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
9416	fi
9417      else
9418	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
9419      fi
9420    else
9421      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
9422    fi
9423  else
9424    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
9425    cat conftest.$ac_ext >&5
9426  fi
9427  rm -f conftest* conftst*
9428
9429  # Do not use the global_symbol_pipe unless it works.
9430  if test "$pipe_works" = yes; then
9431    break
9432  else
9433    lt_cv_sys_global_symbol_pipe=
9434  fi
9435done
9436])
9437if test -z "$lt_cv_sys_global_symbol_pipe"; then
9438  lt_cv_sys_global_symbol_to_cdecl=
9439fi
9440if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
9441  AC_MSG_RESULT(failed)
9442else
9443  AC_MSG_RESULT(ok)
9444fi
9445]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
9446
9447
9448# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
9449# ---------------------------------------
9450AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
9451[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
9452_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
9453_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
9454
9455AC_MSG_CHECKING([for $compiler option to produce PIC])
9456 ifelse([$1],[CXX],[
9457  # C++ specific cases for pic, static, wl, etc.
9458  if test "$GXX" = yes; then
9459    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9460    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
9461
9462    case $host_os in
9463    aix*)
9464      # All AIX code is PIC.
9465      if test "$host_cpu" = ia64; then
9466	# AIX 5 now supports IA64 processor
9467	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9468      fi
9469      ;;
9470    amigaos*)
9471      # FIXME: we need at least 68020 code to build shared libraries, but
9472      # adding the `-m68020' flag to GCC prevents building anything better,
9473      # like `-m68040'.
9474      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
9475      ;;
9476    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
9477      # PIC is the default for these OSes.
9478      ;;
9479    cygwin* | mingw* | os2*)
9480      # This hack is so that the source file can tell whether it is being
9481      # built for inclusion in a dll (and should export symbols for example).
9482      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
9483      ;;
9484    darwin* | rhapsody*)
9485      # PIC is the default on this platform
9486      # Common symbols not allowed in MH_DYLIB files
9487      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
9488      ;;
9489    *djgpp*)
9490      # DJGPP does not support shared libraries at all
9491      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
9492      ;;
9493    sysv4*MP*)
9494      if test -d /usr/nec; then
9495	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
9496      fi
9497      ;;
9498    hpux*)
9499      # PIC is the default for IA64 HP-UX, but not for PA HP-UX.
9500      if test "$host_cpu" != ia64; then
9501	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9502      fi
9503      ;;
9504    *)
9505      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9506      ;;
9507    esac
9508  else
9509    case $host_os in
9510      aix4* | aix5*)
9511	# All AIX code is PIC.
9512	if test "$host_cpu" = ia64; then
9513	  # AIX 5 now supports IA64 processor
9514	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9515	else
9516	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
9517	fi
9518	;;
9519      chorus*)
9520	case $cc_basename in
9521	cxch68)
9522	  # Green Hills C++ Compiler
9523	  # _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"
9524	  ;;
9525	esac
9526	;;
9527      dgux*)
9528	case $cc_basename in
9529	  ec++)
9530	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9531	    ;;
9532	  ghcx)
9533	    # Green Hills C++ Compiler
9534	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
9535	    ;;
9536	  *)
9537	    ;;
9538	esac
9539	;;
9540      freebsd*)
9541	# FreeBSD uses GNU C++
9542	;;
9543      hpux9* | hpux10* | hpux11*)
9544	case $cc_basename in
9545	  CC)
9546	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9547	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
9548	    if test "$host_cpu" != ia64; then
9549	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
9550	    fi
9551	    ;;
9552	  aCC)
9553	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9554	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
9555	    if test "$host_cpu" != ia64; then
9556	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
9557	    fi
9558	    ;;
9559	  *)
9560	    ;;
9561	esac
9562	;;
9563      irix5* | irix6* | nonstopux*)
9564	case $cc_basename in
9565	  CC)
9566	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9567	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9568	    # CC pic flag -KPIC is the default.
9569	    ;;
9570	  *)
9571	    ;;
9572	esac
9573	;;
9574      linux*)
9575	case $cc_basename in
9576	  KCC)
9577	    # KAI C++ Compiler
9578	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
9579	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9580	    ;;
9581	  cxx)
9582	    # Compaq C++
9583	    # Make sure the PIC flag is empty.  It appears that all Alpha
9584	    # Linux and Compaq Tru64 Unix objects are PIC.
9585	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
9586	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9587	    ;;
9588	  *)
9589	    ;;
9590	esac
9591	;;
9592      lynxos*)
9593	;;
9594      m88k*)
9595	;;
9596      mvs*)
9597	case $cc_basename in
9598	  cxx)
9599	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
9600	    ;;
9601	  *)
9602	    ;;
9603	esac
9604	;;
9605      netbsd*)
9606	;;
9607      osf3* | osf4* | osf5*)
9608	case $cc_basename in
9609	  KCC)
9610	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
9611	    ;;
9612	  RCC)
9613	    # Rational C++ 2.4.1
9614	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
9615	    ;;
9616	  cxx)
9617	    # Digital/Compaq C++
9618	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9619	    # Make sure the PIC flag is empty.  It appears that all Alpha
9620	    # Linux and Compaq Tru64 Unix objects are PIC.
9621	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
9622	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9623	    ;;
9624	  *)
9625	    ;;
9626	esac
9627	;;
9628      psos*)
9629	;;
9630      sco*)
9631	case $cc_basename in
9632	  CC)
9633	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9634	    ;;
9635	  *)
9636	    ;;
9637	esac
9638	;;
9639      solaris*)
9640	case $cc_basename in
9641	  CC)
9642	    # Sun C++ 4.2, 5.x and Centerline C++
9643	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9644	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9645	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
9646	    ;;
9647	  gcx)
9648	    # Green Hills C++ Compiler
9649	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
9650	    ;;
9651	  *)
9652	    ;;
9653	esac
9654	;;
9655      sunos4*)
9656	case $cc_basename in
9657	  CC)
9658	    # Sun C++ 4.x
9659	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
9660	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9661	    ;;
9662	  lcc)
9663	    # Lucid
9664	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
9665	    ;;
9666	  *)
9667	    ;;
9668	esac
9669	;;
9670      tandem*)
9671	case $cc_basename in
9672	  NCC)
9673	    # NonStop-UX NCC 3.20
9674	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9675	    ;;
9676	  *)
9677	    ;;
9678	esac
9679	;;
9680      unixware*)
9681	;;
9682      vxworks*)
9683	;;
9684      *)
9685	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
9686	;;
9687    esac
9688  fi
9689],
9690[
9691  if test "$GCC" = yes; then
9692    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9693    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
9694
9695    case $host_os in
9696      aix*)
9697      # All AIX code is PIC.
9698      if test "$host_cpu" = ia64; then
9699	# AIX 5 now supports IA64 processor
9700	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9701      fi
9702      ;;
9703
9704    amigaos*)
9705      # FIXME: we need at least 68020 code to build shared libraries, but
9706      # adding the `-m68020' flag to GCC prevents building anything better,
9707      # like `-m68040'.
9708      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
9709      ;;
9710
9711    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
9712      # PIC is the default for these OSes.
9713      ;;
9714
9715    cygwin* | mingw* | pw32* | os2*)
9716      # This hack is so that the source file can tell whether it is being
9717      # built for inclusion in a dll (and should export symbols for example).
9718      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
9719      ;;
9720
9721    darwin* | rhapsody*)
9722      # PIC is the default on this platform
9723      # Common symbols not allowed in MH_DYLIB files
9724      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
9725      ;;
9726
9727    msdosdjgpp*)
9728      # Just because we use GCC doesn't mean we suddenly get shared libraries
9729      # on systems that don't support them.
9730      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
9731      enable_shared=no
9732      ;;
9733
9734    sysv4*MP*)
9735      if test -d /usr/nec; then
9736	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
9737      fi
9738      ;;
9739
9740    hpux*)
9741      # PIC is the default for IA64 HP-UX, but not for PA HP-UX.
9742      if test "$host_cpu" != ia64; then
9743	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9744      fi
9745      ;;
9746
9747    *)
9748      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
9749      ;;
9750    esac
9751  else
9752    # PORTME Check for flag to pass linker flags through the system compiler.
9753    case $host_os in
9754    aix*)
9755      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9756      if test "$host_cpu" = ia64; then
9757	# AIX 5 now supports IA64 processor
9758	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9759      else
9760	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
9761      fi
9762      ;;
9763
9764    cygwin* | mingw* | pw32* | os2*)
9765      # This hack is so that the source file can tell whether it is being
9766      # built for inclusion in a dll (and should export symbols for example).
9767      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
9768      ;;
9769
9770    hpux9* | hpux10* | hpux11*)
9771      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9772      if test "$host_cpu" != ia64; then
9773	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
9774      fi
9775      # Is there a better lt_prog_compiler_static that works with the bundled CC?
9776      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
9777      ;;
9778
9779    irix5* | irix6* | nonstopux*)
9780      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9781      # PIC (with -KPIC) is the default.
9782      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9783      ;;
9784
9785    newsos6)
9786      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9787      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9788      ;;
9789
9790    osf3* | osf4* | osf5*)
9791      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9792      # All OSF/1 code is PIC.
9793      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
9794      ;;
9795
9796    sco3.2v5*)
9797      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
9798      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
9799      ;;
9800
9801    solaris*)
9802      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9803      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9804      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9805      ;;
9806
9807    sunos4*)
9808      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
9809      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
9810      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9811      ;;
9812
9813    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
9814      if test "x$host_vendor" = xsni; then
9815	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-LD'
9816      else
9817	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
9818      fi
9819      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
9820      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9821      ;;
9822
9823    sysv4*MP*)
9824      if test -d /usr/nec ;then
9825	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
9826	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9827      fi
9828      ;;
9829
9830    uts4*)
9831      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
9832      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
9833      ;;
9834
9835    *)
9836      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
9837      ;;
9838    esac
9839  fi
9840])
9841AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
9842
9843#
9844# Check to make sure the PIC flag actually works.
9845#
9846if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
9847  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
9848    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
9849    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC], [],
9850    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
9851     "" | " "*) ;;
9852     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
9853     esac],
9854    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
9855     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
9856fi
9857case "$host_os" in
9858  # For platforms which do not support PIC, -DPIC is meaningless:
9859  *djgpp*)
9860    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
9861    ;;
9862  *)
9863    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC"
9864    ;;
9865esac
9866])
9867
9868
9869# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
9870# ------------------------------------
9871# See if the linker supports building shared libraries.
9872AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
9873[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
9874ifelse([$1],[CXX],[
9875  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
9876  case $host_os in
9877  aix4* | aix5*)
9878    # If we're using GNU nm, then we don't want the "-C" option.
9879    # -C means demangle to AIX nm, but means don't demangle with GNU nm
9880    if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then
9881      _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'
9882    else
9883      _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'
9884    fi
9885    ;;
9886  cygwin* | mingw* | pw32*)
9887    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
9888  ;;
9889  *)
9890    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
9891  ;;
9892  esac
9893],[
9894  runpath_var=
9895  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
9896
9897  _LT_AC_TAGVAR(archive_cmds, $1)=
9898  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=
9899  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
9900  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
9901  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
9902  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
9903  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
9904  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
9905  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
9906  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
9907  _LT_AC_TAGVAR(hardcode_direct, $1)=no
9908  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
9909  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
9910  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
9911  _LT_AC_TAGVAR(always_export_symbols, $1)=no
9912  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
9913  # include_expsyms should be a list of space-separated symbols to be *always*
9914  # included in the symbol list
9915  _LT_AC_TAGVAR(include_expsyms, $1)=
9916  # exclude_expsyms can be an egrep regular expression of symbols to exclude
9917  # it will be wrapped by ` (' and `)$', so one must not match beginning or
9918  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
9919  # as well as any symbol that contains `d'.
9920  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
9921  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
9922  # platforms (ab)use it in PIC code, but their linkers get confused if
9923  # the symbol is explicitly referenced.  Since portable code cannot
9924  # rely on this symbol name, it's probably fine to never include it in
9925  # preloaded symbol tables.
9926  extract_expsyms_cmds=
9927
9928  case $host_os in
9929  cygwin* | mingw* | pw32*)
9930    # FIXME: the MSVC++ port hasn't been tested in a loooong time
9931    # When not using gcc, we currently assume that we are using
9932    # Microsoft Visual C++.
9933    if test "$GCC" != yes; then
9934      with_gnu_ld=no
9935    fi
9936    ;;
9937  openbsd*)
9938    with_gnu_ld=no
9939    ;;
9940  esac
9941
9942  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
9943  if test "$with_gnu_ld" = yes; then
9944    # If archive_cmds runs LD, not CC, wlarc should be empty
9945    wlarc='${wl}'
9946
9947    # See if GNU ld supports shared libraries.
9948    case $host_os in
9949    aix3* | aix4* | aix5*)
9950      # On AIX/PPC, the GNU linker is very broken
9951      if test "$host_cpu" != ia64; then
9952	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9953	cat <<EOF 1>&2
9954
9955*** Warning: the GNU linker, at least up to release 2.9.1, is reported
9956*** to be unable to reliably create shared libraries on AIX.
9957*** Therefore, libtool is disabling shared libraries support.  If you
9958*** really care for shared libraries, you may want to modify your PATH
9959*** so that a non-GNU linker is found, and then restart.
9960
9961EOF
9962      fi
9963      ;;
9964
9965    amigaos*)
9966      _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)'
9967      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9968      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
9969
9970      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
9971      # that the semantics of dynamic libraries on AmigaOS, at least up
9972      # to version 4, is to share data among multiple programs linked
9973      # with the same dynamic library.  Since this doesn't match the
9974      # behavior of shared libraries on other platforms, we can't use
9975      # them.
9976      _LT_AC_TAGVAR(ld_shlibs, $1)=no
9977      ;;
9978
9979    beos*)
9980      if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
9981	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
9982	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
9983	# support --undefined.  This deserves some investigation.  FIXME
9984	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9985      else
9986	_LT_AC_TAGVAR(ld_shlibs, $1)=no
9987      fi
9988      ;;
9989
9990    cygwin* | mingw* | pw32*)
9991      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, as there is
9992      # no search path for DLLs.
9993      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
9994      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
9995      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
9996
9997      extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
9998	sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
9999	test -f $output_objdir/impgen.exe || (cd $output_objdir && \
10000	if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
10001	else $CC -o impgen impgen.c ; fi)~
10002	$output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
10003
10004      _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
10005
10006      # cygwin and mingw dlls have different entry points and sets of symbols
10007      # to exclude.
10008      # FIXME: what about values for MSVC?
10009      dll_entry=__cygwin_dll_entry@12
10010      dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
10011      case $host_os in
10012      mingw*)
10013	# mingw values
10014	dll_entry=_DllMainCRTStartup@12
10015	dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
10016	;;
10017      esac
10018
10019      # mingw and cygwin differ, and it's simplest to just exclude the union
10020      # of the two symbol sets.
10021      dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
10022
10023      # recent cygwin and mingw systems supply a stub DllMain which the user
10024      # can override, but on older systems we have to supply one (in ltdll.c)
10025      if test "x$lt_cv_need_dllmain" = "xyes"; then
10026	ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
10027	ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
10028  	test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
10029      else
10030	ltdll_obj=
10031	ltdll_cmds=
10032      fi
10033
10034      # Extract the symbol export list from an `--export-all' def file,
10035      # then regenerate the def file from the symbol export list, so that
10036      # the compiled dll only exports the symbol export list.
10037      # Be careful not to strip the DATA tag left by newer dlltools.
10038      _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"'
10039	$DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
10040	sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
10041
10042      # If the export-symbols file already is a .def file (1st line
10043      # is EXPORTS), use it as is.
10044      # If DATA tags from a recent dlltool are present, honour them!
10045      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`head -1 $export_symbols`" = xEXPORTS; then
10046	  cp $export_symbols $output_objdir/$soname-def;
10047	else
10048	  echo EXPORTS > $output_objdir/$soname-def;
10049	  _lt_hint=1;
10050	  cat $export_symbols | while read symbol; do
10051	   set dummy \$symbol;
10052	   case \[$]# in
10053	     2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
10054	     *) echo "   \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
10055	   esac;
10056	   _lt_hint=`expr 1 + \$_lt_hint`;
10057	  done;
10058	fi~
10059	'"$ltdll_cmds"'
10060	$CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
10061	$DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
10062	$CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
10063	$DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
10064	$CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
10065      ;;
10066
10067    netbsd*)
10068      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
10069	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
10070	wlarc=
10071      else
10072	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10073	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
10074      fi
10075      ;;
10076
10077    solaris* | sysv5*)
10078      if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
10079	_LT_AC_TAGVAR(ld_shlibs, $1)=no
10080	cat <<EOF 1>&2
10081
10082*** Warning: The releases 2.8.* of the GNU linker cannot reliably
10083*** create shared libraries on Solaris systems.  Therefore, libtool
10084*** is disabling shared libraries support.  We urge you to upgrade GNU
10085*** binutils to release 2.9.1 or newer.  Another option is to modify
10086*** your PATH or compiler configuration so that the native linker is
10087*** used, and then restart.
10088
10089EOF
10090      elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
10091	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10092	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
10093      else
10094	_LT_AC_TAGVAR(ld_shlibs, $1)=no
10095      fi
10096      ;;
10097
10098    sunos4*)
10099      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
10100      wlarc=
10101      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10102      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10103      ;;
10104
10105    *)
10106      if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
10107	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
10108	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
10109      else
10110	_LT_AC_TAGVAR(ld_shlibs, $1)=no
10111      fi
10112      ;;
10113    esac
10114
10115    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
10116      runpath_var=LD_RUN_PATH
10117      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
10118      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
10119      case $host_os in
10120      cygwin* | mingw* | pw32*)
10121	# dlltool doesn't understand --whole-archive et. al.
10122	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
10123	;;
10124      *)
10125	# ancient GNU ld didn't support --whole-archive et. al.
10126	if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
10127  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
10128	else
10129  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
10130	fi
10131	;;
10132      esac
10133    fi
10134  else
10135    # PORTME fill in a description of your system's linker (not GNU ld)
10136    case $host_os in
10137    aix3*)
10138      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
10139      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
10140      _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'
10141      # Note: this linker hardcodes the directories in LIBPATH if there
10142      # are no directories specified by -L.
10143      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10144      if test "$GCC" = yes && test -z "$link_static_flag"; then
10145	# Neither direct hardcoding nor static linking is supported with a
10146	# broken collect2.
10147	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
10148      fi
10149      ;;
10150
10151    aix4* | aix5*)
10152      if test "$host_cpu" = ia64; then
10153	# On IA64, the linker does run time linking by default, so we don't
10154	# have to do anything special.
10155	aix_use_runtimelinking=no
10156	exp_sym_flag='-Bexport'
10157	no_entry_flag=""
10158      else
10159	# If we're using GNU nm, then we don't want the "-C" option.
10160	# -C means demangle to AIX nm, but means don't demangle with GNU nm
10161	if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then
10162	  _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'
10163	else
10164	  _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'
10165	fi
10166
10167	# KDE requires run time linking.  Make it the default.
10168	aix_use_runtimelinking=yes
10169	exp_sym_flag='-bexport'
10170	no_entry_flag='-bnoentry'
10171      fi
10172
10173      # When large executables or shared objects are built, AIX ld can
10174      # have problems creating the table of contents.  If linking a library
10175      # or program results in "error TOC overflow" add -mminimal-toc to
10176      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
10177      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
10178
10179      _LT_AC_TAGVAR(archive_cmds, $1)=''
10180      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10181      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
10182      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
10183
10184      if test "$GCC" = yes; then
10185	case $host_os in aix4.[012]|aix4.[012].*)
10186	# We only want to do this on AIX 4.2 and lower, the check
10187	# below for broken collect2 doesn't work under 4.3+
10188	  collect2name=`${CC} -print-prog-name=collect2`
10189	  if test -f "$collect2name" && \
10190  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
10191	  then
10192  	  # We have reworked collect2
10193  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10194	  else
10195  	  # We have old collect2
10196  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
10197  	  # It fails to find uninstalled libraries when the uninstalled
10198  	  # path is not listed in the libpath.  Setting hardcode_minus_L
10199  	  # to unsupported forces relinking
10200  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10201  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10202  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
10203	  fi
10204	esac
10205	shared_flag='-shared'
10206      else
10207	# not using gcc
10208	if test "$host_cpu" = ia64; then
10209  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
10210  	# chokes on -Wl,-G. The following line is correct:
10211	  shared_flag='-G'
10212	else
10213  	if test "$aix_use_runtimelinking" = yes; then
10214	    shared_flag='-qmkshrobj ${wl}-G'
10215	  else
10216	    shared_flag='-qmkshrobj'
10217  	fi
10218	fi
10219      fi
10220
10221      # Let the compiler handle the export list.
10222      _LT_AC_TAGVAR(always_export_symbols, $1)=no
10223      if test "$aix_use_runtimelinking" = yes; then
10224	# Warning - without using the other runtime loading flags (-brtl),
10225	# -berok will link without error, but may produce a broken library.
10226	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
10227       # Determine the default libpath from the value encoded in an empty executable.
10228	_LT_AC_SYS_LIBPATH_AIX
10229	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
10230	_LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
10231	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
10232       else
10233	if test "$host_cpu" = ia64; then
10234	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
10235	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
10236	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
10237	else
10238	 # Determine the default libpath from the value encoded in an empty executable.
10239	 _LT_AC_SYS_LIBPATH_AIX
10240	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
10241	  # Warning - without using the other run time loading flags,
10242	  # -berok will link without error, but may produce a broken library.
10243	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
10244	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
10245	  # -bexpall does not export symbols beginning with underscore (_)
10246	  _LT_AC_TAGVAR(always_export_symbols, $1)=yes
10247	  # Exported symbols can be pulled into shared objects from archives
10248	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
10249	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
10250	  # This is similar to how AIX traditionally builds it's shared libraries.
10251	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
10252	fi
10253      fi
10254      ;;
10255
10256    amigaos*)
10257      _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)'
10258      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10259      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10260      # see comment about different semantics on the GNU ld section
10261      _LT_AC_TAGVAR(ld_shlibs, $1)=no
10262      ;;
10263
10264    bsdi4*)
10265      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
10266      ;;
10267
10268    cygwin* | mingw* | pw32*)
10269      # When not using gcc, we currently assume that we are using
10270      # Microsoft Visual C++.
10271      # hardcode_libdir_flag_spec is actually meaningless, as there is
10272      # no search path for DLLs.
10273      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
10274      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
10275      # Tell ltmain to make .lib files, not .a files.
10276      libext=lib
10277      # FIXME: Setting linknames here is a bad hack.
10278      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
10279      # The linker will automatically build a .lib file if we build a DLL.
10280      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
10281      # FIXME: Should let the user specify the lib program.
10282      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
10283      fix_srcfile_path='`cygpath -w "$srcfile"`'
10284      ;;
10285
10286    darwin* | rhapsody*)
10287      case "$host_os" in
10288      rhapsody* | darwin1.[[012]])
10289	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
10290	;;
10291      *) # Darwin 1.3 on
10292	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
10293	;;
10294      esac
10295
10296      # FIXME: Relying on posixy $() will cause problems for
10297      #        cross-compilation, but unfortunately the echo tests do not
10298      #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
10299      #	       `"' quotes if we put them in here... so don't!
10300      _LT_AC_TAGVAR(archive_cmds, $1)='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring'
10301      # We need to add '_' to the symbols in $export_symbols first
10302      #_LT_AC_TAGVAR(archive_expsym_cmds, $1)="$_LT_AC_TAGVAR(archive_cmds, $1)"' && strip -s $export_symbols'
10303      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10304      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10305      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
10306      ;;
10307
10308    dgux*)
10309      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10310      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10311      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10312      ;;
10313
10314    freebsd1*)
10315      _LT_AC_TAGVAR(ld_shlibs, $1)=no
10316      ;;
10317
10318    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
10319    # support.  Future versions do this automatically, but an explicit c++rt0.o
10320    # does not break anything, and helps significantly (at the cost of a little
10321    # extra space).
10322    freebsd2.2*)
10323      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
10324      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10325      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10326      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10327      ;;
10328
10329    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
10330    freebsd2*)
10331      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
10332      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10333      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10334      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10335      ;;
10336
10337    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
10338    freebsd*)
10339      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
10340      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10341      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10342      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10343      ;;
10344
10345    hpux9* | hpux10* | hpux11*)
10346      if test "$GCC" = yes; then
10347	case $host_os in
10348	  hpux9*)
10349	    _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
10350	    ;;
10351	  *)
10352	    if test "$host_cpu" = ia64; then
10353	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10354	    else
10355	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
10356	    fi
10357	    ;;
10358	esac
10359      else
10360	case $host_os in
10361	  hpux9*)
10362	    _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'
10363	    ;;
10364	  *)
10365	    if test "$host_cpu" = ia64; then
10366	      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
10367	    else
10368	      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
10369	    fi
10370	    ;;
10371	esac
10372      fi
10373      if test "$host_cpu" = ia64; then
10374	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10375	_LT_AC_TAGVAR(hardcode_direct, $1)=no
10376	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10377      else
10378	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
10379	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
10380	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
10381      fi
10382      # hardcode_minus_L: Not really in the search PATH,
10383      # but as the default location of the library.
10384      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10385      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
10386      ;;
10387
10388    irix5* | irix6* | nonstopux*)
10389      if test "$GCC" = yes; then
10390	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
10391      else
10392	_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'
10393      fi
10394      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
10395      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
10396      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
10397      ;;
10398
10399    netbsd*)
10400      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
10401	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
10402      else
10403	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
10404      fi
10405      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10406      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10407      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10408      ;;
10409
10410    newsos6)
10411      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10412      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10413      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
10414      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
10415      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10416      ;;
10417
10418    openbsd*)
10419      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10420      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10421
10422      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
10423	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
10424	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
10425	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
10426      else
10427       case $host_os in
10428	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
10429	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
10430	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10431	   ;;
10432	 *)
10433	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
10434	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
10435	   ;;
10436       esac
10437      fi
10438      ;;
10439
10440    os2*)
10441      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10442      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10443      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
10444      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
10445      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
10446      ;;
10447
10448    osf3*)
10449      if test "$GCC" = yes; then
10450	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
10451	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
10452      else
10453	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
10454	_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'
10455      fi
10456      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
10457      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
10458      ;;
10459
10460    osf4* | osf5*)	# as osf3* with the addition of -msym flag
10461      if test "$GCC" = yes; then
10462	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
10463	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
10464	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
10465      else
10466	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
10467	_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'
10468	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
10469	$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'
10470
10471	# Both c and cxx compiler support -rpath directly
10472	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
10473      fi
10474      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
10475      ;;
10476
10477    sco3.2v5*)
10478      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10479      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10480      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
10481      runpath_var=LD_RUN_PATH
10482      hardcode_runpath_var=yes
10483      ;;
10484
10485    solaris*)
10486      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
10487      if test "$GCC" = yes; then
10488	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10489	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
10490	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
10491      else
10492	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
10493	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
10494  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
10495      fi
10496      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
10497      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10498      case $host_os in
10499      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
10500      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
10501	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
10502      esac
10503      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
10504      ;;
10505
10506    sunos4*)
10507      if test "x$host_vendor" = xsequent; then
10508	# Use $CC to link under sequent, because it throws in some extra .o
10509	# files that make .init and .fini sections work.
10510	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
10511      else
10512	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
10513      fi
10514      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10515      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10516      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
10517      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10518      ;;
10519
10520    sysv4)
10521      if test "x$host_vendor" = xsni; then
10522	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
10523	_LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
10524      else
10525	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10526	_LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
10527      fi
10528      runpath_var='LD_RUN_PATH'
10529      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10530      ;;
10531
10532    sysv4.3*)
10533      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10534      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10535      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
10536      ;;
10537
10538    sysv4*MP*)
10539      if test -d /usr/nec; then
10540	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10541	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10542	runpath_var=LD_RUN_PATH
10543	hardcode_runpath_var=yes
10544	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
10545      fi
10546      ;;
10547
10548    sysv4.2uw2*)
10549      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
10550      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
10551      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
10552      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10553      hardcode_runpath_var=yes
10554      runpath_var=LD_RUN_PATH
10555      ;;
10556
10557   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
10558      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
10559      if test "$GCC" = yes; then
10560	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10561      else
10562	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
10563      fi
10564      runpath_var='LD_RUN_PATH'
10565      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10566      ;;
10567
10568    sysv5*)
10569      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
10570      # $CC -shared without GNU ld will not create a library from C++
10571      # object files and a static libstdc++, better avoid it by now
10572      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
10573      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
10574  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
10575      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
10576      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10577      runpath_var='LD_RUN_PATH'
10578      ;;
10579
10580    uts4*)
10581      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10582      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
10583      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
10584      ;;
10585
10586    *)
10587      _LT_AC_TAGVAR(ld_shlibs, $1)=no
10588      ;;
10589    esac
10590  fi
10591])
10592AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
10593test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
10594
10595variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
10596if test "$GCC" = yes; then
10597  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
10598fi
10599
10600#
10601# Do we need to explicitly link libc?
10602#
10603_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
10604if test "$enable_shared" = yes && test "$GCC" = yes; then
10605  case $_LT_AC_TAGVAR(archive_cmds, $1) in
10606  *'~'*)
10607    # FIXME: we may have to deal with multi-command sequences.
10608    ;;
10609  '$CC '*)
10610    # Test whether the compiler implicitly links with -lc since on some
10611    # systems, -lgcc has to come before -lc. If gcc already passes -lc
10612    # to ld, don't add -lc before -lgcc.
10613    AC_MSG_CHECKING([whether -lc should be explicitly linked in])
10614    $rm conftest*
10615    echo 'static int dummy;' > conftest.$ac_ext
10616
10617    if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
10618      soname=conftest
10619      lib=conftest
10620      libobjs=conftest.$ac_objext
10621      deplibs=
10622      wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
10623      compiler_flags=-v
10624      linker_flags=-v
10625      verstring=
10626      output_objdir=.
10627      libname=conftest
10628      lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
10629      _LT_AC_TAGVAR(allow_undefined_flag, $1)=
10630      if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
10631      then
10632	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
10633      else
10634	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
10635      fi
10636      _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
10637    else
10638      cat conftest.err 1>&5
10639    fi
10640    $rm conftest*
10641    AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
10642    ;;
10643  esac
10644fi
10645])# AC_LIBTOOL_PROG_LD_SHLIBS
10646
10647
10648# _LT_AC_FILE_LTDLL_C
10649# -------------------
10650# Be careful that the start marker always follows a newline.
10651AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
10652# /* ltdll.c starts here */
10653# #define WIN32_LEAN_AND_MEAN
10654# #include <windows.h>
10655# #undef WIN32_LEAN_AND_MEAN
10656# #include <stdio.h>
10657#
10658# #ifndef __CYGWIN__
10659# #  ifdef __CYGWIN32__
10660# #    define __CYGWIN__ __CYGWIN32__
10661# #  endif
10662# #endif
10663#
10664# #ifdef __cplusplus
10665# extern "C" {
10666# #endif
10667# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
10668# #ifdef __cplusplus
10669# }
10670# #endif
10671#
10672# #ifdef __CYGWIN__
10673# #include <cygwin/cygwin_dll.h>
10674# DECLARE_CYGWIN_DLL( DllMain );
10675# #endif
10676# HINSTANCE __hDllInstance_base;
10677#
10678# BOOL APIENTRY
10679# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
10680# {
10681#   __hDllInstance_base = hInst;
10682#   return TRUE;
10683# }
10684# /* ltdll.c ends here */
10685])# _LT_AC_FILE_LTDLL_C
10686
10687
10688# _LT_AC_FILE_IMPGEN_C
10689# --------------------
10690# Be careful that the start marker always follows a newline.
10691AC_DEFUN([_LT_AC_FILE_IMPGEN_C], [
10692# /* impgen.c starts here */
10693# /*   Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
10694#
10695#  This file is part of GNU libtool.
10696#
10697#  This program is free software; you can redistribute it and/or modify
10698#  it under the terms of the GNU General Public License as published by
10699#  the Free Software Foundation; either version 2 of the License, or
10700#  (at your option) any later version.
10701#
10702#  This program is distributed in the hope that it will be useful,
10703#  but WITHOUT ANY WARRANTY; without even the implied warranty of
10704#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10705#  GNU General Public License for more details.
10706#
10707#  You should have received a copy of the GNU General Public License
10708#  along with this program; if not, write to the Free Software
10709#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
10710#  */
10711#
10712# #include <stdio.h>		/* for printf() */
10713# #include <unistd.h>		/* for open(), lseek(), read() */
10714# #include <fcntl.h>		/* for O_RDONLY, O_BINARY */
10715# #include <string.h>		/* for strdup() */
10716#
10717# /* O_BINARY isn't required (or even defined sometimes) under Unix */
10718# #ifndef O_BINARY
10719# #define O_BINARY 0
10720# #endif
10721#
10722# static unsigned int
10723# pe_get16 (fd, offset)
10724#      int fd;
10725#      int offset;
10726# {
10727#   unsigned char b[2];
10728#   lseek (fd, offset, SEEK_SET);
10729#   read (fd, b, 2);
10730#   return b[0] + (b[1]<<8);
10731# }
10732#
10733# static unsigned int
10734# pe_get32 (fd, offset)
10735#     int fd;
10736#     int offset;
10737# {
10738#   unsigned char b[4];
10739#   lseek (fd, offset, SEEK_SET);
10740#   read (fd, b, 4);
10741#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
10742# }
10743#
10744# static unsigned int
10745# pe_as32 (ptr)
10746#      void *ptr;
10747# {
10748#   unsigned char *b = ptr;
10749#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
10750# }
10751#
10752# int
10753# main (argc, argv)
10754#     int argc;
10755#     char *argv[];
10756# {
10757#     int dll;
10758#     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
10759#     unsigned long export_rva, export_size, nsections, secptr, expptr;
10760#     unsigned long name_rvas, nexp;
10761#     unsigned char *expdata, *erva;
10762#     char *filename, *dll_name;
10763#
10764#     filename = argv[1];
10765#
10766#     dll = open(filename, O_RDONLY|O_BINARY);
10767#     if (dll < 1)
10768# 	return 1;
10769#
10770#     dll_name = filename;
10771#
10772#     for (i=0; filename[i]; i++)
10773# 	if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
10774# 	    dll_name = filename + i +1;
10775#
10776#     pe_header_offset = pe_get32 (dll, 0x3c);
10777#     opthdr_ofs = pe_header_offset + 4 + 20;
10778#     num_entries = pe_get32 (dll, opthdr_ofs + 92);
10779#
10780#     if (num_entries < 1) /* no exports */
10781# 	return 1;
10782#
10783#     export_rva = pe_get32 (dll, opthdr_ofs + 96);
10784#     export_size = pe_get32 (dll, opthdr_ofs + 100);
10785#     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
10786#     secptr = (pe_header_offset + 4 + 20 +
10787# 	      pe_get16 (dll, pe_header_offset + 4 + 16));
10788#
10789#     expptr = 0;
10790#     for (i = 0; i < nsections; i++)
10791#     {
10792# 	char sname[8];
10793# 	unsigned long secptr1 = secptr + 40 * i;
10794# 	unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
10795# 	unsigned long vsize = pe_get32 (dll, secptr1 + 16);
10796# 	unsigned long fptr = pe_get32 (dll, secptr1 + 20);
10797# 	lseek(dll, secptr1, SEEK_SET);
10798# 	read(dll, sname, 8);
10799# 	if (vaddr <= export_rva && vaddr+vsize > export_rva)
10800# 	{
10801# 	    expptr = fptr + (export_rva - vaddr);
10802# 	    if (export_rva + export_size > vaddr + vsize)
10803# 		export_size = vsize - (export_rva - vaddr);
10804# 	    break;
10805# 	}
10806#     }
10807#
10808#     expdata = (unsigned char*)malloc(export_size);
10809#     lseek (dll, expptr, SEEK_SET);
10810#     read (dll, expdata, export_size);
10811#     erva = expdata - export_rva;
10812#
10813#     nexp = pe_as32 (expdata+24);
10814#     name_rvas = pe_as32 (expdata+32);
10815#
10816#     printf ("EXPORTS\n");
10817#     for (i = 0; i<nexp; i++)
10818#     {
10819# 	unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
10820# 	printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
10821#     }
10822#
10823#     return 0;
10824# }
10825# /* impgen.c ends here */
10826])# _LT_AC_FILE_IMPGEN_C
10827
10828# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
10829# ---------------------------------
10830AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
10831
10832
10833# old names
10834AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
10835AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
10836AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
10837AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
10838AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
10839AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
10840AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
10841
10842# This is just to silence aclocal about the macro not being used
10843ifelse([AC_DISABLE_FAST_INSTALL])
10844
10845AC_DEFUN([LT_AC_PROG_GCJ],
10846[AC_CHECK_TOOL(GCJ, gcj, no)
10847  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
10848  AC_SUBST(GCJFLAGS)
10849])
10850
10851AC_DEFUN([LT_AC_PROG_RC],
10852[AC_CHECK_TOOL(RC, windres, no)
10853])
10854
10855# NOTE: This macro has been submitted for inclusion into   #
10856#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
10857#  a released version of Autoconf we should remove this    #
10858#  macro and use it instead.                               #
10859# LT_AC_PROG_SED
10860# --------------
10861# Check for a fully-functional sed program, that truncates
10862# as few characters as possible.  Prefer GNU sed if found.
10863AC_DEFUN([LT_AC_PROG_SED],
10864[AC_MSG_CHECKING([for a sed that does not truncate output])
10865AC_CACHE_VAL(lt_cv_path_SED,
10866[# Loop through the user's path and test for sed and gsed.
10867# Then use that list of sed's as ones to test for truncation.
10868as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10869for as_dir in $PATH
10870do
10871  IFS=$as_save_IFS
10872  test -z "$as_dir" && as_dir=.
10873  for ac_prog in sed gsed; do
10874    for ac_exec_ext in '' $ac_executable_extensions; do
10875      if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
10876        _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
10877      fi
10878    done
10879  done
10880done
10881
10882  # Create a temporary directory, and hook for its removal unless debugging.
10883$debug ||
10884{
10885  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
10886  trap '{ (exit 1); exit 1; }' 1 2 13 15
10887}
10888
10889# Create a (secure) tmp directory for tmp files.
10890: ${TMPDIR=/tmp}
10891{
10892  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
10893  test -n "$tmp" && test -d "$tmp"
10894}  ||
10895{
10896  tmp=$TMPDIR/sed$$-$RANDOM
10897  (umask 077 && mkdir $tmp)
10898} ||
10899{
10900   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
10901   { (exit 1); exit 1; }
10902}
10903  _max=0
10904  _count=0
10905  # Add /usr/xpg4/bin/sed as it is typically found on Solaris
10906  # along with /bin/sed that truncates output.
10907  for _sed in $_sed_list /usr/xpg4/bin/sed; do
10908    test ! -f ${_sed} && break
10909    cat /dev/null > "$tmp/sed.in"
10910    _count=0
10911    echo $ECHO_N "0123456789$ECHO_C" >"$tmp/sed.in"
10912    # Check for GNU sed and select it if it is found.
10913    if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
10914      lt_cv_path_SED=${_sed}
10915      break;
10916    fi
10917    while true; do
10918      cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
10919      mv "$tmp/sed.tmp" "$tmp/sed.in"
10920      cp "$tmp/sed.in" "$tmp/sed.nl"
10921      echo >>"$tmp/sed.nl"
10922      ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
10923      cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
10924      # 10000 chars as input seems more than enough
10925      test $_count -gt 10 && break
10926      _count=`expr $_count + 1`
10927      if test $_count -gt $_max; then
10928        _max=$_count
10929        lt_cv_path_SED=$_sed
10930      fi
10931    done
10932  done
10933  rm -rf "$tmp"
10934])
10935AC_MSG_RESULT([$SED])
10936])
10937
10938# Do all the work for Automake.                            -*- Autoconf -*-
10939
10940# This macro actually does too much some checks are only needed if
10941# your package does certain things.  But this isn't really a big deal.
10942
10943# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
10944# Free Software Foundation, Inc.
10945
10946# This program is free software; you can redistribute it and/or modify
10947# it under the terms of the GNU General Public License as published by
10948# the Free Software Foundation; either version 2, or (at your option)
10949# any later version.
10950
10951# This program is distributed in the hope that it will be useful,
10952# but WITHOUT ANY WARRANTY; without even the implied warranty of
10953# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10954# GNU General Public License for more details.
10955
10956# You should have received a copy of the GNU General Public License
10957# along with this program; if not, write to the Free Software
10958# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
10959# 02111-1307, USA.
10960
10961# serial 8
10962
10963# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
10964# written in clear, in which case automake, when reading aclocal.m4,
10965# will think it sees a *use*, and therefore will trigger all it's
10966# C support machinery.  Also note that it means that autoscan, seeing
10967# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
10968
10969
10970AC_PREREQ([2.52])
10971
10972# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
10973# the ones we care about.
10974m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
10975
10976# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
10977# AM_INIT_AUTOMAKE([OPTIONS])
10978# -----------------------------------------------
10979# The call with PACKAGE and VERSION arguments is the old style
10980# call (pre autoconf-2.50), which is being phased out.  PACKAGE
10981# and VERSION should now be passed to AC_INIT and removed from
10982# the call to AM_INIT_AUTOMAKE.
10983# We support both call styles for the transition.  After
10984# the next Automake release, Autoconf can make the AC_INIT
10985# arguments mandatory, and then we can depend on a new Autoconf
10986# release and drop the old call support.
10987AC_DEFUN([AM_INIT_AUTOMAKE],
10988[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
10989 AC_REQUIRE([AC_PROG_INSTALL])dnl
10990# test to see if srcdir already configured
10991if test "`cd $srcdir && pwd`" != "`pwd`" &&
10992   test -f $srcdir/config.status; then
10993  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
10994fi
10995
10996# Define the identity of the package.
10997dnl Distinguish between old-style and new-style calls.
10998m4_ifval([$2],
10999[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
11000 AC_SUBST([PACKAGE], [$1])dnl
11001 AC_SUBST([VERSION], [$2])],
11002[_AM_SET_OPTIONS([$1])dnl
11003 AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
11004 AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
11005
11006_AM_IF_OPTION([no-define],,
11007[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
11008 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
11009
11010# Some tools Automake needs.
11011AC_REQUIRE([AM_SANITY_CHECK])dnl
11012AC_REQUIRE([AC_ARG_PROGRAM])dnl
11013AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
11014AM_MISSING_PROG(AUTOCONF, autoconf)
11015AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
11016AM_MISSING_PROG(AUTOHEADER, autoheader)
11017AM_MISSING_PROG(MAKEINFO, makeinfo)
11018AM_MISSING_PROG(AMTAR, tar)
11019AM_PROG_INSTALL_SH
11020AM_PROG_INSTALL_STRIP
11021# We need awk for the "check" target.  The system "awk" is bad on
11022# some platforms.
11023AC_REQUIRE([AC_PROG_AWK])dnl
11024AC_REQUIRE([AC_PROG_MAKE_SET])dnl
11025
11026_AM_IF_OPTION([no-dependencies],,
11027[AC_PROVIDE_IFELSE([AC_PROG_][CC],
11028                  [_AM_DEPENDENCIES(CC)],
11029                  [define([AC_PROG_][CC],
11030                          defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
11031AC_PROVIDE_IFELSE([AC_PROG_][CXX],
11032                  [_AM_DEPENDENCIES(CXX)],
11033                  [define([AC_PROG_][CXX],
11034                          defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
11035])
11036])
11037
11038# Copyright 2002  Free Software Foundation, Inc.
11039
11040# This program is free software; you can redistribute it and/or modify
11041# it under the terms of the GNU General Public License as published by
11042# the Free Software Foundation; either version 2, or (at your option)
11043# any later version.
11044
11045# This program is distributed in the hope that it will be useful,
11046# but WITHOUT ANY WARRANTY; without even the implied warranty of
11047# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11048# GNU General Public License for more details.
11049
11050# You should have received a copy of the GNU General Public License
11051# along with this program; if not, write to the Free Software
11052# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
11053
11054# AM_AUTOMAKE_VERSION(VERSION)
11055# ----------------------------
11056# Automake X.Y traces this macro to ensure aclocal.m4 has been
11057# generated from the m4 files accompanying Automake X.Y.
11058AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"])
11059
11060# AM_SET_CURRENT_AUTOMAKE_VERSION
11061# -------------------------------
11062# Call AM_AUTOMAKE_VERSION so it can be traced.
11063# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
11064AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
11065	 [AM_AUTOMAKE_VERSION([1.6.3])])
11066
11067# Helper functions for option handling.                    -*- Autoconf -*-
11068
11069# Copyright 2001, 2002  Free Software Foundation, Inc.
11070
11071# This program is free software; you can redistribute it and/or modify
11072# it under the terms of the GNU General Public License as published by
11073# the Free Software Foundation; either version 2, or (at your option)
11074# any later version.
11075
11076# This program is distributed in the hope that it will be useful,
11077# but WITHOUT ANY WARRANTY; without even the implied warranty of
11078# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11079# GNU General Public License for more details.
11080
11081# You should have received a copy of the GNU General Public License
11082# along with this program; if not, write to the Free Software
11083# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
11084# 02111-1307, USA.
11085
11086# serial 2
11087
11088# _AM_MANGLE_OPTION(NAME)
11089# -----------------------
11090AC_DEFUN([_AM_MANGLE_OPTION],
11091[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
11092
11093# _AM_SET_OPTION(NAME)
11094# ------------------------------
11095# Set option NAME.  Presently that only means defining a flag for this option.
11096AC_DEFUN([_AM_SET_OPTION],
11097[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
11098
11099# _AM_SET_OPTIONS(OPTIONS)
11100# ----------------------------------
11101# OPTIONS is a space-separated list of Automake options.
11102AC_DEFUN([_AM_SET_OPTIONS],
11103[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
11104
11105# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
11106# -------------------------------------------
11107# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
11108AC_DEFUN([_AM_IF_OPTION],
11109[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
11110
11111#
11112# Check to make sure that the build environment is sane.
11113#
11114
11115# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
11116
11117# This program is free software; you can redistribute it and/or modify
11118# it under the terms of the GNU General Public License as published by
11119# the Free Software Foundation; either version 2, or (at your option)
11120# any later version.
11121
11122# This program is distributed in the hope that it will be useful,
11123# but WITHOUT ANY WARRANTY; without even the implied warranty of
11124# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11125# GNU General Public License for more details.
11126
11127# You should have received a copy of the GNU General Public License
11128# along with this program; if not, write to the Free Software
11129# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
11130# 02111-1307, USA.
11131
11132# serial 3
11133
11134# AM_SANITY_CHECK
11135# ---------------
11136AC_DEFUN([AM_SANITY_CHECK],
11137[AC_MSG_CHECKING([whether build environment is sane])
11138# Just in case
11139sleep 1
11140echo timestamp > conftest.file
11141# Do `set' in a subshell so we don't clobber the current shell's
11142# arguments.  Must try -L first in case configure is actually a
11143# symlink; some systems play weird games with the mod time of symlinks
11144# (eg FreeBSD returns the mod time of the symlink's containing
11145# directory).
11146if (
11147   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
11148   if test "$[*]" = "X"; then
11149      # -L didn't work.
11150      set X `ls -t $srcdir/configure conftest.file`
11151   fi
11152   rm -f conftest.file
11153   if test "$[*]" != "X $srcdir/configure conftest.file" \
11154      && test "$[*]" != "X conftest.file $srcdir/configure"; then
11155
11156      # If neither matched, then we have a broken ls.  This can happen
11157      # if, for instance, CONFIG_SHELL is bash and it inherits a
11158      # broken ls alias from the environment.  This has actually
11159      # happened.  Such a system could not be considered "sane".
11160      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
11161alias in your environment])
11162   fi
11163
11164   test "$[2]" = conftest.file
11165   )
11166then
11167   # Ok.
11168   :
11169else
11170   AC_MSG_ERROR([newly created file is older than distributed files!
11171Check your system clock])
11172fi
11173AC_MSG_RESULT(yes)])
11174
11175#  -*- Autoconf -*-
11176
11177
11178# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
11179
11180# This program is free software; you can redistribute it and/or modify
11181# it under the terms of the GNU General Public License as published by
11182# the Free Software Foundation; either version 2, or (at your option)
11183# any later version.
11184
11185# This program is distributed in the hope that it will be useful,
11186# but WITHOUT ANY WARRANTY; without even the implied warranty of
11187# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11188# GNU General Public License for more details.
11189
11190# You should have received a copy of the GNU General Public License
11191# along with this program; if not, write to the Free Software
11192# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
11193# 02111-1307, USA.
11194
11195# serial 3
11196
11197# AM_MISSING_PROG(NAME, PROGRAM)
11198# ------------------------------
11199AC_DEFUN([AM_MISSING_PROG],
11200[AC_REQUIRE([AM_MISSING_HAS_RUN])
11201$1=${$1-"${am_missing_run}$2"}
11202AC_SUBST($1)])
11203
11204
11205# AM_MISSING_HAS_RUN
11206# ------------------
11207# Define MISSING if not defined so far and test if it supports --run.
11208# If it does, set am_missing_run to use it, otherwise, to nothing.
11209AC_DEFUN([AM_MISSING_HAS_RUN],
11210[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11211test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
11212# Use eval to expand $SHELL
11213if eval "$MISSING --run true"; then
11214  am_missing_run="$MISSING --run "
11215else
11216  am_missing_run=
11217  AC_MSG_WARN([`missing' script is too old or missing])
11218fi
11219])
11220
11221# AM_AUX_DIR_EXPAND
11222
11223# Copyright 2001 Free Software Foundation, Inc.
11224
11225# This program is free software; you can redistribute it and/or modify
11226# it under the terms of the GNU General Public License as published by
11227# the Free Software Foundation; either version 2, or (at your option)
11228# any later version.
11229
11230# This program is distributed in the hope that it will be useful,
11231# but WITHOUT ANY WARRANTY; without even the implied warranty of
11232# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11233# GNU General Public License for more details.
11234
11235# You should have received a copy of the GNU General Public License
11236# along with this program; if not, write to the Free Software
11237# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
11238# 02111-1307, USA.
11239
11240# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
11241# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
11242# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
11243#
11244# Of course, Automake must honor this variable whenever it calls a
11245# tool from the auxiliary directory.  The problem is that $srcdir (and
11246# therefore $ac_aux_dir as well) can be either absolute or relative,
11247# depending on how configure is run.  This is pretty annoying, since
11248# it makes $ac_aux_dir quite unusable in subdirectories: in the top
11249# source directory, any form will work fine, but in subdirectories a
11250# relative path needs to be adjusted first.
11251#
11252# $ac_aux_dir/missing
11253#    fails when called from a subdirectory if $ac_aux_dir is relative
11254# $top_srcdir/$ac_aux_dir/missing
11255#    fails if $ac_aux_dir is absolute,
11256#    fails when called from a subdirectory in a VPATH build with
11257#          a relative $ac_aux_dir
11258#
11259# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
11260# are both prefixed by $srcdir.  In an in-source build this is usually
11261# harmless because $srcdir is `.', but things will broke when you
11262# start a VPATH build or use an absolute $srcdir.
11263#
11264# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
11265# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
11266#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
11267# and then we would define $MISSING as
11268#   MISSING="\${SHELL} $am_aux_dir/missing"
11269# This will work as long as MISSING is not called from configure, because
11270# unfortunately $(top_srcdir) has no meaning in configure.
11271# However there are other variables, like CC, which are often used in
11272# configure, and could therefore not use this "fixed" $ac_aux_dir.
11273#
11274# Another solution, used here, is to always expand $ac_aux_dir to an
11275# absolute PATH.  The drawback is that using absolute paths prevent a
11276# configured tree to be moved without reconfiguration.
11277
11278# Rely on autoconf to set up CDPATH properly.
11279AC_PREREQ([2.50])
11280
11281AC_DEFUN([AM_AUX_DIR_EXPAND], [
11282# expand $ac_aux_dir to an absolute path
11283am_aux_dir=`cd $ac_aux_dir && pwd`
11284])
11285
11286# AM_PROG_INSTALL_SH
11287# ------------------
11288# Define $install_sh.
11289
11290# Copyright 2001 Free Software Foundation, Inc.
11291
11292# This program is free software; you can redistribute it and/or modify
11293# it under the terms of the GNU General Public License as published by
11294# the Free Software Foundation; either version 2, or (at your option)
11295# any later version.
11296
11297# This program is distributed in the hope that it will be useful,
11298# but WITHOUT ANY WARRANTY; without even the implied warranty of
11299# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11300# GNU General Public License for more details.
11301
11302# You should have received a copy of the GNU General Public License
11303# along with this program; if not, write to the Free Software
11304# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
11305# 02111-1307, USA.
11306
11307AC_DEFUN([AM_PROG_INSTALL_SH],
11308[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11309install_sh=${install_sh-"$am_aux_dir/install-sh"}
11310AC_SUBST(install_sh)])
11311
11312# AM_PROG_INSTALL_STRIP
11313
11314# Copyright 2001 Free Software Foundation, Inc.
11315
11316# This program is free software; you can redistribute it and/or modify
11317# it under the terms of the GNU General Public License as published by
11318# the Free Software Foundation; either version 2, or (at your option)
11319# any later version.
11320
11321# This program is distributed in the hope that it will be useful,
11322# but WITHOUT ANY WARRANTY; without even the implied warranty of
11323# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11324# GNU General Public License for more details.
11325
11326# You should have received a copy of the GNU General Public License
11327# along with this program; if not, write to the Free Software
11328# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
11329# 02111-1307, USA.
11330
11331# One issue with vendor `install' (even GNU) is that you can't
11332# specify the program used to strip binaries.  This is especially
11333# annoying in cross-compiling environments, where the build's strip
11334# is unlikely to handle the host's binaries.
11335# Fortunately install-sh will honor a STRIPPROG variable, so we
11336# always use install-sh in `make install-strip', and initialize
11337# STRIPPROG with the value of the STRIP variable (set by the user).
11338AC_DEFUN([AM_PROG_INSTALL_STRIP],
11339[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11340# Installed binaries are usually stripped using `strip' when the user
11341# run `make install-strip'.  However `strip' might not be the right
11342# tool to use in cross-compilation environments, therefore Automake
11343# will honor the `STRIP' environment variable to overrule this program.
11344dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
11345if test "$cross_compiling" != no; then
11346  AC_CHECK_TOOL([STRIP], [strip], :)
11347fi
11348INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
11349AC_SUBST([INSTALL_STRIP_PROGRAM])])
11350
11351# serial 4						-*- Autoconf -*-
11352
11353# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
11354
11355# This program is free software; you can redistribute it and/or modify
11356# it under the terms of the GNU General Public License as published by
11357# the Free Software Foundation; either version 2, or (at your option)
11358# any later version.
11359
11360# This program is distributed in the hope that it will be useful,
11361# but WITHOUT ANY WARRANTY; without even the implied warranty of
11362# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11363# GNU General Public License for more details.
11364
11365# You should have received a copy of the GNU General Public License
11366# along with this program; if not, write to the Free Software
11367# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
11368# 02111-1307, USA.
11369
11370
11371# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
11372# written in clear, in which case automake, when reading aclocal.m4,
11373# will think it sees a *use*, and therefore will trigger all it's
11374# C support machinery.  Also note that it means that autoscan, seeing
11375# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
11376
11377
11378
11379# _AM_DEPENDENCIES(NAME)
11380# ----------------------
11381# See how the compiler implements dependency checking.
11382# NAME is "CC", "CXX", "GCJ", or "OBJC".
11383# We try a few techniques and use that to set a single cache variable.
11384#
11385# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
11386# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
11387# dependency, and given that the user is not expected to run this macro,
11388# just rely on AC_PROG_CC.
11389AC_DEFUN([_AM_DEPENDENCIES],
11390[AC_REQUIRE([AM_SET_DEPDIR])dnl
11391AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
11392AC_REQUIRE([AM_MAKE_INCLUDE])dnl
11393AC_REQUIRE([AM_DEP_TRACK])dnl
11394
11395ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
11396       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
11397       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
11398       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
11399                   [depcc="$$1"   am_compiler_list=])
11400
11401AC_CACHE_CHECK([dependency style of $depcc],
11402               [am_cv_$1_dependencies_compiler_type],
11403[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
11404  # We make a subdir and do the tests there.  Otherwise we can end up
11405  # making bogus files that we don't know about and never remove.  For
11406  # instance it was reported that on HP-UX the gcc test will end up
11407  # making a dummy file named `D' -- because `-MD' means `put the output
11408  # in D'.
11409  mkdir conftest.dir
11410  # Copy depcomp to subdir because otherwise we won't find it if we're
11411  # using a relative directory.
11412  cp "$am_depcomp" conftest.dir
11413  cd conftest.dir
11414
11415  am_cv_$1_dependencies_compiler_type=none
11416  if test "$am_compiler_list" = ""; then
11417     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
11418  fi
11419  for depmode in $am_compiler_list; do
11420    # We need to recreate these files for each test, as the compiler may
11421    # overwrite some of them when testing with obscure command lines.
11422    # This happens at least with the AIX C compiler.
11423    echo '#include "conftest.h"' > conftest.c
11424    echo 'int i;' > conftest.h
11425    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
11426
11427    case $depmode in
11428    nosideeffect)
11429      # after this tag, mechanisms are not by side-effect, so they'll
11430      # only be used when explicitly requested
11431      if test "x$enable_dependency_tracking" = xyes; then
11432	continue
11433      else
11434	break
11435      fi
11436      ;;
11437    none) break ;;
11438    esac
11439    # We check with `-c' and `-o' for the sake of the "dashmstdout"
11440    # mode.  It turns out that the SunPro C++ compiler does not properly
11441    # handle `-M -o', and we need to detect this.
11442    if depmode=$depmode \
11443       source=conftest.c object=conftest.o \
11444       depfile=conftest.Po tmpdepfile=conftest.TPo \
11445       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
11446       grep conftest.h conftest.Po > /dev/null 2>&1 &&
11447       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
11448      am_cv_$1_dependencies_compiler_type=$depmode
11449      break
11450    fi
11451  done
11452
11453  cd ..
11454  rm -rf conftest.dir
11455else
11456  am_cv_$1_dependencies_compiler_type=none
11457fi
11458])
11459AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
11460])
11461
11462
11463# AM_SET_DEPDIR
11464# -------------
11465# Choose a directory name for dependency files.
11466# This macro is AC_REQUIREd in _AM_DEPENDENCIES
11467AC_DEFUN([AM_SET_DEPDIR],
11468[rm -f .deps 2>/dev/null
11469mkdir .deps 2>/dev/null
11470if test -d .deps; then
11471  DEPDIR=.deps
11472else
11473  # MS-DOS does not allow filenames that begin with a dot.
11474  DEPDIR=_deps
11475fi
11476rmdir .deps 2>/dev/null
11477AC_SUBST([DEPDIR])
11478])
11479
11480
11481# AM_DEP_TRACK
11482# ------------
11483AC_DEFUN([AM_DEP_TRACK],
11484[AC_ARG_ENABLE(dependency-tracking,
11485[  --disable-dependency-tracking Speeds up one-time builds
11486  --enable-dependency-tracking  Do not reject slow dependency extractors])
11487if test "x$enable_dependency_tracking" != xno; then
11488  am_depcomp="$ac_aux_dir/depcomp"
11489  AMDEPBACKSLASH='\'
11490fi
11491AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
11492AC_SUBST([AMDEPBACKSLASH])
11493])
11494
11495# Generate code to set up dependency tracking.   -*- Autoconf -*-
11496
11497# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
11498
11499# This program is free software; you can redistribute it and/or modify
11500# it under the terms of the GNU General Public License as published by
11501# the Free Software Foundation; either version 2, or (at your option)
11502# any later version.
11503
11504# This program is distributed in the hope that it will be useful,
11505# but WITHOUT ANY WARRANTY; without even the implied warranty of
11506# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11507# GNU General Public License for more details.
11508
11509# You should have received a copy of the GNU General Public License
11510# along with this program; if not, write to the Free Software
11511# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
11512# 02111-1307, USA.
11513
11514#serial 2
11515
11516# _AM_OUTPUT_DEPENDENCY_COMMANDS
11517# ------------------------------
11518AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
11519[for mf in $CONFIG_FILES; do
11520  # Strip MF so we end up with the name of the file.
11521  mf=`echo "$mf" | sed -e 's/:.*$//'`
11522  # Check whether this is an Automake generated Makefile or not.
11523  # We used to match only the files named `Makefile.in', but
11524  # some people rename them; so instead we look at the file content.
11525  # Grep'ing the first line is not enough: some people post-process
11526  # each Makefile.in and add a new line on top of each file to say so.
11527  # So let's grep whole file.
11528  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
11529    dirpart=`AS_DIRNAME("$mf")`
11530  else
11531    continue
11532  fi
11533  grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
11534  # Extract the definition of DEP_FILES from the Makefile without
11535  # running `make'.
11536  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
11537  test -z "$DEPDIR" && continue
11538  # When using ansi2knr, U may be empty or an underscore; expand it
11539  U=`sed -n -e '/^U = / s///p' < "$mf"`
11540  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
11541  # We invoke sed twice because it is the simplest approach to
11542  # changing $(DEPDIR) to its actual value in the expansion.
11543  for file in `sed -n -e '
11544    /^DEP_FILES = .*\\\\$/ {
11545      s/^DEP_FILES = //
11546      :loop
11547	s/\\\\$//
11548	p
11549	n
11550	/\\\\$/ b loop
11551      p
11552    }
11553    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
11554       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
11555    # Make sure the directory exists.
11556    test -f "$dirpart/$file" && continue
11557    fdir=`AS_DIRNAME(["$file"])`
11558    AS_MKDIR_P([$dirpart/$fdir])
11559    # echo "creating $dirpart/$file"
11560    echo '# dummy' > "$dirpart/$file"
11561  done
11562done
11563])# _AM_OUTPUT_DEPENDENCY_COMMANDS
11564
11565
11566# AM_OUTPUT_DEPENDENCY_COMMANDS
11567# -----------------------------
11568# This macro should only be invoked once -- use via AC_REQUIRE.
11569#
11570# This code is only required when automatic dependency tracking
11571# is enabled.  FIXME.  This creates each `.P' file that we will
11572# need in order to bootstrap the dependency handling code.
11573AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
11574[AC_CONFIG_COMMANDS([depfiles],
11575     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
11576     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
11577])
11578
11579# Copyright 2001 Free Software Foundation, Inc.             -*- Autoconf -*-
11580
11581# This program is free software; you can redistribute it and/or modify
11582# it under the terms of the GNU General Public License as published by
11583# the Free Software Foundation; either version 2, or (at your option)
11584# any later version.
11585
11586# This program is distributed in the hope that it will be useful,
11587# but WITHOUT ANY WARRANTY; without even the implied warranty of
11588# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11589# GNU General Public License for more details.
11590
11591# You should have received a copy of the GNU General Public License
11592# along with this program; if not, write to the Free Software
11593# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
11594# 02111-1307, USA.
11595
11596# serial 2
11597
11598# AM_MAKE_INCLUDE()
11599# -----------------
11600# Check to see how make treats includes.
11601AC_DEFUN([AM_MAKE_INCLUDE],
11602[am_make=${MAKE-make}
11603cat > confinc << 'END'
11604doit:
11605	@echo done
11606END
11607# If we don't find an include directive, just comment out the code.
11608AC_MSG_CHECKING([for style of include used by $am_make])
11609am__include="#"
11610am__quote=
11611_am_result=none
11612# First try GNU make style include.
11613echo "include confinc" > confmf
11614# We grep out `Entering directory' and `Leaving directory'
11615# messages which can occur if `w' ends up in MAKEFLAGS.
11616# In particular we don't look at `^make:' because GNU make might
11617# be invoked under some other name (usually "gmake"), in which
11618# case it prints its new name instead of `make'.
11619if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
11620   am__include=include
11621   am__quote=
11622   _am_result=GNU
11623fi
11624# Now try BSD make style include.
11625if test "$am__include" = "#"; then
11626   echo '.include "confinc"' > confmf
11627   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
11628      am__include=.include
11629      am__quote="\""
11630      _am_result=BSD
11631   fi
11632fi
11633AC_SUBST(am__include)
11634AC_SUBST(am__quote)
11635AC_MSG_RESULT($_am_result)
11636rm -f confinc confmf
11637])
11638
11639# AM_CONDITIONAL                                              -*- Autoconf -*-
11640
11641# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
11642
11643# This program is free software; you can redistribute it and/or modify
11644# it under the terms of the GNU General Public License as published by
11645# the Free Software Foundation; either version 2, or (at your option)
11646# any later version.
11647
11648# This program is distributed in the hope that it will be useful,
11649# but WITHOUT ANY WARRANTY; without even the implied warranty of
11650# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11651# GNU General Public License for more details.
11652
11653# You should have received a copy of the GNU General Public License
11654# along with this program; if not, write to the Free Software
11655# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
11656# 02111-1307, USA.
11657
11658# serial 5
11659
11660AC_PREREQ(2.52)
11661
11662# AM_CONDITIONAL(NAME, SHELL-CONDITION)
11663# -------------------------------------
11664# Define a conditional.
11665AC_DEFUN([AM_CONDITIONAL],
11666[ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
11667        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
11668AC_SUBST([$1_TRUE])
11669AC_SUBST([$1_FALSE])
11670if $2; then
11671  $1_TRUE=
11672  $1_FALSE='#'
11673else
11674  $1_TRUE='#'
11675  $1_FALSE=
11676fi
11677AC_CONFIG_COMMANDS_PRE(
11678[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
11679  AC_MSG_ERROR([conditional \"$1\" was never defined.
11680Usually this means the macro was only invoked conditionally.])
11681fi])])
11682
11683
11684# Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
11685
11686# This program is free software; you can redistribute it and/or modify
11687# it under the terms of the GNU General Public License as published by
11688# the Free Software Foundation; either version 2, or (at your option)
11689# any later version.
11690
11691# This program is distributed in the hope that it will be useful,
11692# but WITHOUT ANY WARRANTY; without even the implied warranty of
11693# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11694# GNU General Public License for more details.
11695
11696# You should have received a copy of the GNU General Public License
11697# along with this program; if not, write to the Free Software
11698# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
11699# 02111-1307, USA.
11700
11701# serial 3
11702
11703AC_PREREQ(2.50)
11704
11705# AM_PROG_LEX
11706# -----------
11707# Autoconf leaves LEX=: if lex or flex can't be found.  Change that to a
11708# "missing" invocation, for better error output.
11709AC_DEFUN([AM_PROG_LEX],
11710[AC_REQUIRE([AM_MISSING_HAS_RUN])dnl
11711AC_REQUIRE([AC_PROG_LEX])dnl
11712if test "$LEX" = :; then
11713  LEX=${am_missing_run}flex
11714fi])
11715
11716# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
11717
11718# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
11719
11720# This program is free software; you can redistribute it and/or modify
11721# it under the terms of the GNU General Public License as published by
11722# the Free Software Foundation; either version 2, or (at your option)
11723# any later version.
11724
11725# This program is distributed in the hope that it will be useful,
11726# but WITHOUT ANY WARRANTY; without even the implied warranty of
11727# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11728# GNU General Public License for more details.
11729
11730# You should have received a copy of the GNU General Public License
11731# along with this program; if not, write to the Free Software
11732# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
11733# 02111-1307, USA.
11734
11735AC_PREREQ([2.52])
11736
11737# serial 6
11738
11739# When config.status generates a header, we must update the stamp-h file.
11740# This file resides in the same directory as the config header
11741# that is generated.  We must strip everything past the first ":",
11742# and everything past the last "/".
11743
11744# _AM_DIRNAME(PATH)
11745# -----------------
11746# Like AS_DIRNAME, only do it during macro expansion
11747AC_DEFUN([_AM_DIRNAME],
11748       [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
11749	      m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
11750		    m4_if(regexp([$1], [^/.*]), -1,
11751			  [.],
11752			  patsubst([$1], [^\(/\).*], [\1])),
11753		    patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
11754	      patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
11755])# _AM_DIRNAME
11756
11757
11758# The stamp files are numbered to have different names.
11759# We could number them on a directory basis, but that's additional
11760# complications, let's have a unique counter.
11761m4_define([_AM_STAMP_Count], [0])
11762
11763
11764# _AM_STAMP(HEADER)
11765# -----------------
11766# The name of the stamp file for HEADER.
11767AC_DEFUN([_AM_STAMP],
11768[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
11769AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
11770                               [:.*])))/stamp-h[]_AM_STAMP_Count])
11771
11772
11773# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
11774# ------------------------------------------------------------
11775# We used to try to get a real timestamp in stamp-h.  But the fear is that
11776# that will cause unnecessary cvs conflicts.
11777AC_DEFUN([_AM_CONFIG_HEADER],
11778[# Add the stamp file to the list of files AC keeps track of,
11779# along with our hook.
11780AC_CONFIG_HEADERS([$1],
11781                  [# update the timestamp
11782echo 'timestamp for $1' >"_AM_STAMP([$1])"
11783$2],
11784                  [$3])
11785])# _AM_CONFIG_HEADER
11786
11787
11788# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
11789# --------------------------------------------------------------
11790AC_DEFUN([AM_CONFIG_HEADER],
11791[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
11792])# AM_CONFIG_HEADER
11793
11794