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