1 # Configure paths and libs when using KDE GUI
2 ## -*- shell-script -*-
4 ## This file is part of the KDE libraries/packages
5 ## Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
6 ## (C) 1997 Stephan Kulow (coolo@kde.org)
8 ## This file is free software; you can redistribute it and/or
9 ## modify it under the terms of the GNU Library General Public
10 ## License as published by the Free Software Foundation; either
11 ## version 2 of the License, or (at your option) any later version.
13 ## This library is distributed in the hope that it will be useful,
14 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 ## Library General Public License for more details.
18 ## You should have received a copy of the GNU Library General Public License
19 ## along with this library; see the file COPYING.LIB. If not, write to
20 ## the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 ## Boston, MA 02111-1307, USA.
24 ## Please do not modify this file unless you expect your modifications to be
25 ## carried into every other module in the repository. If you decide that you
26 ## really want to modify it, contact coolo@kde.org mentioning that you have
27 ## and that the modified file should be committed to every module.
29 ## Single-module modifications are best placed in configure.in for kdelibs
30 ## and kdebase or configure.in.1 if present.
33 ## ------------------------------------------------------------------------
34 ## Find a file (or one of more files in a list of dirs)
35 ## ------------------------------------------------------------------------
37 AC_DEFUN(AC_FIND_FILE,
44 if test -r "$i/$j"; then
52 AC_DEFUN(KDE_FIND_PATH,
54 AC_MSG_CHECKING([for $1])
55 AC_CACHE_VAL(kde_cv_path_$1,
58 if test -n "$$2"; then
70 if test -x "$dir/$1"; then
73 evalstr="$dir/$1 $5 2>&1 "
74 if eval $evalstr; then
75 kde_cv_path_$1="$dir/$1"
79 kde_cv_path_$1="$dir/$1"
89 if test -z "$kde_cv_path_$1" || test "$kde_cv_path_$1" = "NONE"; then
90 AC_MSG_RESULT(not found)
93 AC_MSG_RESULT($kde_cv_path_$1)
97 AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
99 AC_MSG_ERROR([No Qt meta object compiler (moc) found!
100 Please check whether you installed Qt correctly.
101 You need to have a running moc binary.
102 configure tried to run $ac_cv_path_moc and the test didn't
103 succeed. If configure shouldn't have tried this one, set
104 the environment variable MOC to the right one before running
109 dnl ------------------------------------------------------------------------
110 dnl Find the meta object compiler in the PATH, in $QTDIR/bin, and some
111 dnl more usual places
112 dnl ------------------------------------------------------------------------
114 AC_DEFUN(AC_PATH_QT_MOC,
116 KDE_FIND_PATH(moc, MOC, [$ac_qt_bindir $QTDIR/bin \
117 /usr/bin /usr/X11R6/bin /usr/lib/qt/bin \
118 /usr/local/qt/bin], [KDE_MOC_ERROR_MESSAGE])
120 if test -z "$MOC"; then
121 if test -n "$ac_cv_path_moc"; then
122 output=`eval "$ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt"`
124 echo "configure:__oline__: tried to call $ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt" >&AC_FD_CC
125 echo "configure:__oline__: moc output: $output" >&AC_FD_CC
127 if test -z "$output"; then
128 KDE_MOC_ERROR_MESSAGE
135 AC_DEFUN(KDE_REPLACE_ROOT,
136 $1=`echo "$$1" | sed -e "s#^/#\$\{install_root\}/#"`
139 AC_DEFUN(AC_CREATE_KFSSTND,
141 AC_REQUIRE([AC_CHECK_RPATH])
143 if test "$1" = "default"; then
145 AC_MSG_CHECKING(for KDE paths)
147 if test -z "$kde_htmldir"; then
148 kde_htmldir="\$(prefix)/share/doc/HTML"
150 if test -z "$kde_appsdir"; then
151 kde_appsdir="\$(prefix)/share/applnk"
153 if test -z "$kde_icondir"; then
154 kde_icondir="\$(prefix)/share/icons"
156 if test -z "$kde_sounddir"; then
157 kde_sounddir="\$(prefix)/share/sounds"
159 if test -z "$kde_datadir"; then
160 kde_datadir="\$(prefix)/share/apps"
162 if test -z "$kde_locale"; then
163 kde_locale="\$(prefix)/share/locale"
165 if test -z "$kde_cgidir"; then
166 kde_cgidir="\$(exec_prefix)/cgi-bin"
168 if test -z "$kde_confdir"; then
169 kde_confdir="\$(prefix)/share/config"
171 if test -z "$kde_mimedir"; then
172 kde_mimedir="\$(prefix)/share/mimelnk"
174 if test -z "$kde_toolbardir"; then
175 kde_toolbardir="\$(prefix)/share/toolbar"
177 if test -z "$kde_wallpaperdir"; then
178 kde_wallpaperdir="\$(prefix)/share/wallpapers"
180 if test -z "$kde_bindir"; then
181 kde_bindir="\$(exec_prefix)/bin"
183 if test -z "$kde_partsdir"; then
184 kde_partsdir="\$(exec_prefix)/parts"
186 AC_MSG_RESULT(defaults)
190 AC_CACHE_VAL(kde_cv_all_paths,
192 AC_MSG_CHECKING([for kde headers installed])
194 cat > conftest.$ac_ext <<EOF
196 #include "confdefs.h"
200 printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
201 printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
202 printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
203 printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
204 printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
205 printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
206 printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
207 printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
208 printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
209 printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
210 printf("kde_wallpaperdir=\\"%s\\"\n", KApplication::kde_wallpaperdir().data());
211 printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
212 printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
217 if test -n "$kde_libraries"; then
218 KDE_TEST_RPATH="-rpath $kde_libraries"
221 if test -n "$qt_libraries"; then
222 KDE_TEST_RPATH="$KDE_TEST_RPATH -rpath $qt_libraries"
225 if test -n "$x_libraries"; then
226 KDE_TEST_RPATH="$KDE_TEST_RPATH -rpath $x_libraries"
229 KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
231 ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
232 if AC_TRY_EVAL(ac_compile); then
235 AC_MSG_ERROR([your system is not able to compile a small KDE application!
236 Check, if you installed the KDE header files correctly.])
239 AC_MSG_CHECKING([for kde libraries installed])
240 ac_link='/bin/sh ./libtool --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore -lqt -lXext -lX11 $LIBSOCKET $KDE_TEST_RPATH 1>&5'
242 if AC_TRY_EVAL(ac_link) && test -s conftest; then
245 AC_MSG_ERROR([your system fails at linking a small KDE application!
246 Check, if your compiler is installed correctly and if you have used the
247 same compiler to compile Qt and kdelibs as you did use now])
250 AC_MSG_CHECKING([for KDE paths])
251 if eval `./conftest 2>&5`; then
254 AC_MSG_RESULT(problems)
257 ./conftest 2> /dev/null >&5 # make an echo for config.log
258 kde_have_all_paths=yes
261 if test "$kde_have_all_paths" = "yes"; then
262 kde_cv_all_paths="kde_have_all_paths=\"yes\" \
263 kde_htmldir=\"$kde_htmldir\" \
264 kde_appsdir=\"$kde_appsdir\" \
265 kde_icondir=\"$kde_icondir\" \
266 kde_sounddir=\"$kde_sounddir\" \
267 kde_datadir=\"$kde_datadir\" \
268 kde_locale=\"$kde_locale\" \
269 kde_cgidir=\"$kde_cgidir\" \
270 kde_confdir=\"$kde_confdir\" \
271 kde_mimedir=\"$kde_mimedir\" \
272 kde_toolbardir=\"$kde_toolbardir\" \
273 kde_wallpaperdir=\"$kde_wallpaperdir\" \
274 kde_bindir=\"$kde_bindir\" \
275 kde_partsdir=\"$kde_partsdir\""
281 eval "$kde_cv_all_paths"
283 if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
284 test -z "$kde_icondir" || test -z "$kde_sounddir" ||
285 test -z "$kde_datadir" || test -z "$kde_locale" ||
286 test -z "$kde_cgidir" || test -z "$kde_confdir" ||
287 test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
288 test -z "$kde_wallpaperdir" || test -z "$kde_bindir" ||
289 test -z "$kde_partsdir" || test "$kde_have_all_paths" != "yes"; then
290 kde_have_all_paths=no
291 AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
292 Since it had compiled and linked before, it must be a strange problem on your system.
293 Look at config.log for details. If you are not able to fix this, please contact Stephan Kulow <coolo@kde.org>.])
296 if test -n "$install_root"; then
297 KDE_REPLACE_ROOT(kde_htmldir)
298 KDE_REPLACE_ROOT(kde_appsdir)
299 KDE_REPLACE_ROOT(kde_icondir)
300 KDE_REPLACE_ROOT(kde_sounddir)
301 KDE_REPLACE_ROOT(kde_datadir)
302 KDE_REPLACE_ROOT(kde_locale)
303 KDE_REPLACE_ROOT(kde_cgidir)
304 KDE_REPLACE_ROOT(kde_confdir)
305 KDE_REPLACE_ROOT(kde_mimedir)
306 KDE_REPLACE_ROOT(kde_toolbardir)
307 KDE_REPLACE_ROOT(kde_wallpaperdir)
308 KDE_REPLACE_ROOT(kde_bindir)
309 KDE_REPLACE_ROOT(kde_partsdir)
310 AC_SUBST(install_root)
319 AC_DEFUN(AC_SUBST_KFSSTND,
321 AC_SUBST(kde_htmldir)
322 AC_SUBST(kde_appsdir)
323 AC_SUBST(kde_icondir)
324 AC_SUBST(kde_sounddir)
325 kde_minidir="$kde_icondir/mini"
326 AC_SUBST(kde_minidir)
327 AC_SUBST(kde_datadir)
330 AC_SUBST(kde_confdir)
331 AC_SUBST(kde_mimedir)
332 AC_SUBST(kde_toolbardir)
333 AC_SUBST(kde_wallpaperdir)
335 AC_SUBST(kde_partsdir)
338 AC_DEFUN(KDE_MISC_TESTS,
341 dnl Checks for libraries.
342 AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for FreeBSD
344 AC_CHECK_LIB(crypt, main, [LIBCRYPT="-lcrypt"]) dnl for BSD
346 AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
347 if test $ac_cv_lib_dnet_dnet_ntoa = no; then
348 AC_CHECK_LIB(dnet_stub, dnet_ntoa,
349 [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
351 AC_CHECK_FUNC(gethostbyname)
352 if test $ac_cv_func_gethostbyname = no; then
353 AC_CHECK_LIB(nsl, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
355 AC_CHECK_FUNC(connect)
356 if test $ac_cv_func_connect = no; then
357 AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
361 AC_CHECK_FUNC(remove)
362 if test $ac_cv_func_remove = no; then
363 AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
366 # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
368 if test $ac_cv_func_shmat = no; then
369 AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc")
372 LIBSOCKET=$X_EXTRA_LIBS
374 AC_SUBST(X_EXTRA_LIBS)
375 AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
378 case $host in dnl this *is* LynxOS specific
380 AC_MSG_CHECKING([LynxOS header file wrappers])
381 [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
382 AC_MSG_RESULT(disabled)
383 AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
389 ## ------------------------------------------------------------------------
390 ## Find the header files and libraries for X-Windows. Extended the
392 ## ------------------------------------------------------------------------
396 AC_MSG_CHECKING(for X)
397 AC_CACHE_VAL(ac_cv_have_x,
398 [# One or both of the vars are not set, and there is no cached value.
399 ac_x_includes=NO ac_x_libraries=NO
402 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
403 AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
405 # Record where we found X for the cache.
406 ac_cv_have_x="have_x=yes \
407 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
411 if test "$have_x" != yes; then
412 AC_MSG_RESULT($have_x)
415 # If each of the values was on the command line, it overrides each guess.
416 test "x$x_includes" = xNONE && x_includes=$ac_x_includes
417 test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
418 # Update the cache value to reflect the command line values.
419 ac_cv_have_x="have_x=yes \
420 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
421 AC_MSG_RESULT([libraries $x_libraries, headers $x_includes])
424 if test -z "$x_includes" || test "x$x_includes" = xNONE; then
426 x_includes="."; dnl better than nothing :-
428 X_INCLUDES="-I$x_includes"
431 if test -z "$x_libraries" || test "x$x_libraries" = xNONE; then
433 x_libraries="/usr/lib"; dnl better than nothing :-
435 X_LDFLAGS="-L$x_libraries"
437 all_includes="$all_includes $X_INCLUDES"
438 all_libraries="$all_libraries $X_LDFLAGS"
442 AC_SUBST(x_libraries)
446 AC_DEFUN(KDE_PRINT_QT_PROGRAM,
449 cat > conftest.$ac_ext <<EOF
450 #include "confdefs.h"
452 #include <qapplication.h>
461 AC_DEFUN(KDE_CHECK_QT_DIRECT,
463 AC_MSG_CHECKING([if Qt compiles without flags])
464 AC_CACHE_VAL(kde_cv_qt_direct,
466 ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
467 ac_LIBRARY_PATH="$LIBRARY_PATH"
468 ac_cxxflags_safe="$CXXFLAGS"
469 ac_ldflags_safe="$LDFLAGS"
472 CXXFLAGS="$CXXFLAGS -I$qt_includes"
474 LIBS="-lqt -lXext -lX11 $LIBSOCKET"
476 export LD_LIBRARY_PATH
482 if AC_TRY_EVAL(ac_link) && test -s conftest; then
483 kde_cv_qt_direct="yes"
485 kde_cv_qt_direct="no"
486 echo "configure: failed program was:" >&AC_FD_CC
487 cat conftest.$ac_ext >&AC_FD_CC
490 CXXFLAGS="$ac_cxxflags_safe"
491 LDFLAGS="$ac_ldflags_safe"
494 LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
495 export LD_LIBRARY_PATH
496 LIBRARY_PATH="$ac_LIBRARY_PATH"
500 if test "$kde_cv_qt_direct" = "yes"; then
509 ## ------------------------------------------------------------------------
510 ## Try to find the Qt headers and libraries.
511 ## $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
512 ## and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
513 ## ------------------------------------------------------------------------
515 AC_DEFUN(AC_PATH_QT_1_3,
517 AC_REQUIRE([K_PATH_X])
519 AC_MSG_CHECKING([for Qt])
520 ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
524 [ --with-qt-dir where the root of qt is installed ],
525 [ ac_qt_includes="$withval"/include
526 ac_qt_libraries="$withval"/lib
527 ac_qt_bindir="$withval"/bin
530 AC_ARG_WITH(qt-includes,
531 [ --with-qt-includes where the Qt includes are. ],
533 ac_qt_includes="$withval"
538 AC_ARG_WITH(qt-libraries,
539 [ --with-qt-libraries where the Qt library is installed.],
540 [ ac_qt_libraries="$withval"
541 kde_qt_libs_given=yes
544 if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
546 AC_CACHE_VAL(ac_cv_have_qt,
547 [#try to guess Qt locations
549 qt_incdirs="$ac_qt_includes /usr/lib/qt/include /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt $x_includes $QTINC"
550 test -n "$QTDIR" && qt_incdirs="$QTDIR/include $QTDIR $qt_incdirs"
551 AC_FIND_FILE(qmovie.h, $qt_incdirs, qt_incdir)
552 ac_qt_includes="$qt_incdir"
554 if test ! "$ac_qt_libraries" = "NO"; then
555 qt_libdirs="$ac_qt_libraries"
558 qt_libdirs="$qt_libdirs /usr/lib/qt/lib /usr/X11R6/lib /usr/lib /usr/local/qt/lib /usr/lib/qt $x_libraries $QTLIB"
559 test -n "$QTDIR" && qt_libdirs="$QTDIR/lib $QTDIR $qt_libdirs"
563 for dir in $qt_libdirs; do
564 try="ls -1 $dir/libqt*"
565 if test=`eval $try 2> /dev/null`; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
568 dnl AC_FIND_FILE(libqt.so libqt.so.1.40 libqt.so.1.41 libqt.so.1 libqt.a libqt.sl, $qt_libdirs, qt_libdir)
569 ac_qt_libraries="$qt_libdir"
571 ac_cxxflags_safe="$CXXFLAGS"
572 ac_ldflags_safe="$LDFLAGS"
575 CXXFLAGS="$CXXFLAGS -I$qt_incdir"
576 LDFLAGS="-L$qt_libdir $X_LDFLAGS"
577 LIBS="$LIBS -lqt -lXext -lX11 $LIBSOCKET"
581 if AC_TRY_EVAL(ac_link) && test -s conftest; then
584 echo "configure: failed program was:" >&AC_FD_CC
585 cat conftest.$ac_ext >&AC_FD_CC
589 CXXFLAGS="$ac_cxxflags_safe"
590 LDFLAGS="$ac_ldflags_safe"
593 if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
594 ac_cv_have_qt="have_qt=no"
596 if test "$ac_qt_includes" = NO; then
597 if test "$ac_qt_libraries" = NO; then
598 ac_qt_notfound="(headers and libraries)";
600 ac_qt_notfound="(headers)";
603 ac_qt_notfound="(libraries)";
606 AC_MSG_ERROR([Qt-1.4 $ac_qt_notfound not found. Please check your installation! ]);
615 eval "$ac_cv_have_qt"
617 if test "$have_qt" != yes; then
618 AC_MSG_RESULT([$have_qt]);
620 ac_cv_have_qt="have_qt=yes \
621 ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
622 AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes])
624 qt_libraries="$ac_qt_libraries"
625 qt_includes="$ac_qt_includes"
628 if test ! "$kde_qt_libs_given" = "yes"; then
629 KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
632 AC_SUBST(qt_libraries)
633 AC_SUBST(qt_includes)
635 if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
638 QT_INCLUDES="-I$qt_includes"
639 all_includes="$QT_INCLUDES $all_includes"
642 if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
645 QT_LDFLAGS="-L$qt_libraries"
646 all_libraries="$QT_LDFLAGS $all_libraries"
649 AC_SUBST(QT_INCLUDES)
659 ## ------------------------------------------------------------------------
660 ## Now, the same with KDE
661 ## $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
662 ## and $(kde_includes) will be the kdehdrlocation (if needed)
663 ## ------------------------------------------------------------------------
665 AC_DEFUN(AC_BASE_PATH_KDE,
667 AC_REQUIRE([KDE_MISC_TESTS])
668 AC_REQUIRE([AC_PATH_QT])dnl
669 AC_MSG_CHECKING([for KDE])
671 if test "${prefix}" != NONE; then
672 kde_includes=${prefix}/include
673 ac_kde_includes=$prefix/include
675 if test "${exec_prefix}" != NONE; then
676 kde_libraries=${exec_prefix}/lib
677 ac_kde_libraries=$exec_prefix/lib
679 kde_libraries=${prefix}/lib
680 ac_kde_libraries=$prefix/lib
689 AC_CACHE_VAL(ac_cv_have_kde,
690 [#try to guess kde locations
692 if test -z "$1"; then
694 kde_incdirs="$ac_kde_includes /usr/lib/kde/include /usr/local/kde/include /usr/kde/include /usr/include/kde /usr/include /opt/kde/include $x_includes $qt_includes"
695 test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR $kde_incdirs"
696 AC_FIND_FILE(ksock.h, $kde_incdirs, kde_incdir)
697 ac_kde_includes="$kde_incdir"
699 if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/ksock.h"; then
701 in the prefix, you've chosen, are no kde headers installed. This will fail.
702 So, check this please and use another prefix!])
705 kde_libdirs="$ac_kde_libraries /usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib /usr/X11R6/lib /opt/kde/lib /usr/X11R6/kde/lib"
706 test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
707 AC_FIND_FILE(libkdecore.la, $kde_libdirs, kde_libdir)
708 ac_kde_libraries="$kde_libdir"
710 if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/libkdecore.la"; then
712 in the prefix, you've chosen $ac_kde_libraries, are no kde libraries installed. This will fail.
713 So, check this please and use another prefix!])
715 ac_kde_libraries="$kde_libdir"
717 if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
718 ac_cv_have_kde="have_kde=no"
720 ac_cv_have_kde="have_kde=yes \
721 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
726 ac_cv_have_kde="have_kde=no"
731 eval "$ac_cv_have_kde"
733 if test "$have_kde" != "yes"; then
734 if test "${prefix}" = NONE; then
735 ac_kde_prefix="$ac_default_prefix"
737 ac_kde_prefix="$prefix"
739 if test "$exec_prefix" = NONE; then
740 ac_kde_exec_prefix="$ac_kde_prefix"
741 AC_MSG_RESULT([will be installed in $ac_kde_prefix])
743 ac_kde_exec_prefix="$exec_prefix"
744 AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
747 kde_libraries="${ac_kde_exec_prefix}/lib"
748 kde_includes=${ac_kde_prefix}/include
751 ac_cv_have_kde="have_kde=yes \
752 ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
753 AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
755 kde_libraries="$ac_kde_libraries"
756 kde_includes="$ac_kde_includes"
758 AC_SUBST(kde_libraries)
759 AC_SUBST(kde_includes)
761 if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" ; then
764 KDE_INCLUDES="-I$kde_includes"
765 all_includes="$KDE_INCLUDES $all_includes"
768 if test "$kde_libraries" = "$x_libraries" || test "$kde_libraries" = "$qt_libraries" ; then
771 KDE_LDFLAGS="-L$kde_libraries"
772 all_libraries="$KDE_LDFLAGS $all_libraries"
775 AC_SUBST(KDE_LDFLAGS)
776 AC_SUBST(KDE_INCLUDES)
780 AC_SUBST(all_includes)
781 AC_SUBST(all_libraries)
785 AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
787 AC_MSG_CHECKING(for extra includes)
788 AC_ARG_WITH(extra-includes, [ --with-extra-includes adds non standard include paths],
789 kde_use_extra_includes="$withval",
790 kde_use_extra_includes=NONE
792 if test -n "$kde_use_extra_includes" && \
793 test "$kde_use_extra_includes" != "NONE"; then
797 for dir in $kde_use_extra_includes; do
798 all_includes="$all_includes -I$dir"
799 USER_INCLUDES="$USER_INCLUDES -I$dir"
802 kde_use_extra_includes="added"
804 kde_use_extra_includes="no"
807 AC_MSG_RESULT($kde_use_extra_includes)
809 AC_MSG_CHECKING(for extra libs)
810 AC_ARG_WITH(extra-libs, [ --with-extra-libs adds non standard library paths],
811 kde_use_extra_libs=$withval,
812 kde_use_extra_libs=NONE
814 if test -n "$kde_use_extra_libs" && \
815 test "$kde_use_extra_libs" != "NONE"; then
819 for dir in $kde_use_extra_libs; do
820 all_libraries="$all_libraries -L$dir"
821 KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -rpath $dir"
822 USER_LDFLAGS="$USER_LDFLAGS -L$dir"
825 kde_use_extra_libs="added"
827 kde_use_extra_libs="no"
830 AC_MSG_RESULT($kde_use_extra_libs)
834 AC_DEFUN(KDE_CHECK_KIMGIO,
836 AC_REQUIRE([AC_FIND_TIFF])
837 AC_REQUIRE([AC_FIND_JPEG])
838 AC_REQUIRE([AC_FIND_PNG])
840 LIB_KIMGIO='-lkimgio $(LIBJPEG) $(LIBTIFF) $(LIBPNG) -lm'
842 LIB_KHTMLW='-lkhtmlw $(LIB_KIMGIO) -ljscript'
844 LIB_KHTML='-lkhtml $(LIB_KIMGIO) -ljscript'
848 AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
850 AC_REQUIRE([KDE_MISC_TESTS])
852 KDE_LIBS='-lqt -lkdecore -lkdeui -lkfm -lkfile'
854 # LIB_X11='-lX11 $(LIBSOCKET)'
856 # LIB_QT='-lqt $(LIB_X11)'
858 # LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
859 # AC_SUBST(LIB_KDECORE)
860 # LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
861 # AC_SUBST(LIB_KDEUI)
862 # LIB_KFM='-lkfm $(LIB_KDECORE)'
864 # LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
865 # AC_SUBST(LIB_KFILE)
868 AC_DEFUN(AC_PATH_KDE,
871 AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
873 if test "$enableval" = "no";
874 then ac_use_path_checking="default"
875 else ac_use_path_checking=""
877 ], [ac_use_path_checking=""]
880 AC_ARG_WITH(install-root, [ --with-install-root the root, where to install to [default=/]],
882 if test "$withval" = "no";
883 then kde_install_root="";
884 else kde_install_root=$withval;
886 ], [kde_install_root=""]
889 if test -n "$kde_install_root"; then
890 install_root="$kde_install_root"
895 AC_CREATE_KFSSTND($ac_use_path_checking)
898 KDE_CREATE_LIBS_ALIASES
901 dnl slightly changed version of AC_CHECK_FUNC(setenv)
902 AC_DEFUN(AC_CHECK_SETENV,
903 [AC_MSG_CHECKING([for setenv])
904 AC_CACHE_VAL(ac_cv_func_setenv,
907 dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
908 dnl which includes <sys/select.h> which contains a prototype for
909 dnl select. Similarly for bzero.
911 ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
915 [/* We use char because int might match the return type of a gcc2
916 builtin and then its argument prototype would still apply. */
919 /* The GNU C library defines this for functions which it implements
920 to always fail with ENOSYS. Some functions are actually named
921 something starting with __ and the normal name is an alias. */
922 #if defined (__stub_$1) || defined (__stub___$1)
925 setenv("TEST", "alle", 1);
927 ], eval "ac_cv_func_setenv=yes", eval "ac_cv_func_setenv=no")])
929 if test "$ac_cv_func_setenv" = "yes"; then
931 AC_DEFINE_UNQUOTED(HAVE_FUNC_SETENV)
937 AC_DEFUN(AC_CHECK_GETDOMAINNAME,
940 save_CXXFLAGS="$CXXFLAGS"
941 if test "$GCC" = "yes"; then
942 CXXFLAGS="$CXXFLAGS -pedantic-errors"
944 AC_MSG_CHECKING(for getdomainname)
945 AC_CACHE_VAL(ac_cv_func_getdomainname,
953 getdomainname(buffer, 200);
955 ac_cv_func_getdomainname=yes,
956 ac_cv_func_getdomainname=no)
958 AC_MSG_RESULT($ac_cv_func_getdomainname)
959 if eval "test \"`echo `$ac_cv_func_getdomainname\" = yes"; then
960 AC_DEFINE(HAVE_GETDOMAINNAME)
962 CXXFLAGS="$save_CXXFLAGS"
965 AC_DEFUN(AC_CHECK_GETHOSTNAME,
968 save_CXXFLAGS="$CXXFLAGS"
969 if test "$GCC" = "yes"; then
970 CXXFLAGS="$CXXFLAGS -pedantic-errors"
973 AC_MSG_CHECKING([for gethostname])
974 AC_CACHE_VAL(ac_cv_func_gethostname,
982 gethostname(buffer, 200);
984 ac_cv_func_gethostname=yes,
985 ac_cv_func_gethostname=no)
987 AC_MSG_RESULT($ac_cv_func_gethostname)
988 if eval "test \"`echo `$ac_cv_func_gethostname\" = yes"; then
989 AC_DEFINE(HAVE_GETHOSTNAME)
991 CXXFLAGS="$save_CXXFLAGS"
994 AC_DEFUN(AC_CHECK_USLEEP,
998 AC_MSG_CHECKING([for usleep])
999 AC_CACHE_VAL(ac_cv_func_usleep,
1001 ac_libs_safe="$LIBS"
1002 LIBS="$LIBS $LIBUCB"
1010 ac_cv_func_usleep=yes,
1011 ac_cv_func_usleep=no)
1013 AC_MSG_RESULT($ac_cv_func_usleep)
1014 if eval "test \"`echo `$ac_cv_func_usleep\" = yes"; then
1015 AC_DEFINE(HAVE_USLEEP)
1017 LIBS="$ac_libs_safe"
1020 AC_DEFUN(AC_FIND_GIF,
1021 [AC_MSG_CHECKING([for giflib])
1022 AC_CACHE_VAL(ac_cv_lib_gif,
1023 [ac_save_LIBS="$LIBS"
1024 LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
1030 int GifLastError(void);
1034 /* We use char because int might match the return type of a gcc2
1035 builtin and then its argument prototype would still apply. */
1037 [return GifLastError();],
1038 eval "ac_cv_lib_gif=yes",
1039 eval "ac_cv_lib_gif=no")
1040 LIBS="$ac_save_LIBS"
1042 if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
1044 AC_DEFINE_UNQUOTED(HAVE_LIBGIF)
1046 AC_MSG_ERROR(You need giflib23. Please install the kdesupport package)
1050 AC_DEFUN(AC_FIND_JPEG,
1051 [AC_MSG_CHECKING([for jpeglib])
1052 AC_CACHE_VAL(ac_cv_lib_jpeg,
1053 [ac_save_LIBS="$LIBS"
1054 LIBS="$all_libraries -ljpeg -lm"
1056 [/* Override any gcc2 internal prototype to avoid an error. */
1057 struct jpeg_decompress_struct;
1058 typedef struct jpeg_decompress_struct * j_decompress_ptr;
1063 void jpeg_CreateDecompress(j_decompress_ptr cinfo,
1064 int version, size_t structsize);
1068 /* We use char because int might match the return type of a gcc2
1069 builtin and then its argument prototype would still apply. */
1071 [jpeg_CreateDecompress(0L, 0, 0);],
1072 eval "ac_cv_lib_jpeg=-ljpeg",
1073 eval "ac_cv_lib_jpeg=no")
1074 LIBS="$ac_save_LIBS"
1076 dnl what to do, if the normal way fails:
1077 if eval "test \"`echo $ac_cv_lib_jpeg`\" = no"; then
1078 if test -f "$kde_libraries/libjpeg.so"; then
1079 test -f ./libjpegkde.so || $LN_S $kde_libraries/libjpeg.so ./libjpegkde.so
1080 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1081 else if test -f "$kde_libraries/libjpeg.sl"; then
1082 test -f ./libjpegkde.sl ||$LN_S $kde_libraries/libjpeg.sl ./libjpegkde.sl
1083 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1084 else if test -f "$kde_libraries/libjpeg.a"; then
1085 test -f ./libjpegkde.a || $LN_S $kde_libraries/libjpeg.a ./libjpegkde.a
1086 ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
1089 You need jpeglib6a. Please install the kdesupport package.
1090 If you have already installed kdesupport, you may have an
1091 old libjpeg somewhere.
1092 In this case copy $KDEDIR/lib/libjpeg* to /usr/lib.
1099 if eval "test ! \"`echo $ac_cv_lib_jpeg`\" = no"; then
1100 LIBJPEG="$ac_cv_lib_jpeg"
1102 AC_MSG_RESULT($ac_cv_lib_jpeg)
1103 AC_DEFINE_UNQUOTED(HAVE_LIBJPEG)
1107 AC_DEFUN(AC_FIND_ZLIB,
1109 AC_MSG_CHECKING([for libz])
1110 AC_CACHE_VAL(ac_cv_lib_z,
1111 [ac_save_LIBS="$LIBS"
1112 LIBS="$all_libraries -lz $LIBSOCKET"
1117 [return (zlibVersion() == ZLIB_VERSION); ],
1118 eval "ac_cv_lib_z='-lz'",
1119 eval "ac_cv_lib_z=no")
1120 LIBS="$ac_save_LIBS"
1122 if eval "test ! \"`echo $ac_cv_lib_z`\" = no"; then
1123 dnl AC_DEFINE_UNQUOTED(HAVE_LIBZ)
1126 AC_MSG_RESULT($ac_cv_lib_z)
1134 AC_DEFUN(AC_FIND_TIFF,
1136 AC_REQUIRE([AC_FIND_ZLIB])
1137 AC_REQUIRE([AC_FIND_JPEG])
1138 AC_MSG_CHECKING([for libtiff])
1139 AC_CACHE_VAL(ac_cv_lib_tiff,
1140 [ac_save_LIBS="$LIBS"
1141 LIBS="$all_libraries -ltiff $LIBJPEG $LIBZ -lX11 $LIBSOCKET"
1146 [return (TIFFOpen( "", "r") == 0); ],
1147 eval "ac_cv_lib_tiff='-ltiff $LIBJPEG $LIBZ'",
1148 eval "ac_cv_lib_tiff=no")
1149 LIBS="$ac_save_LIBS"
1151 if eval "test ! \"`echo $ac_cv_lib_tiff`\" = no"; then
1152 AC_DEFINE_UNQUOTED(HAVE_LIBTIFF)
1153 LIBTIFF="$ac_cv_lib_tiff"
1155 AC_MSG_RESULT($ac_cv_lib_tiff)
1164 AC_DEFUN(AC_FIND_PNG,
1166 AC_REQUIRE([AC_FIND_ZLIB])
1167 AC_MSG_CHECKING([for libpng])
1168 AC_CACHE_VAL(ac_cv_lib_png,
1169 [ac_save_LIBS="$LIBS"
1170 LIBS="$all_libraries -lpng $LIBZ -lm -lX11 $LIBSOCKET"
1177 png_structp png_ptr = png_create_read_struct( // image ptr
1178 PNG_LIBPNG_VER_STRING, 0, 0, 0 );
1179 return( png_ptr != 0 );
1181 eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
1182 eval "ac_cv_lib_png=no")
1183 LIBS="$ac_save_LIBS"
1185 if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
1186 AC_DEFINE_UNQUOTED(HAVE_LIBPNG)
1187 LIBPNG="$ac_cv_lib_png"
1189 AC_MSG_RESULT($ac_cv_lib_png)
1197 AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
1199 AC_MSG_CHECKING(if you need GNU extensions)
1200 AC_CACHE_VAL(ac_cv_gnu_extensions,
1202 cat > conftest.c << EOF
1203 #include <features.h>
1205 #ifdef __GNU_LIBRARY__
1210 if (eval "$ac_cpp conftest.c") 2>&5 |
1211 egrep "yes" >/dev/null 2>&1; then
1213 ac_cv_gnu_extensions=yes
1215 ac_cv_gnu_extensions=no
1219 AC_MSG_RESULT($ac_cv_gnu_extensions)
1220 if test "$ac_cv_gnu_extensions" = "yes"; then
1221 AC_DEFINE_UNQUOTED(_GNU_SOURCE)
1225 AC_DEFUN(AC_CHECK_COMPILERS,
1227 dnl this is somehow a fat lie, but prevents other macros from double checking
1228 AC_PROVIDE([AC_PROG_CC])
1229 AC_PROVIDE([AC_PROG_CPP])
1230 AC_ARG_ENABLE(debug,[ --enable-debug creates debugging code [default=no]],
1232 if test $enableval = "no"; dnl
1233 then ac_use_debug_code="no"
1234 else ac_use_debug_code="yes"
1236 ], [ac_use_debug_code="no"])
1238 AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
1240 if test $enableval = "no"; then
1241 ac_use_strict_options="no"
1243 ac_use_strict_options="yes"
1245 ], [ac_use_strict_options="no"])
1247 dnl this was AC_PROG_CC. I had to include it manualy, since I had to patch it
1248 AC_MSG_CHECKING(for a C-Compiler)
1249 dnl if there is one, print out. if not, don't matter
1252 if test -z "$CC"; then AC_CHECK_PROG(CC, gcc, gcc) fi
1253 if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) fi
1254 if test -z "$CC"; then AC_CHECK_PROG(CC, xlc, xlc) fi
1255 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
1260 if test $ac_cv_prog_gcc = yes; then
1266 if test -z "$CFLAGS"; then
1267 if test "$ac_use_debug_code" = "yes"; then
1269 if test $ac_cv_prog_cc_g = yes; then
1273 if test "$GCC" = "yes"; then
1280 if test "$GCC" = "yes"; then
1281 CFLAGS="$CFLAGS -Wall"
1283 if test "$ac_use_strict_options" = "yes"; then
1284 CFLAGS="$CFLAGS -W -ansi -pedantic"
1291 *-*-sysv4.2uw*) CFLAGS="$CFLAGS -D_UNIXWARE";;
1294 if test -z "$LDFLAGS" && test "$ac_use_debug_code" = "no" && test "$GCC" = "yes"; then
1299 dnl this is AC_PROG_CPP. I had to include it here, since autoconf checks
1300 dnl dependecies between AC_PROG_CPP and AC_PROG_CC (or is it automake?)
1302 AC_MSG_CHECKING(how to run the C preprocessor)
1303 # On Suns, sometimes $CPP names a directory.
1304 if test -n "$CPP" && test -d "$CPP"; then
1307 if test -z "$CPP"; then
1308 AC_CACHE_VAL(ac_cv_prog_CPP,
1309 [ # This must be in double quotes, not single quotes, because CPP may get
1310 # substituted into the Makefile and "${CC-cc}" will confuse make.
1312 # On the NeXT, cc -E runs the code through the compiler's parser,
1313 # not just through cpp.
1314 dnl Use a header file that comes with gcc, so configuring glibc
1315 dnl with a fresh cross-compiler works.
1316 AC_TRY_CPP([#include <assert.h>
1318 CPP="${CC-cc} -E -traditional-cpp"
1319 AC_TRY_CPP([#include <assert.h>
1320 Syntax Error], , CPP=/lib/cpp))
1321 ac_cv_prog_CPP="$CPP"])dnl
1322 CPP="$ac_cv_prog_CPP"
1324 ac_cv_prog_CPP="$CPP"
1330 AC_MSG_CHECKING(for a C++-Compiler)
1331 dnl if there is one, print out. if not, don't matter
1334 if test -z "$CXX"; then AC_CHECK_PROG(CXX, g++, g++) fi
1335 if test -z "$CXX"; then AC_CHECK_PROG(CXX, CC, CC) fi
1336 if test -z "$CXX"; then AC_CHECK_PROG(CXX, xlC, xlC) fi
1337 if test -z "$CXX"; then AC_CHECK_PROG(CXX, DCC, DCC) fi
1338 test -z "$CXX" && AC_MSG_ERROR([no acceptable C++-compiler found in \$PATH])
1343 if test $ac_cv_prog_gxx = yes; then
1346 AC_MSG_CHECKING(whether we are using SPARC CC)
1348 cat > conftest.C << EOF
1354 ac_try="$CXX -E conftest.C"
1355 if { (eval echo configure:__online__: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | egrep yes >/dev/null 2>&1; then
1360 AC_MSG_RESULT($ac_cv_prog_CC)
1363 if test -z "$CXXFLAGS"; then
1364 if test "$ac_use_debug_code" = "yes"; then
1366 if test $ac_cv_prog_cxx_g = yes; then
1369 if test "$ac_cv_prog_CC" = "yes"; then
1370 CXXFLAGS="$CXXFLAGS -pto"
1373 if test "$GXX" = "yes"; then
1376 if test "$ac_cv_prog_CC" = "yes"; then
1384 if test "$GXX" = "yes"; then
1385 CXXFLAGS="$CXXFLAGS -Wall"
1387 if test "$ac_use_strict_options" = "yes"; then
1388 CXXFLAGS="$CXXFLAGS -W -ansi -Wtraditional -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Woverloaded-virtual -Wbad-function-cast -Wsynth"
1391 if test "$kde_very_strict" = "yes"; then
1392 CXXFLAGS="$CXXFLAGS -Wold-style-cast -Wshadow -Wredundant-decls -Wconversion"
1398 *-*-sysv4.2uw*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE";;
1403 dnl just a wrapper to clean up configure.in
1404 AC_DEFUN(KDE_PROG_LIBTOOL,
1406 AC_REQUIRE([AM_ENABLE_SHARED])
1407 AC_REQUIRE([AM_ENABLE_STATIC])
1408 dnl libtool is only for C, so I must force him
1409 dnl to find the correct flags for C++
1411 ac_save_cflags="$CFLAGS"
1414 AM_PROG_LIBTOOL dnl for libraries
1416 CFLAGS="$ac_save_cflags"
1419 AC_DEFUN(KDE_DO_IT_ALL,
1421 AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
1427 AC_DEFUN(AC_CHECK_RPATH,
1429 AC_MSG_CHECKING(for rpath)
1430 AC_ARG_ENABLE(rpath,
1431 [ --disable-rpath do not use the rpath feature of ld],
1432 USE_RPATH=$enableval, USE_RPATH=yes)
1433 if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
1435 KDE_RPATH="-rpath \$(kde_libraries)"
1437 if test -n "$qt_libraries"; then
1438 KDE_RPATH="$KDE_RPATH -rpath \$(qt_libraries)"
1440 dnl $x_libraries is set to /usr/lib in case
1441 if test -n "$X_LDFLAGS"; then
1442 KDE_RPATH="$KDE_RPATH -rpath \$(x_libraries)"
1444 if test -n "$KDE_EXTRA_RPATH"; then
1445 KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
1448 AC_SUBST(KDE_EXTRA_RPATH)
1450 AC_MSG_RESULT($USE_RPATH)
1453 dnl This is a merge of some macros out of the gettext aclocal.m4
1454 dnl since we don't need anything, I took the things we need
1455 AC_DEFUN(AM_KDE_WITH_NLS,
1456 [AC_MSG_CHECKING([whether NLS is requested])
1458 dnl Default is enabled NLS
1460 [ --disable-nls do not use Native Language Support],
1461 USE_NLS=$enableval, USE_NLS=yes)
1462 AC_MSG_RESULT($USE_NLS)
1465 dnl If we use NLS figure out what method
1466 if test "$USE_NLS" = "yes"; then
1467 AC_DEFINE(ENABLE_NLS)
1469 AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
1470 [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
1471 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1473 if test -z "`$MSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
1474 AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
1479 AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
1480 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1482 dnl Test whether we really found GNU xgettext.
1483 if test "$XGETTEXT" != ":"; then
1484 dnl If it is no GNU xgettext we define it as : so that the
1485 dnl Makefiles still can work.
1486 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1490 [found xgettext programs is not GNU xgettext; ignore it])
1499 # Search path for a program which passes the given test.
1500 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1503 # Stephan Kulow: I appended a _KDE against name conflicts
1505 dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
1506 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1507 AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
1508 [# Extract the first word of "$2", so it can be a program name with args.
1509 set dummy $2; ac_word=[$]2
1510 AC_MSG_CHECKING([for $ac_word])
1511 AC_CACHE_VAL(ac_cv_path_$1,
1514 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1517 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1518 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1519 test -z "$ac_dir" && ac_dir=.
1520 if test -f $ac_dir/$ac_word; then
1522 ac_cv_path_$1="$ac_dir/$ac_word"
1528 dnl If no 4th arg is given, leave the cache variable unset,
1529 dnl so AC_PATH_PROGS will keep looking.
1530 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1535 if test -n "[$]$1"; then
1536 AC_MSG_RESULT([$]$1)
1544 dnl From Jim Meyering.
1545 dnl FIXME: migrate into libit.
1547 AC_DEFUN(AM_FUNC_OBSTACK,
1548 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
1549 [AC_TRY_LINK([#include "obstack.h"],
1550 [struct obstack *mem;obstack_free(mem,(char *) 0)],
1551 am_cv_func_obstack=yes,
1552 am_cv_func_obstack=no)])
1553 if test $am_cv_func_obstack = yes; then
1554 AC_DEFINE(HAVE_OBSTACK)
1556 LIBOBJS="$LIBOBJS obstack.o"
1560 dnl From Jim Meyering. Use this if you use the GNU error.[ch].
1561 dnl FIXME: Migrate into libit
1563 AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
1564 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
1565 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
1566 am_cv_lib_error_at_line=yes,
1567 am_cv_lib_error_at_line=no)])
1568 if test $am_cv_lib_error_at_line = no; then
1569 LIBOBJS="$LIBOBJS error.o"
1571 AC_SUBST(LIBOBJS)dnl
1574 # Macro to add for using GNU gettext.
1575 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1578 # Stephan Kulow: I put a KDE in it to avoid name conflicts
1580 AC_DEFUN(AM_KDE_GNU_GETTEXT,
1581 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1582 AC_REQUIRE([AC_PROG_RANLIB])dnl
1583 AC_REQUIRE([AC_HEADER_STDC])dnl
1584 AC_REQUIRE([AC_C_INLINE])dnl
1585 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1586 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1587 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1588 AC_REQUIRE([AC_FUNC_MMAP])dnl
1589 AC_REQUIRE([AM_KDE_WITH_NLS])dnl
1590 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
1591 unistd.h values.h alloca.h])
1592 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
1593 __argz_count __argz_stringify __argz_next stpcpy])
1597 if test "x$CATOBJEXT" != "x"; then
1598 if test "x$ALL_LINGUAS" = "x"; then
1601 AC_MSG_CHECKING(for catalogs to be installed)
1603 for lang in ${LINGUAS=$ALL_LINGUAS}; do
1604 case "$ALL_LINGUAS" in
1605 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
1608 LINGUAS=$NEW_LINGUAS
1609 AC_MSG_RESULT($LINGUAS)
1612 dnl Construct list of names of catalog files to be constructed.
1613 if test -n "$LINGUAS"; then
1614 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1620 AC_DEFUN(AC_HAVE_XPM,
1621 [AC_REQUIRE_CPP()dnl
1623 test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
1624 test -z "$XPM_INCLUDE" && XPM_INCLUDE=
1626 AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
1627 xpm_test=$withval, xpm_test="yes")
1628 if test "x$xpm_test" = xno; then
1631 AC_MSG_CHECKING(for XPM)
1632 AC_CACHE_VAL(ac_cv_have_xpm,
1635 ac_save_ldflags="$LDFLAGS"
1636 ac_save_cflags="$CFLAGS"
1637 LDFLAGS="$LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBSOCKET"
1638 CFLAGS="$CFLAGS $X_INCLUDES"
1639 test ! -z "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
1640 AC_TRY_LINK([#include <X11/xpm.h>],[],
1641 ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
1642 LDFLAGS="$ac_save_ldflags"
1643 CFLAGS="$ac_save_cflags"
1646 if test "$ac_cv_have_xpm" = no; then
1653 if test "$XPM_LDFLAGS" = ""; then
1656 XPMLIB="-L$XPM_LDFLAGS -lXpm"
1658 if test "$XPM_INCLUDE" = ""; then
1661 XPMINC="-I$XPM_INCLUDE"
1671 AC_DEFUN(AC_HAVE_GL,
1672 [AC_REQUIRE_CPP()dnl
1674 test -z "$GL_LDFLAGS" && GL_LDFLAGS=
1675 test -z "$GL_INCLUDE" && GL_INCLUDE=
1677 AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
1678 gl_test=$withval, gl_test="yes")
1679 if test "x$gl_test" = xno; then
1682 AC_MSG_CHECKING(for GL)
1683 AC_CACHE_VAL(ac_cv_have_gl,
1686 ac_save_ldflags="$LDFLAGS"
1687 ac_save_cflags="$CFLAGS"
1688 LDFLAGS="$LDFLAGS $GL_LDFLAGS $all_libraries -lMesaGL -lMesaGLU -lX11 -lXext -lm $LIBSOCKET"
1689 CFLAGS="$CFLAGS $X_INCLUDES"
1690 test ! -z "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
1692 ac_cv_have_gl="yes",ac_cv_have_gl="no")
1693 LDFLAGS="$ac_save_ldflags"
1694 CFLAGS="$ac_save_cflags"
1697 if test "$ac_cv_have_gl" = no; then
1704 if test "$GL_LDFLAGS" = ""; then
1705 GLLIB="-lMesaGL -lMesaGLU"
1707 GLLIB="-L$GL_LDFLAGS -lMesaGL -lMesaGLU"
1709 if test "$GL_INCLUDE" = ""; then
1712 GLINC="-I$GL_INCLUDE"
1724 dnl Should test for PAM (Pluggable Authentication Modules)
1725 AC_DEFUN(AC_PATH_PAM_DIRECT,
1727 test -z "$pam_direct_test_library" && pam_direct_test_library=pam
1728 test -z "$pam_direct_test_include" && pam_direct_test_include=security/pam_appl.h
1732 /usr/local/include \
1734 /usr/unsupported/include \
1737 /usr/local/pam/include \
1738 /usr/lib/pam/include \
1743 if test -r "$ac_dir/$pam_direct_test_include"; then
1744 no_pam= ac_pam_includes=$ac_dir
1749 # First see if replacing the include by lib works.
1750 for ac_dir in `echo "$ac_pam_includes" | sed s/include/lib/` \
1755 /usr/unsupported/lib \
1761 for ac_extension in a so sl; do
1762 if test -r $ac_dir/lib${pam_direct_test_library}.$ac_extension; then
1763 no_pam= ac_pam_libraries=$ac_dir
1770 AC_DEFUN(AC_PATH_PAM,
1771 [AC_REQUIRE_CPP()dnl
1773 AC_CHECK_LIB(pam_misc, main, [PAM_MISC_LIB="-lpam_misc"], [], [-lpam -ldl])
1775 AC_MSG_CHECKING(for PAM)
1777 [ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]],
1779 if test "x$withval" = "xyes"; then
1782 elif test "x$withval" = "xno"; then
1786 pam_service="$withval"
1787 if test -z "$pam_service"; then
1796 if test ! "$no_pam" = yes; then
1798 AC_CACHE_VAL(ac_cv_path_pam,
1800 ac_pam_includes=NONE
1801 ac_pam_libraries=NONE
1802 if test -z "$pam_libraries"; then
1805 if test -z "$pam_includes"; then
1811 test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
1812 test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
1814 if test ! "x$pam_includes" = xNONE && test ! "x$pam_libraries" = xNONE; then
1815 ac_pam_libs="-lpam $PAM_MISC_LIB -ldl"
1816 ac_cv_path_pam="no_pam= ac_pam_includes=$ac_pam_includes ac_pam_libraries=$ac_pam_libraries ac_pam_libs=\"$ac_pam_libs\""
1818 ac_cv_path_pam="no_pam=yes"
1822 eval "$ac_cv_path_pam"
1826 if test "$no_pam" = yes; then
1830 PAMLIBS="$ac_pam_libs"
1831 test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
1832 test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
1833 AC_MSG_RESULT([libraries $pam_libraries, headers $pam_includes])
1834 if test "$default_pam" = yes; then
1835 AC_MSG_RESULT(["default pam service name will be used"])
1837 AC_DEFINE_UNQUOTED(KDE_PAM_SERVICE,"$pam_service")
1838 AC_MSG_RESULT(["pam service name will be: " $pam_service])
1840 dnl test whether struct pam_message is const (Linux) or not (Sun)
1841 pam_appl_h="$ac_pam_includes/security/pam_appl.h"
1842 AC_MSG_CHECKING(for const pam_message)
1843 AC_EGREP_HEADER([struct pam_message],
1845 [ AC_EGREP_HEADER([const struct pam_message],
1847 [AC_MSG_RESULT(["const: Linux-type PAM"]) ],
1848 [AC_MSG_RESULT(["nonconst: Sun-type PAM"])
1849 AC_DEFINE(PAM_MESSAGE_NONCONST)]
1851 [AC_MSG_RESULT(["not found - assume const, Linux-type PAM"])]
1855 if test "x$pam_libraries" != x && test "x$pam_libraries" != xNONE ; then
1856 PAMLIBPATHS="-L$pam_libraries"
1858 if test "x$pam_includes" != x && test "x$pam_includes" != xNONE ; then
1859 PAMINC="-I$pam_includes"
1864 AC_SUBST(PAMLIBPATHS)
1868 AC_DEFUN(KDE_CHECK_LIBDL,
1870 AC_CHECK_LIB(dl, dlopen, [
1872 ac_cv_have_dlfcn=yes
1875 AC_CHECK_LIB(dld, shl_unload, [
1877 ac_cv_have_shload=yes
1883 AC_DEFUN(KDE_CHECK_DLOPEN,
1886 AC_CHECK_HEADERS(dlfcn.h dl.h)
1887 if test "$ac_cv_header_dlfcn_h" = "no"; then
1891 if test "$ac_cv_header_dl_h" = "no"; then
1892 ac_cv_have_shload=no
1896 AC_ARG_ENABLE(dlopen,
1897 [ --disable-dlopen link staticly [default=no]] ,
1898 [if test "$enableval" = yes; then
1903 # override the user's opinion, if we know it better ;)
1904 if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
1908 if test "$ac_cv_have_dlfcn" = "yes"; then
1909 AC_DEFINE_UNQUOTED(HAVE_DLFCN)
1912 if test "$ac_cv_have_shload" = "yes"; then
1913 AC_DEFINE_UNQUOTED(HAVE_SHLOAD)
1916 if test "$enable_dlopen" = no ; then
1917 test -n "$1" && eval $1
1919 test -n "$2" && eval $2
1924 AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
1926 KDE_CHECK_DLOPEN(libtool_enable_shared=no, libtool_enable_static=no)
1928 AC_MSG_CHECKING([dynamic loading])
1929 eval "`egrep '^build_libtool_libs=' libtool`"
1930 if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
1932 AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
1936 AC_MSG_RESULT($dynamic_loading)
1937 if test "$dynamic_loading" = "yes"; then
1944 AC_DEFUN(KDE_ADD_INCLUDES,
1946 if test -z "$1"; then
1947 test_include="Pix.h"
1952 AC_MSG_CHECKING([for libg++ ($test_include)])
1954 AC_CACHE_VAL(kde_cv_libgpp_includes,
1956 kde_cv_libgpp_includes=no
1962 /usr/unsupported/include \
1967 if test -r "$ac_dir/$test_include"; then
1968 kde_cv_libgpp_includes=$ac_dir
1974 AC_MSG_RESULT($kde_cv_libgpp_includes)
1975 if test "$kde_cv_libgpp_includes" != "no"; then
1976 all_includes="-I$kde_cv_libgpp_includes $all_includes"
1982 AC_DEFUN(KDE_CHECK_MICO,
1984 AC_REQUIRE([KDE_CHECK_LIBDL])
1985 AC_MSG_CHECKING(for MICO)
1986 AC_ARG_WITH(micodir,
1987 [ --with-micodir=micodir where mico is installed ],
1988 kde_micodir=$withval,
1989 kde_micodir=/usr/local
1991 AC_MSG_RESULT($kde_micodir)
1992 if test ! -r $kde_micodir/include/CORBA.h; then
1993 AC_MSG_ERROR([No CORBA.h found, specify another micodir])
1996 MICO_INCLUDES=-I$kde_micodir/include
1997 AC_SUBST(MICO_INCLUDES)
1998 MICO_LDFLAGS=-L$kde_micodir/lib
1999 AC_SUBST(MICO_LDFLAGS)
2001 AC_MSG_CHECKING([for MICO version])
2002 AC_CACHE_VAL(kde_cv_mico_version,
2005 cat >conftest.$ac_ext <<EOF
2007 #include <mico/version.h>
2010 printf("MICO_VERSION=%s\n",MICO_VERSION);
2014 ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
2015 if AC_TRY_EVAL(ac_compile); then
2016 if eval `./conftest 2>&5`; then
2017 kde_cv_mico_version=$MICO_VERSION
2019 AC_MSG_ERROR([your system is not able to execute a small application to
2020 find MICO version! Check $kde_micodir/include/mico/version.h])
2023 AC_MSG_ERROR([your system is not able to compile a small application to
2024 find MICO version! Check $kde_micodir/include/mico/version.h])
2028 dnl installed MICO version
2029 mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
2030 mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
2031 mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
2033 dnl required MICO version
2034 req_v_maj=`echo $1 | sed -e 's/^\(.*\)\..*\..*$/\1/'`
2035 req_v_mid=`echo $1 | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
2036 req_v_min=`echo $1 | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
2038 if test "$mico_v_maj" -lt "$req_v_maj" || \
2039 ( test "$mico_v_maj" -eq "$req_v_maj" && \
2040 test "$mico_v_mid" -lt "$req_v_mid" ) || \
2041 ( test "$mico_v_mid" -eq "$req_v_mid" && \
2042 test "$mico_v_min" -lt "$req_v_min" )
2045 AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $1 \
2046 at least is required. You should upgrade MICO.])
2048 AC_MSG_RESULT([$kde_cv_mico_version (minimum version $1, ok)])
2051 LIBMICO="-lmico$kde_cv_mico_version $LIBDL"
2053 IDL=$kde_micodir/bin/idl
2058 AC_DEFUN(KDE_CHECK_MINI_STL,
2060 AC_REQUIRE([KDE_CHECK_MICO])
2062 AC_MSG_CHECKING(if we use mico's mini-STL)
2063 AC_CACHE_VAL(kde_cv_have_mini_stl,
2066 kde_save_cxxflags="$CXXFLAGS"
2067 CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
2070 #include <mico/config.h>
2073 #ifdef HAVE_MINI_STL
2077 kde_cv_have_mini_stl=no,
2078 kde_cv_have_mini_stl=yes)
2079 CXXFLAGS="$kde_save_cxxflags"
2083 AC_MSG_RESULT($kde_cv_have_mini_stl)
2084 if test "$kde_cv_have_mini_stl" = "yes"; then
2085 AC_DEFINE_UNQUOTED(HAVE_MINI_STL)
2092 AC_DEFUN(KDE_CHECK_LIBPTHREAD,
2094 AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"], LIBPTHREAD= )
2095 AC_SUBST(LIBPTHREAD)
2098 AC_DEFUN(KDE_TRY_LINK_PYTHON,
2100 AC_CACHE_VAL(kde_cv_try_link_python_$1,
2102 kde_save_cxxflags="$CXXFLAGS"
2103 CXXFLAGS="$CXXFLAGS $PYTHONINC"
2104 kde_save_libs="$LIBS"
2105 LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
2106 kde_save_ldflags="$LDFLAGS"
2107 LDFLAGS="$LDFLAGS $PYTHONLIB"
2113 PySys_SetArgv(1, 0);
2115 [kde_cv_try_link_python_$1=yes],
2116 [kde_cv_try_link_python_$1=no]
2118 CXXFLAGS="$kde_save_cxxflags"
2119 LIBS="$kde_save_libs"
2120 LDFLAGS="$kde_save_ldflags"
2123 if test "$kde_cv_try_link_python_$1" = "yes"; then
2131 AC_DEFUN(KDE_CHECK_PYTHON,
2133 AC_REQUIRE([KDE_CHECK_LIBDL])
2134 AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
2135 if test -z "$1"; then
2141 AC_MSG_CHECKING([for Python$version])
2143 AC_ARG_WITH(pythondir,
2144 [ --with-pythondir=pythondir use python installed in pythondir ],
2146 ac_python_dir=$withval
2147 ], ac_python_dir=/usr/local
2150 python_incdirs="$ac_python_dir/include/python$version /usr/include/python$version /usr/local/include/python$version /usr/local/include"
2151 AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
2152 if test ! -r $python_incdir/Python.h; then
2153 AC_MSG_ERROR(Python.h not found.)
2156 PYTHONINC=-I$python_incdir
2158 python_libdirs="$ac_python_dir/lib/python$version/config /usr/lib/python$version/config /usr/local/python$version/config"
2159 AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
2160 if test ! -r $python_libdir/libpython$version.a; then
2161 AC_MSG_ERROR(libpython$version.a not found.)
2164 PYTHONLIB=-L$python_libdir
2165 LIBPYTHON=-lpython$version
2167 AC_MSG_RESULT(header $python_incdir library $python_libdir)
2169 dnl Note: this test is very weak
2170 AC_MSG_CHECKING(if an Python application links)
2171 KDE_TRY_LINK_PYTHON(normal, "", AC_MSG_RESULT(yes),
2174 AC_MSG_CHECKING(if Python depends on -lpthread)
2175 KDE_TRY_LINK_PYTHON(pthread, "$LIBPTHREAD",
2178 LIBPYTHON="$LIBPYTHON $LIBPTHREAD $LIBDL"
2182 AC_MSG_CHECKING(if Python depeds on -ltcl)
2183 KDE_TRY_LINK_PYTHON(tcl, "-ltcl",
2186 LIBPYTHON="$LIBPYTHON -ltcl"
2190 AC_MSG_WARN([it seems, Python depends on another library.
2191 Pleae use \"make LIBPTYHON='-lpython$version -lotherlib'\" to fix this
2192 and contact the authors to let them know about this problem])
2204 AC_DEFUN(KDE_CHECK_STL_SGI,
2206 AC_MSG_CHECKING([if STL implementation is SGI like])
2207 AC_CACHE_VAL(kde_cv_stl_type_sgi,
2212 string astring="Hallo Welt.";
2213 astring.erase(0, 6); // now astring is "Welt"
2215 ], kde_cv_stl_type_sgi=yes,
2216 kde_cv_stl_type_sgi=no)
2219 AC_MSG_RESULT($kde_cv_stl_type_sgi)
2221 if test "$kde_cv_stl_type_sgi" = "yes"; then
2222 AC_DEFINE_UNQUOTED(HAVE_SGI_STL)
2226 AC_DEFUN(KDE_CHECK_STL_HP,
2228 AC_MSG_CHECKING([if STL implementation is HP like])
2229 AC_CACHE_VAL(kde_cv_stl_type_hp,
2234 string astring="Hello World";
2235 astring.remove(0, 6); // now astring is "World"
2237 ], kde_cv_stl_type_hp=yes,
2238 kde_cv_stl_type_hp=no)
2240 AC_MSG_RESULT($kde_cv_stl_type_hp)
2242 if test "$kde_cv_stl_type_hp" = "yes"; then
2243 AC_DEFINE_UNQUOTED(HAVE_HP_STL)
2247 AC_DEFUN(KDE_CHECK_STL,
2251 if test "$kde_cv_stl_type_sgi" = "no"; then
2254 if test "$kde_cv_stl_type_hp" = "no"; then
2255 AC_MSG_ERROR("no known STL type found")
2261 AC_DEFUN(AC_FIND_QIMGIO,
2262 [AC_REQUIRE([AC_FIND_JPEG])
2263 AC_MSG_CHECKING([for qimgio])
2264 AC_CACHE_VAL(ac_cv_lib_qimgio,
2265 [ac_save_LIBS="$LIBS"
2266 LIBS="$all_libraries -lqimgio -lpng -lz -lqt $LIBJPEG -lX11 $LIBSOCKET"
2269 void qInitImageIO ();
2272 eval "ac_cv_lib_qimgio=yes",
2273 eval "ac_cv_lib_qimgio=no")
2274 LIBS="$ac_save_LIBS"
2276 if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
2277 LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
2279 AC_DEFINE_UNQUOTED(HAVE_QIMGIO)
2282 AC_MSG_RESULT(not found)
2286 AC_DEFUN(KDE_CHECK_ANSI,
2288 AC_MSG_CHECKING([for strdup])
2290 AC_CACHE_VAL(kde_cv_stl_type_sgi,
2293 save_CXXFLAGS="$CXXFLAGS"
2294 if test "$GCC" = "yes"; then
2295 CXXFLAGS="$CXXFLAGS -pedantic-errors"
2301 char buffer[] = "Hallo";
2303 ], kde_cv_has_strdup=yes,
2304 kde_cv_has_strdup=no)
2305 CXXFLAGS="$save_CXXFLAGS"
2307 AC_MSG_RESULT($kde_cv_has_strdup)
2309 if test "$kde_cv_has_strdup" = "yes"; then
2310 AC_DEFINE_UNQUOTED(HAVE_STRDUP)
2315 AC_DEFUN(KDE_CHECK_INSURE,
2317 AC_ARG_ENABLE(insure, [ --enable-insure use insure++ for debugging [default=no]],
2319 if test $enableval = "no"; dnl
2320 then ac_use_insure="no"
2321 else ac_use_insure="yes"
2323 ], [ac_use_insure="no"])
2325 AC_MSG_CHECKING(if we will use Insure++ to debug)
2326 AC_MSG_RESULT($ac_use_insure)
2327 if test "$ac_use_insure" = "yes"; dnl
2328 then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
2332 dnl this is for kdm:
2334 AC_DEFUN(AC_CHECK_KDM,
2336 AC_CHECK_FUNCS(getsecretkey)
2337 dnl checks for X server
2339 AC_PATH_PROG(X_SERVER, X)
2340 if test ! -z "$X_SERVER"; then
2341 X_SERVER=`echo $X_SERVER | sed -e 's+/X$++'`
2342 AC_DEFINE_UNQUOTED(XBINDIR,$X_SERVER)
2347 dnl This one tries to find XDMDIR for config files
2349 [ --with-xdmdir If the xdm config dir can't be found automaticly],
2350 [ ac_xdmdir=$withval],
2353 AC_MSG_CHECKING([for xdm configuration dir])
2354 if test "$ac_xdmdir" = "no"; then
2356 if mkdir conftestdir; then
2358 cat > Imakefile <<'EOF'
2360 @echo 'ac_xdmdir="$(XDMDIR)";'
2362 if (xmkmf) > /dev/null 2> /dev/null && test -f Makefile; then
2363 eval `${MAKE-make} acfindxdm 2>/dev/null 2>/dev/null | grep -v make`
2367 dnl Check if Imake was right
2368 if test -f $ac_xdmdir/xdm-config; then
2369 AC_MSG_RESULT($ac_xdmdir)
2371 dnl Here we must do something else
2372 dnl Maybe look for xdm-config in standard places, and
2373 dnl if that fails use a fresh copy in $KDEDIR/config/kdm/
2374 AC_FIND_FILE(xdm-config,/etc/X11/xdm /var/X11/xdm /usr/openwin/xdm /usr/X11R6/lib/X11/xdm,ac_xdmdir)
2375 if test -f $ac_xdmdir/xdm-config; then
2376 AC_MSG_RESULT($ac_xdmdir)
2378 if test "${prefix}" = NONE; then
2379 ac_xdmdir=$ac_default_prefix/config/kdm
2381 ac_xdmdir=$prefix/config/kdm
2383 AC_MSG_RESULT([xdm config dir not found, installing defaults in $ac_xdmdir])
2384 xdmconfigsubdir=xdmconfig
2385 AC_SUBST(xdmconfigsubdir)
2390 if test -f $ac_xdmdir/xdm-config; then
2391 AC_MSG_RESULT($ac_xdmdir)
2394 AC_MSG_RESULT([xdm config dir not found, installing defaults in $ac_xdmdir])
2395 xdmconfigsubdir=xdmconfig
2396 AC_SUBST(xdmconfigsubdir)
2399 AC_DEFINE_UNQUOTED(XDMDIR,"$ac_xdmdir")
2403 if test "x$no_pam" = "xyes"; then
2407 shadow_support="no" # if pam is installed, use it. We can't savely
2408 # test, if it works *sigh*
2412 [ --with-shadow If you want shadow password support ],
2413 [ if test "$withval" = "yes"; then
2414 shadow_support="yes"
2418 if test "$pam_support" = "yes" && test "$shadow_support=yes"; then
2419 AC_MSG_WARN("You can not define both pam AND shadow")
2422 [ if test -z "$shadow_support"; then shadow_support="no"; fi ] )
2424 if test "$pam_support" = "yes"; then
2425 AC_CHECK_LIB(pam, main, [PASSWDLIB="-lpam -ldl"
2426 AC_DEFINE_UNQUOTED(HAVE_PAM_LIB)],
2430 if test -z "$PASSWDLIB" && test "$shadow_support" = "yes"; then
2431 AC_CHECK_LIB(shadow, main,
2432 [ PASSWDLIB="-lshadow"
2433 AC_DEFINE_UNQUOTED(HAVE_SHADOW_LIB)
2437 AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for FreeBSD
2439 AC_CHECK_LIB(s, main, [LIB_LIBS="-ls"]) dnl for AIX
2441 AC_CHECK_LIB(Xdmcp, main, [LIBXDMCP="-lXdmcp"], , $X_LDFLAGS -lX11) dnl for Unixware
2444 if test -n "$LIBXDMCP"; then
2446 ac_cpp='$CXXCPP $CPPFLAGS $X_INCLUDES'
2447 AC_CHECK_HEADERS(X11/Xdmcp.h)