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.
29 dnl ------------------------------------------------------------------------
30 dnl Forward compatibility macros (make autoconf 2.13 look like 2.50),
31 dnl thanks to Raja R Harinath.
32 dnl ------------------------------------------------------------------------
34 ifdef([_AC_PATH_X_XMKMF],[],
35 [AC_DEFUN([_AC_PATH_X_XMKMF],[AC_PATH_X_XMKMF])])
36 ifdef([AC_OUTPUT_SUBDIRS],[],
37 [AC_DEFUN([AC_OUTPUT_SUBDIRS],[subdirs=$1; _AC_OUTPUT_SUBDIRS])])
40 dnl Internal subroutine of AC_PATH_X.
41 dnl Set ac_x_includes and/or ac_x_libraries.
42 AC_DEFUN(KDE_PATH_X_DIRECT,
44 AC_REQUIRE([KDE_CHECK_LIB64])
46 if test "$ac_x_includes" = NO; then
47 # Guess where to find include files, by looking for this one X11 .h file.
48 test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
50 # First, try using that file with no special directory specified.
51 AC_TRY_CPP([#include <$x_direct_test_include>],
52 [# We can compile using X headers with no special include directory.
54 [# Look for the header file in a standard set of common directories.
55 # Check X11 before X11Rn because it is often a symlink to the current release.
67 /usr/local/X11/include \
68 /usr/local/X11R6/include \
69 /usr/local/X11R5/include \
70 /usr/local/X11R4/include \
72 /usr/local/include/X11 \
73 /usr/local/include/X11R6 \
74 /usr/local/include/X11R5 \
75 /usr/local/include/X11R4 \
79 /usr/XFree86/include/X11 \
83 /usr/unsupported/include \
85 /usr/local/x11r5/include \
86 /usr/lpp/Xamples/include \
88 /usr/openwin/include \
89 /usr/openwin/share/include \
92 if test -r "$ac_dir/$x_direct_test_include"; then
97 fi # $ac_x_includes = NO
99 if test "$ac_x_libraries" = NO; then
100 # Check for the libraries.
102 test -z "$x_direct_test_library" && x_direct_test_library=Xt
103 test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
105 # See if we find them without any special options.
106 # Don't add to $LIBS permanently.
108 LIBS="-l$x_direct_test_library $LIBS"
109 AC_TRY_LINK(, [${x_direct_test_function}()],
110 [LIBS="$ac_save_LIBS"
111 # We can link X programs with no special library path.
113 [LIBS="$ac_save_LIBS"
114 # First see if replacing the include by lib works.
115 # Check X11 before X11Rn because it is often a symlink to the current release.
116 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \
117 /usr/X11/lib${kdelibsuff} \
118 /usr/X11R6/lib${kdelibsuff} \
119 /usr/X11R5/lib${kdelibsuff} \
120 /usr/X11R4/lib${kdelibsuff} \
122 /usr/lib${kdelibsuff}/X11 \
123 /usr/lib${kdelibsuff}/X11R6 \
124 /usr/lib${kdelibsuff}/X11R5 \
125 /usr/lib${kdelibsuff}/X11R4 \
127 /usr/local/X11/lib${kdelibsuff} \
128 /usr/local/X11R6/lib${kdelibsuff} \
129 /usr/local/X11R5/lib${kdelibsuff} \
130 /usr/local/X11R4/lib${kdelibsuff} \
132 /usr/local/lib${kdelibsuff}/X11 \
133 /usr/local/lib${kdelibsuff}/X11R6 \
134 /usr/local/lib${kdelibsuff}/X11R5 \
135 /usr/local/lib${kdelibsuff}/X11R4 \
137 /usr/X386/lib${kdelibsuff} \
138 /usr/x386/lib${kdelibsuff} \
139 /usr/XFree86/lib${kdelibsuff}/X11 \
141 /usr/lib${kdelibsuff} \
142 /usr/local/lib${kdelibsuff} \
143 /usr/unsupported/lib${kdelibsuff} \
144 /usr/athena/lib${kdelibsuff} \
145 /usr/local/x11r5/lib${kdelibsuff} \
146 /usr/lpp/Xamples/lib${kdelibsuff} \
147 /lib/usr/lib${kdelibsuff}/X11 \
149 /usr/openwin/lib${kdelibsuff} \
150 /usr/openwin/share/lib${kdelibsuff} \
153 dnl Don't even attempt the hair of trying to link an X program!
154 for ac_extension in a so sl; do
155 if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
156 ac_x_libraries=$ac_dir
161 fi # $ac_x_libraries = NO
165 dnl ------------------------------------------------------------------------
166 dnl Find a file (or one of more files in a list of dirs)
167 dnl ------------------------------------------------------------------------
169 AC_DEFUN(AC_FIND_FILE,
176 echo "configure: __oline__: $i/$j" >&AC_FD_CC
177 if test -r "$i/$j"; then
178 echo "taking that" >&AC_FD_CC
186 dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,
187 dnl if-not-found, test-parameter)
188 AC_DEFUN(KDE_FIND_PATH,
190 AC_MSG_CHECKING([for $1])
191 if test -n "$$2"; then
194 kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
196 AC_CACHE_VAL(kde_cv_path_$kde_cache,
208 if test -x "$dir/$1"; then
211 evalstr="$dir/$1 $5 2>&1 "
212 if eval $evalstr; then
213 kde_cv_path="$dir/$1"
217 kde_cv_path="$dir/$1"
223 eval "kde_cv_path_$kde_cache=$kde_cv_path"
227 eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
231 if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
232 AC_MSG_RESULT(not found)
235 AC_MSG_RESULT($kde_cv_path)
241 AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
243 AC_MSG_ERROR([No Qt meta object compiler (moc) found!
244 Please check whether you installed Qt correctly.
245 You need to have a running moc binary.
246 configure tried to run $ac_cv_path_moc and the test didn't
247 succeed. If configure shouldn't have tried this one, set
248 the environment variable MOC to the right one before running
253 AC_DEFUN(KDE_UIC_ERROR_MESSAGE,
255 AC_MSG_WARN([No Qt ui compiler (uic) found!
256 Please check whether you installed Qt correctly.
257 You need to have a running uic binary.
258 configure tried to run $ac_cv_path_uic and the test didn't
259 succeed. If configure shouldn't have tried this one, set
260 the environment variable UIC to the right one before running
266 AC_DEFUN(KDE_CHECK_UIC_FLAG,
268 AC_MSG_CHECKING([whether uic supports -$1 ])
269 kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
270 AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
272 cat >conftest.ui <<EOT
273 <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
275 ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
276 if AC_TRY_EVAL(ac_uic_testrun); then
277 eval "kde_cv_prog_uic_$kde_cache=yes"
279 eval "kde_cv_prog_uic_$kde_cache=no"
284 if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
296 dnl ------------------------------------------------------------------------
297 dnl Find the meta object compiler and the ui compiler in the PATH,
298 dnl in $QTDIR/bin, and some more usual places
299 dnl ------------------------------------------------------------------------
301 AC_DEFUN(AC_PATH_QT_MOC_UIC,
304 for dir in $kde_qt_dirs; do
305 qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
307 qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
308 if test ! "$ac_qt_bindir" = "NO"; then
309 qt_bindirs="$ac_qt_bindir $qt_bindirs"
312 KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
313 if test -z "$UIC_NOT_NEEDED"; then
314 KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
315 if test -z "$UIC_PATH" ; then
316 KDE_UIC_ERROR_MESSAGE
318 elif test $kde_qtver = 3; then
319 KDE_CHECK_UIC_FLAG(L,[/nonexistant],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
320 KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
323 if test x$ac_uic_supports_libpath = xyes; then
324 UIC="$UIC -L \$(kde_widgetdir)"
326 if test x$ac_uic_supports_nounload = xyes; then
331 UIC="echo uic not available: "
338 if test $kde_qtver = 3; then
345 AC_DEFUN(KDE_1_CHECK_PATHS,
347 KDE_1_CHECK_PATH_HEADERS
351 if test -n "$USE_RPATH"; then
353 if test -n "$kde_libraries"; then
354 KDE_TEST_RPATH="-R $kde_libraries"
357 if test -n "$qt_libraries"; then
358 KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
361 if test -n "$x_libraries"; then
362 KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
365 KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
368 AC_MSG_CHECKING([for KDE libraries installed])
369 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'
371 if AC_TRY_EVAL(ac_link) && test -s conftest; then
374 AC_MSG_ERROR([your system fails at linking a small KDE application!
375 Check, if your compiler is installed correctly and if you have used the
376 same compiler to compile Qt and kdelibs as you did use now.
377 For more details about this problem, look at the end of config.log.])
380 if eval `KDEDIR= ./conftest 2>&5`; then
386 KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
387 kde_have_all_paths=yes
389 KDE_SET_PATHS($kde_result)
393 AC_DEFUN(KDE_SET_PATHS,
395 kde_cv_all_paths="kde_have_all_paths=\"yes\" \
396 kde_htmldir=\"$kde_htmldir\" \
397 kde_appsdir=\"$kde_appsdir\" \
398 kde_icondir=\"$kde_icondir\" \
399 kde_sounddir=\"$kde_sounddir\" \
400 kde_datadir=\"$kde_datadir\" \
401 kde_locale=\"$kde_locale\" \
402 kde_cgidir=\"$kde_cgidir\" \
403 kde_confdir=\"$kde_confdir\" \
404 kde_mimedir=\"$kde_mimedir\" \
405 kde_toolbardir=\"$kde_toolbardir\" \
406 kde_wallpaperdir=\"$kde_wallpaperdir\" \
407 kde_templatesdir=\"$kde_templatesdir\" \
408 kde_bindir=\"$kde_bindir\" \
409 kde_servicesdir=\"$kde_servicesdir\" \
410 kde_servicetypesdir=\"$kde_servicetypesdir\" \
411 kde_moduledir=\"$kde_moduledir\" \
412 kde_styledir=\"$kde_styledir\" \
413 kde_widgetdir=\"$kde_widgetdir\" \
417 AC_DEFUN(KDE_SET_DEFAULT_PATHS,
419 if test "$1" = "default"; then
421 if test -z "$kde_htmldir"; then
422 kde_htmldir='\${prefix}/share/doc/HTML'
424 if test -z "$kde_appsdir"; then
425 kde_appsdir='\${prefix}/share/applnk'
427 if test -z "$kde_icondir"; then
428 kde_icondir='\${prefix}/share/icons'
430 if test -z "$kde_sounddir"; then
431 kde_sounddir='\${prefix}/share/sounds'
433 if test -z "$kde_datadir"; then
434 kde_datadir='\${prefix}/share/apps'
436 if test -z "$kde_locale"; then
437 kde_locale='\${prefix}/share/locale'
439 if test -z "$kde_cgidir"; then
440 kde_cgidir='\${exec_prefix}/cgi-bin'
442 if test -z "$kde_confdir"; then
443 kde_confdir='\${prefix}/share/config'
445 if test -z "$kde_mimedir"; then
446 kde_mimedir='\${prefix}/share/mimelnk'
448 if test -z "$kde_toolbardir"; then
449 kde_toolbardir='\${prefix}/share/toolbar'
451 if test -z "$kde_wallpaperdir"; then
452 kde_wallpaperdir='\${prefix}/share/wallpapers'
454 if test -z "$kde_templatesdir"; then
455 kde_templatesdir='\${prefix}/share/templates'
457 if test -z "$kde_bindir"; then
458 kde_bindir='\${exec_prefix}/bin'
460 if test -z "$kde_servicesdir"; then
461 kde_servicesdir='\${prefix}/share/services'
463 if test -z "$kde_servicetypesdir"; then
464 kde_servicetypesdir='\${prefix}/share/servicetypes'
466 if test -z "$kde_moduledir"; then
467 if test "$kde_qtver" = "2"; then
468 kde_moduledir='\${libdir}/kde2'
470 kde_moduledir='\${libdir}/kde3'
473 if test -z "$kde_styledir"; then
474 kde_styledir='\${libdir}/kde3/plugins/styles'
476 if test -z "$kde_widgetdir"; then
477 kde_widgetdir='\${libdir}/kde3/plugins/designer'
480 KDE_SET_PATHS(defaults)
484 if test $kde_qtver = 1; then
485 AC_MSG_RESULT([compiling])
488 AC_MSG_ERROR([path checking not yet supported for KDE 2])
494 AC_DEFUN(KDE_CHECK_PATHS_FOR_COMPLETENESS,
495 [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
496 test -z "$kde_icondir" || test -z "$kde_sounddir" ||
497 test -z "$kde_datadir" || test -z "$kde_locale" ||
498 test -z "$kde_cgidir" || test -z "$kde_confdir" ||
499 test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
500 test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
501 test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
502 test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
503 test -z "$kde_styledir" || test -z "kde_widgetdir"
504 test "x$kde_have_all_paths" != "xyes"; then
505 kde_have_all_paths=no
509 AC_DEFUN(KDE_MISSING_PROG_ERROR,
511 AC_MSG_ERROR([The important program $1 was not found!
512 Please check whether you installed KDE correctly.
516 AC_DEFUN(KDE_MISSING_ARTS_ERROR,
518 AC_MSG_ERROR([The important program $1 was not found!
519 Please check whether you installed aRts correctly.
523 AC_DEFUN(KDE_SUBST_PROGRAMS,
526 kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin"
527 test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
528 if test -n "$KDEDIRS"; then
531 for dir in $KDEDIRS; do
532 kde_default_bindirs="$dir/bin $kde_default_bindirs "
536 kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
537 KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
538 KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
539 KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
540 KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
541 KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs])
542 KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
544 if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then
545 kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
546 test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
547 AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
548 if test "$KDE_XSL_STYLESHEET" = "NO"; then
549 KDE_XSL_STYLESHEET=""
551 KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
555 DCOP_DEPENDENCIES='$(DCOPIDL)'
557 AC_SUBST(DCOPIDL2CPP)
558 AC_SUBST(DCOP_DEPENDENCIES)
560 AC_SUBST(ARTSCCONFIG)
563 AC_SUBST(KDE_XSL_STYLESHEET)
565 if test -x "$KDECONFIG"; then # it can be "compiled"
566 kde_libs_prefix=`$KDECONFIG --prefix`
567 if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
568 AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
569 This means it has been moved since you installed it.
570 This won't work. Please recompile kdelibs for the new prefix.
573 kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
575 kde_libs_prefix='$(prefix)'
576 kde_libs_htmldir='$(kde_htmldir)'
578 AC_SUBST(kde_libs_prefix)
579 AC_SUBST(kde_libs_htmldir)
582 AC_DEFUN(AC_CREATE_KFSSTND,
584 AC_REQUIRE([AC_CHECK_RPATH])
586 AC_MSG_CHECKING([for KDE paths])
589 AC_CACHE_VAL(kde_cv_all_paths,
591 KDE_SET_DEFAULT_PATHS($1)
594 eval "$kde_cv_all_paths"
595 KDE_CHECK_PATHS_FOR_COMPLETENESS
596 if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
597 # wrong values were cached, may be, we can set better ones
599 kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
600 kde_datadir= kde_locale= kde_cgidir= kde_confdir=
601 kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
602 kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
606 KDE_SET_DEFAULT_PATHS($1)
607 eval "$kde_cv_all_paths"
608 KDE_CHECK_PATHS_FOR_COMPLETENESS
609 kde_result="$kde_result (cache overridden)"
611 if test "$kde_have_all_paths" = "no"; then
612 AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
613 Since it had compiled and linked before, it must be a strange problem on your system.
614 Look at config.log for details. If you are not able to fix this, look at
615 http://www.kde.org/faq/installation.html or any www.kde.org mirror.
616 (If you're using an egcs version on Linux, you may update binutils!)
620 AC_MSG_RESULT($kde_result)
629 AC_DEFUN(AC_SUBST_KFSSTND,
631 AC_SUBST(kde_htmldir)
632 AC_SUBST(kde_appsdir)
633 AC_SUBST(kde_icondir)
634 AC_SUBST(kde_sounddir)
635 AC_SUBST(kde_datadir)
637 AC_SUBST(kde_confdir)
638 AC_SUBST(kde_mimedir)
639 AC_SUBST(kde_wallpaperdir)
642 AC_SUBST(kde_templatesdir)
643 AC_SUBST(kde_servicesdir)
644 AC_SUBST(kde_servicetypesdir)
645 AC_SUBST(kde_moduledir)
646 AC_SUBST(kde_styledir)
647 AC_SUBST(kde_widgetdir)
648 if test "$kde_qtver" = 1; then
649 kde_minidir="$kde_icondir/mini"
651 # for KDE 1 - this breaks KDE2 apps using minidir, but
652 # that's the plan ;-/
653 kde_minidir="/dev/null"
655 dnl AC_SUBST(kde_minidir)
656 dnl AC_SUBST(kde_cgidir)
657 dnl AC_SUBST(kde_toolbardir)
660 AC_DEFUN(KDE_MISC_TESTS,
663 dnl Checks for libraries.
664 AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
666 AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
669 AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
670 AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
671 AC_MSG_WARN([you have no crypt in either libcrypt or libc.
672 You should install libcrypt from another source or configure with PAM
677 if test $kde_have_crypt = yes; then
678 AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
682 AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
683 if test $ac_cv_lib_dnet_dnet_ntoa = no; then
684 AC_CHECK_LIB(dnet_stub, dnet_ntoa,
685 [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
687 AC_CHECK_FUNC(inet_ntoa)
688 if test $ac_cv_func_inet_ntoa = no; then
689 AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
691 AC_CHECK_FUNC(connect)
692 if test $ac_cv_func_connect = no; then
693 AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
697 AC_CHECK_FUNC(remove)
698 if test $ac_cv_func_remove = no; then
699 AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
702 # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
703 AC_CHECK_FUNC(shmat, ,
704 AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
706 # darwin needs this to initialize the environment
707 AC_CHECK_HEADERS(crt_externs.h)
708 AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
710 # more headers that need to be explicitly included on darwin
711 AC_CHECK_HEADERS(sys/types.h stdint.h)
713 # darwin requires a poll emulation library
714 AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
716 # CoreAudio framework
717 AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
718 AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
719 FRAMEWORK_COREAUDIO="-framework CoreAudio"
724 AC_SUBST(FRAMEWORK_COREAUDIO)
725 LIBSOCKET="$X_EXTRA_LIBS"
727 AC_SUBST(X_EXTRA_LIBS)
728 AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
731 case $host in dnl this *is* LynxOS specific
733 AC_MSG_CHECKING([LynxOS header file wrappers])
734 [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
735 AC_MSG_RESULT(disabled)
736 AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
743 AH_VERBATIM(_AIX_STRINGS_H_BZERO,
746 * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
747 * that defines bzero.
755 AC_CHECK_FUNCS([vsnprintf snprintf])
759 * On HP-UX, the declaration of vsnprintf() is needed every time !
762 #if !defined(HAVE_VSNPRINTF) || defined(hpux)
772 int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
776 int snprintf(char *str, size_t n, char const *fmt, ...);
782 dnl ------------------------------------------------------------------------
783 dnl Find the header files and libraries for X-Windows. Extended the
785 dnl ------------------------------------------------------------------------
789 AC_REQUIRE([KDE_MISC_TESTS])dnl
790 AC_REQUIRE([KDE_CHECK_LIB64])
794 [ --enable-embedded link to Qt-embedded, don't use X],
795 kde_use_qt_emb=$enableval,
801 [ --enable-qtopia link to Qt-embedded, link to the Qtopia Environment],
802 kde_use_qt_emb_palm=$enableval,
803 kde_use_qt_emb_palm=no
806 if test "$kde_use_qt_emb" = "no"; then
808 AC_MSG_CHECKING(for X)
811 AC_CACHE_VAL(kde_cv_have_x,
812 [# One or both of the vars are not set, and there is no cached value.
813 if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
816 kde_x_includes=$x_includes
818 if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
821 kde_x_libraries=$x_libraries
824 # below we use the standard autoconf calls
825 ac_x_libraries=$kde_x_libraries
826 ac_x_includes=$kde_x_includes
829 dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
830 dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
831 dnl location. The correct location is /usr/lib32 or an undefined value
832 dnl (the linker is smart enough to pick the correct default library).
833 dnl Things work just fine if you use just AC_PATH_X_DIRECT.
834 dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
835 dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
836 dnl x_includes should be left alone.
844 if test -z "$ac_x_includes"; then
847 if test -z "$ac_x_libraries"; then
848 ac_x_libraries="/usr/lib${kdelibsuff}"
851 #from now on we use our own again
853 # when the user already gave --x-includes, we ignore
854 # what the standard autoconf macros told us.
855 if test "$kde_x_includes" = NO; then
856 kde_x_includes=$ac_x_includes
859 # for --x-libraries too
860 if test "$kde_x_libraries" = NO; then
861 kde_x_libraries=$ac_x_libraries
864 if test "$kde_x_includes" = NO; then
865 AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
868 if test "$kde_x_libraries" = NO; then
869 AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
872 # Record where we found X for the cache.
873 kde_cv_have_x="have_x=yes \
874 kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
877 eval "$kde_cv_have_x"
879 if test "$have_x" != yes; then
880 AC_MSG_RESULT($have_x)
883 AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
886 if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
888 x_includes="."; dnl better than nothing :-
890 x_includes=$kde_x_includes
891 X_INCLUDES="-I$x_includes"
894 if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
896 x_libraries="/usr/lib"; dnl better than nothing :-
898 x_libraries=$kde_x_libraries
899 X_LDFLAGS="-L$x_libraries"
901 all_includes="$X_INCLUDES"
902 all_libraries="$X_LDFLAGS"
906 AC_SUBST(x_libraries)
909 # Check for libraries that X11R6 Xt/Xaw programs need.
910 ac_save_LDFLAGS="$LDFLAGS"
911 LDFLAGS="$LDFLAGS $X_LDFLAGS"
912 # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
913 # check for ICE first), but we must link in the order -lSM -lICE or
914 # we get undefined symbols. So assume we have SM if we have ICE.
915 # These have to be linked with before -lX11, unlike the other
916 # libraries we check for below, so use a different variable.
917 # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
918 AC_CHECK_LIB(ICE, IceConnectionNumber,
919 [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
921 LDFLAGS="$ac_save_LDFLAGS"
925 LIB_X11='-lX11 $(LIBSOCKET)'
928 AC_MSG_CHECKING(for libXext)
929 AC_CACHE_VAL(kde_cv_have_libXext,
931 kde_ldflags_safe="$LDFLAGS"
932 kde_libs_safe="$LIBS"
934 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
935 LIBS="-lXext -lX11 $LIBSOCKET"
944 printf("hello Xext\n");
946 kde_cv_have_libXext=yes,
947 kde_cv_have_libXext=no
950 LDFLAGS=$kde_ldflags_safe
954 AC_MSG_RESULT($kde_cv_have_libXext)
956 if test "$kde_cv_have_libXext" = "no"; then
957 AC_MSG_ERROR([We need a working libXext to proceed. Since configure
958 can't find it itself, we stop here assuming that make wouldn't find
962 AC_MSG_CHECKING(for Xinerama)
964 AC_ARG_WITH(xinerama,
965 [ --with-xinerama enable support for Xinerama ],
973 kde_save_LDFLAGS="$LDFLAGS"
974 kde_save_CFLAGS="$CFLAGS"
975 kde_save_LIBS="$LIBS"
976 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
977 CFLAGS="$CFLAGS -I$x_includes"
978 LIBS="-lXinerama -lXext"
980 if test "x$no_xinerama" = "xno"; then
982 AC_CACHE_VAL(ac_cv_have_xinerama,
984 AC_TRY_LINK([#include <X11/Xlib.h>
985 #include <X11/extensions/Xinerama.h>],
986 [XineramaIsActive(NULL);],
987 [ac_cv_have_xinerama="yes"],
988 [ac_cv_have_xinerama="no"])
991 ac_cv_have_xinerama=no;
994 AC_MSG_RESULT($ac_cv_have_xinerama)
998 if test "$ac_cv_have_xinerama" = "yes"; then
999 AC_DEFINE(HAVE_XINERAMA, 1, [Define if you want Xinerama support])
1000 LIBXINERAMA="-lXinerama"
1003 AC_SUBST(LIBXINERAMA)
1005 LDFLAGS="$kde_save_LDFLAGS"
1006 CFLAGS="$kde_save_CFLAGS"
1007 LIBS="$kde_save_LIBS"
1013 dnl We're using QT Embedded
1015 CXXFLAGS="$CXXFLAGS -fno-rtti"
1016 QTE_NORTTI="-fno-rtti -DQWS"
1025 AC_SUBST(X_PRE_LIBS)
1028 AC_SUBST(X_INCLUDES)
1030 AC_SUBST(x_includes)
1031 AC_SUBST(x_libraries)
1033 AC_SUBST(QTE_NORTTI)
1041 AC_DEFUN(KDE_PRINT_QT_PROGRAM,
1043 AC_REQUIRE([KDE_USE_QT])
1044 cat > conftest.$ac_ext <<EOF
1045 #include "confdefs.h"
1046 #include <qglobal.h>
1047 #include <qapplication.h>
1049 if test "$kde_qtver" = "2"; then
1050 cat >> conftest.$ac_ext <<EOF
1052 #include <qstring.h>
1056 if test $kde_qtsubver -gt 0; then
1057 cat >> conftest.$ac_ext <<EOF
1058 #if QT_VERSION < 210
1065 if test "$kde_qtver" = "3"; then
1066 cat >> conftest.$ac_ext <<EOF
1067 #include <qcursor.h>
1068 #include <qstylefactory.h>
1069 #include <private/qucomextra_p.h>
1073 echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
1074 cat >> conftest.$ac_ext <<EOF
1080 if test "$kde_qtver" = "2"; then
1081 cat >> conftest.$ac_ext <<EOF
1082 QStringList *t = new QStringList();
1085 if test $kde_qtsubver -gt 0; then
1086 cat >> conftest.$ac_ext <<EOF
1088 s.setLatin1("Elvis is alive", 14);
1092 if test "$kde_qtver" = "3"; then
1093 cat >> conftest.$ac_ext <<EOF
1094 (void)QStyleFactory::create(QString::null);
1095 QCursor c(Qt::WhatsThisCursor);
1098 cat >> conftest.$ac_ext <<EOF
1104 AC_DEFUN(KDE_USE_QT,
1106 if test -z "$1"; then
1107 # Current default Qt version: 3.1
1111 kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
1112 # following is the check if subversion isnt found in passed argument
1113 if test "$kde_qtsubver" = "$1"; then
1116 kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
1117 if test "$kde_qtver" = "1"; then
1122 if test -z "$2"; then
1123 if test "$kde_qtver" = "2"; then
1124 if test $kde_qtsubver -gt 0; then
1125 kde_qt_minversion=">= Qt 2.2.2"
1127 kde_qt_minversion=">= Qt 2.0.2"
1130 if test "$kde_qtver" = "3"; then
1131 if test $kde_qtsubver -gt 0; then
1132 kde_qt_minversion=">= Qt 3.1 (20021021)"
1134 kde_qt_minversion=">= Qt 3.0"
1137 if test "$kde_qtver" = "1"; then
1138 kde_qt_minversion=">= 1.42 and < 2.0"
1141 kde_qt_minversion=$2
1144 if test -z "$3"; then
1145 if test $kde_qtver = 3; then
1146 if test $kde_qtsubver -gt 0; then
1147 kde_qt_verstring="QT_VERSION >= 0x030100"
1149 kde_qt_verstring="QT_VERSION >= 300"
1152 if test $kde_qtver = 2; then
1153 if test $kde_qtsubver -gt 0; then
1154 kde_qt_verstring="QT_VERSION >= 222"
1156 kde_qt_verstring="QT_VERSION >= 200"
1159 if test $kde_qtver = 1; then
1160 kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
1166 if test $kde_qtver = 3; then
1167 kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt"
1169 if test $kde_qtver = 2; then
1170 kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
1172 if test $kde_qtver = 1; then
1173 kde_qt_dirs="$QTDIR /usr/lib/qt"
1177 AC_DEFUN(KDE_CHECK_QT_DIRECT,
1179 AC_REQUIRE([KDE_USE_QT])
1180 AC_MSG_CHECKING([if Qt compiles without flags])
1181 AC_CACHE_VAL(kde_cv_qt_direct,
1185 ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
1186 ac_LIBRARY_PATH="$LIBRARY_PATH"
1187 ac_cxxflags_safe="$CXXFLAGS"
1188 ac_ldflags_safe="$LDFLAGS"
1189 ac_libs_safe="$LIBS"
1191 CXXFLAGS="$CXXFLAGS -I$qt_includes"
1192 LDFLAGS="$LDFLAGS $X_LDFLAGS"
1193 if test "x$kde_use_qt_emb" != "xyes"; then
1194 LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
1196 LIBS="$LIBQT $LIBSOCKET"
1199 export LD_LIBRARY_PATH
1203 KDE_PRINT_QT_PROGRAM
1205 if AC_TRY_EVAL(ac_link) && test -s conftest; then
1206 kde_cv_qt_direct="yes"
1208 kde_cv_qt_direct="no"
1209 echo "configure: failed program was:" >&AC_FD_CC
1210 cat conftest.$ac_ext >&AC_FD_CC
1214 CXXFLAGS="$ac_cxxflags_safe"
1215 LDFLAGS="$ac_ldflags_safe"
1216 LIBS="$ac_libs_safe"
1218 LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
1219 export LD_LIBRARY_PATH
1220 LIBRARY_PATH="$ac_LIBRARY_PATH"
1225 if test "$kde_cv_qt_direct" = "yes"; then
1234 dnl ------------------------------------------------------------------------
1235 dnl Try to find the Qt headers and libraries.
1236 dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
1237 dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
1238 dnl ------------------------------------------------------------------------
1240 AC_DEFUN(AC_PATH_QT_1_3,
1242 AC_REQUIRE([K_PATH_X])
1243 AC_REQUIRE([KDE_USE_QT])
1244 AC_REQUIRE([KDE_CHECK_LIB64])
1246 dnl ------------------------------------------------------------------------
1247 dnl Add configure flag to enable linking to MT version of Qt library.
1248 dnl ------------------------------------------------------------------------
1252 [ --disable-mt link to non-threaded Qt (deprecated)],
1253 kde_use_qt_mt=$enableval,
1255 if test $kde_qtver = 3; then
1265 dnl ------------------------------------------------------------------------
1266 dnl If we not get --disable-qt-mt then adjust some vars for the host.
1267 dnl ------------------------------------------------------------------------
1271 if test "x$kde_use_qt_mt" = "xyes"; then
1273 if test "x$kde_use_threading" = "xyes"; then
1274 CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
1275 KDE_MT_LDFLAGS="$USE_THREADS"
1276 KDE_MT_LIBS="$LIBPTHREAD"
1281 AC_SUBST(KDE_MT_LDFLAGS)
1282 AC_SUBST(KDE_MT_LIBS)
1284 kde_qt_was_given=yes
1286 dnl ------------------------------------------------------------------------
1287 dnl If we haven't been told how to link to Qt, we work it out for ourselves.
1288 dnl ------------------------------------------------------------------------
1289 if test -z "$LIBQT_GLOB"; then
1290 if test "x$kde_use_qt_emb" = "xyes"; then
1291 LIBQT_GLOB="libqte.*"
1293 LIBQT_GLOB="libqt.*"
1297 if test -z "$LIBQT"; then
1298 dnl ------------------------------------------------------------
1299 dnl If we got --enable-embedded then adjust the Qt library name.
1300 dnl ------------------------------------------------------------
1301 if test "x$kde_use_qt_emb" = "xyes"; then
1307 kde_int_qt="-l$qtlib"
1313 if test -z "$LIBQPE"; then
1314 dnl ------------------------------------------------------------
1315 dnl If we got --enable-palmtop then add -lqpe to the link line
1316 dnl ------------------------------------------------------------
1317 if test "x$kde_use_qt_emb" = "xyes"; then
1318 if test "x$kde_use_qt_emb_palm" = "xyes"; then
1328 dnl ------------------------------------------------------------------------
1329 dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
1330 dnl ------------------------------------------------------------------------
1332 if test "x$kde_use_qt_mt" = "xyes"; then
1333 if test -z "$LIBQT"; then
1335 kde_int_qt="-l$qtlib-mt"
1338 kde_int_qt="$qtlib-mt"
1340 LIBQT_GLOB="lib$qtlib-mt.*"
1341 USING_QT_MT="using -mt"
1346 if test $kde_qtver != 1; then
1348 AC_REQUIRE([AC_FIND_PNG])
1349 AC_REQUIRE([AC_FIND_JPEG])
1350 LIBQT="$LIBQT $LIBPNG $LIBJPEG"
1353 if test $kde_qtver = 3; then
1354 AC_REQUIRE([KDE_CHECK_LIBDL])
1355 LIBQT="$LIBQT $LIBDL"
1358 AC_MSG_CHECKING([for Qt])
1360 if test "x$kde_use_qt_emb" != "xyes"; then
1361 LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
1363 ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
1367 [ --with-qt-dir=DIR where the root of Qt is installed ],
1368 [ ac_qt_includes="$withval"/include
1369 ac_qt_libraries="$withval"/lib${kdelibsuff}
1370 ac_qt_bindir="$withval"/bin
1373 AC_ARG_WITH(qt-includes,
1374 [ --with-qt-includes=DIR where the Qt includes are. ],
1376 ac_qt_includes="$withval"
1379 kde_qt_libs_given=no
1381 AC_ARG_WITH(qt-libraries,
1382 [ --with-qt-libraries=DIR where the Qt library is installed.],
1383 [ ac_qt_libraries="$withval"
1384 kde_qt_libs_given=yes
1387 AC_CACHE_VAL(ac_cv_have_qt,
1388 [#try to guess Qt locations
1391 for dir in $kde_qt_dirs; do
1392 qt_incdirs="$qt_incdirs $dir/include $dir"
1394 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 $x_includes"
1395 if test ! "$ac_qt_includes" = "NO"; then
1396 qt_incdirs="$ac_qt_includes $qt_incdirs"
1399 if test "$kde_qtver" != "1"; then
1400 kde_qt_header=qstyle.h
1402 kde_qt_header=qglobal.h
1405 AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
1406 ac_qt_includes="$qt_incdir"
1409 for dir in $kde_qt_dirs; do
1410 qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir"
1412 qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
1413 if test ! "$ac_qt_libraries" = "NO"; then
1414 qt_libdir=$ac_qt_libraries
1416 qt_libdirs="$ac_qt_libraries $qt_libdirs"
1417 # if the Qt was given, the chance is too big that libqt.* doesn't exist
1419 for dir in $qt_libdirs; do
1420 try="ls -1 $dir/${LIBQT_GLOB}"
1421 if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
1425 ac_qt_libraries="$qt_libdir"
1430 ac_cxxflags_safe="$CXXFLAGS"
1431 ac_ldflags_safe="$LDFLAGS"
1432 ac_libs_safe="$LIBS"
1434 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
1435 LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
1436 LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
1438 KDE_PRINT_QT_PROGRAM
1440 if AC_TRY_EVAL(ac_link) && test -s conftest; then
1443 echo "configure: failed program was:" >&AC_FD_CC
1444 cat conftest.$ac_ext >&AC_FD_CC
1445 ac_qt_libraries="NO"
1448 CXXFLAGS="$ac_cxxflags_safe"
1449 LDFLAGS="$ac_ldflags_safe"
1450 LIBS="$ac_libs_safe"
1453 if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
1454 ac_cv_have_qt="have_qt=no"
1457 if test "$ac_qt_includes" = NO; then
1458 if test "$ac_qt_libraries" = NO; then
1459 ac_qt_notfound="(headers and libraries)";
1461 ac_qt_notfound="(headers)";
1464 if test "x$kde_use_qt_mt" = "xyes"; then
1466 Make sure that you have compiled Qt with thread support!"
1467 ac_qt_notfound="(library $qtlib-mt)";
1469 ac_qt_notfound="(library $qtlib)";
1473 AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
1474 For more details about this problem, look at the end of config.log.$missing_qt_mt])
1480 eval "$ac_cv_have_qt"
1482 if test "$have_qt" != yes; then
1483 AC_MSG_RESULT([$have_qt]);
1485 ac_cv_have_qt="have_qt=yes \
1486 ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
1487 AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
1489 qt_libraries="$ac_qt_libraries"
1490 qt_includes="$ac_qt_includes"
1493 if test ! "$kde_qt_libs_given" = "yes"; then
1494 KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
1497 AC_SUBST(qt_libraries)
1498 AC_SUBST(qt_includes)
1500 if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
1503 QT_INCLUDES="-I$qt_includes"
1504 all_includes="$QT_INCLUDES $all_includes"
1507 if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
1510 QT_LDFLAGS="-L$qt_libraries"
1511 all_libraries="$all_libraries $QT_LDFLAGS"
1513 test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
1515 AC_SUBST(QT_INCLUDES)
1516 AC_SUBST(QT_LDFLAGS)
1521 if test "x$kde_use_qt_emb" != "xyes"; then
1522 LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
1524 LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG)'
1526 test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
1534 AC_DEFUN(AC_PATH_QT,
1539 AC_DEFUN(KDE_CHECK_UIC_PLUGINS,
1541 AC_REQUIRE([AC_PATH_QT_MOC_UIC])
1543 if test x$ac_uic_supports_libpath = xyes; then
1545 AC_MSG_CHECKING([if UIC has KDE plugins available])
1546 AC_CACHE_VAL(kde_cv_uic_plugins,
1548 cat > actest.ui << EOF
1549 <!DOCTYPE UI><UI version="3.0" stdsetdef="1">
1550 <class>NewConnectionDialog</class>
1551 <widget class="QDialog">
1552 <widget class="KLineEdit">
1553 <property name="name">
1554 <cstring>testInput</cstring>
1563 kde_cv_uic_plugins=no
1564 kde_line="$UIC_PATH -L $kde_widgetdir"
1565 if test x$ac_uic_supports_nounload = xyes; then
1566 kde_line="$kde_line -nounload"
1568 kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
1569 if AC_TRY_EVAL(kde_line); then
1570 if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
1571 kde_cv_uic_plugins=yes
1574 rm -f actest.ui actest.cpp
1577 if test "$kde_cv_uic_plugins" = yes; then
1578 AC_MSG_RESULT([yes])
1580 AC_MSG_ERROR([not found - you need to install kdelibs first.])
1585 AC_DEFUN(KDE_CHECK_FINAL,
1587 AC_ARG_ENABLE(final, [ --enable-final build size optimized apps (experimental - needs lots of memory)],
1588 kde_use_final=$enableval, kde_use_final=no)
1591 if test "x$kde_use_final" = "xyes"; then
1592 KDE_USE_FINAL_TRUE=""
1593 KDE_USE_FINAL_FALSE="#"
1595 KDE_USE_FINAL_TRUE="#"
1596 KDE_USE_FINAL_FALSE=""
1598 AC_SUBST(KDE_USE_FINAL_TRUE)
1599 AC_SUBST(KDE_USE_FINAL_FALSE)
1601 AC_ARG_ENABLE(closure, [ --disable-closure don't delay template instantiation],
1602 kde_use_closure=$enableval, kde_use_closure=yes)
1604 if test "x$kde_use_closure" = "xyes"; then
1605 KDE_USE_CLOSURE_TRUE=""
1606 KDE_USE_CLOSURE_FALSE="#"
1607 # CXXFLAGS="$CXXFLAGS $REPO"
1609 KDE_USE_CLOSURE_TRUE="#"
1610 KDE_USE_CLOSURE_FALSE=""
1612 AC_SUBST(KDE_USE_CLOSURE_TRUE)
1613 AC_SUBST(KDE_USE_CLOSURE_FALSE)
1616 dnl ------------------------------------------------------------------------
1617 dnl Now, the same with KDE
1618 dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
1619 dnl and $(kde_includes) will be the kdehdrlocation (if needed)
1620 dnl ------------------------------------------------------------------------
1622 AC_DEFUN(AC_BASE_PATH_KDE,
1625 AC_REQUIRE([AC_PATH_QT])dnl
1626 AC_REQUIRE([KDE_CHECK_LIB64])
1629 AC_MSG_CHECKING([for KDE])
1631 if test "${prefix}" != NONE; then
1632 kde_includes=${prefix}/include
1633 ac_kde_includes=$prefix/include
1635 if test "${exec_prefix}" != NONE; then
1636 kde_libraries=${libdir}
1637 ac_kde_libraries=$libdir
1638 if test "$ac_kde_libraries" = '${exec_prefix}/lib'${kdelibsuff}; then
1639 ac_kde_libraries=$exec_prefix/lib${kdelibsuff}
1642 kde_libraries=${prefix}/lib${kdelibsuff}
1643 ac_kde_libraries=$prefix/lib${kdelibsuff}
1652 AC_CACHE_VAL(ac_cv_have_kde,
1653 [#try to guess kde locations
1655 if test "$kde_qtver" = 1; then
1656 kde_check_header="ksock.h"
1657 kde_check_lib="libkdecore.la"
1659 kde_check_header="ksharedptr.h"
1660 kde_check_lib="libkio.la"
1663 if test -z "$1"; then
1665 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"
1666 test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
1667 kde_incdirs="$ac_kde_includes $kde_incdirs"
1668 AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
1669 ac_kde_includes="$kde_incdir"
1671 if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
1673 in the prefix, you've chosen, are no KDE headers installed. This will fail.
1674 So, check this please and use another prefix!])
1677 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}"
1678 test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
1679 kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
1680 AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
1681 ac_kde_libraries="$kde_libdir"
1684 dnl this might be somewhere else
1685 AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
1687 if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
1689 in the prefix, you've chosen, are no KDE libraries installed. This will fail.
1690 So, check this please and use another prefix!])
1693 if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then
1695 I can't find the designer plugins. These are required and should have been installed
1699 if test -n "$kde_widgetdir"; then
1700 kde_widgetdir="$kde_widgetdir/kde3/plugins/designer"
1704 if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
1705 ac_cv_have_kde="have_kde=no"
1707 ac_cv_have_kde="have_kde=yes \
1708 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1713 ac_cv_have_kde="have_kde=no"
1718 eval "$ac_cv_have_kde"
1720 if test "$have_kde" != "yes"; then
1721 if test "${prefix}" = NONE; then
1722 ac_kde_prefix="$ac_default_prefix"
1724 ac_kde_prefix="$prefix"
1726 if test "$exec_prefix" = NONE; then
1727 ac_kde_exec_prefix="$ac_kde_prefix"
1728 AC_MSG_RESULT([will be installed in $ac_kde_prefix])
1730 ac_kde_exec_prefix="$exec_prefix"
1731 AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
1734 kde_libraries="${libdir}"
1735 kde_includes=${ac_kde_prefix}/include
1738 ac_cv_have_kde="have_kde=yes \
1739 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
1740 AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
1742 kde_libraries="$ac_kde_libraries"
1743 kde_includes="$ac_kde_includes"
1745 AC_SUBST(kde_libraries)
1746 AC_SUBST(kde_includes)
1748 if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then
1751 KDE_INCLUDES="-I$kde_includes"
1752 all_includes="$KDE_INCLUDES $all_includes"
1755 KDE_LDFLAGS="-L$kde_libraries"
1756 if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
1757 all_libraries="$all_libraries $KDE_LDFLAGS"
1760 AC_SUBST(KDE_LDFLAGS)
1761 AC_SUBST(KDE_INCLUDES)
1763 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1765 all_libraries="$all_libraries $USER_LDFLAGS"
1766 all_includes="$all_includes $USER_INCLUDES"
1767 AC_SUBST(all_includes)
1768 AC_SUBST(all_libraries)
1770 if test -z "$1"; then
1771 KDE_CHECK_UIC_PLUGINS
1774 ac_kde_libraries="$kde_libdir"
1781 AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
1783 AC_MSG_CHECKING(for extra includes)
1784 AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR
1785 adds non standard include paths],
1786 kde_use_extra_includes="$withval",
1787 kde_use_extra_includes=NONE
1790 if test -n "$kde_use_extra_includes" && \
1791 test "$kde_use_extra_includes" != "NONE"; then
1795 for dir in $kde_use_extra_includes; do
1796 kde_extra_includes="$kde_extra_includes $dir"
1797 USER_INCLUDES="$USER_INCLUDES -I$dir"
1800 kde_use_extra_includes="added"
1802 kde_use_extra_includes="no"
1804 AC_SUBST(USER_INCLUDES)
1806 AC_MSG_RESULT($kde_use_extra_includes)
1809 AC_MSG_CHECKING(for extra libs)
1810 AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths],
1811 kde_use_extra_libs=$withval,
1812 kde_use_extra_libs=NONE
1814 if test -n "$kde_use_extra_libs" && \
1815 test "$kde_use_extra_libs" != "NONE"; then
1819 for dir in $kde_use_extra_libs; do
1820 kde_extra_libs="$kde_extra_libs $dir"
1821 KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
1822 USER_LDFLAGS="$USER_LDFLAGS -L$dir"
1825 kde_use_extra_libs="added"
1827 kde_use_extra_libs="no"
1830 AC_SUBST(USER_LDFLAGS)
1832 AC_MSG_RESULT($kde_use_extra_libs)
1836 AC_DEFUN(KDE_1_CHECK_PATH_HEADERS,
1838 AC_MSG_CHECKING([for KDE headers installed])
1841 cat > conftest.$ac_ext <<EOF
1843 # include <stdlib.h>
1846 #include "confdefs.h"
1850 printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
1851 printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
1852 printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
1853 printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
1854 printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
1855 printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
1856 printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
1857 printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
1858 printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
1859 printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
1860 printf("kde_wallpaperdir=\\"%s\\"\n",
1861 KApplication::kde_wallpaperdir().data());
1862 printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
1863 printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
1864 printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
1865 printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
1866 printf("kde_moduledir=\\"/tmp/dummy\\"\n");
1867 printf("kde_styledir=\\"/tmp/dummy\\"\n");
1868 printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
1873 ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
1874 if AC_TRY_EVAL(ac_compile); then
1877 AC_MSG_ERROR([your system is not able to compile a small KDE application!
1878 Check, if you installed the KDE header files correctly.
1879 For more details about this problem, look at the end of config.log.])
1885 AC_DEFUN(KDE_CHECK_KDEQTADDON,
1887 AC_MSG_CHECKING(for kde-qt-addon)
1888 AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
1890 kde_ldflags_safe="$LDFLAGS"
1891 kde_libs_safe="$LIBS"
1892 kde_cxxflags_safe="$CXXFLAGS"
1894 LIBS="-lkde-qt-addon $LIBQT $LIBS"
1895 CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
1896 LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
1904 kde_cv_have_kdeqtaddon=yes,
1905 kde_cv_have_kdeqtaddon=no
1908 LDFLAGS=$kde_ldflags_safe
1910 CXXFLAGS=$kde_cxxflags_safe
1913 AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
1915 if test "$kde_cv_have_kdeqtaddon" = "no"; then
1916 AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
1917 It is a separate package (and CVS module) named kde-qt-addon.])
1921 AC_DEFUN(KDE_CHECK_KIMGIO,
1923 AC_REQUIRE([AC_BASE_PATH_KDE])
1924 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
1925 AC_REQUIRE([AC_FIND_TIFF])
1926 AC_REQUIRE([AC_FIND_JPEG])
1927 AC_REQUIRE([AC_FIND_PNG])
1928 AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
1930 if test "$1" = "existance"; then
1933 kde_save_LIBS="$LIBS"
1934 LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
1935 AC_CHECK_LIB(kimgio, kimgioRegister, [
1936 LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
1937 LIBS="$kde_save_LIBS"
1940 LIBKIMGIO_EXISTS=yes
1943 if test "$LIBKIMGIO_EXISTS" = "yes"; then
1944 LIB_KIMGIO='-lkimgio'
1948 AC_SUBST(LIB_KIMGIO)
1951 AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
1953 AC_REQUIRE([KDE_MISC_TESTS])
1954 AC_REQUIRE([KDE_CHECK_LIBDL])
1955 AC_REQUIRE([K_PATH_X])
1957 if test $kde_qtver = 3; then
1958 AC_SUBST(LIB_KDECORE, "-lkdecore")
1959 AC_SUBST(LIB_KDEUI, "-lkdeui")
1960 AC_SUBST(LIB_KIO, "-lkio")
1961 AC_SUBST(LIB_SMB, "-lsmb")
1962 AC_SUBST(LIB_KAB, "-lkab")
1963 AC_SUBST(LIB_KABC, "-lkabc")
1964 AC_SUBST(LIB_KHTML, "-lkhtml")
1965 AC_SUBST(LIB_KSPELL, "-lkspell")
1966 AC_SUBST(LIB_KPARTS, "-lkparts")
1967 AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
1968 # these are for backward compatibility
1969 AC_SUBST(LIB_KSYCOCA, "-lkio")
1970 AC_SUBST(LIB_KFILE, "-lkio")
1971 elif test $kde_qtver = 2; then
1972 AC_SUBST(LIB_KDECORE, "-lkdecore")
1973 AC_SUBST(LIB_KDEUI, "-lkdeui")
1974 AC_SUBST(LIB_KIO, "-lkio")
1975 AC_SUBST(LIB_KSYCOCA, "-lksycoca")
1976 AC_SUBST(LIB_SMB, "-lsmb")
1977 AC_SUBST(LIB_KFILE, "-lkfile")
1978 AC_SUBST(LIB_KAB, "-lkab")
1979 AC_SUBST(LIB_KHTML, "-lkhtml")
1980 AC_SUBST(LIB_KSPELL, "-lkspell")
1981 AC_SUBST(LIB_KPARTS, "-lkparts")
1982 AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
1984 AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
1985 AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
1986 AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
1987 AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
1988 AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
1992 AC_DEFUN(AC_PATH_KDE,
1995 AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
1997 if test "$enableval" = "no";
1998 then ac_use_path_checking="default"
1999 else ac_use_path_checking=""
2003 if test "$kde_qtver" = 1;
2004 then ac_use_path_checking=""
2005 else ac_use_path_checking="default"
2010 AC_CREATE_KFSSTND($ac_use_path_checking)
2013 KDE_CREATE_LIBS_ALIASES
2016 dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
2017 AC_DEFUN(KDE_CHECK_FUNC_EXT,
2019 AC_MSG_CHECKING(for $1)
2020 AC_CACHE_VAL(kde_cv_func_$1,
2024 save_CXXFLAGS="$CXXFLAGS"
2025 kde_safe_LIBS="$LIBS"
2026 LIBS="$LIBS $X_EXTRA_LIBS"
2027 if test "$GXX" = "yes"; then
2028 CXXFLAGS="$CXXFLAGS -pedantic-errors"
2038 CXXFLAGS="$save_CXXFLAGS"
2043 AC_MSG_RESULT($kde_cv_func_$1)
2045 AC_MSG_CHECKING([if $1 needs custom prototype])
2046 AC_CACHE_VAL(kde_cv_proto_$1,
2048 if test "x$kde_cv_func_$1" = xyes; then
2052 setenv|unsetenv|usleep|getdomainname|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
2053 kde_cv_proto_$1="yes - in libkdefakes"
2056 kde_cv_proto_$1=unknown
2061 if test "x$kde_cv_proto_$1" = xunknown; then
2066 LIBS="$LIBS $X_EXTRA_LIBS"
2075 [ kde_cv_func_$1=yes
2076 kde_cv_proto_$1=yes ],
2077 [kde_cv_proto_$1="$1 unavailable"]
2083 AC_MSG_RESULT($kde_cv_proto_$1)
2085 if test "x$kde_cv_func_$1" = xyes; then
2086 AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
2089 if test "x$kde_cv_proto_$1" = xno; then
2090 AC_DEFINE(HAVE_$5_PROTO, 1,
2091 [Define if you have the $1 prototype])
2094 AH_VERBATIM([_HAVE_$5_PROTO],
2096 #if !defined(HAVE_$5_PROTO)
2105 AC_DEFUN(AC_CHECK_SETENV,
2107 KDE_CHECK_FUNC_EXT(setenv, [
2110 [setenv("VAR", "VALUE", 1);],
2111 [int setenv (const char *, const char *, int)],
2115 AC_DEFUN(AC_CHECK_UNSETENV,
2117 KDE_CHECK_FUNC_EXT(unsetenv, [
2121 [void unsetenv (const char *)],
2125 AC_DEFUN(AC_CHECK_GETDOMAINNAME,
2127 KDE_CHECK_FUNC_EXT(getdomainname, [
2133 getdomainname(buffer, 200);
2135 [int getdomainname (char *, unsigned int)],
2139 AC_DEFUN(AC_CHECK_GETHOSTNAME,
2141 KDE_CHECK_FUNC_EXT(gethostname, [
2147 gethostname(buffer, 200);
2149 [int gethostname (char *, unsigned int)],
2153 AC_DEFUN(AC_CHECK_USLEEP,
2155 KDE_CHECK_FUNC_EXT(usleep, [
2161 [int usleep (unsigned int)],
2166 AC_DEFUN(AC_CHECK_RANDOM,
2168 KDE_CHECK_FUNC_EXT(random, [
2174 [long int random(void)],
2177 KDE_CHECK_FUNC_EXT(srandom, [
2183 [void srandom(unsigned int)],
2188 AC_DEFUN(AC_CHECK_INITGROUPS,
2190 KDE_CHECK_FUNC_EXT(initgroups, [
2191 #include <sys/types.h>
2197 initgroups(buffer, 27);
2199 [int initgroups(const char *, gid_t)],
2203 AC_DEFUN(AC_CHECK_MKSTEMP,
2205 KDE_CHECK_FUNC_EXT(mkstemp, [
2209 mkstemp("/tmp/aaaXXXXXX");
2211 [int mkstemp(char *)],
2215 AC_DEFUN(AC_CHECK_MKSTEMPS,
2217 KDE_CHECK_FUNC_EXT(mkstemps, [
2222 mkstemps("/tmp/aaaXXXXXX", 6);
2224 [int mkstemps(char *, int)],
2228 AC_DEFUN(AC_CHECK_RES_INIT,
2230 AC_MSG_CHECKING([if res_init needs -lresolv])
2231 kde_libs_safe="$LIBS"
2232 LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
2235 #include <sys/types.h>
2236 #include <netinet/in.h>
2237 #include <arpa/nameser.h>
2244 LIBRESOLV="-lresolv"
2246 AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2248 [ AC_MSG_RESULT(no) ]
2253 AC_MSG_CHECKING([if res_init is available])
2256 #include <sys/types.h>
2257 #include <netinet/in.h>
2258 #include <arpa/nameser.h>
2266 AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2268 [ AC_MSG_RESULT(no) ]
2272 AC_DEFUN(AC_CHECK_STRLCPY,
2274 KDE_CHECK_FUNC_EXT(strlcpy, [
2278 strlcpy(buf, "KDE function test", sizeof(buf));
2280 [unsigned long strlcpy(char*, const char*, unsigned long)],
2284 AC_DEFUN(AC_CHECK_STRLCAT,
2286 KDE_CHECK_FUNC_EXT(strlcat, [
2291 strlcat(buf, "KDE function test", sizeof(buf));
2293 [unsigned long strlcat(char*, const char*, unsigned long)],
2297 AC_DEFUN(AC_FIND_GIF,
2298 [AC_MSG_CHECKING([for giflib])
2299 AC_CACHE_VAL(ac_cv_lib_gif,
2300 [ac_save_LIBS="$LIBS"
2301 if test "x$kde_use_qt_emb" != "xyes"; then
2302 LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
2304 LIBS="$all_libraries -lgif"
2311 int GifLastError(void);
2315 /* We use char because int might match the return type of a gcc2
2316 builtin and then its argument prototype would still apply. */
2318 [return GifLastError();],
2319 eval "ac_cv_lib_gif=yes",
2320 eval "ac_cv_lib_gif=no")
2321 LIBS="$ac_save_LIBS"
2323 if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
2325 AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
2327 AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
2331 AC_DEFUN(KDE_FIND_JPEG_HELPER,
2333 AC_MSG_CHECKING([for libjpeg$2])
2334 AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
2337 ac_save_LIBS="$LIBS"
2338 LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
2339 ac_save_CFLAGS="$CFLAGS"
2340 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2342 [/* Override any gcc2 internal prototype to avoid an error. */
2343 struct jpeg_decompress_struct;
2344 typedef struct jpeg_decompress_struct * j_decompress_ptr;
2349 void jpeg_CreateDecompress(j_decompress_ptr cinfo,
2350 int version, size_t structsize);
2354 /* We use char because int might match the return type of a gcc2
2355 builtin and then its argument prototype would still apply. */
2357 [jpeg_CreateDecompress(0L, 0, 0);],
2358 eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
2359 eval "ac_cv_lib_jpeg_$1=no")
2360 LIBS="$ac_save_LIBS"
2361 CFLAGS="$ac_save_CFLAGS"
2364 if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
2365 LIBJPEG="$ac_cv_lib_jpeg_$1"
2366 AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
2374 AC_DEFUN(AC_FIND_JPEG,
2376 dnl first look for libraries
2377 KDE_FIND_JPEG_HELPER(6b, 6b,
2378 KDE_FIND_JPEG_HELPER(normal, [],
2385 dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
2386 dnl requires system dependent includes loaded before it)
2387 jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
2388 AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
2389 test "x$jpeg_incdir" = xNO && jpeg_incdir=
2391 dnl if headers _and_ libraries are missing, this is no error, and we
2392 dnl continue with a warning (the user will get no jpeg support in khtml)
2393 dnl if only one is missing, it means a configuration error, but we still
2395 if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
2396 AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
2398 if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
2400 There is an installation error in jpeg support. You seem to have only one
2401 of either the headers _or_ the libraries installed. You may need to either
2402 provide correct --with-extra-... options, or the development package of
2403 libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
2404 Disabling JPEG support.
2407 AC_MSG_WARN([libjpeg not found. disable JPEG support.])
2414 AH_VERBATIM(_AC_CHECK_JPEG,
2416 * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
2417 * headers and I'm too lazy to write a configure test as long as only
2418 * unixware is related
2421 #define HAVE_BOOLEAN
2426 AC_DEFUN(KDE_CHECK_QT_JPEG,
2428 AC_MSG_CHECKING([if Qt needs $LIBJPEG])
2429 AC_CACHE_VAL(kde_cv_qt_jpeg,
2433 ac_save_LIBS="$LIBS"
2434 LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
2435 LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
2436 ac_save_CXXFLAGS="$CXXFLAGS"
2437 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2439 [#include <qapplication.h>],
2443 QApplication app(argc, argv);],
2444 eval "kde_cv_qt_jpeg=no",
2445 eval "kde_cv_qt_jpeg=yes")
2446 LIBS="$ac_save_LIBS"
2447 CXXFLAGS="$ac_save_CXXFLAGS"
2451 if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
2453 LIBJPEG_QT='$(LIBJPEG)'
2461 AC_DEFUN(AC_FIND_ZLIB,
2463 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2464 AC_MSG_CHECKING([for libz])
2465 AC_CACHE_VAL(ac_cv_lib_z,
2468 kde_save_LIBS="$LIBS"
2469 LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
2470 kde_save_CFLAGS="$CFLAGS"
2471 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2476 [return (zlibVersion() == ZLIB_VERSION); ],
2477 eval "ac_cv_lib_z='-lz'",
2478 eval "ac_cv_lib_z=no")
2479 LIBS="$kde_save_LIBS"
2480 CFLAGS="$kde_save_CFLAGS"
2482 if test ! "$ac_cv_lib_z" = no; then
2483 AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
2486 AC_MSG_RESULT($ac_cv_lib_z)
2488 AC_MSG_ERROR(not found. Check your installation and look into config.log)
2494 AC_DEFUN(KDE_TRY_TIFFLIB,
2496 AC_MSG_CHECKING([for libtiff $1])
2498 AC_CACHE_VAL(kde_cv_libtiff_$1,
2502 kde_save_LIBS="$LIBS"
2503 if test "x$kde_use_qt_emb" != "xyes"; then
2504 LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
2506 LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
2508 kde_save_CXXFLAGS="$CXXFLAGS"
2509 CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
2515 [return (TIFFOpen( "", "r") == 0); ],
2517 kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
2519 kde_cv_libtiff_$1=no
2522 LIBS="$kde_save_LIBS"
2523 CXXFLAGS="$kde_save_CXXFLAGS"
2527 if test "$kde_cv_libtiff_$1" = "no"; then
2532 LIBTIFF="$kde_cv_libtiff_$1"
2534 AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
2540 AC_DEFUN(AC_FIND_TIFF,
2542 AC_REQUIRE([K_PATH_X])
2543 AC_REQUIRE([AC_FIND_ZLIB])
2544 AC_REQUIRE([AC_FIND_JPEG])
2545 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2547 KDE_TRY_TIFFLIB(tiff, [],
2548 KDE_TRY_TIFFLIB(tiff34))
2554 AC_DEFUN(AC_FIND_PNG,
2556 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
2557 AC_REQUIRE([AC_FIND_ZLIB])
2558 AC_MSG_CHECKING([for libpng])
2559 AC_CACHE_VAL(ac_cv_lib_png,
2561 kde_save_LIBS="$LIBS"
2562 if test "x$kde_use_qt_emb" != "xyes"; then
2563 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
2565 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
2567 kde_save_CFLAGS="$CFLAGS"
2568 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
2575 png_structp png_ptr = png_create_read_struct( /* image ptr */
2576 PNG_LIBPNG_VER_STRING, 0, 0, 0 );
2577 return( png_ptr != 0 );
2579 eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
2580 eval "ac_cv_lib_png=no"
2582 LIBS="$kde_save_LIBS"
2583 CFLAGS="$kde_save_CFLAGS"
2585 if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
2586 AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
2587 LIBPNG="$ac_cv_lib_png"
2589 AC_MSG_RESULT($ac_cv_lib_png)
2597 AC_DEFUN(AC_CHECK_BOOL,
2599 AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
2602 AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
2604 AC_MSG_CHECKING(if you need GNU extensions)
2605 AC_CACHE_VAL(ac_cv_gnu_extensions,
2607 cat > conftest.c << EOF
2608 #include <features.h>
2610 #ifdef __GNU_LIBRARY__
2615 if (eval "$ac_cpp conftest.c") 2>&5 |
2616 egrep "yes" >/dev/null 2>&1; then
2618 ac_cv_gnu_extensions=yes
2620 ac_cv_gnu_extensions=no
2624 AC_MSG_RESULT($ac_cv_gnu_extensions)
2625 if test "$ac_cv_gnu_extensions" = "yes"; then
2626 AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
2630 AC_DEFUN(KDE_CHECK_COMPILER_FLAG,
2632 AC_MSG_CHECKING(whether $CXX supports -$1)
2633 kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
2634 AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
2638 save_CXXFLAGS="$CXXFLAGS"
2639 CXXFLAGS="$CXXFLAGS -$1"
2640 AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
2641 CXXFLAGS="$save_CXXFLAGS"
2644 if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
2655 dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
2656 dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
2657 dnl it's all white-space separated
2658 AC_DEFUN(AC_REMOVE_FORBIDDEN,
2661 if test -n "$__val"; then
2667 *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
2668 *) # Careful to not add spaces, where there were none, because otherwise
2669 # libtool gets confused, if we change e.g. CXX
2670 if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
2678 dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
2679 AC_DEFUN(AC_VALIDIFY_CXXFLAGS,
2681 if test "x$kde_use_qt_emb" != "xyes"; then
2682 AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
2683 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
2685 AC_REMOVE_FORBIDDEN(CXX, [-rpath])
2686 AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
2690 AC_DEFUN(AC_CHECK_COMPILERS,
2692 AC_ARG_ENABLE(debug,[ --enable-debug[=ARG] enables debug symbols (yes|no|full) [default=no]],
2696 kde_use_debug_code="yes"
2697 kde_use_debug_define=no
2700 kde_use_debug_code="full"
2701 kde_use_debug_define=no
2704 kde_use_debug_code="no"
2705 kde_use_debug_define=yes
2709 [kde_use_debug_code="no"
2710 kde_use_debug_define=no
2713 dnl Just for configure --help
2714 AC_ARG_ENABLE(dummyoption,[ --disable-debug disables debug output and debug symbols [default=no]],[],[])
2716 AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
2718 if test $enableval = "no"; then
2719 kde_use_strict_options="no"
2721 kde_use_strict_options="yes"
2723 ], [kde_use_strict_options="no"])
2725 AC_ARG_ENABLE(warnings,[ --disable-warnings disables compilation with -Wall and similiar],
2727 if test $enableval = "no"; then
2728 kde_use_warnings="no"
2730 kde_use_warnings="yes"
2732 ], [kde_use_warnings="yes"])
2734 dnl enable warnings for debug build
2735 if test "$kde_use_debug_code" != "no"; then
2736 kde_use_warnings=yes
2739 AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]],
2740 [kde_use_profiling=$enableval],
2741 [kde_use_profiling="no"]
2744 dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
2751 if test "$GCC" = "yes"; then
2752 if test "$kde_use_debug_code" != "no"; then
2753 if test $kde_use_debug_code = "full"; then
2754 CFLAGS="-g3 $CFLAGS"
2756 CFLAGS="-g -O2 $CFLAGS"
2759 CFLAGS="-O2 $CFLAGS"
2763 if test "$kde_use_debug_define" = "yes"; then
2764 CFLAGS="-DNDEBUG $CFLAGS"
2769 *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
2770 *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
2773 if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
2777 CXXFLAGS=" $CXXFLAGS"
2781 if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
2782 if test "$kde_use_debug_code" != "no"; then
2783 if test "$CXX" = "KCC"; then
2784 CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
2786 if test "$kde_use_debug_code" = "full"; then
2787 CXXFLAGS="-g3 $CXXFLAGS"
2789 CXXFLAGS="-g -O2 $CXXFLAGS"
2792 KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
2794 dnl convenience compiler flags
2795 KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
2796 AC_SUBST(WOVERLOADED_VIRTUAL)
2798 if test "$CXX" = "KCC"; then
2799 CXXFLAGS="+K3 $CXXFLAGS"
2801 CXXFLAGS="-O2 $CXXFLAGS"
2806 if test "$kde_use_debug_define" = "yes"; then
2807 CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
2810 if test "$kde_use_profiling" = "yes"; then
2811 KDE_CHECK_COMPILER_FLAG(pg,
2813 CFLAGS="-pg $CFLAGS"
2814 CXXFLAGS="-pg $CXXFLAGS"
2818 if test "$kde_use_warnings" = "yes"; then
2819 if test "$GCC" = "yes"; then
2822 CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
2823 CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion $CXXFLAGS"
2826 CXXFLAGS="-Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
2827 KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
2828 KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
2829 KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
2833 if test "$GCC" = "yes" && test "$kde_use_strict_options" = "yes"; then
2834 CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
2837 if test "$GXX" = "yes"; then
2838 KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
2839 KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
2840 KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
2842 if test "$CXX" = "KCC"; then
2843 dnl unfortunately we currently cannot disable exception support in KCC
2844 dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
2845 dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
2846 dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= )
2848 AC_ARG_ENABLE(pch,[ --enable-pch enables precompiled header support (currently only KCC) [default=no]],
2850 kde_use_pch=$enableval
2853 if test "$kde_use_pch" = "yes"; then
2854 dnl TODO: support --pch-dir!
2855 KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
2856 dnl the below works (but the dir must exist), but it's
2857 dnl useless for a whole package.
2858 dnl The are precompiled headers for each source file, so when compiling
2859 dnl from scratch, it doesn't make a difference, and they take up
2860 dnl around ~5Mb _per_ sourcefile.
2861 dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
2862 dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
2864 dnl this flag controls inlining. by default KCC inlines in optimisation mode
2865 dnl all implementations that are defined inside the class {} declaration.
2866 dnl because of templates-compatibility with broken gcc compilers, this
2867 dnl can cause excessive inlining. This flag limits it to a sane level
2868 KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
2869 KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
2870 KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
2871 KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
2872 dnl Some source files are shared between multiple executables
2873 dnl (or libraries) and some of those need template instantiations.
2874 dnl In that case KCC needs to compile those sources with
2875 dnl --one_instantiation_per_object. To make it easy for us we compile
2876 dnl _all_ objects with that flag (--one_per is a shorthand).
2877 KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
2879 AC_SUBST(USE_EXCEPTIONS)
2880 dnl obsolete macro - provided to keep things going
2885 *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
2886 *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
2887 *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
2889 if test "$GXX" = yes; then
2890 libstdcpp=`$CXX -print-file-name=libstdc++.so`
2891 if test ! -f $libstdcpp; then
2892 AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so])
2898 AC_VALIDIFY_CXXFLAGS
2902 if test "$GCC" = yes; then
2907 AC_SUBST(NOOPT_CXXFLAGS)
2908 AC_SUBST(NOOPT_CFLAGS)
2912 ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
2915 AC_DEFUN(KDE_ADD_DEPENDENCIES,
2917 [A]M_DEPENDENCIES(CC)
2918 [A]M_DEPENDENCIES(CXX)
2921 dnl just a wrapper to clean up configure.in
2922 AC_DEFUN(KDE_PROG_LIBTOOL,
2924 AC_REQUIRE([AC_CHECK_COMPILERS])
2925 AC_REQUIRE([AC_ENABLE_SHARED])
2926 AC_REQUIRE([AC_ENABLE_STATIC])
2928 AC_REQUIRE([AC_LIBTOOL_DLOPEN])
2929 AC_REQUIRE([KDE_CHECK_LIB64])
2940 LIBTOOL_SHELL="/bin/sh ./libtool"
2941 # LIBTOOL="$LIBTOOL --silent"
2942 KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
2943 AC_SUBST(KDE_PLUGIN)
2945 AC_ARG_ENABLE(objprelink, [ --enable-objprelink prelink apps using objprelink (obsolete)],
2946 kde_use_objprelink=$enableval, kde_use_objprelink=no)
2947 if test "x$kde_use_objprelink" = "xyes"; then
2949 ------------------------------------------------------------
2950 Configuration option --enable-objprelink is no longer useful.
2951 See http:://objprelink.sourceforge.net for details:
2952 1- Recent binutils are fast enough to do without objprelink.
2953 2- Newer versions of objprelink do not need this option.
2954 ------------------------------------------------------------
2959 AC_DEFUN(KDE_CHECK_LIB64,
2962 AC_ARG_ENABLE(libsuffix,
2963 AC_HELP_STRING([--enable-libsuffix],
2964 [/lib directory suffix (64,32,none)]),
2965 kdelibsuff=$enableval)
2966 if test "$kdelibsuff" = "none"; then
2967 if test -d /lib64 ; then
2973 if test -z "$kdelibsuff"; then
2974 AC_MSG_RESULT([not using lib directory suffix])
2975 AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
2977 if test "$libdir" = '${exec_prefix}/lib'; then
2978 libdir="$libdir${kdelibsuff}"
2979 AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms
2981 AC_DEFINE_UNQUOTED(KDELIBSUFF, ["\"${kdelibsuff}\""], Suffix for lib directories)
2982 AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
2986 AC_DEFUN(KDE_CHECK_TYPES,
2987 [ AC_CHECK_SIZEOF(int, 4)dnl
2988 AC_CHECK_SIZEOF(long, 4)dnl
2989 AC_CHECK_SIZEOF(char *, 4)dnl
2990 AC_CHECK_SIZEOF(char, 1)dnl
2993 AC_DEFUN(KDE_DO_IT_ALL,
2997 AM_INIT_AUTOMAKE($1, $2)
2998 AM_DISABLE_LIBRARIES
2999 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
3006 AC_DEFUN(AC_CHECK_RPATH,
3008 AC_MSG_CHECKING(for rpath)
3009 AC_ARG_ENABLE(rpath,
3010 [ --disable-rpath do not use the rpath feature of ld],
3011 USE_RPATH=$enableval, USE_RPATH=yes)
3013 if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
3015 KDE_RPATH="-R \$(kde_libraries)"
3017 if test -n "$qt_libraries"; then
3018 KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
3020 dnl $x_libraries is set to /usr/lib in case
3021 if test -n "$X_LDFLAGS"; then
3022 KDE_RPATH="$KDE_RPATH -R \$(x_libraries)"
3024 if test -n "$KDE_EXTRA_RPATH"; then
3025 KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
3028 AC_SUBST(KDE_EXTRA_RPATH)
3030 AC_MSG_RESULT($USE_RPATH)
3033 dnl Check for the type of the third argument of getsockname
3034 AC_DEFUN(AC_CHECK_SOCKLEN_T, [
3035 AC_MSG_CHECKING(for socklen_t)
3036 AC_CACHE_VAL(ac_cv_socklen_t, [
3040 #include <sys/types.h>
3041 #include <sys/socket.h>
3044 getsockname(0,(struct sockaddr*)0, &a);
3046 ac_cv_socklen_t=socklen_t,
3048 #include <sys/types.h>
3049 #include <sys/socket.h>
3052 getsockname(0,(struct sockaddr*)0, &a);
3054 ac_cv_socklen_t=int,
3055 ac_cv_socklen_t=size_t
3061 AC_MSG_RESULT($ac_cv_socklen_t)
3062 if test "$ac_cv_socklen_t" != "socklen_t"; then
3063 AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t,
3064 [Define the real type of socklen_t])
3066 AC_DEFINE_UNQUOTED(ksize_t, socklen_t, [Compatibility define])
3070 dnl This is a merge of some macros out of the gettext aclocal.m4
3071 dnl since we don't need anything, I took the things we need
3072 dnl the copyright for them is:
3074 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3075 dnl This Makefile.in is free software; the Free Software Foundation
3076 dnl gives unlimited permission to copy and/or distribute it,
3077 dnl with or without modifications, as long as this notice is preserved.
3079 dnl This program is distributed in the hope that it will be useful,
3080 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
3081 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
3082 dnl PARTICULAR PURPOSE.
3084 dnl for this file it is relicensed under LGPL
3086 AC_DEFUN(AM_KDE_WITH_NLS,
3088 dnl If we use NLS figure out what method
3090 AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
3091 [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
3092 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
3094 if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
3095 AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
3102 AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
3103 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
3105 dnl Test whether we really found GNU xgettext.
3106 if test "$XGETTEXT" != ":"; then
3107 dnl If it is no GNU xgettext we define it as : so that the
3108 dnl Makefiles still can work.
3109 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
3113 [found xgettext programs is not GNU xgettext; ignore it])
3121 # Search path for a program which passes the given test.
3122 # Ulrich Drepper <drepper@cygnus.com>, 1996.
3125 # Stephan Kulow: I appended a _KDE against name conflicts
3127 dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
3128 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3129 AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
3130 [# Extract the first word of "$2", so it can be a program name with args.
3131 set dummy $2; ac_word=[$]2
3132 AC_MSG_CHECKING([for $ac_word])
3133 AC_CACHE_VAL(ac_cv_path_$1,
3136 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3139 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3140 for ac_dir in ifelse([$5], , $PATH, [$5]); do
3141 test -z "$ac_dir" && ac_dir=.
3142 if test -f $ac_dir/$ac_word; then
3144 ac_cv_path_$1="$ac_dir/$ac_word"
3150 dnl If no 4th arg is given, leave the cache variable unset,
3151 dnl so AC_PATH_PROGS will keep looking.
3152 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3157 if test -n "[$]$1"; then
3158 AC_MSG_RESULT([$]$1)
3166 # Check whether LC_MESSAGES is available in <locale.h>.
3167 # Ulrich Drepper <drepper@cygnus.com>, 1995.
3171 AC_DEFUN(AM_LC_MESSAGES,
3172 [if test $ac_cv_header_locale_h = yes; then
3173 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
3174 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
3175 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
3176 if test $am_cv_val_LC_MESSAGES = yes; then
3177 AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
3181 dnl From Jim Meyering.
3182 dnl FIXME: migrate into libit.
3184 AC_DEFUN([AM_FUNC_OBSTACK],
3185 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
3186 [AC_TRY_LINK([#include "obstack.h"],
3187 [struct obstack *mem;obstack_free(mem,(char *) 0)],
3188 am_cv_func_obstack=yes,
3189 am_cv_func_obstack=no)])
3190 if test $am_cv_func_obstack = yes; then
3191 AC_DEFINE(HAVE_OBSTACK)
3193 LIBOBJS="$LIBOBJS obstack.o"
3197 dnl From Jim Meyering. Use this if you use the GNU error.[ch].
3198 dnl FIXME: Migrate into libit
3200 AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
3201 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
3202 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
3203 am_cv_lib_error_at_line=yes,
3204 am_cv_lib_error_at_line=no)])
3205 if test $am_cv_lib_error_at_line = no; then
3206 LIBOBJS="$LIBOBJS error.o"
3208 AC_SUBST(LIBOBJS)dnl
3211 # Macro to add for using GNU gettext.
3212 # Ulrich Drepper <drepper@cygnus.com>, 1995.
3215 # Stephan Kulow: I put a KDE in it to avoid name conflicts
3217 AC_DEFUN(AM_KDE_GNU_GETTEXT,
3218 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3219 AC_REQUIRE([AC_PROG_RANLIB])dnl
3220 AC_REQUIRE([AC_HEADER_STDC])dnl
3221 AC_REQUIRE([AC_TYPE_OFF_T])dnl
3222 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
3223 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
3224 AC_REQUIRE([AC_FUNC_MMAP])dnl
3225 AC_REQUIRE([AM_KDE_WITH_NLS])dnl
3226 AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
3227 AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
3228 __argz_count __argz_stringify __argz_next])
3230 AC_MSG_CHECKING(for stpcpy)
3231 AC_CACHE_VAL(kde_cv_func_stpcpy,
3233 kde_safe_cxxflags=$CXXFLAGS
3234 CXXFLAGS="-Wmissing-prototypes -Werror"
3242 stpcpy(buffer, buffer);
3244 kde_cv_func_stpcpy=yes,
3245 kde_cv_func_stpcpy=no)
3247 CXXFLAGS=$kde_safe_cxxflags
3249 AC_MSG_RESULT($kde_cv_func_stpcpy)
3250 if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
3251 AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
3256 if test "x$CATOBJEXT" != "x"; then
3257 if test "x$ALL_LINGUAS" = "x"; then
3260 AC_MSG_CHECKING(for catalogs to be installed)
3262 for lang in ${LINGUAS=$ALL_LINGUAS}; do
3263 case "$ALL_LINGUAS" in
3264 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
3267 LINGUAS=$NEW_LINGUAS
3268 AC_MSG_RESULT($LINGUAS)
3271 dnl Construct list of names of catalog files to be constructed.
3272 if test -n "$LINGUAS"; then
3273 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
3279 AC_DEFUN(AC_HAVE_XPM,
3280 [AC_REQUIRE_CPP()dnl
3281 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3283 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
3284 test -z "$XPM_INCLUDE" && XPM_INCLUDE=
3286 AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
3287 xpm_test=$withval, xpm_test="yes")
3288 if test "x$xpm_test" = xno; then
3291 AC_MSG_CHECKING(for XPM)
3292 AC_CACHE_VAL(ac_cv_have_xpm,
3295 ac_save_ldflags="$LDFLAGS"
3296 ac_save_cflags="$CFLAGS"
3297 if test "x$kde_use_qt_emb" != "xyes"; then
3298 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
3300 LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
3302 CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
3303 test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
3304 AC_TRY_LINK([#include <X11/xpm.h>],[],
3305 ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
3306 LDFLAGS="$ac_save_ldflags"
3307 CFLAGS="$ac_save_cflags"
3310 if test "$ac_cv_have_xpm" = no; then
3316 AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
3317 if test "$XPM_LDFLAGS" = ""; then
3318 XPMLIB='-lXpm $(LIB_X11)'
3320 XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
3322 if test "$XPM_INCLUDE" = ""; then
3325 XPMINC="-I$XPM_INCLUDE"
3335 AC_DEFUN(AC_HAVE_DPMS,
3336 [AC_REQUIRE_CPP()dnl
3337 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3339 test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
3340 test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
3343 AC_ARG_WITH(dpms, [ --without-dpms disable DPMS power saving],
3344 dpms_test=$withval, dpms_test="yes")
3345 if test "x$dpms_test" = xno; then
3348 AC_MSG_CHECKING(for DPMS)
3349 dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
3350 dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
3351 AC_CACHE_VAL(ac_cv_have_dpms,
3353 if test "x$kde_use_qt_emb" = "xyes"; then
3355 ac_cv_have_dpms="no"
3358 ac_save_ldflags="$LDFLAGS"
3359 ac_save_cflags="$CFLAGS"
3360 ac_save_libs="$LIBS"
3361 LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
3362 CFLAGS="$CFLAGS $X_INCLUDES"
3363 test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3365 #include <X11/Xproto.h>
3367 #include <X11/Xlib.h>
3368 #include <X11/extensions/dpms.h>
3370 { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3371 ac_cv_have_dpms="yes", [
3372 LDFLAGS="$ac_save_ldflags"
3373 CFLAGS="$ac_save_cflags"
3374 LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
3375 LIBS="$LIBS -lXdpms"
3376 CFLAGS="$CFLAGS $X_INCLUDES"
3377 test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
3379 #include <X11/Xproto.h>
3381 #include <X11/Xlib.h>
3382 #include <X11/extensions/dpms.h>
3384 { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
3386 ac_cv_have_dpms="-lXdpms"
3387 ],ac_cv_have_dpms="no")
3389 LDFLAGS="$ac_save_ldflags"
3390 CFLAGS="$ac_save_cflags"
3391 LIBS="$ac_save_libs"
3395 if test "$ac_cv_have_dpms" = no; then
3401 AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
3402 if test "$ac_cv_have_dpms" = "-lXdpms"; then
3405 if test "$DPMS_LDFLAGS" = ""; then
3406 DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
3408 DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
3410 if test "$DPMS_INCLUDE" = ""; then
3413 DPMSINC="-I$DPMS_INCLUDE"
3423 AC_DEFUN(AC_HAVE_GL,
3424 [AC_REQUIRE_CPP()dnl
3425 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
3427 test -z "$GL_LDFLAGS" && GL_LDFLAGS=
3428 test -z "$GL_INCLUDE" && GL_INCLUDE=
3430 AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
3431 gl_test=$withval, gl_test="yes")
3432 if test "x$kde_use_qt_emb" = "xyes"; then
3433 # GL and Qt Embedded is a no-go for now.
3435 elif test "x$gl_test" = xno; then
3438 AC_MSG_CHECKING(for GL)
3439 AC_CACHE_VAL(ac_cv_have_gl,
3443 ac_save_ldflags="$LDFLAGS"
3444 ac_save_cxxflags="$CXXFLAGS"
3445 LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU"
3446 test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3447 LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3448 CXXFLAGS="$CFLAGS $X_INCLUDES"
3449 test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3450 AC_TRY_LINK([#include <GL/gl.h>
3453 ac_cv_have_gl="mesa", ac_cv_have_gl="no")
3454 if test "x$ac_cv_have_gl" = "xno"; then
3455 LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGLU -lGL"
3456 test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3457 LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3458 CXXFLAGS="$ac_save_cflags $X_INCLUDES"
3459 test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3460 AC_TRY_LINK([#include <GL/gl.h>
3463 ac_cv_have_gl="yes", ac_cv_have_gl="no")
3466 LDFLAGS="$ac_save_ldflags"
3467 CXXFLAGS="$ac_save_cxxflags"
3470 if test "$ac_cv_have_gl" = "no"; then
3476 AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
3477 if test "$GL_LDFLAGS" = ""; then
3478 if test "$ac_cv_have_gl" = "mesa"; then
3479 GLLIB='-lMesaGLU -lMesaGL $(LIB_X11)'
3481 GLLIB='-lGLU -lGL $(LIB_X11)'
3484 if test "$ac_cv_have_gl" = "mesa"; then
3485 GLLIB="$GL_LDFLAGS -lMesaGLU -lMesaGL "'$(LIB_X11)'
3487 GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
3490 if test "$GL_INCLUDE" = ""; then
3493 GLINC="-I$GL_INCLUDE"
3495 AC_MSG_RESULT($ac_cv_have_gl)
3504 dnl shadow password and PAM magic - maintained by ossi@kde.org
3507 AC_REQUIRE([KDE_CHECK_LIBDL])
3510 [ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]],
3511 [ if test "x$withval" = "xyes"; then
3514 elif test "x$withval" = "xno"; then
3518 pam_service=$withval
3520 ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
3522 AC_CACHE_VAL(ac_cv_path_pam,
3524 AC_CHECK_LIB(pam, pam_start,
3525 [ AC_CHECK_HEADER(security/pam_appl.h,
3529 ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
3532 eval "$ac_cv_path_pam"
3534 AC_MSG_CHECKING(for PAM)
3535 if test "x$use_pam" = xno; then
3540 AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
3541 PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
3543 dnl test whether struct pam_message is const (Linux) or not (Sun)
3544 AC_MSG_CHECKING(for const pam_message)
3545 AC_EGREP_HEADER([struct pam_message], security/pam_appl.h,
3546 [ AC_EGREP_HEADER([const struct pam_message], security/pam_appl.h,
3547 [AC_MSG_RESULT([const: Linux-type PAM])],
3548 [AC_MSG_RESULT([nonconst: Sun-type PAM])
3549 AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
3551 [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
3557 dnl DEF_PAM_SERVICE(arg name, full name, define name)
3558 AC_DEFUN(DEF_PAM_SERVICE, [
3560 [ --with-$1-pam=[val] override PAM service from --with-pam for $2],
3561 [ if test "x$use_pam" = xyes; then
3562 $3_PAM_SERVICE="$withval"
3564 AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
3565 You may want to enforce it by using --with-pam.])
3568 [ if test "x$use_pam" = xyes; then
3569 $3_PAM_SERVICE="$pam_service"
3572 if test -n "$$3_PAM_SERVICE"; then
3573 AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
3574 AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
3576 AC_SUBST($3_PAM_SERVICE)
3579 AC_DEFUN(KDE_SHADOWPASSWD, [
3580 AC_REQUIRE([KDE_PAM])
3582 AC_CHECK_LIB(shadow, getspent,
3583 [ LIBSHADOW="-lshadow"
3587 AC_CHECK_LIB(gen, getspent,
3591 [ AC_CHECK_FUNC(getspent,
3592 [ ac_use_shadow=yes ],
3593 [ ac_use_shadow=no ])
3599 AC_MSG_CHECKING([for shadow passwords])
3602 [ --with-shadow If you want shadow password support ],
3603 [ if test "x$withval" != "xno"; then
3609 use_shadow="$ac_use_shadow"
3612 if test "x$use_shadow" = xyes; then
3614 AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
3621 dnl finally make the relevant binaries setuid root, if we have shadow passwds.
3622 dnl this still applies, if we could use it indirectly through pam.
3623 if test "x$use_shadow" = xyes ||
3624 ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
3626 *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
3627 SETUIDFLAGS="-m 4755 -o root";;
3629 SETUIDFLAGS="-m 4755";;
3632 AC_SUBST(SETUIDFLAGS)
3636 AC_DEFUN(KDE_PASSWDLIBS, [
3637 AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
3638 AC_REQUIRE([KDE_PAM])
3639 AC_REQUIRE([KDE_SHADOWPASSWD])
3641 if test "x$use_pam" = "xyes"; then
3642 PASSWDLIBS="$PAMLIBS"
3644 PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
3647 dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
3648 dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires
3649 dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
3650 dnl may need to read /etc/master.passwd).
3653 SETUIDFLAGS="-m 4755 -o root"
3659 AC_SUBST(PASSWDLIBS)
3662 AC_DEFUN(KDE_CHECK_LIBDL,
3664 AC_CHECK_LIB(dl, dlopen, [
3666 ac_cv_have_dlfcn=yes
3669 AC_CHECK_LIB(dld, shl_unload, [
3671 ac_cv_have_shload=yes
3677 AC_DEFUN(KDE_CHECK_DLOPEN,
3680 AC_CHECK_HEADERS(dlfcn.h dl.h)
3681 if test "$ac_cv_header_dlfcn_h" = "no"; then
3685 if test "$ac_cv_header_dl_h" = "no"; then
3686 ac_cv_have_shload=no
3689 dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
3691 AC_ARG_ENABLE(dlopen,
3692 [ --disable-dlopen link statically [default=no]] ,
3693 enable_dlopen=$enableval,
3696 # override the user's opinion, if we know it better ;)
3697 if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
3701 if test "$ac_cv_have_dlfcn" = "yes"; then
3702 AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
3705 if test "$ac_cv_have_shload" = "yes"; then
3706 AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
3709 if test "$enable_dlopen" = no ; then
3710 test -n "$1" && eval $1
3712 test -n "$2" && eval $2
3717 AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
3719 KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
3721 AC_MSG_CHECKING([dynamic loading])
3722 eval "`egrep '^build_libtool_libs=' libtool`"
3723 if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
3725 AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
3729 AC_MSG_RESULT($dynamic_loading)
3730 if test "$dynamic_loading" = "yes"; then
3737 AC_DEFUN(KDE_ADD_INCLUDES,
3739 if test -z "$1"; then
3740 test_include="Pix.h"
3745 AC_MSG_CHECKING([for libg++ ($test_include)])
3747 AC_CACHE_VAL(kde_cv_libgpp_includes,
3749 kde_cv_libgpp_includes=no
3755 /usr/unsupported/include \
3760 if test -r "$ac_dir/$test_include"; then
3761 kde_cv_libgpp_includes=$ac_dir
3767 AC_MSG_RESULT($kde_cv_libgpp_includes)
3768 if test "$kde_cv_libgpp_includes" != "no"; then
3769 all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
3775 AC_DEFUN(KDE_CHECK_MICO,
3777 AC_REQUIRE([KDE_CHECK_LIBDL])
3778 AC_REQUIRE([KDE_MISC_TESTS])
3779 AC_MSG_CHECKING(for MICO)
3781 if test -z "$MICODIR"; then
3782 kde_micodir=/usr/local
3784 kde_micodir="$MICODIR"
3787 AC_ARG_WITH(micodir,
3788 [ --with-micodir=micodir where mico is installed ],
3789 kde_micodir=$withval,
3790 kde_micodir=$kde_micodir
3793 AC_CACHE_VAL(kde_cv_mico_incdir,
3795 mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes"
3796 AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir)
3799 kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'`
3801 if test ! -r $kde_micodir/include/CORBA.h; then
3802 AC_MSG_ERROR([No CORBA.h found, specify another micodir])
3805 AC_MSG_RESULT($kde_micodir)
3807 MICO_INCLUDES=-I$kde_micodir/include
3808 AC_SUBST(MICO_INCLUDES)
3809 MICO_LDFLAGS=-L$kde_micodir/lib
3810 AC_SUBST(MICO_LDFLAGS)
3811 micodir=$kde_micodir
3814 AC_MSG_CHECKING([for MICO version])
3815 AC_CACHE_VAL(kde_cv_mico_version,
3818 cat >conftest.$ac_ext <<EOF
3820 #include <mico/version.h>
3823 printf("MICO_VERSION=%s\n",MICO_VERSION);
3827 ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
3828 if AC_TRY_EVAL(ac_compile); then
3829 if eval `./conftest 2>&5`; then
3830 kde_cv_mico_version=$MICO_VERSION
3832 AC_MSG_ERROR([your system is not able to execute a small application to
3833 find MICO version! Check $kde_micodir/include/mico/version.h])
3836 AC_MSG_ERROR([your system is not able to compile a small application to
3837 find MICO version! Check $kde_micodir/include/mico/version.h])
3841 dnl installed MICO version
3842 mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
3843 mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
3844 mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
3846 if test "x$1" = "x"; then
3852 dnl required MICO version
3853 req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
3854 req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
3855 req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
3857 if test "$mico_v_maj" -lt "$req_v_maj" || \
3858 ( test "$mico_v_maj" -eq "$req_v_maj" && \
3859 test "$mico_v_mid" -lt "$req_v_mid" ) || \
3860 ( test "$mico_v_mid" -eq "$req_v_mid" && \
3861 test "$mico_v_min" -lt "$req_v_min" )
3864 AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \
3865 at least is required. You should upgrade MICO.])
3867 AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)])
3870 LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL"
3872 if test -z "$IDL"; then
3873 IDL='$(kde_bindir)/cuteidl'
3876 IDL_DEPENDENCIES='$(kde_includes)/CUTE.h'
3877 AC_SUBST(IDL_DEPENDENCIES)
3879 idldir="\$(includedir)/idl"
3884 AC_DEFUN(KDE_CHECK_MINI_STL,
3886 AC_REQUIRE([KDE_CHECK_MICO])
3888 AC_MSG_CHECKING(if we use mico's mini-STL)
3889 AC_CACHE_VAL(kde_cv_have_mini_stl,
3893 kde_save_cxxflags="$CXXFLAGS"
3894 CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
3897 #include <mico/config.h>
3900 #ifdef HAVE_MINI_STL
3904 kde_cv_have_mini_stl=no,
3905 kde_cv_have_mini_stl=yes)
3906 CXXFLAGS="$kde_save_cxxflags"
3910 if test "x$kde_cv_have_mini_stl" = "xyes"; then
3922 AC_DEFUN(KDE_CHECK_LIBPTHREAD,
3924 AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
3925 AC_SUBST(LIBPTHREAD)
3928 AC_DEFUN(KDE_CHECK_PTHREAD_OPTION,
3930 AC_ARG_ENABLE(kernel-threads, [ --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.],
3931 kde_use_kernthreads=$enableval, kde_use_kernthreads=no)
3933 if test "$kde_use_kernthreads" = "yes"; then
3934 ac_save_CXXFLAGS="$CXXFLAGS"
3935 ac_save_CFLAGS="$CFLAGS"
3936 CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
3937 CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
3938 AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
3939 CXXFLAGS="$ac_save_CXXFLAGS"
3940 CFLAGS="$ac_save_CFLAGS"
3941 if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then
3942 kde_use_kernthreads=no
3944 dnl Add proper -I and -l statements
3945 AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD
3946 if test "x$LIBPTHREAD" = "x"; then
3947 kde_use_kernthreads=no
3949 USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
3954 if test -z "$LIBPTHREAD"; then
3955 KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] )
3959 AH_VERBATIM(__svr_define, [
3960 #if defined(__SVR4) && !defined(__svr4__)
3966 KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
3967 CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
3970 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
3973 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
3974 LIBPTHREAD="$LIBPTHREAD -lc_r"
3976 linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
3977 if test "$CXX" = "KCC"; then
3978 CXXFLAGS="$CXXFLAGS --thread_safe"
3979 NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
3985 AC_SUBST(USE_THREADS)
3986 AC_SUBST(LIBPTHREAD)
3989 AC_DEFUN(KDE_CHECK_THREADING,
3991 AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
3992 AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
3993 dnl default is yes if libpthread is found and no if no libpthread is available
3994 if test -z "$LIBPTHREAD"; then
3995 if test -z "$USE_THREADS"; then
3996 kde_check_threading_default=no
3998 kde_check_threading_default=yes
4001 kde_check_threading_default=yes
4003 AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ],
4004 kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
4005 if test "x$kde_use_threading" = "xyes"; then
4006 AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
4010 AC_DEFUN(KDE_TRY_LINK_PYTHON,
4012 if test "$kde_python_link_found" = no; then
4014 if test "$1" = normal; then
4015 AC_MSG_CHECKING(if a Python application links)
4017 AC_MSG_CHECKING(if Python depends on $2)
4020 AC_CACHE_VAL(kde_cv_try_link_python_$1,
4024 kde_save_cflags="$CFLAGS"
4025 CFLAGS="$CFLAGS $PYTHONINC"
4026 kde_save_libs="$LIBS"
4027 LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
4028 kde_save_ldflags="$LDFLAGS"
4029 LDFLAGS="$LDFLAGS $PYTHONLIB"
4035 PySys_SetArgv(1, 0);
4037 [kde_cv_try_link_python_$1=yes],
4038 [kde_cv_try_link_python_$1=no]
4040 CFLAGS="$kde_save_cflags"
4041 LIBS="$kde_save_libs"
4042 LDFLAGS="$kde_save_ldflags"
4045 if test "$kde_cv_try_link_python_$1" = "yes"; then
4047 kde_python_link_found=yes
4048 if test ! "$1" = normal; then
4049 LIBPYTHON="$LIBPYTHON $2"
4062 AC_DEFUN(KDE_CHECK_PYTHON_DIR,
4064 AC_MSG_CHECKING([for Python directory])
4066 AC_CACHE_VAL(kde_cv_pythondir,
4068 if test -z "$PYTHONDIR"; then
4069 kde_cv_pythondir=/usr/local
4071 kde_cv_pythondir="$PYTHONDIR"
4075 AC_ARG_WITH(pythondir,
4076 [ --with-pythondir=pythondir use python installed in pythondir ],
4078 ac_python_dir=$withval
4079 ], ac_python_dir=$kde_cv_pythondir
4082 AC_MSG_RESULT($ac_python_dir)
4085 AC_DEFUN(KDE_CHECK_PYTHON_INTERN,
4087 AC_REQUIRE([KDE_CHECK_LIBDL])
4088 AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
4089 AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
4091 if test -z "$1"; then
4097 AC_MSG_CHECKING([for Python$version])
4099 python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
4100 AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
4101 if test ! -r $python_incdir/Python.h; then
4102 AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
4103 python_incdir=$python_incdir/python$version
4104 if test ! -r $python_incdir/Python.h; then
4109 PYTHONINC=-I$python_incdir
4111 python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
4112 AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
4113 if test ! -r $python_libdir/libpython$version.a; then
4114 AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
4115 python_libdir=$python_libdir/python$version/config
4116 if test ! -r $python_libdir/libpython$version.a; then
4121 PYTHONLIB=-L$python_libdir
4122 kde_orig_LIBPYTHON=$LIBPYTHON
4123 if test -z "$LIBPYTHON"; then
4124 LIBPYTHON=-lpython$version
4127 python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
4128 AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
4129 python_moddir=$python_moddir/python$version
4130 if test ! -r $python_moddir/copy.py; then
4134 PYTHONMODDIR=$python_moddir
4136 AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
4138 if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
4139 LIBPYTHON=$kde_orig_LIBPYTHON
4140 test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
4141 test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
4144 dnl Note: this test is very weak
4145 kde_python_link_found=no
4146 KDE_TRY_LINK_PYTHON(normal)
4147 KDE_TRY_LINK_PYTHON(m, -lm)
4148 KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
4149 KDE_TRY_LINK_PYTHON(tcl, -ltcl)
4150 KDE_TRY_LINK_PYTHON(db2, -ldb2)
4151 KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
4152 KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
4153 KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
4154 KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
4155 KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
4156 KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
4157 KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
4158 [AC_MSG_WARN([it seems, Python depends on another library.
4159 Pleae set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
4160 and contact the authors to let them know about this problem])
4163 LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
4167 AC_SUBST(PYTHONMODDIR)
4168 AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
4174 AC_DEFUN(KDE_CHECK_PYTHON,
4176 KDE_CHECK_PYTHON_INTERN("2.2",
4177 [KDE_CHECK_PYTHON_INTERN("2.1",
4178 [KDE_CHECK_PYTHON_INTERN("2.0", [ KDE_CHECK_PYTHON_INTERN($1, $2) ])
4182 AC_DEFUN(KDE_CHECK_STL_SGI,
4184 AC_MSG_CHECKING([if STL implementation is SGI like])
4185 AC_CACHE_VAL(kde_cv_stl_type_sgi,
4189 using namespace std;
4191 string astring="Hallo Welt.";
4192 astring.erase(0, 6); // now astring is "Welt"
4194 ], kde_cv_stl_type_sgi=yes,
4195 kde_cv_stl_type_sgi=no)
4198 AC_MSG_RESULT($kde_cv_stl_type_sgi)
4200 if test "$kde_cv_stl_type_sgi" = "yes"; then
4201 AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
4205 AC_DEFUN(KDE_CHECK_STL_HP,
4207 AC_MSG_CHECKING([if STL implementation is HP like])
4208 AC_CACHE_VAL(kde_cv_stl_type_hp,
4212 using namespace std;
4214 string astring="Hello World";
4215 astring.remove(0, 6); // now astring is "World"
4217 ], kde_cv_stl_type_hp=yes,
4218 kde_cv_stl_type_hp=no)
4220 AC_MSG_RESULT($kde_cv_stl_type_hp)
4222 if test "$kde_cv_stl_type_hp" = "yes"; then
4223 AC_DEFINE_UNQUOTED(HAVE_HP_STL, 1, [Define if you have a STL implementation by HP])
4227 AC_DEFUN(KDE_CHECK_STL,
4231 ac_save_CXXFLAGS="$CXXFLAGS"
4232 CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
4235 if test "$kde_cv_stl_type_sgi" = "no"; then
4238 if test "$kde_cv_stl_type_hp" = "no"; then
4239 AC_MSG_ERROR("no known STL type found - did you forget to install libstdc++[-devel] ?")
4243 CXXFLAGS="$ac_save_CXXFLAGS"
4247 AC_DEFUN(AC_FIND_QIMGIO,
4248 [AC_REQUIRE([AC_FIND_JPEG])
4249 AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
4250 AC_MSG_CHECKING([for qimgio])
4251 AC_CACHE_VAL(ac_cv_lib_qimgio,
4255 ac_save_LIBS="$LIBS"
4256 ac_save_CXXFLAGS="$CXXFLAGS"
4257 LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
4258 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
4261 #include <qimageio.h>
4262 #include <qstring.h>
4264 QString t = "hallo";
4269 ac_cv_lib_qimgio=yes,
4270 ac_cv_lib_qimgio=no,
4271 ac_cv_lib_qimgio=no)
4272 LIBS="$ac_save_LIBS"
4273 CXXFLAGS="$ac_save_CXXFLAGS"
4276 if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
4277 LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
4279 AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
4282 AC_MSG_RESULT(not found)
4286 AC_DEFUN(KDE_CHECK_ANSI,
4290 AC_DEFUN(KDE_CHECK_INSURE,
4292 AC_ARG_ENABLE(insure, [ --enable-insure use insure++ for debugging [default=no]],
4294 if test $enableval = "no"; dnl
4295 then ac_use_insure="no"
4296 else ac_use_insure="yes"
4298 ], [ac_use_insure="no"])
4300 AC_MSG_CHECKING(if we will use Insure++ to debug)
4301 AC_MSG_RESULT($ac_use_insure)
4302 if test "$ac_use_insure" = "yes"; dnl
4303 then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
4307 AC_DEFUN(AM_DISABLE_LIBRARIES,
4309 AC_PROVIDE([AM_ENABLE_STATIC])
4310 AC_PROVIDE([AM_ENABLE_SHARED])
4316 AC_DEFUN(AC_CHECK_UTMP_FILE,
4318 AC_MSG_CHECKING([for utmp file])
4320 AC_CACHE_VAL(kde_cv_utmp_file,
4331 if test -r "$ac_file"; then
4332 kde_cv_utmp_file=$ac_file
4338 if test "$kde_cv_utmp_file" != "no"; then
4339 AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
4341 AC_MSG_RESULT($kde_cv_utmp_file)
4344 AC_MSG_RESULT([non found])
4349 AC_DEFUN(KDE_CREATE_SUBDIRSLIST,
4352 DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
4354 if test ! -s $srcdir/subdirs; then
4355 dnl Note: Makefile.common creates subdirs, so this is just a fallback
4357 files=`cd $srcdir && ls -1`
4358 dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
4360 echo $i >> $srcdir/subdirs
4364 if test -s $srcdir/inst-apps; then
4365 ac_topsubdirs="`cat $srcdir/inst-apps`"
4367 ac_topsubdirs="`cat $srcdir/subdirs`"
4370 for i in $ac_topsubdirs; do
4371 AC_MSG_CHECKING([if $i should be compiled])
4372 if test -d $srcdir/$i; then
4374 for j in $DO_NOT_COMPILE; do
4375 if test $i = $j; then
4382 AC_MSG_RESULT($install_it)
4383 vari=`echo $i | sed -e 's,[[-+.]],_,g'`
4384 if test $install_it = "yes"; then
4385 TOPSUBDIRS="$TOPSUBDIRS $i"
4386 eval "$vari""_SUBDIR_included=yes"
4388 eval "$vari""_SUBDIR_included=no"
4392 AC_SUBST(TOPSUBDIRS)
4395 AC_DEFUN(KDE_CHECK_NAMESPACES,
4397 AC_MSG_CHECKING(whether C++ compiler supports namespaces)
4411 int Foo::Bar::i = 1;
4414 AC_DEFINE(HAVE_NAMESPACES)
4421 AC_DEFUN(KDE_CHECK_NEWLIBS,
4426 dnl ------------------------------------------------------------------------
4427 dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
4428 dnl ------------------------------------------------------------------------
4430 AC_DEFUN(AC_CHECK_S_ISSOCK,
4432 AC_MSG_CHECKING(for S_ISSOCK)
4433 AC_CACHE_VAL(ac_cv_have_s_issock,
4439 #include <sys/stat.h>
4443 int b = S_ISSOCK( buff.st_mode );
4445 ac_cv_have_s_issock=yes,
4446 ac_cv_have_s_issock=no)
4449 AC_MSG_RESULT($ac_cv_have_s_issock)
4450 if test "$ac_cv_have_s_issock" = "yes"; then
4451 AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
4454 AH_VERBATIM(_ISSOCK,
4456 #ifndef HAVE_S_ISSOCK
4457 #define HAVE_S_ISSOCK
4458 #define S_ISSOCK(mode) (1==0)
4464 dnl ------------------------------------------------------------------------
4465 dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
4466 dnl ------------------------------------------------------------------------
4468 AC_DEFUN(AC_CHECK_KDEMAXPATHLEN,
4470 AC_MSG_CHECKING(for MAXPATHLEN)
4471 AC_CACHE_VAL(ac_cv_maxpathlen,
4474 cat > conftest.$ac_ext <<EOF
4476 # include <stdlib.h>
4479 #include <sys/param.h>
4481 #define MAXPATHLEN 1024
4484 KDE_HELLO MAXPATHLEN
4488 ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
4490 if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
4491 ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
4493 ac_cv_maxpathlen=1024
4499 AC_MSG_RESULT($ac_cv_maxpathlen)
4500 AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
4503 dnl -------------------------------------------------------------------------
4504 dnl See if the compiler supports a template repository bero@redhat.de
4505 dnl -------------------------------------------------------------------------
4506 AC_DEFUN(KDE_COMPILER_REPO,
4511 KDE_CHECK_COMPILER_FLAG(frepo,
4517 if test -z "$REPO"; then
4518 KDE_CHECK_COMPILER_FLAG(instances=explicit,
4520 REPO="-instances=explicit"
4521 NOREPO="-instances=extern"
4525 if test -n "$REPO"; then
4526 AC_DEFINE_UNQUOTED(HAVE_TEMPLATE_REPOSITORY, 1,
4527 [C++ compiler supports template repository])
4535 AC_DEFUN(KDE_CHECK_HEADER,
4538 kde_safe_cppflags=$CPPFLAGS
4539 CPPFLAGS="$CPPFLAGS $all_includes"
4541 AC_CHECK_HEADER($1, $2, $3)
4542 CPPFLAGS=$kde_safe_cppflags
4546 AC_DEFUN(KDE_CHECK_HEADERS,
4548 AH_CHECK_HEADERS([$1])
4550 kde_safe_cppflags=$CPPFLAGS
4551 CPPFLAGS="$CPPFLAGS $all_includes"
4553 AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
4554 CPPFLAGS=$kde_safe_cppflags
4558 AC_DEFUN(KDE_FAST_CONFIGURE,
4560 dnl makes configure fast (needs perl)
4561 AC_ARG_ENABLE(fast-perl, [ --disable-fast-perl disable fast Makefile generation (needs perl)],
4562 with_fast_perl=$enableval, with_fast_perl=yes)
4565 AC_DEFUN(KDE_CONF_FILES,
4568 if test -f $srcdir/configure.files ; then
4569 val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
4572 if test -n "$val" ; then
4574 CONF_FILES="$CONF_FILES $i"
4577 AC_SUBST(CONF_FILES)
4580 AC_DEFUN(KDE_SET_PREFIX,
4583 dnl make $KDEDIR the default for the installation
4584 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
4586 if test "x$prefix" = "xNONE"; then
4587 prefix=$ac_default_prefix
4588 ac_configure_args="$ac_configure_args --prefix=$prefix"
4590 # And delete superflous '/' to make compares easier
4591 prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4592 exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4597 pushdef([AC_PROG_INSTALL],
4599 dnl our own version, testing for a -p flag
4600 popdef([AC_PROG_INSTALL])
4601 dnl as AC_PROG_INSTALL works as it works we first have
4602 dnl to save if the user didn't specify INSTALL, as the
4603 dnl autoconf one overwrites INSTALL and we have no chance to find
4605 test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
4606 test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
4607 test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
4610 if test -z "$kde_save_INSTALL_given" ; then
4611 # OK, user hasn't given any INSTALL, autoconf found one for us
4612 # now we test, if it supports the -p flag
4613 AC_MSG_CHECKING(for -p flag to install)
4614 rm -f confinst.$$.* > /dev/null 2>&1
4615 echo "Testtest" > confinst.$$.orig
4617 if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
4618 if test -f confinst.$$.new ; then
4619 # OK, -p seems to do no harm to install
4620 INSTALL="${INSTALL} -p"
4625 AC_MSG_RESULT($ac_res)
4627 dnl the following tries to resolve some signs and wonders coming up
4628 dnl with different autoconf/automake versions
4630 dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
4631 dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
4632 dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
4633 dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
4634 dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
4635 dnl install-@DIR@PROGRAMS targets to explicitly use that flag
4636 dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
4637 dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
4638 dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
4639 dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
4640 dnl automake (due to broken Makefile.am or whatever) to install programs,
4641 dnl and so does not see the -s flag in automake > 1.4
4642 dnl to clean up that mess we:
4643 dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
4644 dnl which cleans KDE's program with automake > 1.4;
4645 dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
4646 dnl with automake<=1.4
4647 dnl note that dues to this sometimes two '-s' flags are used (if KDE
4648 dnl properly uses install-@DIR@PROGRAMS, but I don't care
4650 dnl And to all this comes, that I even can't write in comments variable
4651 dnl names used by automake, because it is so stupid to think I wanted to
4652 dnl _use_ them, therefor I have written A_M_... instead of AM_
4653 dnl hmm, I wanted to say something ... ahh yes: Arghhh.
4655 if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
4656 INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
4658 if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
4659 INSTALL_SCRIPT='${INSTALL}'
4663 AC_DEFUN(KDE_LANG_CPLUSPLUS,
4665 ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
4666 pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
4669 pushdef([AC_LANG_CPLUSPLUS],
4670 [popdef([AC_LANG_CPLUSPLUS])
4674 AC_DEFUN(KDE_CHECK_LONG_LONG,
4676 AC_MSG_CHECKING(for long long)
4677 AC_CACHE_VAL(kde_cv_c_long_long,
4685 kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
4688 AC_MSG_RESULT($kde_cv_c_long_long)
4689 if test "$kde_cv_c_long_long" = yes; then
4690 AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
4694 AC_DEFUN(KDE_CHECK_LIB,
4696 kde_save_LDFLAGS="$LDFLAGS"
4697 dnl AC_CHECK_LIB modifies LIBS, so save it here
4698 kde_save_LIBS="$LIBS"
4699 LDFLAGS="$LDFLAGS $all_libraries"
4701 aix*) LDFLAGS="-brtl $LDFLAGS"
4702 test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
4705 AC_CHECK_LIB($1, $2, $3, $4, $5)
4706 LDFLAGS="$kde_save_LDFLAGS"
4707 LIBS="$kde_save_LIBS"
4710 AC_DEFUN(KDE_JAVA_PREFIX,
4713 base=`basename "$1"`
4714 list=`ls -1 $dir 2> /dev/null`
4715 for entry in $list; do
4716 if test -d $dir/$entry/bin; then
4719 javadirs="$javadirs $dir/$entry/bin"
4722 elif test -d $dir/$entry/jre/bin; then
4725 javadirs="$javadirs $dir/$entry/jre/bin"
4732 dnl KDE_CHEC_JAVA_DIR(onlyjre)
4733 AC_DEFUN(KDE_CHECK_JAVA_DIR,
4737 [ --with-java=javadir use java installed in javadir, --without-java disables ],
4738 [ ac_java_dir=$withval
4742 AC_MSG_CHECKING([for Java])
4744 dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
4745 if test "x$ac_java_dir" = "xno"; then
4747 kde_java_includedir=no
4748 kde_java_libjvmdir=no
4749 kde_java_libhpidir=no
4751 if test "x$ac_java_dir" = "x"; then
4754 dnl No option set -> look in $PATH
4755 KDE_JAVA_PREFIX(/usr/j2se)
4756 KDE_JAVA_PREFIX(/usr/j*dk*)
4757 KDE_JAVA_PREFIX(/usr/lib/j*dk*)
4758 KDE_JAVA_PREFIX(/opt/j*sdk*)
4759 KDE_JAVA_PREFIX(/usr/lib/java*)
4760 KDE_JAVA_PREFIX(/usr/java*)
4761 KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
4762 KDE_JAVA_PREFIX(/usr/lib/SunJava*)
4763 KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
4764 KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
4765 KDE_JAVA_PREFIX(/opt/java*)
4770 for dir in $PATH; do
4771 javadirs="$javadirs $dir"
4776 for dir in $javadirs; do
4777 if test ! -d $dir; then break; fi
4778 if test -x "$dir/java"; then
4779 libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4780 if test ! -f $libjvmdir/libjvm.so; then continue; fi
4781 jredirs="$jredirs $dir"
4788 for dir in $jredirs; do
4790 kde_java_bindir=$dir
4791 if test -x "$dir/javac"; then
4797 if test -n "$JAVAC"; then
4798 dnl this substitution might not work - well, we test for jni.h below
4799 kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
4801 kde_java_includedir=no
4804 dnl config option set
4805 kde_java_bindir=$ac_java_dir/bin
4806 if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
4807 kde_java_includedir=no
4809 kde_java_includedir=$ac_java_dir/include
4814 dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
4815 if test "x$kde_java_bindir" != "xno"; then
4817 dnl Look for libjvm.so
4818 kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4819 dnl Look for libhpi.so and avoid green threads
4820 kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
4822 dnl Now check everything's fine under there
4823 dnl the include dir is our flag for having the JDK
4824 if test -d "$kde_java_includedir"; then
4825 if test ! -x "$kde_java_bindir/javac"; then
4826 AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
4828 if test ! -x "$kde_java_bindir/javah"; then
4829 AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
4831 if test ! -x "$kde_java_bindir/jar"; then
4832 AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
4834 if test ! -r "$kde_java_includedir/jni.h"; then
4835 AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
4838 jni_includes="-I$kde_java_includedir"
4839 dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
4840 dnl and under linux here..
4841 test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
4842 test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
4843 test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
4850 if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
4851 AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
4854 if test ! -x "$kde_java_bindir/java"; then
4855 AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
4858 if test ! -r "$kde_java_libhpidir/libhpi.so"; then
4859 AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
4862 if test -n "$jni_includes"; then
4863 dnl Check for JNI version
4866 ac_cxxflags_safe="$CXXFLAGS"
4867 CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
4873 #ifndef JNI_VERSION_1_2
4876 ],[ kde_jni_works=yes ],
4877 [ kde_jni_works=no ])
4879 if test $kde_jni_works = no; then
4880 AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
4881 You need to have Java Development Kit (JDK) version 1.2.
4883 Use --with-java to specify another location.
4884 Use --without-java to configure without java support.
4885 Or download a newer JDK and try again.
4886 See e.g. http://java.sun.com/products/jdk/1.2 ])
4889 CXXFLAGS="$ac_cxxflags_safe"
4892 dnl All tests ok, inform and subst the variables
4894 JAVAC=$kde_java_bindir/javac
4895 JAVAH=$kde_java_bindir/javah
4896 JAR=$kde_java_bindir/jar
4897 AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
4898 JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
4899 AC_MSG_RESULT([java JDK in $kde_java_bindir])
4902 AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
4903 AC_MSG_RESULT([java JRE in $kde_java_bindir])
4906 AC_MSG_RESULT([none found])
4913 AC_SUBST(jni_includes)
4915 # for backward compat
4916 kde_cv_java_includedir=$kde_java_includedir
4917 kde_cv_java_bindir=$kde_java_bindir
4920 dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
4921 dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
4922 dnl big packages, m4_foreach is dog-slow. So use our own version of
4923 dnl it. (matz@kde.org)
4924 m4_define([mm_foreach],
4925 [m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
4926 m4_define([mm_car], [[$1]])
4927 m4_define([mm_car2], [[$@]])
4928 m4_define([_mm_foreach],
4929 [m4_if(m4_quote($2), [], [],
4930 [m4_define([$1], [mm_car($2)])$3[]_mm_foreach([$1],
4931 mm_car2(m4_shift($2)),
4933 m4_define([AC_FOREACH],
4934 [mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
4936 AC_DEFUN(KDE_NEED_FLEX,
4939 LIBS="$LIBS $USER_LDFLAGS"
4942 if test -z "$LEXLIB"; then
4943 AC_MSG_ERROR([You need to have flex installed.])
4948 AC_DEFUN(AC_PATH_QTOPIA,
4950 dnl TODO: use AC_CACHE_VAL
4952 if test -z "$1"; then
4957 qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
4958 qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
4959 qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
4962 qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
4963 qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
4965 AC_REQUIRE([AC_PATH_QT])
4967 AC_MSG_CHECKING([for Qtopia])
4970 AC_SUBST(LIB_QTOPIA)
4972 kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
4976 AC_ARG_WITH(qtopia-dir,
4977 [ --with-qtopia-dir=DIR where the root of Qtopia is installed ],
4978 [ ac_qtopia_incdir="$withval"/include] )
4981 for dir in $kde_qtopia_dirs; do
4982 qtopia_incdirs="$qtopia_incdirs $dir/include"
4985 if test ! "$ac_qtopia_incdir" = "NO"; then
4986 qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
4990 AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
4991 ac_qtopia_incdir="$qtopia_incdir"
4993 if test -z "$qtopia_incdir"; then
4994 AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
4997 qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
4998 qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
4999 qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
5001 qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
5002 qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
5003 if test "$qtopia_ver" -lt "$qtopia_minver"; then
5004 AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
5011 ac_cxxflags_safe="$CXXFLAGS"
5012 ac_ldflags_safe="$LDFLAGS"
5013 ac_libs_safe="$LIBS"
5015 CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
5016 LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
5017 LIBS="$LIBS $LIB_QTOPIA $LIBQT"
5019 cat > conftest.$ac_ext <<EOF
5020 #include "confdefs.h"
5021 #include <qpe/qpeapplication.h>
5022 #include <qpe/version.h>
5024 int main( int argc, char **argv )
5026 QPEApplication app( argc, argv );
5031 if AC_TRY_EVAL(ac_link) && test -s conftest; then
5035 AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
5036 the end of config.log])
5039 CXXFLAGS="$ac_cxxflags_safe"
5040 LDFLAGS="$ac_ldflags_safe"
5041 LIBS="$ac_libs_safe"
5045 QTOPIA_INCLUDES="-I$qtopia_incdir"
5046 AC_SUBST(QTOPIA_INCLUDES)
5048 AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
5052 AC_DEFUN(KDE_INIT_DOXYGEN,
5054 AC_MSG_CHECKING([for Qt docs])
5056 if test "${with_qt_dir+set}" = set; then
5057 kde_qtdir="$with_qt_dir"
5060 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], QTDOCDIR)
5061 AC_MSG_RESULT($QTDOCDIR)
5065 KDE_FIND_PATH(dot, DOT, [], [])
5066 if test -n "$DOT"; then
5071 AC_SUBST(KDE_HAVE_DOT)
5072 KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
5075 DOXYGEN_PROJECT_NAME="$1"
5076 DOXYGEN_PROJECT_NUMBER="$2"
5077 AC_SUBST(DOXYGEN_PROJECT_NAME)
5078 AC_SUBST(DOXYGEN_PROJECT_NUMBER)
5081 if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
5084 AC_SUBST(KDE_HAS_DOXYGEN)
5089 AC_DEFUN(AC_FIND_BZIP2,
5091 AC_MSG_CHECKING([for bzDecompress in libbz2])
5092 AC_CACHE_VAL(ac_cv_lib_bzip2,
5095 kde_save_LIBS="$LIBS"
5096 LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
5097 kde_save_CFLAGS="$CFLAGS"
5098 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
5104 [ bz_stream s; (void) bzDecompress(&s); ],
5105 eval "ac_cv_lib_bzip2='-lbz2'",
5106 eval "ac_cv_lib_bzip2=no")
5107 LIBS="$kde_save_LIBS"
5108 CFLAGS="$kde_save_CFLAGS"
5110 AC_MSG_RESULT($ac_cv_lib_bzip2)
5112 if test ! "$ac_cv_lib_bzip2" = no; then
5115 LIBBZ2="$ac_cv_lib_bzip2"
5121 KDE_CHECK_COMPILER_FLAG(shared, [
5122 cxx_shared_flag="-shared"
5125 AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
5126 AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
5129 kde_save_LIBS="$LIBS"
5130 LIBS="$all_libraries $USER_LDFLAGS $cxx_shared_flag -lbz2 $LIBSOCKET"
5131 kde_save_CFLAGS="$CFLAGS"
5132 CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
5139 [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
5140 eval "ac_cv_lib_bzip2_prefix='-lbz2'",
5141 eval "ac_cv_lib_bzip2_prefix=no")
5142 LIBS="$kde_save_LIBS"
5143 CFLAGS="$kde_save_CFLAGS"
5146 AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
5150 if test ! "$ac_cv_lib_bzip2_prefix" = no; then
5153 LIBBZ2="$ac_cv_lib_bzip2_prefix"
5156 AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
5157 dnl else, we just ignore this
5161 AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
5164 dnl ------------------------------------------------------------------------
5165 dnl Try to find the SSL headers and libraries.
5166 dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
5167 dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
5168 dnl ------------------------------------------------------------------------
5170 AC_DEFUN(KDE_CHECK_SSL,
5172 LIBSSL="-lssl -lcrypto"
5173 AC_REQUIRE([KDE_CHECK_LIB64])
5175 ac_ssl_includes=NO ac_ssl_libraries=NO
5178 AC_ARG_WITH(ssl-dir,
5179 [ --with-ssl-dir=DIR where the root of OpenSSL is installed],
5180 [ ac_ssl_includes="$withval"/include
5181 ac_ssl_libraries="$withval"/lib$kdelibsuff
5186 [ --without-ssl disable SSL checks],
5187 [want_ssl=$withval])
5189 if test $want_ssl = yes; then
5191 AC_MSG_CHECKING(for OpenSSL)
5193 AC_CACHE_VAL(ac_cv_have_ssl,
5194 [#try to guess OpenSSL locations
5196 ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
5197 ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
5198 AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
5199 ac_ssl_includes="$ssl_incdir"
5201 ssl_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/ssl/lib$kdelibsuff /usr/local/ssl/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs"
5202 if test ! "$ac_ssl_libraries" = "NO"; then
5203 ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
5208 for dir in $ssl_libdirs; do
5209 try="ls -1 $dir/libssl*"
5210 if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
5213 ac_ssl_libraries="$ssl_libdir"
5218 ac_cflags_safe="$CFLAGS"
5219 ac_ldflags_safe="$LDFLAGS"
5220 ac_libs_safe="$LIBS"
5222 CFLAGS="$CFLAGS -I$ssl_incdir $all_includes"
5223 LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
5224 LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
5226 AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
5232 CFLAGS="$ac_cflags_safe"
5233 LDFLAGS="$ac_ldflags_safe"
5234 LIBS="$ac_libs_safe"
5238 if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
5246 eval "$ac_cv_have_ssl"
5248 AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
5250 AC_MSG_CHECKING([whether OpenSSL uses rsaref])
5251 AC_MSG_RESULT($ac_ssl_rsaref)
5253 AC_MSG_CHECKING([for easter eggs])
5254 AC_MSG_RESULT([none found])
5260 if test "$have_ssl" = yes; then
5261 AC_MSG_CHECKING(for OpenSSL version)
5262 dnl Check for SSL version
5263 AC_CACHE_VAL(ac_cv_ssl_version,
5268 cat >conftest.$ac_ext <<EOF
5269 #include <openssl/opensslv.h>
5273 #ifndef OPENSSL_VERSION_NUMBER
5274 printf("ssl_version=\\"error\\"\n");
5276 if (OPENSSL_VERSION_NUMBER < 0x00906000)
5277 printf("ssl_version=\\"old\\"\n");
5279 printf("ssl_version=\\"ok\\"\n");
5285 ac_compile='${CC-gcc} $CFLAGS -I$ac_ssl_includes conftest.$ac_ext -o conftest'
5286 if AC_TRY_EVAL(ac_compile); then
5288 if eval `./conftest 2>&5`; then
5289 if test $ssl_version = error; then
5290 AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
5292 if test $ssl_version = old; then
5293 AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
5297 ac_cv_ssl_version="ssl_version=$ssl_version"
5299 AC_MSG_ERROR([Your system couldn't run a small SSL test program.
5300 Check config.log, and if you can't figure it out, send a mail to
5301 David Faure <faure@kde.org>, attaching your config.log])
5305 AC_MSG_ERROR([Your system couldn't link a small SSL test program.
5306 Check config.log, and if you can't figure it out, send a mail to
5307 David Faure <faure@kde.org>, attaching your config.log])
5314 eval "$ac_cv_ssl_version"
5315 AC_MSG_RESULT($ssl_version)
5318 if test "$have_ssl" != yes; then
5321 AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
5322 ac_cv_have_ssl="have_ssl=yes \
5323 ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
5326 ssl_libraries="$ac_ssl_libraries"
5327 ssl_includes="$ac_ssl_includes"
5329 if test "$ac_ssl_rsaref" = yes; then
5330 LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref"
5333 if test $ssl_version = "old"; then
5334 AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
5338 if test "$ssl_includes" = "/usr/include" || test "$ssl_includes" = "/usr/local/include" || test -z "$ssl_includes"; then
5341 SSL_INCLUDES="-I$ssl_includes"
5344 if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries"; then
5347 SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
5350 AC_SUBST(SSL_INCLUDES)
5351 AC_SUBST(SSL_LDFLAGS)
5355 AC_DEFUN(KDE_CHECK_STRLCPY,
5359 AC_CHECK_SIZEOF(size_t)
5360 AC_CHECK_SIZEOF(unsigned long)
5362 AC_MSG_CHECKING([sizeof(size_t) == sizeof(unsigned long)])
5364 #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
5367 ],[AC_MSG_RESULT([yes])],[
5370 Apparently on your system our assumption sizeof(size_t) == sizeof(unsigned long)
5371 does not apply. Please mail kde-devel@kde.org with a description of your system!