3 dnl This file is part of the KDE libraries/packages
4 dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
5 dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
7 dnl This file is free software; you can redistribute it and/or
8 dnl modify it under the terms of the GNU Library General Public
9 dnl License as published by the Free Software Foundation; either
10 dnl version 2 of the License, or (at your option) any later version.
12 dnl This library is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 dnl Library General Public License for more details.
17 dnl You should have received a copy of the GNU Library General Public License
18 dnl along with this library; see the file COPYING.LIB. If not, write to
19 dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 dnl Boston, MA 02110-1301, USA.
23 dnl Please do not modify this file unless you expect your modifications to be
24 dnl carried into every other module in the repository.
26 dnl Single-module modifications are best placed in configure.in for kdelibs
27 dnl and kdebase or configure.in.in if present.
30 dnl Internal subroutine of AC_PATH_X.
31 dnl Set ac_x_includes and/or ac_x_libraries.
32 AC_DEFUN([KDE_PATH_X_DIRECT],
34 AC_REQUIRE([KDE_CHECK_LIB64])
36 if test "$ac_x_includes" = NO; then
37 # Guess where to find include files, by looking for this one X11 .h file.
38 test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
40 # First, try using that file with no special directory specified.
41 AC_TRY_CPP([#include <$x_direct_test_include>],
42 [# We can compile using X headers with no special include directory.
44 [# Look for the header file in a standard set of common directories.
45 # Check X11 before X11Rn because it is often a symlink to the current release.
57 /usr/local/X11/include \
58 /usr/local/X11R6/include \
59 /usr/local/X11R5/include \
60 /usr/local/X11R4/include \
62 /usr/local/include/X11 \
63 /usr/local/include/X11R6 \
64 /usr/local/include/X11R5 \
65 /usr/local/include/X11R4 \
69 /usr/XFree86/include/X11 \
73 /usr/unsupported/include \
75 /usr/local/x11r5/include \
76 /usr/lpp/Xamples/include \
78 /usr/openwin/include \
79 /usr/openwin/share/include \
82 if test -r "$ac_dir/$x_direct_test_include"; then
87 fi # $ac_x_includes = NO
89 if test "$ac_x_libraries" = NO; then
90 # Check for the libraries.
92 test -z "$x_direct_test_library" && x_direct_test_library=Xt
93 test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
95 # See if we find them without any special options.
96 # Don't add to $LIBS permanently.
98 LIBS="-l$x_direct_test_library $LIBS"
99 AC_TRY_LINK([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
100 [LIBS="$ac_save_LIBS"
101 # We can link X programs with no special library path.
103 [LIBS="$ac_save_LIBS"
104 # First see if replacing the include by lib works.
105 # Check X11 before X11Rn because it is often a symlink to the current release.
106 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \
107 /usr/X11/lib${kdelibsuff} \
108 /usr/X11R6/lib${kdelibsuff} \
109 /usr/X11R5/lib${kdelibsuff} \
110 /usr/X11R4/lib${kdelibsuff} \
112 /usr/lib${kdelibsuff}/X11 \
113 /usr/lib${kdelibsuff}/X11R6 \
114 /usr/lib${kdelibsuff}/X11R5 \
115 /usr/lib${kdelibsuff}/X11R4 \
117 /usr/local/X11/lib${kdelibsuff} \
118 /usr/local/X11R6/lib${kdelibsuff} \
119 /usr/local/X11R5/lib${kdelibsuff} \
120 /usr/local/X11R4/lib${kdelibsuff} \
122 /usr/local/lib${kdelibsuff}/X11 \
123 /usr/local/lib${kdelibsuff}/X11R6 \
124 /usr/local/lib${kdelibsuff}/X11R5 \
125 /usr/local/lib${kdelibsuff}/X11R4 \
127 /usr/X386/lib${kdelibsuff} \
128 /usr/x386/lib${kdelibsuff} \
129 /usr/XFree86/lib${kdelibsuff}/X11 \
131 /usr/lib${kdelibsuff} \
132 /usr/local/lib${kdelibsuff} \
133 /usr/unsupported/lib${kdelibsuff} \
134 /usr/athena/lib${kdelibsuff} \
135 /usr/local/x11r5/lib${kdelibsuff} \
136 /usr/lpp/Xamples/lib${kdelibsuff} \
137 /lib/usr/lib${kdelibsuff}/X11 \
139 /usr/openwin/lib${kdelibsuff} \
140 /usr/openwin/share/lib${kdelibsuff} \
143 dnl Don't even attempt the hair of trying to link an X program!
144 for ac_extension in a so sl; do
145 if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
146 ac_x_libraries=$ac_dir
151 fi # $ac_x_libraries = NO
155 dnl ------------------------------------------------------------------------
156 dnl Find a file (or one of more files in a list of dirs)
157 dnl ------------------------------------------------------------------------
159 AC_DEFUN([AC_FIND_FILE],
166 echo "configure: __oline__: $i/$j" >&AC_FD_CC
167 if test -r "$i/$j"; then
168 echo "taking that" >&AC_FD_CC
176 dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs,
177 dnl if-not-found, test-parameter, prepend-path)
179 dnl Look for program-name in list-of-dirs+$PATH.
180 dnl If prepend-path is set, look in $PATH+list-of-dirs instead.
181 dnl If found, $variable-name is set. If not, if-not-found is evaluated.
182 dnl test-parameter: if set, the program is executed with this arg,
183 dnl and only a successful exit code is required.
184 AC_DEFUN([KDE_FIND_PATH],
186 AC_MSG_CHECKING([for $1])
187 if test -n "$$2"; then
190 kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
192 AC_CACHE_VAL(kde_cv_path_$kde_cache,
201 if test -z "$6"; then dnl Append dirs in PATH (default)
203 else dnl Prepend dirs in PATH (if 6th arg is set)
209 if test -x "$dir/$1"; then
212 evalstr="$dir/$1 $5 2>&1 "
213 if eval $evalstr; then
214 kde_cv_path="$dir/$1"
218 kde_cv_path="$dir/$1"
224 eval "kde_cv_path_$kde_cache=$kde_cv_path"
228 eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
232 if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
233 AC_MSG_RESULT(not found)
236 AC_MSG_RESULT($kde_cv_path)
242 AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
244 AC_MSG_ERROR([No Qt meta object compiler (moc) found!
245 Please check whether you installed Qt correctly.
246 You need to have a running moc binary.
247 configure tried to run $ac_cv_path_moc and the test didn't
248 succeed. If configure shouldn't have tried this one, set
249 the environment variable MOC to the right one before running
254 AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
256 AC_MSG_WARN([No Qt ui compiler (uic) found!
257 Please check whether you installed Qt correctly.
258 You need to have a running uic binary.
259 configure tried to run $ac_cv_path_uic and the test didn't
260 succeed. If configure shouldn't have tried this one, set
261 the environment variable UIC to the right one before running
267 AC_DEFUN([KDE_CHECK_UIC_FLAG],
269 AC_MSG_CHECKING([whether uic supports -$1 ])
270 kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
271 AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
273 cat >conftest.ui <<EOT
274 <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
276 ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
277 if AC_TRY_EVAL(ac_uic_testrun); then
278 eval "kde_cv_prog_uic_$kde_cache=yes"
280 eval "kde_cv_prog_uic_$kde_cache=no"
285 if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
297 dnl ------------------------------------------------------------------------
298 dnl Find the meta object compiler and the ui compiler in the PATH,
299 dnl in $QTDIR/bin, and some more usual places
300 dnl ------------------------------------------------------------------------
302 AC_DEFUN([AC_PATH_QT_MOC_UIC],
304 AC_REQUIRE([KDE_CHECK_PERL])
306 for dir in $kde_qt_dirs; do
307 qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
309 qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
310 if test ! "$ac_qt_bindir" = "NO"; then
311 qt_bindirs="$ac_qt_bindir $qt_bindirs"
314 KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
315 if test -z "$UIC_NOT_NEEDED"; then
316 KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
317 if test -z "$UIC_PATH" ; then
318 KDE_UIC_ERROR_MESSAGE
323 if test $kde_qtver = 3; then
324 KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
325 KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
327 if test x$ac_uic_supports_libpath = xyes; then
328 UIC="$UIC -L \$(kde_widgetdir)"
330 if test x$ac_uic_supports_nounload = xyes; then
336 UIC="echo uic not available: "
343 if test $kde_qtver = 3; then
350 AC_DEFUN([KDE_1_CHECK_PATHS],
352 KDE_1_CHECK_PATH_HEADERS
356 if test -n "$USE_RPATH"; then
358 if test -n "$kde_libraries"; then
359 KDE_TEST_RPATH="-R $kde_libraries"
362 if test -n "$qt_libraries"; then
363 KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
366 if test -n "$x_libraries"; then
367 KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
370 KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
373 AC_MSG_CHECKING([for KDE libraries installed])
374 ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
376 if AC_TRY_EVAL(ac_link) && test -s conftest; then
379 AC_MSG_ERROR([your system fails at linking a small KDE application!
380 Check, if your compiler is installed correctly and if you have used the
381 same compiler to compile Qt and kdelibs as you did use now.
382 For more details about this problem, look at the end of config.log.])
385 if eval `KDEDIR= ./conftest 2>&5`; then
391 KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
392 kde_have_all_paths=yes
394 KDE_SET_PATHS($kde_result)
398 AC_DEFUN([KDE_SET_PATHS],
400 kde_cv_all_paths="kde_have_all_paths=\"yes\" \
401 kde_htmldir=\"$kde_htmldir\" \
402 kde_appsdir=\"$kde_appsdir\" \
403 kde_icondir=\"$kde_icondir\" \
404 kde_sounddir=\"$kde_sounddir\" \
405 kde_datadir=\"$kde_datadir\" \
406 kde_locale=\"$kde_locale\" \
407 kde_cgidir=\"$kde_cgidir\" \
408 kde_confdir=\"$kde_confdir\" \
409 kde_kcfgdir=\"$kde_kcfgdir\" \
410 kde_mimedir=\"$kde_mimedir\" \
411 kde_toolbardir=\"$kde_toolbardir\" \
412 kde_wallpaperdir=\"$kde_wallpaperdir\" \
413 kde_templatesdir=\"$kde_templatesdir\" \
414 kde_bindir=\"$kde_bindir\" \
415 kde_servicesdir=\"$kde_servicesdir\" \
416 kde_servicetypesdir=\"$kde_servicetypesdir\" \
417 kde_moduledir=\"$kde_moduledir\" \
418 kde_styledir=\"$kde_styledir\" \
419 kde_widgetdir=\"$kde_widgetdir\" \
420 xdg_appsdir=\"$xdg_appsdir\" \
421 xdg_menudir=\"$xdg_menudir\" \
422 xdg_directorydir=\"$xdg_directorydir\" \
426 AC_DEFUN([KDE_SET_DEFAULT_PATHS],
428 if test "$1" = "default"; then
430 if test -z "$kde_htmldir"; then
431 kde_htmldir='\${datadir}/doc/HTML'
433 if test -z "$kde_appsdir"; then
434 kde_appsdir='\${datadir}/applnk'
436 if test -z "$kde_icondir"; then
437 kde_icondir='\${datadir}/icons'
439 if test -z "$kde_sounddir"; then
440 kde_sounddir='\${datadir}/sounds'
442 if test -z "$kde_datadir"; then
443 kde_datadir='\${datadir}/apps'
445 if test -z "$kde_locale"; then
446 kde_locale='\${datadir}/locale'
448 if test -z "$kde_cgidir"; then
449 kde_cgidir='\${exec_prefix}/cgi-bin'
451 if test -z "$kde_confdir"; then
452 kde_confdir='\${datadir}/config'
454 if test -z "$kde_kcfgdir"; then
455 kde_kcfgdir='\${datadir}/config.kcfg'
457 if test -z "$kde_mimedir"; then
458 kde_mimedir='\${datadir}/mimelnk'
460 if test -z "$kde_toolbardir"; then
461 kde_toolbardir='\${datadir}/toolbar'
463 if test -z "$kde_wallpaperdir"; then
464 kde_wallpaperdir='\${datadir}/wallpapers'
466 if test -z "$kde_templatesdir"; then
467 kde_templatesdir='\${datadir}/templates'
469 if test -z "$kde_bindir"; then
470 kde_bindir='\${exec_prefix}/bin'
472 if test -z "$kde_servicesdir"; then
473 kde_servicesdir='\${datadir}/services'
475 if test -z "$kde_servicetypesdir"; then
476 kde_servicetypesdir='\${datadir}/servicetypes'
478 if test -z "$kde_moduledir"; then
479 if test "$kde_qtver" = "2"; then
480 kde_moduledir='\${libdir}/kde2'
482 kde_moduledir='\${libdir}/kde3'
485 if test -z "$kde_styledir"; then
486 kde_styledir='\${libdir}/kde3/plugins/styles'
488 if test -z "$kde_widgetdir"; then
489 kde_widgetdir='\${libdir}/kde3/plugins/designer'
491 if test -z "$xdg_appsdir"; then
492 xdg_appsdir='\${datadir}/applications/kde'
494 if test -z "$xdg_menudir"; then
495 xdg_menudir='\${sysconfdir}/xdg/menus'
497 if test -z "$xdg_directorydir"; then
498 xdg_directorydir='\${datadir}/desktop-directories'
501 KDE_SET_PATHS(defaults)
505 if test $kde_qtver = 1; then
506 AC_MSG_RESULT([compiling])
509 AC_MSG_ERROR([path checking not yet supported for KDE 2])
515 AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
516 [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
517 test -z "$kde_icondir" || test -z "$kde_sounddir" ||
518 test -z "$kde_datadir" || test -z "$kde_locale" ||
519 test -z "$kde_cgidir" || test -z "$kde_confdir" ||
520 test -z "$kde_kcfgdir" ||
521 test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
522 test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
523 test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
524 test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
525 test -z "$kde_styledir" || test -z "kde_widgetdir" ||
526 test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
527 test "x$kde_have_all_paths" != "xyes"; then
528 kde_have_all_paths=no
532 AC_DEFUN([KDE_MISSING_PROG_ERROR],
534 AC_MSG_ERROR([The important program $1 was not found!
535 Please check whether you installed KDE correctly.
539 AC_DEFUN([KDE_MISSING_ARTS_ERROR],
541 AC_MSG_ERROR([The important program $1 was not found!
542 Please check whether you installed aRts correctly or use
543 --without-arts to compile without aRts support (this will remove functionality).
547 AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
549 kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin"
550 test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
551 if test -n "$KDEDIRS"; then
554 for dir in $KDEDIRS; do
555 kde_default_bindirs="$dir/bin $kde_default_bindirs "
561 AC_DEFUN([KDE_SUBST_PROGRAMS],
564 AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
565 [build_arts=$withval],
568 AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
569 if test "$build_arts" = "no"; then
570 AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
573 KDE_SET_DEFAULT_BINDIRS
574 kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
575 KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
576 KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
577 if test "$build_arts" '!=' "no"; then
578 KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
579 KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
581 KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
585 if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then
589 if test "$kde_qtver" = "3"; then
590 if test "$kde_qtsubver" -le 1; then
593 if test "$kde_qtsubver" -le 2; then
596 if test "$KDECONFIG" != "compiled"; then
597 if test `$KDECONFIG --version | grep KDE | sed 's/KDE: \(...\).*/\1/'` = 3.2; then
604 if test -n "$kde32ornewer"; then
605 KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)])
606 KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
608 if test -n "$kde33ornewer"; then
609 KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)])
610 AC_SUBST(MAKEKDEWIDGETS)
612 KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
614 if test -n "$MEINPROC" -a "$MEINPROC" != "compiled"; then
615 kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
616 test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
617 AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
618 if test "$KDE_XSL_STYLESHEET" = "NO"; then
619 KDE_XSL_STYLESHEET=""
621 KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
625 DCOP_DEPENDENCIES='$(DCOPIDL)'
626 if test -n "$kde32ornewer"; then
627 KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
628 DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
629 AC_SUBST(KCONFIG_COMPILER)
630 AC_SUBST(KCFG_DEPENDENCIES)
634 AC_SUBST(DCOPIDL2CPP)
635 AC_SUBST(DCOP_DEPENDENCIES)
637 AC_SUBST(ARTSCCONFIG)
639 AC_SUBST(KDE_XSL_STYLESHEET)
643 AC_DEFUN([AC_CREATE_KFSSTND],
645 AC_REQUIRE([AC_CHECK_RPATH])
647 AC_MSG_CHECKING([for KDE paths])
650 AC_CACHE_VAL(kde_cv_all_paths,
652 KDE_SET_DEFAULT_PATHS($1)
655 eval "$kde_cv_all_paths"
656 KDE_CHECK_PATHS_FOR_COMPLETENESS
657 if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
658 # wrong values were cached, may be, we can set better ones
660 kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
661 kde_datadir= kde_locale= kde_cgidir= kde_confdir= kde_kcfgdir=
662 kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
663 kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
667 xdg_appsdir = xdg_menudir= xdg_directorydir=
668 KDE_SET_DEFAULT_PATHS($1)
669 eval "$kde_cv_all_paths"
670 KDE_CHECK_PATHS_FOR_COMPLETENESS
671 kde_result="$kde_result (cache overridden)"
673 if test "$kde_have_all_paths" = "no"; then
674 AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
675 Since it had compiled and linked before, it must be a strange problem on your system.
676 Look at config.log for details. If you are not able to fix this, look at
677 http://www.kde.org/faq/installation.html or any www.kde.org mirror.
678 (If you're using an egcs version on Linux, you may update binutils!)
682 AC_MSG_RESULT($kde_result)
691 AC_DEFUN([AC_SUBST_KFSSTND],
693 AC_SUBST(kde_htmldir)
694 AC_SUBST(kde_appsdir)
695 AC_SUBST(kde_icondir)
696 AC_SUBST(kde_sounddir)
697 AC_SUBST(kde_datadir)
699 AC_SUBST(kde_confdir)
700 AC_SUBST(kde_kcfgdir)
701 AC_SUBST(kde_mimedir)
702 AC_SUBST(kde_wallpaperdir)
704 dnl X Desktop Group standards
705 AC_SUBST(xdg_appsdir)
706 AC_SUBST(xdg_menudir)
707 AC_SUBST(xdg_directorydir)
709 AC_SUBST(kde_templatesdir)
710 AC_SUBST(kde_servicesdir)
711 AC_SUBST(kde_servicetypesdir)
712 AC_SUBST(kde_moduledir)
713 AC_SUBST(kdeinitdir, '$(kde_moduledir)')
714 AC_SUBST(kde_styledir)
715 AC_SUBST(kde_widgetdir)
716 if test "$kde_qtver" = 1; then
717 kde_minidir="$kde_icondir/mini"
719 # for KDE 1 - this breaks KDE2 apps using minidir, but
720 # that's the plan ;-/
721 kde_minidir="/dev/null"
723 dnl AC_SUBST(kde_minidir)
724 dnl AC_SUBST(kde_cgidir)
725 dnl AC_SUBST(kde_toolbardir)
728 AC_DEFUN([KDE_MISC_TESTS],
730 dnl Checks for libraries.
731 AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
733 AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
736 AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
737 AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
738 AC_MSG_WARN([you have no crypt in either libcrypt or libc.
739 You should install libcrypt from another source or configure with PAM
744 if test $kde_have_crypt = yes; then
745 AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
748 AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
749 if test $ac_cv_lib_dnet_dnet_ntoa = no; then
750 AC_CHECK_LIB(dnet_stub, dnet_ntoa,
751 [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
753 AC_CHECK_FUNC(inet_ntoa)
754 if test $ac_cv_func_inet_ntoa = no; then
755 AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
757 AC_CHECK_FUNC(connect)
758 if test $ac_cv_func_connect = no; then
759 AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
763 AC_CHECK_FUNC(remove)
764 if test $ac_cv_func_remove = no; then
765 AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
768 # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
769 AC_CHECK_FUNC(shmat, ,
770 AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
772 # more headers that need to be explicitly included on darwin
773 AC_CHECK_HEADERS(sys/types.h stdint.h)
775 # sys/bitypes.h is needed for uint32_t and friends on Tru64
776 AC_CHECK_HEADERS(sys/bitypes.h)
778 # darwin requires a poll emulation library
779 AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
781 # for some image handling on Mac OS X
782 AC_CHECK_HEADERS(Carbon/Carbon.h)
784 # CoreAudio framework
785 AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
786 AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
787 FRAMEWORK_COREAUDIO="-Wl,-framework,CoreAudio"
792 AC_SUBST(FRAMEWORK_COREAUDIO)
793 LIBSOCKET="$X_EXTRA_LIBS"
795 AC_SUBST(X_EXTRA_LIBS)
796 AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
799 case $host in dnl this *is* LynxOS specific
801 AC_MSG_CHECKING([LynxOS header file wrappers])
802 [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
803 AC_MSG_RESULT(disabled)
804 AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
811 KDE_CHECK_PIE_SUPPORT
813 # darwin needs this to initialize the environment
814 AC_CHECK_HEADERS(crt_externs.h)
815 AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
817 AH_VERBATIM(_DARWIN_ENVIRON,
819 #if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
820 # include <sys/time.h>
821 # include <crt_externs.h>
822 # define environ (*_NSGetEnviron())
826 AH_VERBATIM(_AIX_STRINGS_H_BZERO,
829 * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
830 * that defines bzero.
838 AC_CHECK_FUNCS([vsnprintf snprintf])
842 * On HP-UX, the declaration of vsnprintf() is needed every time !
845 #if !defined(HAVE_VSNPRINTF) || defined(hpux)
855 int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
859 int snprintf(char *str, size_t n, char const *fmt, ...);
865 dnl ------------------------------------------------------------------------
866 dnl Find the header files and libraries for X-Windows. Extended the
868 dnl ------------------------------------------------------------------------
872 AC_REQUIRE([KDE_MISC_TESTS])dnl
873 AC_REQUIRE([KDE_CHECK_LIB64])
877 AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
878 kde_use_qt_emb=$enableval,
884 AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
885 kde_use_qt_emb_palm=$enableval,
886 kde_use_qt_emb_palm=no
891 AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
892 kde_use_qt_mac=$enableval,
896 # used to disable x11-specific stuff on special platforms
897 AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
899 if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
901 AC_MSG_CHECKING(for X)
903 AC_CACHE_VAL(kde_cv_have_x,
904 [# One or both of the vars are not set, and there is no cached value.
905 if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
908 kde_x_includes=$x_includes
910 if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
913 kde_x_libraries=$x_libraries
916 # below we use the standard autoconf calls
917 ac_x_libraries=$kde_x_libraries
918 ac_x_includes=$kde_x_includes
921 dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
922 dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
923 dnl location. The correct location is /usr/lib32 or an undefined value
924 dnl (the linker is smart enough to pick the correct default library).
925 dnl Things work just fine if you use just AC_PATH_X_DIRECT.
926 dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
927 dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
928 dnl x_includes should be left alone.
936 if test -z "$ac_x_includes"; then
939 if test -z "$ac_x_libraries"; then
940 ac_x_libraries="/usr/lib${kdelibsuff}"
943 #from now on we use our own again
945 # when the user already gave --x-includes, we ignore
946 # what the standard autoconf macros told us.
947 if test "$kde_x_includes" = NO; then
948 kde_x_includes=$ac_x_includes
951 # for --x-libraries too
952 if test "$kde_x_libraries" = NO; then
953 kde_x_libraries=$ac_x_libraries
956 if test "$kde_x_includes" = NO; then
957 AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
960 if test "$kde_x_libraries" = NO; then
961 AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
964 # Record where we found X for the cache.
965 kde_cv_have_x="have_x=yes \
966 kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
969 eval "$kde_cv_have_x"
971 if test "$have_x" != yes; then
972 AC_MSG_RESULT($have_x)
975 AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
978 if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
980 x_includes="."; dnl better than nothing :-
982 x_includes=$kde_x_includes
983 X_INCLUDES="-I$x_includes"
986 if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE || test "$kde_x_libraries" = "/usr/lib"; then
988 x_libraries="/usr/lib"; dnl better than nothing :-
990 x_libraries=$kde_x_libraries
991 X_LDFLAGS="-L$x_libraries"
993 all_includes="$X_INCLUDES"
994 all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
996 # Check for libraries that X11R6 Xt/Xaw programs need.
997 ac_save_LDFLAGS="$LDFLAGS"
998 LDFLAGS="$LDFLAGS $X_LDFLAGS"
999 # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
1000 # check for ICE first), but we must link in the order -lSM -lICE or
1001 # we get undefined symbols. So assume we have SM if we have ICE.
1002 # These have to be linked with before -lX11, unlike the other
1003 # libraries we check for below, so use a different variable.
1004 # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
1005 AC_CHECK_LIB(ICE, IceConnectionNumber,
1006 [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
1007 LDFLAGS="$ac_save_LDFLAGS"
1009 LIB_X11='-lX11 $(LIBSOCKET)'
1011 AC_MSG_CHECKING(for libXext)
1012 AC_CACHE_VAL(kde_cv_have_libXext,
1014 kde_ldflags_safe="$LDFLAGS"
1015 kde_libs_safe="$LIBS"
1017 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
1018 LIBS="-lXext -lX11 $LIBSOCKET"
1023 # include <stdlib.h>
1027 printf("hello Xext\n");
1029 kde_cv_have_libXext=yes,
1030 kde_cv_have_libXext=no
1033 LDFLAGS=$kde_ldflags_safe
1037 AC_MSG_RESULT($kde_cv_have_libXext)
1039 if test "$kde_cv_have_libXext" = "no"; then
1040 AC_MSG_ERROR([We need a working libXext to proceed. Since configure
1041 can't find it itself, we stop here assuming that make wouldn't find
1048 elif test "$kde_use_qt_emb" = "yes"; then
1049 dnl We're using QT Embedded
1051 CXXFLAGS="$CXXFLAGS -fno-rtti"
1052 QTE_NORTTI="-fno-rtti -DQWS"
1062 elif test "$kde_use_qt_mac" = "yes"; then
1063 dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
1064 dnl be included to get the information) --Sam
1065 CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
1066 CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
1077 AC_SUBST(X_PRE_LIBS)
1079 AC_SUBST(LIB_XRENDER)
1081 AC_SUBST(X_INCLUDES)
1083 AC_SUBST(x_includes)
1084 AC_SUBST(x_libraries)
1085 AC_SUBST(QTE_NORTTI)
1090 AC_DEFUN([KDE_PRINT_QT_PROGRAM],
1092 AC_REQUIRE([KDE_USE_QT])
1093 cat > conftest.$ac_ext <<EOF
1094 #include "confdefs.h"
1095 #include <qglobal.h>
1096 #include <qapplication.h>
1098 if test "$kde_qtver" = "2"; then
1099 cat >> conftest.$ac_ext <<EOF
1101 #include <qstring.h>
1105 if test $kde_qtsubver -gt 0; then
1106 cat >> conftest.$ac_ext <<EOF
1107 #if QT_VERSION < 210
1114 if test "$kde_qtver" = "3"; then
1115 cat >> conftest.$ac_ext <<EOF
1116 #include <qcursor.h>
1117 #include <qstylefactory.h>
1118 #include <private/qucomextra_p.h>
1122 echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
1123 cat >> conftest.$ac_ext <<EOF
1129 if test "$kde_qtver" = "2"; then
1130 cat >> conftest.$ac_ext <<EOF
1131 QStringList *t = new QStringList();
1134 if test $kde_qtsubver -gt 0; then
1135 cat >> conftest.$ac_ext <<EOF
1137 s.setLatin1("Elvis is alive", 14);
1141 if test "$kde_qtver" = "3"; then
1142 cat >> conftest.$ac_ext <<EOF
1143 (void)QStyleFactory::create(QString::null);
1144 QCursor c(Qt::WhatsThisCursor);
1147 cat >> conftest.$ac_ext <<EOF
1153 AC_DEFUN([KDE_USE_QT],
1155 if test -z "$1"; then
1156 # Current default Qt version: 3.3
1160 kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
1161 # following is the check if subversion isnt found in passed argument
1162 if test "$kde_qtsubver" = "$1"; then
1165 kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
1166 if test "$kde_qtver" = "1"; then
1171 if test -z "$2"; then
1172 if test "$kde_qtver" = "2"; then
1173 if test $kde_qtsubver -gt 0; then
1174 kde_qt_minversion=">= Qt 2.2.2"
1176 kde_qt_minversion=">= Qt 2.0.2"
1179 if test "$kde_qtver" = "3"; then
1180 if test $kde_qtsubver -gt 0; then
1181 if test $kde_qtsubver -gt 1; then
1182 if test $kde_qtsubver -gt 2; then
1183 kde_qt_minversion=">= Qt 3.3 and < 4.0"
1185 kde_qt_minversion=">= Qt 3.2 and < 4.0"
1188 kde_qt_minversion=">= Qt 3.1 (20021021) and < 4.0"
1191 kde_qt_minversion=">= Qt 3.0 and < 4.0"
1194 if test "$kde_qtver" = "1"; then
1195 kde_qt_minversion=">= 1.42 and < 2.0"
1198 kde_qt_minversion="$2"
1201 if test -z "$3"; then
1202 if test $kde_qtver = 3; then
1203 if test $kde_qtsubver -gt 0; then
1204 kde_qt_verstring="QT_VERSION >= 0x03@VER@00 && QT_VERSION < 0x040000"
1205 qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
1206 kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
1208 kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000"
1211 if test $kde_qtver = 2; then
1212 if test $kde_qtsubver -gt 0; then
1213 kde_qt_verstring="QT_VERSION >= 222"
1215 kde_qt_verstring="QT_VERSION >= 200"
1218 if test $kde_qtver = 1; then
1219 kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
1222 kde_qt_verstring="$3"
1225 if test $kde_qtver = 4; then
1226 kde_qt_dirs="$QTDIR /usr/lib/qt4 /usr/lib/qt /usr/share/qt4"
1228 if test $kde_qtver = 3; then
1229 kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3 /usr/lib${kdelibsuff}/qt-3.3"
1230 if test -z "$PKG_CONFIG"; then
1231 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1233 if test "$PKG_CONFIG" != "no" ; then
1234 if $PKG_CONFIG --exists qt-mt ; then
1235 kde_qt_dirs="$kde_qt_dirs `$PKG_CONFIG --variable=prefix qt-mt`"
1239 if test $kde_qtver = 2; then
1240 kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
1242 if test $kde_qtver = 1; then
1243 kde_qt_dirs="$QTDIR /usr/lib/qt"
1247 AC_DEFUN([KDE_CHECK_QT_DIRECT],
1249 AC_REQUIRE([KDE_USE_QT])
1250 AC_MSG_CHECKING([if Qt compiles without flags])
1251 AC_CACHE_VAL(kde_cv_qt_direct,
1255 ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
1256 ac_LIBRARY_PATH="$LIBRARY_PATH"
1257 ac_cxxflags_safe="$CXXFLAGS"
1258 ac_ldflags_safe="$LDFLAGS"
1259 ac_libs_safe="$LIBS"
1261 CXXFLAGS="$CXXFLAGS -I$qt_includes"
1262 LDFLAGS="$LDFLAGS $X_LDFLAGS"
1263 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1264 LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
1266 LIBS="$LIBQT $LIBSOCKET"
1269 export LD_LIBRARY_PATH
1273 KDE_PRINT_QT_PROGRAM
1275 if AC_TRY_EVAL(ac_link) && test -s conftest; then
1276 kde_cv_qt_direct="yes"
1278 kde_cv_qt_direct="no"
1279 echo "configure: failed program was:" >&AC_FD_CC
1280 cat conftest.$ac_ext >&AC_FD_CC
1284 CXXFLAGS="$ac_cxxflags_safe"
1285 LDFLAGS="$ac_ldflags_safe"
1286 LIBS="$ac_libs_safe"
1288 LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
1289 export LD_LIBRARY_PATH
1290 LIBRARY_PATH="$ac_LIBRARY_PATH"
1295 if test "$kde_cv_qt_direct" = "yes"; then
1304 dnl ------------------------------------------------------------------------
1305 dnl Try to find the Qt headers and libraries.
1306 dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
1307 dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
1308 dnl ------------------------------------------------------------------------
1310 AC_DEFUN([AC_PATH_QT_1_3],
1312 AC_REQUIRE([K_PATH_X])
1313 AC_REQUIRE([KDE_USE_QT])
1314 AC_REQUIRE([KDE_CHECK_LIB64])
1316 dnl ------------------------------------------------------------------------
1317 dnl Add configure flag to enable linking to MT version of Qt library.
1318 dnl ------------------------------------------------------------------------
1322 AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]),
1323 kde_use_qt_mt=$enableval,
1325 if test $kde_qtver = 3; then
1335 dnl ------------------------------------------------------------------------
1336 dnl If we not get --disable-qt-mt then adjust some vars for the host.
1337 dnl ------------------------------------------------------------------------
1341 if test "x$kde_use_qt_mt" = "xyes"; then
1343 if test "x$kde_use_threading" = "xyes"; then
1344 CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
1345 KDE_MT_LDFLAGS="$USE_THREADS"
1346 KDE_MT_LIBS="$LIBPTHREAD"
1351 AC_SUBST(KDE_MT_LDFLAGS)
1352 AC_SUBST(KDE_MT_LIBS)
1354 kde_qt_was_given=yes
1356 dnl ------------------------------------------------------------------------
1357 dnl If we haven't been told how to link to Qt, we work it out for ourselves.
1358 dnl ------------------------------------------------------------------------
1359 if test -z "$LIBQT_GLOB"; then
1360 if test "x$kde_use_qt_emb" = "xyes"; then
1361 LIBQT_GLOB="libqte.*"
1363 LIBQT_GLOB="libqt.*"
1367 dnl ------------------------------------------------------------
1368 dnl If we got --enable-embedded then adjust the Qt library name.
1369 dnl ------------------------------------------------------------
1370 if test "x$kde_use_qt_emb" = "xyes"; then
1376 kde_int_qt="-l$qtlib"
1378 if test -z "$LIBQPE"; then
1379 dnl ------------------------------------------------------------
1380 dnl If we got --enable-palmtop then add -lqpe to the link line
1381 dnl ------------------------------------------------------------
1382 if test "x$kde_use_qt_emb" = "xyes"; then
1383 if test "x$kde_use_qt_emb_palm" = "xyes"; then
1393 dnl ------------------------------------------------------------------------
1394 dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
1395 dnl ------------------------------------------------------------------------
1397 if test "x$kde_use_qt_mt" = "xyes"; then
1399 kde_int_qt="-l$qtlib-mt"
1400 LIBQT_GLOB="lib$qtlib-mt.*"
1401 USING_QT_MT="using -mt"
1406 if test $kde_qtver != 1; then
1408 AC_REQUIRE([AC_FIND_PNG])
1409 AC_REQUIRE([AC_FIND_JPEG])
1410 LIBQT="$LIBQT $LIBPNG $LIBJPEG"
1413 if test $kde_qtver = 3; then
1414 AC_REQUIRE([KDE_CHECK_LIBDL])
1415 LIBQT="$LIBQT $LIBDL"
1418 AC_MSG_CHECKING([for Qt])
1420 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1421 LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
1423 ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
1427 AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]),
1428 [ ac_qt_includes="$withval"/include
1429 ac_qt_libraries="$withval"/lib${kdelibsuff}
1430 ac_qt_bindir="$withval"/bin
1433 AC_ARG_WITH(qt-includes,
1434 AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]),
1436 ac_qt_includes="$withval"
1439 kde_qt_libs_given=no
1441 AC_ARG_WITH(qt-libraries,
1442 AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]),
1443 [ ac_qt_libraries="$withval"
1444 kde_qt_libs_given=yes
1447 AC_CACHE_VAL(ac_cv_have_qt,
1448 [#try to guess Qt locations
1451 for dir in $kde_qt_dirs; do
1452 qt_incdirs="$qt_incdirs $dir/include $dir"
1454 if test -z "$PKG_CONFIG"; then
1455 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1457 if test "$PKG_CONFIG" != "no" ; then
1458 if $PKG_CONFIG --exists qt-mt ; then
1459 qt_incdirs="$qt_incdirs `$PKG_CONFIG --variable=includedir qt-mt`"
1462 qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes"
1463 if test ! "$ac_qt_includes" = "NO"; then
1464 qt_incdirs="$ac_qt_includes $qt_incdirs"
1467 if test "$kde_qtver" != "1"; then
1468 kde_qt_header=qstyle.h
1470 kde_qt_header=qglobal.h
1473 AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
1474 ac_qt_includes="$qt_incdir"
1477 for dir in $kde_qt_dirs; do
1478 qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir/lib $dir"
1480 if test -z "$PKG_CONFIG"; then
1481 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1483 if test "$PKG_CONFIG" != "no" ; then
1484 if $PKG_CONFIG --exists qt-mt ; then
1485 qt_libdirs="$qt_incdirs `$PKG_CONFIG --variable=libdir qt-mt`"
1488 qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
1489 if test ! "$ac_qt_libraries" = "NO"; then
1490 qt_libdir=$ac_qt_libraries
1492 qt_libdirs="$ac_qt_libraries $qt_libdirs"
1493 # if the Qt was given, the chance is too big that libqt.* doesn't exist
1495 for dir in $qt_libdirs; do
1496 try="ls -1 $dir/${LIBQT_GLOB}"
1497 if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
1500 for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
1501 if test -e "$a"; then
1502 LIBQT="$LIBQT ${kde_int_qt}_incremental"
1507 ac_qt_libraries="$qt_libdir"
1512 ac_cxxflags_safe="$CXXFLAGS"
1513 ac_ldflags_safe="$LDFLAGS"
1514 ac_libs_safe="$LIBS"
1516 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
1517 LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
1518 LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
1520 KDE_PRINT_QT_PROGRAM
1522 if AC_TRY_EVAL(ac_link) && test -s conftest; then
1525 echo "configure: failed program was:" >&AC_FD_CC
1526 cat conftest.$ac_ext >&AC_FD_CC
1527 ac_qt_libraries="NO"
1530 CXXFLAGS="$ac_cxxflags_safe"
1531 LDFLAGS="$ac_ldflags_safe"
1532 LIBS="$ac_libs_safe"
1535 if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
1536 ac_cv_have_qt="have_qt=no"
1539 if test "$ac_qt_includes" = NO; then
1540 if test "$ac_qt_libraries" = NO; then
1541 ac_qt_notfound="(headers and libraries)";
1543 ac_qt_notfound="(headers)";
1546 if test "x$kde_use_qt_mt" = "xyes"; then
1548 Make sure that you have compiled Qt with thread support!"
1549 ac_qt_notfound="(library $qtlib-mt)";
1551 ac_qt_notfound="(library $qtlib)";
1555 AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
1556 For more details about this problem, look at the end of config.log.$missing_qt_mt])
1562 eval "$ac_cv_have_qt"
1564 if test "$have_qt" != yes; then
1565 AC_MSG_RESULT([$have_qt]);
1567 ac_cv_have_qt="have_qt=yes \
1568 ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
1569 AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
1571 qt_libraries="$ac_qt_libraries"
1572 qt_includes="$ac_qt_includes"
1575 if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
1576 KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
1579 AC_SUBST(qt_libraries)
1580 AC_SUBST(qt_includes)
1582 if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
1585 QT_INCLUDES="-I$qt_includes"
1586 all_includes="$QT_INCLUDES $all_includes"
1589 if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
1592 QT_LDFLAGS="-L$qt_libraries"
1593 all_libraries="$QT_LDFLAGS $all_libraries"
1595 test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
1597 AC_SUBST(QT_INCLUDES)
1598 AC_SUBST(QT_LDFLAGS)
1603 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1604 LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
1606 LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
1608 test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
1609 for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
1610 if test -e "$a"; then
1611 LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
1622 AC_DEFUN([AC_PATH_QT],
1627 AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
1629 AC_REQUIRE([AC_PATH_QT_MOC_UIC])
1631 if test x$ac_uic_supports_libpath = xyes; then
1633 AC_MSG_CHECKING([if UIC has KDE plugins available])
1634 AC_CACHE_VAL(kde_cv_uic_plugins,
1636 cat > actest.ui << EOF
1637 <!DOCTYPE UI><UI version="3.0" stdsetdef="1">
1638 <class>NewConnectionDialog</class>
1639 <widget class="QDialog">
1640 <widget class="KLineEdit">
1641 <property name="name">
1642 <cstring>testInput</cstring>
1651 kde_cv_uic_plugins=no
1652 kde_line="$UIC_PATH -L $kde_widgetdir"
1653 if test x$ac_uic_supports_nounload = xyes; then
1654 kde_line="$kde_line -nounload"
1656 kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
1657 if AC_TRY_EVAL(kde_line); then
1658 # if you're trying to debug this check and think it's incorrect,
1659 # better check your installation. The check _is_ correct - your
1660 # installation is not.
1661 if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
1662 kde_cv_uic_plugins=yes
1665 rm -f actest.ui actest.cpp
1668 AC_MSG_RESULT([$kde_cv_uic_plugins])
1669 if test "$kde_cv_uic_plugins" != yes; then
1671 you need to install kdelibs first.
1673 If you did install kdelibs, then the Qt version that is picked up by
1674 this configure is not the same version you used to compile kdelibs.
1675 The Qt Plugin installed by kdelibs is *ONLY* loadable if it is the
1676 _same Qt version_, compiled with the _same compiler_ and the same Qt
1677 configuration settings.
1683 AC_DEFUN([KDE_CHECK_FINAL],
1685 AC_ARG_ENABLE(final,
1686 AC_HELP_STRING([--enable-final],
1687 [build size optimized apps (experimental - needs lots of memory)]),
1688 kde_use_final=$enableval, kde_use_final=no)
1690 if test "x$kde_use_final" = "xyes"; then
1691 KDE_USE_FINAL_TRUE=""
1692 KDE_USE_FINAL_FALSE="#"
1694 KDE_USE_FINAL_TRUE="#"
1695 KDE_USE_FINAL_FALSE=""
1697 AC_SUBST(KDE_USE_FINAL_TRUE)
1698 AC_SUBST(KDE_USE_FINAL_FALSE)
1701 AC_DEFUN([KDE_CHECK_CLOSURE],
1703 AC_ARG_ENABLE(closure,
1704 AC_HELP_STRING([--enable-closure],[delay template instantiation]),
1705 kde_use_closure=$enableval, kde_use_closure=no)
1708 if test "x$kde_use_closure" = "xyes"; then
1709 KDE_USE_CLOSURE_TRUE=""
1710 KDE_USE_CLOSURE_FALSE="#"
1711 # CXXFLAGS="$CXXFLAGS $REPO"
1713 KDE_USE_CLOSURE_TRUE="#"
1714 KDE_USE_CLOSURE_FALSE=""
1718 KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
1719 [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
1720 [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
1721 [KDE_NO_UNDEFINED=""])],
1722 [KDE_NO_UNDEFINED=""])
1726 AC_SUBST(KDE_USE_CLOSURE_TRUE)
1727 AC_SUBST(KDE_USE_CLOSURE_FALSE)
1728 AC_SUBST(KDE_NO_UNDEFINED)
1731 dnl Check if the linker supports --enable-new-dtags and --as-needed
1732 AC_DEFUN([KDE_CHECK_NEW_LDFLAGS],
1734 AC_ARG_ENABLE(new_ldflags,
1735 AC_HELP_STRING([--enable-new-ldflags],
1736 [enable the new linker flags]),
1737 kde_use_new_ldflags=$enableval,
1738 kde_use_new_ldflags=no)
1740 LDFLAGS_AS_NEEDED=""
1741 LDFLAGS_NEW_DTAGS=""
1742 if test "x$kde_use_new_ldflags" = "xyes"; then
1743 LDFLAGS_NEW_DTAGS=""
1744 KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags],
1745 [LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],)
1747 KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
1748 [LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
1750 AC_SUBST(LDFLAGS_AS_NEEDED)
1751 AC_SUBST(LDFLAGS_NEW_DTAGS)
1754 AC_DEFUN([KDE_CHECK_NMCHECK],
1756 AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
1757 kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
1759 if test "$kde_use_nmcheck" = "yes"; then
1760 KDE_USE_NMCHECK_TRUE=""
1761 KDE_USE_NMCHECK_FALSE="#"
1763 KDE_USE_NMCHECK_TRUE="#"
1764 KDE_USE_NMCHECK_FALSE=""
1766 AC_SUBST(KDE_USE_NMCHECK_TRUE)
1767 AC_SUBST(KDE_USE_NMCHECK_FALSE)
1770 AC_DEFUN([KDE_EXPAND_MAKEVAR], [
1772 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1774 while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
1778 dnl ------------------------------------------------------------------------
1779 dnl Now, the same with KDE
1780 dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
1781 dnl and $(kde_includes) will be the kdehdrlocation (if needed)
1782 dnl ------------------------------------------------------------------------
1784 AC_DEFUN([AC_BASE_PATH_KDE],
1786 AC_REQUIRE([KDE_CHECK_STL])
1787 AC_REQUIRE([AC_PATH_QT])dnl
1788 AC_REQUIRE([KDE_CHECK_LIB64])
1791 AC_MSG_CHECKING([for KDE])
1793 if test "${prefix}" != NONE; then
1794 kde_includes=${includedir}
1795 KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
1797 kde_libraries=${libdir}
1798 KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
1807 AC_CACHE_VAL(ac_cv_have_kde,
1808 [#try to guess kde locations
1810 if test "$kde_qtver" = 1; then
1811 kde_check_header="ksock.h"
1812 kde_check_lib="libkdecore.la"
1814 kde_check_header="ksharedptr.h"
1815 kde_check_lib="libkio.la"
1818 if test -z "$1"; then
1820 kde_incdirs="$kde_libs_prefix/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes"
1821 test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
1822 kde_incdirs="$ac_kde_includes $kde_incdirs"
1823 AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
1824 ac_kde_includes="$kde_incdir"
1826 if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
1828 in the prefix, you've chosen, are no KDE headers installed. This will fail.
1829 So, check this please and use another prefix!])
1832 kde_libdirs="$kde_libs_prefix/lib${kdelibsuff} /usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}"
1833 test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
1834 kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
1835 AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
1836 ac_kde_libraries="$kde_libdir"
1839 dnl this might be somewhere else
1840 AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
1842 if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
1844 in the prefix, you've chosen, are no KDE libraries installed. This will fail.
1845 So, check this please and use another prefix!])
1848 if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
1850 I can't find the designer plugins. These are required and should have been installed
1854 if test -n "$kde_widgetdir"; then
1855 kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
1859 if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
1860 ac_cv_have_kde="have_kde=no"
1862 ac_cv_have_kde="have_kde=yes \
1863 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1866 else dnl test -z $1, e.g. from kdelibs
1868 ac_cv_have_kde="have_kde=no"
1873 eval "$ac_cv_have_kde"
1875 if test "$have_kde" != "yes"; then
1876 if test "${prefix}" = NONE; then
1877 ac_kde_prefix="$ac_default_prefix"
1879 ac_kde_prefix="$prefix"
1881 if test "$exec_prefix" = NONE; then
1882 ac_kde_exec_prefix="$ac_kde_prefix"
1883 AC_MSG_RESULT([will be installed in $ac_kde_prefix])
1885 ac_kde_exec_prefix="$exec_prefix"
1886 AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
1889 kde_libraries="${libdir}"
1890 kde_includes="${includedir}"
1893 ac_cv_have_kde="have_kde=yes \
1894 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1895 AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
1897 kde_libraries="$ac_kde_libraries"
1898 kde_includes="$ac_kde_includes"
1900 AC_SUBST(kde_libraries)
1901 AC_SUBST(kde_includes)
1903 if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then
1906 KDE_INCLUDES="-I$kde_includes"
1907 all_includes="$KDE_INCLUDES $all_includes"
1910 KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
1912 KDE_LDFLAGS="-L$kde_libraries"
1913 if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
1914 all_libraries="$KDE_LDFLAGS $all_libraries"
1917 AC_SUBST(KDE_LDFLAGS)
1918 AC_SUBST(KDE_INCLUDES)
1920 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1922 all_libraries="$all_libraries $USER_LDFLAGS"
1923 all_includes="$all_includes $USER_INCLUDES"
1924 AC_SUBST(all_includes)
1925 AC_SUBST(all_libraries)
1927 if test -z "$1"; then
1928 KDE_CHECK_UIC_PLUGINS
1931 ac_kde_libraries="$kde_libdir"
1938 AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
1940 AC_MSG_CHECKING(for extra includes)
1941 AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
1942 kde_use_extra_includes="$withval",
1943 kde_use_extra_includes=NONE
1946 if test -n "$kde_use_extra_includes" && \
1947 test "$kde_use_extra_includes" != "NONE"; then
1951 for dir in $kde_use_extra_includes; do
1952 kde_extra_includes="$kde_extra_includes $dir"
1953 USER_INCLUDES="$USER_INCLUDES -I$dir"
1956 kde_use_extra_includes="added"
1958 kde_use_extra_includes="no"
1960 AC_SUBST(USER_INCLUDES)
1962 AC_MSG_RESULT($kde_use_extra_includes)
1965 AC_MSG_CHECKING(for extra libs)
1966 AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
1967 kde_use_extra_libs=$withval,
1968 kde_use_extra_libs=NONE
1970 if test -n "$kde_use_extra_libs" && \
1971 test "$kde_use_extra_libs" != "NONE"; then
1975 for dir in $kde_use_extra_libs; do
1976 kde_extra_libs="$kde_extra_libs $dir"
1977 KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
1978 USER_LDFLAGS="$USER_LDFLAGS -L$dir"
1981 kde_use_extra_libs="added"
1983 kde_use_extra_libs="no"
1986 AC_SUBST(USER_LDFLAGS)
1988 AC_MSG_RESULT($kde_use_extra_libs)
1992 AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
1994 AC_MSG_CHECKING([for KDE headers installed])
1997 cat > conftest.$ac_ext <<EOF
1999 # include <stdlib.h>
2002 #include "confdefs.h"
2006 printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
2007 printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
2008 printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
2009 printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
2010 printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
2011 printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
2012 printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
2013 printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
2014 printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
2015 printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
2016 printf("kde_wallpaperdir=\\"%s\\"\n",
2017 KApplication::kde_wallpaperdir().data());
2018 printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
2019 printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
2020 printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
2021 printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
2022 printf("kde_moduledir=\\"/tmp/dummy\\"\n");
2023 printf("kde_styledir=\\"/tmp/dummy\\"\n");
2024 printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
2025 printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
2026 printf("xdg_menudir=\\"/tmp/dummy\\"\n");
2027 printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
2028 printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
2033 ac_save_CPPFLAGS=$CPPFLAGS
2034 CPPFLAGS="$all_includes $CPPFLAGS"
2035 if AC_TRY_EVAL(ac_compile); then
2038 AC_MSG_ERROR([your system is not able to compile a small KDE application!
2039 Check, if you installed the KDE header files correctly.
2040 For more details about this problem, look at the end of config.log.])
2042 CPPFLAGS=$ac_save_CPPFLAGS
2047 AC_DEFUN([KDE_CHECK_KDEQTADDON],
2049 AC_MSG_CHECKING(for kde-qt-addon)
2050 AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
2052 kde_ldflags_safe="$LDFLAGS"
2053 kde_libs_safe="$LIBS"
2054 kde_cxxflags_safe="$CXXFLAGS"
2056 LIBS="-lkde-qt-addon $LIBQT $LIBS"
2057 CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
2058 LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
2066 kde_cv_have_kdeqtaddon=yes,
2067 kde_cv_have_kdeqtaddon=no
2070 LDFLAGS=$kde_ldflags_safe
2072 CXXFLAGS=$kde_cxxflags_safe
2075 AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
2077 if test "$kde_cv_have_kdeqtaddon" = "no"; then
2078 AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
2079 It is a separate package (and CVS module) named kde-qt-addon.])
2083 AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
2085 AC_REQUIRE([KDE_MISC_TESTS])
2086 AC_REQUIRE([KDE_CHECK_LIBDL])
2087 AC_REQUIRE([K_PATH_X])
2089 if test $kde_qtver = 3; then
2091 *cygwin*) lib_kded="-lkdeinit_kded" ;;
2094 AC_SUBST(LIB_KDED, $lib_kded)
2095 AC_SUBST(LIB_KDECORE, "-lkdecore")
2096 AC_SUBST(LIB_KDEUI, "-lkdeui")
2097 AC_SUBST(LIB_KIO, "-lkio")
2098 AC_SUBST(LIB_KJS, "-lkjs")
2099 AC_SUBST(LIB_SMB, "-lsmb")
2100 AC_SUBST(LIB_KAB, "-lkab")
2101 AC_SUBST(LIB_KABC, "-lkabc")
2102 AC_SUBST(LIB_KHTML, "-lkhtml")
2103 AC_SUBST(LIB_KSPELL, "-lkspell")
2104 AC_SUBST(LIB_KPARTS, "-lkparts")
2105 AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2106 AC_SUBST(LIB_KUTILS, "-lkutils")
2107 AC_SUBST(LIB_KDEPIM, "-lkdepim")
2108 AC_SUBST(LIB_KIMPROXY, "-lkimproxy")
2109 AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
2110 AC_SUBST(LIB_KDNSSD, "-lkdnssd")
2111 AC_SUBST(LIB_KUNITTEST, "-lkunittest")
2112 # these are for backward compatibility
2113 AC_SUBST(LIB_KSYCOCA, "-lkio")
2114 AC_SUBST(LIB_KFILE, "-lkio")
2115 elif test $kde_qtver = 2; then
2116 AC_SUBST(LIB_KDECORE, "-lkdecore")
2117 AC_SUBST(LIB_KDEUI, "-lkdeui")
2118 AC_SUBST(LIB_KIO, "-lkio")
2119 AC_SUBST(LIB_KSYCOCA, "-lksycoca")
2120 AC_SUBST(LIB_SMB, "-lsmb")
2121 AC_SUBST(LIB_KFILE, "-lkfile")
2122 AC_SUBST(LIB_KAB, "-lkab")
2123 AC_SUBST(LIB_KHTML, "-lkhtml")
2124 AC_SUBST(LIB_KSPELL, "-lkspell")
2125 AC_SUBST(LIB_KPARTS, "-lkparts")
2126 AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2128 AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
2129 AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
2130 AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
2131 AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
2132 AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
2136 AC_DEFUN([AC_PATH_KDE],
2139 AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
2141 if test "$enableval" = "no";
2142 then ac_use_path_checking="default"
2143 else ac_use_path_checking=""
2147 if test "$kde_qtver" = 1;
2148 then ac_use_path_checking=""
2149 else ac_use_path_checking="default"
2154 AC_CREATE_KFSSTND($ac_use_path_checking)
2157 KDE_CREATE_LIBS_ALIASES
2160 dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
2161 AC_DEFUN([KDE_CHECK_FUNC_EXT],
2163 AC_MSG_CHECKING(for $1)
2164 AC_CACHE_VAL(kde_cv_func_$1,
2168 save_CXXFLAGS="$CXXFLAGS"
2169 kde_safe_LIBS="$LIBS"
2170 LIBS="$LIBS $X_EXTRA_LIBS"
2171 if test "$GXX" = "yes"; then
2172 CXXFLAGS="$CXXFLAGS -pedantic-errors"
2182 CXXFLAGS="$save_CXXFLAGS"
2183 LIBS="$kde_safe_LIBS"
2187 AC_MSG_RESULT($kde_cv_func_$1)
2189 AC_MSG_CHECKING([if $1 needs custom prototype])
2190 AC_CACHE_VAL(kde_cv_proto_$1,
2192 if test "x$kde_cv_func_$1" = xyes; then
2196 setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
2197 kde_cv_proto_$1="yes - in libkdefakes"
2200 kde_cv_proto_$1=unknown
2205 if test "x$kde_cv_proto_$1" = xunknown; then
2210 LIBS="$LIBS $X_EXTRA_LIBS"
2219 [ kde_cv_func_$1=yes
2220 kde_cv_proto_$1=yes ],
2221 [kde_cv_proto_$1="$1 unavailable"]
2227 AC_MSG_RESULT($kde_cv_proto_$1)
2229 if test "x$kde_cv_func_$1" = xyes; then
2230 AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
2233 if test "x$kde_cv_proto_$1" = xno; then
2234 AC_DEFINE(HAVE_$5_PROTO, 1,
2235 [Define if you have the $1 prototype])
2238 AH_VERBATIM([_HAVE_$5_PROTO],
2240 #if !defined(HAVE_$5_PROTO)
2252 AC_DEFUN([AC_CHECK_SETENV],
2254 KDE_CHECK_FUNC_EXT(setenv, [
2257 [setenv("VAR", "VALUE", 1);],
2258 [int setenv (const char *, const char *, int)],
2262 AC_DEFUN([AC_CHECK_UNSETENV],
2264 KDE_CHECK_FUNC_EXT(unsetenv, [
2268 [void unsetenv (const char *)],
2272 AC_DEFUN([AC_CHECK_GETDOMAINNAME],
2274 KDE_CHECK_FUNC_EXT(getdomainname, [
2281 getdomainname(buffer, 200);
2283 [#include <sys/types.h>
2284 int getdomainname (char *, size_t)],
2288 AC_DEFUN([AC_CHECK_GETHOSTNAME],
2290 KDE_CHECK_FUNC_EXT(gethostname, [
2296 gethostname(buffer, 200);
2298 [int gethostname (char *, unsigned int)],
2302 AC_DEFUN([AC_CHECK_USLEEP],
2304 KDE_CHECK_FUNC_EXT(usleep, [
2310 [int usleep (unsigned int)],
2315 AC_DEFUN([AC_CHECK_RANDOM],
2317 KDE_CHECK_FUNC_EXT(random, [
2323 [long int random(void)],
2326 KDE_CHECK_FUNC_EXT(srandom, [
2332 [void srandom(unsigned int)],
2337 AC_DEFUN([AC_CHECK_INITGROUPS],
2339 KDE_CHECK_FUNC_EXT(initgroups, [
2340 #include <sys/types.h>
2346 initgroups(buffer, 27);
2348 [int initgroups(const char *, gid_t)],
2352 AC_DEFUN([AC_CHECK_MKSTEMPS],
2354 KDE_CHECK_FUNC_EXT(mkstemps, [
2359 mkstemps("/tmp/aaaXXXXXX", 6);
2361 [int mkstemps(char *, int)],
2365 AC_DEFUN([AC_CHECK_MKSTEMP],
2367 KDE_CHECK_FUNC_EXT(mkstemp, [
2372 mkstemp("/tmp/aaaXXXXXX");
2374 [int mkstemp(char *)],
2378 AC_DEFUN([AC_CHECK_MKDTEMP],
2380 KDE_CHECK_FUNC_EXT(mkdtemp, [
2385 mkdtemp("/tmp/aaaXXXXXX");
2387 [char *mkdtemp(char *)],
2392 AC_DEFUN([AC_CHECK_RES_INIT],
2394 AC_MSG_CHECKING([if res_init needs -lresolv])
2395 kde_libs_safe="$LIBS"
2396 LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
2399 #include <sys/types.h>
2400 #include <netinet/in.h>
2401 #include <arpa/nameser.h>
2408 LIBRESOLV="-lresolv"
2410 AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2412 [ AC_MSG_RESULT(no) ]
2417 KDE_CHECK_FUNC_EXT(res_init,
2419 #include <sys/types.h>
2420 #include <netinet/in.h>
2421 #include <arpa/nameser.h>
2425 [int res_init(void)],
2429 AC_DEFUN([AC_CHECK_STRLCPY],
2431 KDE_CHECK_FUNC_EXT(strlcpy, [
2435 strlcpy(buf, "KDE function test", sizeof(buf));
2437 [unsigned long strlcpy(char*, const char*, unsigned long)],
2441 AC_DEFUN([AC_CHECK_STRLCAT],
2443 KDE_CHECK_FUNC_EXT(strlcat, [
2448 strlcat(buf, "KDE function test", sizeof(buf));
2450 [unsigned long strlcat(char*, const char*, unsigned long)],
2454 AC_DEFUN([AC_CHECK_RES_QUERY],
2456 KDE_CHECK_FUNC_EXT(res_query, [
2457 #include <sys/types.h>
2458 #include <netinet/in.h>
2459 #include <arpa/nameser.h>
2464 res_query(NULL, 0, 0, NULL, 0);
2466 [int res_query(const char *, int, int, unsigned char *, int)],
2470 AC_DEFUN([AC_CHECK_DN_SKIPNAME],
2472 KDE_CHECK_FUNC_EXT(dn_skipname, [
2473 #include <sys/types.h>
2474 #include <netinet/in.h>
2475 #include <arpa/nameser.h>
2479 dn_skipname (NULL, NULL);
2481 [int dn_skipname (unsigned char *, unsigned char *)],
2486 AC_DEFUN([AC_FIND_GIF],
2487 [AC_MSG_CHECKING([for giflib])
2488 AC_CACHE_VAL(ac_cv_lib_gif,
2489 [ac_save_LIBS="$LIBS"
2490 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2491 LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
2493 LIBS="$all_libraries -lgif"
2500 int GifLastError(void);
2504 /* We use char because int might match the return type of a gcc2
2505 builtin and then its argument prototype would still apply. */
2507 [return GifLastError();],
2508 eval "ac_cv_lib_gif=yes",
2509 eval "ac_cv_lib_gif=no")
2510 LIBS="$ac_save_LIBS"
2512 if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
2514 AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
2516 AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
2520 AC_DEFUN([KDE_FIND_JPEG_HELPER],
2522 AC_MSG_CHECKING([for libjpeg$2])
2523 AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
2525 ac_save_LIBS="$LIBS"
2526 LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
2527 ac_save_CFLAGS="$CFLAGS"
2528 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2534 void jpeg_CreateDecompress();
2539 [jpeg_CreateDecompress();],
2540 eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
2541 eval "ac_cv_lib_jpeg_$1=no")
2542 LIBS="$ac_save_LIBS"
2543 CFLAGS="$ac_save_CFLAGS"
2546 if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
2547 LIBJPEG="$ac_cv_lib_jpeg_$1"
2548 AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
2556 AC_DEFUN([AC_FIND_JPEG],
2558 dnl first look for libraries
2559 KDE_FIND_JPEG_HELPER(6b, 6b,
2560 KDE_FIND_JPEG_HELPER(normal, [],
2567 dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
2568 dnl requires system dependent includes loaded before it)
2569 jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
2570 AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
2571 test "x$jpeg_incdir" = xNO && jpeg_incdir=
2573 dnl if headers _and_ libraries are missing, this is no error, and we
2574 dnl continue with a warning (the user will get no jpeg support in khtml)
2575 dnl if only one is missing, it means a configuration error, but we still
2577 if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
2578 AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
2580 if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
2582 There is an installation error in jpeg support. You seem to have only one
2583 of either the headers _or_ the libraries installed. You may need to either
2584 provide correct --with-extra-... options, or the development package of
2585 libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
2586 Disabling JPEG support.
2589 AC_MSG_WARN([libjpeg not found. disable JPEG support.])
2596 AH_VERBATIM(_AC_CHECK_JPEG,
2598 * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
2599 * headers and I'm too lazy to write a configure test as long as only
2600 * unixware is related
2603 #define HAVE_BOOLEAN
2608 AC_DEFUN([KDE_CHECK_QT_JPEG],
2610 if test -n "$LIBJPEG"; then
2611 AC_MSG_CHECKING([if Qt needs $LIBJPEG])
2612 AC_CACHE_VAL(kde_cv_qt_jpeg,
2616 ac_save_LIBS="$LIBS"
2617 LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
2618 LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
2619 ac_save_CXXFLAGS="$CXXFLAGS"
2620 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2622 [#include <qapplication.h>],
2626 QApplication app(argc, argv);],
2627 eval "kde_cv_qt_jpeg=no",
2628 eval "kde_cv_qt_jpeg=yes")
2629 LIBS="$ac_save_LIBS"
2630 CXXFLAGS="$ac_save_CXXFLAGS"
2635 if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
2637 LIBJPEG_QT='$(LIBJPEG)'
2645 AC_DEFUN([AC_FIND_ZLIB],
2647 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2648 AC_MSG_CHECKING([for libz])
2649 AC_CACHE_VAL(ac_cv_lib_z,
2651 kde_save_LIBS="$LIBS"
2652 LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
2653 kde_save_CFLAGS="$CFLAGS"
2654 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2662 gzFile f = (gzFile) 0;
2663 /* this would segfault.. but we only link, don't run */
2664 (void) gzgets(f, buf, sizeof(buf));
2666 return (strcmp(zlibVersion(), ZLIB_VERSION) == 0);
2668 eval "ac_cv_lib_z='-lz'",
2669 eval "ac_cv_lib_z=no")
2670 LIBS="$kde_save_LIBS"
2671 CFLAGS="$kde_save_CFLAGS"
2673 if test ! "$ac_cv_lib_z" = no; then
2674 AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
2676 AC_MSG_RESULT($ac_cv_lib_z)
2678 AC_MSG_ERROR(not found.
2679 Possibly configure picks up an outdated version
2680 installed by XFree86. Remove it from your system.
2682 Check your installation and look into config.log)
2688 AC_DEFUN([KDE_TRY_TIFFLIB],
2690 AC_MSG_CHECKING([for libtiff $1])
2692 AC_CACHE_VAL(kde_cv_libtiff_$1,
2696 kde_save_LIBS="$LIBS"
2697 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2698 LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
2700 LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
2702 kde_save_CXXFLAGS="$CXXFLAGS"
2703 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2709 [return (TIFFOpen( "", "r") == 0); ],
2711 kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
2713 kde_cv_libtiff_$1=no
2716 LIBS="$kde_save_LIBS"
2717 CXXFLAGS="$kde_save_CXXFLAGS"
2721 if test "$kde_cv_libtiff_$1" = "no"; then
2726 LIBTIFF="$kde_cv_libtiff_$1"
2728 AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
2734 AC_DEFUN([AC_FIND_TIFF],
2736 AC_REQUIRE([K_PATH_X])
2737 AC_REQUIRE([AC_FIND_ZLIB])
2738 AC_REQUIRE([AC_FIND_JPEG])
2739 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2741 KDE_TRY_TIFFLIB(tiff, [],
2742 KDE_TRY_TIFFLIB(tiff34))
2747 AC_DEFUN([KDE_FIND_LIBEXR],
2749 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2750 AC_REQUIRE([AC_FIND_ZLIB])
2751 AC_CACHE_VAL(ac_cv_libexr,
2753 if test -z "$PKG_CONFIG"; then
2754 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2757 AC_MSG_CHECKING([for OpenEXR libraries])
2759 if test "$PKG_CONFIG" = "no" ; then
2761 echo "*** The pkg-config script could not be found. Make sure it is"
2762 echo "*** in your path, or set the PKG_CONFIG environment variable"
2763 echo "*** to the full path to pkg-config."
2764 echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
2766 if ! $PKG_CONFIG --exists OpenEXR ; then
2770 if ! $PKG_CONFIG --atleast-version="1.1.1" OpenEXR ; then
2774 kde_save_LIBS="$LIBS"
2775 LIBS="$LIBS $all_libraries $USER_LDFLAGS `pkg-config --libs OpenEXR` $LIBZ"
2778 kde_save_CXXFLAGS="$CXXFLAGS"
2779 EXR_FLAGS=`$PKG_CONFIG --cflags OpenEXR`
2780 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES $EXR_FLAGS"
2784 #include <ImfRgbaFile.h>
2787 using namespace Imf;
2788 RgbaInputFile file ("dummy");
2791 eval "ac_cv_libexr='`pkg-config --libs OpenEXR`'",
2792 eval "ac_cv_libexr=no"
2794 LIBS="$kde_save_LIBS"
2795 CXXFLAGS="$kde_save_CXXFLAGS"
2798 if eval "test ! \"`echo $ac_cv_libexr`\" = no"; then
2799 AC_DEFINE_UNQUOTED(HAVE_EXR, 1, [Define if you have OpenEXR])
2800 LIB_EXR="$ac_cv_libexr"
2801 AC_MSG_RESULT($ac_cv_libexr)
2815 AC_DEFUN([AC_FIND_PNG],
2817 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2818 AC_REQUIRE([AC_FIND_ZLIB])
2819 AC_MSG_CHECKING([for libpng])
2820 AC_CACHE_VAL(ac_cv_lib_png,
2822 kde_save_LIBS="$LIBS"
2823 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2824 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
2826 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
2828 kde_save_CFLAGS="$CFLAGS"
2829 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2836 png_structp png_ptr = png_create_read_struct( /* image ptr */
2837 PNG_LIBPNG_VER_STRING, 0, 0, 0 );
2838 return( png_ptr != 0 );
2840 eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
2841 eval "ac_cv_lib_png=no"
2843 LIBS="$kde_save_LIBS"
2844 CFLAGS="$kde_save_CFLAGS"
2846 if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
2847 AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
2848 LIBPNG="$ac_cv_lib_png"
2850 AC_MSG_RESULT($ac_cv_lib_png)
2859 AC_DEFUN([AC_FIND_JASPER],
2861 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2862 AC_REQUIRE([AC_FIND_JPEG])
2863 AC_MSG_CHECKING([for jasper])
2864 AC_CACHE_VAL(ac_cv_jasper,
2866 kde_save_LIBS="$LIBS"
2867 LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
2868 kde_save_CFLAGS="$CFLAGS"
2869 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2873 #include<jasper/jasper.h>
2876 return( jas_init() );
2878 eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
2879 eval "ac_cv_jasper=no"
2881 LIBS="$kde_save_LIBS"
2882 CFLAGS="$kde_save_CFLAGS"
2884 if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
2885 AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
2886 LIB_JASPER="$ac_cv_jasper"
2887 AC_MSG_RESULT($ac_cv_jasper)
2892 AC_SUBST(LIB_JASPER)
2895 AC_DEFUN([AC_CHECK_BOOL],
2897 AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
2900 AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
2902 AC_MSG_CHECKING(if you need GNU extensions)
2903 AC_CACHE_VAL(ac_cv_gnu_extensions,
2905 cat > conftest.c << EOF
2906 #include <features.h>
2908 #ifdef __GNU_LIBRARY__
2913 if (eval "$ac_cpp conftest.c") 2>&5 |
2914 egrep "yes" >/dev/null 2>&1; then
2916 ac_cv_gnu_extensions=yes
2918 ac_cv_gnu_extensions=no
2922 AC_MSG_RESULT($ac_cv_gnu_extensions)
2923 if test "$ac_cv_gnu_extensions" = "yes"; then
2924 AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
2928 AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
2930 AC_MSG_CHECKING([whether $CXX supports -$1])
2931 kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
2932 AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
2936 save_CXXFLAGS="$CXXFLAGS"
2937 CXXFLAGS="$CXXFLAGS -$1"
2938 AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
2939 CXXFLAGS="$save_CXXFLAGS"
2942 if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
2953 AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
2955 AC_MSG_CHECKING([whether $CC supports -$1])
2956 kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
2957 AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
2961 save_CFLAGS="$CFLAGS"
2962 CFLAGS="$CFLAGS -$1"
2963 AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
2964 CFLAGS="$save_CFLAGS"
2967 if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
2979 dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
2980 dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
2981 dnl it's all white-space separated
2982 AC_DEFUN([AC_REMOVE_FORBIDDEN],
2985 if test -n "$__val"; then
2991 *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
2992 *) # Careful to not add spaces, where there were none, because otherwise
2993 # libtool gets confused, if we change e.g. CXX
2994 if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
3003 AC_DEFUN([KDE_CHECK_FOR_BAD_COMPILER],
3005 AC_MSG_CHECKING([whether $CC is blacklisted])
3007 dnl In theory we have tu run this test against $CC and $CXX
3008 dnl in C and in C++ mode, because its perfectly legal for
3009 dnl the user to mix compiler versions, since C has a defined
3012 dnl For now, we assume the user is not on crack.
3016 #if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0
3021 kde_bad_compiler=no,
3022 kde_bad_compiler=yes
3025 AC_MSG_RESULT($kde_bad_compiler)
3027 if test "$kde_bad_compiler" = "yes"; then
3030 This particular compiler version is blacklisted because it
3031 is known to miscompile KDE. Please use a newer version, or
3032 if that is not yet available, choose an older version.
3034 Please do not report a bug or bother us reporting this
3035 configure error. We know about it, and we introduced
3036 it by intention to avoid untraceable bugs or crashes in KDE.
3044 AC_DEFUN([KDE_CHECK_FOR_OPT_NOINLINE_MATCH],
3046 AC_CACHE_CHECK([whether system headers can cope with -O2 -fno-inline],
3047 kde_cv_opt_noinline_match,
3049 kde_cv_opt_noinline_match=irrelevant
3050 dnl if we don't use both -O2 and -fno-inline, this check is moot
3051 if echo "$CFLAGS" | grep -e -O2 >/dev/null 2>/dev/null \
3052 && echo "$CFLAGS" | grep -e -fno-inline >/dev/null 2>/dev/null ; then
3054 ac_cflags_save="$CFLAGS"
3055 CFLAGS="$CFLAGS -D_USE_GNU"
3059 ], [ const char *pt, *et;
3060 et = __extension__ ({ char __a0, __a1, __a2; (__builtin_constant_p ( ";," ) && ((size_t)(const void *)(( ";," )+ 1) - (size_t)(const void *)( ";," ) == 1) ? ((__a0 =((__const char *) ( ";," ))[0], __a0 == '\0') ? ((void) ( pt ),((void *)0) ) : ((__a1 = ((__const char *) ( ";," ))[1], __a1== '\0') ? (__extension__ (__builtin_constant_p ( __a0 ) && ( __a0 ) == '\0' ? (char *) __rawmemchr ( pt , __a0) : strchr( pt , __a0 ))) : ((__a2 = ((__const char *) ( ";," ))[2], __a2 == '\0') ? __strpbrk_c2 ( pt , __a0, __a1) :(((__const char *) ( ";," ))[3] == '\0' ? __strpbrk_c3 ( pt ,__a0, __a1, __a2): strpbrk ( pt , ";," ))))) : strpbrk ( pt , ";," )); }) ;
3062 kde_cv_opt_noinline_match=yes,
3063 kde_cv_opt_noinline_match=no
3066 CFLAGS="$ac_cflags_save"
3072 dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
3073 AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
3075 if test "x$kde_use_qt_emb" != "xyes"; then
3076 AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
3077 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
3079 AC_REMOVE_FORBIDDEN(CXX, [-rpath])
3080 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
3084 AC_DEFUN([AC_CHECK_COMPILERS],
3086 AC_ARG_ENABLE(debug,
3087 AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
3091 kde_use_debug_code="yes"
3092 kde_use_debug_define=no
3095 kde_use_debug_code="full"
3096 kde_use_debug_define=no
3099 kde_use_debug_code="no"
3100 kde_use_debug_define=yes
3104 [kde_use_debug_code="no"
3105 kde_use_debug_define=no
3108 dnl Just for configure --help
3109 AC_ARG_ENABLE(dummyoption,
3110 AC_HELP_STRING([--disable-debug],
3111 [disables debug output and debug symbols [default=no]]),
3114 AC_ARG_ENABLE(strict,
3115 AC_HELP_STRING([--enable-strict],
3116 [compiles with strict compiler options (may not work!)]),
3118 if test $enableval = "no"; then
3119 kde_use_strict_options="no"
3121 kde_use_strict_options="yes"
3123 ], [kde_use_strict_options="no"])
3125 AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
3127 if test $enableval = "no"; then
3128 kde_use_warnings="no"
3130 kde_use_warnings="yes"
3132 ], [kde_use_warnings="yes"])
3134 dnl enable warnings for debug build
3135 if test "$kde_use_debug_code" != "no"; then
3136 kde_use_warnings=yes
3139 AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
3140 [kde_use_profiling=$enableval],
3141 [kde_use_profiling="no"]
3144 dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
3151 if test "$GCC" = "yes"; then
3152 if test "$kde_use_debug_code" != "no"; then
3153 if test $kde_use_debug_code = "full"; then
3154 CFLAGS="-g3 -fno-inline $CFLAGS"
3156 CFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CFLAGS"
3159 CFLAGS="-O2 $CFLAGS"
3163 if test "$kde_use_debug_define" = "yes"; then
3164 CFLAGS="-DNDEBUG $CFLAGS"
3169 *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
3170 *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
3173 if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
3177 CXXFLAGS=" $CXXFLAGS"
3181 KDE_CHECK_FOR_BAD_COMPILER
3183 if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
3184 if test "$kde_use_debug_code" != "no"; then
3185 if test "$CXX" = "KCC"; then
3186 CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
3188 if test "$kde_use_debug_code" = "full"; then
3189 CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
3191 CXXFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CXXFLAGS"
3194 KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
3196 dnl convenience compiler flags
3197 KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
3198 AC_SUBST(WOVERLOADED_VIRTUAL)
3200 if test "$CXX" = "KCC"; then
3201 CXXFLAGS="+K3 $CXXFLAGS"
3203 CXXFLAGS="-O2 $CXXFLAGS"
3208 if test "$kde_use_debug_define" = "yes"; then
3209 CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
3212 if test "$kde_use_profiling" = "yes"; then
3213 KDE_CHECK_COMPILER_FLAG(pg,
3215 CFLAGS="-pg $CFLAGS"
3216 CXXFLAGS="-pg $CXXFLAGS"
3220 if test "$kde_use_warnings" = "yes"; then
3221 if test "$GCC" = "yes"; then
3222 CXXFLAGS="-Wall -W -Wpointer-arith $CXXFLAGS"
3225 CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
3226 CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts $CXXFLAGS"
3227 KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
3228 KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
3231 KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
3232 KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
3233 dnl ### FIXME: revert for KDE 4
3234 KDE_CHECK_COMPILER_FLAG(Wno-non-virtual-dtor,[CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"])
3238 if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
3239 CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
3243 AC_HELP_STRING([--enable-pch],
3244 [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
3245 [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
3247 HAVE_GCC_VISIBILITY=0
3248 AC_SUBST([HAVE_GCC_VISIBILITY])
3250 if test "$GXX" = "yes"; then
3251 gcc_no_reorder_blocks=NO
3252 KDE_CHECK_COMPILER_FLAG(fno-reorder-blocks,[gcc_no_reorder_blocks=YES])
3253 if test $kde_use_debug_code != "no" && \
3254 test $kde_use_debug_code != "full" && \
3255 test "YES" = "$gcc_no_reorder_blocks" ; then
3256 CXXFLAGS="$CXXFLAGS -fno-reorder-blocks"
3257 CFLAGS="$CFLAGS -fno-reorder-blocks"
3259 KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
3260 KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
3261 KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
3262 KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
3263 ENABLE_PERMISSIVE_FLAG="-fpermissive"
3265 if test "$kde_use_pch" = "yes"; then
3266 AC_MSG_CHECKING(whether gcc supports precompiling c header files)
3268 if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
3269 kde_gcc_supports_pch=yes
3272 kde_gcc_supports_pch=no
3275 if test "$kde_gcc_supports_pch" = "yes"; then
3276 AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
3277 if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
3278 kde_gcc_supports_pch=yes
3281 kde_gcc_supports_pch=no
3285 rm -f conftest.h conftest.h.gch
3288 KDE_CHECK_FOR_OPT_NOINLINE_MATCH
3289 if test "x$kde_cv_opt_noinline_match" = "xno" ; then
3290 CFLAGS="`echo "$CFLAGS" | sed "s/ -fno-inline//"`"
3293 AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
3294 if test "$CXX" = "KCC"; then
3295 dnl unfortunately we currently cannot disable exception support in KCC
3296 dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
3297 dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
3298 dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= )
3300 if test "$kde_use_pch" = "yes"; then
3301 dnl TODO: support --pch-dir!
3302 KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
3303 dnl the below works (but the dir must exist), but it's
3304 dnl useless for a whole package.
3305 dnl The are precompiled headers for each source file, so when compiling
3306 dnl from scratch, it doesn't make a difference, and they take up
3307 dnl around ~5Mb _per_ sourcefile.
3308 dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
3309 dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
3311 dnl this flag controls inlining. by default KCC inlines in optimisation mode
3312 dnl all implementations that are defined inside the class {} declaration.
3313 dnl because of templates-compatibility with broken gcc compilers, this
3314 dnl can cause excessive inlining. This flag limits it to a sane level
3315 KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
3316 KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
3317 KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
3318 KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
3319 dnl Some source files are shared between multiple executables
3320 dnl (or libraries) and some of those need template instantiations.
3321 dnl In that case KCC needs to compile those sources with
3322 dnl --one_instantiation_per_object. To make it easy for us we compile
3323 dnl _all_ objects with that flag (--one_per is a shorthand).
3324 KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
3326 AC_SUBST(USE_EXCEPTIONS)
3327 dnl obsolete macro - provided to keep things going
3332 *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
3333 *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
3334 *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
3336 if test "$GXX" = yes; then
3337 libstdcpp=`$CXX -print-file-name=libstdc++.so`
3338 if test ! -f $libstdcpp; then
3339 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])
3345 AC_VALIDIFY_CXXFLAGS
3349 if test "$GCC" = yes; then
3352 KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
3354 AC_ARG_ENABLE(coverage,
3355 AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
3356 if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
3357 ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
3358 ac_coverage_linker="-lgcc"
3359 elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
3360 ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
3361 ac_coverage_linker=""
3363 AC_MSG_ERROR([coverage with your compiler is not supported])
3365 CFLAGS="$CFLAGS $ac_coverage_compiler"
3366 CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
3367 LDFLAGS="$LDFLAGS $ac_coverage_linker"
3370 AC_SUBST(NOOPT_CXXFLAGS)
3371 AC_SUBST(NOOPT_CFLAGS)
3372 AC_SUBST(ENABLE_PERMISSIVE_FLAG)
3374 KDE_CHECK_NEW_LDFLAGS
3379 ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
3382 AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG],
3384 AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug,
3389 safe_CXXFLAGS=$CXXFLAGS
3390 safe_LDFLAGS=$LDFLAGS
3391 CXXFLAGS="$CXXFLAGS -fPIC -fvisibility-inlines-hidden -O0"
3392 LDFLAGS="$LDFLAGS -shared -fPIC"
3396 /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
3398 int some_function( void ) __attribute__ ((visibility("default")));
3399 int some_function( void )
3401 std::string s("blafasel");
3404 ], [/* elvis is alive */],
3405 kde_cv_val_gcc_visibility_bug=no, kde_cv_val_gcc_visibility_bug=yes)
3407 CXXFLAGS=$safe_CXXFLAGS
3408 LDFLAGS=$safe_LDFLAGS
3413 if test x$kde_cv_val_gcc_visibility_bug = xno; then
3414 CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
3419 AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
3421 AC_BEFORE([AC_PATH_QT_1_3], [KDE_ENABLE_HIDDEN_VISIBILITY])
3423 AC_MSG_CHECKING([grepping for visibility push/pop in headers])
3425 if test "x$GXX" = "xyes"; then
3429 [GCC visibility push],
3430 [ #include <exception>
3434 kde_stdc_visibility_patched=yes ],
3437 AC_MSG_WARN([Your libstdc++ doesn't appear to be patched for
3438 visibility support. Disabling -fvisibility=hidden])
3440 kde_stdc_visibility_patched=no ])
3444 kde_have_gcc_visibility=no
3445 KDE_CHECK_COMPILER_FLAG(fvisibility=hidden,
3447 kde_have_gcc_visibility=yes
3448 dnl the whole toolchain is just a mess, gcc is just too buggy
3449 dnl to handle STL with visibility enabled. Lets reconsider
3450 dnl when gcc 4.2 is out or when things get fixed in the compiler.
3451 dnl Contact mueller@kde.org for details.
3452 AC_ARG_ENABLE(gcc-hidden-visibility,
3453 AC_HELP_STRING([--enable-gcc-hidden-visibility],[toolchain hidden visibility [default=no]]),
3454 [kde_have_gcc_visibility=$enableval],
3455 [kde_have_gcc_visibility=no])
3457 AC_CACHE_CHECK([if Qt is patched for -fvisibility], kde_cv_val_qt_gcc_visibility_patched,
3462 safe_CXXFLAGS=$CXXFLAGS
3463 CXXFLAGS="$CXXFLAGS $all_includes"
3467 #include <qglobal.h>
3468 #if Q_EXPORT - 0 != 0
3469 /* if this compiles, then Q_EXPORT is undefined */
3470 /* if Q_EXPORT is nonempty, this will break compilation */
3472 ], [/* elvis is alive */],
3473 kde_cv_val_qt_gcc_visibility_patched=no, kde_cv_val_qt_gcc_visibility_patched=yes)
3475 CXXFLAGS=$safe_CXXFLAGS
3480 if test x$kde_have_gcc_visibility = "xyes" && test x$kde_stdc_visibility_patched = "xyes" && test x$kde_cv_val_qt_gcc_visibility_patched = "xyes"; then
3481 CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
3482 KDE_CHECK_VISIBILITY_GCC_BUG
3483 HAVE_GCC_VISIBILITY=1
3484 AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
3490 AC_DEFUN([KDE_ADD_DEPENDENCIES],
3492 [A]M_DEPENDENCIES(CC)
3493 [A]M_DEPENDENCIES(CXX)
3496 dnl just a wrapper to clean up configure.in
3497 AC_DEFUN([KDE_PROG_LIBTOOL],
3499 AC_REQUIRE([AC_CHECK_COMPILERS])
3500 AC_REQUIRE([AC_ENABLE_SHARED])
3501 AC_REQUIRE([AC_ENABLE_STATIC])
3503 AC_REQUIRE([AC_LIBTOOL_DLOPEN])
3504 AC_REQUIRE([KDE_CHECK_LIB64])
3512 LIBTOOL_SHELL="/bin/sh ./libtool"
3513 # LIBTOOL="$LIBTOOL --silent"
3514 KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
3515 AC_SUBST(KDE_PLUGIN)
3517 # This hack ensures that libtool creates shared libs for kunittest plugins. By default check_LTLIBRARIES makes static libs.
3518 KDE_CHECK_PLUGIN="\$(KDE_PLUGIN) -rpath \$(libdir)"
3519 AC_SUBST(KDE_CHECK_PLUGIN)
3521 # we patch configure quite some so we better keep that consistent for incremental runs
3522 AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
3525 AC_DEFUN([KDE_CHECK_LIB64],
3527 AC_ARG_ENABLE(libsuffix,
3528 AC_HELP_STRING([--enable-libsuffix],
3529 [/lib directory suffix (64,32,none,auto[=default])]),
3530 kdelibsuff=$enableval, kdelibsuff="auto")
3532 if test "$kdelibsuff" = "auto"; then
3534 cat > conftest.c << EOF
3540 kdelibsuff=`$CC conftest.c -o conftest.out; ldd conftest.out |sed -ne '/libc.so/{
3541 s,.*/lib\([[^\/]]*\)/.*,\1,
3547 if test "$kdelibsuff" = "no" || test "$kdelibsuff" = "none"; then
3550 if test -z "$kdelibsuff"; then
3551 AC_MSG_RESULT([not using lib directory suffix])
3552 AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
3554 if test "$libdir" = '${exec_prefix}/lib'; then
3555 libdir="$libdir${kdelibsuff}"
3556 AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms
3558 AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${kdelibsuff}"], Suffix for lib directories)
3559 AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
3563 AC_DEFUN([KDE_CHECK_TYPES],
3564 [ AC_CHECK_SIZEOF(int, 4)dnl
3565 AC_CHECK_SIZEOF(short)dnl
3566 AC_CHECK_SIZEOF(long, 4)dnl
3567 AC_CHECK_SIZEOF(char *, 4)dnl
3570 dnl Not used - kept for compat only?
3571 AC_DEFUN([KDE_DO_IT_ALL],
3575 AM_INIT_AUTOMAKE($1, $2)
3576 AM_DISABLE_LIBRARIES
3577 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
3584 AC_DEFUN([AC_CHECK_RPATH],
3586 AC_MSG_CHECKING(for rpath)
3587 AC_ARG_ENABLE(rpath,
3588 AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
3589 USE_RPATH=$enableval, USE_RPATH=yes)
3591 if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
3593 KDE_RPATH="-R \$(libdir)"
3595 if test "$kde_libraries" != "$libdir"; then
3596 KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)"
3599 if test -n "$qt_libraries"; then
3600 KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
3602 dnl $x_libraries is set to /usr/lib in case
3603 if test -n "$X_LDFLAGS"; then
3604 X_RPATH="-R \$(x_libraries)"
3605 KDE_RPATH="$KDE_RPATH $X_RPATH"
3607 if test -n "$KDE_EXTRA_RPATH"; then
3608 KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
3611 AC_SUBST(KDE_EXTRA_RPATH)
3614 AC_MSG_RESULT($USE_RPATH)
3617 dnl Check for the type of the third argument of getsockname
3618 AC_DEFUN([AC_CHECK_SOCKLEN_T],
3620 AC_MSG_CHECKING(for socklen_t)
3621 AC_CACHE_VAL(kde_cv_socklen_t,
3626 #include <sys/types.h>
3627 #include <sys/socket.h>
3631 getpeername(0,0,&len);
3634 kde_cv_socklen_t=yes
3635 kde_cv_socklen_t_equiv=socklen_t
3639 AC_MSG_RESULT($kde_cv_socklen_t)
3640 if test $kde_cv_socklen_t = no; then
3641 AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
3642 AC_CACHE_VAL(kde_cv_socklen_t_equiv,
3644 kde_cv_socklen_t_equiv=int
3646 for t in int size_t unsigned long "unsigned long"; do
3648 #include <sys/types.h>
3649 #include <sys/socket.h>
3653 getpeername(0,0,&len);
3656 kde_cv_socklen_t_equiv="$t"
3662 AC_MSG_RESULT($kde_cv_socklen_t_equiv)
3664 AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
3665 [type to use in place of socklen_t if not defined])
3666 AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
3667 [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
3670 dnl This is a merge of some macros out of the gettext aclocal.m4
3671 dnl since we don't need anything, I took the things we need
3672 dnl the copyright for them is:
3674 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3675 dnl This Makefile.in is free software; the Free Software Foundation
3676 dnl gives unlimited permission to copy and/or distribute it,
3677 dnl with or without modifications, as long as this notice is preserved.
3679 dnl This program is distributed in the hope that it will be useful,
3680 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
3681 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
3682 dnl PARTICULAR PURPOSE.
3684 dnl for this file it is relicensed under LGPL
3686 AC_DEFUN([AM_KDE_WITH_NLS],
3688 dnl If we use NLS figure out what method
3690 AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
3691 [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
3692 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
3694 if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
3695 AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
3702 AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
3703 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
3705 dnl Test whether we really found GNU xgettext.
3706 if test "$XGETTEXT" != ":"; then
3707 dnl If it is no GNU xgettext we define it as : so that the
3708 dnl Makefiles still can work.
3709 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
3713 [found xgettext programs is not GNU xgettext; ignore it])
3721 # Search path for a program which passes the given test.
3722 # Ulrich Drepper <drepper@cygnus.com>, 1996.
3725 # Stephan Kulow: I appended a _KDE against name conflicts
3727 dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
3728 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3729 AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
3730 [# Extract the first word of "$2", so it can be a program name with args.
3731 set dummy $2; ac_word=[$]2
3732 AC_MSG_CHECKING([for $ac_word])
3733 AC_CACHE_VAL(ac_cv_path_$1,
3736 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3739 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3740 for ac_dir in ifelse([$5], , $PATH, [$5]); do
3741 test -z "$ac_dir" && ac_dir=.
3742 if test -f $ac_dir/$ac_word; then
3744 ac_cv_path_$1="$ac_dir/$ac_word"
3750 dnl If no 4th arg is given, leave the cache variable unset,
3751 dnl so AC_PATH_PROGS will keep looking.
3752 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3757 if test -n "[$]$1"; then
3758 AC_MSG_RESULT([$]$1)
3766 # Check whether LC_MESSAGES is available in <locale.h>.
3767 # Ulrich Drepper <drepper@cygnus.com>, 1995.
3771 AC_DEFUN([AM_LC_MESSAGES],
3772 [if test $ac_cv_header_locale_h = yes; then
3773 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
3774 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
3775 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
3776 if test $am_cv_val_LC_MESSAGES = yes; then
3777 AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
3781 dnl From Jim Meyering.
3782 dnl FIXME: migrate into libit.
3784 AC_DEFUN([AM_FUNC_OBSTACK],
3785 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
3786 [AC_TRY_LINK([#include "obstack.h"],
3787 [struct obstack *mem;obstack_free(mem,(char *) 0)],
3788 am_cv_func_obstack=yes,
3789 am_cv_func_obstack=no)])
3790 if test $am_cv_func_obstack = yes; then
3791 AC_DEFINE(HAVE_OBSTACK)
3793 LIBOBJS="$LIBOBJS obstack.o"
3797 dnl From Jim Meyering. Use this if you use the GNU error.[ch].
3798 dnl FIXME: Migrate into libit
3800 AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
3801 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
3802 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
3803 am_cv_lib_error_at_line=yes,
3804 am_cv_lib_error_at_line=no)])
3805 if test $am_cv_lib_error_at_line = no; then
3806 LIBOBJS="$LIBOBJS error.o"
3808 AC_SUBST(LIBOBJS)dnl
3811 # Macro to add for using GNU gettext.
3812 # Ulrich Drepper <drepper@cygnus.com>, 1995.
3815 # Stephan Kulow: I put a KDE in it to avoid name conflicts
3817 AC_DEFUN([AM_KDE_GNU_GETTEXT],
3818 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3819 AC_REQUIRE([AC_PROG_RANLIB])dnl
3820 AC_REQUIRE([AC_HEADER_STDC])dnl
3821 AC_REQUIRE([AC_TYPE_OFF_T])dnl
3822 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
3823 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
3824 AC_REQUIRE([AC_FUNC_MMAP])dnl
3825 AC_REQUIRE([AM_KDE_WITH_NLS])dnl
3826 AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
3827 AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
3828 __argz_count __argz_stringify __argz_next])
3830 AC_MSG_CHECKING(for stpcpy)
3831 AC_CACHE_VAL(kde_cv_func_stpcpy,
3833 kde_safe_cxxflags=$CXXFLAGS
3842 stpcpy(buffer, buffer);
3844 kde_cv_func_stpcpy=yes,
3845 kde_cv_func_stpcpy=no)
3847 CXXFLAGS=$kde_safe_cxxflags
3849 AC_MSG_RESULT($kde_cv_func_stpcpy)
3850 if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
3851 AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
3856 if test "x$CATOBJEXT" != "x"; then
3857 if test "x$ALL_LINGUAS" = "x"; then
3860 AC_MSG_CHECKING(for catalogs to be installed)
3862 for lang in ${LINGUAS=$ALL_LINGUAS}; do
3863 case "$ALL_LINGUAS" in
3864 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
3867 LINGUAS=$NEW_LINGUAS
3868 AC_MSG_RESULT($LINGUAS)
3871 dnl Construct list of names of catalog files to be constructed.
3872 if test -n "$LINGUAS"; then
3873 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
3879 AC_DEFUN([AC_HAVE_XPM],
3880 [AC_REQUIRE_CPP()dnl
3881 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3883 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
3884 test -z "$XPM_INCLUDE" && XPM_INCLUDE=
3886 AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
3887 xpm_test=$withval, xpm_test="yes")
3888 if test "x$xpm_test" = xno; then
3891 AC_MSG_CHECKING(for XPM)
3892 AC_CACHE_VAL(ac_cv_have_xpm,
3894 ac_save_ldflags="$LDFLAGS"
3895 ac_save_cflags="$CFLAGS"
3896 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
3897 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
3899 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
3901 CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
3902 test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
3903 AC_TRY_LINK([#include <X11/xpm.h>],[],
3904 ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
3905 LDFLAGS="$ac_save_ldflags"
3906 CFLAGS="$ac_save_cflags"
3909 if test "$ac_cv_have_xpm" = no; then
3915 AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
3916 if test "$XPM_LDFLAGS" = ""; then
3917 XPMLIB='-lXpm $(LIB_X11)'
3919 XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
3921 if test "$XPM_INCLUDE" = ""; then
3924 XPMINC="-I$XPM_INCLUDE"
3934 AC_DEFUN([AC_HAVE_DPMS],
3935 [AC_REQUIRE_CPP()dnl
3936 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3938 test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
3939 test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
3942 AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
3943 dpms_test=$withval, dpms_test="yes")
3944 if test "x$dpms_test" = xno; then
3947 AC_MSG_CHECKING(for DPMS)
3948 dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
3949 dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
3950 AC_CACHE_VAL(ac_cv_have_dpms,
3952 if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
3954 ac_cv_have_dpms="no"
3956 ac_save_ldflags="$LDFLAGS"
3957 ac_save_cflags="$CFLAGS"
3958 ac_save_libs="$LIBS"
3959 LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries"
3960 LIBS="-lX11 -lXext $LIBSOCKET"
3961 CFLAGS="$CFLAGS $X_INCLUDES"
3962 test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3964 #include <X11/Xproto.h>
3966 #include <X11/Xlib.h>
3967 #include <X11/extensions/dpms.h>
3969 { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3970 ac_cv_have_dpms="yes", [
3971 LIBS="-lXdpms $LIBS"
3973 #include <X11/Xproto.h>
3975 #include <X11/Xlib.h>
3976 #include <X11/extensions/dpms.h>
3978 { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3980 ac_cv_have_dpms="-lXdpms"
3981 ],ac_cv_have_dpms="no")
3983 LDFLAGS="$ac_save_ldflags"
3984 CFLAGS="$ac_save_cflags"
3985 LIBS="$ac_save_libs"
3989 if test "$ac_cv_have_dpms" = no; then
3995 AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
3996 if test "$ac_cv_have_dpms" = "-lXdpms"; then
3999 if test "$DPMS_LDFLAGS" = ""; then
4000 DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
4002 DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
4004 if test "$DPMS_INCLUDE" = ""; then
4007 DPMSINC="-I$DPMS_INCLUDE"
4013 ac_save_cflags="$CFLAGS"
4014 CFLAGS="$CFLAGS $X_INCLUDES"
4015 test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
4016 AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
4017 [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
4018 AC_CHECK_DECL(DPMSCapable,
4019 AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
4020 [#include <X11/Xlib.h>
4021 #include <X11/extensions/dpms.h>])
4022 AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
4023 [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
4024 AC_CHECK_DECL(DPMSInfo,
4025 AC_DEFINE(HAVE_DPMSINFO_PROTO),,
4026 [#include <X11/Xlib.h>
4027 #include <X11/extensions/dpms.h>])
4028 CFLAGS="$ac_save_cflags"
4033 AC_DEFUN([AC_HAVE_GL],
4034 [AC_REQUIRE_CPP()dnl
4035 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
4037 test -z "$GL_LDFLAGS" && GL_LDFLAGS=
4038 test -z "$GL_INCLUDE" && GL_INCLUDE=
4040 AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
4041 gl_test=$withval, gl_test="yes")
4042 if test "x$kde_use_qt_emb" = "xyes"; then
4043 # GL and Qt Embedded is a no-go for now.
4045 elif test "x$gl_test" = xno; then
4048 AC_MSG_CHECKING(for GL)
4049 AC_CACHE_VAL(ac_cv_have_gl,
4053 ac_save_ldflags=$LDFLAGS
4054 ac_save_cxxflags=$CXXFLAGS
4056 LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries"
4057 LIBS="$LIBS -lGL -lGLU"
4058 test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LIBS="$LIBS -lX11"
4059 LIBS="$LIBS $LIB_XEXT -lm $LIBSOCKET"
4060 CXXFLAGS="$CFLAGS $X_INCLUDES"
4061 test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
4062 AC_TRY_LINK([#include <GL/gl.h>
4065 ac_cv_have_gl="yes", ac_cv_have_gl="no")
4067 LDFLAGS=$ac_save_ldflags
4068 CXXFLAGS=$ac_save_cxxflags
4072 if test "$ac_cv_have_gl" = "no"; then
4078 AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
4079 if test "$GL_LDFLAGS" = ""; then
4080 GLLIB='-lGLU -lGL $(LIB_X11)'
4082 GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
4084 if test "$GL_INCLUDE" = ""; then
4087 GLINC="-I$GL_INCLUDE"
4089 AC_MSG_RESULT($ac_cv_have_gl)
4098 dnl shadow password and PAM magic - maintained by ossi@kde.org
4100 AC_DEFUN([KDE_PAM], [
4101 AC_REQUIRE([KDE_CHECK_LIBDL])
4105 AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
4106 [ if test "x$withval" = "xyes"; then
4109 elif test "x$withval" = "xno"; then
4113 pam_service=$withval
4115 ], [ pam_service=kde ])
4119 if test "x$want_pam" != xno; then
4120 AC_CHECK_LIB(pam, pam_start, [
4121 AC_CHECK_HEADER(security/pam_appl.h,
4122 [ pam_header=security/pam_appl.h ],
4123 [ AC_CHECK_HEADER(pam/pam_appl.h,
4124 [ pam_header=pam/pam_appl.h ],
4126 AC_MSG_WARN([PAM detected, but no headers found!
4127 Make sure you have the necessary development packages installed.])
4133 if test -z "$pam_header"; then
4134 if test "x$want_pam" = xyes; then
4135 AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
4138 AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
4139 PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
4142 dnl darwin claims to be something special
4143 if test "$pam_header" = "pam/pam_appl.h"; then
4144 AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
4147 dnl test whether struct pam_message is const (Linux) or not (Sun)
4148 AC_MSG_CHECKING(for const pam_message)
4149 AC_EGREP_HEADER([struct pam_message], $pam_header,
4150 [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
4151 [AC_MSG_RESULT([const: Linux-type PAM])],
4152 [AC_MSG_RESULT([nonconst: Sun-type PAM])
4153 AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
4155 [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
4162 dnl DEF_PAM_SERVICE(arg name, full name, define name)
4163 AC_DEFUN([DEF_PAM_SERVICE], [
4165 AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
4166 [ if test "x$use_pam" = xyes; then
4167 $3_PAM_SERVICE=$withval
4169 AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
4170 You may want to enforce it by using --with-pam.])
4173 [ if test "x$use_pam" = xyes; then
4174 $3_PAM_SERVICE="$pam_service"
4177 if test -n "$$3_PAM_SERVICE"; then
4178 AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
4179 AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
4181 AC_SUBST($3_PAM_SERVICE)
4184 AC_DEFUN([KDE_SHADOWPASSWD], [
4185 AC_REQUIRE([KDE_PAM])
4187 AC_CHECK_LIB(shadow, getspent,
4188 [ LIBSHADOW="-lshadow"
4192 AC_CHECK_LIB(gen, getspent,
4196 [ AC_CHECK_FUNC(getspent,
4197 [ ac_use_shadow=yes ],
4198 [ ac_use_shadow=no ])
4204 AC_MSG_CHECKING([for shadow passwords])
4207 AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
4208 [ if test "x$withval" != "xno"; then
4214 use_shadow="$ac_use_shadow"
4217 if test "x$use_shadow" = xyes; then
4219 AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
4226 dnl finally make the relevant binaries setuid root, if we have shadow passwds.
4227 dnl this still applies, if we could use it indirectly through pam.
4228 if test "x$use_shadow" = xyes ||
4229 ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
4231 *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
4232 SETUIDFLAGS="-m 4755 -o root";;
4234 SETUIDFLAGS="-m 4755";;
4237 AC_SUBST(SETUIDFLAGS)
4241 AC_DEFUN([KDE_PASSWDLIBS], [
4242 AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
4243 AC_REQUIRE([KDE_PAM])
4244 AC_REQUIRE([KDE_SHADOWPASSWD])
4246 if test "x$use_pam" = "xyes"; then
4247 PASSWDLIBS="$PAMLIBS"
4249 PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
4252 dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
4253 dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires
4254 dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
4255 dnl may need to read /etc/master.passwd).
4258 SETUIDFLAGS="-m 4755 -o root"
4264 AC_SUBST(PASSWDLIBS)
4267 AC_DEFUN([KDE_CHECK_LIBDL],
4269 AC_CHECK_LIB(dl, dlopen, [
4271 ac_cv_have_dlfcn=yes
4274 AC_CHECK_LIB(dld, shl_unload, [
4276 ac_cv_have_shload=yes
4282 AC_DEFUN([KDE_CHECK_DLOPEN],
4285 AC_CHECK_HEADERS(dlfcn.h dl.h)
4286 if test "$ac_cv_header_dlfcn_h" = "no"; then
4290 if test "$ac_cv_header_dl_h" = "no"; then
4291 ac_cv_have_shload=no
4294 dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
4296 AC_ARG_ENABLE(dlopen,
4297 AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
4298 enable_dlopen=$enableval,
4301 # override the user's opinion, if we know it better ;)
4302 if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
4306 if test "$ac_cv_have_dlfcn" = "yes"; then
4307 AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
4310 if test "$ac_cv_have_shload" = "yes"; then
4311 AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
4314 if test "$enable_dlopen" = no ; then
4315 test -n "$1" && eval $1
4317 test -n "$2" && eval $2
4322 AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
4324 KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
4326 AC_MSG_CHECKING([dynamic loading])
4327 eval "`egrep '^build_libtool_libs=' libtool`"
4328 if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
4330 AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
4334 AC_MSG_RESULT($dynamic_loading)
4335 if test "$dynamic_loading" = "yes"; then
4342 AC_DEFUN([KDE_ADD_INCLUDES],
4344 if test -z "$1"; then
4345 test_include="Pix.h"
4350 AC_MSG_CHECKING([for libg++ ($test_include)])
4352 AC_CACHE_VAL(kde_cv_libgpp_includes,
4354 kde_cv_libgpp_includes=no
4360 /usr/unsupported/include \
4365 if test -r "$ac_dir/$test_include"; then
4366 kde_cv_libgpp_includes=$ac_dir
4372 AC_MSG_RESULT($kde_cv_libgpp_includes)
4373 if test "$kde_cv_libgpp_includes" != "no"; then
4374 all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
4379 AC_DEFUN([KDE_CHECK_LIBPTHREAD],
4381 dnl This code is here specifically to handle the
4382 dnl various flavors of threading library on FreeBSD
4383 dnl 4-, 5-, and 6-, and the (weird) rules around it.
4384 dnl There may be an environment PTHREAD_LIBS that
4385 dnl specifies what to use; otherwise, search for it.
4386 dnl -pthread is special cased and unsets LIBPTHREAD
4390 if test -n "$PTHREAD_LIBS"; then
4391 if test "x$PTHREAD_LIBS" = "x-pthread" ; then
4392 LIBPTHREAD="PTHREAD"
4394 PTHREAD_LIBS_save="$PTHREAD_LIBS"
4395 PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
4396 AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
4397 KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
4398 LIBPTHREAD="$PTHREAD_LIBS_save"])
4399 PTHREAD_LIBS="$PTHREAD_LIBS_save"
4403 dnl Is this test really needed, in the face of the Tru64 test below?
4404 if test -z "$LIBPTHREAD"; then
4405 AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
4408 dnl This is a special Tru64 check, see BR 76171 issue #18.
4409 if test -z "$LIBPTHREAD" ; then
4410 AC_MSG_CHECKING([for pthread_create in -lpthread])
4412 LIBS="$LIBS -lpthread"
4413 AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
4415 LIBPTHREAD="-lpthread"],[
4420 dnl Un-special-case for FreeBSD.
4421 if test "x$LIBPTHREAD" = "xPTHREAD" ; then
4425 AC_SUBST(LIBPTHREAD)
4428 AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
4431 if test -z "$LIBPTHREAD"; then
4432 KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
4435 AH_VERBATIM(__svr_define, [
4436 #if defined(__SVR4) && !defined(__svr4__)
4442 KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
4443 CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
4446 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
4449 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
4450 LIBPTHREAD="$LIBPTHREAD -lc_r"
4452 linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
4453 if test "$CXX" = "KCC"; then
4454 CXXFLAGS="$CXXFLAGS --thread_safe"
4455 NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
4461 AC_SUBST(USE_THREADS)
4462 AC_SUBST(LIBPTHREAD)
4465 AC_DEFUN([KDE_CHECK_THREADING],
4467 AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4468 AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
4469 dnl default is yes if libpthread is found and no if no libpthread is available
4470 if test -z "$LIBPTHREAD"; then
4471 if test -z "$USE_THREADS"; then
4472 kde_check_threading_default=no
4474 kde_check_threading_default=yes
4477 kde_check_threading_default=yes
4479 AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
4480 kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
4481 if test "x$kde_use_threading" = "xyes"; then
4482 AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
4486 AC_DEFUN([KDE_TRY_LINK_PYTHON],
4488 if test "$kde_python_link_found" = no; then
4490 if test "$1" = normal; then
4491 AC_MSG_CHECKING(if a Python application links)
4493 AC_MSG_CHECKING(if Python depends on $2)
4496 AC_CACHE_VAL(kde_cv_try_link_python_$1,
4498 kde_save_cflags="$CFLAGS"
4499 CFLAGS="$CFLAGS $PYTHONINC"
4500 kde_save_libs="$LIBS"
4501 LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
4502 kde_save_ldflags="$LDFLAGS"
4503 LDFLAGS="$LDFLAGS $PYTHONLIB"
4509 PySys_SetArgv(1, 0);
4511 [kde_cv_try_link_python_$1=yes],
4512 [kde_cv_try_link_python_$1=no]
4514 CFLAGS="$kde_save_cflags"
4515 LIBS="$kde_save_libs"
4516 LDFLAGS="$kde_save_ldflags"
4519 if test "$kde_cv_try_link_python_$1" = "yes"; then
4521 kde_python_link_found=yes
4522 if test ! "$1" = normal; then
4523 LIBPYTHON="$LIBPYTHON $2"
4535 AC_DEFUN([KDE_CHECK_PYTHON_DIR],
4537 AC_MSG_CHECKING([for Python directory])
4539 AC_CACHE_VAL(kde_cv_pythondir,
4541 if test -z "$PYTHONDIR"; then
4542 kde_cv_pythondir=/usr/local
4544 kde_cv_pythondir="$PYTHONDIR"
4548 AC_ARG_WITH(pythondir,
4549 AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
4551 ac_python_dir=$withval
4552 ], ac_python_dir=$kde_cv_pythondir
4555 AC_MSG_RESULT($ac_python_dir)
4558 AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
4560 AC_REQUIRE([KDE_CHECK_LIBDL])
4561 AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4562 AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
4564 if test -z "$1"; then
4570 AC_MSG_CHECKING([for Python$version])
4572 python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
4573 AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
4574 if test ! -r $python_incdir/Python.h; then
4575 AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
4576 python_incdir=$python_incdir/python$version
4577 if test ! -r $python_incdir/Python.h; then
4582 PYTHONINC=-I$python_incdir
4584 python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs"
4585 AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
4586 if test ! -r $python_libdir/libpython$version.so; then
4587 AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
4588 if test ! -r $python_libdir/libpython$version.a; then
4589 AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
4590 python_libdir=$python_libdir/python$version/config
4591 if test ! -r $python_libdir/libpython$version.a; then
4597 PYTHONLIB=-L$python_libdir
4598 kde_orig_LIBPYTHON=$LIBPYTHON
4599 if test -z "$LIBPYTHON"; then
4600 LIBPYTHON=-lpython$version
4603 AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
4604 python_moddir=$python_moddir/python$version
4605 if test ! -r $python_moddir/copy.py; then
4609 PYTHONMODDIR=$python_moddir
4611 AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
4613 if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
4614 LIBPYTHON=$kde_orig_LIBPYTHON
4615 test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
4616 test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
4619 dnl Note: this test is very weak
4620 kde_python_link_found=no
4621 KDE_TRY_LINK_PYTHON(normal)
4622 KDE_TRY_LINK_PYTHON(m, -lm)
4623 KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
4624 KDE_TRY_LINK_PYTHON(tcl, -ltcl)
4625 KDE_TRY_LINK_PYTHON(db2, -ldb2)
4626 KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
4627 KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
4628 KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
4629 KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
4630 KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
4631 KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
4632 KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
4633 KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
4634 [AC_MSG_WARN([it seems, Python depends on another library.
4635 Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
4636 and contact the authors to let them know about this problem])
4639 LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
4643 AC_SUBST(PYTHONMODDIR)
4644 AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
4650 AC_DEFUN([KDE_CHECK_PYTHON],
4652 KDE_CHECK_PYTHON_INTERN("2.5",
4653 [KDE_CHECK_PYTHON_INTERN("2.4",
4654 [KDE_CHECK_PYTHON_INTERN("2.3",
4655 [KDE_CHECK_PYTHON_INTERN("2.2",
4656 [KDE_CHECK_PYTHON_INTERN("2.1",
4657 [KDE_CHECK_PYTHON_INTERN("2.0",
4658 [KDE_CHECK_PYTHON_INTERN($1, $2) ])
4666 AC_DEFUN([KDE_CHECK_STL],
4670 ac_save_CXXFLAGS="$CXXFLAGS"
4671 CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
4673 AC_MSG_CHECKING([if C++ programs can be compiled])
4674 AC_CACHE_VAL(kde_cv_stl_works,
4678 using namespace std;
4680 string astring="Hallo Welt.";
4681 astring.erase(0, 6); // now astring is "Welt"
4683 ], kde_cv_stl_works=yes,
4684 kde_cv_stl_works=no)
4687 AC_MSG_RESULT($kde_cv_stl_works)
4689 if test "$kde_cv_stl_works" = "yes"; then
4691 AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
4693 AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
4694 Check config.log for details - if you're using a Linux distribution you might miss
4695 a package named similar to libstdc++-dev.])
4698 CXXFLAGS="$ac_save_CXXFLAGS"
4702 AC_DEFUN([AC_FIND_QIMGIO],
4703 [AC_REQUIRE([AC_FIND_JPEG])
4704 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
4705 AC_MSG_CHECKING([for qimgio])
4706 AC_CACHE_VAL(ac_cv_lib_qimgio,
4710 ac_save_LIBS="$LIBS"
4711 ac_save_CXXFLAGS="$CXXFLAGS"
4712 LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
4713 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
4716 #include <qimageio.h>
4717 #include <qstring.h>
4719 QString t = "hallo";
4724 ac_cv_lib_qimgio=yes,
4725 ac_cv_lib_qimgio=no,
4726 ac_cv_lib_qimgio=no)
4727 LIBS="$ac_save_LIBS"
4728 CXXFLAGS="$ac_save_CXXFLAGS"
4731 if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
4732 LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
4734 AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
4737 AC_MSG_RESULT(not found)
4741 AC_DEFUN([AM_DISABLE_LIBRARIES],
4743 AC_PROVIDE([AM_ENABLE_STATIC])
4744 AC_PROVIDE([AM_ENABLE_SHARED])
4750 AC_DEFUN([AC_CHECK_UTMP_FILE],
4752 AC_MSG_CHECKING([for utmp file])
4754 AC_CACHE_VAL(kde_cv_utmp_file,
4765 if test -r "$ac_file"; then
4766 kde_cv_utmp_file=$ac_file
4772 if test "$kde_cv_utmp_file" != "no"; then
4773 AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
4775 AC_MSG_RESULT($kde_cv_utmp_file)
4778 AC_MSG_RESULT([non found])
4783 AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
4786 DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
4789 if test ! -s $srcdir/subdirs; then
4790 dnl Note: Makefile.common creates subdirs, so this is just a fallback
4791 files=`cd $srcdir && ls -1`
4792 dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
4794 echo $i >> $srcdir/subdirs
4799 if test -s $srcdir/inst-apps; then
4800 ac_topsubdirs="`cat $srcdir/inst-apps`"
4801 elif test -s $srcdir/subdirs; then
4802 ac_topsubdirs="`cat $srcdir/subdirs`"
4805 for i in $ac_topsubdirs; do
4806 AC_MSG_CHECKING([if $i should be compiled])
4807 if test -d $srcdir/$i; then
4809 for j in $DO_NOT_COMPILE; do
4810 if test $i = $j; then
4817 AC_MSG_RESULT($install_it)
4818 vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
4819 if test $install_it = "yes"; then
4820 TOPSUBDIRS="$TOPSUBDIRS $i"
4821 eval "$vari""_SUBDIR_included=yes"
4823 eval "$vari""_SUBDIR_included=no"
4827 AC_SUBST(TOPSUBDIRS)
4830 AC_DEFUN([KDE_CHECK_NAMESPACES],
4832 AC_MSG_CHECKING(whether C++ compiler supports namespaces)
4846 int Foo::Bar::i = 1;
4849 AC_DEFINE(HAVE_NAMESPACES)
4856 dnl ------------------------------------------------------------------------
4857 dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
4858 dnl ------------------------------------------------------------------------
4860 AC_DEFUN([AC_CHECK_S_ISSOCK],
4862 AC_MSG_CHECKING(for S_ISSOCK)
4863 AC_CACHE_VAL(ac_cv_have_s_issock,
4867 #include <sys/stat.h>
4871 int b = S_ISSOCK( buff.st_mode );
4873 ac_cv_have_s_issock=yes,
4874 ac_cv_have_s_issock=no)
4876 AC_MSG_RESULT($ac_cv_have_s_issock)
4877 if test "$ac_cv_have_s_issock" = "yes"; then
4878 AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
4881 AH_VERBATIM(_ISSOCK,
4883 #ifndef HAVE_S_ISSOCK
4884 #define HAVE_S_ISSOCK
4885 #define S_ISSOCK(mode) (1==0)
4891 dnl ------------------------------------------------------------------------
4892 dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
4893 dnl ------------------------------------------------------------------------
4895 AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
4897 AC_MSG_CHECKING(for MAXPATHLEN)
4898 AC_CACHE_VAL(ac_cv_maxpathlen,
4900 cat > conftest.$ac_ext <<EOF
4902 # include <stdlib.h>
4905 #include <sys/param.h>
4907 #define MAXPATHLEN 1024
4910 KDE_HELLO MAXPATHLEN
4914 ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
4916 if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
4917 ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
4919 ac_cv_maxpathlen=1024
4925 AC_MSG_RESULT($ac_cv_maxpathlen)
4926 AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
4929 AC_DEFUN([KDE_CHECK_HEADER],
4931 kde_safe_cppflags=$CPPFLAGS
4932 CPPFLAGS="$CPPFLAGS $all_includes"
4935 AC_CHECK_HEADER([$1], [$2], [$3], [$4])
4937 CPPFLAGS=$kde_safe_cppflags
4940 AC_DEFUN([KDE_CHECK_HEADERS],
4942 AH_CHECK_HEADERS([$1])
4944 kde_safe_cppflags=$CPPFLAGS
4945 CPPFLAGS="$CPPFLAGS $all_includes"
4947 AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
4948 CPPFLAGS=$kde_safe_cppflags
4952 AC_DEFUN([KDE_FAST_CONFIGURE],
4954 dnl makes configure fast (needs perl)
4955 AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
4956 with_fast_perl=$enableval, with_fast_perl=yes)
4959 AC_DEFUN([KDE_CONF_FILES],
4962 if test -f $srcdir/configure.files ; then
4963 val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
4966 if test -n "$val" ; then
4968 CONF_FILES="$CONF_FILES $i"
4971 AC_SUBST(CONF_FILES)
4974 dnl This sets the prefix, for arts and kdelibs
4975 dnl Do NOT use in any other module.
4976 dnl It only looks at --prefix, KDEDIR and falls back to /usr/local/kde
4977 AC_DEFUN([KDE_SET_PREFIX_CORE],
4980 dnl make $KDEDIR the default for the installation
4981 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
4983 if test "x$prefix" = "xNONE"; then
4984 prefix=$ac_default_prefix
4985 ac_configure_args="$ac_configure_args --prefix=$prefix"
4987 # And delete superfluous '/' to make compares easier
4988 prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4989 exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4991 kde_libs_prefix='$(prefix)'
4992 kde_libs_htmldir='$(kde_htmldir)'
4993 AC_SUBST(kde_libs_prefix)
4994 AC_SUBST(kde_libs_htmldir)
5000 AC_DEFUN([KDE_SET_PREFIX],
5003 dnl We can't give real code to that macro, only a value.
5004 dnl It only matters for --help, since we set the prefix in this function anyway.
5005 AC_PREFIX_DEFAULT(${KDEDIR:-the kde prefix})
5007 KDE_SET_DEFAULT_BINDIRS
5008 if test "x$prefix" = "xNONE"; then
5009 dnl no prefix given: look for kde-config in the PATH and deduce the prefix from it
5010 KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
5012 dnl prefix given: look for kde-config, preferrably in prefix, otherwise in PATH
5013 kde_save_PATH="$PATH"
5014 PATH="$exec_prefix/bin:$prefix/bin:$PATH"
5015 KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
5016 PATH="$kde_save_PATH"
5019 kde_libs_prefix=`$KDECONFIG --prefix`
5020 if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
5021 AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
5022 This means it has been moved since you installed it.
5023 This won't work. Please recompile kdelibs for the new prefix.
5026 kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
5028 AC_MSG_CHECKING([where to install])
5029 if test "x$prefix" = "xNONE"; then
5030 prefix=$kde_libs_prefix
5031 AC_MSG_RESULT([$prefix (as returned by kde-config)])
5033 dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
5034 given_prefix=$prefix
5035 AC_MSG_RESULT([$prefix (as requested)])
5038 # And delete superfluous '/' to make compares easier
5039 prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
5040 exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
5041 given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
5044 AC_SUBST(kde_libs_prefix)
5045 AC_SUBST(kde_libs_htmldir)
5051 pushdef([AC_PROG_INSTALL],
5053 dnl our own version, testing for a -p flag
5054 popdef([AC_PROG_INSTALL])
5055 dnl as AC_PROG_INSTALL works as it works we first have
5056 dnl to save if the user didn't specify INSTALL, as the
5057 dnl autoconf one overwrites INSTALL and we have no chance to find
5059 test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
5060 test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
5061 test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
5064 if test -z "$kde_save_INSTALL_given" ; then
5065 # OK, user hasn't given any INSTALL, autoconf found one for us
5066 # now we test, if it supports the -p flag
5067 AC_MSG_CHECKING(for -p flag to install)
5068 rm -f confinst.$$.* > /dev/null 2>&1
5069 echo "Testtest" > confinst.$$.orig
5071 if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
5072 if test -f confinst.$$.new ; then
5073 # OK, -p seems to do no harm to install
5074 INSTALL="${INSTALL} -p"
5079 AC_MSG_RESULT($ac_res)
5081 dnl the following tries to resolve some signs and wonders coming up
5082 dnl with different autoconf/automake versions
5084 dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
5085 dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
5086 dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
5087 dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
5088 dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
5089 dnl install-@DIR@PROGRAMS targets to explicitly use that flag
5090 dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
5091 dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
5092 dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
5093 dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
5094 dnl automake (due to broken Makefile.am or whatever) to install programs,
5095 dnl and so does not see the -s flag in automake > 1.4
5096 dnl to clean up that mess we:
5097 dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
5098 dnl which cleans KDE's program with automake > 1.4;
5099 dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
5100 dnl with automake<=1.4
5101 dnl note that dues to this sometimes two '-s' flags are used (if KDE
5102 dnl properly uses install-@DIR@PROGRAMS, but I don't care
5104 dnl And to all this comes, that I even can't write in comments variable
5105 dnl names used by automake, because it is so stupid to think I wanted to
5106 dnl _use_ them, therefor I have written A_M_... instead of AM_
5107 dnl hmm, I wanted to say something ... ahh yes: Arghhh.
5109 if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
5110 INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
5112 if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
5113 INSTALL_SCRIPT='${INSTALL}'
5117 AC_DEFUN([KDE_LANG_CPLUSPLUS],
5119 ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
5120 pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
5123 pushdef([AC_LANG_CPLUSPLUS],
5124 [popdef([AC_LANG_CPLUSPLUS])
5128 AC_DEFUN([KDE_CHECK_LONG_LONG],
5130 AC_MSG_CHECKING(for long long)
5131 AC_CACHE_VAL(kde_cv_c_long_long,
5139 kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
5142 AC_MSG_RESULT($kde_cv_c_long_long)
5143 if test "$kde_cv_c_long_long" = yes; then
5144 AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
5148 AC_DEFUN([KDE_CHECK_LIB],
5150 kde_save_LDFLAGS="$LDFLAGS"
5151 dnl AC_CHECK_LIB modifies LIBS, so save it here
5152 kde_save_LIBS="$LIBS"
5153 LDFLAGS="$LDFLAGS $all_libraries"
5155 aix*) LDFLAGS="-brtl $LDFLAGS"
5156 test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
5159 AC_CHECK_LIB($1, $2, $3, $4, $5)
5160 LDFLAGS="$kde_save_LDFLAGS"
5161 LIBS="$kde_save_LIBS"
5164 AC_DEFUN([KDE_JAVA_PREFIX],
5167 base=`basename "$1"`
5168 list=`ls -1 $dir 2> /dev/null`
5169 for entry in $list; do
5170 if test -d $dir/$entry/bin; then
5173 javadirs="$javadirs $dir/$entry/bin"
5176 elif test -d $dir/$entry/jre/bin; then
5179 javadirs="$javadirs $dir/$entry/jre/bin"
5186 dnl KDE_CHEC_JAVA_DIR(onlyjre)
5187 AC_DEFUN([KDE_CHECK_JAVA_DIR],
5191 AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
5192 [ ac_java_dir=$withval
5196 AC_MSG_CHECKING([for Java])
5198 dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
5199 if test "x$ac_java_dir" = "xno"; then
5201 kde_java_includedir=no
5202 kde_java_libjvmdir=no
5203 kde_java_libgcjdir=no
5204 kde_java_libhpidir=no
5206 if test "x$ac_java_dir" = "x"; then
5209 dnl No option set -> collect list of candidate paths
5210 if test -n "$JAVA_HOME"; then
5211 KDE_JAVA_PREFIX($JAVA_HOME)
5213 KDE_JAVA_PREFIX(/usr/j2se)
5214 KDE_JAVA_PREFIX(/usr/lib/j2se)
5215 KDE_JAVA_PREFIX(/usr/j*dk*)
5216 KDE_JAVA_PREFIX(/usr/lib/j*dk*)
5217 KDE_JAVA_PREFIX(/opt/j*sdk*)
5218 KDE_JAVA_PREFIX(/usr/lib/java*)
5219 KDE_JAVA_PREFIX(/usr/java*)
5220 KDE_JAVA_PREFIX(/usr/java/j*dk*)
5221 KDE_JAVA_PREFIX(/usr/java/j*re*)
5222 KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
5223 KDE_JAVA_PREFIX(/usr/lib/SunJava*)
5224 KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
5225 KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
5226 KDE_JAVA_PREFIX(/opt/java*)
5231 for dir in $PATH; do
5232 if test -d "$dir"; then
5233 javadirs="$javadirs $dir"
5239 dnl Now javadirs contains a list of paths that exist, all ending with bin/
5240 for dir in $javadirs; do
5241 dnl Check for the java executable
5242 if test -x "$dir/java"; then
5243 sane_path=$(cd $dir; /bin/pwd)
5244 dnl And also check for a libjvm.so somewhere under there
5245 dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
5246 if test "$sane_path" != "/usr/bin"; then
5247 libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
5248 if test ! -f $libjvmdir/libjvm.so; then continue; fi
5249 jredirs="$jredirs $dir"
5254 dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
5258 for dir in $jredirs; do
5260 kde_java_bindir=$dir
5261 if test -x "$dir/javac"; then
5267 if test -n "$JAVAC"; then
5268 dnl this substitution might not work - well, we test for jni.h below
5269 kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
5271 kde_java_includedir=no
5274 dnl config option set
5275 kde_java_bindir=$ac_java_dir/bin
5276 if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
5277 kde_java_includedir=no
5279 kde_java_includedir=$ac_java_dir/include
5284 dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
5285 if test "x$kde_java_bindir" != "xno"; then
5287 dnl Look for libjvm.so
5288 kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
5289 dnl Look for libgcj.so
5290 kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
5291 dnl Look for libhpi.so and avoid green threads
5292 kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
5294 dnl Now check everything's fine under there
5295 dnl the include dir is our flag for having the JDK
5296 if test -d "$kde_java_includedir"; then
5297 if test ! -x "$kde_java_bindir/javac"; then
5298 AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
5300 if test ! -x "$kde_java_bindir/javah"; then
5301 AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5303 if test ! -x "$kde_java_bindir/jar"; then
5304 AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5306 if test ! -r "$kde_java_includedir/jni.h"; then
5307 AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
5310 jni_includes="-I$kde_java_includedir"
5311 dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
5312 dnl and under linux here..
5314 dnl not needed for gcj
5316 if test "x$kde_java_libgcjdir" = "x"; then
5317 test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
5318 test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
5319 test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
5327 if test "x$kde_java_libgcjdir" = "x"; then
5328 if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
5329 AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
5332 if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
5333 AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
5337 if test ! -x "$kde_java_bindir/java"; then
5338 AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
5341 dnl not needed for gcj compile
5343 if test "x$kde_java_libgcjdir" = "x"; then
5344 if test ! -r "$kde_java_libhpidir/libhpi.so"; then
5345 AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
5349 if test -n "$jni_includes"; then
5350 dnl Check for JNI version
5353 ac_cxxflags_safe="$CXXFLAGS"
5354 CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
5360 #ifndef JNI_VERSION_1_2
5363 ],[ kde_jni_works=yes ],
5364 [ kde_jni_works=no ])
5366 if test $kde_jni_works = no; then
5367 AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
5368 You need to have Java Development Kit (JDK) version 1.2.
5370 Use --with-java to specify another location.
5371 Use --without-java to configure without java support.
5372 Or download a newer JDK and try again.
5373 See e.g. http://java.sun.com/products/jdk/1.2 ])
5376 CXXFLAGS="$ac_cxxflags_safe"
5379 dnl All tests ok, inform and subst the variables
5381 JAVAC=$kde_java_bindir/javac
5382 JAVAH=$kde_java_bindir/javah
5383 JAR=$kde_java_bindir/jar
5384 AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5385 if test "x$kde_java_libgcjdir" = "x"; then
5386 JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
5388 JVMLIBS="-L$kde_java_libgcjdir -lgcj"
5390 AC_MSG_RESULT([java JDK in $kde_java_bindir])
5393 AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5394 AC_MSG_RESULT([java JRE in $kde_java_bindir])
5396 elif test -d "/Library/Java/Home"; then
5397 kde_java_bindir="/Library/Java/Home/bin"
5398 jni_includes="-I/Library/Java/Home/include"
5400 JAVAC=$kde_java_bindir/javac
5401 JAVAH=$kde_java_bindir/javah
5402 JAR=$kde_java_bindir/jar
5403 JVMLIBS="-Wl,-framework,JavaVM"
5405 AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
5406 AC_MSG_RESULT([Apple Java Framework])
5408 AC_MSG_RESULT([none found])
5415 AC_SUBST(jni_includes)
5417 # for backward compat
5418 kde_cv_java_includedir=$kde_java_includedir
5419 kde_cv_java_bindir=$kde_java_bindir
5422 dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
5423 dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
5424 dnl big packages, m4_foreach is dog-slow. So use our own version of
5425 dnl it. (matz@kde.org)
5426 m4_define([mm_foreach],
5427 [m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
5428 m4_define([mm_car], [[$1]])
5429 m4_define([mm_car2], [[$@]])
5430 m4_define([_mm_foreach],
5431 [m4_if(m4_quote($2), [], [],
5432 [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
5433 mm_car2(m4_shift($2)),
5435 m4_define([AC_FOREACH],
5436 [mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
5438 AC_DEFUN([KDE_NEED_FLEX],
5441 LIBS="$LIBS $USER_LDFLAGS"
5444 if test -z "$LEXLIB"; then
5445 AC_MSG_ERROR([You need to have flex installed.])
5450 AC_DEFUN([AC_PATH_QTOPIA],
5452 dnl TODO: use AC_CACHE_VAL
5454 if test -z "$1"; then
5459 qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
5460 qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
5461 qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
5464 qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
5465 qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
5467 AC_REQUIRE([AC_PATH_QT])
5469 AC_MSG_CHECKING([for Qtopia])
5472 AC_SUBST(LIB_QTOPIA)
5474 kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
5478 AC_ARG_WITH(qtopia-dir,
5479 AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]),
5480 [ ac_qtopia_incdir="$withval"/include] )
5483 for dir in $kde_qtopia_dirs; do
5484 qtopia_incdirs="$qtopia_incdirs $dir/include"
5487 if test ! "$ac_qtopia_incdir" = "NO"; then
5488 qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
5492 AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
5493 ac_qtopia_incdir="$qtopia_incdir"
5495 if test -z "$qtopia_incdir"; then
5496 AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
5499 qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
5500 qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
5501 qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
5503 qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
5504 qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
5505 if test "$qtopia_ver" -lt "$qtopia_minver"; then
5506 AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
5513 ac_cxxflags_safe="$CXXFLAGS"
5514 ac_ldflags_safe="$LDFLAGS"
5515 ac_libs_safe="$LIBS"
5517 CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
5518 LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
5519 LIBS="$LIBS $LIB_QTOPIA $LIBQT"
5521 cat > conftest.$ac_ext <<EOF
5522 #include "confdefs.h"
5523 #include <qpe/qpeapplication.h>
5524 #include <qpe/version.h>
5526 int main( int argc, char **argv )
5528 QPEApplication app( argc, argv );
5533 if AC_TRY_EVAL(ac_link) && test -s conftest; then
5537 AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
5538 the end of config.log])
5541 CXXFLAGS="$ac_cxxflags_safe"
5542 LDFLAGS="$ac_ldflags_safe"
5543 LIBS="$ac_libs_safe"
5547 QTOPIA_INCLUDES="-I$qtopia_incdir"
5548 AC_SUBST(QTOPIA_INCLUDES)
5550 AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
5554 AC_DEFUN([KDE_INIT_DOXYGEN],
5556 AC_MSG_CHECKING([for Qt docs])
5558 if test "${with_qt_dir+set}" = set; then
5559 kde_qtdir="$with_qt_dir"
5562 AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
5563 AC_MSG_RESULT($QTDOCDIR)
5567 KDE_FIND_PATH(dot, DOT, [], [])
5568 if test -n "$DOT"; then
5573 AC_SUBST(KDE_HAVE_DOT)
5574 KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
5577 DOXYGEN_PROJECT_NAME="$1"
5578 DOXYGEN_PROJECT_NUMBER="$2"
5579 AC_SUBST(DOXYGEN_PROJECT_NAME)
5580 AC_SUBST(DOXYGEN_PROJECT_NUMBER)
5583 if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
5586 AC_SUBST(KDE_HAS_DOXYGEN)
5591 AC_DEFUN([AC_FIND_BZIP2],
5593 AC_MSG_CHECKING([for bzDecompress in libbz2])
5594 AC_CACHE_VAL(ac_cv_lib_bzip2,
5598 kde_save_LIBS="$LIBS"
5599 LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
5600 kde_save_CXXFLAGS="$CXXFLAGS"
5601 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
5607 [ bz_stream s; (void) bzDecompress(&s); ],
5608 eval "ac_cv_lib_bzip2='-lbz2'",
5609 eval "ac_cv_lib_bzip2=no")
5610 LIBS="$kde_save_LIBS"
5611 CXXFLAGS="$kde_save_CXXFLAGS"
5614 AC_MSG_RESULT($ac_cv_lib_bzip2)
5616 if test ! "$ac_cv_lib_bzip2" = no; then
5619 LIBBZ2="$ac_cv_lib_bzip2"
5626 KDE_CHECK_COMPILER_FLAG(shared, [
5627 ld_shared_flag="-shared"
5629 KDE_CHECK_COMPILER_FLAG(fPIC, [
5630 cxx_shared_flag="-fPIC"
5633 AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
5634 AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
5638 kde_save_LIBS="$LIBS"
5639 LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
5640 kde_save_CXXFLAGS="$CXXFLAGS"
5641 CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
5648 [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
5649 eval "ac_cv_lib_bzip2_prefix='-lbz2'",
5650 eval "ac_cv_lib_bzip2_prefix=no")
5651 LIBS="$kde_save_LIBS"
5652 CXXFLAGS="$kde_save_CXXFLAGS"
5656 AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
5658 if test ! "$ac_cv_lib_bzip2_prefix" = no; then
5661 LIBBZ2="$ac_cv_lib_bzip2_prefix"
5664 AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
5665 dnl else, we just ignore this
5669 AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
5672 dnl ------------------------------------------------------------------------
5673 dnl Try to find the SSL headers and libraries.
5674 dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
5675 dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
5676 dnl ------------------------------------------------------------------------
5678 AC_DEFUN([KDE_CHECK_SSL],
5680 LIBSSL="-lssl -lcrypto"
5681 AC_REQUIRE([KDE_CHECK_LIB64])
5683 ac_ssl_includes=NO ac_ssl_libraries=NO
5686 AC_ARG_WITH(ssl-dir,
5687 AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
5688 [ ac_ssl_includes="$withval"/include
5689 ac_ssl_libraries="$withval"/lib$kdelibsuff
5694 AC_HELP_STRING([--without-ssl],[disable SSL checks]),
5695 [want_ssl=$withval])
5697 if test $want_ssl = yes; then
5699 AC_MSG_CHECKING(for OpenSSL)
5701 AC_CACHE_VAL(ac_cv_have_ssl,
5702 [#try to guess OpenSSL locations
5704 ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
5705 ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
5706 AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
5707 ac_ssl_includes="$ssl_incdir"
5709 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"
5710 if test ! "$ac_ssl_libraries" = "NO"; then
5711 ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
5716 for dir in $ssl_libdirs; do
5717 try="ls -1 $dir/libssl*"
5718 if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
5721 ac_ssl_libraries="$ssl_libdir"
5723 ac_ldflags_safe="$LDFLAGS"
5724 ac_libs_safe="$LIBS"
5726 LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
5727 LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
5729 AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
5735 LDFLAGS="$ac_ldflags_safe"
5736 LIBS="$ac_libs_safe"
5738 if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
5746 eval "$ac_cv_have_ssl"
5748 AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
5750 AC_MSG_CHECKING([whether OpenSSL uses rsaref])
5751 AC_MSG_RESULT($ac_ssl_rsaref)
5753 AC_MSG_CHECKING([for easter eggs])
5754 AC_MSG_RESULT([none found])
5760 if test "$have_ssl" = yes; then
5761 AC_MSG_CHECKING(for OpenSSL version)
5762 dnl Check for SSL version
5763 AC_CACHE_VAL(ac_cv_ssl_version,
5766 cat >conftest.$ac_ext <<EOF
5767 #include <openssl/opensslv.h>
5771 #ifndef OPENSSL_VERSION_NUMBER
5772 printf("ssl_version=\\"error\\"\n");
5774 if (OPENSSL_VERSION_NUMBER < 0x00906000)
5775 printf("ssl_version=\\"old\\"\n");
5777 printf("ssl_version=\\"ok\\"\n");
5783 ac_save_CPPFLAGS=$CPPFLAGS
5784 if test "$ac_ssl_includes" != "/usr/include"; then
5785 CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
5788 if AC_TRY_EVAL(ac_link); then
5790 if eval `./conftest 2>&5`; then
5791 if test $ssl_version = error; then
5792 AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
5794 if test $ssl_version = old; then
5795 AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
5799 ac_cv_ssl_version="ssl_version=$ssl_version"
5801 AC_MSG_ERROR([Your system couldn't run a small SSL test program.
5802 Check config.log, and if you can't figure it out, send a mail to
5803 David Faure <faure@kde.org>, attaching your config.log])
5807 AC_MSG_ERROR([Your system couldn't link a small SSL test program.
5808 Check config.log, and if you can't figure it out, send a mail to
5809 David Faure <faure@kde.org>, attaching your config.log])
5811 CPPFLAGS=$ac_save_CPPFLAGS
5815 eval "$ac_cv_ssl_version"
5816 AC_MSG_RESULT($ssl_version)
5819 if test "$have_ssl" != yes; then
5822 AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
5823 ac_cv_have_ssl="have_ssl=yes \
5824 ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
5827 ssl_libraries="$ac_ssl_libraries"
5828 ssl_includes="$ac_ssl_includes"
5830 if test "$ac_ssl_rsaref" = yes; then
5831 LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref"
5834 if test $ssl_version = "old"; then
5835 AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
5841 if test "$ssl_includes" = "/usr/include"; then
5842 if test -f /usr/kerberos/include/krb5.h; then
5843 SSL_INCLUDES="-I/usr/kerberos/include"
5845 elif test "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
5846 SSL_INCLUDES="-I$ssl_includes"
5849 if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
5852 SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
5855 AC_SUBST(SSL_INCLUDES)
5856 AC_SUBST(SSL_LDFLAGS)
5860 AC_DEFUN([KDE_CHECK_STRLCPY],
5862 AC_REQUIRE([AC_CHECK_STRLCAT])
5863 AC_REQUIRE([AC_CHECK_STRLCPY])
5864 AC_CHECK_SIZEOF(size_t)
5865 AC_CHECK_SIZEOF(unsigned long)
5867 AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
5869 #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
5872 ],AC_MSG_RESULT([yes]),[
5875 Apparently on your system our assumption sizeof size_t == sizeof unsigned long
5876 does not apply. Please mail kde-devel@kde.org with a description of your system!
5881 AC_DEFUN([KDE_CHECK_BINUTILS],
5883 AC_MSG_CHECKING([if ld supports unversioned version maps])
5885 kde_save_LDFLAGS="$LDFLAGS"
5886 LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
5887 echo "{ local: extern \"C++\" { foo }; };" > conftest.map
5888 AC_TRY_LINK([int foo;],
5890 #ifdef __INTEL_COMPILER
5891 icc apparently does not support libtools version-info and version-script
5892 at the same time. Dunno where the bug is, but until somebody figured out,
5893 better disable the optional version scripts.
5897 ], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
5898 LDFLAGS="$kde_save_LDFLAGS"
5900 AM_CONDITIONAL(include_VERSION_SCRIPT,
5901 [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
5903 AC_MSG_RESULT($kde_supports_versionmaps)
5906 AC_DEFUN([AM_PROG_OBJC],[
5907 AC_CHECK_PROGS(OBJC, gcc, gcc)
5908 test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
5909 if test "x${OBJCFLAGS-unset}" = xunset; then
5913 _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
5916 AC_DEFUN([KDE_CHECK_PERL],
5918 KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
5919 AC_MSG_ERROR([No Perl found in your $PATH.
5920 We need perl to generate some code.])
5925 AC_DEFUN([KDE_CHECK_LARGEFILE],
5928 if test "$ac_cv_sys_file_offset_bits" != no; then
5929 CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
5932 if test "x$ac_cv_sys_large_files" != "xno"; then
5933 CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
5938 dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
5939 dnl which allows to search for libs that get installed into the KDE prefix.
5941 dnl Syntax: KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
5942 dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
5943 dnl also defines KSTUFF_PKG_ERRORS on error
5944 AC_DEFUN([KDE_PKG_CHECK_MODULES], [
5946 PKG_CONFIG_PATH="$prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
5947 if test "$prefix" != "$kde_libs_prefix"; then
5948 PKG_CONFIG_PATH="$kde_libs_prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
5950 export PKG_CONFIG_PATH
5951 PKG_CHECK_MODULES([$1],[$2],[$3],[$4])
5955 dnl Check for PIE support in the compiler and linker
5956 AC_DEFUN([KDE_CHECK_PIE_SUPPORT],
5958 AC_CACHE_CHECK([for PIE support], kde_cv_val_pie_support,
5962 safe_CXXFLAGS=$CXXFLAGS
5963 safe_LDFLAGS=$LDFLAGS
5964 CXXFLAGS="$CXXFLAGS -fPIE"
5965 LDFLAGS="$LDFLAGS -pie"
5967 AC_TRY_LINK([int foo;], [], [kde_cv_val_pie_support=yes], [kde_cv_val_pie_support=no])
5969 CXXFLAGS=$safe_CXXFLAGS
5970 LDFLAGS=$safe_LDFLAGS
5974 AC_MSG_CHECKING(if enabling -pie/fPIE support)
5977 AC_HELP_STRING([--enable-pie],[platform supports PIE linking [default=detect]]),
5978 [kde_has_pie_support=$enableval],
5979 [kde_has_pie_support=detect])
5981 if test "$kde_has_pie_support" = "detect"; then
5982 kde_has_pie_support=$kde_cv_val_pie_support
5985 AC_MSG_RESULT([$kde_has_pie_support])
5990 AC_SUBST([KDE_USE_FPIE])
5991 AC_SUBST([KDE_USE_PIE])
5993 if test "$kde_has_pie_support" = "yes"; then
5994 KDE_USE_FPIE="-fPIE"