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., 59 Temple Place - Suite 330,
20 dnl Boston, MA 02111-1307, 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(, [${x_direct_test_function}()],
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(programm-name, variable-name, list of directories,
177 dnl if-not-found, test-parameter)
178 AC_DEFUN([KDE_FIND_PATH],
180 AC_MSG_CHECKING([for $1])
181 if test -n "$$2"; then
184 kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
186 AC_CACHE_VAL(kde_cv_path_$kde_cache,
198 if test -x "$dir/$1"; then
201 evalstr="$dir/$1 $5 2>&1 "
202 if eval $evalstr; then
203 kde_cv_path="$dir/$1"
207 kde_cv_path="$dir/$1"
213 eval "kde_cv_path_$kde_cache=$kde_cv_path"
217 eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
221 if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
222 AC_MSG_RESULT(not found)
225 AC_MSG_RESULT($kde_cv_path)
231 AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
233 AC_MSG_ERROR([No Qt meta object compiler (moc) found!
234 Please check whether you installed Qt correctly.
235 You need to have a running moc binary.
236 configure tried to run $ac_cv_path_moc and the test didn't
237 succeed. If configure shouldn't have tried this one, set
238 the environment variable MOC to the right one before running
243 AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
245 AC_MSG_WARN([No Qt ui compiler (uic) found!
246 Please check whether you installed Qt correctly.
247 You need to have a running uic binary.
248 configure tried to run $ac_cv_path_uic and the test didn't
249 succeed. If configure shouldn't have tried this one, set
250 the environment variable UIC to the right one before running
256 AC_DEFUN([KDE_CHECK_UIC_FLAG],
258 AC_MSG_CHECKING([whether uic supports -$1 ])
259 kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
260 AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
262 cat >conftest.ui <<EOT
263 <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
265 ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
266 if AC_TRY_EVAL(ac_uic_testrun); then
267 eval "kde_cv_prog_uic_$kde_cache=yes"
269 eval "kde_cv_prog_uic_$kde_cache=no"
274 if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
286 dnl ------------------------------------------------------------------------
287 dnl Find the meta object compiler and the ui compiler in the PATH,
288 dnl in $QTDIR/bin, and some more usual places
289 dnl ------------------------------------------------------------------------
291 AC_DEFUN([AC_PATH_QT_MOC_UIC],
293 AC_REQUIRE([KDE_CHECK_PERL])
295 for dir in $kde_qt_dirs; do
296 qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
298 qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
299 if test ! "$ac_qt_bindir" = "NO"; then
300 qt_bindirs="$ac_qt_bindir $qt_bindirs"
303 KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
304 if test -z "$UIC_NOT_NEEDED"; then
305 KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
306 if test -z "$UIC_PATH" ; then
307 KDE_UIC_ERROR_MESSAGE
312 if test $kde_qtver = 3; then
313 KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
314 KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
316 if test x$ac_uic_supports_libpath = xyes; then
317 UIC="$UIC -L \$(kde_widgetdir)"
319 if test x$ac_uic_supports_nounload = xyes; then
325 UIC="echo uic not available: "
332 if test $kde_qtver = 3; then
339 AC_DEFUN([KDE_1_CHECK_PATHS],
341 KDE_1_CHECK_PATH_HEADERS
345 if test -n "$USE_RPATH"; then
347 if test -n "$kde_libraries"; then
348 KDE_TEST_RPATH="-R $kde_libraries"
351 if test -n "$qt_libraries"; then
352 KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
355 if test -n "$x_libraries"; then
356 KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
359 KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
362 AC_MSG_CHECKING([for KDE libraries installed])
363 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'
365 if AC_TRY_EVAL(ac_link) && test -s conftest; then
368 AC_MSG_ERROR([your system fails at linking a small KDE application!
369 Check, if your compiler is installed correctly and if you have used the
370 same compiler to compile Qt and kdelibs as you did use now.
371 For more details about this problem, look at the end of config.log.])
374 if eval `KDEDIR= ./conftest 2>&5`; then
380 KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
381 kde_have_all_paths=yes
383 KDE_SET_PATHS($kde_result)
387 AC_DEFUN([KDE_SET_PATHS],
389 kde_cv_all_paths="kde_have_all_paths=\"yes\" \
390 kde_htmldir=\"$kde_htmldir\" \
391 kde_appsdir=\"$kde_appsdir\" \
392 kde_icondir=\"$kde_icondir\" \
393 kde_sounddir=\"$kde_sounddir\" \
394 kde_datadir=\"$kde_datadir\" \
395 kde_locale=\"$kde_locale\" \
396 kde_cgidir=\"$kde_cgidir\" \
397 kde_confdir=\"$kde_confdir\" \
398 kde_kcfgdir=\"$kde_kcfgdir\" \
399 kde_mimedir=\"$kde_mimedir\" \
400 kde_toolbardir=\"$kde_toolbardir\" \
401 kde_wallpaperdir=\"$kde_wallpaperdir\" \
402 kde_templatesdir=\"$kde_templatesdir\" \
403 kde_bindir=\"$kde_bindir\" \
404 kde_servicesdir=\"$kde_servicesdir\" \
405 kde_servicetypesdir=\"$kde_servicetypesdir\" \
406 kde_moduledir=\"$kde_moduledir\" \
407 kde_styledir=\"$kde_styledir\" \
408 kde_widgetdir=\"$kde_widgetdir\" \
409 xdg_appsdir=\"$xdg_appsdir\" \
410 xdg_menudir=\"$xdg_menudir\" \
411 xdg_directorydir=\"$xdg_directorydir\" \
415 AC_DEFUN([KDE_SET_DEFAULT_PATHS],
417 if test "$1" = "default"; then
419 if test -z "$kde_htmldir"; then
420 kde_htmldir='\${datadir}/doc/HTML'
422 if test -z "$kde_appsdir"; then
423 kde_appsdir='\${datadir}/applnk'
425 if test -z "$kde_icondir"; then
426 kde_icondir='\${datadir}/icons'
428 if test -z "$kde_sounddir"; then
429 kde_sounddir='\${datadir}/sounds'
431 if test -z "$kde_datadir"; then
432 kde_datadir='\${datadir}/apps'
434 if test -z "$kde_locale"; then
435 kde_locale='\${datadir}/locale'
437 if test -z "$kde_cgidir"; then
438 kde_cgidir='\${exec_prefix}/cgi-bin'
440 if test -z "$kde_confdir"; then
441 kde_confdir='\${datadir}/config'
443 if test -z "$kde_kcfgdir"; then
444 kde_kcfgdir='\${datadir}/config.kcfg'
446 if test -z "$kde_mimedir"; then
447 kde_mimedir='\${datadir}/mimelnk'
449 if test -z "$kde_toolbardir"; then
450 kde_toolbardir='\${datadir}/toolbar'
452 if test -z "$kde_wallpaperdir"; then
453 kde_wallpaperdir='\${datadir}/wallpapers'
455 if test -z "$kde_templatesdir"; then
456 kde_templatesdir='\${datadir}/templates'
458 if test -z "$kde_bindir"; then
459 kde_bindir='\${exec_prefix}/bin'
461 if test -z "$kde_servicesdir"; then
462 kde_servicesdir='\${datadir}/services'
464 if test -z "$kde_servicetypesdir"; then
465 kde_servicetypesdir='\${datadir}/servicetypes'
467 if test -z "$kde_moduledir"; then
468 if test "$kde_qtver" = "2"; then
469 kde_moduledir='\${libdir}/kde2'
471 kde_moduledir='\${libdir}/kde3'
474 if test -z "$kde_styledir"; then
475 kde_styledir='\${libdir}/kde3/plugins/styles'
477 if test -z "$kde_widgetdir"; then
478 kde_widgetdir='\${libdir}/kde3/plugins/designer'
480 if test -z "$xdg_appsdir"; then
481 xdg_appsdir='\${datadir}/applications/kde'
483 if test -z "$xdg_menudir"; then
484 xdg_menudir='\${sysconfdir}/xdg/menus'
486 if test -z "$xdg_directorydir"; then
487 xdg_directorydir='\${datadir}/desktop-directories'
490 KDE_SET_PATHS(defaults)
494 if test $kde_qtver = 1; then
495 AC_MSG_RESULT([compiling])
498 AC_MSG_ERROR([path checking not yet supported for KDE 2])
504 AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
505 [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
506 test -z "$kde_icondir" || test -z "$kde_sounddir" ||
507 test -z "$kde_datadir" || test -z "$kde_locale" ||
508 test -z "$kde_cgidir" || test -z "$kde_confdir" ||
509 test -z "$kde_kcfgdir" ||
510 test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
511 test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
512 test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
513 test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
514 test -z "$kde_styledir" || test -z "kde_widgetdir" ||
515 test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
516 test "x$kde_have_all_paths" != "xyes"; then
517 kde_have_all_paths=no
521 AC_DEFUN([KDE_MISSING_PROG_ERROR],
523 AC_MSG_ERROR([The important program $1 was not found!
524 Please check whether you installed KDE correctly.
528 AC_DEFUN([KDE_MISSING_ARTS_ERROR],
530 AC_MSG_ERROR([The important program $1 was not found!
531 Please check whether you installed aRts correctly or use
532 --without-arts to compile without aRts support (this will remove functionality).
536 AC_DEFUN([KDE_SUBST_PROGRAMS],
539 [ --without-arts build without aRts [default=yes] ],
540 [build_arts=$withval],
543 AM_CONDITIONAL(include_ARTS, test "$build_arts" != "no")
545 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"
546 test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
547 if test -n "$KDEDIRS"; then
550 for dir in $KDEDIRS; do
551 kde_default_bindirs="$dir/bin $kde_default_bindirs "
555 kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
556 KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
557 KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
558 if test "$build_arts" != "no"; then
559 KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
560 KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
562 KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs])
563 KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
566 if test "$kde_qtver" -lt 3; then
569 if test "$kde_qtver" = "3" && test "$kde_qtsubver" -le 1; then
574 if test -n "$kde32ornewer"; then
575 KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)])
576 KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
578 KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [XMLLINT=""])
580 if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then
581 kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
582 test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
583 AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
584 if test "$KDE_XSL_STYLESHEET" = "NO"; then
585 KDE_XSL_STYLESHEET=""
587 KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
591 DCOP_DEPENDENCIES='$(DCOPIDL)'
592 if test -n "$kde32ornewer"; then
593 KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
594 DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
595 AC_SUBST(KCONFIG_COMPILER)
596 AC_SUBST(KCFG_DEPENDENCIES)
600 AC_SUBST(DCOPIDL2CPP)
601 AC_SUBST(DCOP_DEPENDENCIES)
603 AC_SUBST(ARTSCCONFIG)
606 AC_SUBST(KDE_XSL_STYLESHEET)
609 if test -x "$KDECONFIG"; then # it can be "compiled"
610 kde_libs_prefix=`$KDECONFIG --prefix`
611 if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
612 AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
613 This means it has been moved since you installed it.
614 This won't work. Please recompile kdelibs for the new prefix.
617 kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
619 kde_libs_prefix='$(prefix)'
620 kde_libs_htmldir='$(kde_htmldir)'
622 AC_SUBST(kde_libs_prefix)
623 AC_SUBST(kde_libs_htmldir)
626 AC_DEFUN([AC_CREATE_KFSSTND],
628 AC_REQUIRE([AC_CHECK_RPATH])
630 AC_MSG_CHECKING([for KDE paths])
633 AC_CACHE_VAL(kde_cv_all_paths,
635 KDE_SET_DEFAULT_PATHS($1)
638 eval "$kde_cv_all_paths"
639 KDE_CHECK_PATHS_FOR_COMPLETENESS
640 if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
641 # wrong values were cached, may be, we can set better ones
643 kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
644 kde_datadir= kde_locale= kde_cgidir= kde_confdir= kde_kcfgdir=
645 kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
646 kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
650 xdg_appsdir = xdg_menudir= xdg_directorydir=
651 KDE_SET_DEFAULT_PATHS($1)
652 eval "$kde_cv_all_paths"
653 KDE_CHECK_PATHS_FOR_COMPLETENESS
654 kde_result="$kde_result (cache overridden)"
656 if test "$kde_have_all_paths" = "no"; then
657 AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
658 Since it had compiled and linked before, it must be a strange problem on your system.
659 Look at config.log for details. If you are not able to fix this, look at
660 http://www.kde.org/faq/installation.html or any www.kde.org mirror.
661 (If you're using an egcs version on Linux, you may update binutils!)
665 AC_MSG_RESULT($kde_result)
674 AC_DEFUN([AC_SUBST_KFSSTND],
676 AC_SUBST(kde_htmldir)
677 AC_SUBST(kde_appsdir)
678 AC_SUBST(kde_icondir)
679 AC_SUBST(kde_sounddir)
680 AC_SUBST(kde_datadir)
682 AC_SUBST(kde_confdir)
683 AC_SUBST(kde_kcfgdir)
684 AC_SUBST(kde_mimedir)
685 AC_SUBST(kde_wallpaperdir)
687 dnl X Desktop Group standards
688 AC_SUBST(xdg_appsdir)
689 AC_SUBST(xdg_menudir)
690 AC_SUBST(xdg_directorydir)
692 AC_SUBST(kde_templatesdir)
693 AC_SUBST(kde_servicesdir)
694 AC_SUBST(kde_servicetypesdir)
695 AC_SUBST(kde_moduledir)
696 AC_SUBST(kdeinitdir, '$(kde_moduledir)')
697 AC_SUBST(kde_styledir)
698 AC_SUBST(kde_widgetdir)
699 if test "$kde_qtver" = 1; then
700 kde_minidir="$kde_icondir/mini"
702 # for KDE 1 - this breaks KDE2 apps using minidir, but
703 # that's the plan ;-/
704 kde_minidir="/dev/null"
706 dnl AC_SUBST(kde_minidir)
707 dnl AC_SUBST(kde_cgidir)
708 dnl AC_SUBST(kde_toolbardir)
711 AC_DEFUN([KDE_MISC_TESTS],
713 dnl Checks for libraries.
714 AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
716 AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
719 AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
720 AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
721 AC_MSG_WARN([you have no crypt in either libcrypt or libc.
722 You should install libcrypt from another source or configure with PAM
727 if test $kde_have_crypt = yes; then
728 AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
731 AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
732 if test $ac_cv_lib_dnet_dnet_ntoa = no; then
733 AC_CHECK_LIB(dnet_stub, dnet_ntoa,
734 [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
736 AC_CHECK_FUNC(inet_ntoa)
737 if test $ac_cv_func_inet_ntoa = no; then
738 AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
740 AC_CHECK_FUNC(connect)
741 if test $ac_cv_func_connect = no; then
742 AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
746 AC_CHECK_FUNC(remove)
747 if test $ac_cv_func_remove = no; then
748 AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
751 # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
752 AC_CHECK_FUNC(shmat, ,
753 AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
755 # more headers that need to be explicitly included on darwin
756 AC_CHECK_HEADERS(sys/types.h stdint.h)
758 # darwin requires a poll emulation library
759 AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
761 # CoreAudio framework
762 AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
763 AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
764 FRAMEWORK_COREAUDIO="-Xlinker -framework -Xlinker CoreAudio"
769 AC_SUBST(FRAMEWORK_COREAUDIO)
770 LIBSOCKET="$X_EXTRA_LIBS"
772 AC_SUBST(X_EXTRA_LIBS)
773 AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
776 case $host in dnl this *is* LynxOS specific
778 AC_MSG_CHECKING([LynxOS header file wrappers])
779 [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
780 AC_MSG_RESULT(disabled)
781 AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
789 # darwin needs this to initialize the environment
790 AC_CHECK_HEADERS(crt_externs.h)
791 AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
793 AH_VERBATIM(_DARWIN_ENVIRON,
795 #if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
796 # include <sys/time.h>
797 # include <crt_externs.h>
798 # define environ (*_NSGetEnviron())
802 AH_VERBATIM(_AIX_STRINGS_H_BZERO,
805 * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
806 * that defines bzero.
814 AC_CHECK_FUNCS([vsnprintf snprintf])
818 * On HP-UX, the declaration of vsnprintf() is needed every time !
821 #if !defined(HAVE_VSNPRINTF) || defined(hpux)
831 int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
835 int snprintf(char *str, size_t n, char const *fmt, ...);
841 dnl ------------------------------------------------------------------------
842 dnl Find the header files and libraries for X-Windows. Extended the
844 dnl ------------------------------------------------------------------------
848 AC_REQUIRE([KDE_MISC_TESTS])dnl
849 AC_REQUIRE([KDE_CHECK_LIB64])
853 [ --enable-embedded link to Qt-embedded, don't use X],
854 kde_use_qt_emb=$enableval,
860 [ --enable-qtopia link to Qt-embedded, link to the Qtopia Environment],
861 kde_use_qt_emb_palm=$enableval,
862 kde_use_qt_emb_palm=no
867 [ --enable-mac link to Qt/Mac (don't use X)],
868 kde_use_qt_mac=$enableval,
872 if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
874 AC_MSG_CHECKING(for X)
876 AC_CACHE_VAL(kde_cv_have_x,
877 [# One or both of the vars are not set, and there is no cached value.
878 if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
881 kde_x_includes=$x_includes
883 if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
886 kde_x_libraries=$x_libraries
889 # below we use the standard autoconf calls
890 ac_x_libraries=$kde_x_libraries
891 ac_x_includes=$kde_x_includes
894 dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
895 dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
896 dnl location. The correct location is /usr/lib32 or an undefined value
897 dnl (the linker is smart enough to pick the correct default library).
898 dnl Things work just fine if you use just AC_PATH_X_DIRECT.
899 dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
900 dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
901 dnl x_includes should be left alone.
909 if test -z "$ac_x_includes"; then
912 if test -z "$ac_x_libraries"; then
913 ac_x_libraries="/usr/lib${kdelibsuff}"
916 #from now on we use our own again
918 # when the user already gave --x-includes, we ignore
919 # what the standard autoconf macros told us.
920 if test "$kde_x_includes" = NO; then
921 kde_x_includes=$ac_x_includes
924 # for --x-libraries too
925 if test "$kde_x_libraries" = NO; then
926 kde_x_libraries=$ac_x_libraries
929 if test "$kde_x_includes" = NO; then
930 AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
933 if test "$kde_x_libraries" = NO; then
934 AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
937 # Record where we found X for the cache.
938 kde_cv_have_x="have_x=yes \
939 kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
942 eval "$kde_cv_have_x"
944 if test "$have_x" != yes; then
945 AC_MSG_RESULT($have_x)
948 AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
951 if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
953 x_includes="."; dnl better than nothing :-
955 x_includes=$kde_x_includes
956 X_INCLUDES="-I$x_includes"
959 if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
961 x_libraries="/usr/lib"; dnl better than nothing :-
963 x_libraries=$kde_x_libraries
964 X_LDFLAGS="-L$x_libraries"
966 all_includes="$X_INCLUDES"
967 all_libraries="$X_LDFLAGS"
969 # Check for libraries that X11R6 Xt/Xaw programs need.
970 ac_save_LDFLAGS="$LDFLAGS"
971 LDFLAGS="$LDFLAGS $X_LDFLAGS"
972 # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
973 # check for ICE first), but we must link in the order -lSM -lICE or
974 # we get undefined symbols. So assume we have SM if we have ICE.
975 # These have to be linked with before -lX11, unlike the other
976 # libraries we check for below, so use a different variable.
977 # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
978 AC_CHECK_LIB(ICE, IceConnectionNumber,
979 [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
980 LDFLAGS="$ac_save_LDFLAGS"
982 LIB_X11='-lX11 $(LIBSOCKET)'
984 AC_MSG_CHECKING(for libXext)
985 AC_CACHE_VAL(kde_cv_have_libXext,
987 kde_ldflags_safe="$LDFLAGS"
988 kde_libs_safe="$LIBS"
990 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
991 LIBS="-lXext -lX11 $LIBSOCKET"
1000 printf("hello Xext\n");
1002 kde_cv_have_libXext=yes,
1003 kde_cv_have_libXext=no
1006 LDFLAGS=$kde_ldflags_safe
1010 AC_MSG_RESULT($kde_cv_have_libXext)
1012 if test "$kde_cv_have_libXext" = "no"; then
1013 AC_MSG_ERROR([We need a working libXext to proceed. Since configure
1014 can't find it itself, we stop here assuming that make wouldn't find
1021 elif test "$kde_use_qt_emb" = "yes"; then
1022 dnl We're using QT Embedded
1024 CXXFLAGS="$CXXFLAGS -fno-rtti"
1025 QTE_NORTTI="-fno-rtti -DQWS"
1035 elif test "$kde_use_qt_mac" = "yes"; then
1036 dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
1037 dnl be included to get the information) --Sam
1038 CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
1039 CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
1050 AC_SUBST(X_PRE_LIBS)
1052 AC_SUBST(LIB_XRENDER)
1054 AC_SUBST(X_INCLUDES)
1056 AC_SUBST(x_includes)
1057 AC_SUBST(x_libraries)
1058 AC_SUBST(QTE_NORTTI)
1063 AC_DEFUN([KDE_PRINT_QT_PROGRAM],
1065 AC_REQUIRE([KDE_USE_QT])
1066 cat > conftest.$ac_ext <<EOF
1067 #include "confdefs.h"
1068 #include <qglobal.h>
1069 #include <qapplication.h>
1071 if test "$kde_qtver" = "2"; then
1072 cat >> conftest.$ac_ext <<EOF
1074 #include <qstring.h>
1078 if test $kde_qtsubver -gt 0; then
1079 cat >> conftest.$ac_ext <<EOF
1080 #if QT_VERSION < 210
1087 if test "$kde_qtver" = "3"; then
1088 cat >> conftest.$ac_ext <<EOF
1089 #include <qcursor.h>
1090 #include <qstylefactory.h>
1091 #include <private/qucomextra_p.h>
1095 echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
1096 cat >> conftest.$ac_ext <<EOF
1102 if test "$kde_qtver" = "2"; then
1103 cat >> conftest.$ac_ext <<EOF
1104 QStringList *t = new QStringList();
1107 if test $kde_qtsubver -gt 0; then
1108 cat >> conftest.$ac_ext <<EOF
1110 s.setLatin1("Elvis is alive", 14);
1114 if test "$kde_qtver" = "3"; then
1115 cat >> conftest.$ac_ext <<EOF
1116 (void)QStyleFactory::create(QString::null);
1117 QCursor c(Qt::WhatsThisCursor);
1120 cat >> conftest.$ac_ext <<EOF
1126 AC_DEFUN([KDE_USE_QT],
1128 if test -z "$1"; then
1129 # Current default Qt version: 3.2
1133 kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
1134 # following is the check if subversion isnt found in passed argument
1135 if test "$kde_qtsubver" = "$1"; then
1138 kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
1139 if test "$kde_qtver" = "1"; then
1144 if test -z "$2"; then
1145 if test "$kde_qtver" = "2"; then
1146 if test $kde_qtsubver -gt 0; then
1147 kde_qt_minversion=">= Qt 2.2.2"
1149 kde_qt_minversion=">= Qt 2.0.2"
1152 if test "$kde_qtver" = "3"; then
1153 if test $kde_qtsubver -gt 0; then
1154 if test $kde_qtsubver -gt 1; then
1155 kde_qt_minversion=">= Qt 3.2"
1157 kde_qt_minversion=">= Qt 3.1 (20021021)"
1160 kde_qt_minversion=">= Qt 3.0"
1163 if test "$kde_qtver" = "1"; then
1164 kde_qt_minversion=">= 1.42 and < 2.0"
1167 kde_qt_minversion=$2
1170 if test -z "$3"; then
1171 if test $kde_qtver = 3; then
1172 if test $kde_qtsubver -gt 0; then
1173 kde_qt_verstring="QT_VERSION >= 0x03@VER@00"
1174 qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
1175 kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
1177 kde_qt_verstring="QT_VERSION >= 300"
1180 if test $kde_qtver = 2; then
1181 if test $kde_qtsubver -gt 0; then
1182 kde_qt_verstring="QT_VERSION >= 222"
1184 kde_qt_verstring="QT_VERSION >= 200"
1187 if test $kde_qtver = 1; then
1188 kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
1194 if test $kde_qtver = 3; then
1195 kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3"
1197 if test $kde_qtver = 2; then
1198 kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
1200 if test $kde_qtver = 1; then
1201 kde_qt_dirs="$QTDIR /usr/lib/qt"
1205 AC_DEFUN([KDE_CHECK_QT_DIRECT],
1207 AC_REQUIRE([KDE_USE_QT])
1208 AC_MSG_CHECKING([if Qt compiles without flags])
1209 AC_CACHE_VAL(kde_cv_qt_direct,
1213 ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
1214 ac_LIBRARY_PATH="$LIBRARY_PATH"
1215 ac_cxxflags_safe="$CXXFLAGS"
1216 ac_ldflags_safe="$LDFLAGS"
1217 ac_libs_safe="$LIBS"
1219 CXXFLAGS="$CXXFLAGS -I$qt_includes"
1220 LDFLAGS="$LDFLAGS $X_LDFLAGS"
1221 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1222 LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
1224 LIBS="$LIBQT $LIBSOCKET"
1227 export LD_LIBRARY_PATH
1231 KDE_PRINT_QT_PROGRAM
1233 if AC_TRY_EVAL(ac_link) && test -s conftest; then
1234 kde_cv_qt_direct="yes"
1236 kde_cv_qt_direct="no"
1237 echo "configure: failed program was:" >&AC_FD_CC
1238 cat conftest.$ac_ext >&AC_FD_CC
1242 CXXFLAGS="$ac_cxxflags_safe"
1243 LDFLAGS="$ac_ldflags_safe"
1244 LIBS="$ac_libs_safe"
1246 LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
1247 export LD_LIBRARY_PATH
1248 LIBRARY_PATH="$ac_LIBRARY_PATH"
1253 if test "$kde_cv_qt_direct" = "yes"; then
1262 dnl ------------------------------------------------------------------------
1263 dnl Try to find the Qt headers and libraries.
1264 dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
1265 dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
1266 dnl ------------------------------------------------------------------------
1268 AC_DEFUN([AC_PATH_QT_1_3],
1270 AC_REQUIRE([K_PATH_X])
1271 AC_REQUIRE([KDE_USE_QT])
1272 AC_REQUIRE([KDE_CHECK_LIB64])
1274 dnl ------------------------------------------------------------------------
1275 dnl Add configure flag to enable linking to MT version of Qt library.
1276 dnl ------------------------------------------------------------------------
1280 [ --disable-mt link to non-threaded Qt (deprecated)],
1281 kde_use_qt_mt=$enableval,
1283 if test $kde_qtver = 3; then
1293 dnl ------------------------------------------------------------------------
1294 dnl If we not get --disable-qt-mt then adjust some vars for the host.
1295 dnl ------------------------------------------------------------------------
1299 if test "x$kde_use_qt_mt" = "xyes"; then
1301 if test "x$kde_use_threading" = "xyes"; then
1302 CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
1303 KDE_MT_LDFLAGS="$USE_THREADS"
1304 KDE_MT_LIBS="$LIBPTHREAD"
1309 AC_SUBST(KDE_MT_LDFLAGS)
1310 AC_SUBST(KDE_MT_LIBS)
1312 kde_qt_was_given=yes
1314 dnl ------------------------------------------------------------------------
1315 dnl If we haven't been told how to link to Qt, we work it out for ourselves.
1316 dnl ------------------------------------------------------------------------
1317 if test -z "$LIBQT_GLOB"; then
1318 if test "x$kde_use_qt_emb" = "xyes"; then
1319 LIBQT_GLOB="libqte.*"
1321 LIBQT_GLOB="libqt.*"
1325 if test -z "$LIBQT"; then
1326 dnl ------------------------------------------------------------
1327 dnl If we got --enable-embedded then adjust the Qt library name.
1328 dnl ------------------------------------------------------------
1329 if test "x$kde_use_qt_emb" = "xyes"; then
1335 kde_int_qt="-l$qtlib"
1341 if test -z "$LIBQPE"; then
1342 dnl ------------------------------------------------------------
1343 dnl If we got --enable-palmtop then add -lqpe to the link line
1344 dnl ------------------------------------------------------------
1345 if test "x$kde_use_qt_emb" = "xyes"; then
1346 if test "x$kde_use_qt_emb_palm" = "xyes"; then
1356 dnl ------------------------------------------------------------------------
1357 dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
1358 dnl ------------------------------------------------------------------------
1360 if test "x$kde_use_qt_mt" = "xyes"; then
1361 if test -z "$LIBQT"; then
1363 kde_int_qt="-l$qtlib-mt"
1366 kde_int_qt="$qtlib-mt"
1368 LIBQT_GLOB="lib$qtlib-mt.*"
1369 USING_QT_MT="using -mt"
1374 if test $kde_qtver != 1; then
1376 AC_REQUIRE([AC_FIND_PNG])
1377 AC_REQUIRE([AC_FIND_JPEG])
1378 LIBQT="$LIBQT $LIBPNG $LIBJPEG"
1381 if test $kde_qtver = 3; then
1382 AC_REQUIRE([KDE_CHECK_LIBDL])
1383 LIBQT="$LIBQT $LIBDL"
1386 AC_MSG_CHECKING([for Qt])
1388 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1389 LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
1391 ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
1395 [ --with-qt-dir=DIR where the root of Qt is installed ],
1396 [ ac_qt_includes="$withval"/include
1397 ac_qt_libraries="$withval"/lib${kdelibsuff}
1398 ac_qt_bindir="$withval"/bin
1401 AC_ARG_WITH(qt-includes,
1402 [ --with-qt-includes=DIR where the Qt includes are. ],
1404 ac_qt_includes="$withval"
1407 kde_qt_libs_given=no
1409 AC_ARG_WITH(qt-libraries,
1410 [ --with-qt-libraries=DIR where the Qt library is installed.],
1411 [ ac_qt_libraries="$withval"
1412 kde_qt_libs_given=yes
1415 AC_CACHE_VAL(ac_cv_have_qt,
1416 [#try to guess Qt locations
1419 for dir in $kde_qt_dirs; do
1420 qt_incdirs="$qt_incdirs $dir/include $dir"
1422 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"
1423 if test ! "$ac_qt_includes" = "NO"; then
1424 qt_incdirs="$ac_qt_includes $qt_incdirs"
1427 if test "$kde_qtver" != "1"; then
1428 kde_qt_header=qstyle.h
1430 kde_qt_header=qglobal.h
1433 AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
1434 ac_qt_includes="$qt_incdir"
1437 for dir in $kde_qt_dirs; do
1438 qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir"
1440 qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
1441 if test ! "$ac_qt_libraries" = "NO"; then
1442 qt_libdir=$ac_qt_libraries
1444 qt_libdirs="$ac_qt_libraries $qt_libdirs"
1445 # if the Qt was given, the chance is too big that libqt.* doesn't exist
1447 for dir in $qt_libdirs; do
1448 try="ls -1 $dir/${LIBQT_GLOB}"
1449 if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
1452 for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
1453 if test -e "$a"; then
1454 LIBQT="$LIBQT ${kde_int_qt}_incremental"
1459 ac_qt_libraries="$qt_libdir"
1464 ac_cxxflags_safe="$CXXFLAGS"
1465 ac_ldflags_safe="$LDFLAGS"
1466 ac_libs_safe="$LIBS"
1468 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
1469 LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
1470 LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
1472 KDE_PRINT_QT_PROGRAM
1474 if AC_TRY_EVAL(ac_link) && test -s conftest; then
1477 echo "configure: failed program was:" >&AC_FD_CC
1478 cat conftest.$ac_ext >&AC_FD_CC
1479 ac_qt_libraries="NO"
1482 CXXFLAGS="$ac_cxxflags_safe"
1483 LDFLAGS="$ac_ldflags_safe"
1484 LIBS="$ac_libs_safe"
1487 if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
1488 ac_cv_have_qt="have_qt=no"
1491 if test "$ac_qt_includes" = NO; then
1492 if test "$ac_qt_libraries" = NO; then
1493 ac_qt_notfound="(headers and libraries)";
1495 ac_qt_notfound="(headers)";
1498 if test "x$kde_use_qt_mt" = "xyes"; then
1500 Make sure that you have compiled Qt with thread support!"
1501 ac_qt_notfound="(library $qtlib-mt)";
1503 ac_qt_notfound="(library $qtlib)";
1507 AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
1508 For more details about this problem, look at the end of config.log.$missing_qt_mt])
1514 eval "$ac_cv_have_qt"
1516 if test "$have_qt" != yes; then
1517 AC_MSG_RESULT([$have_qt]);
1519 ac_cv_have_qt="have_qt=yes \
1520 ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
1521 AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
1523 qt_libraries="$ac_qt_libraries"
1524 qt_includes="$ac_qt_includes"
1527 if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
1528 KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
1531 AC_SUBST(qt_libraries)
1532 AC_SUBST(qt_includes)
1534 if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
1537 QT_INCLUDES="-I$qt_includes"
1538 all_includes="$QT_INCLUDES $all_includes"
1541 if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
1544 QT_LDFLAGS="-L$qt_libraries"
1545 all_libraries="$all_libraries $QT_LDFLAGS"
1547 test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
1549 AC_SUBST(QT_INCLUDES)
1550 AC_SUBST(QT_LDFLAGS)
1555 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
1556 LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
1558 LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
1560 test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
1561 for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
1562 if test -e "$a"; then
1563 LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
1574 AC_DEFUN([AC_PATH_QT],
1579 AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
1581 AC_REQUIRE([AC_PATH_QT_MOC_UIC])
1583 if test x$ac_uic_supports_libpath = xyes; then
1585 AC_MSG_CHECKING([if UIC has KDE plugins available])
1586 AC_CACHE_VAL(kde_cv_uic_plugins,
1588 cat > actest.ui << EOF
1589 <!DOCTYPE UI><UI version="3.0" stdsetdef="1">
1590 <class>NewConnectionDialog</class>
1591 <widget class="QDialog">
1592 <widget class="KLineEdit">
1593 <property name="name">
1594 <cstring>testInput</cstring>
1603 kde_cv_uic_plugins=no
1604 kde_line="$UIC_PATH -L $kde_widgetdir"
1605 if test x$ac_uic_supports_nounload = xyes; then
1606 kde_line="$kde_line -nounload"
1608 kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
1609 if AC_TRY_EVAL(kde_line); then
1610 # if you're trying to debug this check and think it's incorrect,
1611 # better check your installation. The check _is_ correct - your
1612 # installation is not.
1613 if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
1614 kde_cv_uic_plugins=yes
1617 rm -f actest.ui actest.cpp
1620 AC_MSG_RESULT([$kde_cv_uic_plugins])
1621 if test "$kde_cv_uic_plugins" != yes; then
1622 AC_MSG_ERROR([you need to install kdelibs first.])
1627 AC_DEFUN([KDE_CHECK_FINAL],
1629 AC_ARG_ENABLE(final, [ --enable-final build size optimized apps (experimental - needs lots of memory)],
1630 kde_use_final=$enableval, kde_use_final=no)
1632 if test "x$kde_use_final" = "xyes"; then
1633 KDE_USE_FINAL_TRUE=""
1634 KDE_USE_FINAL_FALSE="#"
1636 KDE_USE_FINAL_TRUE="#"
1637 KDE_USE_FINAL_FALSE=""
1639 AC_SUBST(KDE_USE_FINAL_TRUE)
1640 AC_SUBST(KDE_USE_FINAL_FALSE)
1643 AC_DEFUN([KDE_CHECK_CLOSURE],
1645 AC_ARG_ENABLE(closure, [ --enable-closure delay template instantiation],
1646 kde_use_closure=$enableval, kde_use_closure=no)
1649 if test "x$kde_use_closure" = "xyes"; then
1650 KDE_USE_CLOSURE_TRUE=""
1651 KDE_USE_CLOSURE_FALSE="#"
1652 # CXXFLAGS="$CXXFLAGS $REPO"
1654 KDE_USE_CLOSURE_TRUE="#"
1655 KDE_USE_CLOSURE_FALSE=""
1659 KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
1660 [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
1661 [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
1662 [KDE_NO_UNDEFINED=""])],
1663 [KDE_NO_UNDEFINED=""])
1667 AC_SUBST(KDE_USE_CLOSURE_TRUE)
1668 AC_SUBST(KDE_USE_CLOSURE_FALSE)
1669 AC_SUBST(KDE_NO_UNDEFINED)
1672 AC_DEFUN([KDE_CHECK_NMCHECK],
1674 AC_ARG_ENABLE(nmcheck, [ --enable-nmcheck enable automatic namespace cleanness check],
1675 kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
1677 if test "$kde_use_nmcheck" = "yes"; then
1678 KDE_USE_NMCHECK_TRUE=""
1679 KDE_USE_NMCHECK_FALSE="#"
1681 KDE_USE_NMCHECK_TRUE="#"
1682 KDE_USE_NMCHECK_FALSE=""
1684 AC_SUBST(KDE_USE_NMCHECK_TRUE)
1685 AC_SUBST(KDE_USE_NMCHECK_FALSE)
1688 AC_DEFUN([KDE_EXPAND_MAKEVAR], [
1690 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1692 while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
1696 dnl ------------------------------------------------------------------------
1697 dnl Now, the same with KDE
1698 dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
1699 dnl and $(kde_includes) will be the kdehdrlocation (if needed)
1700 dnl ------------------------------------------------------------------------
1702 AC_DEFUN([AC_BASE_PATH_KDE],
1704 AC_REQUIRE([KDE_CHECK_STL])
1705 AC_REQUIRE([AC_PATH_QT])dnl
1706 AC_REQUIRE([KDE_CHECK_LIB64])
1709 AC_MSG_CHECKING([for KDE])
1711 if test "${prefix}" != NONE; then
1712 kde_includes=${includedir}
1713 KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
1715 kde_libraries=${libdir}
1716 KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
1725 AC_CACHE_VAL(ac_cv_have_kde,
1726 [#try to guess kde locations
1728 if test "$kde_qtver" = 1; then
1729 kde_check_header="ksock.h"
1730 kde_check_lib="libkdecore.la"
1732 kde_check_header="ksharedptr.h"
1733 kde_check_lib="libkio.la"
1736 if test -z "$1"; then
1738 kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes"
1739 test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
1740 kde_incdirs="$ac_kde_includes $kde_incdirs"
1741 AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
1742 ac_kde_includes="$kde_incdir"
1744 if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
1746 in the prefix, you've chosen, are no KDE headers installed. This will fail.
1747 So, check this please and use another prefix!])
1750 kde_libdirs="/usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}"
1751 test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
1752 kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
1753 AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
1754 ac_kde_libraries="$kde_libdir"
1757 dnl this might be somewhere else
1758 AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
1760 if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
1762 in the prefix, you've chosen, are no KDE libraries installed. This will fail.
1763 So, check this please and use another prefix!])
1766 if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
1768 I can't find the designer plugins. These are required and should have been installed
1772 if test -n "$kde_widgetdir"; then
1773 kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
1777 if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
1778 ac_cv_have_kde="have_kde=no"
1780 ac_cv_have_kde="have_kde=yes \
1781 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1786 ac_cv_have_kde="have_kde=no"
1791 eval "$ac_cv_have_kde"
1793 if test "$have_kde" != "yes"; then
1794 if test "${prefix}" = NONE; then
1795 ac_kde_prefix="$ac_default_prefix"
1797 ac_kde_prefix="$prefix"
1799 if test "$exec_prefix" = NONE; then
1800 ac_kde_exec_prefix="$ac_kde_prefix"
1801 AC_MSG_RESULT([will be installed in $ac_kde_prefix])
1803 ac_kde_exec_prefix="$exec_prefix"
1804 AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
1807 kde_libraries="${libdir}"
1808 kde_includes="${includedir}"
1811 ac_cv_have_kde="have_kde=yes \
1812 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1813 AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
1815 kde_libraries="$ac_kde_libraries"
1816 kde_includes="$ac_kde_includes"
1818 AC_SUBST(kde_libraries)
1819 AC_SUBST(kde_includes)
1821 if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then
1824 KDE_INCLUDES="-I$kde_includes"
1825 all_includes="$KDE_INCLUDES $all_includes"
1828 KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
1830 KDE_LDFLAGS="-L$kde_libraries"
1831 if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
1832 all_libraries="$all_libraries $KDE_LDFLAGS"
1835 AC_SUBST(KDE_LDFLAGS)
1836 AC_SUBST(KDE_INCLUDES)
1838 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1840 all_libraries="$all_libraries $USER_LDFLAGS"
1841 all_includes="$all_includes $USER_INCLUDES"
1842 AC_SUBST(all_includes)
1843 AC_SUBST(all_libraries)
1845 if test -z "$1"; then
1846 KDE_CHECK_UIC_PLUGINS
1849 ac_kde_libraries="$kde_libdir"
1856 AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
1858 AC_MSG_CHECKING(for extra includes)
1859 AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR
1860 adds non standard include paths],
1861 kde_use_extra_includes="$withval",
1862 kde_use_extra_includes=NONE
1865 if test -n "$kde_use_extra_includes" && \
1866 test "$kde_use_extra_includes" != "NONE"; then
1870 for dir in $kde_use_extra_includes; do
1871 kde_extra_includes="$kde_extra_includes $dir"
1872 USER_INCLUDES="$USER_INCLUDES -I$dir"
1875 kde_use_extra_includes="added"
1877 kde_use_extra_includes="no"
1879 AC_SUBST(USER_INCLUDES)
1881 AC_MSG_RESULT($kde_use_extra_includes)
1884 AC_MSG_CHECKING(for extra libs)
1885 AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths],
1886 kde_use_extra_libs=$withval,
1887 kde_use_extra_libs=NONE
1889 if test -n "$kde_use_extra_libs" && \
1890 test "$kde_use_extra_libs" != "NONE"; then
1894 for dir in $kde_use_extra_libs; do
1895 kde_extra_libs="$kde_extra_libs $dir"
1896 KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
1897 USER_LDFLAGS="$USER_LDFLAGS -L$dir"
1900 kde_use_extra_libs="added"
1902 kde_use_extra_libs="no"
1905 AC_SUBST(USER_LDFLAGS)
1907 AC_MSG_RESULT($kde_use_extra_libs)
1911 AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
1913 AC_MSG_CHECKING([for KDE headers installed])
1916 cat > conftest.$ac_ext <<EOF
1918 # include <stdlib.h>
1921 #include "confdefs.h"
1925 printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
1926 printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
1927 printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
1928 printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
1929 printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
1930 printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
1931 printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
1932 printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
1933 printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
1934 printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
1935 printf("kde_wallpaperdir=\\"%s\\"\n",
1936 KApplication::kde_wallpaperdir().data());
1937 printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
1938 printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
1939 printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
1940 printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
1941 printf("kde_moduledir=\\"/tmp/dummy\\"\n");
1942 printf("kde_styledir=\\"/tmp/dummy\\"\n");
1943 printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
1944 printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
1945 printf("xdg_menudir=\\"/tmp/dummy\\"\n");
1946 printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
1947 printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
1952 ac_save_CPPFLAGS=$CPPFLAGS
1953 CPPFLAGS="$all_includes $CPPFLAGS"
1954 if AC_TRY_EVAL(ac_compile); then
1957 AC_MSG_ERROR([your system is not able to compile a small KDE application!
1958 Check, if you installed the KDE header files correctly.
1959 For more details about this problem, look at the end of config.log.])
1961 CPPFLAGS=$ac_save_CPPFLAGS
1966 AC_DEFUN([KDE_CHECK_KDEQTADDON],
1968 AC_MSG_CHECKING(for kde-qt-addon)
1969 AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
1971 kde_ldflags_safe="$LDFLAGS"
1972 kde_libs_safe="$LIBS"
1973 kde_cxxflags_safe="$CXXFLAGS"
1975 LIBS="-lkde-qt-addon $LIBQT $LIBS"
1976 CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
1977 LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
1985 kde_cv_have_kdeqtaddon=yes,
1986 kde_cv_have_kdeqtaddon=no
1989 LDFLAGS=$kde_ldflags_safe
1991 CXXFLAGS=$kde_cxxflags_safe
1994 AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
1996 if test "$kde_cv_have_kdeqtaddon" = "no"; then
1997 AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
1998 It is a separate package (and CVS module) named kde-qt-addon.])
2002 AC_DEFUN([KDE_CHECK_KIMGIO],
2004 AC_REQUIRE([AC_BASE_PATH_KDE])
2005 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2006 AC_REQUIRE([AC_FIND_TIFF])
2007 AC_REQUIRE([AC_FIND_JPEG])
2008 AC_REQUIRE([AC_FIND_PNG])
2009 AC_REQUIRE([AC_FIND_JASPER])
2010 AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
2012 if test "$1" = "existence"; then
2015 kde_save_LIBS="$LIBS"
2016 LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
2017 AC_CHECK_LIB(kimgio, kimgioRegister, [
2018 LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
2019 LIBS="$kde_save_LIBS"
2022 LIBKIMGIO_EXISTS=yes
2025 if test "$LIBKIMGIO_EXISTS" = "yes"; then
2026 LIB_KIMGIO='-lkimgio'
2030 AC_SUBST(LIB_KIMGIO)
2033 AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
2035 AC_REQUIRE([KDE_MISC_TESTS])
2036 AC_REQUIRE([KDE_CHECK_LIBDL])
2037 AC_REQUIRE([K_PATH_X])
2039 if test $kde_qtver = 3; then
2040 AC_SUBST(LIB_KDECORE, "-lkdecore")
2041 AC_SUBST(LIB_KDEUI, "-lkdeui")
2042 AC_SUBST(LIB_KIO, "-lkio")
2043 AC_SUBST(LIB_SMB, "-lsmb")
2044 AC_SUBST(LIB_KAB, "-lkab")
2045 AC_SUBST(LIB_KABC, "-lkabc")
2046 AC_SUBST(LIB_KHTML, "-lkhtml")
2047 AC_SUBST(LIB_KSPELL, "-lkspell")
2048 AC_SUBST(LIB_KPARTS, "-lkparts")
2049 AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2050 AC_SUBST(LIB_KUTILS, "-lkutils")
2051 AC_SUBST(LIB_KDEPIM, "-lkdepim")
2052 # these are for backward compatibility
2053 AC_SUBST(LIB_KSYCOCA, "-lkio")
2054 AC_SUBST(LIB_KFILE, "-lkio")
2055 elif test $kde_qtver = 2; then
2056 AC_SUBST(LIB_KDECORE, "-lkdecore")
2057 AC_SUBST(LIB_KDEUI, "-lkdeui")
2058 AC_SUBST(LIB_KIO, "-lkio")
2059 AC_SUBST(LIB_KSYCOCA, "-lksycoca")
2060 AC_SUBST(LIB_SMB, "-lsmb")
2061 AC_SUBST(LIB_KFILE, "-lkfile")
2062 AC_SUBST(LIB_KAB, "-lkab")
2063 AC_SUBST(LIB_KHTML, "-lkhtml")
2064 AC_SUBST(LIB_KSPELL, "-lkspell")
2065 AC_SUBST(LIB_KPARTS, "-lkparts")
2066 AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2068 AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
2069 AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
2070 AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
2071 AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
2072 AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
2076 AC_DEFUN([AC_PATH_KDE],
2079 AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
2081 if test "$enableval" = "no";
2082 then ac_use_path_checking="default"
2083 else ac_use_path_checking=""
2087 if test "$kde_qtver" = 1;
2088 then ac_use_path_checking=""
2089 else ac_use_path_checking="default"
2094 AC_CREATE_KFSSTND($ac_use_path_checking)
2097 KDE_CREATE_LIBS_ALIASES
2100 dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
2101 AC_DEFUN([KDE_CHECK_FUNC_EXT],
2103 AC_MSG_CHECKING(for $1)
2104 AC_CACHE_VAL(kde_cv_func_$1,
2108 save_CXXFLAGS="$CXXFLAGS"
2109 kde_safe_LIBS="$LIBS"
2110 LIBS="$LIBS $X_EXTRA_LIBS"
2111 if test "$GXX" = "yes"; then
2112 CXXFLAGS="$CXXFLAGS -pedantic-errors"
2122 CXXFLAGS="$save_CXXFLAGS"
2123 LIBS="$kde_safe_LIBS"
2127 AC_MSG_RESULT($kde_cv_func_$1)
2129 AC_MSG_CHECKING([if $1 needs custom prototype])
2130 AC_CACHE_VAL(kde_cv_proto_$1,
2132 if test "x$kde_cv_func_$1" = xyes; then
2136 setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
2137 kde_cv_proto_$1="yes - in libkdefakes"
2140 kde_cv_proto_$1=unknown
2145 if test "x$kde_cv_proto_$1" = xunknown; then
2150 LIBS="$LIBS $X_EXTRA_LIBS"
2159 [ kde_cv_func_$1=yes
2160 kde_cv_proto_$1=yes ],
2161 [kde_cv_proto_$1="$1 unavailable"]
2167 AC_MSG_RESULT($kde_cv_proto_$1)
2169 if test "x$kde_cv_func_$1" = xyes; then
2170 AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
2173 if test "x$kde_cv_proto_$1" = xno; then
2174 AC_DEFINE(HAVE_$5_PROTO, 1,
2175 [Define if you have the $1 prototype])
2178 AH_VERBATIM([_HAVE_$5_PROTO],
2180 #if !defined(HAVE_$5_PROTO)
2192 AC_DEFUN([AC_CHECK_SETENV],
2194 KDE_CHECK_FUNC_EXT(setenv, [
2197 [setenv("VAR", "VALUE", 1);],
2198 [int setenv (const char *, const char *, int)],
2202 AC_DEFUN([AC_CHECK_UNSETENV],
2204 KDE_CHECK_FUNC_EXT(unsetenv, [
2208 [void unsetenv (const char *)],
2212 AC_DEFUN([AC_CHECK_GETDOMAINNAME],
2214 KDE_CHECK_FUNC_EXT(getdomainname, [
2221 getdomainname(buffer, 200);
2223 [#include <sys/types.h>
2224 int getdomainname (char *, size_t)],
2228 AC_DEFUN([AC_CHECK_GETHOSTNAME],
2230 KDE_CHECK_FUNC_EXT(gethostname, [
2236 gethostname(buffer, 200);
2238 [int gethostname (char *, unsigned int)],
2242 AC_DEFUN([AC_CHECK_USLEEP],
2244 KDE_CHECK_FUNC_EXT(usleep, [
2250 [int usleep (unsigned int)],
2255 AC_DEFUN([AC_CHECK_RANDOM],
2257 KDE_CHECK_FUNC_EXT(random, [
2263 [long int random(void)],
2266 KDE_CHECK_FUNC_EXT(srandom, [
2272 [void srandom(unsigned int)],
2277 AC_DEFUN([AC_CHECK_INITGROUPS],
2279 KDE_CHECK_FUNC_EXT(initgroups, [
2280 #include <sys/types.h>
2286 initgroups(buffer, 27);
2288 [int initgroups(const char *, gid_t)],
2292 AC_DEFUN([AC_CHECK_MKSTEMPS],
2294 KDE_CHECK_FUNC_EXT(mkstemps, [
2299 mkstemps("/tmp/aaaXXXXXX", 6);
2301 [int mkstemps(char *, int)],
2305 AC_DEFUN([AC_CHECK_MKDTEMP],
2307 KDE_CHECK_FUNC_EXT(mkdtemp, [
2312 mkdtemp("/tmp/aaaXXXXXX");
2314 [char *mkdtemp(char *)],
2319 AC_DEFUN([AC_CHECK_RES_INIT],
2321 AC_MSG_CHECKING([if res_init needs -lresolv])
2322 kde_libs_safe="$LIBS"
2323 LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
2326 #include <sys/types.h>
2327 #include <netinet/in.h>
2328 #include <arpa/nameser.h>
2335 LIBRESOLV="-lresolv"
2337 AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2339 [ AC_MSG_RESULT(no) ]
2344 AC_MSG_CHECKING([if res_init is available])
2347 #include <sys/types.h>
2348 #include <netinet/in.h>
2349 #include <arpa/nameser.h>
2357 AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2359 [ AC_MSG_RESULT(no) ]
2363 AC_DEFUN([AC_CHECK_STRLCPY],
2365 KDE_CHECK_FUNC_EXT(strlcpy, [
2369 strlcpy(buf, "KDE function test", sizeof(buf));
2371 [unsigned long strlcpy(char*, const char*, unsigned long)],
2375 AC_DEFUN([AC_CHECK_STRLCAT],
2377 KDE_CHECK_FUNC_EXT(strlcat, [
2382 strlcat(buf, "KDE function test", sizeof(buf));
2384 [unsigned long strlcat(char*, const char*, unsigned long)],
2388 AC_DEFUN([AC_FIND_GIF],
2389 [AC_MSG_CHECKING([for giflib])
2390 AC_CACHE_VAL(ac_cv_lib_gif,
2391 [ac_save_LIBS="$LIBS"
2392 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2393 LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
2395 LIBS="$all_libraries -lgif"
2402 int GifLastError(void);
2406 /* We use char because int might match the return type of a gcc2
2407 builtin and then its argument prototype would still apply. */
2409 [return GifLastError();],
2410 eval "ac_cv_lib_gif=yes",
2411 eval "ac_cv_lib_gif=no")
2412 LIBS="$ac_save_LIBS"
2414 if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
2416 AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
2418 AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
2422 AC_DEFUN([KDE_FIND_JPEG_HELPER],
2424 AC_MSG_CHECKING([for libjpeg$2])
2425 AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
2427 ac_save_LIBS="$LIBS"
2428 LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
2429 ac_save_CFLAGS="$CFLAGS"
2430 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2432 [/* Override any gcc2 internal prototype to avoid an error. */
2433 struct jpeg_decompress_struct;
2434 typedef struct jpeg_decompress_struct * j_decompress_ptr;
2439 void jpeg_CreateDecompress(j_decompress_ptr cinfo,
2440 int version, size_t structsize);
2444 /* We use char because int might match the return type of a gcc2
2445 builtin and then its argument prototype would still apply. */
2447 [jpeg_CreateDecompress(0L, 0, 0);],
2448 eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
2449 eval "ac_cv_lib_jpeg_$1=no")
2450 LIBS="$ac_save_LIBS"
2451 CFLAGS="$ac_save_CFLAGS"
2454 if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
2455 LIBJPEG="$ac_cv_lib_jpeg_$1"
2456 AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
2464 AC_DEFUN([AC_FIND_JPEG],
2466 dnl first look for libraries
2467 KDE_FIND_JPEG_HELPER(6b, 6b,
2468 KDE_FIND_JPEG_HELPER(normal, [],
2475 dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
2476 dnl requires system dependent includes loaded before it)
2477 jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
2478 AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
2479 test "x$jpeg_incdir" = xNO && jpeg_incdir=
2481 dnl if headers _and_ libraries are missing, this is no error, and we
2482 dnl continue with a warning (the user will get no jpeg support in khtml)
2483 dnl if only one is missing, it means a configuration error, but we still
2485 if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
2486 AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
2488 if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
2490 There is an installation error in jpeg support. You seem to have only one
2491 of either the headers _or_ the libraries installed. You may need to either
2492 provide correct --with-extra-... options, or the development package of
2493 libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
2494 Disabling JPEG support.
2497 AC_MSG_WARN([libjpeg not found. disable JPEG support.])
2504 AH_VERBATIM(_AC_CHECK_JPEG,
2506 * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
2507 * headers and I'm too lazy to write a configure test as long as only
2508 * unixware is related
2511 #define HAVE_BOOLEAN
2516 AC_DEFUN([KDE_CHECK_QT_JPEG],
2518 if test -n "$LIBJPEG"; then
2519 AC_MSG_CHECKING([if Qt needs $LIBJPEG])
2520 AC_CACHE_VAL(kde_cv_qt_jpeg,
2524 ac_save_LIBS="$LIBS"
2525 LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
2526 LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
2527 ac_save_CXXFLAGS="$CXXFLAGS"
2528 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2530 [#include <qapplication.h>],
2534 QApplication app(argc, argv);],
2535 eval "kde_cv_qt_jpeg=no",
2536 eval "kde_cv_qt_jpeg=yes")
2537 LIBS="$ac_save_LIBS"
2538 CXXFLAGS="$ac_save_CXXFLAGS"
2543 if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
2545 LIBJPEG_QT='$(LIBJPEG)'
2553 AC_DEFUN([AC_FIND_ZLIB],
2555 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2556 AC_MSG_CHECKING([for libz])
2557 AC_CACHE_VAL(ac_cv_lib_z,
2559 kde_save_LIBS="$LIBS"
2560 LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
2561 kde_save_CFLAGS="$CFLAGS"
2562 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2569 gzFile f = (gzFile) 0;
2570 /* this would segfault.. but we only link, don't run */
2571 (void) gzgets(f, buf, sizeof(buf));
2573 return (zlibVersion() == ZLIB_VERSION);
2575 eval "ac_cv_lib_z='-lz'",
2576 eval "ac_cv_lib_z=no")
2577 LIBS="$kde_save_LIBS"
2578 CFLAGS="$kde_save_CFLAGS"
2580 if test ! "$ac_cv_lib_z" = no; then
2581 AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
2583 AC_MSG_RESULT($ac_cv_lib_z)
2585 AC_MSG_ERROR(not found.
2586 Possibly configure picks up an outdated version
2587 installed by XFree86. Remove it from your system.
2589 Check your installation and look into config.log)
2595 AC_DEFUN([KDE_TRY_TIFFLIB],
2597 AC_MSG_CHECKING([for libtiff $1])
2599 AC_CACHE_VAL(kde_cv_libtiff_$1,
2603 kde_save_LIBS="$LIBS"
2604 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2605 LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
2607 LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
2609 kde_save_CXXFLAGS="$CXXFLAGS"
2610 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2616 [return (TIFFOpen( "", "r") == 0); ],
2618 kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
2620 kde_cv_libtiff_$1=no
2623 LIBS="$kde_save_LIBS"
2624 CXXFLAGS="$kde_save_CXXFLAGS"
2628 if test "$kde_cv_libtiff_$1" = "no"; then
2633 LIBTIFF="$kde_cv_libtiff_$1"
2635 AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
2641 AC_DEFUN([AC_FIND_TIFF],
2643 AC_REQUIRE([K_PATH_X])
2644 AC_REQUIRE([AC_FIND_ZLIB])
2645 AC_REQUIRE([AC_FIND_JPEG])
2646 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2648 KDE_TRY_TIFFLIB(tiff, [],
2649 KDE_TRY_TIFFLIB(tiff34))
2655 AC_DEFUN([AC_FIND_PNG],
2657 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2658 AC_REQUIRE([AC_FIND_ZLIB])
2659 AC_MSG_CHECKING([for libpng])
2660 AC_CACHE_VAL(ac_cv_lib_png,
2662 kde_save_LIBS="$LIBS"
2663 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
2664 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
2666 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
2668 kde_save_CFLAGS="$CFLAGS"
2669 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2676 png_structp png_ptr = png_create_read_struct( /* image ptr */
2677 PNG_LIBPNG_VER_STRING, 0, 0, 0 );
2678 return( png_ptr != 0 );
2680 eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
2681 eval "ac_cv_lib_png=no"
2683 LIBS="$kde_save_LIBS"
2684 CFLAGS="$kde_save_CFLAGS"
2686 if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
2687 AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
2688 LIBPNG="$ac_cv_lib_png"
2690 AC_MSG_RESULT($ac_cv_lib_png)
2699 AC_DEFUN([AC_FIND_JASPER],
2701 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2702 AC_REQUIRE([AC_FIND_JPEG])
2703 AC_MSG_CHECKING([for jasper])
2704 AC_CACHE_VAL(ac_cv_jasper,
2706 kde_save_LIBS="$LIBS"
2707 LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
2708 kde_save_CFLAGS="$CFLAGS"
2709 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2713 #include<jasper/jasper.h>
2716 return( jas_init() );
2718 eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
2719 eval "ac_cv_jasper=no"
2721 LIBS="$kde_save_LIBS"
2722 CFLAGS="$kde_save_CFLAGS"
2724 if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
2725 AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
2726 LIB_JASPER="$ac_cv_jasper"
2727 AC_MSG_RESULT($ac_cv_jasper)
2732 AC_SUBST(LIB_JASPER)
2735 AC_DEFUN([AC_CHECK_BOOL],
2737 AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
2740 AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
2742 AC_MSG_CHECKING(if you need GNU extensions)
2743 AC_CACHE_VAL(ac_cv_gnu_extensions,
2745 cat > conftest.c << EOF
2746 #include <features.h>
2748 #ifdef __GNU_LIBRARY__
2753 if (eval "$ac_cpp conftest.c") 2>&5 |
2754 egrep "yes" >/dev/null 2>&1; then
2756 ac_cv_gnu_extensions=yes
2758 ac_cv_gnu_extensions=no
2762 AC_MSG_RESULT($ac_cv_gnu_extensions)
2763 if test "$ac_cv_gnu_extensions" = "yes"; then
2764 AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
2768 AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
2770 AC_MSG_CHECKING([whether $CXX supports -$1])
2771 kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
2772 AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
2776 save_CXXFLAGS="$CXXFLAGS"
2777 CXXFLAGS="$CXXFLAGS -$1"
2778 AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
2779 CXXFLAGS="$save_CXXFLAGS"
2782 if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
2793 AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
2795 AC_MSG_CHECKING([whether $CC supports -$1])
2796 kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
2797 AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
2801 save_CFLAGS="$CFLAGS"
2802 CFLAGS="$CFLAGS -$1"
2803 AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
2804 CFLAGS="$save_CFLAGS"
2807 if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
2819 dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
2820 dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
2821 dnl it's all white-space separated
2822 AC_DEFUN([AC_REMOVE_FORBIDDEN],
2825 if test -n "$__val"; then
2831 *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
2832 *) # Careful to not add spaces, where there were none, because otherwise
2833 # libtool gets confused, if we change e.g. CXX
2834 if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
2842 dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
2843 AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
2845 if test "x$kde_use_qt_emb" != "xyes"; then
2846 AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
2847 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
2849 AC_REMOVE_FORBIDDEN(CXX, [-rpath])
2850 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
2854 AC_DEFUN([AC_CHECK_COMPILERS],
2856 AC_ARG_ENABLE(debug,[ --enable-debug[=ARG] enables debug symbols (yes|no|full) [default=no]],
2860 kde_use_debug_code="yes"
2861 kde_use_debug_define=no
2864 kde_use_debug_code="full"
2865 kde_use_debug_define=no
2868 kde_use_debug_code="no"
2869 kde_use_debug_define=yes
2873 [kde_use_debug_code="no"
2874 kde_use_debug_define=no
2877 dnl Just for configure --help
2878 AC_ARG_ENABLE(dummyoption,[ --disable-debug disables debug output and debug symbols [default=no]],[],[])
2880 AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
2882 if test $enableval = "no"; then
2883 kde_use_strict_options="no"
2885 kde_use_strict_options="yes"
2887 ], [kde_use_strict_options="no"])
2889 AC_ARG_ENABLE(warnings,[ --disable-warnings disables compilation with -Wall and similiar],
2891 if test $enableval = "no"; then
2892 kde_use_warnings="no"
2894 kde_use_warnings="yes"
2896 ], [kde_use_warnings="yes"])
2898 dnl enable warnings for debug build
2899 if test "$kde_use_debug_code" != "no"; then
2900 kde_use_warnings=yes
2903 AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]],
2904 [kde_use_profiling=$enableval],
2905 [kde_use_profiling="no"]
2908 dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
2915 if test "$GCC" = "yes"; then
2916 if test "$kde_use_debug_code" != "no"; then
2917 if test $kde_use_debug_code = "full"; then
2918 CFLAGS="-g3 -fno-inline $CFLAGS"
2920 CFLAGS="-g -O2 $CFLAGS"
2923 CFLAGS="-O2 $CFLAGS"
2927 if test "$kde_use_debug_define" = "yes"; then
2928 CFLAGS="-DNDEBUG $CFLAGS"
2933 *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
2934 *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
2937 if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
2941 CXXFLAGS=" $CXXFLAGS"
2945 if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
2946 if test "$kde_use_debug_code" != "no"; then
2947 if test "$CXX" = "KCC"; then
2948 CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
2950 if test "$kde_use_debug_code" = "full"; then
2951 CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
2953 CXXFLAGS="-g -O2 $CXXFLAGS"
2956 KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
2958 dnl convenience compiler flags
2959 KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
2960 AC_SUBST(WOVERLOADED_VIRTUAL)
2962 if test "$CXX" = "KCC"; then
2963 CXXFLAGS="+K3 $CXXFLAGS"
2965 CXXFLAGS="-O2 $CXXFLAGS"
2970 if test "$kde_use_debug_define" = "yes"; then
2971 CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
2974 if test "$kde_use_profiling" = "yes"; then
2975 KDE_CHECK_COMPILER_FLAG(pg,
2977 CFLAGS="-pg $CFLAGS"
2978 CXXFLAGS="-pg $CXXFLAGS"
2982 if test "$kde_use_warnings" = "yes"; then
2983 if test "$GCC" = "yes"; then
2984 CXXFLAGS="-Wall -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
2987 CFLAGS="-ansi -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
2988 CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts $CXXFLAGS"
2989 KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
2990 KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
2993 KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
2994 KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
2995 KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
2999 if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
3000 CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
3003 if test "$GXX" = "yes"; then
3004 KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
3005 KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
3006 KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
3007 KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
3009 if test "$CXX" = "KCC"; then
3010 dnl unfortunately we currently cannot disable exception support in KCC
3011 dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
3012 dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
3013 dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= )
3015 AC_ARG_ENABLE(pch,[ --enable-pch enables precompiled header support (currently only KCC) [default=no]],
3017 kde_use_pch=$enableval
3020 if test "$kde_use_pch" = "yes"; then
3021 dnl TODO: support --pch-dir!
3022 KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
3023 dnl the below works (but the dir must exist), but it's
3024 dnl useless for a whole package.
3025 dnl The are precompiled headers for each source file, so when compiling
3026 dnl from scratch, it doesn't make a difference, and they take up
3027 dnl around ~5Mb _per_ sourcefile.
3028 dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
3029 dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
3031 dnl this flag controls inlining. by default KCC inlines in optimisation mode
3032 dnl all implementations that are defined inside the class {} declaration.
3033 dnl because of templates-compatibility with broken gcc compilers, this
3034 dnl can cause excessive inlining. This flag limits it to a sane level
3035 KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
3036 KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
3037 KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
3038 KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
3039 dnl Some source files are shared between multiple executables
3040 dnl (or libraries) and some of those need template instantiations.
3041 dnl In that case KCC needs to compile those sources with
3042 dnl --one_instantiation_per_object. To make it easy for us we compile
3043 dnl _all_ objects with that flag (--one_per is a shorthand).
3044 KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
3046 AC_SUBST(USE_EXCEPTIONS)
3047 dnl obsolete macro - provided to keep things going
3052 *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
3053 *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
3054 *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
3056 if test "$GXX" = yes; then
3057 libstdcpp=`$CXX -print-file-name=libstdc++.so`
3058 if test ! -f $libstdcpp; then
3059 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])
3065 AC_VALIDIFY_CXXFLAGS
3069 if test "$GCC" = yes; then
3072 KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
3074 AC_SUBST(NOOPT_CXXFLAGS)
3075 AC_SUBST(NOOPT_CFLAGS)
3081 ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
3084 AC_DEFUN([KDE_ADD_DEPENDENCIES],
3086 [A]M_DEPENDENCIES(CC)
3087 [A]M_DEPENDENCIES(CXX)
3090 dnl just a wrapper to clean up configure.in
3091 AC_DEFUN([KDE_PROG_LIBTOOL],
3093 AC_REQUIRE([AC_CHECK_COMPILERS])
3094 AC_REQUIRE([AC_ENABLE_SHARED])
3095 AC_REQUIRE([AC_ENABLE_STATIC])
3097 AC_REQUIRE([AC_LIBTOOL_DLOPEN])
3098 AC_REQUIRE([KDE_CHECK_LIB64])
3106 LIBTOOL_SHELL="/bin/sh ./libtool"
3107 # LIBTOOL="$LIBTOOL --silent"
3108 KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
3109 AC_SUBST(KDE_PLUGIN)
3111 # we patch configure quite some so we better keep that consistent for incremental runs
3112 AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
3115 AC_DEFUN([KDE_CHECK_LIB64],
3118 AC_ARG_ENABLE(libsuffix,
3119 AC_HELP_STRING([--enable-libsuffix],
3120 [/lib directory suffix (64,32,none[=default])]),
3121 kdelibsuff=$enableval)
3122 # TODO: add an auto case that compiles a little C app to check
3123 # where the glibc is
3124 if test "$kdelibsuff" = "no"; then
3127 if test -z "$kdelibsuff"; then
3128 AC_MSG_RESULT([not using lib directory suffix])
3129 AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
3131 if test "$libdir" = '${exec_prefix}/lib'; then
3132 libdir="$libdir${kdelibsuff}"
3133 AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms
3135 AC_DEFINE_UNQUOTED(KDELIBSUFF, ["\"${kdelibsuff}\""], Suffix for lib directories)
3136 AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
3140 AC_DEFUN([KDE_CHECK_TYPES],
3141 [ AC_CHECK_SIZEOF(int, 4)dnl
3142 AC_CHECK_SIZEOF(short)dnl
3143 AC_CHECK_SIZEOF(long, 4)dnl
3144 AC_CHECK_SIZEOF(char *, 4)dnl
3147 AC_DEFUN([KDE_DO_IT_ALL],
3151 AM_INIT_AUTOMAKE($1, $2)
3152 AM_DISABLE_LIBRARIES
3153 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
3160 AC_DEFUN([AC_CHECK_RPATH],
3162 AC_MSG_CHECKING(for rpath)
3163 AC_ARG_ENABLE(rpath,
3164 [ --disable-rpath do not use the rpath feature of ld],
3165 USE_RPATH=$enableval, USE_RPATH=yes)
3167 if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
3169 KDE_RPATH="-R \$(kde_libraries)"
3171 if test -n "$qt_libraries"; then
3172 KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
3174 dnl $x_libraries is set to /usr/lib in case
3175 if test -n "$X_LDFLAGS"; then
3176 X_RPATH="-R \$(x_libraries)"
3177 KDE_RPATH="$KDE_RPATH $X_RPATH"
3179 if test -n "$KDE_EXTRA_RPATH"; then
3180 KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
3183 AC_SUBST(KDE_EXTRA_RPATH)
3186 AC_MSG_RESULT($USE_RPATH)
3189 dnl Check for the type of the third argument of getsockname
3190 AC_DEFUN([AC_CHECK_SOCKLEN_T], [
3191 AC_MSG_CHECKING(for socklen_t)
3192 AC_CACHE_VAL(ac_cv_socklen_t, [
3196 #include <sys/types.h>
3197 #include <sys/socket.h>
3200 getsockname(0,(struct sockaddr*)0, &a);
3202 ac_cv_socklen_t=socklen_t,
3204 #include <sys/types.h>
3205 #include <sys/socket.h>
3208 getsockname(0,(struct sockaddr*)0, &a);
3210 ac_cv_socklen_t=int,
3211 ac_cv_socklen_t=size_t
3217 AC_MSG_RESULT($ac_cv_socklen_t)
3218 if test "$ac_cv_socklen_t" != "socklen_t"; then
3219 AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t,
3220 [Define the real type of socklen_t])
3222 AC_DEFINE_UNQUOTED(ksize_t, socklen_t, [Compatibility define])
3226 dnl This is a merge of some macros out of the gettext aclocal.m4
3227 dnl since we don't need anything, I took the things we need
3228 dnl the copyright for them is:
3230 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3231 dnl This Makefile.in is free software; the Free Software Foundation
3232 dnl gives unlimited permission to copy and/or distribute it,
3233 dnl with or without modifications, as long as this notice is preserved.
3235 dnl This program is distributed in the hope that it will be useful,
3236 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
3237 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
3238 dnl PARTICULAR PURPOSE.
3240 dnl for this file it is relicensed under LGPL
3242 AC_DEFUN([AM_KDE_WITH_NLS],
3244 dnl If we use NLS figure out what method
3246 AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
3247 [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
3248 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
3250 if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
3251 AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
3258 AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
3259 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
3261 dnl Test whether we really found GNU xgettext.
3262 if test "$XGETTEXT" != ":"; then
3263 dnl If it is no GNU xgettext we define it as : so that the
3264 dnl Makefiles still can work.
3265 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
3269 [found xgettext programs is not GNU xgettext; ignore it])
3277 # Search path for a program which passes the given test.
3278 # Ulrich Drepper <drepper@cygnus.com>, 1996.
3281 # Stephan Kulow: I appended a _KDE against name conflicts
3283 dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
3284 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3285 AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
3286 [# Extract the first word of "$2", so it can be a program name with args.
3287 set dummy $2; ac_word=[$]2
3288 AC_MSG_CHECKING([for $ac_word])
3289 AC_CACHE_VAL(ac_cv_path_$1,
3292 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3295 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3296 for ac_dir in ifelse([$5], , $PATH, [$5]); do
3297 test -z "$ac_dir" && ac_dir=.
3298 if test -f $ac_dir/$ac_word; then
3300 ac_cv_path_$1="$ac_dir/$ac_word"
3306 dnl If no 4th arg is given, leave the cache variable unset,
3307 dnl so AC_PATH_PROGS will keep looking.
3308 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3313 if test -n "[$]$1"; then
3314 AC_MSG_RESULT([$]$1)
3322 # Check whether LC_MESSAGES is available in <locale.h>.
3323 # Ulrich Drepper <drepper@cygnus.com>, 1995.
3327 AC_DEFUN([AM_LC_MESSAGES],
3328 [if test $ac_cv_header_locale_h = yes; then
3329 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
3330 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
3331 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
3332 if test $am_cv_val_LC_MESSAGES = yes; then
3333 AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
3337 dnl From Jim Meyering.
3338 dnl FIXME: migrate into libit.
3340 AC_DEFUN([AM_FUNC_OBSTACK],
3341 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
3342 [AC_TRY_LINK([#include "obstack.h"],
3343 [struct obstack *mem;obstack_free(mem,(char *) 0)],
3344 am_cv_func_obstack=yes,
3345 am_cv_func_obstack=no)])
3346 if test $am_cv_func_obstack = yes; then
3347 AC_DEFINE(HAVE_OBSTACK)
3349 LIBOBJS="$LIBOBJS obstack.o"
3353 dnl From Jim Meyering. Use this if you use the GNU error.[ch].
3354 dnl FIXME: Migrate into libit
3356 AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
3357 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
3358 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
3359 am_cv_lib_error_at_line=yes,
3360 am_cv_lib_error_at_line=no)])
3361 if test $am_cv_lib_error_at_line = no; then
3362 LIBOBJS="$LIBOBJS error.o"
3364 AC_SUBST(LIBOBJS)dnl
3367 # Macro to add for using GNU gettext.
3368 # Ulrich Drepper <drepper@cygnus.com>, 1995.
3371 # Stephan Kulow: I put a KDE in it to avoid name conflicts
3373 AC_DEFUN([AM_KDE_GNU_GETTEXT],
3374 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3375 AC_REQUIRE([AC_PROG_RANLIB])dnl
3376 AC_REQUIRE([AC_HEADER_STDC])dnl
3377 AC_REQUIRE([AC_TYPE_OFF_T])dnl
3378 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
3379 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
3380 AC_REQUIRE([AC_FUNC_MMAP])dnl
3381 AC_REQUIRE([AM_KDE_WITH_NLS])dnl
3382 AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
3383 AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
3384 __argz_count __argz_stringify __argz_next])
3386 AC_MSG_CHECKING(for stpcpy)
3387 AC_CACHE_VAL(kde_cv_func_stpcpy,
3389 kde_safe_cxxflags=$CXXFLAGS
3398 stpcpy(buffer, buffer);
3400 kde_cv_func_stpcpy=yes,
3401 kde_cv_func_stpcpy=no)
3403 CXXFLAGS=$kde_safe_cxxflags
3405 AC_MSG_RESULT($kde_cv_func_stpcpy)
3406 if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
3407 AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
3412 if test "x$CATOBJEXT" != "x"; then
3413 if test "x$ALL_LINGUAS" = "x"; then
3416 AC_MSG_CHECKING(for catalogs to be installed)
3418 for lang in ${LINGUAS=$ALL_LINGUAS}; do
3419 case "$ALL_LINGUAS" in
3420 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
3423 LINGUAS=$NEW_LINGUAS
3424 AC_MSG_RESULT($LINGUAS)
3427 dnl Construct list of names of catalog files to be constructed.
3428 if test -n "$LINGUAS"; then
3429 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
3435 AC_DEFUN([AC_HAVE_XPM],
3436 [AC_REQUIRE_CPP()dnl
3437 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3439 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
3440 test -z "$XPM_INCLUDE" && XPM_INCLUDE=
3442 AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
3443 xpm_test=$withval, xpm_test="yes")
3444 if test "x$xpm_test" = xno; then
3447 AC_MSG_CHECKING(for XPM)
3448 AC_CACHE_VAL(ac_cv_have_xpm,
3450 ac_save_ldflags="$LDFLAGS"
3451 ac_save_cflags="$CFLAGS"
3452 if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
3453 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
3455 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
3457 CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
3458 test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
3459 AC_TRY_LINK([#include <X11/xpm.h>],[],
3460 ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
3461 LDFLAGS="$ac_save_ldflags"
3462 CFLAGS="$ac_save_cflags"
3465 if test "$ac_cv_have_xpm" = no; then
3471 AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
3472 if test "$XPM_LDFLAGS" = ""; then
3473 XPMLIB='-lXpm $(LIB_X11)'
3475 XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
3477 if test "$XPM_INCLUDE" = ""; then
3480 XPMINC="-I$XPM_INCLUDE"
3490 AC_DEFUN([AC_HAVE_DPMS],
3491 [AC_REQUIRE_CPP()dnl
3492 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3494 test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
3495 test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
3498 AC_ARG_WITH(dpms, [ --without-dpms disable DPMS power saving],
3499 dpms_test=$withval, dpms_test="yes")
3500 if test "x$dpms_test" = xno; then
3503 AC_MSG_CHECKING(for DPMS)
3504 dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
3505 dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
3506 AC_CACHE_VAL(ac_cv_have_dpms,
3508 if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
3510 ac_cv_have_dpms="no"
3512 ac_save_ldflags="$LDFLAGS"
3513 ac_save_cflags="$CFLAGS"
3514 ac_save_libs="$LIBS"
3515 LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
3516 CFLAGS="$CFLAGS $X_INCLUDES"
3517 test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3519 #include <X11/Xproto.h>
3521 #include <X11/Xlib.h>
3522 #include <X11/extensions/dpms.h>
3524 { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3525 ac_cv_have_dpms="yes", [
3526 LDFLAGS="$ac_save_ldflags"
3527 CFLAGS="$ac_save_cflags"
3528 LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
3529 LIBS="$LIBS -lXdpms"
3530 CFLAGS="$CFLAGS $X_INCLUDES"
3531 test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3533 #include <X11/Xproto.h>
3535 #include <X11/Xlib.h>
3536 #include <X11/extensions/dpms.h>
3538 { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3540 ac_cv_have_dpms="-lXdpms"
3541 ],ac_cv_have_dpms="no")
3543 LDFLAGS="$ac_save_ldflags"
3544 CFLAGS="$ac_save_cflags"
3545 LIBS="$ac_save_libs"
3549 if test "$ac_cv_have_dpms" = no; then
3555 AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
3556 if test "$ac_cv_have_dpms" = "-lXdpms"; then
3559 if test "$DPMS_LDFLAGS" = ""; then
3560 DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
3562 DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
3564 if test "$DPMS_INCLUDE" = ""; then
3567 DPMSINC="-I$DPMS_INCLUDE"
3573 ac_save_cflags="$CFLAGS"
3574 CFLAGS="$CFLAGS $X_INCLUDES"
3575 test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3576 AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
3577 [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
3578 AC_CHECK_DECL(DPMSCapable,
3579 AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
3580 [#include <X11/extensions/dpms.h>])
3581 AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
3582 [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
3583 AC_CHECK_DECL(DPMSInfo,
3584 AC_DEFINE(HAVE_DPMSINFO_PROTO),,
3585 [#include <X11/extensions/dpms.h>])
3586 CFLAGS="$ac_save_cflags"
3591 AC_DEFUN([AC_HAVE_GL],
3592 [AC_REQUIRE_CPP()dnl
3593 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3595 test -z "$GL_LDFLAGS" && GL_LDFLAGS=
3596 test -z "$GL_INCLUDE" && GL_INCLUDE=
3598 AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
3599 gl_test=$withval, gl_test="yes")
3600 if test "x$kde_use_qt_emb" = "xyes"; then
3601 # GL and Qt Embedded is a no-go for now.
3603 elif test "x$gl_test" = xno; then
3606 AC_MSG_CHECKING(for GL)
3607 AC_CACHE_VAL(ac_cv_have_gl,
3611 ac_save_ldflags="$LDFLAGS"
3612 ac_save_cxxflags="$CXXFLAGS"
3613 LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU"
3614 test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3615 LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3616 CXXFLAGS="$CFLAGS $X_INCLUDES"
3617 test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3618 AC_TRY_LINK([#include <GL/gl.h>
3621 ac_cv_have_gl="mesa", ac_cv_have_gl="no")
3622 if test "x$ac_cv_have_gl" = "xno"; then
3623 LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGLU -lGL"
3624 test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3625 LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3626 CXXFLAGS="$ac_save_cflags $X_INCLUDES"
3627 test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3628 AC_TRY_LINK([#include <GL/gl.h>
3631 ac_cv_have_gl="yes", ac_cv_have_gl="no")
3634 LDFLAGS="$ac_save_ldflags"
3635 CXXFLAGS="$ac_save_cxxflags"
3638 if test "$ac_cv_have_gl" = "no"; then
3644 AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
3645 if test "$GL_LDFLAGS" = ""; then
3646 if test "$ac_cv_have_gl" = "mesa"; then
3647 GLLIB='-lMesaGLU -lMesaGL $(LIB_X11)'
3649 GLLIB='-lGLU -lGL $(LIB_X11)'
3652 if test "$ac_cv_have_gl" = "mesa"; then
3653 GLLIB="$GL_LDFLAGS -lMesaGLU -lMesaGL "'$(LIB_X11)'
3655 GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
3658 if test "$GL_INCLUDE" = ""; then
3661 GLINC="-I$GL_INCLUDE"
3663 AC_MSG_RESULT($ac_cv_have_gl)
3672 dnl shadow password and PAM magic - maintained by ossi@kde.org
3674 AC_DEFUN([KDE_PAM], [
3675 AC_REQUIRE([KDE_CHECK_LIBDL])
3679 [ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]],
3680 [ if test "x$withval" = "xyes"; then
3683 elif test "x$withval" = "xno"; then
3687 pam_service=$withval
3689 ], [ pam_service=kde ])
3693 if test "x$want_pam" != xno; then
3694 AC_CHECK_LIB(pam, pam_start, [
3695 AC_CHECK_HEADER(security/pam_appl.h,
3696 [ pam_header=security/pam_appl.h ],
3697 [ AC_CHECK_HEADER(pam/pam_appl.h,
3698 [ pam_header=pam/pam_appl.h ],
3700 AC_MSG_WARN([PAM detected, but no headers found!
3701 Make sure you have the necessary development packages installed.])
3707 if test -z "$pam_header"; then
3708 if test "x$want_pam" = xyes; then
3709 AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
3712 AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
3713 PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
3716 dnl darwin claims to be something special
3717 if test "$pam_header" = "pam/pam_appl.h"; then
3718 AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
3721 dnl test whether struct pam_message is const (Linux) or not (Sun)
3722 AC_MSG_CHECKING(for const pam_message)
3723 AC_EGREP_HEADER([struct pam_message], $pam_header,
3724 [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
3725 [AC_MSG_RESULT([const: Linux-type PAM])],
3726 [AC_MSG_RESULT([nonconst: Sun-type PAM])
3727 AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
3729 [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
3736 dnl DEF_PAM_SERVICE(arg name, full name, define name)
3737 AC_DEFUN([DEF_PAM_SERVICE], [
3739 [ --with-$1-pam=[val] override PAM service from --with-pam for $2],
3740 [ if test "x$use_pam" = xyes; then
3741 $3_PAM_SERVICE=$withval
3743 AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
3744 You may want to enforce it by using --with-pam.])
3747 [ if test "x$use_pam" = xyes; then
3748 $3_PAM_SERVICE="$pam_service"
3751 if test -n "$$3_PAM_SERVICE"; then
3752 AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
3753 AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
3755 AC_SUBST($3_PAM_SERVICE)
3758 AC_DEFUN([KDE_SHADOWPASSWD], [
3759 AC_REQUIRE([KDE_PAM])
3761 AC_CHECK_LIB(shadow, getspent,
3762 [ LIBSHADOW="-lshadow"
3766 AC_CHECK_LIB(gen, getspent,
3770 [ AC_CHECK_FUNC(getspent,
3771 [ ac_use_shadow=yes ],
3772 [ ac_use_shadow=no ])
3778 AC_MSG_CHECKING([for shadow passwords])
3781 [ --with-shadow If you want shadow password support ],
3782 [ if test "x$withval" != "xno"; then
3788 use_shadow="$ac_use_shadow"
3791 if test "x$use_shadow" = xyes; then
3793 AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
3800 dnl finally make the relevant binaries setuid root, if we have shadow passwds.
3801 dnl this still applies, if we could use it indirectly through pam.
3802 if test "x$use_shadow" = xyes ||
3803 ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
3805 *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
3806 SETUIDFLAGS="-m 4755 -o root";;
3808 SETUIDFLAGS="-m 4755";;
3811 AC_SUBST(SETUIDFLAGS)
3815 AC_DEFUN([KDE_PASSWDLIBS], [
3816 AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
3817 AC_REQUIRE([KDE_PAM])
3818 AC_REQUIRE([KDE_SHADOWPASSWD])
3820 if test "x$use_pam" = "xyes"; then
3821 PASSWDLIBS="$PAMLIBS"
3823 PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
3826 dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
3827 dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires
3828 dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
3829 dnl may need to read /etc/master.passwd).
3832 SETUIDFLAGS="-m 4755 -o root"
3838 AC_SUBST(PASSWDLIBS)
3841 AC_DEFUN([KDE_CHECK_LIBDL],
3843 AC_CHECK_LIB(dl, dlopen, [
3845 ac_cv_have_dlfcn=yes
3848 AC_CHECK_LIB(dld, shl_unload, [
3850 ac_cv_have_shload=yes
3856 AC_DEFUN([KDE_CHECK_DLOPEN],
3859 AC_CHECK_HEADERS(dlfcn.h dl.h)
3860 if test "$ac_cv_header_dlfcn_h" = "no"; then
3864 if test "$ac_cv_header_dl_h" = "no"; then
3865 ac_cv_have_shload=no
3868 dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
3870 AC_ARG_ENABLE(dlopen,
3871 [ --disable-dlopen link statically [default=no]] ,
3872 enable_dlopen=$enableval,
3875 # override the user's opinion, if we know it better ;)
3876 if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
3880 if test "$ac_cv_have_dlfcn" = "yes"; then
3881 AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
3884 if test "$ac_cv_have_shload" = "yes"; then
3885 AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
3888 if test "$enable_dlopen" = no ; then
3889 test -n "$1" && eval $1
3891 test -n "$2" && eval $2
3896 AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
3898 KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
3900 AC_MSG_CHECKING([dynamic loading])
3901 eval "`egrep '^build_libtool_libs=' libtool`"
3902 if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
3904 AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
3908 AC_MSG_RESULT($dynamic_loading)
3909 if test "$dynamic_loading" = "yes"; then
3916 AC_DEFUN([KDE_ADD_INCLUDES],
3918 if test -z "$1"; then
3919 test_include="Pix.h"
3924 AC_MSG_CHECKING([for libg++ ($test_include)])
3926 AC_CACHE_VAL(kde_cv_libgpp_includes,
3928 kde_cv_libgpp_includes=no
3934 /usr/unsupported/include \
3939 if test -r "$ac_dir/$test_include"; then
3940 kde_cv_libgpp_includes=$ac_dir
3946 AC_MSG_RESULT($kde_cv_libgpp_includes)
3947 if test "$kde_cv_libgpp_includes" != "no"; then
3948 all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
3952 AC_DEFUN([KDE_CHECK_LIBPTHREAD],
3956 if test -n "$PTHREAD_LIBS"; then
3957 PTHREAD_LIBS_save="$PTHREAD_LIBS"
3958 PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
3959 KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [LIBPTHREAD="$PTHREAD_LIBS_save"] )
3960 PTHREAD_LIBS="$PTHREAD_LIBS_save"
3963 if test -z "$LIBPTHREAD"; then
3964 AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
3967 AC_SUBST(LIBPTHREAD)
3970 AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
3973 if test -z "$LIBPTHREAD"; then
3974 KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
3977 AH_VERBATIM(__svr_define, [
3978 #if defined(__SVR4) && !defined(__svr4__)
3984 KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
3985 CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
3988 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
3991 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
3992 LIBPTHREAD="$LIBPTHREAD -lc_r"
3994 linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
3995 if test "$CXX" = "KCC"; then
3996 CXXFLAGS="$CXXFLAGS --thread_safe"
3997 NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
4003 AC_SUBST(USE_THREADS)
4004 AC_SUBST(LIBPTHREAD)
4007 AC_DEFUN([KDE_CHECK_THREADING],
4009 AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4010 AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
4011 dnl default is yes if libpthread is found and no if no libpthread is available
4012 if test -z "$LIBPTHREAD"; then
4013 if test -z "$USE_THREADS"; then
4014 kde_check_threading_default=no
4016 kde_check_threading_default=yes
4019 kde_check_threading_default=yes
4021 AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ],
4022 kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
4023 if test "x$kde_use_threading" = "xyes"; then
4024 AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
4028 AC_DEFUN([KDE_TRY_LINK_PYTHON],
4030 if test "$kde_python_link_found" = no; then
4032 if test "$1" = normal; then
4033 AC_MSG_CHECKING(if a Python application links)
4035 AC_MSG_CHECKING(if Python depends on $2)
4038 AC_CACHE_VAL(kde_cv_try_link_python_$1,
4040 kde_save_cflags="$CFLAGS"
4041 CFLAGS="$CFLAGS $PYTHONINC"
4042 kde_save_libs="$LIBS"
4043 LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
4044 kde_save_ldflags="$LDFLAGS"
4045 LDFLAGS="$LDFLAGS $PYTHONLIB"
4051 PySys_SetArgv(1, 0);
4053 [kde_cv_try_link_python_$1=yes],
4054 [kde_cv_try_link_python_$1=no]
4056 CFLAGS="$kde_save_cflags"
4057 LIBS="$kde_save_libs"
4058 LDFLAGS="$kde_save_ldflags"
4061 if test "$kde_cv_try_link_python_$1" = "yes"; then
4063 kde_python_link_found=yes
4064 if test ! "$1" = normal; then
4065 LIBPYTHON="$LIBPYTHON $2"
4077 AC_DEFUN([KDE_CHECK_PYTHON_DIR],
4079 AC_MSG_CHECKING([for Python directory])
4081 AC_CACHE_VAL(kde_cv_pythondir,
4083 if test -z "$PYTHONDIR"; then
4084 kde_cv_pythondir=/usr/local
4086 kde_cv_pythondir="$PYTHONDIR"
4090 AC_ARG_WITH(pythondir,
4091 [ --with-pythondir=pythondir use python installed in pythondir ],
4093 ac_python_dir=$withval
4094 ], ac_python_dir=$kde_cv_pythondir
4097 AC_MSG_RESULT($ac_python_dir)
4100 AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
4102 AC_REQUIRE([KDE_CHECK_LIBDL])
4103 AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4104 AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
4106 if test -z "$1"; then
4112 AC_MSG_CHECKING([for Python$version])
4114 python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
4115 AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
4116 if test ! -r $python_incdir/Python.h; then
4117 AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
4118 python_incdir=$python_incdir/python$version
4119 if test ! -r $python_incdir/Python.h; then
4124 PYTHONINC=-I$python_incdir
4126 python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs"
4127 AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
4128 if test ! -r $python_libdir/libpython$version.so; then
4129 AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
4130 if test ! -r $python_libdir/libpython$version.a; then
4131 AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
4132 python_libdir=$python_libdir/python$version/config
4133 if test ! -r $python_libdir/libpython$version.a; then
4139 PYTHONLIB=-L$python_libdir
4140 kde_orig_LIBPYTHON=$LIBPYTHON
4141 if test -z "$LIBPYTHON"; then
4142 LIBPYTHON=-lpython$version
4145 AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
4146 python_moddir=$python_moddir/python$version
4147 if test ! -r $python_moddir/copy.py; then
4151 PYTHONMODDIR=$python_moddir
4153 AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
4155 if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
4156 LIBPYTHON=$kde_orig_LIBPYTHON
4157 test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
4158 test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
4161 dnl Note: this test is very weak
4162 kde_python_link_found=no
4163 KDE_TRY_LINK_PYTHON(normal)
4164 KDE_TRY_LINK_PYTHON(m, -lm)
4165 KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
4166 KDE_TRY_LINK_PYTHON(tcl, -ltcl)
4167 KDE_TRY_LINK_PYTHON(db2, -ldb2)
4168 KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
4169 KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
4170 KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
4171 KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
4172 KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
4173 KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
4174 KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
4175 KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
4176 [AC_MSG_WARN([it seems, Python depends on another library.
4177 Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
4178 and contact the authors to let them know about this problem])
4181 LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
4185 AC_SUBST(PYTHONMODDIR)
4186 AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
4192 AC_DEFUN([KDE_CHECK_PYTHON],
4194 KDE_CHECK_PYTHON_INTERN("2.3",
4195 [KDE_CHECK_PYTHON_INTERN("2.2",
4196 [KDE_CHECK_PYTHON_INTERN("2.1",
4197 [KDE_CHECK_PYTHON_INTERN("2.0",
4198 [KDE_CHECK_PYTHON_INTERN($1, $2) ])
4204 AC_DEFUN([KDE_CHECK_STL],
4208 ac_save_CXXFLAGS="$CXXFLAGS"
4209 CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
4211 AC_MSG_CHECKING([if C++ programs can be compiled])
4212 AC_CACHE_VAL(kde_cv_stl_works,
4216 using namespace std;
4218 string astring="Hallo Welt.";
4219 astring.erase(0, 6); // now astring is "Welt"
4221 ], kde_cv_stl_works=yes,
4222 kde_cv_stl_works=no)
4225 AC_MSG_RESULT($kde_cv_stl_works)
4227 if test "$kde_cv_stl_works" = "yes"; then
4229 AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
4231 AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
4232 Check config.log for details - if you're using a Linux distribution you might miss
4233 a package named similiar to libstd++-dev.])
4236 CXXFLAGS="$ac_save_CXXFLAGS"
4240 AC_DEFUN([AC_FIND_QIMGIO],
4241 [AC_REQUIRE([AC_FIND_JPEG])
4242 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
4243 AC_MSG_CHECKING([for qimgio])
4244 AC_CACHE_VAL(ac_cv_lib_qimgio,
4248 ac_save_LIBS="$LIBS"
4249 ac_save_CXXFLAGS="$CXXFLAGS"
4250 LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
4251 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
4254 #include <qimageio.h>
4255 #include <qstring.h>
4257 QString t = "hallo";
4262 ac_cv_lib_qimgio=yes,
4263 ac_cv_lib_qimgio=no,
4264 ac_cv_lib_qimgio=no)
4265 LIBS="$ac_save_LIBS"
4266 CXXFLAGS="$ac_save_CXXFLAGS"
4269 if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
4270 LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
4272 AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
4275 AC_MSG_RESULT(not found)
4279 AC_DEFUN([AM_DISABLE_LIBRARIES],
4281 AC_PROVIDE([AM_ENABLE_STATIC])
4282 AC_PROVIDE([AM_ENABLE_SHARED])
4288 AC_DEFUN([AC_CHECK_UTMP_FILE],
4290 AC_MSG_CHECKING([for utmp file])
4292 AC_CACHE_VAL(kde_cv_utmp_file,
4303 if test -r "$ac_file"; then
4304 kde_cv_utmp_file=$ac_file
4310 if test "$kde_cv_utmp_file" != "no"; then
4311 AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
4313 AC_MSG_RESULT($kde_cv_utmp_file)
4316 AC_MSG_RESULT([non found])
4321 AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
4324 DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
4326 if test ! -s $srcdir/subdirs; then
4327 dnl Note: Makefile.common creates subdirs, so this is just a fallback
4329 files=`cd $srcdir && ls -1`
4330 dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
4332 echo $i >> $srcdir/subdirs
4337 if test -s $srcdir/inst-apps; then
4338 ac_topsubdirs="`cat $srcdir/inst-apps`"
4339 elif test -s $srcdir/subdirs; then
4340 ac_topsubdirs="`cat $srcdir/subdirs`"
4343 for i in $ac_topsubdirs; do
4344 AC_MSG_CHECKING([if $i should be compiled])
4345 if test -d $srcdir/$i; then
4347 for j in $DO_NOT_COMPILE; do
4348 if test $i = $j; then
4355 AC_MSG_RESULT($install_it)
4356 vari=`echo $i | sed -e 's,[[-+.]],_,g'`
4357 if test $install_it = "yes"; then
4358 TOPSUBDIRS="$TOPSUBDIRS $i"
4359 eval "$vari""_SUBDIR_included=yes"
4361 eval "$vari""_SUBDIR_included=no"
4365 AC_SUBST(TOPSUBDIRS)
4368 AC_DEFUN([KDE_CHECK_NAMESPACES],
4370 AC_MSG_CHECKING(whether C++ compiler supports namespaces)
4384 int Foo::Bar::i = 1;
4387 AC_DEFINE(HAVE_NAMESPACES)
4394 dnl ------------------------------------------------------------------------
4395 dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
4396 dnl ------------------------------------------------------------------------
4398 AC_DEFUN([AC_CHECK_S_ISSOCK],
4400 AC_MSG_CHECKING(for S_ISSOCK)
4401 AC_CACHE_VAL(ac_cv_have_s_issock,
4405 #include <sys/stat.h>
4409 int b = S_ISSOCK( buff.st_mode );
4411 ac_cv_have_s_issock=yes,
4412 ac_cv_have_s_issock=no)
4414 AC_MSG_RESULT($ac_cv_have_s_issock)
4415 if test "$ac_cv_have_s_issock" = "yes"; then
4416 AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
4419 AH_VERBATIM(_ISSOCK,
4421 #ifndef HAVE_S_ISSOCK
4422 #define HAVE_S_ISSOCK
4423 #define S_ISSOCK(mode) (1==0)
4429 dnl ------------------------------------------------------------------------
4430 dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
4431 dnl ------------------------------------------------------------------------
4433 AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
4435 AC_MSG_CHECKING(for MAXPATHLEN)
4436 AC_CACHE_VAL(ac_cv_maxpathlen,
4438 cat > conftest.$ac_ext <<EOF
4440 # include <stdlib.h>
4443 #include <sys/param.h>
4445 #define MAXPATHLEN 1024
4448 KDE_HELLO MAXPATHLEN
4452 ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
4454 if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
4455 ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
4457 ac_cv_maxpathlen=1024
4463 AC_MSG_RESULT($ac_cv_maxpathlen)
4464 AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
4467 AC_DEFUN([KDE_CHECK_HEADER],
4470 kde_safe_cppflags=$CPPFLAGS
4471 CPPFLAGS="$CPPFLAGS $all_includes"
4473 AC_CHECK_HEADER([$1], [$2], [$3], [$4])
4474 CPPFLAGS=$kde_safe_cppflags
4478 AC_DEFUN([KDE_CHECK_HEADERS],
4480 AH_CHECK_HEADERS([$1])
4482 kde_safe_cppflags=$CPPFLAGS
4483 CPPFLAGS="$CPPFLAGS $all_includes"
4485 AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
4486 CPPFLAGS=$kde_safe_cppflags
4490 AC_DEFUN([KDE_FAST_CONFIGURE],
4492 dnl makes configure fast (needs perl)
4493 AC_ARG_ENABLE(fast-perl, [ --disable-fast-perl disable fast Makefile generation (needs perl)],
4494 with_fast_perl=$enableval, with_fast_perl=yes)
4497 AC_DEFUN([KDE_CONF_FILES],
4500 if test -f $srcdir/configure.files ; then
4501 val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
4504 if test -n "$val" ; then
4506 CONF_FILES="$CONF_FILES $i"
4509 AC_SUBST(CONF_FILES)
4512 AC_DEFUN([KDE_SET_PREFIX],
4515 dnl make $KDEDIR the default for the installation
4516 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
4518 if test "x$prefix" = "xNONE"; then
4519 prefix=$ac_default_prefix
4520 ac_configure_args="$ac_configure_args --prefix=$prefix"
4522 # And delete superfluous '/' to make compares easier
4523 prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4524 exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4529 pushdef([AC_PROG_INSTALL],
4531 dnl our own version, testing for a -p flag
4532 popdef([AC_PROG_INSTALL])
4533 dnl as AC_PROG_INSTALL works as it works we first have
4534 dnl to save if the user didn't specify INSTALL, as the
4535 dnl autoconf one overwrites INSTALL and we have no chance to find
4537 test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
4538 test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
4539 test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
4542 if test -z "$kde_save_INSTALL_given" ; then
4543 # OK, user hasn't given any INSTALL, autoconf found one for us
4544 # now we test, if it supports the -p flag
4545 AC_MSG_CHECKING(for -p flag to install)
4546 rm -f confinst.$$.* > /dev/null 2>&1
4547 echo "Testtest" > confinst.$$.orig
4549 if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
4550 if test -f confinst.$$.new ; then
4551 # OK, -p seems to do no harm to install
4552 INSTALL="${INSTALL} -p"
4557 AC_MSG_RESULT($ac_res)
4559 dnl the following tries to resolve some signs and wonders coming up
4560 dnl with different autoconf/automake versions
4562 dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
4563 dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
4564 dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
4565 dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
4566 dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
4567 dnl install-@DIR@PROGRAMS targets to explicitly use that flag
4568 dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
4569 dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
4570 dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
4571 dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
4572 dnl automake (due to broken Makefile.am or whatever) to install programs,
4573 dnl and so does not see the -s flag in automake > 1.4
4574 dnl to clean up that mess we:
4575 dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
4576 dnl which cleans KDE's program with automake > 1.4;
4577 dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
4578 dnl with automake<=1.4
4579 dnl note that dues to this sometimes two '-s' flags are used (if KDE
4580 dnl properly uses install-@DIR@PROGRAMS, but I don't care
4582 dnl And to all this comes, that I even can't write in comments variable
4583 dnl names used by automake, because it is so stupid to think I wanted to
4584 dnl _use_ them, therefor I have written A_M_... instead of AM_
4585 dnl hmm, I wanted to say something ... ahh yes: Arghhh.
4587 if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
4588 INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
4590 if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
4591 INSTALL_SCRIPT='${INSTALL}'
4595 AC_DEFUN([KDE_LANG_CPLUSPLUS],
4597 ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
4598 pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
4601 pushdef([AC_LANG_CPLUSPLUS],
4602 [popdef([AC_LANG_CPLUSPLUS])
4606 AC_DEFUN([KDE_CHECK_LONG_LONG],
4608 AC_MSG_CHECKING(for long long)
4609 AC_CACHE_VAL(kde_cv_c_long_long,
4617 kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
4620 AC_MSG_RESULT($kde_cv_c_long_long)
4621 if test "$kde_cv_c_long_long" = yes; then
4622 AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
4626 AC_DEFUN([KDE_CHECK_LIB],
4628 kde_save_LDFLAGS="$LDFLAGS"
4629 dnl AC_CHECK_LIB modifies LIBS, so save it here
4630 kde_save_LIBS="$LIBS"
4631 LDFLAGS="$LDFLAGS $all_libraries"
4633 aix*) LDFLAGS="-brtl $LDFLAGS"
4634 test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
4637 AC_CHECK_LIB($1, $2, $3, $4, $5)
4638 LDFLAGS="$kde_save_LDFLAGS"
4639 LIBS="$kde_save_LIBS"
4642 AC_DEFUN([KDE_JAVA_PREFIX],
4645 base=`basename "$1"`
4646 list=`ls -1 $dir 2> /dev/null`
4647 for entry in $list; do
4648 if test -d $dir/$entry/bin; then
4651 javadirs="$javadirs $dir/$entry/bin"
4654 elif test -d $dir/$entry/jre/bin; then
4657 javadirs="$javadirs $dir/$entry/jre/bin"
4664 dnl KDE_CHEC_JAVA_DIR(onlyjre)
4665 AC_DEFUN([KDE_CHECK_JAVA_DIR],
4669 [ --with-java=javadir use java installed in javadir, --without-java disables ],
4670 [ ac_java_dir=$withval
4674 AC_MSG_CHECKING([for Java])
4676 dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
4677 if test "x$ac_java_dir" = "xno"; then
4679 kde_java_includedir=no
4680 kde_java_libjvmdir=no
4681 kde_java_libgcjdir=no
4682 kde_java_libhpidir=no
4684 if test "x$ac_java_dir" = "x"; then
4687 dnl No option set -> collect list of candidate paths
4688 if test -n "$JAVA_HOME"; then
4689 KDE_JAVA_PREFIX($JAVA_HOME)
4691 KDE_JAVA_PREFIX(/usr/j2se)
4692 KDE_JAVA_PREFIX(/usr/lib/j2se)
4693 KDE_JAVA_PREFIX(/usr/j*dk*)
4694 KDE_JAVA_PREFIX(/usr/lib/j*dk*)
4695 KDE_JAVA_PREFIX(/opt/j*sdk*)
4696 KDE_JAVA_PREFIX(/usr/lib/java*)
4697 KDE_JAVA_PREFIX(/usr/java*)
4698 KDE_JAVA_PREFIX(/usr/java/j*dk*)
4699 KDE_JAVA_PREFIX(/usr/java/j*re*)
4700 KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
4701 KDE_JAVA_PREFIX(/usr/lib/SunJava*)
4702 KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
4703 KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
4704 KDE_JAVA_PREFIX(/opt/java*)
4709 for dir in $PATH; do
4710 if test -d "$dir"; then
4711 javadirs="$javadirs $dir"
4717 dnl Now javadirs contains a list of paths that exist, all ending with bin/
4718 for dir in $javadirs; do
4719 dnl Check for the java executable
4720 if test -x "$dir/java"; then
4721 dnl And also check for a libjvm.so somewhere under there
4722 dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
4723 if test "$dir" != "/usr/bin"; then
4724 libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4725 if test ! -f $libjvmdir/libjvm.so; then continue; fi
4726 jredirs="$jredirs $dir"
4731 dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
4735 for dir in $jredirs; do
4737 kde_java_bindir=$dir
4738 if test -x "$dir/javac"; then
4744 if test -n "$JAVAC"; then
4745 dnl this substitution might not work - well, we test for jni.h below
4746 kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
4748 kde_java_includedir=no
4751 dnl config option set
4752 kde_java_bindir=$ac_java_dir/bin
4753 if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
4754 kde_java_includedir=no
4756 kde_java_includedir=$ac_java_dir/include
4761 dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
4762 if test "x$kde_java_bindir" != "xno"; then
4764 dnl Look for libjvm.so
4765 kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4766 dnl Look for libgcj.so
4767 kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
4768 dnl Look for libhpi.so and avoid green threads
4769 kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
4771 dnl Now check everything's fine under there
4772 dnl the include dir is our flag for having the JDK
4773 if test -d "$kde_java_includedir"; then
4774 if test ! -x "$kde_java_bindir/javac"; then
4775 AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
4777 if test ! -x "$kde_java_bindir/javah"; then
4778 AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
4780 if test ! -x "$kde_java_bindir/jar"; then
4781 AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
4783 if test ! -r "$kde_java_includedir/jni.h"; then
4784 AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
4787 jni_includes="-I$kde_java_includedir"
4788 dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
4789 dnl and under linux here..
4791 dnl not needed for gcj
4793 if test "x$kde_java_libgcjdir" = "x"; then
4794 test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
4795 test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
4796 test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
4804 if test "x$kde_java_libgcjdir" = "x"; then
4805 if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
4806 AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
4809 if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
4810 AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
4814 if test ! -x "$kde_java_bindir/java"; then
4815 AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
4818 dnl not needed for gcj compile
4820 if test "x$kde_java_libgcjdir" = "x"; then
4821 if test ! -r "$kde_java_libhpidir/libhpi.so"; then
4822 AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
4826 if test -n "$jni_includes"; then
4827 dnl Check for JNI version
4830 ac_cxxflags_safe="$CXXFLAGS"
4831 CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
4837 #ifndef JNI_VERSION_1_2
4840 ],[ kde_jni_works=yes ],
4841 [ kde_jni_works=no ])
4843 if test $kde_jni_works = no; then
4844 AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
4845 You need to have Java Development Kit (JDK) version 1.2.
4847 Use --with-java to specify another location.
4848 Use --without-java to configure without java support.
4849 Or download a newer JDK and try again.
4850 See e.g. http://java.sun.com/products/jdk/1.2 ])
4853 CXXFLAGS="$ac_cxxflags_safe"
4856 dnl All tests ok, inform and subst the variables
4858 JAVAC=$kde_java_bindir/javac
4859 JAVAH=$kde_java_bindir/javah
4860 JAR=$kde_java_bindir/jar
4861 AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
4862 if test "x$kde_java_libgcjdir" = "x"; then
4863 JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
4865 JVMLIBS="-L$kde_java_libgcjdir -lgcj"
4867 AC_MSG_RESULT([java JDK in $kde_java_bindir])
4870 AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
4871 AC_MSG_RESULT([java JRE in $kde_java_bindir])
4873 elif test -d "/Library/Java/Home"; then
4874 kde_java_bindir="/Library/Java/Home/bin"
4875 jni_includes="-I/Library/Java/Home/include"
4877 JAVAC=$kde_java_bindir/javac
4878 JAVAH=$kde_java_bindir/javah
4879 JAR=$kde_java_bindir/jar
4880 JVMLIBS="-Xlinker -framework -Xlinker JavaVM"
4882 AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
4883 AC_MSG_RESULT([Apple Java Framework])
4885 AC_MSG_RESULT([none found])
4892 AC_SUBST(jni_includes)
4894 # for backward compat
4895 kde_cv_java_includedir=$kde_java_includedir
4896 kde_cv_java_bindir=$kde_java_bindir
4899 dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
4900 dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
4901 dnl big packages, m4_foreach is dog-slow. So use our own version of
4902 dnl it. (matz@kde.org)
4903 m4_define([mm_foreach],
4904 [m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
4905 m4_define([mm_car], [[$1]])
4906 m4_define([mm_car2], [[$@]])
4907 m4_define([_mm_foreach],
4908 [m4_if(m4_quote($2), [], [],
4909 [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
4910 mm_car2(m4_shift($2)),
4912 m4_define([AC_FOREACH],
4913 [mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
4915 AC_DEFUN([KDE_NEED_FLEX],
4918 LIBS="$LIBS $USER_LDFLAGS"
4921 if test -z "$LEXLIB"; then
4922 AC_MSG_ERROR([You need to have flex installed.])
4927 AC_DEFUN([AC_PATH_QTOPIA],
4929 dnl TODO: use AC_CACHE_VAL
4931 if test -z "$1"; then
4936 qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
4937 qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
4938 qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
4941 qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
4942 qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
4944 AC_REQUIRE([AC_PATH_QT])
4946 AC_MSG_CHECKING([for Qtopia])
4949 AC_SUBST(LIB_QTOPIA)
4951 kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
4955 AC_ARG_WITH(qtopia-dir,
4956 [ --with-qtopia-dir=DIR where the root of Qtopia is installed ],
4957 [ ac_qtopia_incdir="$withval"/include] )
4960 for dir in $kde_qtopia_dirs; do
4961 qtopia_incdirs="$qtopia_incdirs $dir/include"
4964 if test ! "$ac_qtopia_incdir" = "NO"; then
4965 qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
4969 AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
4970 ac_qtopia_incdir="$qtopia_incdir"
4972 if test -z "$qtopia_incdir"; then
4973 AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
4976 qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
4977 qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
4978 qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
4980 qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
4981 qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
4982 if test "$qtopia_ver" -lt "$qtopia_minver"; then
4983 AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
4990 ac_cxxflags_safe="$CXXFLAGS"
4991 ac_ldflags_safe="$LDFLAGS"
4992 ac_libs_safe="$LIBS"
4994 CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
4995 LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
4996 LIBS="$LIBS $LIB_QTOPIA $LIBQT"
4998 cat > conftest.$ac_ext <<EOF
4999 #include "confdefs.h"
5000 #include <qpe/qpeapplication.h>
5001 #include <qpe/version.h>
5003 int main( int argc, char **argv )
5005 QPEApplication app( argc, argv );
5010 if AC_TRY_EVAL(ac_link) && test -s conftest; then
5014 AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
5015 the end of config.log])
5018 CXXFLAGS="$ac_cxxflags_safe"
5019 LDFLAGS="$ac_ldflags_safe"
5020 LIBS="$ac_libs_safe"
5024 QTOPIA_INCLUDES="-I$qtopia_incdir"
5025 AC_SUBST(QTOPIA_INCLUDES)
5027 AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
5031 AC_DEFUN([KDE_INIT_DOXYGEN],
5033 AC_MSG_CHECKING([for Qt docs])
5035 if test "${with_qt_dir+set}" = set; then
5036 kde_qtdir="$with_qt_dir"
5039 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)
5040 AC_MSG_RESULT($QTDOCDIR)
5044 KDE_FIND_PATH(dot, DOT, [], [])
5045 if test -n "$DOT"; then
5050 AC_SUBST(KDE_HAVE_DOT)
5051 KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
5054 DOXYGEN_PROJECT_NAME="$1"
5055 DOXYGEN_PROJECT_NUMBER="$2"
5056 AC_SUBST(DOXYGEN_PROJECT_NAME)
5057 AC_SUBST(DOXYGEN_PROJECT_NUMBER)
5060 if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
5063 AC_SUBST(KDE_HAS_DOXYGEN)
5068 AC_DEFUN([AC_FIND_BZIP2],
5070 AC_MSG_CHECKING([for bzDecompress in libbz2])
5071 AC_CACHE_VAL(ac_cv_lib_bzip2,
5075 kde_save_LIBS="$LIBS"
5076 LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
5077 kde_save_CXXFLAGS="$CXXFLAGS"
5078 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
5084 [ bz_stream s; (void) bzDecompress(&s); ],
5085 eval "ac_cv_lib_bzip2='-lbz2'",
5086 eval "ac_cv_lib_bzip2=no")
5087 LIBS="$kde_save_LIBS"
5088 CXXFLAGS="$kde_save_CXXFLAGS"
5091 AC_MSG_RESULT($ac_cv_lib_bzip2)
5093 if test ! "$ac_cv_lib_bzip2" = no; then
5096 LIBBZ2="$ac_cv_lib_bzip2"
5103 KDE_CHECK_COMPILER_FLAG(shared, [
5104 ld_shared_flag="-shared"
5106 KDE_CHECK_COMPILER_FLAG(fPIC, [
5107 cxx_shared_flag="-fPIC"
5110 AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
5111 AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
5115 kde_save_LIBS="$LIBS"
5116 LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
5117 kde_save_CXXFLAGS="$CXXFLAGS"
5118 CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
5125 [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
5126 eval "ac_cv_lib_bzip2_prefix='-lbz2'",
5127 eval "ac_cv_lib_bzip2_prefix=no")
5128 LIBS="$kde_save_LIBS"
5129 CXXFLAGS="$kde_save_CXXFLAGS"
5133 AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
5135 if test ! "$ac_cv_lib_bzip2_prefix" = no; then
5138 LIBBZ2="$ac_cv_lib_bzip2_prefix"
5141 AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
5142 dnl else, we just ignore this
5146 AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
5149 dnl ------------------------------------------------------------------------
5150 dnl Try to find the SSL headers and libraries.
5151 dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
5152 dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
5153 dnl ------------------------------------------------------------------------
5155 AC_DEFUN([KDE_CHECK_SSL],
5157 LIBSSL="-lssl -lcrypto"
5158 AC_REQUIRE([KDE_CHECK_LIB64])
5160 ac_ssl_includes=NO ac_ssl_libraries=NO
5163 AC_ARG_WITH(ssl-dir,
5164 [ --with-ssl-dir=DIR where the root of OpenSSL is installed],
5165 [ ac_ssl_includes="$withval"/include
5166 ac_ssl_libraries="$withval"/lib$kdelibsuff
5171 [ --without-ssl disable SSL checks],
5172 [want_ssl=$withval])
5174 if test $want_ssl = yes; then
5176 AC_MSG_CHECKING(for OpenSSL)
5178 AC_CACHE_VAL(ac_cv_have_ssl,
5179 [#try to guess OpenSSL locations
5181 ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
5182 ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
5183 AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
5184 ac_ssl_includes="$ssl_incdir"
5186 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"
5187 if test ! "$ac_ssl_libraries" = "NO"; then
5188 ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
5193 for dir in $ssl_libdirs; do
5194 try="ls -1 $dir/libssl*"
5195 if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
5198 ac_ssl_libraries="$ssl_libdir"
5200 ac_ldflags_safe="$LDFLAGS"
5201 ac_libs_safe="$LIBS"
5203 LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
5204 LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
5206 AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
5212 LDFLAGS="$ac_ldflags_safe"
5213 LIBS="$ac_libs_safe"
5215 if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
5223 eval "$ac_cv_have_ssl"
5225 AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
5227 AC_MSG_CHECKING([whether OpenSSL uses rsaref])
5228 AC_MSG_RESULT($ac_ssl_rsaref)
5230 AC_MSG_CHECKING([for easter eggs])
5231 AC_MSG_RESULT([none found])
5237 if test "$have_ssl" = yes; then
5238 AC_MSG_CHECKING(for OpenSSL version)
5239 dnl Check for SSL version
5240 AC_CACHE_VAL(ac_cv_ssl_version,
5243 cat >conftest.$ac_ext <<EOF
5244 #include <openssl/opensslv.h>
5248 #ifndef OPENSSL_VERSION_NUMBER
5249 printf("ssl_version=\\"error\\"\n");
5251 if (OPENSSL_VERSION_NUMBER < 0x00906000)
5252 printf("ssl_version=\\"old\\"\n");
5254 printf("ssl_version=\\"ok\\"\n");
5260 ac_save_CPPFLAGS=$CPPFLAGS
5261 if test "$ac_ssl_includes" != "/usr/include"; then
5262 CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
5265 if AC_TRY_EVAL(ac_link); then
5267 if eval `./conftest 2>&5`; then
5268 if test $ssl_version = error; then
5269 AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
5271 if test $ssl_version = old; then
5272 AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
5276 ac_cv_ssl_version="ssl_version=$ssl_version"
5278 AC_MSG_ERROR([Your system couldn't run a small SSL test program.
5279 Check config.log, and if you can't figure it out, send a mail to
5280 David Faure <faure@kde.org>, attaching your config.log])
5284 AC_MSG_ERROR([Your system couldn't link a small SSL test program.
5285 Check config.log, and if you can't figure it out, send a mail to
5286 David Faure <faure@kde.org>, attaching your config.log])
5288 CPPFLAGS=$ac_save_CPPFLAGS
5292 eval "$ac_cv_ssl_version"
5293 AC_MSG_RESULT($ssl_version)
5296 if test "$have_ssl" != yes; then
5299 AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
5300 ac_cv_have_ssl="have_ssl=yes \
5301 ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
5304 ssl_libraries="$ac_ssl_libraries"
5305 ssl_includes="$ac_ssl_includes"
5307 if test "$ac_ssl_rsaref" = yes; then
5308 LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref"
5311 if test $ssl_version = "old"; then
5312 AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
5318 if test "$ssl_includes" = "/usr/include"; then
5319 if test -f /usr/kerberos/include/krb5.h; then
5320 SSL_INCLUDES="-I/usr/kerberos/include"
5322 elif test "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
5323 SSL_INCLUDES="-I$ssl_includes"
5326 if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
5329 SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
5332 AC_SUBST(SSL_INCLUDES)
5333 AC_SUBST(SSL_LDFLAGS)
5337 AC_DEFUN([KDE_CHECK_STRLCPY],
5339 AC_REQUIRE([AC_CHECK_STRLCAT])
5340 AC_REQUIRE([AC_CHECK_STRLCPY])
5341 AC_CHECK_SIZEOF(size_t)
5342 AC_CHECK_SIZEOF(unsigned long)
5344 AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
5346 #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
5349 ],AC_MSG_RESULT([yes]),[
5352 Apparently on your system our assumption sizeof size_t == sizeof unsigned long
5353 does not apply. Please mail kde-devel@kde.org with a description of your system!
5358 AC_DEFUN([KDE_CHECK_BINUTILS],
5360 AC_MSG_CHECKING([if ld supports unversioned version maps])
5362 kde_save_LDFLAGS="$LDFLAGS"
5363 LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
5364 echo "{ local: extern \"C++\" { foo }; };" > conftest.map
5365 AC_TRY_LINK([int foo;],
5367 #ifdef __INTEL_COMPILER
5368 icc apparently does not support libtools version-info and version-script
5369 at the same time. Dunno where the bug is, but until somebody figured out,
5370 better disable the optional version scripts.
5374 ], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
5375 LDFLAGS="$kde_save_LDFLAGS"
5377 AM_CONDITIONAL(include_VERSION_SCRIPT,
5378 [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
5380 AC_MSG_RESULT($kde_supports_versionmaps)
5383 AC_DEFUN([AM_PROG_OBJC],[
5384 AC_CHECK_PROGS(OBJC, gcc, gcc)
5385 test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
5386 if test "x${OBJCFLAGS-unset}" = xunset; then
5390 _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
5393 AC_DEFUN([KDE_CHECK_PERL],
5395 KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
5396 AC_MSG_ERROR([No Perl found in your $PATH.
5397 We need perl to generate some code.])